index.vue 58 KB

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