index.vue 67 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523
  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. },
  1461. hideMobel() {
  1462. this.modal = false
  1463. },
  1464. handleClick(e) {
  1465. //个人机构跳转升级页面
  1466. if (e.index == 1) {
  1467. this.$api.navigateTo('/pages/login/apply')
  1468. }
  1469. this.modal = false
  1470. },
  1471. showPopup(index, shop) {
  1472. // 显示popup弹窗
  1473. switch (index) {
  1474. case 0:
  1475. // 友盟埋点收集领券按钮
  1476. if (process.env.NODE_ENV != 'development') {
  1477. this.$uma.trackEvent('Um_Event_cartCouponButton', {
  1478. Um_Key_PageName: '机构购物车',
  1479. Um_Key_EvenName: '点击领券按钮',
  1480. Um_Key_userId: `${this.userId}`
  1481. })
  1482. }
  1483. this.currentTab = 0
  1484. this.couponParam.status = 1
  1485. this.couponParam.shopId = shop.shopId
  1486. this.queryPopupCoupons()
  1487. this.popupShow0 = true
  1488. break
  1489. case 1:
  1490. this.popupShow1 = true
  1491. break
  1492. }
  1493. },
  1494. handleShouUnitPopup(pros){// 规格弹窗
  1495. this.popupShow2 = true
  1496. this.handlePros = pros
  1497. },
  1498. hidePopup(index) {
  1499. // 隐藏popup弹窗
  1500. switch (index) {
  1501. case 0:
  1502. this.popupShow0 = false
  1503. break
  1504. case 1:
  1505. this.popupShow1 = false
  1506. break
  1507. }
  1508. },
  1509. couponChange(e) {
  1510. this.currentTab = e.index
  1511. switch (this.currentTab) {
  1512. case 0:
  1513. this.couponParam.status = 1
  1514. this.queryPopupCoupons()
  1515. break
  1516. case 1:
  1517. this.couponParam.status = 2
  1518. this.queryPopupCoupons()
  1519. break
  1520. }
  1521. }
  1522. }
  1523. }
  1524. </script>
  1525. <style lang="scss">
  1526. page {
  1527. background: #f7f7f7;
  1528. height: auto;
  1529. }
  1530. .cart-content {
  1531. position: relative;
  1532. }
  1533. .container-cart-main.none {
  1534. display: none;
  1535. }
  1536. .container-cart-main.show {
  1537. display: block;
  1538. }
  1539. .cart-content.empty.none {
  1540. display: none;
  1541. }
  1542. .cart-content.empty.show {
  1543. display: block;
  1544. }
  1545. .container-cart.show {
  1546. display: block;
  1547. }
  1548. .container-cart.none {
  1549. display: none;
  1550. }
  1551. .empty-container.none {
  1552. display: none;
  1553. }
  1554. .empty-container.show {
  1555. display: flex;
  1556. }
  1557. .foot-check-delbtn {
  1558. width: 100%;
  1559. height: 80rpx;
  1560. position: fixed;
  1561. top: 0;
  1562. left: 0;
  1563. box-sizing: border-box;
  1564. padding: 15rpx 24rpx;
  1565. background-color: #f7f7f7;
  1566. z-index: 990;
  1567. .foot-text {
  1568. font-size: $font-size-26;
  1569. height: 50rpx;
  1570. line-height: 50rpx;
  1571. color: #666666;
  1572. float: left;
  1573. padding-left: 10rpx;
  1574. text {
  1575. margin: 0 6rpx;
  1576. }
  1577. }
  1578. .delBtn {
  1579. width: 100rpx;
  1580. display: inline-block;
  1581. padding: 0 15rpx;
  1582. font-size: $font-size-26;
  1583. height: 50rpx;
  1584. line-height: 50rpx;
  1585. border-radius: 30rpx;
  1586. background: #ffffff;
  1587. border: 1px solid #FF5B00;
  1588. color: #FF5B00;
  1589. float: right;
  1590. text-align: center;
  1591. &.none {
  1592. display: none;
  1593. }
  1594. }
  1595. }
  1596. .checkbox-box {
  1597. display: flex;
  1598. align-items: center;
  1599. .checkbox {
  1600. display: flex;
  1601. margin: 0;
  1602. padding: 5rpx;
  1603. display: flex;
  1604. flex-direction: column;
  1605. align-items: center;
  1606. box-sizing: border-box;
  1607. text-align: center;
  1608. text-decoration: none;
  1609. border-radius: 0;
  1610. -webkit-tap-highlight-color: transparent;
  1611. overflow: hidden;
  1612. background-color: #ffffff;
  1613. font-size: 36rpx;
  1614. color: #999999;
  1615. &.icon-yixuanze {
  1616. color: $color-system;
  1617. }
  1618. }
  1619. &.disabled {
  1620. .checkbox {
  1621. color: #999999;
  1622. }
  1623. }
  1624. .text {
  1625. font-size: $font-size-24;
  1626. margin-left: 10rpx;
  1627. }
  1628. }
  1629. .goods-list {
  1630. width: 100%;
  1631. height: auto;
  1632. background-color: #f7f7f7;
  1633. .goods-item {
  1634. width: 702rpx;
  1635. padding: 0 24rpx;
  1636. background: #ffffff;
  1637. margin-bottom: 24rpx;
  1638. }
  1639. .shoptitle {
  1640. height: 80rpx;
  1641. line-height: 80rpx;
  1642. .checkbox-box {
  1643. float: left;
  1644. line-height: 80rpx;
  1645. display: inline-block;
  1646. box-sizing: border-box;
  1647. }
  1648. .text {
  1649. width: 400rpx;
  1650. float: left;
  1651. display: block;
  1652. overflow: hidden;
  1653. text-overflow: ellipsis;
  1654. white-space: nowrap;
  1655. line-height: 80rpx;
  1656. margin-left: 20rpx;
  1657. font-size: $font-size-28;
  1658. color: $text-color;
  1659. text-align: left;
  1660. font-weight: bold;
  1661. }
  1662. .text-coupon {
  1663. float: right;
  1664. line-height: 80rpx;
  1665. font-size: $font-size-30;
  1666. color: #FF5B00;
  1667. }
  1668. .floor-item-act {
  1669. width: 120rpx;
  1670. height: 80rpx;
  1671. text-align: center;
  1672. box-sizing: border-box;
  1673. float: left;
  1674. padding: 24rpx 0;
  1675. margin-left: 20rpx;
  1676. }
  1677. }
  1678. .goods-pros {
  1679. width: 100%;
  1680. height: auto;
  1681. margin-bottom: 20rpx;
  1682. }
  1683. .goods-pros-t {
  1684. display: flex;
  1685. align-items: center;
  1686. width: 100%;
  1687. height: 210rpx;
  1688. padding: 0 0 26rpx 0;
  1689. .checkbox-box {
  1690. // padding: 10rpx;
  1691. }
  1692. .pros-img {
  1693. width: 210rpx;
  1694. height: 100%;
  1695. border-radius: 10rpx;
  1696. margin: 0 20rpx;
  1697. border: 1px solid #f3f3f3;
  1698. position: relative;
  1699. image {
  1700. width: 100%;
  1701. height: 100%;
  1702. border-radius: 10rpx;
  1703. }
  1704. .pros-type {
  1705. width: 64rpx;
  1706. height: 64rpx;
  1707. text-align: justify;
  1708. box-sizing: border-box;
  1709. padding: 10rpx;
  1710. border-radius: 0 0 8rpx 8rpx;
  1711. background-color: #33ccbf;
  1712. font-size: $font-size-22;
  1713. color: #ffffff;
  1714. line-height: 25rpx;
  1715. position: absolute;
  1716. top: 0;
  1717. right: 10rpx;
  1718. }
  1719. }
  1720. }
  1721. .goods-pros-b {
  1722. width: 100%;
  1723. height: auto;
  1724. padding: 0 0 24rpx 0;
  1725. box-sizing: border-box;
  1726. &.show {
  1727. display: block;
  1728. }
  1729. &.none {
  1730. display: none;
  1731. }
  1732. .sum-none {
  1733. width: 100%;
  1734. height: 48rpx;
  1735. line-height: 48rpx;
  1736. color: $text-color;
  1737. float: left;
  1738. text-align: right;
  1739. .money {
  1740. font-size: $font-size-26;
  1741. color: #999999;
  1742. text-decoration: line-through;
  1743. }
  1744. .money-sign {
  1745. font-size: $font-size-26;
  1746. color: #999999;
  1747. text-decoration: line-through;
  1748. }
  1749. .money-reduced {
  1750. margin-left: 10rpx;
  1751. font-size: $font-size-26;
  1752. color: $color-system;
  1753. .iconfont {
  1754. font-size: $font-size-34;
  1755. }
  1756. }
  1757. }
  1758. .sum {
  1759. width: 100%;
  1760. height: 40rpx;
  1761. font-size: $font-size-26;
  1762. line-height: 40rpx;
  1763. color: $text-color;
  1764. float: left;
  1765. display: flex;
  1766. justify-content: flex-end;
  1767. font-weight: bold;
  1768. .money {
  1769. color: #ff2a2a;
  1770. font-size: $font-size-26;
  1771. }
  1772. .money-sign {
  1773. font-size: $font-size-24;
  1774. color: #ff2a2a;
  1775. }
  1776. }
  1777. }
  1778. .pros-product {
  1779. width: 416rpx;
  1780. height: 100%;
  1781. line-height: 36rpx;
  1782. font-size: $font-size-28;
  1783. position: relative;
  1784. .producttitle {
  1785. width: 100%;
  1786. display: inline-block;
  1787. height: auto;
  1788. text-overflow: ellipsis;
  1789. display: -webkit-box;
  1790. word-break: break-all;
  1791. -webkit-box-orient: vertical;
  1792. -webkit-line-clamp: 2;
  1793. overflow: hidden;
  1794. margin-bottom: 15rpx;
  1795. .no-text {
  1796. display: inline-block;
  1797. height: 36rpx;
  1798. padding: 0 12rpx;
  1799. line-height: 36rpx;
  1800. background: linear-gradient(315deg, rgba(231, 0, 0, 1) 0%, rgba(255, 104, 1, 1) 100%);
  1801. border-radius: 18rpx;
  1802. text-align: center;
  1803. color: #ffffff;
  1804. font-size: $font-size-28;
  1805. margin-right: 24rpx;
  1806. }
  1807. }
  1808. .productspec {
  1809. height: 36rpx;
  1810. color: #999999;
  1811. font-size: $font-size-26;
  1812. }
  1813. .cart-sku-temp{
  1814. width: 100%;
  1815. height: 48rpx;
  1816. margin: 30rpx 0 0 0;
  1817. .cart-sku-text{
  1818. font-size: 28rpx;
  1819. line-height: 48rpx;
  1820. color: #666666;
  1821. float: left;
  1822. }
  1823. .cart-sku-btn{
  1824. padding: 0 16rpx;
  1825. text-align: center;
  1826. line-height: 40rpx;
  1827. font-size: 24rpx;
  1828. box-sizing: border-box;
  1829. border: 1px solid #FF5B00;
  1830. color: #FF5B00;
  1831. float: left;
  1832. border-radius: 20rpx;
  1833. margin-left: 16rpx;
  1834. }
  1835. }
  1836. .productprice {
  1837. width: 100%;
  1838. height: 48rpx;
  1839. margin: 30rpx 0 0 0;
  1840. .price {
  1841. line-height: 48rpx;
  1842. font-size: $font-size-26;
  1843. width: 48%;
  1844. color: #ff2a2a;
  1845. float: left;
  1846. font-weight: bold;
  1847. &.disabled {
  1848. color: #999999;
  1849. text-decoration: line-through;
  1850. }
  1851. .money-sign {
  1852. font-size: $font-size-24;
  1853. color: #ff2a2a;
  1854. }
  1855. }
  1856. .count {
  1857. height: 100%;
  1858. float: right;
  1859. position: relative;
  1860. &.show {
  1861. display: block;
  1862. }
  1863. &.none {
  1864. display: none;
  1865. }
  1866. .count-tips {
  1867. width: auto;
  1868. display: inline-block;
  1869. padding: 0 15rpx;
  1870. line-height: 44rpx;
  1871. height: 44rpx;
  1872. border-radius: 22rpx;
  1873. background: $btn-confirm;
  1874. font-size: $font-size-24;
  1875. text-align: center;
  1876. color: #ffffff;
  1877. position: absolute;
  1878. top: -60rpx;
  1879. left: -5rpx;
  1880. z-index: 5;
  1881. &.step {
  1882. left: -217rpx;
  1883. }
  1884. &::before {
  1885. content: '';
  1886. position: absolute;
  1887. bottom: -30rpx;
  1888. right: 15rpx;
  1889. z-index: 1;
  1890. width: 0;
  1891. height: 0;
  1892. border-width: 18rpx;
  1893. border-style: solid;
  1894. border-color: $color-system transparent transparent transparent;
  1895. }
  1896. }
  1897. .number-box {
  1898. display: flex;
  1899. justify-content: center;
  1900. align-items: center;
  1901. border: 2rpx solid #ffe6dc;
  1902. border-radius: 30rpx;
  1903. .iconfont {
  1904. font-size: $font-size-24;
  1905. padding: 0 18rpx;
  1906. color: #999999;
  1907. text-align: center;
  1908. line-height: 48rpx;
  1909. font-weight: bold;
  1910. background: #fef6f3;
  1911. &.icon-jianhao {
  1912. border-radius: 30rpx 0 0 30rpx;
  1913. }
  1914. &.icon-jiahao {
  1915. border-radius: 0 30rpx 30rpx 0;
  1916. }
  1917. }
  1918. .btn-input {
  1919. width: 62rpx;
  1920. height: 48rpx;
  1921. line-height: 48rpx;
  1922. background: #fff;
  1923. border-radius: 4rpx;
  1924. text-align: center;
  1925. font-size: $font-size-24;
  1926. }
  1927. }
  1928. .uni-numbox {
  1929. position: absolute;
  1930. left: 45rpx;
  1931. bottom: 0;
  1932. .uni-numbox-minus,
  1933. .uni-numbox-plus {
  1934. width: 50rpx;
  1935. line-height: 40rpx;
  1936. }
  1937. .uni-numbox-value {
  1938. font-size: $font-size-28;
  1939. width: 60rpx;
  1940. }
  1941. }
  1942. }
  1943. }
  1944. .floor-item-act {
  1945. width: 100%;
  1946. height: 56rpx;
  1947. text-align: center;
  1948. box-sizing: border-box;
  1949. float: left;
  1950. padding: 0 0 10rpx 0;
  1951. margin-left: 10rpx;
  1952. }
  1953. }
  1954. }
  1955. .failure-list {
  1956. width: 702rpx;
  1957. height: auto;
  1958. padding: 0 24rpx;
  1959. margin-top: 20rpx;
  1960. background: #ffffff;
  1961. .failure-title {
  1962. width: 100%;
  1963. height: 82rpx;
  1964. line-height: 82rpx;
  1965. font-size: $font-size-28;
  1966. border-bottom: 1px solid #ebebeb;
  1967. .title-txt {
  1968. float: left;
  1969. color: #666666;
  1970. text-align: left;
  1971. }
  1972. .title-btn {
  1973. float: right;
  1974. color: $color-system;
  1975. text-align: right;
  1976. line-height: 80rpx;
  1977. .butto {
  1978. display: inline-block;
  1979. padding: 0 15rpx;
  1980. font-size: $font-size-26;
  1981. height: 50rpx;
  1982. line-height: 50rpx;
  1983. border-radius: 30rpx;
  1984. background: #ffffff;
  1985. // border: 1px solid #C9C9C9;
  1986. // color: #999999;
  1987. margin-top: 15rpx;
  1988. }
  1989. }
  1990. }
  1991. .productlist {
  1992. padding-top: 10rpx;
  1993. .goods-pros {
  1994. width: 100%;
  1995. height: auto;
  1996. padding: 20rpx 0;
  1997. }
  1998. .goods-pros-t {
  1999. display: flex;
  2000. align-items: center;
  2001. width: 100%;
  2002. height: 210rpx;
  2003. position: relative;
  2004. .img-tip {
  2005. display: block;
  2006. width: 72rpx;
  2007. height: 36rpx;
  2008. line-height: 36rpx;
  2009. font-size: $font-size-24;
  2010. text-align: center;
  2011. color: #ffffff;
  2012. border-radius: 24rpx;
  2013. background: rgba(51, 51, 51, 0.3);
  2014. // position: absolute;
  2015. // left: 0;
  2016. // top: 0;
  2017. }
  2018. .checkbox-box {
  2019. padding: 10rpx;
  2020. }
  2021. .pros-img {
  2022. width: 180rpx;
  2023. height: 100%;
  2024. border-radius: 10rpx;
  2025. margin: 0 20rpx;
  2026. border: 1px solid #f3f3f3;
  2027. position: relative;
  2028. image {
  2029. width: 100%;
  2030. height: 100%;
  2031. border-radius: 10rpx;
  2032. }
  2033. .pros-type {
  2034. width: 64rpx;
  2035. height: 64rpx;
  2036. text-align: justify;
  2037. box-sizing: border-box;
  2038. padding: 10rpx;
  2039. border-radius: 0 0 8rpx 8rpx;
  2040. background-color: #33ccbf;
  2041. font-size: $font-size-22;
  2042. color: #ffffff;
  2043. line-height: 25rpx;
  2044. position: absolute;
  2045. top: 0;
  2046. right: 10rpx;
  2047. }
  2048. }
  2049. .pros-marks {
  2050. width: 730rpx;
  2051. height: 250rpx;
  2052. z-index: 90;
  2053. background: rgba(0, 0, 0, 0.05);
  2054. position: absolute;
  2055. left: -20rpx;
  2056. top: -20rpx;
  2057. }
  2058. }
  2059. .goods-pros-b {
  2060. width: 622rpx;
  2061. margin-left: 84rpx;
  2062. height: 40rpx;
  2063. padding: 0 0 26rpx 0;
  2064. // border-top: 1px solid #EBEBEB;
  2065. &.show {
  2066. display: block;
  2067. }
  2068. &.none {
  2069. display: none;
  2070. }
  2071. .sum {
  2072. font-size: $font-size-28;
  2073. line-height: 40rpx;
  2074. color: $text-color;
  2075. display: flex;
  2076. justify-content: flex-end;
  2077. .money {
  2078. color: #ff2a2a;
  2079. font-size: $font-size-28;
  2080. }
  2081. .money-sign {
  2082. font-size: $font-size-24;
  2083. color: #ff2a2a;
  2084. }
  2085. }
  2086. }
  2087. .pros-product {
  2088. width: 402rpx;
  2089. height: 100%;
  2090. line-height: 36rpx;
  2091. font-size: $font-size-28;
  2092. position: relative;
  2093. .producttitle {
  2094. width: 100%;
  2095. display: inline-block;
  2096. height: auto;
  2097. text-overflow: ellipsis;
  2098. display: -webkit-box;
  2099. word-break: break-all;
  2100. -webkit-box-orient: vertical;
  2101. -webkit-line-clamp: 2;
  2102. overflow: hidden;
  2103. margin-bottom: 8rpx;
  2104. .no-text {
  2105. display: inline-block;
  2106. height: 36rpx;
  2107. padding: 0 12rpx;
  2108. line-height: 36rpx;
  2109. background: linear-gradient(315deg, rgba(231, 0, 0, 1) 0%, rgba(255, 104, 1, 1) 100%);
  2110. border-radius: 18rpx;
  2111. text-align: center;
  2112. color: #ffffff;
  2113. font-size: $font-size-28;
  2114. margin-right: 24rpx;
  2115. }
  2116. }
  2117. .productspec {
  2118. height: 36rpx;
  2119. color: #999999;
  2120. font-size: $font-size-26;
  2121. margin-top: 20rpx;
  2122. }
  2123. .productstate {
  2124. font-size: $font-size-28;
  2125. height: 44rpx;
  2126. color: #ff2a2a;
  2127. position: absolute;
  2128. bottom: 0;
  2129. left: 0;
  2130. }
  2131. }
  2132. }
  2133. }
  2134. .tui-popup-box {
  2135. position: relative;
  2136. box-sizing: border-box;
  2137. min-height: 220rpx;
  2138. padding: 24rpx 24rpx 0 24rpx;
  2139. .tui-popup-close {
  2140. width: 90rpx;
  2141. height: 90rpx;
  2142. position: absolute;
  2143. right: 0;
  2144. top: 24rpx;
  2145. line-height: 90rpx;
  2146. text-align: center;
  2147. color: #b2b2b2;
  2148. .icon-iconfontguanbi {
  2149. font-size: $font-size-40;
  2150. }
  2151. }
  2152. .title {
  2153. font-size: $font-size-34;
  2154. color: $text-color;
  2155. line-height: 88rpx;
  2156. text-align: center;
  2157. float: left;
  2158. width: 100%;
  2159. height: 88rpx;
  2160. font-weight: bold;
  2161. }
  2162. .tui-popup-main {
  2163. width: 100%;
  2164. float: left;
  2165. &.coupon {
  2166. padding-bottom: 40rpx;
  2167. .coupon-empty {
  2168. width: 100%;
  2169. height: 600rpx;
  2170. display: flex;
  2171. align-items: center;
  2172. justify-content: center;
  2173. flex-direction: column;
  2174. position: fixed;
  2175. background: $bg-color;
  2176. .empty-container-image {
  2177. width: 150rpx;
  2178. height: 150rpx;
  2179. margin-bottom: 0;
  2180. margin-top: 0;
  2181. }
  2182. .error-text {
  2183. font-size: $font-size-28;
  2184. color: #999999;
  2185. line-height: 88rpx;
  2186. }
  2187. }
  2188. }
  2189. .tui-popup-scroll {
  2190. width: 100%;
  2191. height: 600rpx;
  2192. .coupon-list {
  2193. width: 100%;
  2194. height: 200rpx;
  2195. margin-top: 24rpx;
  2196. box-sizing: border-box;
  2197. background: url(https://static.caimei365.com/app/img/icon/icon-coupon-uesb@2x.png);
  2198. background-size: cover;
  2199. &:last-child {
  2200. margin-bottom: 24rpx;
  2201. }
  2202. .list-cell-le {
  2203. width: 224rpx;
  2204. height: 100%;
  2205. box-sizing: border-box;
  2206. padding: 37rpx 0;
  2207. float: left;
  2208. .coupon-maxMoney {
  2209. width: 100%;
  2210. height: 78rpx;
  2211. line-height: 78rpx;
  2212. font-size: 56rpx;
  2213. color: #ffffff;
  2214. text-align: center;
  2215. .small {
  2216. font-size: $font-size-24;
  2217. }
  2218. }
  2219. .coupon-minMoney {
  2220. width: 100%;
  2221. height: 33rpx;
  2222. line-height: 33rpx;
  2223. font-size: $font-size-24;
  2224. color: #ffffff;
  2225. text-align: center;
  2226. }
  2227. }
  2228. .list-cell-ri {
  2229. width: 478rpx;
  2230. height: 100%;
  2231. box-sizing: border-box;
  2232. padding: 20rpx 24rpx 0 24rpx;
  2233. float: right;
  2234. .list-cell-top {
  2235. width: 100%;
  2236. height: 121rpx;
  2237. float: left;
  2238. border-bottom: 1px solid #e1e1e1;
  2239. .list-cell-type {
  2240. width: 286rpx;
  2241. height: 100%;
  2242. float: left;
  2243. .list-cell-tags {
  2244. width: 100%;
  2245. height: 32rpx;
  2246. margin-bottom: 7rpx;
  2247. .tags {
  2248. display: inline-block;
  2249. padding: 0 10rpx;
  2250. height: 32rpx;
  2251. line-height: 32rpx;
  2252. background-color: #ffdcce;
  2253. color: #f94b4b;
  2254. font-size: $font-size-20;
  2255. border-radius: 8rpx;
  2256. text-align: center;
  2257. float: left;
  2258. }
  2259. }
  2260. .list-cell-texts {
  2261. width: 100%;
  2262. height: auto;
  2263. line-height: 35rpx;
  2264. text-overflow: ellipsis;
  2265. display: -webkit-box;
  2266. word-break: break-all;
  2267. -webkit-box-orient: vertical;
  2268. -webkit-line-clamp: 2;
  2269. overflow: hidden;
  2270. font-size: 26rpx;
  2271. color: #333333;
  2272. }
  2273. }
  2274. .list-cell-btn {
  2275. width: 128rpx;
  2276. height: 100%;
  2277. float: right;
  2278. .icon-used {
  2279. width: 100%;
  2280. height: 100%;
  2281. box-sizing: border-box;
  2282. padding-top: 28rpx;
  2283. .icon-used-text {
  2284. width: 100%;
  2285. text-align: center;
  2286. line-height: 26rpx;
  2287. font-size: $font-size-20;
  2288. color: #f94b4b;
  2289. }
  2290. .icon-used-btn {
  2291. width: 128rpx;
  2292. height: 48rpx;
  2293. border-radius: 28rpx;
  2294. line-height: 48rpx;
  2295. font-size: $font-size-26;
  2296. text-align: center;
  2297. &.receive {
  2298. background-image: linear-gradient(270deg, #f94b4b 0%, #feb673 100%);
  2299. color: #ffffff;
  2300. }
  2301. &.make {
  2302. border: solid 1px #f94b4b;
  2303. color: #f94b4b;
  2304. }
  2305. }
  2306. }
  2307. }
  2308. }
  2309. .list-cell-time {
  2310. width: 100%;
  2311. height: 58rpx;
  2312. line-height: 58rpx;
  2313. text-align: left;
  2314. font-size: $font-size-20;
  2315. color: #999999;
  2316. }
  2317. }
  2318. }
  2319. }
  2320. .tui-popup-coupon {
  2321. width: 100%;
  2322. height: 500rpx;
  2323. box-sizing: border-box;
  2324. padding: 30rpx 20rpx;
  2325. .tui-popup-h1 {
  2326. width: 100%;
  2327. height: 66rpx;
  2328. display: flex;
  2329. align-items: center;
  2330. .tui-popup-text {
  2331. flex: 1;
  2332. height: 66rpx;
  2333. line-height: 66rpx;
  2334. font-size: $font-size-30;
  2335. color: #333333;
  2336. &.red {
  2337. color: #f94b4b;
  2338. }
  2339. &.bold {
  2340. font-weight: bold;
  2341. }
  2342. &.left {
  2343. text-align: left;
  2344. }
  2345. &.right {
  2346. text-align: right;
  2347. }
  2348. }
  2349. }
  2350. }
  2351. }
  2352. }
  2353. .footer {
  2354. width: 100%;
  2355. background-color: #ffffff;
  2356. height: 110rpx;
  2357. position: fixed;
  2358. bottom: 0rpx;
  2359. z-index: 990;
  2360. .footer-le {
  2361. width: 520rpx;
  2362. height: 100%;
  2363. padding-left: 24rpx;
  2364. float: left;
  2365. box-sizing: border-box;
  2366. .foot-check {
  2367. width: 100rpx;
  2368. float: left;
  2369. line-height: 110rpx;
  2370. font-size: $font-size-24;
  2371. .checkbox {
  2372. width: 40rpx;
  2373. text-align: center;
  2374. }
  2375. .text {
  2376. width: 60rpx;
  2377. float: right;
  2378. }
  2379. }
  2380. .sum {
  2381. width: 360rpx;
  2382. height: 110rpx;
  2383. float: right;
  2384. box-sizing: border-box;
  2385. padding: 10rpx;
  2386. .sum-none {
  2387. width: 100%;
  2388. height: 45rpx;
  2389. line-height: 45rpx;
  2390. color: $text-color;
  2391. float: left;
  2392. text-align: left;
  2393. .money {
  2394. font-size: $font-size-24;
  2395. color: #999999;
  2396. text-decoration: line-through;
  2397. }
  2398. .money-sign {
  2399. font-size: $font-size-24;
  2400. color: #999999;
  2401. text-decoration: line-through;
  2402. }
  2403. .money-reduced {
  2404. margin-left: 10rpx;
  2405. font-size: $font-size-24;
  2406. color: #ff2a2a;
  2407. }
  2408. .money-popup {
  2409. height: 45rpx;
  2410. line-height: 45rpx;
  2411. display: inline-block;
  2412. float: right;
  2413. font-size: $font-size-24;
  2414. color: #ff2a2a;
  2415. .icon-xiangshangjiantou {
  2416. font-size: $font-size-30;
  2417. margin-left: 5rpx;
  2418. }
  2419. }
  2420. }
  2421. .sum-price {
  2422. width: 100%;
  2423. height: 45rpx;
  2424. line-height: 45rpx;
  2425. font-size: $font-size-30;
  2426. color: $text-color;
  2427. float: left;
  2428. font-weight: normal;
  2429. text-align: left;
  2430. &.none {
  2431. height: 90rpx;
  2432. line-height: 90rpx;
  2433. }
  2434. .money {
  2435. color: #ff2a2a;
  2436. }
  2437. .money-sign {
  2438. font-size: $font-size-24;
  2439. color: #ff2a2a;
  2440. }
  2441. }
  2442. }
  2443. }
  2444. .footer-ri {
  2445. width: 230rpx;
  2446. height: 100%;
  2447. float: right;
  2448. display: flex;
  2449. justify-content: space-between;
  2450. align-items: center;
  2451. z-index: 999;
  2452. box-sizing: border-box;
  2453. padding: 13rpx 15rpx 13rpx 5rpx;
  2454. &.none {
  2455. display: none;
  2456. }
  2457. .btn {
  2458. width: 200rpx;
  2459. height: 100%;
  2460. background: linear-gradient(135deg, rgba(242, 143, 49, 1) 0%, rgba(225, 86, 22, 1) 100%);
  2461. font-size: $font-size-28;
  2462. line-height: 84rpx;
  2463. color: #ffffff;
  2464. display: flex;
  2465. border-radius: 42rpx;
  2466. justify-content: center;
  2467. align-items: center;
  2468. }
  2469. }
  2470. .footer-del {
  2471. width: 400rpx;
  2472. height: 110rpx;
  2473. position: absolute;
  2474. padding-left: 200rpx;
  2475. background: #ffffff;
  2476. right: 0;
  2477. top: 0;
  2478. z-index: 1000;
  2479. &.show {
  2480. animation: showDelbtn 0s linear both;
  2481. }
  2482. &.none {
  2483. animation: hideDelbtn 0s linear both;
  2484. }
  2485. .btn {
  2486. width: 50%;
  2487. height: 100%;
  2488. line-height: 110rpx;
  2489. font-size: $font-size-28;
  2490. color: #ffffff;
  2491. text-align: center;
  2492. float: left;
  2493. }
  2494. .btn.btn-cancel {
  2495. background: #eec1ab;
  2496. }
  2497. .btn.btn-confirm {
  2498. background: #ff2a2a;
  2499. }
  2500. @keyframes showDelbtn {
  2501. 0% {
  2502. transform: translateX(0);
  2503. }
  2504. 100% {
  2505. transform: translateX(-100%);
  2506. }
  2507. }
  2508. @keyframes hideDelbtn {
  2509. 0% {
  2510. transform: translateX(-100%);
  2511. }
  2512. 100% {
  2513. transform: translateX(0);
  2514. }
  2515. }
  2516. }
  2517. }
  2518. </style>