index.vue 69 KB

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