index.vue 65 KB

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