index.vue 66 KB

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