index.vue 59 KB

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