index.vue 67 KB

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