index.vue 69 KB

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