index.vue 66 KB

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