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">¥{{ allPrice | 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. >¥{{ (allPrice - 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. allPrice: 0, // 所有价格
  479. totalOriginalPrice: 0, // 所有原价价
  480. reducedPrice: 0, // 满减
  481. couponPrice: 0, // 优惠金额
  482. totalDiscountAmount: 0, // 总共减去金额
  483. isDiscount: false, // 控制显示优惠明细
  484. allCount: 0, // 被选中的产品数量
  485. isModallayer: false,
  486. skeletonShow: true,
  487. isshowDelbtn: false,
  488. isDisabled: false, // 供应商/店铺全选是否禁用状态
  489. isNoConfim: false,
  490. isEmpty: false, // 显示空购物车
  491. scrollHeight: 'auto',
  492. nomoreText: '上拉显示更多',
  493. hasNextPage: false,
  494. loadding: false,
  495. pullUpOn: true,
  496. pullFlag: true,
  497. pageSize: 10,
  498. pageNum: 1,
  499. submitIds: [],
  500. popupShow: false,
  501. popupShow0: false,
  502. popupShow1: false,
  503. currentTab: 1,
  504. navbar: [{ name: '未领取', num: 0 }, { name: '已领取', num: 0 }],
  505. couponParam: {
  506. // 获取弹窗优惠券领取参数
  507. userId: 0,
  508. shopId: 0,
  509. status: 1,
  510. source: 2
  511. },
  512. productCouponList: [], // 优惠券弹窗列表
  513. isCouponEmpty: false
  514. }
  515. },
  516. created() {
  517. this.setScrollHeight()
  518. console.log('pathType', this.pathType)
  519. },
  520. computed: {
  521. ...mapState(['hasLogin', 'userInfo', 'isWxAuthorize'])
  522. },
  523. watch: {
  524. //深度监听所有数据,每次改变重新计算总价和总数
  525. goodsList: {
  526. deep: true,
  527. handler(val, oldval) {
  528. this.totalPeice()
  529. this.totalCount()
  530. }
  531. }
  532. },
  533. filters: {
  534. NumFormat(value) {
  535. //处理金额
  536. return Number(value).toFixed(2)
  537. },
  538. totalprice(val, count) {
  539. //单件商品的价格 × 数量
  540. return (val * count).toFixed(2)
  541. },
  542. TypeFormat(value) {
  543. switch (value) {
  544. case 0:
  545. return '活动券'
  546. break
  547. case 1:
  548. return '品类券'
  549. break
  550. case 2:
  551. return '用户专享券'
  552. break
  553. case 3:
  554. return '店铺券'
  555. break
  556. case 4:
  557. return '新用户券'
  558. break
  559. }
  560. }
  561. },
  562. methods: {
  563. async initData() {
  564. const userInfo = await this.$api.getStorage()
  565. this.isModallayer = false //遮罩层 防止多次点击
  566. this.skeletonShow = true //预加载圆圈
  567. this.isCheckAll = false //是否全选
  568. this.submitIds = []
  569. this.couponPrice = 0
  570. this.totalDiscountAmount = 0
  571. this.isDiscount = false
  572. this.eligibleCoupons = []
  573. this.userId = this.couponParam.userId = userInfo.userId ? userInfo.userId : 0
  574. this.userIdentity = userInfo.userIdentity ? userInfo.userIdentity : 0
  575. this.vipFlag = userInfo.vipFlag ? userInfo.vipFlag : 0
  576. this.initGetCartGoodsList()
  577. },
  578. isShowVipFlag(pros){
  579. if(pros.priceFlag!=1){
  580. if(this.userIdentity == 4 && this.vipFlag == 1){
  581. return true
  582. }else if(this.userIdentity == 2){
  583. return true
  584. }
  585. }
  586. },
  587. initLogin() {
  588. this.$api.redirectTo('/pages/login/login')
  589. },
  590. clickPopupShow(pros, type) {
  591. this.popupShow = true
  592. this.handlerPros = pros
  593. },
  594. setScrollHeight() {
  595. // 窗口高度-footer高度
  596. const { windowHeight, pixelRatio } = uni.getSystemInfoSync()
  597. setTimeout(() => {
  598. const query = uni.createSelectorQuery().in(this)
  599. query.selectAll('.footer').boundingClientRect()
  600. query.exec(res => {
  601. this.windowHeight = windowHeight
  602. if (res[0][0]) {
  603. this.scrollHeight = windowHeight - res[0][0].height
  604. }
  605. })
  606. }, 500)
  607. },
  608. initGetCartGoodsList() {
  609. //初始化购物车 index:1
  610. this.ProductService.QueryShoppingCartList({ userId: this.userId, source: 2 })
  611. .then(response => {
  612. this.skeletonShow = false
  613. let data = response.data
  614. this.kindCount = data.kindCount
  615. this.promotionsList = data.promotions
  616. this.totalCouponList = data.couponList
  617. this.$store.commit('updateAllNum', data.kindCount)
  618. if (data.list.length > 0 || data.invalid.length > 0) {
  619. this.isEmpty = false
  620. } else {
  621. this.isEmpty = true
  622. }
  623. if (data.list && data.list.length > 0) {
  624. this.goodsList = data.list
  625. this.goodsList.forEach((item, index) => {
  626. item.cartList.forEach(pros => {
  627. pros.shopId = item.shopId
  628. pros.isStep = false
  629. if (pros.step === 2) {
  630. if (pros.number % pros.min != 0) {
  631. pros.number = pros.min
  632. this.totalShopPeice()
  633. this.updateShoppogNum(pros)
  634. }
  635. }
  636. })
  637. })
  638. this.totalShopPeice()
  639. } else {
  640. this.goodsList = []
  641. }
  642. if (data.invalid && data.invalid.length > 0) {
  643. let newFailureList = [],
  644. isFailureLayer
  645. data.invalid.forEach((failure, index) => {
  646. if (failure.status == 1 || failure.status == 2) {
  647. isFailureLayer = true
  648. } else {
  649. isFailureLayer = false
  650. }
  651. newFailureList.push(Object.assign({}, failure, { isFailureLayer: isFailureLayer }))
  652. })
  653. this.failureList = newFailureList
  654. } else {
  655. this.failureList = []
  656. }
  657. })
  658. .catch(error => {
  659. this.$util.msg(error.msg, 2000)
  660. })
  661. },
  662. ischeckFailure(failure) {
  663. failure.isChecked = !failure.isChecked
  664. this.updateCheckAllBtn()
  665. },
  666. ischeck(item, pro) {
  667. //为未选中的时候改变为true,反之为true
  668. pro.isChecked = !pro.isChecked
  669. if (pro.isChecked) {
  670. if (!this.submitIds.includes(pro.productID * 1)) {
  671. this.submitIds.push(pro.productID)
  672. }
  673. } else {
  674. var lent = this.submitIds.indexOf(pro.productId * 1)
  675. if (lent >= 0) {
  676. this.submitIds.splice(lent, 1)
  677. }
  678. }
  679. this.updateProductCheckedAllBtn(item)
  680. this.updateCheckAllBtn()
  681. },
  682. updateProductCheckedAllBtn(item) {
  683. // 单独每个供应商的勾选判断
  684. let productsList = item.cartList,
  685. productsCheckedLength = 0,
  686. disabledLength = 0
  687. if (this.isshowDelbtn) {
  688. productsList.forEach(pros => {
  689. if (pros.isChecked) {
  690. productsCheckedLength++
  691. }
  692. })
  693. } else {
  694. productsList.forEach(pros => {
  695. if (pros.isChecked) {
  696. productsCheckedLength++
  697. }
  698. })
  699. }
  700. item.isChecked = productsCheckedLength === productsList.length
  701. },
  702. updateCheckAllBtn() {
  703. // 全选勾选判断
  704. let goodsCheckedLength = 0,
  705. goodsList = this.goodsList,
  706. failureList = this.failureList
  707. goodsList.forEach(item => {
  708. if (item.isChecked) {
  709. goodsCheckedLength++
  710. }
  711. })
  712. failureList.forEach(failureItem => {
  713. if (failureItem.isChecked) {
  714. goodsCheckedLength++
  715. }
  716. })
  717. if (this.isshowDelbtn) {
  718. this.isCheckAll = goodsCheckedLength === goodsList.length + failureList.length
  719. } else {
  720. this.isCheckAll = goodsCheckedLength === goodsList.length
  721. }
  722. },
  723. checkShop(item) {
  724. //与单选商品类似
  725. item.isChecked = !item.isChecked
  726. this.setProductChecked(item)
  727. this.updateCheckAllBtn()
  728. },
  729. setProductChecked(item) {
  730. item.cartList.forEach(pros => {
  731. if (item.isChecked) {
  732. pros.isChecked = true
  733. if (!this.submitIds.includes(pros.productId * 1)) {
  734. this.submitIds.push(pros.productId)
  735. }
  736. } else {
  737. pros.isChecked = false
  738. var lent = this.submitIds.indexOf(pros.productId * 1)
  739. if (lent >= 0) {
  740. this.submitIds.splice(lent, 1)
  741. }
  742. }
  743. })
  744. },
  745. updateBothCheckBtn() {
  746. if (this.isshowDelbtn) {
  747. // 当管理删除按钮出现时,失效的商品可被选择
  748. this.goodsList.forEach(item => {
  749. item.isChecked = this.isCheckAll
  750. this.setProductChecked(item)
  751. })
  752. //删除按钮 全选包括失效商品勾选
  753. this.failureList.forEach(failureItem => {
  754. failureItem.isChecked = this.isCheckAll
  755. })
  756. } else {
  757. this.goodsList.forEach(item => {
  758. item.isChecked = this.isCheckAll && !item.isDisabled
  759. this.setProductChecked(item)
  760. })
  761. }
  762. },
  763. checkAll() {
  764. //全选方法内调用方法
  765. this.isCheckAll = !this.isCheckAll
  766. if (!this.isCheckAll) {
  767. this.popupShow1 = false
  768. }
  769. this.updateBothCheckBtn()
  770. },
  771. totalShopPeice() {
  772. //每次所属会所下的商品增减重新计算合计价格&减去含有下架的商品
  773. let touchPrice = 0
  774. let reducedPrice = 0 //商铺合计满减价
  775. this.goodsList.map((item, index) => {
  776. //计算店铺满减后店铺合计
  777. if (item.promotions && item.promotions.mode == 2) {
  778. let prosPrice = 0
  779. let totalOriginalPrice = 0 //商铺合计原价
  780. item.cartList.forEach(pros => {
  781. prosPrice += pros.price * pros.number
  782. totalOriginalPrice += pros.originalPrice * pros.number
  783. })
  784. if (prosPrice >= item.promotions.touchPrice) {
  785. item.totalPrice = prosPrice - item.promotions.reducedPrice
  786. item.reducedPrice = item.promotions.reducedPrice
  787. item.totalOriginalPrice = totalOriginalPrice
  788. } else {
  789. item.reducedPrice = 0 //统计合计价格
  790. item.totalPrice = prosPrice
  791. }
  792. } else {
  793. //以下为计算除店铺满减以外的单品满减以及正常商品合计
  794. let _totalPrice = 0
  795. let _reducedPrice = 0
  796. let _totalOriginalPrice = 0
  797. item.cartList.forEach(pros => {
  798. let _price = pros.price * pros.number
  799. _totalOriginalPrice += pros.price * pros.number
  800. if (pros.promotions && pros.promotions.type != 2 && pros.promotions.mode == 2) {
  801. if (_price >= pros.promotions.touchPrice) {
  802. _price = _price - pros.promotions.reducedPrice
  803. _reducedPrice += pros.promotions.reducedPrice
  804. }
  805. _totalPrice += _price
  806. } else {
  807. _reducedPrice = 0
  808. _totalPrice += pros.price * pros.number
  809. }
  810. })
  811. item.reducedPrice = _reducedPrice
  812. item.totalOriginalPrice = _totalOriginalPrice
  813. item.totalPrice = _totalPrice
  814. }
  815. })
  816. },
  817. totalPeice() {
  818. //计算总价格,每次调用此方法,将初始值为0,遍历价格并累加
  819. let totalPrice = 0
  820. let reducedPrice = 0
  821. let originalPrice = 0
  822. this.goodsList.forEach((item, index) => {
  823. let supplierPrice = 0
  824. let supplierReducedPrice = 0
  825. item.totalprice = 0
  826. item.reducedprice = 0
  827. item.originalprice = 0
  828. item.cartList.forEach(pros => {
  829. if (pros.isChecked) {
  830. supplierPrice += pros.price * pros.number
  831. // 单品满减
  832. if (pros.promotions && pros.promotions.type * 1 === 1 && pros.promotions.mode * 1 === 2) {
  833. // 单品满减-重新计算供应商总价/满减金额
  834. if (pros.price * pros.number >= pros.promotions.touchPrice) {
  835. supplierPrice -= pros.promotions.reducedPrice
  836. supplierReducedPrice += pros.promotions.reducedPrice
  837. }
  838. }
  839. }
  840. })
  841. // 店铺满减
  842. if (item.promotions && item.promotions.mode * 1 === 2) {
  843. // 店铺满减-计算供应商总价/满减金额
  844. if (supplierPrice >= item.promotions.touchPrice) {
  845. supplierPrice -= item.promotions.reducedPrice
  846. supplierReducedPrice += item.promotions.reducedPrice
  847. }
  848. }
  849. item.totalprice = supplierPrice
  850. item.reducedprice = supplierReducedPrice
  851. item.originalprice = supplierPrice + supplierReducedPrice
  852. totalPrice += item.totalprice
  853. reducedPrice += item.reducedprice
  854. originalPrice += item.originalprice
  855. })
  856. // 总促销计算
  857. this.promotionsList.forEach(promotions => {
  858. // 凑单满减
  859. if (promotions.mode * 1 === 2 && promotions.type * 1 === 2) {
  860. let total = 0
  861. promotions.productList.forEach(pros => {
  862. if (this.submitIds.includes(pros.productId * 1)) {
  863. total += pros.number * pros.price
  864. }
  865. })
  866. if (total >= promotions.touchPrice) {
  867. totalPrice -= promotions.reducedPrice
  868. reducedPrice += promotions.reducedPrice
  869. }
  870. }
  871. })
  872. // 最后统计商品原价
  873. this.totalOriginalPrice = originalPrice
  874. // 最后满减金额 = 店铺减去金额 + 单品减去金额 + 凑单减去金额
  875. this.reducedPrice = reducedPrice
  876. // 最终合计价格 = 店铺满减合计 + 单品满减 + 正常合计 + 凑单满减
  877. this.allPrice = totalPrice
  878. console.log('totalOriginalPrice', this.totalOriginalPrice)
  879. console.log('reducedPrice', this.reducedPrice)
  880. console.log('allPrice', this.allPrice)
  881. // 计算优惠券
  882. if (this.totalCouponList.length > 0) {
  883. let eligibleCoupons = this.calculationCoupon()
  884. if (eligibleCoupons.length > 0) {
  885. this.eligibleCoupons.splice(0, this.eligibleCoupons.length)
  886. this.eligibleCoupons = eligibleCoupons.sort((a, b) => b.couponAmount - a.couponAmount)
  887. this.couponPrice = this.eligibleCoupons[0].couponAmount
  888. } else {
  889. this.couponPrice = 0
  890. }
  891. }
  892. // 最后满减金额 = 店铺减去金额 + 单品减去金额 + 凑单减去金额
  893. this.totalDiscountAmount = this.reducedPrice + this.couponPrice
  894. console.log('totalDiscountAmount', this.totalDiscountAmount)
  895. // 控制显示优惠明细
  896. if (this.totalDiscountAmount > 0) {
  897. this.isDiscount = true
  898. } else {
  899. this.isDiscount = false
  900. }
  901. },
  902. totalCount() {
  903. //计算总数量
  904. this.allCount = 0
  905. let prosAllCount = 0
  906. let validCount = 0
  907. let validList = []
  908. let productsList = []
  909. this.goodsList.forEach(item => {
  910. productsList = item.cartList
  911. productsList.forEach(pros => {
  912. if (pros.isChecked) {
  913. prosAllCount += parseInt(pros.number)
  914. this.allCount = prosAllCount
  915. }
  916. })
  917. })
  918. },
  919. calculationCoupon() {
  920. // 优惠券计算
  921. let eligibleCoupons = []
  922. this.goodsList.forEach(shop => {
  923. shop.cartList.forEach(pros => {
  924. if (pros.isChecked) {
  925. this.totalCouponList.forEach(coupon => {
  926. //循环优惠券
  927. switch (coupon.couponType) {
  928. case 0: // 活动券
  929. if (coupon.productType == 1) {
  930. // 活动券-全商城商品
  931. if (this.allPrice >= coupon.touchPrice) {
  932. eligibleCoupons.push(coupon)
  933. }
  934. } else if (coupon.productType == 2) {
  935. // 活动券-指定商品
  936. if (coupon.productIds && coupon.productIds.includes(pros.productId)) {
  937. if (this.allPrice >= coupon.touchPrice) {
  938. eligibleCoupons.push(coupon)
  939. }
  940. }
  941. }
  942. break
  943. case 1: // 品类券适用于产品或者仪器 categoryType(commodityType) : 1 产品 2 仪器
  944. if (coupon.categoryType && coupon.categoryType == pros.commodityType) {
  945. if (this.allPrice >= coupon.touchPrice) {
  946. eligibleCoupons.push(coupon)
  947. }
  948. }
  949. break
  950. case 2: // 用户专享券 适用于商城全部商品
  951. if (this.allPrice >= coupon.touchPrice) {
  952. eligibleCoupons.push(coupon)
  953. }
  954. break
  955. case 3: // 店铺券适用于某个供应商的全部商品
  956. if (coupon.shopId && pros.supplierId == coupon.shopId) {
  957. if (this.allPrice >= coupon.touchPrice) {
  958. eligibleCoupons.push(coupon)
  959. }
  960. }
  961. break
  962. case 4: //新用户券 适用于商城全部商品
  963. if (this.allPrice >= coupon.touchPrice) {
  964. eligibleCoupons.push(coupon)
  965. }
  966. break
  967. }
  968. })
  969. } else {
  970. console.log('没有选择商品')
  971. return
  972. }
  973. })
  974. })
  975. return eligibleCoupons
  976. },
  977. changeCountAdd(item, pros) {
  978. //商品数量加加
  979. if (pros.step === 2) {
  980. pros.isStep = false
  981. pros.number += pros.min
  982. this.processActivityPrice(pros)
  983. this.isStock = false
  984. } else {
  985. pros.number++
  986. this.processActivityPrice(pros)
  987. this.isStock = false
  988. }
  989. this.updateShoppogNum(pros)
  990. this.totalShopPeice()
  991. },
  992. changeCountSub(item, pros) {
  993. //商品数量减减
  994. if (pros.number <= pros.min) {
  995. pros.number = pros.min
  996. this.$util.msg(`该商品最小起订量为${pros.min}`, 2000)
  997. return
  998. } else {
  999. if (pros.step === 2) {
  1000. pros.isStep = false
  1001. pros.number -= pros.min
  1002. } else {
  1003. pros.number--
  1004. }
  1005. this.processActivityPrice(pros)
  1006. }
  1007. this.updateShoppogNum(pros)
  1008. this.totalShopPeice()
  1009. },
  1010. changeInput(pros) {
  1011. //输入商品数量更新
  1012. pros.isStep = false
  1013. },
  1014. changeNnmber(e, item, pros) {
  1015. //输入商品数量更新
  1016. let _value = Number(e.detail.value)
  1017. if (!this.$api.isNumber(_value)) {
  1018. pros.number = pros.min
  1019. } else if (_value < pros.min) {
  1020. this.$util.msg(`该商品最小起订量为${pros.min}`, 2000)
  1021. pros.number = pros.min
  1022. } else if (_value % pros.min != 0) {
  1023. pros.isStep = true
  1024. pros.number = pros.min
  1025. } else {
  1026. pros.isStep = false
  1027. pros.number = e.detail.value
  1028. this.processActivityPrice(pros)
  1029. }
  1030. this.updateShoppogNum(pros)
  1031. this.totalShopPeice()
  1032. },
  1033. processActivityPrice(pros) {
  1034. //单独处理活动价格和阶梯价格
  1035. let ladderPriceList = pros.ladderPrices
  1036. if (pros.ladderFlag == 0 || pros.actStatus == 1) {
  1037. pros.price = pros.price
  1038. } else {
  1039. ladderPriceList.forEach((item, index) => {
  1040. if (pros.number >= item.buyNum) {
  1041. pros.price = item.buyPrice
  1042. }
  1043. })
  1044. }
  1045. },
  1046. updateShoppogNum(pros) {
  1047. //加减购物车商品更新到后台
  1048. this.ProductService.ShoppingCartUpdate({
  1049. userId: this.userId,
  1050. productId: pros.productId,
  1051. productCount: pros.number,
  1052. source: 2
  1053. })
  1054. .then(response => {
  1055. this.isshowDelbtn = false
  1056. this.initGetCartGoodsList()
  1057. })
  1058. .catch(error => {
  1059. this.$util.msg(error.msg, 2000)
  1060. })
  1061. },
  1062. toConfirmation() {
  1063. //跳转确认订单页面
  1064. let setGoodsList = []
  1065. this.goodsList.forEach(res => {
  1066. let products = res.cartList
  1067. products.forEach(pros => {
  1068. if (pros.isChecked) {
  1069. setGoodsList.push(pros.productId)
  1070. }
  1071. })
  1072. })
  1073. if (setGoodsList == '') {
  1074. this.$util.msg('请先选择结算商品~', 2000)
  1075. return
  1076. } else {
  1077. this.isNoConfim = false
  1078. this.goodsList.forEach(el => {
  1079. el.cartList.forEach(pros => {
  1080. if (pros.isChecked) {
  1081. if (pros.number < pros.min) {
  1082. this.isNoConfim = true
  1083. }
  1084. }
  1085. })
  1086. })
  1087. if (this.isNoConfim) {
  1088. this.$util.modal(
  1089. '',
  1090. '有商品的购买量没达到最小起订量,请修改数量后再次提交结算',
  1091. '去修改',
  1092. '',
  1093. false,
  1094. () => {}
  1095. )
  1096. return
  1097. }
  1098. let productIds = ''
  1099. this.goodsList.forEach(el => {
  1100. //获取勾选的商品ID拼接字符串逗号隔开,最后一个逗号去掉
  1101. el.cartList.forEach(pros => {
  1102. if (pros.isChecked) {
  1103. productIds += pros.productId + ','
  1104. }
  1105. })
  1106. })
  1107. let cartPramsData = { productIds: productIds.substring(0, productIds.lastIndexOf(',')) }
  1108. // 友盟埋点购物车去结算点击事件
  1109. if (process.env.NODE_ENV != 'development') {
  1110. this.$uma.trackEvent('Um_Event_shoppingCartConfirmOrder', {
  1111. Um_Key_PageName: '去结算',
  1112. Um_Key_SourcePage: '底部菜单购物车'
  1113. })
  1114. }
  1115. this.$api.navigateTo(`/pages/user/order/create-order?data=${JSON.stringify({ data: cartPramsData })}`)
  1116. }
  1117. },
  1118. showDelManager() {
  1119. //显示删除商品管理
  1120. this.isshowDelbtn = true
  1121. if (this.isCheckAll) {
  1122. this.updateBothCheckBtn()
  1123. } else {
  1124. this.goodsList.forEach(item => {
  1125. if (item.isChecked) {
  1126. item.cartList.forEach(pros => {
  1127. pros.isChecked = true
  1128. })
  1129. }
  1130. })
  1131. this.updateCheckAllBtn()
  1132. }
  1133. // 失效也被勾选
  1134. this.failureList.forEach(failureItem => {
  1135. if (failureItem.isFailureLayer) {
  1136. failureItem.isFailureLayer = false
  1137. }
  1138. })
  1139. },
  1140. hideDelManage() {
  1141. //隐藏删除商品管理
  1142. this.isshowDelbtn = false
  1143. let isFailureLayer,
  1144. newFailureList = []
  1145. if (this.isCheckAll) {
  1146. this.updateBothCheckBtn()
  1147. } else {
  1148. // 失效商品取消勾选
  1149. this.goodsList.forEach(item => {
  1150. if (item.isDisabled) {
  1151. item.isChecked = false
  1152. }
  1153. item.cartList.forEach(pros => {
  1154. if (pros.validFlag == 3) {
  1155. pros.isChecked = false
  1156. }
  1157. })
  1158. })
  1159. this.updateCheckAllBtn()
  1160. }
  1161. this.failureList.forEach((failure, index) => {
  1162. if (failure.failureState == 1 || failure.failureState == 2) {
  1163. isFailureLayer = true
  1164. } else {
  1165. isFailureLayer = false
  1166. }
  1167. newFailureList.push(Object.assign({}, failure, { isFailureLayer: isFailureLayer }))
  1168. })
  1169. this.failureList = newFailureList
  1170. },
  1171. deleteList() {
  1172. //删除购物车商品
  1173. this.delGoodsList = []
  1174. this.goodsList.forEach(delitem => {
  1175. let products = delitem.cartList
  1176. products.forEach(pros => {
  1177. if (pros.isChecked) {
  1178. this.delGoodsList += pros.productId + ','
  1179. }
  1180. })
  1181. })
  1182. this.failureList.forEach(failure => {
  1183. if (failure.isChecked) {
  1184. this.delGoodsList += failure.productId + ','
  1185. }
  1186. })
  1187. if (this.delGoodsList.length == 0) {
  1188. this.$util.msg('请选择要删除的商品~', 2000)
  1189. return
  1190. } else {
  1191. this.$util.modal('', '确定删除选中的商品吗?', '确定', '取消', true, () => {
  1192. this.ProductService.ShoppingCartDelete({
  1193. userId: this.userId,
  1194. productIds: this.delGoodsList
  1195. })
  1196. .then(response => {
  1197. this.$util.msg('删除成功', 2000)
  1198. setTimeout(() => {
  1199. this.isshowDelbtn = false
  1200. this.initGetCartGoodsList()
  1201. }, 2000)
  1202. })
  1203. .catch(error => {
  1204. this.$util.msg(error.msg, 2000)
  1205. })
  1206. })
  1207. }
  1208. },
  1209. deletefailureList() {
  1210. this.failureList.forEach(failure => {
  1211. this.delGoodsList += failure.productId + ','
  1212. })
  1213. this.$util.modal('', '确定清空全部失效商品吗?', '确定', '取消', true, () => {
  1214. this.ProductService.ShoppingCartDelete({
  1215. userId: this.userId,
  1216. productIds: this.delGoodsList
  1217. })
  1218. .then(response => {
  1219. this.$util.msg('删除成功', 2000)
  1220. setTimeout(() => {
  1221. this.isshowDelbtn = false
  1222. this.initGetCartGoodsList()
  1223. }, 2000)
  1224. })
  1225. .catch(error => {
  1226. this.$util.msg(error.msg, 2000)
  1227. })
  1228. })
  1229. },
  1230. goIndex() {
  1231. uni.switchTab({
  1232. url: '/pages/tabBar/home/index'
  1233. })
  1234. },
  1235. goNavto(url) {
  1236. uni.navigateTo({
  1237. url
  1238. })
  1239. },
  1240. navToListPage(id) {
  1241. this.isModallayer = true
  1242. this.$api.navigateTo(`/pages/goods/product?id=${id}`)
  1243. },
  1244. failureToProduct(failure) {
  1245. if (failure.status == 1) {
  1246. this.$util.msg('商品已丢失,不能查看', 2000)
  1247. return
  1248. } else if (failure.status == 2) {
  1249. this.$util.msg('商品已停售,不能查看', 2000)
  1250. return
  1251. } else {
  1252. this.isModallayer = true
  1253. this.$api.navigateTo(`/pages/goods/product?id=${failure.productId}`)
  1254. }
  1255. },
  1256. failureStateText(state) {
  1257. let stateText = '',
  1258. stateTextObject = {
  1259. 1: '商品已丢失',
  1260. 2: '商品已停售',
  1261. 3: '商品已下架',
  1262. 4: '商品已售罄',
  1263. 5: '价格仅会员可见,您不能购买',
  1264. 6: '未公开价格',
  1265. 7: '库存不足'
  1266. }
  1267. Object.keys(stateTextObject).forEach(key => {
  1268. if (key == state) {
  1269. stateText = stateTextObject[key]
  1270. }
  1271. })
  1272. return stateText
  1273. },
  1274. setHeaderBtnPosi() {
  1275. // 获得胶囊按钮位置信息
  1276. let headerBtnPosi = uni.getMenuButtonBoundingClientRect()
  1277. return headerBtnPosi
  1278. },
  1279. setSysteminfo() {
  1280. let systeminfo
  1281. uni.getSystemInfo({
  1282. // 获取设备信息
  1283. success: res => {
  1284. systeminfo = res
  1285. }
  1286. })
  1287. return systeminfo
  1288. },
  1289. PromotionsFormat(promo) {
  1290. //促销活动类型数据处理
  1291. if (promo != null) {
  1292. if (promo.type == 1 && promo.mode == 1) {
  1293. return true
  1294. } else {
  1295. return false
  1296. }
  1297. }
  1298. return false
  1299. },
  1300. queryPopupCoupons() {
  1301. // 获取弹窗优惠券列表
  1302. this.ProductService.ShoppingCartGetCoupon(this.couponParam)
  1303. .then(response => {
  1304. let data = response.data
  1305. this.navbar[0].num = data.notCouponNum
  1306. this.navbar[1].num = data.couponNum
  1307. if (data.couponList && data.couponList.length > 0) {
  1308. this.productCouponList = data.couponList
  1309. this.isCouponEmpty = false
  1310. } else {
  1311. this.isCouponEmpty = true
  1312. }
  1313. })
  1314. .catch(error => {
  1315. console.log('获取优惠券列表失败')
  1316. })
  1317. },
  1318. receiveCoupon(coupon) {
  1319. // 点击优惠券领取按钮
  1320. this.ProductService.ReceiveCoupon({
  1321. userId: this.couponParam.userId,
  1322. couponId: coupon.couponId,
  1323. source: 2
  1324. })
  1325. .then(response => {
  1326. this.$util.msg('领取成功', 1500, true, 'success')
  1327. setTimeout(() => {
  1328. this.currentTab = 1
  1329. this.couponParam.status = 2
  1330. this.queryPopupCoupons()
  1331. }, 1500)
  1332. })
  1333. .catch(error => {
  1334. this.$util.msg(error.msg, 2000)
  1335. })
  1336. },
  1337. showPopup(index, shop) {
  1338. // 显示popup弹窗
  1339. switch (index) {
  1340. case 0:
  1341. this.currentTab = 0
  1342. this.couponParam.status = 1
  1343. this.couponParam.shopId = shop.shopId
  1344. this.queryPopupCoupons()
  1345. this.popupShow0 = true
  1346. break
  1347. case 1:
  1348. this.popupShow1 = true
  1349. break
  1350. }
  1351. },
  1352. hidePopup(index) {
  1353. // 隐藏popup弹窗
  1354. switch (index) {
  1355. case 0:
  1356. this.popupShow0 = false
  1357. break
  1358. case 1:
  1359. this.popupShow1 = false
  1360. break
  1361. }
  1362. },
  1363. couponChange(e) {
  1364. this.currentTab = e.index
  1365. switch (this.currentTab) {
  1366. case 0:
  1367. this.couponParam.status = 1
  1368. this.queryPopupCoupons()
  1369. break
  1370. case 1:
  1371. this.couponParam.status = 2
  1372. this.queryPopupCoupons()
  1373. break
  1374. }
  1375. }
  1376. }
  1377. }
  1378. </script>
  1379. <style lang="scss">
  1380. page {
  1381. background: #f7f7f7;
  1382. height: auto;
  1383. }
  1384. .cart-content {
  1385. position: relative;
  1386. }
  1387. .container-cart-main.none {
  1388. display: none;
  1389. }
  1390. .container-cart-main.show {
  1391. display: block;
  1392. }
  1393. .cart-content.empty.none {
  1394. display: none;
  1395. }
  1396. .cart-content.empty.show {
  1397. display: block;
  1398. }
  1399. .container-cart.show {
  1400. display: block;
  1401. }
  1402. .container-cart.none {
  1403. display: none;
  1404. }
  1405. .empty-container.none {
  1406. display: none;
  1407. }
  1408. .empty-container.show {
  1409. display: flex;
  1410. }
  1411. .foot-check-delbtn {
  1412. width: 100%;
  1413. height: 80rpx;
  1414. position: fixed;
  1415. top: 0;
  1416. left: 0;
  1417. box-sizing: border-box;
  1418. padding: 15rpx 24rpx;
  1419. background-color: #f7f7f7;
  1420. z-index: 990;
  1421. .foot-text {
  1422. font-size: $font-size-26;
  1423. height: 50rpx;
  1424. line-height: 50rpx;
  1425. color: #666666;
  1426. float: left;
  1427. padding-left: 10rpx;
  1428. text {
  1429. margin: 0 6rpx;
  1430. }
  1431. }
  1432. .delBtn {
  1433. width: 100rpx;
  1434. display: inline-block;
  1435. padding: 0 15rpx;
  1436. font-size: $font-size-26;
  1437. height: 50rpx;
  1438. line-height: 50rpx;
  1439. border-radius: 30rpx;
  1440. background: #ffffff;
  1441. border: 1px solid #e15616;
  1442. color: #e15616;
  1443. float: right;
  1444. text-align: center;
  1445. &.none {
  1446. display: none;
  1447. }
  1448. }
  1449. }
  1450. .checkbox-box {
  1451. display: flex;
  1452. align-items: center;
  1453. .checkbox {
  1454. display: flex;
  1455. margin: 0;
  1456. padding: 5rpx;
  1457. display: flex;
  1458. flex-direction: column;
  1459. align-items: center;
  1460. box-sizing: border-box;
  1461. text-align: center;
  1462. text-decoration: none;
  1463. border-radius: 0;
  1464. -webkit-tap-highlight-color: transparent;
  1465. overflow: hidden;
  1466. background-color: #ffffff;
  1467. font-size: 36rpx;
  1468. color: #999999;
  1469. &.icon-yixuanze {
  1470. color: $color-system;
  1471. }
  1472. }
  1473. &.disabled {
  1474. .checkbox {
  1475. color: #999999;
  1476. }
  1477. }
  1478. .text {
  1479. font-size: $font-size-24;
  1480. margin-left: 10rpx;
  1481. }
  1482. }
  1483. .goods-list {
  1484. width: 100%;
  1485. height: auto;
  1486. background-color: #f7f7f7;
  1487. .goods-item {
  1488. width: 702rpx;
  1489. padding: 0 24rpx;
  1490. background: #ffffff;
  1491. margin-bottom: 24rpx;
  1492. }
  1493. .shoptitle {
  1494. height: 80rpx;
  1495. line-height: 80rpx;
  1496. .checkbox-box {
  1497. float: left;
  1498. height: 80rpx;
  1499. line-height: 80rpx;
  1500. display: inline-block;
  1501. box-sizing: border-box;
  1502. margin-left: 10rpx;
  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>