index.vue 59 KB

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