index.vue 59 KB

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