index.vue 67 KB

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