index.vue 58 KB

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