index.vue 58 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115
  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. let eligibleCoupons = this.calculationCoupon()
  701. if(eligibleCoupons.length>0){
  702. this.eligibleCoupons.splice(0,this.eligibleCoupons.length);
  703. this.eligibleCoupons = eligibleCoupons.sort((a,b)=> b.couponAmount - a.couponAmount)
  704. this.couponPrice = this.eligibleCoupons[0].couponAmount
  705. }else{
  706. this.couponPrice = 0
  707. }
  708. }
  709. // 最后满减金额 = 店铺减去金额 + 单品减去金额 + 凑单减去金额
  710. this.totalDiscountAmount = this.reducedPrice + this.couponPrice;
  711. // 控制显示优惠明细
  712. if(this.totalDiscountAmount > 0 ){
  713. this.isDiscount = true
  714. }else{
  715. this.isDiscount = false
  716. }
  717. },
  718. totalCount(){//计算总数量
  719. this.allCount = 0
  720. let prosAllCount=0
  721. let validCount = 0
  722. let validList =[];
  723. let productsList =[];
  724. this.goodsList.forEach(item=>{
  725. productsList = item.cartList
  726. productsList.forEach(pros=>{
  727. if(pros.productsChecked){
  728. prosAllCount+=parseInt(pros.number);
  729. this.allCount = prosAllCount
  730. }
  731. })
  732. })
  733. },
  734. calculationCoupon(){// 优惠券计算
  735. let eligibleCoupons = []
  736. this.goodsList.forEach(shop=>{
  737. shop.cartList.forEach(pros=>{
  738. if(pros.productsChecked){
  739. this.totalCouponList.forEach(coupon=>{//循环优惠券
  740. switch(coupon.couponType){
  741. case 0:// 活动券
  742. if(coupon.productType == 1){// 活动券-全商城商品
  743. if(this.allPrice >= coupon.touchPrice){
  744. eligibleCoupons.push(coupon)
  745. }
  746. }else if(coupon.productType == 2){// 活动券-指定商品
  747. if(coupon.productIds && coupon.productIds.includes(pros.productId)){
  748. if(this.allPrice >= coupon.touchPrice){
  749. eligibleCoupons.push(coupon)
  750. }
  751. }
  752. }
  753. break;
  754. case 1:// 品类券适用于产品或者仪器 categoryType(commodityType) : 1 产品 2 仪器
  755. if( coupon.categoryType && coupon.categoryType == pros.commodityType){
  756. if(this.allPrice >= coupon.touchPrice){
  757. eligibleCoupons.push(coupon)
  758. }
  759. }
  760. break;
  761. case 2:// 用户专享券 适用于商城全部商品
  762. if(this.allPrice >= coupon.touchPrice){
  763. eligibleCoupons.push(coupon)
  764. }
  765. break;
  766. case 3:// 店铺券适用于某个供应商的全部商品
  767. if(coupon.shopId && pros.supplierId == coupon.shopId){
  768. if(this.allPrice >= coupon.touchPrice){
  769. eligibleCoupons.push(coupon)
  770. }
  771. }
  772. break;
  773. case 4://新用户券 适用于商城全部商品
  774. if(this.allPrice >= coupon.touchPrice){
  775. eligibleCoupons.push(coupon)
  776. }
  777. break;
  778. }
  779. })
  780. }else{
  781. console.log('没有选择商品')
  782. return;
  783. }
  784. })
  785. })
  786. return eligibleCoupons;
  787. },
  788. changeCountAdd(item,pros){//商品数量加加
  789. if(pros.step === 2){
  790. pros.isStep = false
  791. pros.number += pros.min
  792. this.processActivityPrice(pros)
  793. this.isStock = false
  794. }else{
  795. pros.number++
  796. this.processActivityPrice(pros)
  797. this.isStock = false
  798. }
  799. this.updateShoppogNum(pros)
  800. this.totalShopPeice();
  801. },
  802. changeCountSub(item,pros){//商品数量减减
  803. if(pros.number<=pros.min){
  804. pros.number= pros.min
  805. this.$util.msg(`该商品最小起订量为${pros.min}`,2000);
  806. return
  807. }else{
  808. if(pros.step === 2){
  809. pros.isStep = false
  810. pros.number -= pros.min
  811. }else{
  812. pros.number--
  813. }
  814. this.processActivityPrice(pros)
  815. }
  816. this.updateShoppogNum(pros)
  817. this.totalShopPeice();
  818. },
  819. changeInput(pros){//输入商品数量更新
  820. pros.isStep = false
  821. },
  822. changeNnmber(e,item,pros){//输入商品数量更新
  823. let _value = Number(e.detail.value);
  824. if(!this.$api.isNumber(_value)){
  825. pros.number = pros.min
  826. }else if(_value < pros.min){
  827. this.$util.msg(`该商品最小起订量为${pros.min}`,2000);
  828. pros.number = pros.min
  829. }else if(_value % pros.min != 0){
  830. pros.isStep = true
  831. pros.number = pros.min
  832. }else{
  833. pros.isStep = false
  834. pros.number = e.detail.value
  835. this.processActivityPrice(pros)
  836. }
  837. this.updateShoppogNum(pros)
  838. this.totalShopPeice();
  839. },
  840. processActivityPrice(pros){//单独处理活动价格和阶梯价格
  841. let ladderPriceList = pros.ladderPrices;
  842. if(pros.ladderFlag == '0' || pros.actStatus == 1){
  843. pros.price = pros.price
  844. }else{
  845. ladderPriceList.forEach((item,index)=>{
  846. if(pros.number>=item.buyNum){
  847. pros.price = item.buyPrice
  848. }
  849. })
  850. }
  851. },
  852. updateShoppogNum(pros){//加减购物车商品更新到后台
  853. let params ={userID:this.userId,productID:pros.productId,productCount:pros.number}
  854. this.ProductService.ShoppingCartUpdate(params).then(response =>{
  855. this.isshowDelbtn = false;
  856. this.initGetCartGoodsList();
  857. }).catch(error =>{
  858. this.$util.msg(error.msg,2000);
  859. })
  860. },
  861. toConfirmation(){//跳转确认订单页面
  862. let setGoodsList=[];
  863. this.goodsList.forEach(res=>{
  864. let products = res.cartList
  865. products.forEach(pros=>{
  866. if(pros.productsChecked){
  867. setGoodsList.push(pros.productId)
  868. }
  869. })
  870. })
  871. if(setGoodsList == ''){
  872. this.$util.msg("请先选择结算商品~",2000);
  873. return
  874. }else{
  875. this.isNoConfim = false
  876. this.goodsList.forEach(el=>{
  877. el.cartList.forEach(pros=>{
  878. if(pros.productsChecked){
  879. if(pros.number<pros.min){
  880. this.isNoConfim = true
  881. }
  882. }
  883. })
  884. })
  885. if(this.isNoConfim){
  886. this.$util.modal('','有商品的购买量没达到最小起订量,请修改数量后再次提交结算','去修改','',false,() =>{})
  887. return;
  888. }
  889. let productID = '';
  890. this.goodsList.forEach(el=>{//获取勾选的商品ID拼接字符串逗号隔开,最后一个逗号去掉
  891. el.cartList.forEach(pros=>{
  892. if(pros.productsChecked){
  893. productID += pros.productId+','
  894. }
  895. })
  896. })
  897. let cartPramsData={
  898. allPrice:this.allPrice,
  899. allCount:this.allCount,
  900. productID:productID.substring(0,productID.lastIndexOf(',')),
  901. productCount:''
  902. }
  903. // 友盟埋点购物车去结算点击事件
  904. if(process.env.NODE_ENV != 'development'){
  905. this.$uma.trackEvent('Um_Event_shoppingCartConfirmOrder', {
  906. Um_Key_PageName: '去结算',
  907. Um_Key_SourcePage: '底部菜单购物车',
  908. })
  909. }
  910. this.$api.navigateTo(`/pages/user/order/create-order?data=${JSON.stringify({data:cartPramsData})}`)
  911. }
  912. },
  913. showDelManager(){//显示删除商品管理
  914. this.isshowDelbtn = true;
  915. if(this.isCheckAll) {
  916. this.updateBothCheckBtn();
  917. } else {
  918. this.goodsList.forEach(item => {
  919. if(item.checked) {
  920. item.cartList.forEach(pros => {
  921. pros.productsChecked = true;
  922. })
  923. }
  924. })
  925. this.updateCheckAllBtn();
  926. }
  927. // 失效也被勾选
  928. this.failureList.forEach(failureItem => {
  929. if(failureItem.isFailureLayer){
  930. failureItem.isFailureLayer = false
  931. }
  932. })
  933. },
  934. hideDelManage(){//隐藏删除商品管理
  935. this.isshowDelbtn = false;
  936. let isFailureLayer,newFailureList =[];
  937. if(this.isCheckAll) {
  938. this.updateBothCheckBtn();
  939. } else {
  940. // 失效商品取消勾选
  941. this.goodsList.forEach(item => {
  942. if(item.isDisabled) {
  943. item.checked = false;
  944. }
  945. item.cartList.forEach(pros => {
  946. if(pros.validFlag == 3) {
  947. pros.productsChecked = false;
  948. }
  949. })
  950. })
  951. this.updateCheckAllBtn();
  952. }
  953. this.failureList.forEach((failure,index) => {
  954. if(failure.failureState == 1 || failure.failureState == 2) {
  955. isFailureLayer = true
  956. }else{
  957. isFailureLayer = false
  958. }
  959. newFailureList.push(Object.assign({},failure,{isFailureLayer:isFailureLayer}))
  960. })
  961. this.failureList = newFailureList;
  962. },
  963. deleteList(){//删除购物车商品
  964. this.delGoodsList=[];
  965. this.goodsList.forEach(delitem=>{
  966. let products = delitem.cartList
  967. products.forEach(pros=>{
  968. if(pros.productsChecked){
  969. this.delGoodsList += pros.productId+','
  970. }
  971. })
  972. })
  973. this.failureList.forEach(failure=>{
  974. if(failure.productsChecked){
  975. this.delGoodsList += failure.productId+','
  976. }
  977. })
  978. if(this.delGoodsList.length == 0){
  979. this.$util.msg("请选择要删除的商品~",2000);
  980. return
  981. }else{
  982. this.$util.modal('','确定删除选中的商品吗?','确定','取消',true,() =>{
  983. this.ProductService.ShoppingCartDelete({userID:this.userId,productIDs:this.delGoodsList}).then(response =>{
  984. this.$util.msg('删除成功',2000);
  985. setTimeout(()=>{
  986. this.isshowDelbtn = false;
  987. this.initGetCartGoodsList();
  988. },2000)
  989. }).catch(error =>{
  990. this.$util.msg(error.msg,2000)
  991. })
  992. })
  993. }
  994. },
  995. deletefailureList(){
  996. this.failureList.forEach(failure=>{ this.delGoodsList += failure.productId+',' })
  997. this.$util.modal('','确定清空全部失效商品吗?','确定','取消',true,() =>{
  998. this.ProductService.ShoppingCartDelete({userID:this.userId,productIDs:this.delGoodsList}).then(response =>{
  999. this.$util.msg('删除成功',2000);
  1000. setTimeout(()=>{
  1001. this.isshowDelbtn = false;
  1002. this.initGetCartGoodsList();
  1003. },2000)
  1004. }).catch(error =>{
  1005. this.$util.msg(error.msg,2000)
  1006. })
  1007. })
  1008. },
  1009. goIndex(){
  1010. uni.switchTab({
  1011. url: '/pages/tabBar/home/index'
  1012. });
  1013. },
  1014. goNavto(url){
  1015. uni.navigateTo ({
  1016. url
  1017. })
  1018. },
  1019. navToListPage(id){
  1020. this.isModallayer = true;
  1021. this.$api.navigateTo(`/pages/goods/product?id=${id}`)
  1022. },
  1023. failureToProduct(failure){
  1024. if(failure.status == 1){
  1025. this.$util.msg('商品已丢失,不能查看',2000)
  1026. return
  1027. }else if(failure.status == 2){
  1028. this.$util.msg('商品已停售,不能查看',2000)
  1029. return
  1030. }else{
  1031. this.isModallayer = true;
  1032. this.$api.navigateTo(`/pages/goods/product?id=${failure.productId}`)
  1033. }
  1034. },
  1035. failureStateText(state){
  1036. let stateText = '',
  1037. stateTextObject={
  1038. 1:'商品已丢失',
  1039. 2:'商品已停售',
  1040. 3:'商品已下架',
  1041. 4:'商品已售罄',
  1042. 5:'价格仅会员可见,您不能购买',
  1043. 6:'未公开价格',
  1044. 7:'库存不足'
  1045. }
  1046. Object.keys(stateTextObject).forEach(key => {
  1047. if(key == state){
  1048. stateText = stateTextObject[key]
  1049. }
  1050. })
  1051. return stateText;
  1052. },
  1053. setHeaderBtnPosi(){
  1054. // 获得胶囊按钮位置信息
  1055. let headerBtnPosi = uni.getMenuButtonBoundingClientRect();
  1056. return headerBtnPosi
  1057. },
  1058. setSysteminfo(){
  1059. let systeminfo;
  1060. uni.getSystemInfo({ // 获取设备信息
  1061. success: (res) => {
  1062. systeminfo = res
  1063. },
  1064. })
  1065. return systeminfo
  1066. },
  1067. PromotionsFormat(promo){//促销活动类型数据处理
  1068. if(promo!=null){
  1069. if(promo.type == 1 && promo.mode == 1){
  1070. return true
  1071. }else{
  1072. return false
  1073. }
  1074. }
  1075. return false
  1076. },
  1077. queryPopupCoupons(){// 获取弹窗优惠券列表
  1078. this.ProductService.ShoppingCartGetCoupon(this.couponParam).then(response =>{
  1079. let data = response.data
  1080. this.navbar[0].num = data.notCouponNum
  1081. this.navbar[1].num = data.couponNum
  1082. if(data.couponList && data.couponList.length >0){
  1083. this.productCouponList = data.couponList
  1084. this.isCouponEmpty = false
  1085. }else{
  1086. this.isCouponEmpty = true
  1087. }
  1088. })
  1089. .catch(error =>{
  1090. console.log('获取优惠券列表失败')
  1091. })
  1092. },
  1093. receiveCoupon(coupon){// 点击优惠券领取按钮
  1094. this.ProductService.ReceiveCoupon(
  1095. {
  1096. userId:this.couponParam.userId,
  1097. couponId:coupon.couponId,
  1098. source:2
  1099. }
  1100. )
  1101. .then(response =>{
  1102. this.$util.msg('领取成功',1500,true,'success')
  1103. setTimeout(()=>{
  1104. this.currentTab = 1
  1105. this.couponParam.status = 2
  1106. this.queryPopupCoupons()
  1107. },1500)
  1108. })
  1109. .catch(error =>{
  1110. this.$util.msg(error.msg,2000);
  1111. })
  1112. },
  1113. showPopup(index,shop){// 显示popup弹窗
  1114. switch(index){
  1115. case 0:
  1116. this.currentTab = 0
  1117. this.couponParam.status = 1
  1118. this.couponParam.shopId = shop.id
  1119. this.queryPopupCoupons()
  1120. this.popupShow0 = true
  1121. break;
  1122. case 1:
  1123. this.popupShow1 = true
  1124. break;
  1125. }
  1126. },
  1127. hidePopup(index){// 隐藏popup弹窗
  1128. switch(index){
  1129. case 0:
  1130. this.popupShow0 = false
  1131. break;
  1132. case 1:
  1133. this.popupShow1 = false
  1134. break;
  1135. }
  1136. },
  1137. couponChange(e) {
  1138. this.currentTab = e.index
  1139. switch(this.currentTab){
  1140. case 0:
  1141. this.couponParam.status = 1
  1142. this.queryPopupCoupons()
  1143. break;
  1144. case 1:
  1145. this.couponParam.status = 2
  1146. this.queryPopupCoupons()
  1147. break;
  1148. }
  1149. }
  1150. }
  1151. }
  1152. </script>
  1153. <style lang="scss">
  1154. page{
  1155. background: #f7f7f7;
  1156. height: auto;
  1157. }
  1158. .cart-content{
  1159. position: relative;
  1160. }
  1161. .container-cart-main.none{
  1162. display: none;
  1163. }
  1164. .container-cart-main.show{
  1165. display: block;
  1166. }
  1167. .cart-content.empty.none{
  1168. display: none;
  1169. }
  1170. .cart-content.empty.show{
  1171. display: block;
  1172. }
  1173. .container-cart.show{
  1174. display: block;
  1175. }
  1176. .container-cart.none{
  1177. display: none;
  1178. }
  1179. .empty-container.none{
  1180. display: none;
  1181. }
  1182. .empty-container.show{
  1183. display: flex;
  1184. }
  1185. .foot-check-delbtn{
  1186. width: 100%;
  1187. height: 80rpx;
  1188. position: fixed;
  1189. top: 0;
  1190. left: 0;
  1191. box-sizing: border-box;
  1192. padding: 15rpx 24rpx;
  1193. background-color: #F7F7F7;
  1194. z-index: 990;
  1195. .foot-text{
  1196. font-size: $font-size-26;
  1197. height: 50rpx;
  1198. line-height: 50rpx;
  1199. color:#666666;
  1200. float: left;
  1201. padding-left: 10rpx;
  1202. text{
  1203. margin: 0 6rpx;
  1204. }
  1205. }
  1206. .delBtn{
  1207. width: 100rpx;
  1208. display: inline-block;
  1209. padding: 0 15rpx;
  1210. font-size: $font-size-26;
  1211. height: 50rpx;
  1212. line-height: 50rpx;
  1213. border-radius: 30rpx;
  1214. background:#FFFFFF;
  1215. border: 1px solid #e15616;
  1216. color: #E15616;
  1217. float: right;
  1218. text-align: center;
  1219. &.none{
  1220. display: none;
  1221. }
  1222. }
  1223. }
  1224. .checkbox-box{
  1225. display: flex;
  1226. align-items: center;
  1227. .checkbox{
  1228. display: flex;
  1229. margin: 0;
  1230. padding: 5rpx;
  1231. display: flex;
  1232. flex-direction: column;
  1233. align-items: center;
  1234. box-sizing: border-box;
  1235. text-align: center;
  1236. text-decoration: none;
  1237. border-radius: 0;
  1238. -webkit-tap-highlight-color: transparent;
  1239. overflow: hidden;
  1240. background-color:#FFFFFF;
  1241. font-size: 36rpx;
  1242. color:#999999;
  1243. &.icon-yixuanze{
  1244. color: $color-system;
  1245. }
  1246. }
  1247. &.disabled{
  1248. .checkbox{
  1249. color:#999999
  1250. }
  1251. }
  1252. .text{
  1253. font-size: $font-size-24;
  1254. margin-left: 10rpx;
  1255. }
  1256. }
  1257. .goods-list{
  1258. width: 100%;
  1259. height: auto;
  1260. background-color: #F7F7F7;
  1261. .goods-item{
  1262. width: 702rpx;
  1263. padding: 0 24rpx;
  1264. background: #FFFFFF;
  1265. margin-bottom: 24rpx;
  1266. }
  1267. .shoptitle{
  1268. height: 80rpx;
  1269. line-height: 80rpx;
  1270. .checkbox-box{
  1271. float: left;
  1272. height: 80rpx;
  1273. line-height: 80rpx;
  1274. display: inline-block;
  1275. box-sizing: border-box;
  1276. margin-left: 10rpx;
  1277. }
  1278. .text{
  1279. width: 400rpx;
  1280. float: left;
  1281. display: block;
  1282. overflow: hidden;
  1283. text-overflow:ellipsis;
  1284. white-space: nowrap;
  1285. line-height: 80rpx;
  1286. margin-left: 20rpx;
  1287. font-size: $font-size-28;
  1288. color: $text-color;
  1289. text-align: left;
  1290. font-weight: bold;
  1291. }
  1292. .text-coupon{
  1293. float: right;
  1294. line-height: 80rpx;
  1295. font-size: $font-size-30;
  1296. color: #e15616;
  1297. }
  1298. .floor-item-act{
  1299. width: 120rpx;
  1300. height: 80rpx;
  1301. text-align: center;
  1302. box-sizing: border-box;
  1303. float: left;
  1304. padding: 24rpx 0;
  1305. margin-left: 20rpx;
  1306. .floor-tags{
  1307. height: 28rpx;
  1308. border-radius: 6rpx;
  1309. background-color: #FFFFFF;
  1310. line-height: 28rpx;
  1311. color: $color-system;
  1312. text-align: center;
  1313. display: inline-block;
  1314. padding:0 16rpx;
  1315. font-size: $font-size-20;
  1316. border: 1px solid #E15616;
  1317. float: right;
  1318. }
  1319. }
  1320. }
  1321. .goods-pros{
  1322. width: 100%;
  1323. height: auto;
  1324. margin-bottom: 20rpx;
  1325. }
  1326. .goods-pros-t{
  1327. display: flex;
  1328. align-items: center;
  1329. width: 100%;
  1330. height: 210rpx;
  1331. padding:0 0 26rpx 0;
  1332. .checkbox-box{
  1333. padding: 10rpx;
  1334. }
  1335. .pros-img{
  1336. width: 210rpx;
  1337. height: 100%;
  1338. border-radius: 10rpx;
  1339. margin:0 20rpx;
  1340. border:1px solid #f3f3f3;
  1341. image{
  1342. width: 100%;
  1343. height: 100%;
  1344. border-radius: 10rpx;
  1345. }
  1346. }
  1347. }
  1348. .goods-pros-b{
  1349. width:100%;
  1350. height: auto;
  1351. padding:0 0 24rpx 0;
  1352. box-sizing: border-box;
  1353. &.show{
  1354. display: block;
  1355. }
  1356. &.none{
  1357. display: none;
  1358. }
  1359. .sum-none{
  1360. width: 100%;
  1361. height: 48rpx;
  1362. line-height: 48rpx;
  1363. color: $text-color;
  1364. float: left;
  1365. text-align: right;
  1366. .money{
  1367. font-size: $font-size-26;
  1368. color: #999999;
  1369. text-decoration: line-through;
  1370. }
  1371. .money-sign{
  1372. font-size: $font-size-26;
  1373. color: #999999;
  1374. text-decoration: line-through;
  1375. }
  1376. .money-reduced{
  1377. margin-left: 10rpx;
  1378. font-size: $font-size-26;
  1379. color: $color-system;
  1380. .iconfont{
  1381. font-size: $font-size-34;
  1382. }
  1383. }
  1384. }
  1385. .sum{
  1386. width: 100%;
  1387. height: 40rpx;
  1388. font-size: $font-size-26;
  1389. line-height: 40rpx;
  1390. color: $text-color;
  1391. float: left;
  1392. display: flex;
  1393. justify-content: flex-end;
  1394. font-weight: bold;
  1395. .money{
  1396. color: #FF2A2A;
  1397. font-size: $font-size-26;
  1398. }
  1399. .money-sign{
  1400. font-size: $font-size-24;
  1401. color: #FF2A2A;
  1402. }
  1403. }
  1404. }
  1405. .pros-product{
  1406. width: 416rpx;
  1407. height: 100%;
  1408. line-height: 36rpx;
  1409. font-size: $font-size-28;
  1410. position: relative;
  1411. .producttitle{
  1412. width: 100%;
  1413. display: inline-block;
  1414. height: auto;
  1415. text-overflow:ellipsis;
  1416. display: -webkit-box;
  1417. word-break: break-all;
  1418. -webkit-box-orient: vertical;
  1419. -webkit-line-clamp: 2;
  1420. overflow: hidden;
  1421. margin-bottom: 15rpx;
  1422. .no-text{
  1423. display: inline-block;
  1424. height:36rpx;
  1425. padding: 0 12rpx;
  1426. line-height: 36rpx;
  1427. background:linear-gradient(315deg,rgba(231,0,0,1) 0%,rgba(255,104,1,1) 100%);
  1428. border-radius:18rpx;
  1429. text-align: center;
  1430. color: #FFFFFF;
  1431. font-size:$font-size-28;
  1432. margin-right: 24rpx;
  1433. }
  1434. }
  1435. .productspec{
  1436. height: 36rpx;
  1437. color: #999999;
  1438. font-size: $font-size-26;
  1439. }
  1440. .productprice{
  1441. width: 100%;
  1442. height: 48rpx;
  1443. margin: 30rpx 0 0 0;
  1444. .price{
  1445. line-height: 48rpx;
  1446. font-size: $font-size-26;
  1447. width: 48%;
  1448. color: #FF2A2A;
  1449. float: left;
  1450. font-weight: bold;
  1451. &.disabled{
  1452. color: #999999;
  1453. text-decoration: line-through;
  1454. }
  1455. .money-sign{
  1456. font-size: $font-size-24;
  1457. color: #FF2A2A;
  1458. }
  1459. }
  1460. .count{
  1461. height: 100%;
  1462. float: right;
  1463. position: relative;
  1464. &.show{
  1465. display: block;
  1466. }
  1467. &.none{
  1468. display: none;
  1469. }
  1470. .count-tips{
  1471. width: auto;
  1472. display: inline-block;
  1473. padding: 0 15rpx;
  1474. line-height: 44rpx;
  1475. height: 44rpx;
  1476. border-radius: 22rpx;
  1477. background: $btn-confirm;
  1478. font-size: $font-size-24;
  1479. text-align: center;
  1480. color: #FFFFFF;
  1481. position: absolute;
  1482. top:-60rpx;
  1483. left: -5rpx;
  1484. z-index: 5;
  1485. &.step{
  1486. left:-217rpx
  1487. }
  1488. &::before{
  1489. content: "";
  1490. position: absolute;
  1491. bottom: -30rpx;
  1492. right: 15rpx;
  1493. z-index:1;
  1494. width: 0;
  1495. height: 0;
  1496. border-width: 18rpx;
  1497. border-style: solid;
  1498. border-color:$color-system transparent transparent transparent;
  1499. }
  1500. }
  1501. .number-box{
  1502. display: flex;
  1503. justify-content: center;
  1504. align-items: center;
  1505. border: 2rpx solid #ffe6dc;
  1506. border-radius: 30rpx;
  1507. .iconfont{
  1508. font-size: $font-size-24;
  1509. padding:0 18rpx;
  1510. color: #999999;
  1511. text-align: center;
  1512. line-height: 48rpx;
  1513. font-weight: bold;
  1514. background: #fef6f3;
  1515. &.icon-jianhao{
  1516. border-radius: 30rpx 0 0 30rpx;
  1517. }
  1518. &.icon-jiahao{
  1519. border-radius: 0 30rpx 30rpx 0;
  1520. }
  1521. }
  1522. .btn-input{
  1523. width: 62rpx;
  1524. height: 48rpx;
  1525. line-height: 48rpx;
  1526. background: #fff;
  1527. border-radius: 4rpx;
  1528. text-align: center;
  1529. font-size: $font-size-24;
  1530. }
  1531. }
  1532. .uni-numbox{
  1533. position: absolute;
  1534. left: 45rpx;
  1535. bottom: 0;
  1536. .uni-numbox-minus, .uni-numbox-plus{
  1537. width: 50rpx;
  1538. line-height: 40rpx;
  1539. }
  1540. .uni-numbox-value {
  1541. font-size: $font-size-28;
  1542. width: 60rpx;
  1543. }
  1544. }
  1545. }
  1546. }
  1547. .floor-item-act{
  1548. width: 100%;
  1549. height: 56rpx;
  1550. text-align: center;
  1551. box-sizing: border-box;
  1552. float: left;
  1553. padding:0 0 10rpx 0;
  1554. margin-left: 10rpx;
  1555. .floor-tags{
  1556. height: 28rpx;
  1557. border-radius: 6rpx;
  1558. background-color: #FFFFFF;
  1559. line-height: 28rpx;
  1560. color: $color-system;
  1561. text-align: center;
  1562. display: inline-block;
  1563. padding:0 16rpx;
  1564. font-size: $font-size-20;
  1565. border: 1px solid #E15616;
  1566. float: left;
  1567. }
  1568. }
  1569. }
  1570. }
  1571. .failure-list{
  1572. width: 702rpx;
  1573. height: auto;
  1574. padding: 0 24rpx;
  1575. margin-top: 20rpx;
  1576. background: #FFFFFF;
  1577. .failure-title{
  1578. width: 100%;
  1579. height: 82rpx;
  1580. line-height: 82rpx;
  1581. font-size: $font-size-28;
  1582. border-bottom: 1px solid #EBEBEB;
  1583. .title-txt{
  1584. float: left;
  1585. color:#666666;
  1586. text-align: left;
  1587. }
  1588. .title-btn{
  1589. float: right;
  1590. color: $color-system;
  1591. text-align: right;
  1592. line-height: 80rpx;
  1593. .butto{
  1594. display: inline-block;
  1595. padding: 0 15rpx;
  1596. font-size: $font-size-26;
  1597. height: 50rpx;
  1598. line-height: 50rpx;
  1599. border-radius: 30rpx;
  1600. background:#FFFFFF;
  1601. // border: 1px solid #C9C9C9;
  1602. // color: #999999;
  1603. margin-top: 15rpx;
  1604. }
  1605. }
  1606. }
  1607. .productlist{
  1608. padding-top: 10rpx;
  1609. .goods-pros{
  1610. width: 100%;
  1611. height: auto;
  1612. padding: 20rpx 0;
  1613. }
  1614. .goods-pros-t{
  1615. display: flex;
  1616. align-items: center;
  1617. width: 100%;
  1618. height: 210rpx;
  1619. position: relative;
  1620. .img-tip{
  1621. display: block;
  1622. width: 72rpx;
  1623. height: 36rpx;
  1624. line-height: 36rpx;
  1625. font-size: $font-size-24;
  1626. text-align: center;
  1627. color: #FFFFFF;
  1628. border-radius: 24rpx;
  1629. background:rgba(51,51,51,0.3);
  1630. // position: absolute;
  1631. // left: 0;
  1632. // top: 0;
  1633. }
  1634. .checkbox-box{
  1635. padding: 10rpx;
  1636. }
  1637. .pros-img{
  1638. width: 180rpx;
  1639. height: 100%;
  1640. border-radius: 10rpx;
  1641. margin:0 20rpx;
  1642. border:1px solid #f3f3f3;
  1643. position: relative;
  1644. image{
  1645. width: 100%;
  1646. height: 100%;
  1647. border-radius: 10rpx;
  1648. }
  1649. }
  1650. .pros-marks{
  1651. width: 730rpx; height: 250rpx;
  1652. z-index: 90;
  1653. background: rgba(0,0,0,.05);
  1654. position: absolute;
  1655. left:-20rpx;
  1656. top: -20rpx;
  1657. }
  1658. }
  1659. .goods-pros-b{
  1660. width:622rpx;
  1661. margin-left: 84rpx;
  1662. height: 40rpx;
  1663. padding:0 0 26rpx 0;
  1664. // border-top: 1px solid #EBEBEB;
  1665. &.show{
  1666. display: block;
  1667. }
  1668. &.none{
  1669. display: none;
  1670. }
  1671. .sum{
  1672. font-size: $font-size-28;
  1673. line-height: 40rpx;
  1674. color: $text-color;
  1675. display: flex;
  1676. justify-content: flex-end;
  1677. .money{
  1678. color: #FF2A2A;
  1679. font-size: $font-size-28;
  1680. }
  1681. .money-sign{
  1682. font-size: $font-size-24;
  1683. color: #FF2A2A;
  1684. }
  1685. }
  1686. }
  1687. .pros-product{
  1688. width: 402rpx;
  1689. height: 100%;
  1690. line-height: 36rpx;
  1691. font-size: $font-size-28;
  1692. position: relative;
  1693. .producttitle{
  1694. width: 100%;
  1695. display: inline-block;
  1696. height: auto;
  1697. text-overflow:ellipsis;
  1698. display: -webkit-box;
  1699. word-break: break-all;
  1700. -webkit-box-orient: vertical;
  1701. -webkit-line-clamp: 2;
  1702. overflow: hidden;
  1703. margin-bottom: 8rpx;
  1704. .no-text{
  1705. display: inline-block;
  1706. height:36rpx;
  1707. padding: 0 12rpx;
  1708. line-height: 36rpx;
  1709. background:linear-gradient(315deg,rgba(231,0,0,1) 0%,rgba(255,104,1,1) 100%);
  1710. border-radius:18rpx;
  1711. text-align: center;
  1712. color: #FFFFFF;
  1713. font-size: $font-size-28;
  1714. margin-right: 24rpx;
  1715. }
  1716. }
  1717. .productspec{
  1718. height: 36rpx;
  1719. color: #999999;
  1720. font-size: $font-size-26;
  1721. margin-top: 20rpx;
  1722. }
  1723. .productstate{
  1724. font-size: $font-size-28;
  1725. height: 44rpx;
  1726. color: #FF2A2A;
  1727. position: absolute;
  1728. bottom: 0;
  1729. left: 0;
  1730. }
  1731. }
  1732. }
  1733. }
  1734. .tui-popup-box {
  1735. position: relative;
  1736. box-sizing: border-box;
  1737. min-height: 220rpx;
  1738. padding:24rpx 24rpx 0 24rpx;
  1739. .tui-popup-close{
  1740. width: 90rpx;
  1741. height: 90rpx;
  1742. position: absolute;
  1743. right: 0;
  1744. top: 24rpx;
  1745. line-height: 90rpx;
  1746. text-align: center;
  1747. color: #b2b2b2;
  1748. .icon-iconfontguanbi{
  1749. font-size: $font-size-40;
  1750. }
  1751. }
  1752. .title{
  1753. font-size: $font-size-34;
  1754. color: $text-color;
  1755. line-height: 88rpx;
  1756. text-align: center;
  1757. float: left;
  1758. width: 100%;
  1759. height: 88rpx;
  1760. font-weight: bold;
  1761. }
  1762. .tui-popup-main{
  1763. width: 100%;
  1764. float: left;
  1765. &.coupon{
  1766. padding-bottom: 40rpx;
  1767. .coupon-empty{
  1768. width: 100%;
  1769. height: 600rpx;
  1770. display: flex;
  1771. align-items: center;
  1772. justify-content: center;
  1773. flex-direction: column;
  1774. position: fixed;
  1775. background: $bg-color;
  1776. .empty-container-image{
  1777. width: 150rpx;
  1778. height: 150rpx;
  1779. margin-bottom: 0;
  1780. margin-top: 0;
  1781. }
  1782. .error-text{
  1783. font-size: $font-size-28;
  1784. color: #999999;
  1785. line-height: 88rpx;
  1786. }
  1787. }
  1788. }
  1789. .tui-popup-scroll{
  1790. width: 100%;
  1791. height: 600rpx;
  1792. .coupon-list{
  1793. width: 100%;
  1794. height: 200rpx;
  1795. margin-top: 24rpx;
  1796. box-sizing: border-box;
  1797. background: url(https://static.caimei365.com/app/img/icon/icon-coupon-uesb@2x.png);
  1798. background-size: cover;
  1799. &:last-child{
  1800. margin-bottom: 24rpx;
  1801. }
  1802. .list-cell-le{
  1803. width: 224rpx;
  1804. height: 100%;
  1805. box-sizing: border-box;
  1806. padding: 37rpx 0;
  1807. float: left;
  1808. .coupon-maxMoney{
  1809. width: 100%;
  1810. height: 78rpx;
  1811. line-height: 78rpx;
  1812. font-size: 56rpx;
  1813. color: #FFFFFF;
  1814. text-align: center;
  1815. .small{
  1816. font-size: $font-size-24;
  1817. }
  1818. }
  1819. .coupon-minMoney{
  1820. width: 100%;
  1821. height: 33rpx;
  1822. line-height: 33rpx;
  1823. font-size: $font-size-24;
  1824. color: #FFFFFF;
  1825. text-align: center;
  1826. }
  1827. }
  1828. .list-cell-ri{
  1829. width: 478rpx;
  1830. height: 100%;
  1831. box-sizing: border-box;
  1832. padding: 20rpx 24rpx 0 24rpx;
  1833. float: right;
  1834. .list-cell-top{
  1835. width: 100%;
  1836. height: 121rpx;
  1837. float: left;
  1838. border-bottom: 1px solid #e1e1e1;
  1839. .list-cell-type{
  1840. width: 286rpx;
  1841. height: 100%;
  1842. float: left;
  1843. .list-cell-tags{
  1844. width: 100%;
  1845. height: 32rpx;
  1846. margin-bottom: 7rpx;
  1847. .tags{
  1848. display: inline-block;
  1849. padding: 0 10rpx;
  1850. height: 32rpx;
  1851. line-height: 32rpx;
  1852. background-color: #ffdcce;
  1853. color: #f94b4b;
  1854. font-size: $font-size-20;
  1855. border-radius: 8rpx;
  1856. text-align: center;
  1857. float: left;
  1858. }
  1859. }
  1860. .list-cell-texts{
  1861. width: 100%;
  1862. height: auto;
  1863. line-height:35rpx;
  1864. text-overflow:ellipsis;
  1865. display: -webkit-box;
  1866. word-break: break-all;
  1867. -webkit-box-orient: vertical;
  1868. -webkit-line-clamp: 2;
  1869. overflow: hidden;
  1870. font-size: 26rpx;
  1871. color: #333333;
  1872. }
  1873. }
  1874. .list-cell-btn{
  1875. width: 128rpx;
  1876. height: 100%;
  1877. float: right;
  1878. .icon-used{
  1879. width: 100%;
  1880. height: 100%;
  1881. box-sizing: border-box;
  1882. padding-top: 57rpx;
  1883. .icon-used-btn{
  1884. width: 128rpx;
  1885. height: 48rpx;
  1886. border-radius: 28rpx;
  1887. line-height: 48rpx;
  1888. font-size: $font-size-26;
  1889. text-align: center;
  1890. &.receive{
  1891. background-image: linear-gradient(270deg, #f94b4b 0%, #feb673 100%);;
  1892. color: #FFFFFF;
  1893. }
  1894. &.make{
  1895. border: solid 1px #f94b4b;
  1896. color: #f94b4b;
  1897. }
  1898. }
  1899. }
  1900. }
  1901. }
  1902. .list-cell-time{
  1903. width: 100%;
  1904. height: 58rpx;
  1905. line-height: 58rpx;
  1906. text-align: left;
  1907. font-size: $font-size-20;
  1908. color: #999999;
  1909. }
  1910. }
  1911. }
  1912. }
  1913. .tui-popup-coupon{
  1914. width: 100%;
  1915. height: 500rpx;
  1916. box-sizing: border-box;
  1917. padding:30rpx 20rpx;
  1918. .tui-popup-h1{
  1919. width: 100%;
  1920. height: 66rpx;
  1921. display: flex;
  1922. align-items: center;
  1923. .tui-popup-text{
  1924. flex: 1;
  1925. height: 66rpx;
  1926. line-height: 66rpx;
  1927. font-size: $font-size-30;
  1928. color: #333333;
  1929. &.red{
  1930. color: #f94b4b;
  1931. }
  1932. &.bold{
  1933. font-weight: bold;
  1934. }
  1935. &.left{
  1936. text-align: left;
  1937. }
  1938. &.right{
  1939. text-align: right;
  1940. }
  1941. }
  1942. }
  1943. }
  1944. }
  1945. }
  1946. .footer{
  1947. width: 100%;
  1948. background-color: #FFFFFF;
  1949. height: 110rpx;
  1950. position: fixed;
  1951. bottom: 0rpx;
  1952. z-index: 990;
  1953. .footer-le{
  1954. width: 520rpx;
  1955. height: 100%;
  1956. padding-left: 24rpx;
  1957. float: left;
  1958. box-sizing: border-box;
  1959. .foot-check{
  1960. width: 100rpx;
  1961. float: left;
  1962. line-height: 110rpx;
  1963. font-size: $font-size-24;
  1964. .checkbox{
  1965. width: 40rpx;
  1966. text-align: center;
  1967. }
  1968. .text{
  1969. width: 60rpx;
  1970. float: right;
  1971. }
  1972. }
  1973. .sum{
  1974. width: 360rpx;
  1975. height: 110rpx;
  1976. float: right;
  1977. box-sizing: border-box;
  1978. padding: 10rpx;
  1979. .sum-none{
  1980. width: 100%;
  1981. height: 45rpx;
  1982. line-height: 45rpx;
  1983. color: $text-color;
  1984. float: left;
  1985. text-align: left;
  1986. .money{
  1987. font-size: $font-size-24;
  1988. color: #999999;
  1989. text-decoration: line-through;
  1990. }
  1991. .money-sign{
  1992. font-size: $font-size-24;
  1993. color: #999999;
  1994. text-decoration: line-through;
  1995. }
  1996. .money-reduced{
  1997. margin-left: 10rpx;
  1998. font-size: $font-size-24;
  1999. color: #FF2A2A;
  2000. }
  2001. .money-popup{
  2002. height: 45rpx;
  2003. line-height: 45rpx;
  2004. display: inline-block;
  2005. float: right;
  2006. font-size: $font-size-24;
  2007. color: #FF2A2A;
  2008. .icon-xiangshangjiantou{
  2009. font-size: $font-size-30;
  2010. margin-left: 5rpx;
  2011. }
  2012. }
  2013. }
  2014. .sum-price{
  2015. width: 100%;
  2016. height: 45rpx;
  2017. line-height: 45rpx;
  2018. font-size: $font-size-30;
  2019. color: $text-color;
  2020. float: left;
  2021. font-weight: normal;
  2022. text-align: left;
  2023. &.none{
  2024. height: 90rpx;
  2025. line-height: 90rpx;
  2026. }
  2027. .money{
  2028. color: #FF2A2A;
  2029. }
  2030. .money-sign{
  2031. font-size: $font-size-24;
  2032. color: #FF2A2A;
  2033. }
  2034. }
  2035. }
  2036. }
  2037. .footer-ri{
  2038. width: 230rpx;
  2039. height: 100%;
  2040. float: right;
  2041. display: flex;
  2042. justify-content: space-between;
  2043. align-items: center;
  2044. z-index: 999;
  2045. box-sizing: border-box;
  2046. padding: 13rpx 15rpx 13rpx 5rpx;
  2047. &.none{
  2048. display: none;
  2049. }
  2050. .btn{
  2051. width: 200rpx;
  2052. height: 100%;
  2053. background:linear-gradient(135deg,rgba(242,143,49,1) 0%,rgba(225,86,22,1) 100%);
  2054. font-size: $font-size-28;
  2055. line-height: 84rpx;
  2056. color: #FFFFFF;
  2057. display: flex;
  2058. border-radius: 42rpx;
  2059. justify-content: center;
  2060. align-items: center;
  2061. }
  2062. }
  2063. .footer-del{
  2064. width: 400rpx;
  2065. height: 110rpx;
  2066. position: absolute;
  2067. padding-left: 200rpx;
  2068. background: #FFFFFF;
  2069. right: 0;
  2070. top: 0;
  2071. z-index: 1000;
  2072. &.show{
  2073. animation: showDelbtn 0s linear both;
  2074. }
  2075. &.none{
  2076. animation: hideDelbtn 0s linear both;
  2077. }
  2078. .btn{
  2079. width: 50%;
  2080. height: 100%;
  2081. line-height: 110rpx;
  2082. font-size: $font-size-28;
  2083. color: #FFFFFF;
  2084. text-align: center;
  2085. float: left;
  2086. }
  2087. .btn.btn-cancel{
  2088. background:#EEC1AB;
  2089. }
  2090. .btn.btn-confirm{
  2091. background:#FF2A2A;
  2092. }
  2093. @keyframes showDelbtn {
  2094. 0% {
  2095. transform: translateX(0);
  2096. }
  2097. 100% {
  2098. transform: translateX(-100%);
  2099. }
  2100. }
  2101. @keyframes hideDelbtn {
  2102. 0% {
  2103. transform: translateX(-100%);
  2104. }
  2105. 100% {
  2106. transform: translateX(0);
  2107. }
  2108. }
  2109. }
  2110. }
  2111. </style>