index.vue 64 KB

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