index.vue 60 KB

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