index.vue 67 KB

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