index.vue 63 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403
  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">{{ 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. goNavto(url) {
  1324. uni.navigateTo({
  1325. url
  1326. })
  1327. },
  1328. navToListPage(id) {
  1329. this.isModallayer = true
  1330. this.$api.navigateTo(`/pages/goods/product?id=${id}`)
  1331. },
  1332. failureToProduct(failure) {
  1333. if (failure.status == 1) {
  1334. this.$util.msg('商品已丢失,不能查看', 2000)
  1335. return
  1336. } else if (failure.status == 2) {
  1337. this.$util.msg('商品已停售,不能查看', 2000)
  1338. return
  1339. } else {
  1340. this.isModallayer = true
  1341. this.$api.navigateTo(`/pages/goods/product?id=${failure.productId}`)
  1342. }
  1343. },
  1344. failureStateText(state) {
  1345. let stateText = '',
  1346. stateTextObject = {
  1347. 1: '商品已丢失',
  1348. 2: '商品已停售',
  1349. 3: '商品已下架',
  1350. 4: '商品已售罄',
  1351. 5: '价格仅会员可见,您不能购买',
  1352. 6: '未公开价格',
  1353. 7: '库存不足',
  1354. 8: '价格仅医美机构可见'
  1355. }
  1356. Object.keys(stateTextObject).forEach(key => {
  1357. if (key == state) {
  1358. stateText = stateTextObject[key]
  1359. }
  1360. })
  1361. return stateText
  1362. },
  1363. setHeaderBtnPosi() {
  1364. // 获得胶囊按钮位置信息
  1365. let headerBtnPosi = uni.getMenuButtonBoundingClientRect()
  1366. return headerBtnPosi
  1367. },
  1368. setSysteminfo() {
  1369. let systeminfo
  1370. uni.getSystemInfo({
  1371. // 获取设备信息
  1372. success: res => {
  1373. systeminfo = res
  1374. }
  1375. })
  1376. return systeminfo
  1377. },
  1378. PromotionsFormat(promo) {
  1379. //促销活动类型数据处理
  1380. if (promo != null) {
  1381. if (promo.type == 1 && promo.mode == 1) {
  1382. return true
  1383. } else {
  1384. return false
  1385. }
  1386. }
  1387. return false
  1388. },
  1389. queryPopupCoupons() {
  1390. // 获取弹窗优惠券列表
  1391. this.ProductService.ShoppingCartGetCoupon(this.couponParam)
  1392. .then(response => {
  1393. let data = response.data
  1394. this.navbar[0].num = data.notCouponNum
  1395. this.navbar[1].num = data.couponNum
  1396. if (data.couponList && data.couponList.length > 0) {
  1397. this.productCouponList = data.couponList
  1398. this.isCouponEmpty = false
  1399. } else {
  1400. this.isCouponEmpty = true
  1401. }
  1402. })
  1403. .catch(error => {
  1404. console.log('获取优惠券列表失败')
  1405. })
  1406. },
  1407. receiveCoupon(coupon) {
  1408. // 点击优惠券领取按钮
  1409. this.ProductService.ReceiveCoupon({
  1410. userId: this.couponParam.userId,
  1411. couponId: coupon.couponId,
  1412. source: 2
  1413. })
  1414. .then(response => {
  1415. this.$util.msg('领取成功', 1500, true, 'success')
  1416. setTimeout(() => {
  1417. this.currentTab = 1
  1418. this.couponParam.status = 2
  1419. this.queryPopupCoupons()
  1420. }, 1500)
  1421. })
  1422. .catch(error => {
  1423. this.$util.msg(error.msg, 2000)
  1424. })
  1425. },
  1426. showPopup(index, shop) {
  1427. // 显示popup弹窗
  1428. switch (index) {
  1429. case 0:
  1430. this.currentTab = 0
  1431. this.couponParam.status = 1
  1432. this.couponParam.shopId = shop.shopId
  1433. this.queryPopupCoupons()
  1434. this.popupShow0 = true
  1435. break
  1436. case 1:
  1437. this.popupShow1 = true
  1438. break
  1439. }
  1440. },
  1441. hidePopup(index) {
  1442. // 隐藏popup弹窗
  1443. switch (index) {
  1444. case 0:
  1445. this.popupShow0 = false
  1446. break
  1447. case 1:
  1448. this.popupShow1 = false
  1449. break
  1450. }
  1451. },
  1452. couponChange(e) {
  1453. this.currentTab = e.index
  1454. switch (this.currentTab) {
  1455. case 0:
  1456. this.couponParam.status = 1
  1457. this.queryPopupCoupons()
  1458. break
  1459. case 1:
  1460. this.couponParam.status = 2
  1461. this.queryPopupCoupons()
  1462. break
  1463. }
  1464. }
  1465. }
  1466. }
  1467. </script>
  1468. <style lang="scss">
  1469. page {
  1470. background: #f7f7f7;
  1471. height: auto;
  1472. }
  1473. .cart-content {
  1474. position: relative;
  1475. }
  1476. .container-cart-main.none {
  1477. display: none;
  1478. }
  1479. .container-cart-main.show {
  1480. display: block;
  1481. }
  1482. .cart-content.empty.none {
  1483. display: none;
  1484. }
  1485. .cart-content.empty.show {
  1486. display: block;
  1487. }
  1488. .container-cart.show {
  1489. display: block;
  1490. }
  1491. .container-cart.none {
  1492. display: none;
  1493. }
  1494. .empty-container.none {
  1495. display: none;
  1496. }
  1497. .empty-container.show {
  1498. display: flex;
  1499. }
  1500. .foot-check-delbtn {
  1501. width: 100%;
  1502. height: 80rpx;
  1503. position: fixed;
  1504. top: 0;
  1505. left: 0;
  1506. box-sizing: border-box;
  1507. padding: 15rpx 24rpx;
  1508. background-color: #f7f7f7;
  1509. z-index: 990;
  1510. .foot-text {
  1511. font-size: $font-size-26;
  1512. height: 50rpx;
  1513. line-height: 50rpx;
  1514. color: #666666;
  1515. float: left;
  1516. padding-left: 10rpx;
  1517. text {
  1518. margin: 0 6rpx;
  1519. }
  1520. }
  1521. .delBtn {
  1522. width: 100rpx;
  1523. display: inline-block;
  1524. padding: 0 15rpx;
  1525. font-size: $font-size-26;
  1526. height: 50rpx;
  1527. line-height: 50rpx;
  1528. border-radius: 30rpx;
  1529. background: #ffffff;
  1530. border: 1px solid #e15616;
  1531. color: #e15616;
  1532. float: right;
  1533. text-align: center;
  1534. &.none {
  1535. display: none;
  1536. }
  1537. }
  1538. }
  1539. .checkbox-box {
  1540. display: flex;
  1541. align-items: center;
  1542. .checkbox {
  1543. display: flex;
  1544. margin: 0;
  1545. padding: 5rpx;
  1546. display: flex;
  1547. flex-direction: column;
  1548. align-items: center;
  1549. box-sizing: border-box;
  1550. text-align: center;
  1551. text-decoration: none;
  1552. border-radius: 0;
  1553. -webkit-tap-highlight-color: transparent;
  1554. overflow: hidden;
  1555. background-color: #ffffff;
  1556. font-size: 36rpx;
  1557. color: #999999;
  1558. &.icon-yixuanze {
  1559. color: $color-system;
  1560. }
  1561. }
  1562. &.disabled {
  1563. .checkbox {
  1564. color: #999999;
  1565. }
  1566. }
  1567. .text {
  1568. font-size: $font-size-24;
  1569. margin-left: 10rpx;
  1570. }
  1571. }
  1572. .goods-list {
  1573. width: 100%;
  1574. height: auto;
  1575. background-color: #f7f7f7;
  1576. .goods-item {
  1577. width: 702rpx;
  1578. padding: 0 24rpx;
  1579. background: #ffffff;
  1580. margin-bottom: 24rpx;
  1581. }
  1582. .shoptitle {
  1583. height: 80rpx;
  1584. line-height: 80rpx;
  1585. .checkbox-box {
  1586. float: left;
  1587. line-height: 80rpx;
  1588. display: inline-block;
  1589. box-sizing: border-box;
  1590. }
  1591. .text {
  1592. width: 400rpx;
  1593. float: left;
  1594. display: block;
  1595. overflow: hidden;
  1596. text-overflow: ellipsis;
  1597. white-space: nowrap;
  1598. line-height: 80rpx;
  1599. margin-left: 20rpx;
  1600. font-size: $font-size-28;
  1601. color: $text-color;
  1602. text-align: left;
  1603. font-weight: bold;
  1604. }
  1605. .text-coupon {
  1606. float: right;
  1607. line-height: 80rpx;
  1608. font-size: $font-size-30;
  1609. color: #e15616;
  1610. }
  1611. .floor-item-act {
  1612. width: 120rpx;
  1613. height: 80rpx;
  1614. text-align: center;
  1615. box-sizing: border-box;
  1616. float: left;
  1617. padding: 24rpx 0;
  1618. margin-left: 20rpx;
  1619. }
  1620. }
  1621. .goods-pros {
  1622. width: 100%;
  1623. height: auto;
  1624. margin-bottom: 20rpx;
  1625. }
  1626. .goods-pros-t {
  1627. display: flex;
  1628. align-items: center;
  1629. width: 100%;
  1630. height: 210rpx;
  1631. padding: 0 0 26rpx 0;
  1632. .checkbox-box {
  1633. // padding: 10rpx;
  1634. }
  1635. .pros-img {
  1636. width: 210rpx;
  1637. height: 100%;
  1638. border-radius: 10rpx;
  1639. margin: 0 20rpx;
  1640. border: 1px solid #f3f3f3;
  1641. image {
  1642. width: 100%;
  1643. height: 100%;
  1644. border-radius: 10rpx;
  1645. }
  1646. }
  1647. }
  1648. .goods-pros-b {
  1649. width: 100%;
  1650. height: auto;
  1651. padding: 0 0 24rpx 0;
  1652. box-sizing: border-box;
  1653. &.show {
  1654. display: block;
  1655. }
  1656. &.none {
  1657. display: none;
  1658. }
  1659. .sum-none {
  1660. width: 100%;
  1661. height: 48rpx;
  1662. line-height: 48rpx;
  1663. color: $text-color;
  1664. float: left;
  1665. text-align: right;
  1666. .money {
  1667. font-size: $font-size-26;
  1668. color: #999999;
  1669. text-decoration: line-through;
  1670. }
  1671. .money-sign {
  1672. font-size: $font-size-26;
  1673. color: #999999;
  1674. text-decoration: line-through;
  1675. }
  1676. .money-reduced {
  1677. margin-left: 10rpx;
  1678. font-size: $font-size-26;
  1679. color: $color-system;
  1680. .iconfont {
  1681. font-size: $font-size-34;
  1682. }
  1683. }
  1684. }
  1685. .sum {
  1686. width: 100%;
  1687. height: 40rpx;
  1688. font-size: $font-size-26;
  1689. line-height: 40rpx;
  1690. color: $text-color;
  1691. float: left;
  1692. display: flex;
  1693. justify-content: flex-end;
  1694. font-weight: bold;
  1695. .money {
  1696. color: #ff2a2a;
  1697. font-size: $font-size-26;
  1698. }
  1699. .money-sign {
  1700. font-size: $font-size-24;
  1701. color: #ff2a2a;
  1702. }
  1703. }
  1704. }
  1705. .pros-product {
  1706. width: 416rpx;
  1707. height: 100%;
  1708. line-height: 36rpx;
  1709. font-size: $font-size-28;
  1710. position: relative;
  1711. .producttitle {
  1712. width: 100%;
  1713. display: inline-block;
  1714. height: auto;
  1715. text-overflow: ellipsis;
  1716. display: -webkit-box;
  1717. word-break: break-all;
  1718. -webkit-box-orient: vertical;
  1719. -webkit-line-clamp: 2;
  1720. overflow: hidden;
  1721. margin-bottom: 15rpx;
  1722. .no-text {
  1723. display: inline-block;
  1724. height: 36rpx;
  1725. padding: 0 12rpx;
  1726. line-height: 36rpx;
  1727. background: linear-gradient(315deg, rgba(231, 0, 0, 1) 0%, rgba(255, 104, 1, 1) 100%);
  1728. border-radius: 18rpx;
  1729. text-align: center;
  1730. color: #ffffff;
  1731. font-size: $font-size-28;
  1732. margin-right: 24rpx;
  1733. }
  1734. }
  1735. .productspec {
  1736. height: 36rpx;
  1737. color: #999999;
  1738. font-size: $font-size-26;
  1739. }
  1740. .productprice {
  1741. width: 100%;
  1742. height: 48rpx;
  1743. margin: 30rpx 0 0 0;
  1744. .price {
  1745. line-height: 48rpx;
  1746. font-size: $font-size-26;
  1747. width: 48%;
  1748. color: #ff2a2a;
  1749. float: left;
  1750. font-weight: bold;
  1751. &.disabled {
  1752. color: #999999;
  1753. text-decoration: line-through;
  1754. }
  1755. .money-sign {
  1756. font-size: $font-size-24;
  1757. color: #ff2a2a;
  1758. }
  1759. }
  1760. .count {
  1761. height: 100%;
  1762. float: right;
  1763. position: relative;
  1764. &.show {
  1765. display: block;
  1766. }
  1767. &.none {
  1768. display: none;
  1769. }
  1770. .count-tips {
  1771. width: auto;
  1772. display: inline-block;
  1773. padding: 0 15rpx;
  1774. line-height: 44rpx;
  1775. height: 44rpx;
  1776. border-radius: 22rpx;
  1777. background: $btn-confirm;
  1778. font-size: $font-size-24;
  1779. text-align: center;
  1780. color: #ffffff;
  1781. position: absolute;
  1782. top: -60rpx;
  1783. left: -5rpx;
  1784. z-index: 5;
  1785. &.step {
  1786. left: -217rpx;
  1787. }
  1788. &::before {
  1789. content: '';
  1790. position: absolute;
  1791. bottom: -30rpx;
  1792. right: 15rpx;
  1793. z-index: 1;
  1794. width: 0;
  1795. height: 0;
  1796. border-width: 18rpx;
  1797. border-style: solid;
  1798. border-color: $color-system transparent transparent transparent;
  1799. }
  1800. }
  1801. .number-box {
  1802. display: flex;
  1803. justify-content: center;
  1804. align-items: center;
  1805. border: 2rpx solid #ffe6dc;
  1806. border-radius: 30rpx;
  1807. .iconfont {
  1808. font-size: $font-size-24;
  1809. padding: 0 18rpx;
  1810. color: #999999;
  1811. text-align: center;
  1812. line-height: 48rpx;
  1813. font-weight: bold;
  1814. background: #fef6f3;
  1815. &.icon-jianhao {
  1816. border-radius: 30rpx 0 0 30rpx;
  1817. }
  1818. &.icon-jiahao {
  1819. border-radius: 0 30rpx 30rpx 0;
  1820. }
  1821. }
  1822. .btn-input {
  1823. width: 62rpx;
  1824. height: 48rpx;
  1825. line-height: 48rpx;
  1826. background: #fff;
  1827. border-radius: 4rpx;
  1828. text-align: center;
  1829. font-size: $font-size-24;
  1830. }
  1831. }
  1832. .uni-numbox {
  1833. position: absolute;
  1834. left: 45rpx;
  1835. bottom: 0;
  1836. .uni-numbox-minus,
  1837. .uni-numbox-plus {
  1838. width: 50rpx;
  1839. line-height: 40rpx;
  1840. }
  1841. .uni-numbox-value {
  1842. font-size: $font-size-28;
  1843. width: 60rpx;
  1844. }
  1845. }
  1846. }
  1847. }
  1848. .floor-item-act {
  1849. width: 100%;
  1850. height: 56rpx;
  1851. text-align: center;
  1852. box-sizing: border-box;
  1853. float: left;
  1854. padding: 0 0 10rpx 0;
  1855. margin-left: 10rpx;
  1856. }
  1857. }
  1858. }
  1859. .failure-list {
  1860. width: 702rpx;
  1861. height: auto;
  1862. padding: 0 24rpx;
  1863. margin-top: 20rpx;
  1864. background: #ffffff;
  1865. .failure-title {
  1866. width: 100%;
  1867. height: 82rpx;
  1868. line-height: 82rpx;
  1869. font-size: $font-size-28;
  1870. border-bottom: 1px solid #ebebeb;
  1871. .title-txt {
  1872. float: left;
  1873. color: #666666;
  1874. text-align: left;
  1875. }
  1876. .title-btn {
  1877. float: right;
  1878. color: $color-system;
  1879. text-align: right;
  1880. line-height: 80rpx;
  1881. .butto {
  1882. display: inline-block;
  1883. padding: 0 15rpx;
  1884. font-size: $font-size-26;
  1885. height: 50rpx;
  1886. line-height: 50rpx;
  1887. border-radius: 30rpx;
  1888. background: #ffffff;
  1889. // border: 1px solid #C9C9C9;
  1890. // color: #999999;
  1891. margin-top: 15rpx;
  1892. }
  1893. }
  1894. }
  1895. .productlist {
  1896. padding-top: 10rpx;
  1897. .goods-pros {
  1898. width: 100%;
  1899. height: auto;
  1900. padding: 20rpx 0;
  1901. }
  1902. .goods-pros-t {
  1903. display: flex;
  1904. align-items: center;
  1905. width: 100%;
  1906. height: 210rpx;
  1907. position: relative;
  1908. .img-tip {
  1909. display: block;
  1910. width: 72rpx;
  1911. height: 36rpx;
  1912. line-height: 36rpx;
  1913. font-size: $font-size-24;
  1914. text-align: center;
  1915. color: #ffffff;
  1916. border-radius: 24rpx;
  1917. background: rgba(51, 51, 51, 0.3);
  1918. // position: absolute;
  1919. // left: 0;
  1920. // top: 0;
  1921. }
  1922. .checkbox-box {
  1923. padding: 10rpx;
  1924. }
  1925. .pros-img {
  1926. width: 180rpx;
  1927. height: 100%;
  1928. border-radius: 10rpx;
  1929. margin: 0 20rpx;
  1930. border: 1px solid #f3f3f3;
  1931. position: relative;
  1932. image {
  1933. width: 100%;
  1934. height: 100%;
  1935. border-radius: 10rpx;
  1936. }
  1937. }
  1938. .pros-marks {
  1939. width: 730rpx;
  1940. height: 250rpx;
  1941. z-index: 90;
  1942. background: rgba(0, 0, 0, 0.05);
  1943. position: absolute;
  1944. left: -20rpx;
  1945. top: -20rpx;
  1946. }
  1947. }
  1948. .goods-pros-b {
  1949. width: 622rpx;
  1950. margin-left: 84rpx;
  1951. height: 40rpx;
  1952. padding: 0 0 26rpx 0;
  1953. // border-top: 1px solid #EBEBEB;
  1954. &.show {
  1955. display: block;
  1956. }
  1957. &.none {
  1958. display: none;
  1959. }
  1960. .sum {
  1961. font-size: $font-size-28;
  1962. line-height: 40rpx;
  1963. color: $text-color;
  1964. display: flex;
  1965. justify-content: flex-end;
  1966. .money {
  1967. color: #ff2a2a;
  1968. font-size: $font-size-28;
  1969. }
  1970. .money-sign {
  1971. font-size: $font-size-24;
  1972. color: #ff2a2a;
  1973. }
  1974. }
  1975. }
  1976. .pros-product {
  1977. width: 402rpx;
  1978. height: 100%;
  1979. line-height: 36rpx;
  1980. font-size: $font-size-28;
  1981. position: relative;
  1982. .producttitle {
  1983. width: 100%;
  1984. display: inline-block;
  1985. height: auto;
  1986. text-overflow: ellipsis;
  1987. display: -webkit-box;
  1988. word-break: break-all;
  1989. -webkit-box-orient: vertical;
  1990. -webkit-line-clamp: 2;
  1991. overflow: hidden;
  1992. margin-bottom: 8rpx;
  1993. .no-text {
  1994. display: inline-block;
  1995. height: 36rpx;
  1996. padding: 0 12rpx;
  1997. line-height: 36rpx;
  1998. background: linear-gradient(315deg, rgba(231, 0, 0, 1) 0%, rgba(255, 104, 1, 1) 100%);
  1999. border-radius: 18rpx;
  2000. text-align: center;
  2001. color: #ffffff;
  2002. font-size: $font-size-28;
  2003. margin-right: 24rpx;
  2004. }
  2005. }
  2006. .productspec {
  2007. height: 36rpx;
  2008. color: #999999;
  2009. font-size: $font-size-26;
  2010. margin-top: 20rpx;
  2011. }
  2012. .productstate {
  2013. font-size: $font-size-28;
  2014. height: 44rpx;
  2015. color: #ff2a2a;
  2016. position: absolute;
  2017. bottom: 0;
  2018. left: 0;
  2019. }
  2020. }
  2021. }
  2022. }
  2023. .tui-popup-box {
  2024. position: relative;
  2025. box-sizing: border-box;
  2026. min-height: 220rpx;
  2027. padding: 24rpx 24rpx 0 24rpx;
  2028. .tui-popup-close {
  2029. width: 90rpx;
  2030. height: 90rpx;
  2031. position: absolute;
  2032. right: 0;
  2033. top: 24rpx;
  2034. line-height: 90rpx;
  2035. text-align: center;
  2036. color: #b2b2b2;
  2037. .icon-iconfontguanbi {
  2038. font-size: $font-size-40;
  2039. }
  2040. }
  2041. .title {
  2042. font-size: $font-size-34;
  2043. color: $text-color;
  2044. line-height: 88rpx;
  2045. text-align: center;
  2046. float: left;
  2047. width: 100%;
  2048. height: 88rpx;
  2049. font-weight: bold;
  2050. }
  2051. .tui-popup-main {
  2052. width: 100%;
  2053. float: left;
  2054. &.coupon {
  2055. padding-bottom: 40rpx;
  2056. .coupon-empty {
  2057. width: 100%;
  2058. height: 600rpx;
  2059. display: flex;
  2060. align-items: center;
  2061. justify-content: center;
  2062. flex-direction: column;
  2063. position: fixed;
  2064. background: $bg-color;
  2065. .empty-container-image {
  2066. width: 150rpx;
  2067. height: 150rpx;
  2068. margin-bottom: 0;
  2069. margin-top: 0;
  2070. }
  2071. .error-text {
  2072. font-size: $font-size-28;
  2073. color: #999999;
  2074. line-height: 88rpx;
  2075. }
  2076. }
  2077. }
  2078. .tui-popup-scroll {
  2079. width: 100%;
  2080. height: 600rpx;
  2081. .coupon-list {
  2082. width: 100%;
  2083. height: 200rpx;
  2084. margin-top: 24rpx;
  2085. box-sizing: border-box;
  2086. background: url(https://static.caimei365.com/app/img/icon/icon-coupon-uesb@2x.png);
  2087. background-size: cover;
  2088. &:last-child {
  2089. margin-bottom: 24rpx;
  2090. }
  2091. .list-cell-le {
  2092. width: 224rpx;
  2093. height: 100%;
  2094. box-sizing: border-box;
  2095. padding: 37rpx 0;
  2096. float: left;
  2097. .coupon-maxMoney {
  2098. width: 100%;
  2099. height: 78rpx;
  2100. line-height: 78rpx;
  2101. font-size: 56rpx;
  2102. color: #ffffff;
  2103. text-align: center;
  2104. .small {
  2105. font-size: $font-size-24;
  2106. }
  2107. }
  2108. .coupon-minMoney {
  2109. width: 100%;
  2110. height: 33rpx;
  2111. line-height: 33rpx;
  2112. font-size: $font-size-24;
  2113. color: #ffffff;
  2114. text-align: center;
  2115. }
  2116. }
  2117. .list-cell-ri {
  2118. width: 478rpx;
  2119. height: 100%;
  2120. box-sizing: border-box;
  2121. padding: 20rpx 24rpx 0 24rpx;
  2122. float: right;
  2123. .list-cell-top {
  2124. width: 100%;
  2125. height: 121rpx;
  2126. float: left;
  2127. border-bottom: 1px solid #e1e1e1;
  2128. .list-cell-type {
  2129. width: 286rpx;
  2130. height: 100%;
  2131. float: left;
  2132. .list-cell-tags {
  2133. width: 100%;
  2134. height: 32rpx;
  2135. margin-bottom: 7rpx;
  2136. .tags {
  2137. display: inline-block;
  2138. padding: 0 10rpx;
  2139. height: 32rpx;
  2140. line-height: 32rpx;
  2141. background-color: #ffdcce;
  2142. color: #f94b4b;
  2143. font-size: $font-size-20;
  2144. border-radius: 8rpx;
  2145. text-align: center;
  2146. float: left;
  2147. }
  2148. }
  2149. .list-cell-texts {
  2150. width: 100%;
  2151. height: auto;
  2152. line-height: 35rpx;
  2153. text-overflow: ellipsis;
  2154. display: -webkit-box;
  2155. word-break: break-all;
  2156. -webkit-box-orient: vertical;
  2157. -webkit-line-clamp: 2;
  2158. overflow: hidden;
  2159. font-size: 26rpx;
  2160. color: #333333;
  2161. }
  2162. }
  2163. .list-cell-btn {
  2164. width: 128rpx;
  2165. height: 100%;
  2166. float: right;
  2167. .icon-used {
  2168. width: 100%;
  2169. height: 100%;
  2170. box-sizing: border-box;
  2171. padding-top: 57rpx;
  2172. .icon-used-btn {
  2173. width: 128rpx;
  2174. height: 48rpx;
  2175. border-radius: 28rpx;
  2176. line-height: 48rpx;
  2177. font-size: $font-size-26;
  2178. text-align: center;
  2179. &.receive {
  2180. background-image: linear-gradient(270deg, #f94b4b 0%, #feb673 100%);
  2181. color: #ffffff;
  2182. }
  2183. &.make {
  2184. border: solid 1px #f94b4b;
  2185. color: #f94b4b;
  2186. }
  2187. }
  2188. }
  2189. }
  2190. }
  2191. .list-cell-time {
  2192. width: 100%;
  2193. height: 58rpx;
  2194. line-height: 58rpx;
  2195. text-align: left;
  2196. font-size: $font-size-20;
  2197. color: #999999;
  2198. }
  2199. }
  2200. }
  2201. }
  2202. .tui-popup-coupon {
  2203. width: 100%;
  2204. height: 500rpx;
  2205. box-sizing: border-box;
  2206. padding: 30rpx 20rpx;
  2207. .tui-popup-h1 {
  2208. width: 100%;
  2209. height: 66rpx;
  2210. display: flex;
  2211. align-items: center;
  2212. .tui-popup-text {
  2213. flex: 1;
  2214. height: 66rpx;
  2215. line-height: 66rpx;
  2216. font-size: $font-size-30;
  2217. color: #333333;
  2218. &.red {
  2219. color: #f94b4b;
  2220. }
  2221. &.bold {
  2222. font-weight: bold;
  2223. }
  2224. &.left {
  2225. text-align: left;
  2226. }
  2227. &.right {
  2228. text-align: right;
  2229. }
  2230. }
  2231. }
  2232. }
  2233. }
  2234. }
  2235. .footer {
  2236. width: 100%;
  2237. background-color: #ffffff;
  2238. height: 110rpx;
  2239. position: fixed;
  2240. bottom: 0rpx;
  2241. z-index: 990;
  2242. .footer-le {
  2243. width: 520rpx;
  2244. height: 100%;
  2245. padding-left: 24rpx;
  2246. float: left;
  2247. box-sizing: border-box;
  2248. .foot-check {
  2249. width: 100rpx;
  2250. float: left;
  2251. line-height: 110rpx;
  2252. font-size: $font-size-24;
  2253. .checkbox {
  2254. width: 40rpx;
  2255. text-align: center;
  2256. }
  2257. .text {
  2258. width: 60rpx;
  2259. float: right;
  2260. }
  2261. }
  2262. .sum {
  2263. width: 360rpx;
  2264. height: 110rpx;
  2265. float: right;
  2266. box-sizing: border-box;
  2267. padding: 10rpx;
  2268. .sum-none {
  2269. width: 100%;
  2270. height: 45rpx;
  2271. line-height: 45rpx;
  2272. color: $text-color;
  2273. float: left;
  2274. text-align: left;
  2275. .money {
  2276. font-size: $font-size-24;
  2277. color: #999999;
  2278. text-decoration: line-through;
  2279. }
  2280. .money-sign {
  2281. font-size: $font-size-24;
  2282. color: #999999;
  2283. text-decoration: line-through;
  2284. }
  2285. .money-reduced {
  2286. margin-left: 10rpx;
  2287. font-size: $font-size-24;
  2288. color: #ff2a2a;
  2289. }
  2290. .money-popup {
  2291. height: 45rpx;
  2292. line-height: 45rpx;
  2293. display: inline-block;
  2294. float: right;
  2295. font-size: $font-size-24;
  2296. color: #ff2a2a;
  2297. .icon-xiangshangjiantou {
  2298. font-size: $font-size-30;
  2299. margin-left: 5rpx;
  2300. }
  2301. }
  2302. }
  2303. .sum-price {
  2304. width: 100%;
  2305. height: 45rpx;
  2306. line-height: 45rpx;
  2307. font-size: $font-size-30;
  2308. color: $text-color;
  2309. float: left;
  2310. font-weight: normal;
  2311. text-align: left;
  2312. &.none {
  2313. height: 90rpx;
  2314. line-height: 90rpx;
  2315. }
  2316. .money {
  2317. color: #ff2a2a;
  2318. }
  2319. .money-sign {
  2320. font-size: $font-size-24;
  2321. color: #ff2a2a;
  2322. }
  2323. }
  2324. }
  2325. }
  2326. .footer-ri {
  2327. width: 230rpx;
  2328. height: 100%;
  2329. float: right;
  2330. display: flex;
  2331. justify-content: space-between;
  2332. align-items: center;
  2333. z-index: 999;
  2334. box-sizing: border-box;
  2335. padding: 13rpx 15rpx 13rpx 5rpx;
  2336. &.none {
  2337. display: none;
  2338. }
  2339. .btn {
  2340. width: 200rpx;
  2341. height: 100%;
  2342. background: linear-gradient(135deg, rgba(242, 143, 49, 1) 0%, rgba(225, 86, 22, 1) 100%);
  2343. font-size: $font-size-28;
  2344. line-height: 84rpx;
  2345. color: #ffffff;
  2346. display: flex;
  2347. border-radius: 42rpx;
  2348. justify-content: center;
  2349. align-items: center;
  2350. }
  2351. }
  2352. .footer-del {
  2353. width: 400rpx;
  2354. height: 110rpx;
  2355. position: absolute;
  2356. padding-left: 200rpx;
  2357. background: #ffffff;
  2358. right: 0;
  2359. top: 0;
  2360. z-index: 1000;
  2361. &.show {
  2362. animation: showDelbtn 0s linear both;
  2363. }
  2364. &.none {
  2365. animation: hideDelbtn 0s linear both;
  2366. }
  2367. .btn {
  2368. width: 50%;
  2369. height: 100%;
  2370. line-height: 110rpx;
  2371. font-size: $font-size-28;
  2372. color: #ffffff;
  2373. text-align: center;
  2374. float: left;
  2375. }
  2376. .btn.btn-cancel {
  2377. background: #eec1ab;
  2378. }
  2379. .btn.btn-confirm {
  2380. background: #ff2a2a;
  2381. }
  2382. @keyframes showDelbtn {
  2383. 0% {
  2384. transform: translateX(0);
  2385. }
  2386. 100% {
  2387. transform: translateX(-100%);
  2388. }
  2389. }
  2390. @keyframes hideDelbtn {
  2391. 0% {
  2392. transform: translateX(-100%);
  2393. }
  2394. 100% {
  2395. transform: translateX(0);
  2396. }
  2397. }
  2398. }
  2399. }
  2400. </style>