index.vue 59 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116
  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 | NumFormat}}</text>
  125. </view>
  126. <view class="sum-none" v-if="isDiscount">
  127. <!-- <text class="money-sign">¥</text> -->
  128. <!-- <text class="money">{{ totalOriginalPrice | NumFormat }}</text> -->
  129. <text class="money-reduced">共减<text>¥{{ totalDiscountAmount | NumFormat}}</text></text>
  130. <text class="money-popup" @click="showPopup(1)">优惠明细<text class="iconfont icon-xiangshangjiantou"></text></text>
  131. </view>
  132. </view>
  133. </view>
  134. <view v-if="!isshowDelbtn" class="footer-ri" >
  135. <view class="btn hanld-btn" @tap="toConfirmation">去结算({{allCount}})</view>
  136. </view>
  137. <view v-else class="footer-del">
  138. <view class="btn btn-cancel" @tap.stop="hideDelManage">取消</view>
  139. <view class="btn btn-confirm" @tap.stop="deleteList">删除</view>
  140. </view>
  141. </view>
  142. </template>
  143. <template v-else>
  144. <view class="footer" :style="{paddingBottom :isIphoneX ? '68rpx' : '0rpx'}">
  145. <view class="footer-le">
  146. <view class="foot-check checkbox-box" @tap.stop="checkAll()">
  147. <button class="checkbox iconfont" :class="[isCheckAll?'icon-yixuanze':'icon-weixuanze']"></button>
  148. <view class="text">全选</view>
  149. </view>
  150. <view class="sum">
  151. <view class="sum-price" :class="isDiscount ? '' : 'none'">
  152. 总价:<text class="money-sign">¥</text><text class="money">{{allPrice | NumFormat}}</text>
  153. </view>
  154. <view class="sum-none" v-if="isDiscount">
  155. <!-- <text class="money-sign">¥</text> -->
  156. <!-- <text class="money">{{ totalOriginalPrice | NumFormat }}</text> -->
  157. <text class="money-reduced">共减<text>¥{{ totalDiscountAmount | NumFormat}}</text></text>
  158. <text class="money-popup" @click="showPopup(1)">优惠明细<text class="iconfont icon-xiangshangjiantou"></text></text>
  159. </view>
  160. </view>
  161. </view>
  162. <view v-if="!isshowDelbtn" class="footer-ri" >
  163. <view class="btn hanld-btn" @tap="toConfirmation">去结算({{allCount}})</view>
  164. </view>
  165. <view v-else class="footer-del">
  166. <view class="btn btn-cancel" @tap.stop="hideDelManage">取消</view>
  167. <view class="btn btn-confirm" @tap.stop="deleteList">删除</view>
  168. </view>
  169. </view>
  170. </template>
  171. </view>
  172. <view v-else class="cart-content empty">
  173. <view class="empty-container">
  174. <image class="empty-container-image" src="https://img.caimei365.com/group1/M00/03/71/Cmis2F3wna6AWdWzAAGlgAP0das422.png" mode="aspectFit"></image>
  175. <text class="error-text">购物车空空如也,快去商城逛逛吧~</text>
  176. <view class="login-btn" @click="goIndex">去商城</view>
  177. </view>
  178. </view>
  179. </view>
  180. <!-- 促销活动弹窗 -->
  181. <activi-popup :product="handlerPros" :popupShow="popupShow"></activi-popup>
  182. <!-- 透明模态层 -->
  183. <modal-layer v-if='modallayer'></modal-layer>
  184. <!-- 优惠券 -->
  185. <tui-bottom-popup :radius="true" :show="popupShow0" @close="hidePopup(0)">
  186. <view class="tui-popup-box clearfix">
  187. <view class="title">优惠券</view>
  188. <view class="tui-popup-close" @click="hidePopup(0)">
  189. <text class="iconfont icon-iconfontguanbi"></text>
  190. </view>
  191. <view class="tui-popup-tabs">
  192. <coupon-tabs :tabs="navbar"
  193. :currentTab="currentTab>2?0:currentTab"
  194. @change="couponChange"
  195. :itemWidth="(100/navbar.length)+'%'"
  196. selectedColor="#e15616"
  197. sliderBgColor="#e15616">
  198. </coupon-tabs>
  199. </view>
  200. <div class="tui-popup-main coupon">
  201. <scroll-view class="tui-popup-scroll" scroll-y="true">
  202. <view class="coupon-empty" v-if="isCouponEmpty">
  203. <image class="empty-container-image" :src="StaticUrl+'/icon/icon-coupon-empty@2x.png'"></image>
  204. <text class="error-text">暂无可领的优惠券~</text>
  205. </view>
  206. <template v-else>
  207. <view v-for="(coupon,index) in productCouponList"
  208. :key="index"
  209. :id="coupon.couponId"
  210. class="coupon-list"
  211. >
  212. <view class="list-cell-le">
  213. <view class="coupon-maxMoney"><text class="small">¥</text>{{ coupon.couponAmount }}</view>
  214. <view class="coupon-minMoney">满{{ coupon.touchPrice }}可用</view>
  215. </view>
  216. <view class="list-cell-ri">
  217. <view class="list-cell-top">
  218. <view class="list-cell-type">
  219. <view class="list-cell-tags">
  220. <text class="tags">{{ coupon.couponType | TypeFormat }}</text>
  221. </view>
  222. <view class="list-cell-texts" :class="currentTab == 1 || currentTab == 2 ? 'none' : ''">
  223. <text v-if="coupon.couponType == 0">
  224. {{ coupon.productType && coupon.productType == 1 ? '全商城商品通用' : '仅可购买指定商品' }}
  225. </text>
  226. <text v-if="coupon.couponType == 1">
  227. {{ coupon.categoryType == 1 ? '仅限购买产品类商品' : '仅限购买仪器类商品' }}
  228. </text>
  229. <text v-if="coupon.couponType == 3">仅限购买店铺【{{ coupon.shopName }}】的商品</text>
  230. <text v-if="coupon.couponType == 4 || coupon.couponType == 2">全商城商品通用</text>
  231. </view>
  232. </view>
  233. <view class="list-cell-btn">
  234. <view class="icon-used">
  235. <view class="icon-used-btn receive" v-if="currentTab == 0" @click="receiveCoupon(coupon)">领取</view>
  236. <view class="icon-used-btn make" v-if="currentTab == 1">已领取</view>
  237. </view>
  238. </view>
  239. </view>
  240. <view class="list-cell-time">{{ coupon.endDate }}</view>
  241. </view>
  242. </view>
  243. </template>
  244. </scroll-view>
  245. </div>
  246. </view>
  247. </tui-bottom-popup>
  248. <!-- 优惠明细 -->
  249. <tui-bottom-popup :radius="true" :show="popupShow1" @close="hidePopup(1)">
  250. <view class="tui-popup-box clearfix">
  251. <view class="title">优惠明细</view>
  252. <view class="tui-popup-close" @click="hidePopup(1)">
  253. <text class="iconfont icon-iconfontguanbi"></text>
  254. </view>
  255. <div class="tui-popup-main coupon">
  256. <view class="tui-popup-coupon">
  257. <view class="tui-popup-h1">
  258. <view class="tui-popup-text left">商品总额</view>
  259. <view class="tui-popup-text right bold">¥{{allPrice | NumFormat}}</view>
  260. </view>
  261. <view class="tui-popup-h1" v-if="reducedPrice>0">
  262. <view class="tui-popup-text left">促销满减</view>
  263. <view class="tui-popup-text right bold red">-¥{{ reducedPrice | NumFormat}}</view>
  264. </view>
  265. <view class="tui-popup-h1" v-if="couponPrice>0">
  266. <view class="tui-popup-text left">优惠券</view>
  267. <view class="tui-popup-text right bold red">-¥{{ couponPrice | 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 red">-¥{{ totalDiscountAmount | NumFormat }}</view>
  272. </view>
  273. <view class="tui-popup-h1">
  274. <view class="tui-popup-text left bold">总计</view>
  275. <view class="tui-popup-text right bold">¥{{ (allPrice - totalDiscountAmount) | NumFormat }}</view>
  276. </view>
  277. </view>
  278. </div>
  279. </view>
  280. </tui-bottom-popup>
  281. </view>
  282. </template>
  283. <script>
  284. import authorize from '@/common/config/authorize.js'
  285. import tuiSkeleton from "@/components/tui-skeleton/tui-skeleton"
  286. import tuiLoadmore from "@/components/tui-components/loadmore/loadmore"
  287. import tuiNomore from "@/components/tui-components/nomore/nomore"
  288. import activiPopup from "@/components/cm-module/productDetails/cm-activipopu"
  289. import couponTabs from '@/components/cm-module/coupon/tui-tabs.vue'
  290. import modalLayer from "@/components/modal-layer"
  291. import { mapState,mapMutations } from 'vuex';
  292. export default{
  293. name:"cartComponents",
  294. props:{
  295. pathType:{
  296. type:Number
  297. }
  298. },
  299. components:{
  300. tuiSkeleton,
  301. tuiLoadmore,
  302. tuiNomore,
  303. activiPopup,
  304. couponTabs,
  305. modalLayer
  306. },
  307. data() {
  308. return{
  309. StaticUrl:this.$Static, // 静态图片路径
  310. CustomBar:this.CustomBar, // 顶部导航栏高度
  311. isIphoneX:this.$store.state.isIphoneX,
  312. userId:'',
  313. alertType:'',
  314. isStock:'',
  315. handlerPros:{}, // 监听单挑促销商品
  316. failureList:[], // 失效商品列表
  317. goodsList:[], // 购物车的商品
  318. promotionsList:[], // 促销列表
  319. totalCouponList:[], // 优惠券算列表
  320. eligibleCoupons:[], // 最终需要用到优惠券
  321. delGoodsList:'', // 要删除的商品
  322. setGoodData:'', // 确认订单的商品
  323. isCheckAll:false, // 是否全选
  324. kindCount:0, // 购物车宝贝数量
  325. allPrice:0, // 所有价格
  326. totalOriginalPrice:0, // 所有原价价
  327. reducedPrice:0, // 满减
  328. couponPrice:0, // 优惠金额
  329. totalDiscountAmount:0, // 总共减去金额
  330. isDiscount:false, // 控制显示优惠明细
  331. allCount:0, // 被选中的产品数量
  332. isModallayer:false,
  333. skeletonShow:true,
  334. isshowDelbtn:false,
  335. isDisabled: false, // 供应商/店铺全选是否禁用状态
  336. isNoConfim:false,
  337. isEmpty:false, // 显示空购物车
  338. scrollHeight: 'auto',
  339. nomoreText: '上拉显示更多',
  340. hasNextPage: false,
  341. loadding: false,
  342. pullUpOn: true,
  343. pullFlag: true,
  344. pageSize: 10,
  345. pageNum: 1,
  346. submitIds:[],
  347. popupShow:false,
  348. popupShow0:false,
  349. popupShow1:false,
  350. currentTab: 1,
  351. navbar: [
  352. { name: "未领取",num:0 },
  353. { name: "已领取",num:0 }
  354. ],
  355. couponParam:{ // 获取弹窗优惠券领取参数
  356. userId:0,
  357. shopId:0,
  358. status:1,
  359. source:2
  360. },
  361. productCouponList:[], // 优惠券弹窗列表
  362. isCouponEmpty:false,
  363. }
  364. },
  365. created(){
  366. this.setScrollHeight();
  367. console.log('pathType',this.pathType)
  368. },
  369. computed: {
  370. ...mapState(['hasLogin','userInfo','isWxAuthorize'])
  371. },
  372. watch:{//深度监听所有数据,每次改变重新计算总价和总数
  373. goodsList:{
  374. deep:true,
  375. handler(val,oldval){
  376. this.totalPeice()
  377. this.totalCount()
  378. }
  379. }
  380. },
  381. filters:{
  382. NumFormat(value) {//处理金额
  383. return Number(value).toFixed(2);
  384. },
  385. totalprice(val,count){//单件商品的价格 × 数量
  386. return (val * count).toFixed(2)
  387. },
  388. TypeFormat(value) {
  389. switch (value) {
  390. case 0:
  391. return '活动券';
  392. break;
  393. case 1:
  394. return '品类券';
  395. break;
  396. case 2:
  397. return '用户专享券';
  398. break;
  399. case 3:
  400. return '店铺券';
  401. break;
  402. case 4:
  403. return '新用户券';
  404. break;
  405. }
  406. }
  407. },
  408. methods:{
  409. initData(){
  410. this.isModallayer = false //遮罩层 防止多次点击
  411. this.skeletonShow = true //预加载圆圈
  412. this.isCheckAll=false//是否全选
  413. this.submitIds = []
  414. this.couponPrice = 0
  415. this.totalDiscountAmount = 0
  416. this.isDiscount = false
  417. this.eligibleCoupons = []
  418. this.$api.getStorage().then((resolve) => {
  419. this.userId = this.couponParam.userId = resolve.userId ? resolve.userId : 0;
  420. this.initGetCartGoodsList();
  421. })
  422. },
  423. initLogin(){
  424. this.$api.redirectTo('/pages/login/login')
  425. },
  426. clickPopupShow(pros,type){
  427. this.popupShow = true;
  428. this.handlerPros = pros;
  429. },
  430. setScrollHeight() {
  431. // 窗口高度-footer高度
  432. const {windowHeight, pixelRatio} = uni.getSystemInfoSync();
  433. setTimeout(()=> {
  434. const query = uni.createSelectorQuery().in(this);
  435. query.selectAll('.footer').boundingClientRect();
  436. query.exec(res => {
  437. this.windowHeight = windowHeight;
  438. if(res[0][0]) {
  439. this.scrollHeight = windowHeight - res[0][0].height;
  440. }
  441. })
  442. }, 500)
  443. },
  444. initGetCartGoodsList(){//初始化购物车 index:1
  445. this.ProductService.QueryShoppingCartList({userId:this.userId}).then(response =>{
  446. this.skeletonShow = false
  447. let data = response.data
  448. this.kindCount = data.kindCount
  449. this.promotionsList = data.promotions
  450. this.totalCouponList = data.couponList
  451. this.$store.commit('updateAllNum',data.kindCount)
  452. if( data.list.length > 0 || data.invalid.length > 0){
  453. this.isEmpty =false
  454. }else{
  455. this.isEmpty =true
  456. }
  457. if(data.list && data.list.length > 0 ){
  458. this.goodsList = data.list;
  459. this.goodsList.forEach((item,index) => {
  460. item.cartList.forEach(pros => {
  461. pros.shopID = item.shopID;
  462. pros.isStep = false
  463. if(pros.step === 2){
  464. if(pros.number % pros.min != 0){
  465. pros.number = pros.min
  466. this.totalShopPeice()
  467. this.updateShoppogNum(pros)
  468. }
  469. }
  470. })
  471. })
  472. this.totalShopPeice()
  473. } else {
  474. this.goodsList = [];
  475. }
  476. if( data.invalid && data.invalid.length > 0){
  477. let newFailureList = [],isFailureLayer;
  478. data.invalid.forEach((failure,index) => {
  479. if(failure.status == 1 || failure.status == 2) {
  480. isFailureLayer = true
  481. }else{
  482. isFailureLayer = false
  483. }
  484. newFailureList.push(Object.assign({},failure,{isFailureLayer:isFailureLayer}))
  485. })
  486. this.failureList = newFailureList
  487. } else {
  488. this.failureList = [];
  489. }
  490. }).catch(error =>{
  491. this.$util.msg(error.msg,2000);
  492. })
  493. },
  494. ischeckFailure(failure){
  495. failure.productsChecked = !failure.productsChecked
  496. this.updateCheckAllBtn()
  497. },
  498. ischeck(item,pro){//为未选中的时候改变为true,反之为true
  499. pro.productsChecked = !pro.productsChecked;
  500. if(pro.productsChecked) {
  501. if(!this.submitIds.includes(pro.productID*1)){
  502. this.submitIds.push(pro.productID);
  503. }
  504. } else {
  505. var lent = this.submitIds.indexOf(pro.productID*1);
  506. if(lent >=0 ){
  507. this.submitIds.splice(lent, 1);
  508. }
  509. }
  510. this.updateProductCheckedAllBtn(item);
  511. this.updateCheckAllBtn();
  512. },
  513. updateProductCheckedAllBtn(item) {// 单独每个供应商的勾选判断
  514. let productsList = item.cartList,
  515. productsCheckedLength = 0,
  516. disabledLength = 0;
  517. if(this.isshowDelbtn) {
  518. productsList.forEach(pros => {
  519. if(pros.productsChecked) {
  520. productsCheckedLength++;
  521. }
  522. })
  523. } else {
  524. productsList.forEach(pros => {
  525. if(pros.productsChecked) {
  526. productsCheckedLength++;
  527. }
  528. })
  529. }
  530. item.checked = productsCheckedLength === productsList.length;
  531. },
  532. updateCheckAllBtn() {// 全选勾选判断
  533. let goodsCheckedLength = 0,
  534. goodsList = this.goodsList,
  535. failureList = this.failureList;
  536. goodsList.forEach(item => {
  537. if(item.checked) {
  538. goodsCheckedLength++;
  539. }
  540. })
  541. failureList.forEach(failureItem=>{
  542. if(failureItem.productsChecked){
  543. goodsCheckedLength++;
  544. }
  545. })
  546. if(this.isshowDelbtn){
  547. this.isCheckAll = goodsCheckedLength === goodsList.length + failureList.length;
  548. }else{
  549. this.isCheckAll = goodsCheckedLength === goodsList.length;
  550. }
  551. },
  552. checkShop(item){//与单选商品类似
  553. item.checked = !item.checked;
  554. this.setProductChecked(item);
  555. this.updateCheckAllBtn();
  556. },
  557. setProductChecked(item) {
  558. item.cartList.forEach(pros=>{
  559. if(item.checked) {
  560. pros.productsChecked = true;
  561. if(!this.submitIds.includes(pros.productId*1)){
  562. this.submitIds.push(pros.productId);
  563. }
  564. } else {
  565. pros.productsChecked = false;
  566. var lent = this.submitIds.indexOf(pros.productId*1);
  567. if(lent >=0 ){
  568. this.submitIds.splice(lent, 1);
  569. }
  570. }
  571. })
  572. },
  573. updateBothCheckBtn() {
  574. if(this.isshowDelbtn) {
  575. // 当管理删除按钮出现时,失效的商品可被选择
  576. this.goodsList.forEach((item)=>{
  577. item.checked = this.isCheckAll;
  578. this.setProductChecked(item);
  579. })
  580. //删除按钮 全选包括失效商品勾选
  581. this.failureList.forEach(failureItem=>{
  582. failureItem.productsChecked = this.isCheckAll;
  583. })
  584. } else {
  585. this.goodsList.forEach((item)=>{
  586. item.checked = this.isCheckAll && !item.isDisabled;
  587. this.setProductChecked(item);
  588. })
  589. }
  590. },
  591. checkAll(){//全选方法内调用方法
  592. this.isCheckAll = !this.isCheckAll;
  593. if(!this.isCheckAll){
  594. this.popupShow1 = false
  595. }
  596. this.updateBothCheckBtn();
  597. },
  598. totalShopPeice(){//每次所属会所下的商品增减重新计算合计价格&减去含有下架的商品
  599. let touchPrice = 0;
  600. let reducedPrice = 0;//商铺合计满减价
  601. this.goodsList.map((item,index)=>{
  602. //计算店铺满减后店铺合计
  603. if(item.promotions && item.promotions.mode == 2){
  604. let prosPrice=0;
  605. let totalOriginalPrice = 0;//商铺合计原价
  606. item.cartList.forEach(pros=>{
  607. prosPrice += pros.price*pros.number
  608. totalOriginalPrice += pros.originalPrice*pros.number
  609. })
  610. if(prosPrice >= item.promotions.touchPrice){
  611. item.totalPrice = prosPrice - item.promotions.reducedPrice
  612. item.reducedPrice = item.promotions.reducedPrice
  613. item.totalOriginalPrice = totalOriginalPrice
  614. }else{
  615. item.reducedPrice = 0 //统计合计价格
  616. item.totalPrice = prosPrice
  617. }
  618. }else{//以下为计算除店铺满减以外的单品满减以及正常商品合计
  619. let _totalPrice = 0;
  620. let _reducedPrice = 0;
  621. let _totalOriginalPrice =0;
  622. item.cartList.forEach(pros=>{
  623. let _price = pros.price*pros.number
  624. _totalOriginalPrice += pros.price*pros.number;
  625. if(pros.promotions && pros.promotions.type != 2 && pros.promotions.mode == 2){
  626. if(_price >= pros.promotions.touchPrice){
  627. _price = _price - pros.promotions.reducedPrice
  628. _reducedPrice += pros.promotions.reducedPrice
  629. }
  630. _totalPrice += _price
  631. }else{
  632. _reducedPrice = 0;
  633. _totalPrice += pros.price*pros.number;
  634. }
  635. })
  636. item.reducedPrice = _reducedPrice
  637. item.totalOriginalPrice = _totalOriginalPrice
  638. item.totalPrice = _totalPrice
  639. }
  640. })
  641. },
  642. totalPeice(){//计算总价格,每次调用此方法,将初始值为0,遍历价格并累加
  643. let totalPrice = 0;
  644. let reducedPrice = 0;
  645. let originalPrice = 0;
  646. this.goodsList.forEach((item,index)=>{
  647. let supplierPrice = 0;
  648. let supplierReducedPrice = 0;
  649. item.totalprice = 0;
  650. item.reducedprice = 0;
  651. item.originalprice = 0;
  652. item.cartList.forEach(pros=>{
  653. if(pros.productsChecked){
  654. supplierPrice += pros.price*pros.number;
  655. // 单品满减
  656. if(pros.promotions && pros.promotions.type*1===1 && pros.promotions.mode*1===2){
  657. // 单品满减-重新计算供应商总价/满减金额
  658. if(pros.price*pros.number >= pros.promotions.touchPrice){
  659. supplierPrice -= pros.promotions.reducedPrice;
  660. supplierReducedPrice += pros.promotions.reducedPrice;
  661. }
  662. }
  663. }
  664. })
  665. // 店铺满减
  666. if(item.promotions && item.promotions.mode*1===2){
  667. // 店铺满减-计算供应商总价/满减金额
  668. if(supplierPrice >= item.promotions.touchPrice){
  669. supplierPrice -= item.promotions.reducedPrice;
  670. supplierReducedPrice += item.promotions.reducedPrice;
  671. }
  672. }
  673. item.totalprice = supplierPrice;
  674. item.reducedprice = supplierReducedPrice;
  675. item.originalprice = (supplierPrice+supplierReducedPrice);
  676. totalPrice += item.totalprice;
  677. reducedPrice += item.reducedprice;
  678. originalPrice += item.originalprice;
  679. })
  680. // 总促销计算
  681. this.promotionsList.forEach(promotions =>{
  682. // 凑单满减
  683. if(promotions.mode*1===2 && promotions.type*1===2){
  684. let total = 0;
  685. promotions.productList.forEach(pros=>{
  686. if (this.submitIds.includes(pros.productId*1)){
  687. total += pros.number * pros.price;
  688. }
  689. });
  690. if(total>=promotions.touchPrice){
  691. totalPrice -= promotions.reducedPrice;
  692. reducedPrice += promotions.reducedPrice;
  693. }
  694. }
  695. });
  696. // 最后统计商品原价
  697. this.totalOriginalPrice = originalPrice;
  698. // 最后满减金额 = 店铺减去金额 + 单品减去金额 + 凑单减去金额
  699. this.reducedPrice = reducedPrice;
  700. // 最终合计价格 = 店铺满减合计 + 单品满减 + 正常合计 + 凑单满减
  701. this.allPrice = totalPrice ;
  702. // 计算优惠券
  703. if(this.totalCouponList.length>0){
  704. this.calculationCoupon()
  705. }
  706. // 最后满减金额 = 店铺减去金额 + 单品减去金额 + 凑单减去金额
  707. this.totalDiscountAmount = this.reducedPrice + this.couponPrice;
  708. // 控制显示优惠明细
  709. if(this.totalDiscountAmount > 0 ){
  710. this.isDiscount = true
  711. }else{
  712. this.isDiscount = false
  713. }
  714. },
  715. totalCount(){//计算总数量
  716. this.allCount = 0
  717. let prosAllCount=0
  718. let validCount = 0
  719. let validList =[];
  720. let productsList =[];
  721. this.goodsList.forEach(item=>{
  722. productsList = item.cartList
  723. productsList.forEach(pros=>{
  724. if(pros.productsChecked){
  725. prosAllCount+=parseInt(pros.number);
  726. this.allCount = prosAllCount
  727. }
  728. })
  729. })
  730. },
  731. calculationCoupon(){// 优惠券计算
  732. const eligibleCoupons = [];
  733. this.goodsList.forEach((shop,index)=>{
  734. shop.cartList.forEach(pros=>{
  735. if(pros.productsChecked){
  736. this.totalCouponList.map((coupon,index)=>{//循环优惠券
  737. const couponType = coupon.couponType;
  738. if(couponType == 0){// 活动券
  739. if(coupon.productType == 1){// 活动券-全商城商品
  740. if(this.allPrice>=coupon.touchPrice){
  741. eligibleCoupons.push(coupon)
  742. eligibleCoupons.sort((a,b)=> b.couponAmount - a.couponAmount )
  743. }
  744. }else if(coupon.productType == 2){// 活动券-指定商品
  745. if(coupon.productIds && coupon.productIds.includes(pros.productId)){
  746. if(this.allPrice>=coupon.touchPrice){
  747. eligibleCoupons.push(coupon)
  748. eligibleCoupons.sort((a,b)=> b.couponAmount - a.couponAmount )
  749. }
  750. }else{
  751. return false
  752. }
  753. }
  754. // 品类券适用于产品或者仪器,购买产品类或仪器类的商品,商品金额达到优惠标准即可使用优惠券
  755. }else if(couponType == 1){// 品类券 categoryType(commodityType) : 1 产品 2 仪器
  756. if( coupon.categoryType && coupon.categoryType == pros.commodityType){
  757. if(this.allPrice>=coupon.touchPrice){
  758. eligibleCoupons.push(coupon)
  759. eligibleCoupons.sort((a,b)=> b.couponAmount - a.couponAmount )
  760. }
  761. }
  762. // 适用于商城全部商品
  763. }else if(couponType == 2 || couponType == 4){// 用户专享券和新用户券
  764. if(this.allPrice>=coupon.touchPrice){
  765. eligibleCoupons.push(coupon)
  766. eligibleCoupons.sort((a,b)=> b.couponAmount - a.couponAmount )
  767. }
  768. // 店铺券适用于某个供应商的全部商品
  769. }else if(couponType == 3){// 店铺券 supplierId
  770. if(coupon.shopId && pros.supplierId == coupon.shopId){
  771. if(this.allPrice>=coupon.touchPrice){
  772. eligibleCoupons.push(coupon)
  773. eligibleCoupons.sort((a,b)=> b.couponAmount - a.couponAmount )
  774. }
  775. }
  776. }
  777. })
  778. }
  779. })
  780. })
  781. if(eligibleCoupons.length>0){
  782. this.eligibleCoupons.push(eligibleCoupons[0])
  783. this.couponPrice = this.eligibleCoupons.sort((a,b)=> b.couponAmount - a.couponAmount)[0].couponAmount
  784. }
  785. },
  786. checkenTotalPrice(){
  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>