index.vue 58 KB

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