index.vue 68 KB

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