index.vue 59 KB

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