cart.vue 52 KB

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