cart.vue 52 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982
  1. <template>
  2. <view class="container cart clearfix" v-if="hasLogin">
  3. <tui-skeleton v-if="skeletonShow" backgroundColor="#fafafa" borderRadius="10rpx" :isLoading ="true" :loadingType="5"></tui-skeleton>
  4. <view class="container-cart-main tui-skeleton" :style="{paddingTop:isshowDelbtn ? '0rpx':'80rpx'}">
  5. <view class="foot-check-delbtn" v-if="!isshowDelbtn && goodsList.length>0">
  6. <view class="foot-text">共<text>{{kindCount}}</text>件商品</view>
  7. <view class="delBtn" @tap.stop="showDelManager">删除</view>
  8. </view>
  9. <view v-if="!isEmpty" class="container-cart">
  10. <view class="cart-content" :style="{paddingBottom :isIphoneX ? '130rpx' : '100rpx'}">
  11. <view class="goods-list">
  12. <view v-for="(item, index) in goodsList" :key="index" class="goods-item clearfix">
  13. <view class="shoptitle">
  14. <!--选择商店的全部商品"-->
  15. <view class="checkbox-box" @click.stop="checkShop(item)">
  16. <view class="checkbox iconfont" :class="[item.checked ?'icon-yixuanze':'icon-weixuanze']"></view>
  17. </view>
  18. <view v-if="item.promotions" class="floor-item-act">
  19. <view class="floor-tags" @click.stop="clickPopupShow(item,2)">{{item.promotions.name}}</view>
  20. </view>
  21. <view class="text">{{item.name}}</view>
  22. <view class="text-coupon" @click="showPopup(0)">领券</view>
  23. </view>
  24. <view class="productlist">
  25. <view class="goods-pros" v-for="(pros,idx) in item.cartList" :key="idx" >
  26. <view class="goods-pros-t">
  27. <!--选择商品-->
  28. <view class="checkbox-box" @click.stop="ischeck(item,pros)">
  29. <view class="checkbox iconfont" :class="[pros.productsChecked ? 'icon-yixuanze':'icon-weixuanze']"></view>
  30. </view>
  31. <view class="pros-img" @click.stop="navToListPage(pros.productId)" ><image :src="pros.image ? pros.image:''" alt="" /></view>
  32. <view class="pros-product">
  33. <view class="producttitle" @click.stop="navToListPage(pros.productId)" >{{pros.name}}</view>
  34. <view class="productspec">规格:{{pros.unit ? pros.unit : ''}}</view>
  35. <view class="productprice">
  36. <!--使用过滤器对总价改变-->
  37. <view class="price" :class="PromotionsFormat(pros.promotions) ? 'disabled' : ''">
  38. <text>¥</text>
  39. {{ (PromotionsFormat(pros.promotions) ? pros.originalPrice : pros.price) | NumFormat }}
  40. </view>
  41. <view class="count" v-if="pros.validFlag == 2 " :class="[isshowDelbtn ? 'none':'show']">
  42. <text class="count-tips" v-if="pros.number<pros.min">起订量:{{pros.min}}</text>
  43. <text class="count-tips step" v-if="pros.isStep">购买量必须为起订量的整数倍</text>
  44. <view class="number-box">
  45. <view class="iconfont icon-jianhao" @click="changeCountSub(item,pros)"></view>
  46. <input class="btn-input" type="number" maxlength='4' v-model="pros.number" @blur="changeNnmber($event,item,pros)" @focus="changeInput(pros)">
  47. <view class="iconfont icon-jiahao" @click="changeCountAdd(item,pros)"></view>
  48. </view>
  49. </view>
  50. </view>
  51. <view v-show="pros.actStatus==1" class="floor-item-act">
  52. <view v-if="PromotionsFormat(pros.promotions)" class="floor-tags" @click.stop="clickPopupShow(pros,1)">
  53. {{pros.promotions.name}}
  54. <text v-if ="pros.promotions!=null && pros.promotions.type!=3">
  55. :¥{{ pros.promotions == null ? '0.00' : pros.promotions.touchPrice | NumFormat}}
  56. </text>
  57. </view>
  58. <view v-else-if="pros.promotions.type!=3" class="floor-tags" @click.stop="clickPopupShow(pros,2)">{{pros.promotions.name}}</view>
  59. </view>
  60. <view v-if="pros.actStatus == null && pros.ladderFlag == 1" class="floor-item-act">
  61. <view class="floor-tags" @click.stop="clickPopupShow(pros,2)">阶梯价格</view>
  62. </view>
  63. </view>
  64. </view>
  65. </view>
  66. </view>
  67. <view class="goods-pros-b clearfix" :class="[isshowDelbtn ? 'none':'show']" >
  68. <view class="sum-none" v-if="item.reducedPrice>0">
  69. <text class="money-sign">¥</text>
  70. <text class="money">{{ item.totalOriginalPrice | NumFormat }}</text>
  71. <text class="money-reduced">减<text>¥{{ item.reducedPrice | NumFormat}}</text></text>
  72. </view>
  73. <view class="sum">合计:<text class="money"><text class="money-sign">¥</text>{{item.totalPrice | NumFormat}}</text></view>
  74. </view>
  75. </view>
  76. </view>
  77. <view class="failure-list" v-if="failureList.length>0">
  78. <view class="failure-title">
  79. <view class="title-txt">失效商品<text>{{failureList.length}}件</text></view>
  80. <view class="title-btn" @click.stop="deletefailureList"><text class="butto">清空失效商品</text></view>
  81. </view>
  82. <view class="productlist">
  83. <view class="goods-pros" v-for="(failure,failureIdx) in failureList" :key="failureIdx" >
  84. <view class="goods-pros-t" @click.stop="failureToProduct(failure)">
  85. <!--选择商品-->
  86. <view class="checkbox-box" @click.stop="ischeckFailure(failure)" v-if="isshowDelbtn">
  87. <button class="checkbox iconfont"
  88. :class="[ failure.productsChecked ? 'icon-yixuanze':'icon-weixuanze']">
  89. </button>
  90. </view>
  91. <text class="img-tip">失效</text>
  92. <view class="pros-img">
  93. <image :src="failure.image ? failure.image:''" alt="" />
  94. </view>
  95. <view class="pros-product">
  96. <view class="producttitle">{{failure.name}}</view>
  97. <view class="productspec">规格:{{failure.unit ? failure.unit : ''}}</view>
  98. <view class="productstate">{{failureStateText(failure.status)}}</view>
  99. </view>
  100. <view class="pros-marks" v-if="failure.isFailureLayer"></view>
  101. </view>
  102. </view>
  103. </view>
  104. </view>
  105. </view>
  106. <!-- 脚部菜单 -->
  107. <view class="footer">
  108. <view class="footer-le">
  109. <view class="foot-check checkbox-box" @tap.stop="checkAll()">
  110. <button class="checkbox iconfont" :class="[isCheckAll?'icon-yixuanze':'icon-weixuanze']"></button>
  111. <view class="text">全选</view>
  112. </view>
  113. <view class="sum">
  114. <view class="sum-price" :class="reducedPrice == 0 ? 'none' : ''">
  115. 总价:<text class="money-sign">¥</text><text class="money">{{allPrice | NumFormat}}</text>
  116. </view>
  117. <view class="sum-none" v-if="reducedPrice>0">
  118. <!-- <text class="money-sign">¥</text> -->
  119. <!-- <text class="money">{{ totalOriginalPrice | NumFormat }}</text> -->
  120. <text class="money-reduced">共减<text>¥{{ reducedPrice | NumFormat}}</text></text>
  121. <text class="money-popup" @click="showPopup(1)">优惠明细<text class="iconfont icon-xiangshangjiantou"></text></text>
  122. </view>
  123. </view>
  124. </view>
  125. <view v-if="!isshowDelbtn" class="footer-ri" >
  126. <view class="btn hanld-btn" @tap="toConfirmation">去结算({{allCount}})</view>
  127. </view>
  128. <view v-else class="footer-del">
  129. <view class="btn btn-cancel" @tap.stop="hideDelManage">取消</view>
  130. <view class="btn btn-confirm" @tap.stop="deleteList">删除</view>
  131. </view>
  132. </view>
  133. </view>
  134. <view v-else class="cart-content empty">
  135. <view class="empty-container">
  136. <image class="empty-container-image" src="https://img.caimei365.com/group1/M00/03/71/Cmis2F3wna6AWdWzAAGlgAP0das422.png" mode="aspectFit"></image>
  137. <text class="error-text">购物车空空如也,快去商城逛逛吧~</text>
  138. <view class="login-btn" @click="goIndex">去商城</view>
  139. </view>
  140. </view>
  141. </view>
  142. <!-- 促销活动弹窗 -->
  143. <activi-popup :product="handlerPros" :popupShow="popupShow"></activi-popup>
  144. <!-- 透明模态层 -->
  145. <modal-layer v-if='modallayer'></modal-layer>
  146. <!-- 优惠券 -->
  147. <tui-bottom-popup :radius="true" :show="popupShow0" @close="hidePopup(0)">
  148. <view class="tui-popup-box clearfix">
  149. <view class="title">优惠券</view>
  150. <view class="tui-popup-close" @click="hidePopup(0)">
  151. <text class="iconfont icon-iconfontguanbi"></text>
  152. </view>
  153. <view class="tui-popup-tabs">
  154. <coupon-tabs :tabs="navbar"
  155. :currentTab="currentTab>2?0:currentTab"
  156. @change="couponChange"
  157. :itemWidth="(100/navbar.length)+'%'"
  158. selectedColor="#e15616"
  159. sliderBgColor="#e15616">
  160. </coupon-tabs>
  161. </view>
  162. <div class="tui-popup-main coupon">
  163. <scroll-view class="tui-popup-scroll" scroll-y="true">
  164. <view v-for="(coupon,index) in dataList" :key="index" :id="coupon.id" class="coupon-list">
  165. <view class="list-cell-le">
  166. <view class="coupon-maxMoney">
  167. <text class="small">¥</text>
  168. {{ coupon.maxMoney }}
  169. </view>
  170. <view class="coupon-minMoney">
  171. 满{{ coupon.minMoney }}可用
  172. </view>
  173. </view>
  174. <view class="list-cell-ri">
  175. <view class="list-cell-top">
  176. <view class="list-cell-type">
  177. <view class="list-cell-tags">
  178. <text class="tags">{{ coupon.couponType | TypeFormat }}</text>
  179. </view>
  180. <view class="list-cell-texts" :class="currentTab == 1 || currentTab == 2 ? 'none' : ''">
  181. <text v-if="coupon.useType == 1">{{ coupon.useType | TypeFormatText }}</text>
  182. <text v-if="coupon.useType == 2">{{ coupon.useType | TypeFormatText }}</text>
  183. <text v-if="coupon.useType == 3">{{ coupon.useType | TypeFormatText }}{{ coupon.couponText }}的商品</text>
  184. </view>
  185. </view>
  186. <view class="list-cell-btn">
  187. <view class="icon-used">
  188. <view class="icon-used-btn receive" v-if="currentTab == 0" @click="receiveCoupon(coupon)">领取</view>
  189. <view class="icon-used-btn make" v-if="currentTab == 1">已领取</view>
  190. </view>
  191. </view>
  192. </view>
  193. <view class="list-cell-time">{{ coupon.couponTime }}</view>
  194. </view>
  195. </view>
  196. </scroll-view>
  197. </div>
  198. </view>
  199. </tui-bottom-popup>
  200. <!-- 优惠明细 -->
  201. <tui-bottom-popup :radius="true" :show="popupShow1" @close="hidePopup(1)">
  202. <view class="tui-popup-box clearfix">
  203. <view class="title">优惠明细</view>
  204. <view class="tui-popup-close" @click="hidePopup(1)">
  205. <text class="iconfont icon-iconfontguanbi"></text>
  206. </view>
  207. <div class="tui-popup-main coupon">
  208. <view class="tui-popup-coupon">
  209. <view class="tui-popup-h1">
  210. <view class="tui-popup-text left">商品总额</view>
  211. <view class="tui-popup-text right bold">¥450.00</view>
  212. </view>
  213. <view class="tui-popup-h1">
  214. <view class="tui-popup-text left">促销满减</view>
  215. <view class="tui-popup-text right bold red">¥450.00</view>
  216. </view>
  217. <view class="tui-popup-h1">
  218. <view class="tui-popup-text left">优惠券</view>
  219. <view class="tui-popup-text right bold red">¥450.00</view>
  220. </view>
  221. <view class="tui-popup-h1">
  222. <view class="tui-popup-text left">共减</view>
  223. <view class="tui-popup-text right bold red">¥450.00</view>
  224. </view>
  225. <view class="tui-popup-h1">
  226. <view class="tui-popup-text left">总计</view>
  227. <view class="tui-popup-text right bold">¥450.00</view>
  228. </view>
  229. </view>
  230. </div>
  231. </view>
  232. </tui-bottom-popup>
  233. </view>
  234. </template>
  235. <script>
  236. import authorize from '@/common/config/authorize.js'
  237. import tuiSkeleton from "@/components/tui-skeleton/tui-skeleton"
  238. import tuiLoadmore from "@/components/tui-components/loadmore/loadmore"
  239. import tuiNomore from "@/components/tui-components/nomore/nomore"
  240. import activiPopup from "@/components/cm-module/productDetails/cm-activipopu"
  241. import couponTabs from '@/components/cm-module/coupon/tui-tabs.vue'
  242. import modalLayer from "@/components/modal-layer"
  243. import { mapState,mapMutations } from 'vuex';
  244. export default{
  245. components:{
  246. tuiSkeleton,
  247. tuiLoadmore,
  248. tuiNomore,
  249. activiPopup,
  250. couponTabs,
  251. modalLayer
  252. },
  253. data(){
  254. return{
  255. CustomBar:this.CustomBar,// 顶部导航栏高度
  256. isIphoneX:this.$store.state.isIphoneX,
  257. userID:'',
  258. alertType:'',
  259. isStock:'',
  260. handlerPros:{},//监听单挑促销商品
  261. failureList:[], //失效商品列表
  262. goodsList:[], //购物车的商品
  263. promotionsList:[],//促销列表
  264. delGoodsList:'',//要删除的商品
  265. setGoodData:'', //确认订单的商品
  266. isCheckAll:false,//是否全选
  267. kindCount:0,//购物车宝贝数量
  268. allPrice:0,//所有价格
  269. totalOriginalPrice:0,//所有原价价
  270. reducedPrice:0,//满减
  271. allCount:0,//被选中的产品数量
  272. isModallayer:false,
  273. skeletonShow:true,
  274. isshowDelbtn:false,
  275. isDisabled: false, // 供应商/店铺全选是否禁用状态
  276. isNoConfim:false,
  277. isEmpty:false,//显示空购物车
  278. scrollHeight: 'auto',
  279. nomoreText: '上拉显示更多',
  280. hasNextPage: false,
  281. loadding: false,
  282. pullUpOn: true,
  283. pullFlag: true,
  284. pageSize: 10,
  285. pageNum: 1,
  286. submitIds:[],
  287. popupShow:false,
  288. popupShow0:false,
  289. popupShow1:false,
  290. currentTab: 0,
  291. navbar: [
  292. { name: "未领取",num:3 },
  293. { name: "已领取",num:4 }
  294. ],
  295. dataList:[
  296. {
  297. maxMoney:5000,
  298. minMoney:1000,
  299. couponType:1,
  300. couponTime:'2021.06.28~2021.07.28',
  301. couponText:'华熙生物技术有限公司',
  302. useType:1,
  303. couponBtnType:0
  304. },
  305. {
  306. maxMoney:2000,
  307. minMoney:200,
  308. couponType:2,
  309. couponTime:'2021.06.28~2021.07.28',
  310. couponText:'华熙生物技术有限公司',
  311. useType:2,
  312. couponBtnType:0
  313. },
  314. {
  315. maxMoney:4000,
  316. minMoney:800,
  317. couponType:3,
  318. couponTime:'2021.06.28~2021.07.28',
  319. couponText:'华熙生物技术有限公司',
  320. useType:3,
  321. couponBtnType:0
  322. },
  323. {
  324. maxMoney:6000,
  325. minMoney:1000,
  326. couponType:4,
  327. couponTime:'2021.06.28~2021.07.28',
  328. couponText:'华熙生物技术有限公司',
  329. useType:1,
  330. couponBtnType:0
  331. },
  332. {
  333. maxMoney:6000,
  334. minMoney:1000,
  335. couponType:5,
  336. couponTime:'2021.06.28~2021.07.28',
  337. couponText:'华熙生物技术有限公司',
  338. useType:2,
  339. couponBtnType:0
  340. }
  341. ],
  342. }
  343. },
  344. onLoad(){
  345. this.setScrollHeight();
  346. },
  347. computed: {
  348. ...mapState(['hasLogin','userInfo','isWxAuthorize'])
  349. },
  350. filters:{
  351. NumFormat(value) {//处理金额
  352. return Number(value).toFixed(2);
  353. },
  354. totalprice(val,count){//单件商品的价格 × 数量
  355. return (val * count).toFixed(2)
  356. },
  357. TypeFormat:function(value) {
  358. switch (value) {
  359. case 1:
  360. return '活动券';
  361. break;
  362. case 2:
  363. return '品类券';
  364. break;
  365. case 3:
  366. return '店铺券';
  367. break;
  368. case 4:
  369. return '专享券';
  370. break;
  371. case 5:
  372. return '新用户券';
  373. break;
  374. }
  375. },
  376. TypeFormatText:function(value) {
  377. switch (value) {
  378. case 1:
  379. return '全商城商品通用';
  380. break;
  381. case 2:
  382. return '仅限购买仪器类商品';
  383. break;
  384. case 3:
  385. return '仅可购买店铺';
  386. break;
  387. }
  388. }
  389. },
  390. methods:{
  391. initData(){
  392. this.isModallayer = false //遮罩层 防止多次点击
  393. this.skeletonShow = true //预加载圆圈
  394. this.isCheckAll=false//是否全选
  395. this.submitIds = []
  396. this.$api.getStorage().then((resolve) => {
  397. this.userID = resolve.userId;
  398. this.initGetCartGoodsList();
  399. })
  400. },
  401. initLogin(){
  402. this.$api.redirectTo('/pages/login/login?type=4')
  403. },
  404. clickPopupShow(pros,type){
  405. this.popupShow = true;
  406. this.handlerPros = pros;
  407. },
  408. setScrollHeight() {
  409. // 窗口高度-footer高度
  410. const {windowHeight, pixelRatio} = uni.getSystemInfoSync();
  411. setTimeout(()=> {
  412. const query = uni.createSelectorQuery().in(this);
  413. query.selectAll('.footer').boundingClientRect();
  414. query.exec(res => {
  415. this.windowHeight = windowHeight;
  416. if(res[0][0]) {
  417. this.scrollHeight = windowHeight - res[0][0].height;
  418. }
  419. })
  420. }, 500)
  421. },
  422. initGetCartGoodsList(){//初始化购物车 index:1
  423. this.ProductService.QueryShoppingCartList({userId:this.userID}).then(response =>{
  424. this.skeletonShow = false
  425. let data = response.data
  426. this.kindCount = data.kindCount
  427. this.promotionsList = data.promotions
  428. this.$store.commit('updateAllNum',data.kindCount)
  429. if( data.list.length > 0 || data.invalid.length > 0){
  430. this.isEmpty =false
  431. }else{
  432. this.isEmpty =true
  433. }
  434. if(data.list && data.list.length > 0 ){
  435. this.goodsList = data.list;
  436. this.goodsList.forEach((item,index) => {
  437. item.cartList.forEach(pros => {
  438. pros.shopID = item.shopID;
  439. pros.isStep = false
  440. if(pros.step === 2){
  441. if(pros.number % pros.min != 0){
  442. pros.number = pros.min
  443. this.totalShopPeice()
  444. this.updateShoppogNum(pros)
  445. }
  446. }
  447. })
  448. })
  449. this.totalShopPeice()
  450. } else {
  451. this.goodsList = [];
  452. }
  453. if( data.invalid && data.invalid.length > 0){
  454. let newFailureList = [],isFailureLayer;
  455. data.invalid.forEach((failure,index) => {
  456. if(failure.status == 1 || failure.status == 2) {
  457. isFailureLayer = true
  458. }else{
  459. isFailureLayer = false
  460. }
  461. newFailureList.push(Object.assign({},failure,{isFailureLayer:isFailureLayer}))
  462. })
  463. this.failureList = newFailureList
  464. } else {
  465. this.failureList = [];
  466. }
  467. }).catch(error =>{
  468. this.$util.msg(error.msg,2000);
  469. })
  470. },
  471. ischeckFailure(failure){
  472. failure.productsChecked = !failure.productsChecked
  473. this.updateCheckAllBtn()
  474. },
  475. ischeck(item,pro){//为未选中的时候改变为true,反之为true
  476. pro.productsChecked = !pro.productsChecked;
  477. if(pro.productsChecked) {
  478. if(!this.submitIds.includes(pro.productID*1)){
  479. this.submitIds.push(pro.productID);
  480. }
  481. } else {
  482. var lent = this.submitIds.indexOf(pro.productID*1);
  483. if(lent >=0 ){
  484. this.submitIds.splice(lent, 1);
  485. }
  486. }
  487. this.updateProductCheckedAllBtn(item);
  488. this.updateCheckAllBtn();
  489. },
  490. updateProductCheckedAllBtn(item) {// 单独每个供应商的勾选判断
  491. let productsList = item.cartList,
  492. productsCheckedLength = 0,
  493. disabledLength = 0;
  494. if(this.isshowDelbtn) {
  495. productsList.forEach(pros => {
  496. if(pros.productsChecked) {
  497. productsCheckedLength++;
  498. }
  499. })
  500. } else {
  501. productsList.forEach(pros => {
  502. if(pros.productsChecked) {
  503. productsCheckedLength++;
  504. }
  505. })
  506. }
  507. item.checked = productsCheckedLength === productsList.length;
  508. },
  509. updateCheckAllBtn() {// 全选勾选判断
  510. let goodsCheckedLength = 0,
  511. goodsList = this.goodsList,
  512. failureList = this.failureList;
  513. goodsList.forEach(item => {
  514. if(item.checked) {
  515. goodsCheckedLength++;
  516. }
  517. })
  518. failureList.forEach(failureItem=>{
  519. if(failureItem.productsChecked){
  520. goodsCheckedLength++;
  521. }
  522. })
  523. if(this.isshowDelbtn){
  524. this.isCheckAll = goodsCheckedLength === goodsList.length + failureList.length;
  525. }else{
  526. this.isCheckAll = goodsCheckedLength === goodsList.length;
  527. }
  528. },
  529. checkShop(item){//与单选商品类似
  530. item.checked = !item.checked;
  531. this.setProductChecked(item);
  532. this.updateCheckAllBtn();
  533. },
  534. setProductChecked(item) {
  535. item.cartList.forEach(pros=>{
  536. if(item.checked) {
  537. pros.productsChecked = true;
  538. if(!this.submitIds.includes(pros.productId*1)){
  539. this.submitIds.push(pros.productId);
  540. }
  541. } else {
  542. pros.productsChecked = false;
  543. var lent = this.submitIds.indexOf(pros.productId*1);
  544. if(lent >=0 ){
  545. this.submitIds.splice(lent, 1);
  546. }
  547. }
  548. })
  549. },
  550. updateBothCheckBtn() {
  551. if(this.isshowDelbtn) {
  552. // 当管理删除按钮出现时,失效的商品可被选择
  553. this.goodsList.forEach((item)=>{
  554. item.checked = this.isCheckAll;
  555. this.setProductChecked(item);
  556. })
  557. //删除按钮 全选包括失效商品勾选
  558. this.failureList.forEach(failureItem=>{
  559. failureItem.productsChecked = this.isCheckAll;
  560. })
  561. } else {
  562. this.goodsList.forEach((item)=>{
  563. item.checked = this.isCheckAll && !item.isDisabled;
  564. this.setProductChecked(item);
  565. })
  566. }
  567. },
  568. checkAll(){//全选方法内调用方法
  569. this.isCheckAll = !this.isCheckAll;
  570. if(!this.isCheckAll){
  571. this.popupShow1 = false
  572. }
  573. this.updateBothCheckBtn();
  574. },
  575. totalShopPeice(){//每次所属会所下的商品增减重新计算合计价格&减去含有下架的商品
  576. let touchPrice = 0;
  577. let reducedPrice = 0;//商铺合计满减价
  578. this.goodsList.map((item,index)=>{
  579. //计算店铺满减后店铺合计
  580. if(item.promotions && item.promotions.mode == 2){
  581. let prosPrice=0;
  582. let totalOriginalPrice = 0;//商铺合计原价
  583. item.cartList.forEach(pros=>{
  584. prosPrice += pros.price*pros.number
  585. totalOriginalPrice += pros.originalPrice*pros.number
  586. })
  587. if(prosPrice >= item.promotions.touchPrice){
  588. item.totalPrice = prosPrice - item.promotions.reducedPrice
  589. item.reducedPrice = item.promotions.reducedPrice
  590. item.totalOriginalPrice = totalOriginalPrice
  591. }else{
  592. item.reducedPrice = 0 //统计合计价格
  593. item.totalPrice = prosPrice
  594. }
  595. }else{//以下为计算除店铺满减以外的单品满减以及正常商品合计
  596. let _totalPrice = 0;
  597. let _reducedPrice = 0;
  598. let _totalOriginalPrice =0;
  599. item.cartList.forEach(pros=>{
  600. let _price = pros.price*pros.number
  601. _totalOriginalPrice += pros.price*pros.number;
  602. if(pros.promotions && pros.promotions.type != 2 && pros.promotions.mode == 2){
  603. if(_price >= pros.promotions.touchPrice){
  604. _price = _price - pros.promotions.reducedPrice
  605. _reducedPrice += pros.promotions.reducedPrice
  606. }
  607. _totalPrice += _price
  608. }else{
  609. _reducedPrice = 0;
  610. _totalPrice += pros.price*pros.number;
  611. }
  612. })
  613. item.reducedPrice = _reducedPrice
  614. item.totalOriginalPrice = _totalOriginalPrice
  615. item.totalPrice = _totalPrice
  616. }
  617. })
  618. },
  619. totalPeice(){//计算总价格,每次调用此方法,将初始值为0,遍历价格并累加
  620. let totalPrice = 0;
  621. let reducedPrice = 0;
  622. let originalPrice = 0;
  623. this.goodsList.forEach((item,index)=>{
  624. let supplierPrice = 0;
  625. let supplierReducedPrice = 0;
  626. item.totalprice = 0;
  627. item.reducedprice = 0;
  628. item.originalprice = 0;
  629. item.cartList.forEach(pros=>{
  630. if(pros.productsChecked){
  631. supplierPrice += pros.price*pros.number;
  632. // 单品满减
  633. if(pros.promotions && pros.promotions.type*1===1 && pros.promotions.mode*1===2){
  634. // 单品满减-重新计算供应商总价/满减金额
  635. if(pros.price*pros.number >= pros.promotions.touchPrice){
  636. supplierPrice -= pros.promotions.reducedPrice;
  637. supplierReducedPrice += pros.promotions.reducedPrice;
  638. }
  639. }
  640. }
  641. })
  642. // 店铺满减
  643. if(item.promotions && item.promotions.mode*1===2){
  644. // 店铺满减-计算供应商总价/满减金额
  645. if(supplierPrice >= item.promotions.touchPrice){
  646. supplierPrice -= item.promotions.reducedPrice;
  647. supplierReducedPrice += item.promotions.reducedPrice;
  648. }
  649. }
  650. item.totalprice = supplierPrice;
  651. item.reducedprice = supplierReducedPrice;
  652. item.originalprice = (supplierPrice+supplierReducedPrice);
  653. totalPrice += item.totalprice;
  654. reducedPrice += item.reducedprice;
  655. originalPrice += item.originalprice;
  656. })
  657. //总促销计算
  658. this.promotionsList.forEach(promotions =>{
  659. // 凑单满减
  660. if(promotions.mode*1===2 && promotions.type*1===2){
  661. let total = 0;
  662. promotions.productList.forEach(pros=>{
  663. if (this.submitIds.includes(pros.productId*1)){
  664. total += pros.number * pros.price;
  665. }
  666. });
  667. if(total>=promotions.touchPrice){
  668. totalPrice -= promotions.reducedPrice;
  669. reducedPrice += promotions.reducedPrice;
  670. }
  671. }
  672. });
  673. //最后统计商品原价
  674. this.totalOriginalPrice = originalPrice;
  675. //最后满减金额 = 店铺减去金额 + 单品减去金额 + 凑单减去金额
  676. this.reducedPrice = reducedPrice;
  677. //最终合计价格 = 店铺满减合计 + 单品满减 + 正常合计 + 凑单满减
  678. this.allPrice = totalPrice ;
  679. },
  680. totalCount(){//计算总数量
  681. this.allCount = 0
  682. let prosAllCount=0
  683. let validCount = 0
  684. let validList =[];
  685. let productsList =[];
  686. this.goodsList.forEach(item=>{
  687. productsList = item.cartList
  688. productsList.forEach(pros=>{
  689. if(pros.productsChecked){
  690. prosAllCount+=parseInt(pros.number);
  691. this.allCount = prosAllCount
  692. }
  693. })
  694. })
  695. },
  696. changeCountAdd(item,pros){//商品数量加加
  697. if(pros.step === 2){
  698. pros.isStep = false
  699. pros.number += pros.min
  700. this.processActivityPrice(pros)
  701. this.isStock = false
  702. }else{
  703. pros.number++
  704. this.processActivityPrice(pros)
  705. this.isStock = false
  706. }
  707. this.updateShoppogNum(pros)
  708. this.totalShopPeice();
  709. },
  710. changeCountSub(item,pros){//商品数量减减
  711. if(pros.number<=pros.min){
  712. pros.number= pros.min
  713. this.$util.msg(`该商品最小起订量为${pros.min}`,2000);
  714. return
  715. }else{
  716. if(pros.step === 2){
  717. pros.isStep = false
  718. pros.number -= pros.min
  719. }else{
  720. pros.number--
  721. }
  722. this.processActivityPrice(pros)
  723. }
  724. this.updateShoppogNum(pros)
  725. this.totalShopPeice();
  726. },
  727. changeInput(pros){//输入商品数量更新
  728. pros.isStep = false
  729. },
  730. changeNnmber(e,item,pros){//输入商品数量更新
  731. let _value = Number(e.detail.value);
  732. if(!this.$api.isNumber(_value)){
  733. pros.number = pros.min
  734. }else if(_value < pros.min){
  735. this.$util.msg(`该商品最小起订量为${pros.min}`,2000);
  736. pros.number = pros.min
  737. }else if(_value % pros.min != 0){
  738. pros.isStep = true
  739. pros.number = pros.min
  740. }else{
  741. pros.isStep = false
  742. pros.number = e.detail.value
  743. this.processActivityPrice(pros)
  744. }
  745. this.updateShoppogNum(pros)
  746. this.totalShopPeice();
  747. },
  748. processActivityPrice(pros){//单独处理活动价格和阶梯价格
  749. let ladderPriceList = pros.ladderPrices;
  750. if(pros.ladderFlag == '0' || pros.actStatus == 1){
  751. pros.price = pros.price
  752. }else{
  753. ladderPriceList.forEach((item,index)=>{
  754. if(pros.number>=item.buyNum){
  755. pros.price = item.buyPrice
  756. }
  757. })
  758. }
  759. },
  760. updateShoppogNum(pros){//加减购物车商品更新到后台
  761. let params ={userID:this.userID,productID:pros.productId,productCount:pros.number}
  762. this.ProductService.ShoppingCartUpdate(params).then(response =>{
  763. this.isshowDelbtn = false;
  764. this.initGetCartGoodsList();
  765. }).catch(error =>{
  766. this.$util.msg(error.msg,2000);
  767. })
  768. },
  769. toConfirmation(){//跳转确认订单页面
  770. let setGoodsList=[];
  771. this.goodsList.forEach(res=>{
  772. let products = res.cartList
  773. products.forEach(pros=>{
  774. if(pros.productsChecked){
  775. setGoodsList.push(pros.productId)
  776. }
  777. })
  778. })
  779. if(setGoodsList == ''){
  780. this.$util.msg("请先选择结算商品~",2000);
  781. return
  782. }else{
  783. this.isNoConfim = false
  784. this.goodsList.forEach(el=>{
  785. el.cartList.forEach(pros=>{
  786. if(pros.productsChecked){
  787. if(pros.number<pros.min){
  788. this.isNoConfim = true
  789. }
  790. }
  791. })
  792. })
  793. if(this.isNoConfim){
  794. this.$util.modal('','有商品的购买量没达到最小起订量,请修改数量后再次提交结算','去修改','',false,() =>{})
  795. return;
  796. }
  797. let productID = '';
  798. this.goodsList.forEach(el=>{//获取勾选的商品ID拼接字符串逗号隔开,最后一个逗号去掉
  799. el.cartList.forEach(pros=>{
  800. if(pros.productsChecked){
  801. productID += pros.productId+','
  802. }
  803. })
  804. })
  805. let cartPramsData={
  806. allPrice:this.allPrice,
  807. allCount:this.allCount,
  808. productID:productID.substring(0,productID.lastIndexOf(',')),
  809. productCount:''
  810. }
  811. // 友盟埋点购物车去结算点击事件
  812. if(process.env.NODE_ENV != 'development'){
  813. this.$uma.trackEvent('Um_Event_shoppingCartConfirmOrder', {
  814. Um_Key_PageName: '去结算',
  815. Um_Key_SourcePage: '底部菜单购物车',
  816. })
  817. }
  818. this.$api.navigateTo(`/pages/user/order/create-order?data=${JSON.stringify({data:cartPramsData})}`)
  819. }
  820. },
  821. showDelManager(){//显示删除商品管理
  822. this.isshowDelbtn = true;
  823. if(this.isCheckAll) {
  824. this.updateBothCheckBtn();
  825. } else {
  826. this.goodsList.forEach(item => {
  827. if(item.checked) {
  828. item.cartList.forEach(pros => {
  829. pros.productsChecked = true;
  830. })
  831. }
  832. })
  833. this.updateCheckAllBtn();
  834. }
  835. // 失效也被勾选
  836. this.failureList.forEach(failureItem => {
  837. if(failureItem.isFailureLayer){
  838. failureItem.isFailureLayer = false
  839. }
  840. })
  841. },
  842. hideDelManage(){//隐藏删除商品管理
  843. this.isshowDelbtn = false;
  844. let isFailureLayer,newFailureList =[];
  845. if(this.isCheckAll) {
  846. this.updateBothCheckBtn();
  847. } else {
  848. // 失效商品取消勾选
  849. this.goodsList.forEach(item => {
  850. if(item.isDisabled) {
  851. item.checked = false;
  852. }
  853. item.cartList.forEach(pros => {
  854. if(pros.validFlag == 3) {
  855. pros.productsChecked = false;
  856. }
  857. })
  858. })
  859. this.updateCheckAllBtn();
  860. }
  861. this.failureList.forEach((failure,index) => {
  862. if(failure.failureState == 1 || failure.failureState == 2) {
  863. isFailureLayer = true
  864. }else{
  865. isFailureLayer = false
  866. }
  867. newFailureList.push(Object.assign({},failure,{isFailureLayer:isFailureLayer}))
  868. })
  869. this.failureList = newFailureList;
  870. },
  871. deleteList(){//删除购物车商品
  872. this.delGoodsList=[];
  873. this.goodsList.forEach(delitem=>{
  874. let products = delitem.cartList
  875. products.forEach(pros=>{
  876. if(pros.productsChecked){
  877. this.delGoodsList += pros.productId+','
  878. }
  879. })
  880. })
  881. this.failureList.forEach(failure=>{
  882. if(failure.productsChecked){
  883. this.delGoodsList += failure.productId+','
  884. }
  885. })
  886. if(this.delGoodsList.length == 0){
  887. this.$util.msg("请选择要删除的商品~",2000);
  888. return
  889. }else{
  890. this.$util.modal('','确定删除选中的商品吗?','确定','取消',true,() =>{
  891. this.ProductService.ShoppingCartDelete({userID:this.userID,productIDs:this.delGoodsList}).then(response =>{
  892. this.$util.msg('删除成功',2000);
  893. setTimeout(()=>{
  894. this.isshowDelbtn = false;
  895. this.initGetCartGoodsList();
  896. },2000)
  897. }).catch(error =>{
  898. this.$util.msg(error.msg,2000)
  899. })
  900. })
  901. }
  902. },
  903. deletefailureList(){
  904. this.failureList.forEach(failure=>{ this.delGoodsList += failure.productId+',' })
  905. this.$util.modal('','确定清空全部失效商品吗?','确定','取消',true,() =>{
  906. this.ProductService.ShoppingCartDelete({userID:this.userID,productIDs:this.delGoodsList}).then(response =>{
  907. this.$util.msg('删除成功',2000);
  908. setTimeout(()=>{
  909. this.isshowDelbtn = false;
  910. this.initGetCartGoodsList();
  911. },2000)
  912. }).catch(error =>{
  913. this.$util.msg(error.msg,2000)
  914. })
  915. })
  916. },
  917. goIndex(){
  918. uni.switchTab({
  919. url: '/pages/tabBar/home/index'
  920. });
  921. },
  922. goNavto(url){
  923. uni.navigateTo ({
  924. url
  925. })
  926. },
  927. navToListPage(id){
  928. this.isModallayer = true;
  929. this.$api.navigateTo(`/pages/goods/product?id=${id}`)
  930. },
  931. failureToProduct(failure){
  932. if(failure.status == 1){
  933. this.$util.msg('商品已丢失,不能查看',2000)
  934. return
  935. }else if(failure.status == 2){
  936. this.$util.msg('商品已停售,不能查看',2000)
  937. return
  938. }else{
  939. this.isModallayer = true;
  940. this.$api.navigateTo(`/pages/goods/product?id=${failure.productId}`)
  941. }
  942. },
  943. failureStateText(state){
  944. let stateText = '',
  945. stateTextObject={
  946. 1:'商品已丢失',
  947. 2:'商品已停售',
  948. 3:'商品已下架',
  949. 4:'商品已售罄',
  950. 5:'价格仅会员可见,您不能购买',
  951. 6:'未公开价格',
  952. 7:'库存不足'
  953. }
  954. Object.keys(stateTextObject).forEach(key => {
  955. if(key == state){
  956. stateText = stateTextObject[key]
  957. }
  958. })
  959. return stateText;
  960. },
  961. setHeaderBtnPosi(){
  962. // 获得胶囊按钮位置信息
  963. let headerBtnPosi = uni.getMenuButtonBoundingClientRect();
  964. return headerBtnPosi
  965. },
  966. setSysteminfo(){
  967. let systeminfo;
  968. uni.getSystemInfo({ // 获取设备信息
  969. success: (res) => {
  970. systeminfo = res
  971. },
  972. })
  973. return systeminfo
  974. },
  975. PromotionsFormat(promo){//促销活动类型数据处理
  976. if(promo!=null){
  977. if(promo.type == 1 && promo.mode == 1){
  978. return true
  979. }else{
  980. return false
  981. }
  982. }
  983. return false
  984. },
  985. showPopup(index){// 显示popup弹窗
  986. switch(index){
  987. case 0:
  988. this.popupShow0 = true
  989. break;
  990. case 1:
  991. this.popupShow1 = true
  992. break;
  993. }
  994. },
  995. hidePopup(index){// 隐藏popup弹窗
  996. switch(index){
  997. case 0:
  998. this.popupShow0 = false
  999. break;
  1000. case 1:
  1001. this.popupShow1 = false
  1002. break;
  1003. }
  1004. },
  1005. couponChange(e) {
  1006. this.currentTab = e.index
  1007. console.log('currentTab',this.currentTab)
  1008. switch(this.currentTab){
  1009. case 0:
  1010. this.listClass = 'list-used'
  1011. break;
  1012. case 1:
  1013. this.listClass = 'list-none'
  1014. break;
  1015. case 2:
  1016. this.listClass = 'list-none'
  1017. break;
  1018. }
  1019. },
  1020. },
  1021. watch:{//深度监听所有数据,每次改变重新计算总价和总数
  1022. goodsList:{
  1023. deep:true,
  1024. handler(val,oldval){
  1025. this.totalPeice()
  1026. this.totalCount()
  1027. }
  1028. }
  1029. },
  1030. onPullDownRefresh() {//下拉刷新
  1031. this.initGetCartGoodsList()
  1032. uni.stopPullDownRefresh()
  1033. },
  1034. onShow(){
  1035. if(this.hasLogin){
  1036. this.initData()
  1037. }else{
  1038. this.initLogin()
  1039. }
  1040. },
  1041. }
  1042. </script>
  1043. <style lang="scss">
  1044. page{
  1045. background: #f7f7f7;
  1046. height: auto;
  1047. }
  1048. .cart-content{
  1049. position: relative;
  1050. }
  1051. .container-cart-main.none{
  1052. display: none;
  1053. }
  1054. .container-cart-main.show{
  1055. display: block;
  1056. }
  1057. .cart-content.empty.none{
  1058. display: none;
  1059. }
  1060. .cart-content.empty.show{
  1061. display: block;
  1062. }
  1063. .container-cart.show{
  1064. display: block;
  1065. }
  1066. .container-cart.none{
  1067. display: none;
  1068. }
  1069. .empty-container.none{
  1070. display: none;
  1071. }
  1072. .empty-container.show{
  1073. display: flex;
  1074. }
  1075. .foot-check-delbtn{
  1076. width: 100%;
  1077. height: 80rpx;
  1078. position: fixed;
  1079. top: 0;
  1080. left: 0;
  1081. box-sizing: border-box;
  1082. padding: 15rpx 24rpx;
  1083. background-color: #F7F7F7;
  1084. z-index: 990;
  1085. .foot-text{
  1086. font-size: $font-size-26;
  1087. height: 50rpx;
  1088. line-height: 50rpx;
  1089. color:#666666;
  1090. float: left;
  1091. padding-left: 10rpx;
  1092. text{
  1093. margin: 0 6rpx;
  1094. }
  1095. }
  1096. .delBtn{
  1097. width: 100rpx;
  1098. display: inline-block;
  1099. padding: 0 15rpx;
  1100. font-size: $font-size-26;
  1101. height: 50rpx;
  1102. line-height: 50rpx;
  1103. border-radius: 30rpx;
  1104. background:#FFFFFF;
  1105. border: 1px solid #e15616;
  1106. color: #E15616;
  1107. float: right;
  1108. text-align: center;
  1109. &.none{
  1110. display: none;
  1111. }
  1112. }
  1113. }
  1114. .checkbox-box{
  1115. display: flex;
  1116. align-items: center;
  1117. .checkbox{
  1118. display: flex;
  1119. margin: 0;
  1120. padding: 5rpx;
  1121. display: flex;
  1122. flex-direction: column;
  1123. align-items: center;
  1124. box-sizing: border-box;
  1125. text-align: center;
  1126. text-decoration: none;
  1127. border-radius: 0;
  1128. -webkit-tap-highlight-color: transparent;
  1129. overflow: hidden;
  1130. background-color:#FFFFFF;
  1131. font-size: 36rpx;
  1132. color:#999999;
  1133. &.icon-yixuanze{
  1134. color: $color-system;
  1135. }
  1136. }
  1137. &.disabled{
  1138. .checkbox{
  1139. color:#999999
  1140. }
  1141. }
  1142. .text{
  1143. font-size: $font-size-24;
  1144. margin-left: 10rpx;
  1145. }
  1146. }
  1147. .goods-list{
  1148. width: 100%;
  1149. height: auto;
  1150. background-color: #F7F7F7;
  1151. .goods-item{
  1152. width: 702rpx;
  1153. padding: 0 24rpx;
  1154. background: #FFFFFF;
  1155. margin-bottom: 24rpx;
  1156. }
  1157. .shoptitle{
  1158. height: 80rpx;
  1159. line-height: 80rpx;
  1160. .checkbox-box{
  1161. float: left;
  1162. height: 80rpx;
  1163. line-height: 80rpx;
  1164. display: inline-block;
  1165. box-sizing: border-box;
  1166. margin-left: 10rpx;
  1167. }
  1168. .text{
  1169. width: 400rpx;
  1170. float: left;
  1171. display: block;
  1172. overflow: hidden;
  1173. text-overflow:ellipsis;
  1174. white-space: nowrap;
  1175. line-height: 80rpx;
  1176. margin-left: 20rpx;
  1177. font-size: $font-size-28;
  1178. color: $text-color;
  1179. text-align: left;
  1180. font-weight: bold;
  1181. }
  1182. .text-coupon{
  1183. float: right;
  1184. line-height: 80rpx;
  1185. font-size: $font-size-30;
  1186. color: #e15616;
  1187. }
  1188. .floor-item-act{
  1189. width: 120rpx;
  1190. height: 80rpx;
  1191. text-align: center;
  1192. box-sizing: border-box;
  1193. float: left;
  1194. padding: 24rpx 0;
  1195. margin-left: 20rpx;
  1196. .floor-tags{
  1197. height: 28rpx;
  1198. border-radius: 6rpx;
  1199. background-color: #FFFFFF;
  1200. line-height: 28rpx;
  1201. color: $color-system;
  1202. text-align: center;
  1203. display: inline-block;
  1204. padding:0 16rpx;
  1205. font-size: $font-size-20;
  1206. border: 1px solid #E15616;
  1207. float: right;
  1208. }
  1209. }
  1210. }
  1211. .goods-pros{
  1212. width: 100%;
  1213. height: auto;
  1214. margin-bottom: 20rpx;
  1215. }
  1216. .goods-pros-t{
  1217. display: flex;
  1218. align-items: center;
  1219. width: 100%;
  1220. height: 210rpx;
  1221. padding:0 0 26rpx 0;
  1222. .checkbox-box{
  1223. padding: 10rpx;
  1224. }
  1225. .pros-img{
  1226. width: 210rpx;
  1227. height: 100%;
  1228. border-radius: 10rpx;
  1229. margin:0 20rpx;
  1230. border:1px solid #f3f3f3;
  1231. image{
  1232. width: 100%;
  1233. height: 100%;
  1234. border-radius: 10rpx;
  1235. }
  1236. }
  1237. }
  1238. .goods-pros-b{
  1239. width:100%;
  1240. height: auto;
  1241. padding:0 0 24rpx 0;
  1242. box-sizing: border-box;
  1243. &.show{
  1244. display: block;
  1245. }
  1246. &.none{
  1247. display: none;
  1248. }
  1249. .sum-none{
  1250. width: 100%;
  1251. height: 48rpx;
  1252. line-height: 48rpx;
  1253. color: $text-color;
  1254. float: left;
  1255. text-align: right;
  1256. .money{
  1257. font-size: $font-size-26;
  1258. color: #999999;
  1259. text-decoration: line-through;
  1260. }
  1261. .money-sign{
  1262. font-size: $font-size-26;
  1263. color: #999999;
  1264. text-decoration: line-through;
  1265. }
  1266. .money-reduced{
  1267. margin-left: 10rpx;
  1268. font-size: $font-size-26;
  1269. color: $color-system;
  1270. .iconfont{
  1271. font-size: $font-size-34;
  1272. }
  1273. }
  1274. }
  1275. .sum{
  1276. width: 100%;
  1277. height: 40rpx;
  1278. font-size: $font-size-26;
  1279. line-height: 40rpx;
  1280. color: $text-color;
  1281. float: left;
  1282. display: flex;
  1283. justify-content: flex-end;
  1284. font-weight: bold;
  1285. .money{
  1286. color: #FF2A2A;
  1287. font-size: $font-size-26;
  1288. }
  1289. .money-sign{
  1290. font-size: $font-size-24;
  1291. color: #FF2A2A;
  1292. }
  1293. }
  1294. }
  1295. .pros-product{
  1296. width: 416rpx;
  1297. height: 100%;
  1298. line-height: 36rpx;
  1299. font-size: $font-size-28;
  1300. position: relative;
  1301. .producttitle{
  1302. width: 100%;
  1303. display: inline-block;
  1304. height: auto;
  1305. text-overflow:ellipsis;
  1306. display: -webkit-box;
  1307. word-break: break-all;
  1308. -webkit-box-orient: vertical;
  1309. -webkit-line-clamp: 2;
  1310. overflow: hidden;
  1311. margin-bottom: 15rpx;
  1312. .no-text{
  1313. display: inline-block;
  1314. height:36rpx;
  1315. padding: 0 12rpx;
  1316. line-height: 36rpx;
  1317. background:linear-gradient(315deg,rgba(231,0,0,1) 0%,rgba(255,104,1,1) 100%);
  1318. border-radius:18rpx;
  1319. text-align: center;
  1320. color: #FFFFFF;
  1321. font-size:$font-size-28;
  1322. margin-right: 24rpx;
  1323. }
  1324. }
  1325. .productspec{
  1326. height: 36rpx;
  1327. color: #999999;
  1328. font-size: $font-size-26;
  1329. }
  1330. .productprice{
  1331. width: 100%;
  1332. height: 48rpx;
  1333. margin: 30rpx 0 0 0;
  1334. .price{
  1335. line-height: 48rpx;
  1336. font-size: $font-size-26;
  1337. width: 48%;
  1338. color: #FF2A2A;
  1339. float: left;
  1340. font-weight: bold;
  1341. &.disabled{
  1342. color: #999999;
  1343. text-decoration: line-through;
  1344. }
  1345. .money-sign{
  1346. font-size: $font-size-24;
  1347. color: #FF2A2A;
  1348. }
  1349. }
  1350. .count{
  1351. height: 100%;
  1352. float: right;
  1353. position: relative;
  1354. &.show{
  1355. display: block;
  1356. }
  1357. &.none{
  1358. display: none;
  1359. }
  1360. .count-tips{
  1361. width: auto;
  1362. display: inline-block;
  1363. padding: 0 15rpx;
  1364. line-height: 44rpx;
  1365. height: 44rpx;
  1366. border-radius: 22rpx;
  1367. background: $btn-confirm;
  1368. font-size: $font-size-24;
  1369. text-align: center;
  1370. color: #FFFFFF;
  1371. position: absolute;
  1372. top:-60rpx;
  1373. left: -5rpx;
  1374. z-index: 5;
  1375. &.step{
  1376. left:-217rpx
  1377. }
  1378. &::before{
  1379. content: "";
  1380. position: absolute;
  1381. bottom: -30rpx;
  1382. right: 15rpx;
  1383. z-index:1;
  1384. width: 0;
  1385. height: 0;
  1386. border-width: 18rpx;
  1387. border-style: solid;
  1388. border-color:$color-system transparent transparent transparent;
  1389. }
  1390. }
  1391. .number-box{
  1392. display: flex;
  1393. justify-content: center;
  1394. align-items: center;
  1395. border: 2rpx solid #ffe6dc;
  1396. border-radius: 30rpx;
  1397. .iconfont{
  1398. font-size: $font-size-24;
  1399. padding:0 18rpx;
  1400. color: #999999;
  1401. text-align: center;
  1402. line-height: 48rpx;
  1403. font-weight: bold;
  1404. background: #fef6f3;
  1405. &.icon-jianhao{
  1406. border-radius: 30rpx 0 0 30rpx;
  1407. }
  1408. &.icon-jiahao{
  1409. border-radius: 0 30rpx 30rpx 0;
  1410. }
  1411. }
  1412. .btn-input{
  1413. width: 62rpx;
  1414. height: 48rpx;
  1415. line-height: 48rpx;
  1416. background: #fff;
  1417. border-radius: 4rpx;
  1418. text-align: center;
  1419. font-size: $font-size-24;
  1420. }
  1421. }
  1422. .uni-numbox{
  1423. position: absolute;
  1424. left: 45rpx;
  1425. bottom: 0;
  1426. .uni-numbox-minus, .uni-numbox-plus{
  1427. width: 50rpx;
  1428. line-height: 40rpx;
  1429. }
  1430. .uni-numbox-value {
  1431. font-size: $font-size-28;
  1432. width: 60rpx;
  1433. }
  1434. }
  1435. }
  1436. }
  1437. .floor-item-act{
  1438. width: 100%;
  1439. height: 56rpx;
  1440. text-align: center;
  1441. box-sizing: border-box;
  1442. float: left;
  1443. padding:0 0 10rpx 0;
  1444. margin-left: 10rpx;
  1445. .floor-tags{
  1446. height: 28rpx;
  1447. border-radius: 6rpx;
  1448. background-color: #FFFFFF;
  1449. line-height: 28rpx;
  1450. color: $color-system;
  1451. text-align: center;
  1452. display: inline-block;
  1453. padding:0 16rpx;
  1454. font-size: $font-size-20;
  1455. border: 1px solid #E15616;
  1456. float: left;
  1457. }
  1458. }
  1459. }
  1460. }
  1461. .failure-list{
  1462. width: 702rpx;
  1463. height: auto;
  1464. padding: 0 24rpx;
  1465. margin-top: 20rpx;
  1466. background: #FFFFFF;
  1467. .failure-title{
  1468. width: 100%;
  1469. height: 82rpx;
  1470. line-height: 82rpx;
  1471. font-size: $font-size-28;
  1472. border-bottom: 1px solid #EBEBEB;
  1473. .title-txt{
  1474. float: left;
  1475. color:#666666;
  1476. text-align: left;
  1477. }
  1478. .title-btn{
  1479. float: right;
  1480. color: $color-system;
  1481. text-align: right;
  1482. line-height: 80rpx;
  1483. .butto{
  1484. display: inline-block;
  1485. padding: 0 15rpx;
  1486. font-size: $font-size-26;
  1487. height: 50rpx;
  1488. line-height: 50rpx;
  1489. border-radius: 30rpx;
  1490. background:#FFFFFF;
  1491. // border: 1px solid #C9C9C9;
  1492. // color: #999999;
  1493. margin-top: 15rpx;
  1494. }
  1495. }
  1496. }
  1497. .productlist{
  1498. padding-top: 10rpx;
  1499. .goods-pros{
  1500. width: 100%;
  1501. height: auto;
  1502. padding: 20rpx 0;
  1503. }
  1504. .goods-pros-t{
  1505. display: flex;
  1506. align-items: center;
  1507. width: 100%;
  1508. height: 210rpx;
  1509. position: relative;
  1510. .img-tip{
  1511. display: block;
  1512. width: 72rpx;
  1513. height: 36rpx;
  1514. line-height: 36rpx;
  1515. font-size: $font-size-24;
  1516. text-align: center;
  1517. color: #FFFFFF;
  1518. border-radius: 24rpx;
  1519. background:rgba(51,51,51,0.3);
  1520. // position: absolute;
  1521. // left: 0;
  1522. // top: 0;
  1523. }
  1524. .checkbox-box{
  1525. padding: 10rpx;
  1526. }
  1527. .pros-img{
  1528. width: 180rpx;
  1529. height: 100%;
  1530. border-radius: 10rpx;
  1531. margin:0 20rpx;
  1532. border:1px solid #f3f3f3;
  1533. position: relative;
  1534. image{
  1535. width: 100%;
  1536. height: 100%;
  1537. border-radius: 10rpx;
  1538. }
  1539. }
  1540. .pros-marks{
  1541. width: 730rpx; height: 250rpx;
  1542. z-index: 90;
  1543. background: rgba(0,0,0,.05);
  1544. position: absolute;
  1545. left:-20rpx;
  1546. top: -20rpx;
  1547. }
  1548. }
  1549. .goods-pros-b{
  1550. width:622rpx;
  1551. margin-left: 84rpx;
  1552. height: 40rpx;
  1553. padding:0 0 26rpx 0;
  1554. // border-top: 1px solid #EBEBEB;
  1555. &.show{
  1556. display: block;
  1557. }
  1558. &.none{
  1559. display: none;
  1560. }
  1561. .sum{
  1562. font-size: $font-size-28;
  1563. line-height: 40rpx;
  1564. color: $text-color;
  1565. display: flex;
  1566. justify-content: flex-end;
  1567. .money{
  1568. color: #FF2A2A;
  1569. font-size: $font-size-28;
  1570. }
  1571. .money-sign{
  1572. font-size: $font-size-24;
  1573. color: #FF2A2A;
  1574. }
  1575. }
  1576. }
  1577. .pros-product{
  1578. width: 402rpx;
  1579. height: 100%;
  1580. line-height: 36rpx;
  1581. font-size: $font-size-28;
  1582. position: relative;
  1583. .producttitle{
  1584. width: 100%;
  1585. display: inline-block;
  1586. height: auto;
  1587. text-overflow:ellipsis;
  1588. display: -webkit-box;
  1589. word-break: break-all;
  1590. -webkit-box-orient: vertical;
  1591. -webkit-line-clamp: 2;
  1592. overflow: hidden;
  1593. margin-bottom: 8rpx;
  1594. .no-text{
  1595. display: inline-block;
  1596. height:36rpx;
  1597. padding: 0 12rpx;
  1598. line-height: 36rpx;
  1599. background:linear-gradient(315deg,rgba(231,0,0,1) 0%,rgba(255,104,1,1) 100%);
  1600. border-radius:18rpx;
  1601. text-align: center;
  1602. color: #FFFFFF;
  1603. font-size: $font-size-28;
  1604. margin-right: 24rpx;
  1605. }
  1606. }
  1607. .productspec{
  1608. height: 36rpx;
  1609. color: #999999;
  1610. font-size: $font-size-26;
  1611. margin-top: 20rpx;
  1612. }
  1613. .productstate{
  1614. font-size: $font-size-28;
  1615. height: 44rpx;
  1616. color: #FF2A2A;
  1617. position: absolute;
  1618. bottom: 0;
  1619. left: 0;
  1620. }
  1621. }
  1622. }
  1623. }
  1624. .tui-popup-box {
  1625. position: relative;
  1626. box-sizing: border-box;
  1627. min-height: 220rpx;
  1628. padding:24rpx 24rpx 0 24rpx;
  1629. .tui-popup-close{
  1630. width: 90rpx;
  1631. height: 90rpx;
  1632. position: absolute;
  1633. right: 0;
  1634. top: 24rpx;
  1635. line-height: 90rpx;
  1636. text-align: center;
  1637. color: #b2b2b2;
  1638. .icon-iconfontguanbi{
  1639. font-size: $font-size-40;
  1640. }
  1641. }
  1642. .title{
  1643. font-size: $font-size-34;
  1644. color: $text-color;
  1645. line-height: 88rpx;
  1646. text-align: center;
  1647. float: left;
  1648. width: 100%;
  1649. height: 88rpx;
  1650. font-weight: bold;
  1651. }
  1652. .tui-popup-main{
  1653. width: 100%;
  1654. float: left;
  1655. &.coupon{
  1656. padding-bottom: 24rpx;
  1657. }
  1658. .tui-popup-scroll{
  1659. width: 100%;
  1660. height: 500rpx;
  1661. .coupon-list{
  1662. width: 100%;
  1663. height: 200rpx;
  1664. margin-top: 24rpx;
  1665. box-sizing: border-box;
  1666. background: url(https://static.caimei365.com/app/img/icon/icon-coupon-uesb@2x.png);
  1667. background-size: cover;
  1668. .list-cell-le{
  1669. width: 224rpx;
  1670. height: 100%;
  1671. box-sizing: border-box;
  1672. padding: 37rpx 0;
  1673. float: left;
  1674. .coupon-maxMoney{
  1675. width: 100%;
  1676. height: 78rpx;
  1677. line-height: 78rpx;
  1678. font-size: 56rpx;
  1679. color: #FFFFFF;
  1680. text-align: center;
  1681. .small{
  1682. font-size: $font-size-24;
  1683. }
  1684. }
  1685. .coupon-minMoney{
  1686. width: 100%;
  1687. height: 33rpx;
  1688. line-height: 33rpx;
  1689. font-size: $font-size-24;
  1690. color: #FFFFFF;
  1691. text-align: center;
  1692. }
  1693. }
  1694. .list-cell-ri{
  1695. width: 478rpx;
  1696. height: 100%;
  1697. box-sizing: border-box;
  1698. padding: 20rpx 24rpx 0 24rpx;
  1699. float: right;
  1700. .list-cell-top{
  1701. width: 100%;
  1702. height: 121rpx;
  1703. float: left;
  1704. border-bottom: 1px solid #e1e1e1;
  1705. .list-cell-type{
  1706. width: 286rpx;
  1707. height: 100%;
  1708. float: left;
  1709. .list-cell-tags{
  1710. width: 100%;
  1711. height: 32rpx;
  1712. margin-bottom: 7rpx;
  1713. .tags{
  1714. display: inline-block;
  1715. padding: 0 10rpx;
  1716. height: 32rpx;
  1717. line-height: 32rpx;
  1718. background-color: #ffdcce;
  1719. color: #f94b4b;
  1720. font-size: $font-size-20;
  1721. border-radius: 8rpx;
  1722. text-align: center;
  1723. float: left;
  1724. }
  1725. }
  1726. .list-cell-texts{
  1727. width: 100%;
  1728. height: auto;
  1729. line-height:35rpx;
  1730. text-overflow:ellipsis;
  1731. display: -webkit-box;
  1732. word-break: break-all;
  1733. -webkit-box-orient: vertical;
  1734. -webkit-line-clamp: 2;
  1735. overflow: hidden;
  1736. font-size: 26rpx;
  1737. color: #333333;
  1738. }
  1739. }
  1740. .list-cell-btn{
  1741. width: 128rpx;
  1742. height: 100%;
  1743. float: right;
  1744. .icon-used{
  1745. width: 100%;
  1746. height: 100%;
  1747. box-sizing: border-box;
  1748. padding-top: 57rpx;
  1749. .icon-used-btn{
  1750. width: 128rpx;
  1751. height: 48rpx;
  1752. border-radius: 28rpx;
  1753. line-height: 48rpx;
  1754. font-size: $font-size-26;
  1755. text-align: center;
  1756. &.receive{
  1757. background-image: linear-gradient(270deg, #f94b4b 0%, #feb673 100%);;
  1758. color: #FFFFFF;
  1759. }
  1760. &.make{
  1761. border: solid 1px #f94b4b;
  1762. color: #f94b4b;
  1763. }
  1764. }
  1765. }
  1766. }
  1767. }
  1768. .list-cell-time{
  1769. width: 100%;
  1770. height: 58rpx;
  1771. line-height: 58rpx;
  1772. text-align: left;
  1773. font-size: $font-size-20;
  1774. color: #999999;
  1775. }
  1776. }
  1777. }
  1778. }
  1779. .tui-popup-coupon{
  1780. width: 100%;
  1781. height: 500rpx;
  1782. box-sizing: border-box;
  1783. padding:30rpx 20rpx;
  1784. .tui-popup-h1{
  1785. width: 100%;
  1786. height: 66rpx;
  1787. display: flex;
  1788. align-items: center;
  1789. .tui-popup-text{
  1790. flex: 1;
  1791. height: 66rpx;
  1792. line-height: 66rpx;
  1793. font-size: $font-size-30;
  1794. color: #333333;
  1795. &.red{
  1796. color: #f94b4b;
  1797. }
  1798. &.bold{
  1799. font-weight: bold;
  1800. }
  1801. &.left{
  1802. text-align: left;
  1803. }
  1804. &.right{
  1805. text-align: right;
  1806. }
  1807. }
  1808. }
  1809. }
  1810. }
  1811. }
  1812. .footer{
  1813. width: 100%;
  1814. background-color: #FFFFFF;
  1815. height: 110rpx;
  1816. position: fixed;
  1817. bottom: 0rpx;
  1818. z-index: 1009;
  1819. .footer-le{
  1820. width: 520rpx;
  1821. height: 100%;
  1822. padding-left: 24rpx;
  1823. float: left;
  1824. box-sizing: border-box;
  1825. .foot-check{
  1826. width: 100rpx;
  1827. float: left;
  1828. line-height: 110rpx;
  1829. font-size: $font-size-24;
  1830. .checkbox{
  1831. width: 40rpx;
  1832. text-align: center;
  1833. }
  1834. .text{
  1835. width: 60rpx;
  1836. float: right;
  1837. }
  1838. }
  1839. .sum{
  1840. width: 360rpx;
  1841. height: 110rpx;
  1842. float: right;
  1843. box-sizing: border-box;
  1844. padding: 10rpx;
  1845. .sum-none{
  1846. width: 100%;
  1847. height: 45rpx;
  1848. line-height: 45rpx;
  1849. color: $text-color;
  1850. float: left;
  1851. text-align: left;
  1852. .money{
  1853. font-size: $font-size-24;
  1854. color: #999999;
  1855. text-decoration: line-through;
  1856. }
  1857. .money-sign{
  1858. font-size: $font-size-24;
  1859. color: #999999;
  1860. text-decoration: line-through;
  1861. }
  1862. .money-reduced{
  1863. margin-left: 10rpx;
  1864. font-size: $font-size-24;
  1865. color: #FF2A2A;
  1866. }
  1867. .money-popup{
  1868. height: 45rpx;
  1869. line-height: 45rpx;
  1870. display: inline-block;
  1871. float: right;
  1872. font-size: $font-size-24;
  1873. color: #FF2A2A;
  1874. .icon-xiangshangjiantou{
  1875. font-size: $font-size-30;
  1876. margin-left: 5rpx;
  1877. }
  1878. }
  1879. }
  1880. .sum-price{
  1881. width: 100%;
  1882. height: 45rpx;
  1883. line-height: 45rpx;
  1884. font-size: $font-size-30;
  1885. color: $text-color;
  1886. float: left;
  1887. font-weight: normal;
  1888. text-align: left;
  1889. &.none{
  1890. height: 90rpx;
  1891. line-height: 90rpx;
  1892. }
  1893. .money{
  1894. color: #FF2A2A;
  1895. }
  1896. .money-sign{
  1897. font-size: $font-size-24;
  1898. color: #FF2A2A;
  1899. }
  1900. }
  1901. }
  1902. }
  1903. .footer-ri{
  1904. width: 230rpx;
  1905. height: 100%;
  1906. float: right;
  1907. display: flex;
  1908. justify-content: space-between;
  1909. align-items: center;
  1910. z-index: 999;
  1911. box-sizing: border-box;
  1912. padding: 13rpx 15rpx 13rpx 5rpx;
  1913. &.none{
  1914. display: none;
  1915. }
  1916. .btn{
  1917. width: 200rpx;
  1918. height: 100%;
  1919. background:linear-gradient(135deg,rgba(242,143,49,1) 0%,rgba(225,86,22,1) 100%);
  1920. font-size: $font-size-28;
  1921. line-height: 84rpx;
  1922. color: #FFFFFF;
  1923. display: flex;
  1924. border-radius: 42rpx;
  1925. justify-content: center;
  1926. align-items: center;
  1927. }
  1928. }
  1929. .footer-del{
  1930. width: 400rpx;
  1931. height: 110rpx;
  1932. position: absolute;
  1933. padding-left: 200rpx;
  1934. background: #FFFFFF;
  1935. right: 0;
  1936. top: 0;
  1937. z-index: 1000;
  1938. &.show{
  1939. animation: showDelbtn 0s linear both;
  1940. }
  1941. &.none{
  1942. animation: hideDelbtn 0s linear both;
  1943. }
  1944. .btn{
  1945. width: 50%;
  1946. height: 100%;
  1947. line-height: 110rpx;
  1948. font-size: $font-size-28;
  1949. color: #FFFFFF;
  1950. text-align: center;
  1951. float: left;
  1952. }
  1953. .btn.btn-cancel{
  1954. background:#EEC1AB;
  1955. }
  1956. .btn.btn-confirm{
  1957. background:#FF2A2A;
  1958. }
  1959. @keyframes showDelbtn {
  1960. 0% {
  1961. transform: translateX(0);
  1962. }
  1963. 100% {
  1964. transform: translateX(-100%);
  1965. }
  1966. }
  1967. @keyframes hideDelbtn {
  1968. 0% {
  1969. transform: translateX(-100%);
  1970. }
  1971. 100% {
  1972. transform: translateX(0);
  1973. }
  1974. }
  1975. }
  1976. }
  1977. </style>