cart.vue 40 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462
  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-xuanze':'icon-weixuanze']"></view>
  17. </view>
  18. <view class="text">{{item.name}}</view>
  19. </view>
  20. <view class="productlist">
  21. <view class="goods-pros" v-for="(pros,idx) in item.productList" :key="idx" >
  22. <view class="goods-pros-t">
  23. <!--选择商品-->
  24. <view class="checkbox-box" @click.stop="ischeck(item,pros)">
  25. <view class="checkbox iconfont" :class="[pros.productsChecked ? 'icon-xuanze':'icon-weixuanze']"></view>
  26. </view>
  27. <view class="pros-img" @click.stop="navToListPage(pros.productId)" ><image :src="pros.mainImage ? pros.mainImage:''" alt="" /></view>
  28. <view class="pros-product">
  29. <view class="producttitle" @click.stop="navToListPage(pros.productId)" >{{pros.productName}}</view>
  30. <view v-show="pros.actStatus==1" class="floor-item-act">
  31. <view v-if="PromotionsFormat(pros.promotion)" class="floor-tags" @click.stop="clickPopupShow(pros,1)">
  32. {{pros.promotion.name}}
  33. <text v-if ="pros.promotion!=null && pros.promotion.type!=3">
  34. :¥{{ pros.promotion == null ? '0.00' : pros.promotion.touchPrice | NumFormat}}
  35. </text>
  36. </view>
  37. <view v-else-if="pros.promotion.type!=3" class="floor-tags" @click.stop="clickPopupShow(pros,2)">{{pros.promotion.name}}</view>
  38. </view>
  39. <view v-if="pros.actStatus == null && pros.ladderPriceFlag == 1" class="floor-item-act">
  40. <view class="floor-tags" @click.stop="clickPopupShow(pros,2)">阶梯价格</view>
  41. </view>
  42. <view class="productspec">规格:{{pros.unit ? pros.unit : ''}}</view>
  43. <view class="productprice">
  44. <!--使用过滤器对总价改变-->
  45. <view class="price" :class="PromotionsFormat(pros.promotion) ? 'disabled' : ''">
  46. <text>¥</text>
  47. {{ (PromotionsFormat(pros.promotion) ? pros.price : pros.retailPrice) | NumFormat }}
  48. </view>
  49. <view class="count">
  50. <view class="number-box">
  51. <view class="iconfont icon-jianhao" @click="changeCountSub(item,pros)"></view>
  52. <input class="btn-input" type="number" maxlength='4' v-model="pros.productCount" @blur="changeNnmber($event,item,pros)" @focus="changeInput(pros)">
  53. <view class="iconfont icon-jiahao" @click="changeCountAdd(item,pros)"></view>
  54. </view>
  55. </view>
  56. </view>
  57. </view>
  58. </view>
  59. </view>
  60. </view>
  61. <view class="goods-pros-b clearfix">
  62. <view class="sum-none" v-if="item.reducedPrice>0">
  63. <text class="money-sign">¥</text>
  64. <text class="money">{{ item.totalOriginalPrice | NumFormat }}</text>
  65. <text class="money-reduced">减<text>¥{{ item.reducedPrice | NumFormat}}</text></text>
  66. </view>
  67. <view class="sum">合计:<text class="money"><text class="money-sign">¥</text>{{item.totalPrice | NumFormat}}</text></view>
  68. </view>
  69. </view>
  70. </view>
  71. <view class="failure-list" v-if="failureList.length>0">
  72. <view class="failure-title">
  73. <view class="title-txt">失效商品<text>{{failureList.length}}件</text></view>
  74. <view class="title-btn" @click.stop="deletefailureList"><text class="butto">清空失效商品</text></view>
  75. </view>
  76. <view class="productlist">
  77. <view class="goods-pros" v-for="(failure,failureIdx) in failureList" :key="failureIdx" >
  78. <view class="goods-pros-t" @click.stop="failureToProduct(failure)">
  79. <!--选择商品-->
  80. <view class="checkbox-box" @click.stop="ischeckFailure(failure)" v-if="isshowDelbtn">
  81. <button class="checkbox iconfont"
  82. :class="[ failure.productsChecked ? 'icon-xuanze':'icon-weixuanze']">
  83. </button>
  84. </view>
  85. <text class="img-tip">失效</text>
  86. <view class="pros-img">
  87. <image :src="failure.mainImage ? failure.mainImage:''" alt="" />
  88. </view>
  89. <view class="pros-product">
  90. <view class="producttitle">{{failure.productName}}</view>
  91. <view class="productspec">规格:{{failure.unit ? failure.unit : ''}}</view>
  92. <view class="productstate">商品已下架</view>
  93. </view>
  94. </view>
  95. </view>
  96. </view>
  97. </view>
  98. </view>
  99. <!-- 脚部菜单 -->
  100. <view class="footer" :style="{paddingBottom :isIphoneX ? '68rpx' : '0rpx'}">
  101. <view class="footer-le">
  102. <view class="foot-check checkbox-box" @tap.stop="checkAll()">
  103. <button class="checkbox iconfont" :class="[isCheckAll?'icon-xuanze':'icon-weixuanze']"></button>
  104. <view class="text">全选</view>
  105. </view>
  106. <view class="sum">
  107. <view class="sum-none" v-if="reducedPrice>0">
  108. <text class="money-sign">¥</text>
  109. <text class="money">{{ totalOriginalPrice | NumFormat }}</text>
  110. <text class="money-reduced">减<text>¥{{ reducedPrice | NumFormat}}</text></text>
  111. </view>
  112. <view class="sum-price" :class="reducedPrice == 0 ? 'none' : ''">
  113. 总价:<text class="money-sign">¥</text><text class="money">{{allPrice | NumFormat}}</text>
  114. </view>
  115. </view>
  116. </view>
  117. <view v-if="!isshowDelbtn" class="footer-ri" >
  118. <view class="btn hanld-btn" @tap="toConfirmation">去结算({{allCount}})</view>
  119. </view>
  120. <view v-else class="footer-del">
  121. <view class="btn btn-cancel" @tap.stop="hideDelManage">取消</view>
  122. <view class="btn btn-confirm" @tap.stop="deleteList">删除</view>
  123. </view>
  124. </view>
  125. </view>
  126. <view v-else class="cart-content empty">
  127. <view class="empty-container">
  128. <image class="empty-container-image" src="https://static-b.caimei365.com/app/wisa/img/icon/cart_empth.png" mode="aspectFit"></image>
  129. <text class="error-text">购物车空空如也,快去下单吧~</text>
  130. </view>
  131. </view>
  132. </view>
  133. <!-- 操作弹窗 -->
  134. <tui-modal :show="modal" @click="handleClick" @cancel="hideMobel" :content="contentModalText" color="#333" :size="32" shape="circle" :maskClosable="false"></tui-modal>
  135. <!-- 促销活动弹窗 -->
  136. <activi-popup :product="handlerPros" :popupShow="popupShow"></activi-popup>
  137. <!-- 透明模态层 -->
  138. <modal-layer v-if='modallayer'></modal-layer>
  139. </view>
  140. </template>
  141. <script>
  142. import authorize from '@/common/config/authorize.js'
  143. import tuiSkeleton from "@/components/tui-skeleton/tui-skeleton"
  144. import tuiLoadmore from "@/components/tui-components/loadmore/loadmore"
  145. import tuiNomore from "@/components/tui-components/nomore/nomore"
  146. import activiPopup from "@/components/cm-module/productDetails/cm-activipopu"
  147. import modalLayer from "@/components/modal-layer"
  148. import { mapState,mapMutations } from 'vuex';
  149. export default{
  150. components:{
  151. tuiSkeleton,
  152. tuiLoadmore,
  153. tuiNomore,
  154. activiPopup,
  155. modalLayer
  156. },
  157. data(){
  158. return{
  159. CustomBar:this.CustomBar,// 顶部导航栏高度
  160. isIphoneX:this.$store.state.isIphoneX,
  161. userId:'',
  162. alertType:'',
  163. isStock:'',
  164. popupShow:false,
  165. handlerPros:{},//监听单挑促销商品
  166. failureList:[], //失效商品列表
  167. goodsList:[], //购物车的商品
  168. delGoodsList:'',//要删除的商品
  169. setGoodData:'', //确认订单的商品
  170. isCheckAll:false,//是否全选
  171. kindCount:0,//购物车宝贝数量
  172. allPrice:0,//所有价格
  173. totalOriginalPrice:0,//所有原价价
  174. reducedPrice:0,//满减
  175. allCount:0,//被选中的产品数量
  176. isModallayer:false,
  177. skeletonShow:true,
  178. isshowDelbtn:false,
  179. isDisabled: false, // 供应商/店铺全选是否禁用状态
  180. isNoConfim:false,
  181. isEmpty:false,//显示空购物车
  182. scrollHeight: 'auto',
  183. submitIds:[],
  184. modal:false,
  185. contentModalText:'',
  186. deleteType:0,
  187. }
  188. },
  189. onLoad(){
  190. this.setScrollHeight();
  191. },
  192. computed: {
  193. ...mapState(['hasLogin','userInfo'])
  194. },
  195. filters:{
  196. NumFormat(value) {//处理金额
  197. return Number(value).toFixed(2);
  198. },
  199. totalprice(val,count){//单件商品的价格 × 数量
  200. return (val * count).toFixed(2)
  201. }
  202. },
  203. methods:{
  204. initData(){
  205. this.isModallayer = false //遮罩层 防止多次点击
  206. this.skeletonShow = true //预加载圆圈
  207. this.isCheckAll=false//是否全选
  208. this.submitIds = []
  209. this.$api.getComStorage('clubInfo').then((resolve) =>{
  210. this.userId = resolve.userId
  211. this.initGetCartGoodsList();
  212. })
  213. },
  214. clickPopupShow(pros,type){
  215. this.popupShow = true;
  216. this.handlerPros = pros;
  217. },
  218. setScrollHeight() {
  219. // 窗口高度-footer高度
  220. const {windowHeight, pixelRatio} = uni.getSystemInfoSync();
  221. setTimeout(()=> {
  222. const query = uni.createSelectorQuery().in(this);
  223. query.selectAll('.footer').boundingClientRect();
  224. query.exec(res => {
  225. this.windowHeight = windowHeight;
  226. if(res[0][0]) {
  227. this.scrollHeight = windowHeight - res[0][0].height;
  228. }
  229. })
  230. }, 500)
  231. },
  232. initGetCartGoodsList(){//初始化购物车 index:1
  233. this.ProductService.QueryShoppingCartList({userId:this.userId}).then(response =>{
  234. this.skeletonShow = false
  235. let data = response.data
  236. this.kindCount = data.cartQuantity
  237. if( data.shopList.length > 0 || data.products.length > 0){
  238. this.isEmpty =false
  239. }else{
  240. this.isEmpty =true
  241. }
  242. if(data.shopList && data.shopList.length > 0 ){
  243. this.goodsList = data.shopList;
  244. this.goodsList.forEach((item,index) => {
  245. item.productList.forEach(pros => {
  246. pros.shopId = item.shopId;
  247. })
  248. })
  249. this.totalShopPeice()
  250. } else {
  251. this.goodsList = [];
  252. }
  253. if( data.products && data.products.length > 0){
  254. let newFailureList = [],isFailureLayer;
  255. data.products.forEach((failure,index) => {
  256. if(failure.status == 1 || failure.status == 2) {
  257. isFailureLayer = true
  258. }else{
  259. isFailureLayer = false
  260. }
  261. newFailureList.push(Object.assign({},failure,{isFailureLayer:isFailureLayer}))
  262. })
  263. this.failureList = newFailureList
  264. } else {
  265. this.failureList = [];
  266. }
  267. }).catch(error =>{
  268. this.$util.msg(error.msg,2000);
  269. })
  270. },
  271. ischeckFailure(failure){
  272. failure.productsChecked = !failure.productsChecked
  273. this.updateCheckAllBtn()
  274. },
  275. ischeck(item,pro){//为未选中的时候改变为true,反之为true
  276. pro.productsChecked = !pro.productsChecked;
  277. if(pro.productsChecked) {
  278. if(!this.submitIds.includes(pro.productID*1)){
  279. this.submitIds.push(pro.productID);
  280. }
  281. } else {
  282. var lent = this.submitIds.indexOf(pro.productID*1);
  283. if(lent >=0 ){
  284. this.submitIds.splice(lent, 1);
  285. }
  286. }
  287. this.updateProductCheckedAllBtn(item);
  288. this.updateCheckAllBtn();
  289. },
  290. updateProductCheckedAllBtn(item) {// 单独每个供应商的勾选判断
  291. let productsList = item.productList,
  292. productsCheckedLength = 0,
  293. disabledLength = 0;
  294. if(this.isshowDelbtn) {
  295. productsList.forEach(pros => {
  296. if(pros.productsChecked) {
  297. productsCheckedLength++;
  298. }
  299. })
  300. } else {
  301. productsList.forEach(pros => {
  302. if(pros.productsChecked) {
  303. productsCheckedLength++;
  304. }
  305. })
  306. }
  307. item.checked = productsCheckedLength === productsList.length;
  308. },
  309. updateCheckAllBtn() {// 全选勾选判断
  310. let goodsCheckedLength = 0,
  311. goodsList = this.goodsList,
  312. failureList = this.failureList;
  313. goodsList.forEach(item => {
  314. if(item.checked) {
  315. goodsCheckedLength++;
  316. }
  317. })
  318. failureList.forEach(failureItem=>{
  319. if(failureItem.productsChecked){
  320. goodsCheckedLength++;
  321. }
  322. })
  323. if(this.isshowDelbtn){
  324. this.isCheckAll = goodsCheckedLength === goodsList.length + failureList.length;
  325. }else{
  326. this.isCheckAll = goodsCheckedLength === goodsList.length;
  327. }
  328. },
  329. checkShop(item){//与单选商品类似
  330. item.checked = !item.checked;
  331. this.setProductChecked(item);
  332. this.updateCheckAllBtn();
  333. },
  334. setProductChecked(item) {
  335. item.productList.forEach(pros=>{
  336. if(item.checked) {
  337. pros.productsChecked = true;
  338. if(!this.submitIds.includes(pros.productId*1)){
  339. this.submitIds.push(pros.productId);
  340. }
  341. } else {
  342. pros.productsChecked = false;
  343. var lent = this.submitIds.indexOf(pros.productId*1);
  344. if(lent >=0 ){
  345. this.submitIds.splice(lent, 1);
  346. }
  347. }
  348. })
  349. },
  350. updateBothCheckBtn() {
  351. if(this.isshowDelbtn) {
  352. // 当管理删除按钮出现时,失效的商品可被选择
  353. this.goodsList.forEach((item)=>{
  354. item.checked = this.isCheckAll;
  355. this.setProductChecked(item);
  356. })
  357. //删除按钮 全选包括失效商品勾选
  358. this.failureList.forEach(failureItem=>{
  359. failureItem.productsChecked = this.isCheckAll;
  360. })
  361. } else {
  362. this.goodsList.forEach((item)=>{
  363. item.checked = this.isCheckAll && !item.isDisabled;
  364. this.setProductChecked(item);
  365. })
  366. }
  367. },
  368. checkAll(){//全选方法内调用方法
  369. this.isCheckAll = !this.isCheckAll;
  370. this.updateBothCheckBtn();
  371. },
  372. totalShopPeice(){//每次所属会所下的商品增减重新计算合计价格&减去含有下架的商品
  373. let touchPrice = 0;
  374. let reducedPrice = 0;//商铺合计满减价
  375. this.goodsList.map((item,index)=>{
  376. let _totalPrice = 0;
  377. let _reducedPrice = 0;
  378. let _totalOriginalPrice =0;
  379. item.productList.forEach(pros=>{
  380. let _price = pros.retailPrice*pros.productCount
  381. _totalOriginalPrice += pros.retailPrice*pros.productCount;
  382. if(pros.promotion && pros.promotion.type != 2 && pros.promotion.mode == 2){
  383. if(_price >= pros.promotion.touchPrice){
  384. _price = _price - pros.promotion.reducedPrice
  385. _reducedPrice += pros.promotion.reducedPrice
  386. }
  387. _totalPrice += _price
  388. }else{
  389. _reducedPrice = 0;
  390. _totalPrice += pros.retailPrice*pros.productCount;
  391. }
  392. })
  393. item.reducedPrice = _reducedPrice
  394. item.totalOriginalPrice = _totalOriginalPrice
  395. item.totalPrice = _totalPrice
  396. console.log(item.totalPrice)
  397. })
  398. },
  399. totalPeice(){//计算总价格,每次调用此方法,将初始值为0,遍历价格并累加
  400. let totalPrice = 0;
  401. let reducedPrice = 0;
  402. let originalPrice = 0;
  403. this.goodsList.forEach((item,index)=>{
  404. let supplierPrice = 0;
  405. let supplierReducedPrice = 0;
  406. item.totalprice = 0;
  407. item.reducedprice = 0;
  408. item.originalprice = 0;
  409. item.productList.forEach(pros=>{
  410. if(pros.productsChecked){
  411. supplierPrice += pros.retailPrice*pros.productCount;
  412. // 单品满减
  413. if(pros.promotion && pros.promotion.type*1===1 && pros.promotion.mode*1===2){
  414. // 单品满减-重新计算供应商总价/满减金额
  415. if(pros.retailPrice*pros.productCount >= pros.promotion.touchPrice){
  416. supplierPrice -= pros.promotion.reducedPrice;
  417. supplierReducedPrice += pros.promotion.reducedPrice;
  418. }
  419. }
  420. }
  421. })
  422. item.totalprice = supplierPrice;
  423. item.reducedprice = supplierReducedPrice;
  424. item.originalprice = (supplierPrice+supplierReducedPrice);
  425. totalPrice += item.totalprice;
  426. reducedPrice += item.reducedprice;
  427. originalPrice += item.originalprice;
  428. })
  429. //最后统计商品原价
  430. this.totalOriginalPrice = originalPrice;
  431. //最后满减金额 = 店铺减去金额 + 单品减去金额 + 凑单减去金额
  432. this.reducedPrice = reducedPrice;
  433. //最终合计价格 = 店铺满减合计 + 单品满减 + 正常合计 + 凑单满减
  434. this.allPrice = totalPrice ;
  435. },
  436. totalCount(){//计算总数量
  437. this.allCount = 0
  438. let prosAllCount=0
  439. let validCount = 0
  440. let validList =[];
  441. let productsList =[];
  442. this.goodsList.forEach(item=>{
  443. productsList = item.productList
  444. productsList.forEach(pros=>{
  445. if(pros.productsChecked){
  446. prosAllCount+=parseInt(pros.productCount);
  447. this.allCount = prosAllCount
  448. }
  449. })
  450. })
  451. },
  452. changeCountAdd(item,pros){//商品数量加加
  453. if(pros.step === 2){
  454. pros.productCount += pros.minBuyNumber
  455. this.processActivityPrice(pros)
  456. this.isStock = false
  457. }else{
  458. pros.productCount++
  459. this.processActivityPrice(pros)
  460. this.isStock = false
  461. }
  462. this.updateShoppogNum(pros)
  463. this.totalShopPeice();
  464. },
  465. changeCountSub(item,pros){//商品数量减减
  466. if(pros.productCount<=pros.minBuyNumber){
  467. pros.productCount= pros.minBuyNumber
  468. this.$util.msg(`该商品最小起订量为${pros.minBuyNumber}`,2000);
  469. return
  470. }else{
  471. if(pros.step === 2){
  472. pros.isStep = false
  473. pros.productCount -= pros.minBuyNumber
  474. }else{
  475. pros.productCount--
  476. }
  477. this.processActivityPrice(pros)
  478. }
  479. this.updateShoppogNum(pros)
  480. this.totalShopPeice();
  481. },
  482. changeInput(pros){//输入商品数量更新
  483. },
  484. changeNnmber(e,item,pros){//输入商品数量更新
  485. let _value = Number(e.detail.value);
  486. if(!this.$api.isNumber(_value)){
  487. pros.productCount = pros.minBuyNumber
  488. }else if(_value < pros.minBuyNumber){
  489. console.log('111111')
  490. this.$util.msg(`该商品最小起订量为${pros.minBuyNumber}`,2000);
  491. pros.productCount = pros.minBuyNumber
  492. }else if(_value % pros.minBuyNumber != 0){
  493. console.log('22222222')
  494. pros.productCount = pros.minBuyNumber
  495. }else{
  496. console.log('33333333')
  497. pros.productCount = _value
  498. this.processActivityPrice(pros)
  499. }
  500. this.updateShoppogNum(pros)
  501. this.totalShopPeice();
  502. },
  503. processActivityPrice(pros){//单独处理活动价格和阶梯价格
  504. let ladderPriceList = pros.ladderPrices;
  505. if(pros.ladderPriceFlag == '0' || pros.actStatus == 1){
  506. pros.price = pros.price
  507. }else{
  508. ladderPriceList.forEach((item,index)=>{
  509. if(pros.productCount>=item.buyNum){
  510. pros.price = item.buyPrice
  511. }
  512. })
  513. }
  514. },
  515. updateShoppogNum(pros){//加减购物车商品更新到后台
  516. this.ProductService.ShoppingCartUpdate({cartId:pros.cartId,productCount:pros.productCount})
  517. .then(response =>{
  518. this.isshowDelbtn = false;
  519. this.initGetCartGoodsList();
  520. })
  521. .catch(error =>{
  522. this.$util.msg(error.msg,2000);
  523. })
  524. },
  525. toConfirmation(){//跳转确认订单页面
  526. let setGoodsList=[];
  527. this.goodsList.forEach(res=>{
  528. let products = res.productList
  529. products.forEach(pros=>{
  530. if(pros.productsChecked){
  531. setGoodsList.push(pros.productId)
  532. }
  533. })
  534. })
  535. if(setGoodsList == ''){
  536. this.$util.msg("请先选择结算商品~",2000);
  537. return
  538. }else{
  539. this.isNoConfim = false
  540. this.goodsList.forEach(el=>{
  541. el.productList.forEach(pros=>{
  542. if(pros.productsChecked){
  543. if(pros.productCount<pros.minBuyNumber){
  544. this.isNoConfim = true
  545. }
  546. }
  547. })
  548. })
  549. if(this.isNoConfim){
  550. this.$util.modal('','有商品的购买量没达到最小起订量,请修改数量后再次提交结算','去修改','',false,() =>{})
  551. return;
  552. }
  553. let productID = '';
  554. this.goodsList.forEach(el=>{//获取勾选的商品ID拼接字符串逗号隔开,最后一个逗号去掉
  555. el.productList.forEach(pros=>{
  556. if(pros.productsChecked){
  557. productID += pros.productId+','
  558. }
  559. })
  560. })
  561. let cartPramsData={
  562. userId:this.userId,
  563. allPrice:this.allPrice,
  564. allCount:this.allCount,
  565. productID:productID.substring(0,productID.lastIndexOf(',')),
  566. productCount:''
  567. }
  568. this.$api.navigateTo(`/pages/user/order/create-order?data=${JSON.stringify({data:cartPramsData})}`)
  569. }
  570. },
  571. showDelManager(){//显示删除商品管理
  572. this.isshowDelbtn = true;
  573. if(this.isCheckAll) {
  574. this.updateBothCheckBtn();
  575. } else {
  576. this.goodsList.forEach(item => {
  577. if(item.checked) {
  578. item.productList.forEach(pros => {
  579. pros.productsChecked = true;
  580. })
  581. }
  582. })
  583. this.updateCheckAllBtn();
  584. }
  585. // 失效也被勾选
  586. this.failureList.forEach(failureItem => {
  587. if(failureItem.isFailureLayer){
  588. failureItem.isFailureLayer = false
  589. }
  590. })
  591. },
  592. hideDelManage(){//隐藏删除商品管理
  593. this.isshowDelbtn = false;
  594. let isFailureLayer,newFailureList =[];
  595. if(this.isCheckAll) {
  596. this.updateBothCheckBtn();
  597. } else {
  598. // 失效商品取消勾选
  599. this.goodsList.forEach(item => {
  600. if(item.isDisabled) {
  601. item.checked = false;
  602. }
  603. item.productList.forEach(pros => {
  604. if(pros.validFlag == 3) {
  605. pros.productsChecked = false;
  606. }
  607. })
  608. })
  609. this.updateCheckAllBtn();
  610. }
  611. this.failureList.forEach((failure,index) => {
  612. if(failure.failureState == 1 || failure.failureState == 2) {
  613. isFailureLayer = true
  614. }else{
  615. isFailureLayer = false
  616. }
  617. newFailureList.push(Object.assign({},failure,{isFailureLayer:isFailureLayer}))
  618. })
  619. this.failureList = newFailureList;
  620. },
  621. deleteList(){//删除购物车商品
  622. this.delGoodsList=[];
  623. this.goodsList.forEach(delitem=>{
  624. let products = delitem.productList
  625. products.forEach(pros=>{
  626. if(pros.productsChecked){
  627. this.delGoodsList += pros.cartId+','
  628. }
  629. })
  630. })
  631. this.failureList.forEach(failure=>{
  632. if(failure.productsChecked){
  633. this.delGoodsList += failure.cartId+','
  634. }
  635. })
  636. if(this.delGoodsList.length == 0){
  637. this.$util.msg("请选择要删除的商品~",2000);
  638. return
  639. }else{
  640. this.modal = true;
  641. this.contentModalText = '确定删除选中的商品吗?';
  642. this.deleteType = 1
  643. }
  644. },
  645. deletefailureList(){
  646. this.delGoodsList = ''
  647. this.failureList.forEach(failure=>{ this.delGoodsList += failure.cartId+',' })
  648. this.modal = true;
  649. this.contentModalText = '确定清除所有失效商品吗?';
  650. this.deleteType = 2
  651. },
  652. handleClick(e) {//用户操作订单
  653. let index = e.index;
  654. if(index == 1){
  655. this.ProductService.ShoppingCartDelete(
  656. {
  657. cartIds:this.delGoodsList,
  658. }
  659. )
  660. .then(response =>{
  661. this.$util.msg('删除成功',2000);
  662. setTimeout(()=>{
  663. this.isshowDelbtn = false;
  664. this.initGetCartGoodsList();
  665. },1000)
  666. }).catch(error =>{
  667. this.$util.msg(error.msg,2000)
  668. })
  669. }
  670. this.modal = false;
  671. },
  672. hideMobel(){
  673. this.modal = false;
  674. },
  675. goNavto(url){
  676. uni.navigateTo ({
  677. url
  678. })
  679. },
  680. navToListPage(id){
  681. this.isModallayer = true;
  682. console.log(this.goodsList)
  683. this.$api.navigateTo(`/pages/goods/product?id=${id}`)
  684. },
  685. failureToProduct(failure){
  686. this.isModallayer = true;
  687. this.$api.navigateTo(`/pages/goods/product?id=${failure.productId}`)
  688. },
  689. failureStateText(state){
  690. let stateText = '',
  691. stateTextObject={
  692. 1:'商品已丢失',
  693. 2:'商品已停售',
  694. 3:'商品已下架',
  695. 4:'商品已售罄',
  696. 5:'价格仅会员可见,您不能购买',
  697. 6:'未公开价格',
  698. 7:'库存不足'
  699. }
  700. Object.keys(stateTextObject).forEach(key => {
  701. if(key == state){
  702. stateText = stateTextObject[key]
  703. }
  704. })
  705. return stateText;
  706. },
  707. setHeaderBtnPosi(){
  708. // 获得胶囊按钮位置信息
  709. let headerBtnPosi = uni.getMenuButtonBoundingClientRect();
  710. return headerBtnPosi
  711. },
  712. setSysteminfo(){
  713. let systeminfo;
  714. uni.getSystemInfo({ // 获取设备信息
  715. success: (res) => {
  716. systeminfo = res
  717. },
  718. })
  719. return systeminfo
  720. },
  721. PromotionsFormat(promo){//促销活动类型数据处理
  722. if(promo!=null){
  723. if(promo.type == 1 && promo.mode == 1){
  724. return true
  725. }else{
  726. return false
  727. }
  728. }
  729. return false
  730. }
  731. },
  732. watch:{//深度监听所有数据,每次改变重新计算总价和总数
  733. goodsList:{
  734. deep:true,
  735. handler(val,oldval){
  736. this.totalPeice()
  737. this.totalCount()
  738. }
  739. }
  740. },
  741. onPullDownRefresh() {//下拉刷新
  742. this.initGetCartGoodsList()
  743. uni.stopPullDownRefresh()
  744. },
  745. onShow(){
  746. this.initData()
  747. },
  748. }
  749. </script>
  750. <style lang="scss">
  751. page{
  752. background: #f7f7f7;
  753. height: auto;
  754. }
  755. .cart-content{
  756. position: relative;
  757. }
  758. .container-cart-main.none{
  759. display: none;
  760. }
  761. .container-cart-main.show{
  762. display: block;
  763. }
  764. .cart-content.empty.none{
  765. display: none;
  766. }
  767. .cart-content.empty.show{
  768. display: block;
  769. }
  770. .container-cart.show{
  771. display: block;
  772. }
  773. .container-cart.none{
  774. display: none;
  775. }
  776. .empty-container.none{
  777. display: none;
  778. }
  779. .empty-container.show{
  780. display: flex;
  781. }
  782. .foot-check-delbtn{
  783. width: 100%;
  784. height: 80rpx;
  785. position: fixed;
  786. top: 0;
  787. left: 0;
  788. box-sizing: border-box;
  789. padding: 15rpx 24rpx;
  790. background-color: #F7F7F7;
  791. z-index: 990;
  792. .foot-text{
  793. font-size: $font-size-26;
  794. height: 50rpx;
  795. line-height: 50rpx;
  796. color:#666666;
  797. float: left;
  798. padding-left: 10rpx;
  799. text{
  800. margin: 0 6rpx;
  801. }
  802. }
  803. .delBtn{
  804. width: 100rpx;
  805. display: inline-block;
  806. padding: 0 15rpx;
  807. font-size: $font-size-26;
  808. height: 50rpx;
  809. line-height: 50rpx;
  810. border-radius: 30rpx;
  811. background:#FFFFFF;
  812. border: 1px solid #333333;
  813. color: #333333;
  814. float: right;
  815. text-align: center;
  816. &.none{
  817. display: none;
  818. }
  819. }
  820. }
  821. .checkbox-box{
  822. display: flex;
  823. align-items: center;
  824. .checkbox{
  825. display: flex;
  826. margin: 0;
  827. padding: 5rpx;
  828. display: flex;
  829. flex-direction: column;
  830. align-items: center;
  831. box-sizing: border-box;
  832. text-align: center;
  833. text-decoration: none;
  834. border-radius: 0;
  835. -webkit-tap-highlight-color: transparent;
  836. overflow: hidden;
  837. background-color:#FFFFFF;
  838. font-size: 36rpx;
  839. color:#999999;
  840. &.icon-xuanze{
  841. color: $color-system;
  842. }
  843. }
  844. &.disabled{
  845. .checkbox{
  846. color:#999999
  847. }
  848. }
  849. .text{
  850. font-size: $font-size-24;
  851. margin-left: 10rpx;
  852. }
  853. }
  854. .goods-list{
  855. width: 100%;
  856. height: auto;
  857. background-color: #F7F7F7;
  858. .goods-item{
  859. width: 702rpx;
  860. padding: 0 24rpx;
  861. background: #FFFFFF;
  862. margin-bottom: 24rpx;
  863. }
  864. .shoptitle{
  865. display: flex;
  866. align-items: center;
  867. height: 80rpx;
  868. line-height: 80rpx;
  869. .checkbox-box{
  870. padding: 10rpx;
  871. }
  872. .text{
  873. width: 450rpx;
  874. display: block;
  875. overflow: hidden;
  876. text-overflow:ellipsis;
  877. white-space: nowrap;
  878. margin-left: 20rpx;
  879. font-size: $font-size-28;
  880. color: $text-color;
  881. text-align: left;
  882. font-weight: bold;
  883. }
  884. }
  885. .goods-pros{
  886. width: 100%;
  887. height: auto;
  888. margin-bottom: 20rpx;
  889. }
  890. .goods-pros-t{
  891. display: flex;
  892. align-items: center;
  893. width: 100%;
  894. height: 210rpx;
  895. padding:0 0 26rpx 0;
  896. .checkbox-box{
  897. padding: 10rpx;
  898. }
  899. .pros-img{
  900. width: 210rpx;
  901. height: 100%;
  902. border-radius: 10rpx;
  903. margin:0 20rpx;
  904. border:1px solid #f3f3f3;
  905. image{
  906. width: 100%;
  907. height: 100%;
  908. border-radius: 10rpx;
  909. }
  910. }
  911. }
  912. .goods-pros-b{
  913. width:100%;
  914. height: auto;
  915. padding:0 0 24rpx 0;
  916. box-sizing: border-box;
  917. &.show{
  918. display: block;
  919. }
  920. &.none{
  921. display: none;
  922. }
  923. .sum-none{
  924. width: 100%;
  925. height: 48rpx;
  926. line-height: 48rpx;
  927. color: $text-color;
  928. float: left;
  929. text-align: right;
  930. .money{
  931. font-size: $font-size-26;
  932. color: #999999;
  933. text-decoration: line-through;
  934. }
  935. .money-sign{
  936. font-size: $font-size-26;
  937. color: #999999;
  938. text-decoration: line-through;
  939. }
  940. .money-reduced{
  941. margin-left: 10rpx;
  942. font-size: $font-size-26;
  943. color: $color-system;
  944. .iconfont{
  945. font-size: $font-size-34;
  946. }
  947. }
  948. }
  949. .sum{
  950. width: 100%;
  951. height: 40rpx;
  952. font-size: $font-size-26;
  953. line-height: 40rpx;
  954. color: $text-color;
  955. float: left;
  956. display: flex;
  957. justify-content: flex-end;
  958. font-weight: bold;
  959. .money{
  960. color: #FF2A2A;
  961. font-size: $font-size-26;
  962. }
  963. .money-sign{
  964. font-size: $font-size-24;
  965. color: #FF2A2A;
  966. }
  967. }
  968. }
  969. .pros-product{
  970. width: 416rpx;
  971. height: 100%;
  972. line-height: 36rpx;
  973. font-size: $font-size-28;
  974. position: relative;
  975. .producttitle{
  976. width: 100%;
  977. display: inline-block;
  978. height: auto;
  979. text-overflow:ellipsis;
  980. display: -webkit-box;
  981. word-break: break-all;
  982. -webkit-box-orient: vertical;
  983. -webkit-line-clamp: 2;
  984. overflow: hidden;
  985. margin-bottom: 15rpx;
  986. .no-text{
  987. display: inline-block;
  988. height:36rpx;
  989. padding: 0 12rpx;
  990. line-height: 36rpx;
  991. background:linear-gradient(315deg,rgba(231,0,0,1) 0%,rgba(255,104,1,1) 100%);
  992. border-radius:18rpx;
  993. text-align: center;
  994. color: #FFFFFF;
  995. font-size:$font-size-28;
  996. margin-right: 24rpx;
  997. }
  998. }
  999. .productspec{
  1000. width: 100%;
  1001. height: 36rpx;
  1002. float: left;
  1003. margin-top: 10rpx;
  1004. color: #999999;
  1005. font-size: $font-size-26;
  1006. }
  1007. .productprice{
  1008. width: 100%;
  1009. height: 48rpx;
  1010. margin: 30rpx 0 0 0;
  1011. float: left;
  1012. .price{
  1013. line-height: 48rpx;
  1014. font-size: $font-size-26;
  1015. width: 48%;
  1016. color: #FF2A2A;
  1017. float: left;
  1018. font-weight: bold;
  1019. &.disabled{
  1020. color: #999999;
  1021. text-decoration: line-through;
  1022. }
  1023. .money-sign{
  1024. font-size: $font-size-24;
  1025. color: #FF2A2A;
  1026. }
  1027. }
  1028. .count{
  1029. height: 100%;
  1030. float: right;
  1031. position: relative;
  1032. &.show{
  1033. display: block;
  1034. }
  1035. &.none{
  1036. display: none;
  1037. }
  1038. .count-tips{
  1039. width: auto;
  1040. display: inline-block;
  1041. padding: 0 15rpx;
  1042. line-height: 44rpx;
  1043. height: 44rpx;
  1044. border-radius: 22rpx;
  1045. background: $btn-confirm;
  1046. font-size: $font-size-24;
  1047. text-align: center;
  1048. color: #FFFFFF;
  1049. position: absolute;
  1050. top:-60rpx;
  1051. left: -5rpx;
  1052. z-index: 5;
  1053. &.step{
  1054. left:-217rpx
  1055. }
  1056. &::before{
  1057. content: "";
  1058. position: absolute;
  1059. bottom: -30rpx;
  1060. right: 15rpx;
  1061. z-index:1;
  1062. width: 0;
  1063. height: 0;
  1064. border-width: 18rpx;
  1065. border-style: solid;
  1066. border-color:$color-system transparent transparent transparent;
  1067. }
  1068. }
  1069. .number-box {
  1070. display: flex;
  1071. justify-content: center;
  1072. align-items: center;
  1073. border: 2rpx solid #e1e1e1;
  1074. border-radius: 30rpx;
  1075. height: 48rpx;
  1076. margin-left: 20rpx;
  1077. .iconfont {
  1078. font-size: $font-size-24;
  1079. padding: 0 14rpx;
  1080. color: #333333;
  1081. text-align: center;
  1082. line-height: 48rpx;
  1083. font-weight: bold;
  1084. background: #ffffff;
  1085. &.icon-jianhao {
  1086. border-radius: 30rpx 0 0 30rpx;
  1087. }
  1088. &.icon-jiahao {
  1089. border-radius: 0 30rpx 30rpx 0;
  1090. }
  1091. }
  1092. .btn-input {
  1093. width: 56rpx;
  1094. height: 44rpx;
  1095. line-height: 44rpx;
  1096. border-radius: 4rpx;
  1097. text-align: center;
  1098. font-size: $font-size-24;
  1099. color: #333333;
  1100. background-color: #f7f7f7;
  1101. }
  1102. }
  1103. .uni-numbox{
  1104. position: absolute;
  1105. left: 45rpx;
  1106. bottom: 0;
  1107. .uni-numbox-minus, .uni-numbox-plus{
  1108. width: 50rpx;
  1109. line-height: 40rpx;
  1110. }
  1111. .uni-numbox-value {
  1112. font-size: $font-size-28;
  1113. width: 60rpx;
  1114. }
  1115. }
  1116. }
  1117. }
  1118. .floor-item-act{
  1119. width: 100%;
  1120. height: auto;
  1121. text-align: center;
  1122. box-sizing: border-box;
  1123. float: left;
  1124. padding:0 0 10rpx 0;
  1125. .floor-tags{
  1126. height: 28rpx;
  1127. border-radius: 6rpx;
  1128. background-color: #FFFFFF;
  1129. line-height: 28rpx;
  1130. color: #ff2a2a;
  1131. text-align: center;
  1132. display: inline-block;
  1133. padding:0 16rpx;
  1134. font-size: $font-size-20;
  1135. border: 1px solid #ff2a2a;
  1136. float: left;
  1137. }
  1138. }
  1139. }
  1140. }
  1141. .failure-list{
  1142. width: 702rpx;
  1143. height: auto;
  1144. padding: 0 24rpx;
  1145. margin-top: 20rpx;
  1146. background: #FFFFFF;
  1147. .failure-title{
  1148. width: 100%;
  1149. height: 82rpx;
  1150. line-height: 82rpx;
  1151. font-size: $font-size-28;
  1152. border-bottom: 1px solid #EBEBEB;
  1153. .title-txt{
  1154. float: left;
  1155. color:#666666;
  1156. text-align: left;
  1157. }
  1158. .title-btn{
  1159. float: right;
  1160. color: $color-system;
  1161. text-align: right;
  1162. line-height: 80rpx;
  1163. .butto{
  1164. display: inline-block;
  1165. padding: 0 15rpx;
  1166. font-size: $font-size-26;
  1167. height: 50rpx;
  1168. line-height: 50rpx;
  1169. border-radius: 30rpx;
  1170. background:#FFFFFF;
  1171. // border: 1px solid #C9C9C9;
  1172. // color: #999999;
  1173. margin-top: 15rpx;
  1174. }
  1175. }
  1176. }
  1177. .productlist{
  1178. padding-top: 10rpx;
  1179. .goods-pros{
  1180. width: 100%;
  1181. height: auto;
  1182. padding: 20rpx 0;
  1183. }
  1184. .goods-pros-t{
  1185. display: flex;
  1186. align-items: center;
  1187. width: 100%;
  1188. height: 210rpx;
  1189. position: relative;
  1190. .img-tip{
  1191. display: block;
  1192. width: 72rpx;
  1193. height: 36rpx;
  1194. line-height: 36rpx;
  1195. font-size: $font-size-24;
  1196. text-align: center;
  1197. color: #FFFFFF;
  1198. border-radius: 24rpx;
  1199. background:rgba(51,51,51,0.3);
  1200. // position: absolute;
  1201. // left: 0;
  1202. // top: 0;
  1203. }
  1204. .checkbox-box{
  1205. padding: 10rpx;
  1206. }
  1207. .pros-img{
  1208. width: 180rpx;
  1209. height: 100%;
  1210. border-radius: 10rpx;
  1211. margin:0 20rpx;
  1212. border:1px solid #f3f3f3;
  1213. position: relative;
  1214. image{
  1215. width: 100%;
  1216. height: 100%;
  1217. border-radius: 10rpx;
  1218. }
  1219. }
  1220. .pros-marks{
  1221. width: 730rpx; height: 250rpx;
  1222. z-index: 90;
  1223. background: rgba(0,0,0,.05);
  1224. position: absolute;
  1225. left:-20rpx;
  1226. top: -20rpx;
  1227. }
  1228. }
  1229. .goods-pros-b{
  1230. width:622rpx;
  1231. margin-left: 84rpx;
  1232. height: 40rpx;
  1233. padding:0 0 26rpx 0;
  1234. // border-top: 1px solid #EBEBEB;
  1235. &.show{
  1236. display: block;
  1237. }
  1238. &.none{
  1239. display: none;
  1240. }
  1241. .sum{
  1242. font-size: $font-size-28;
  1243. line-height: 40rpx;
  1244. color: $text-color;
  1245. display: flex;
  1246. justify-content: flex-end;
  1247. .money{
  1248. color: #FF2A2A;
  1249. font-size: $font-size-28;
  1250. }
  1251. .money-sign{
  1252. font-size: $font-size-24;
  1253. color: #FF2A2A;
  1254. }
  1255. }
  1256. }
  1257. .pros-product{
  1258. width: 402rpx;
  1259. height: 100%;
  1260. line-height: 36rpx;
  1261. font-size: $font-size-28;
  1262. position: relative;
  1263. .producttitle{
  1264. width: 100%;
  1265. display: inline-block;
  1266. height: auto;
  1267. text-overflow:ellipsis;
  1268. display: -webkit-box;
  1269. word-break: break-all;
  1270. -webkit-box-orient: vertical;
  1271. -webkit-line-clamp: 2;
  1272. overflow: hidden;
  1273. margin-bottom: 8rpx;
  1274. .no-text{
  1275. display: inline-block;
  1276. height:36rpx;
  1277. padding: 0 12rpx;
  1278. line-height: 36rpx;
  1279. background:linear-gradient(315deg,rgba(231,0,0,1) 0%,rgba(255,104,1,1) 100%);
  1280. border-radius:18rpx;
  1281. text-align: center;
  1282. color: #FFFFFF;
  1283. font-size: $font-size-28;
  1284. margin-right: 24rpx;
  1285. }
  1286. }
  1287. .productspec{
  1288. height: 36rpx;
  1289. color: #999999;
  1290. font-size: $font-size-26;
  1291. margin-top: 20rpx;
  1292. }
  1293. .productstate{
  1294. font-size: $font-size-28;
  1295. height: 44rpx;
  1296. color: #FF2A2A;
  1297. position: absolute;
  1298. bottom: 0;
  1299. left: 0;
  1300. }
  1301. }
  1302. }
  1303. }
  1304. .footer{
  1305. width: 100%;
  1306. background-color: #FFFFFF;
  1307. height: 110rpx;
  1308. position: fixed;
  1309. bottom: 0rpx;
  1310. z-index: 100;
  1311. .footer-le{
  1312. width: 520rpx;
  1313. height: 100%;
  1314. padding:0 24rpx;
  1315. float: left;
  1316. box-sizing: border-box;
  1317. .foot-check{
  1318. width: 100rpx;
  1319. float: left;
  1320. line-height: 110rpx;
  1321. font-size: $font-size-24;
  1322. .checkbox{
  1323. width: 40rpx;
  1324. text-align: center;
  1325. }
  1326. .text{
  1327. width: 60rpx;
  1328. float: right;
  1329. }
  1330. }
  1331. .sum{
  1332. width: 360rpx;
  1333. height: 110rpx;
  1334. float: right;
  1335. box-sizing: border-box;
  1336. padding: 10rpx;
  1337. .sum-none{
  1338. width: 100%;
  1339. height: 45rpx;
  1340. line-height: 45rpx;
  1341. color: $text-color;
  1342. float: left;
  1343. text-align: right;
  1344. .money{
  1345. font-size: $font-size-24;
  1346. color: #999999;
  1347. text-decoration: line-through;
  1348. }
  1349. .money-sign{
  1350. font-size: $font-size-24;
  1351. color: #999999;
  1352. text-decoration: line-through;
  1353. }
  1354. .money-reduced{
  1355. margin-left: 10rpx;
  1356. font-size: $font-size-24;
  1357. color: $color-system;
  1358. }
  1359. }
  1360. .sum-price{
  1361. text-align: right;
  1362. width: 100%;
  1363. height: 45rpx;
  1364. line-height: 45rpx;
  1365. font-size: $font-size-30;
  1366. color: $text-color;
  1367. float: left;
  1368. font-weight: normal;
  1369. &.none{
  1370. height: 90rpx;
  1371. line-height: 90rpx;
  1372. }
  1373. .money{
  1374. color: #FF2A2A;
  1375. }
  1376. .money-sign{
  1377. font-size: $font-size-24;
  1378. color: #FF2A2A;
  1379. }
  1380. }
  1381. }
  1382. }
  1383. .footer-ri{
  1384. width: 230rpx;
  1385. height: 100%;
  1386. float: right;
  1387. display: flex;
  1388. justify-content: space-between;
  1389. align-items: center;
  1390. z-index: 999;
  1391. box-sizing: border-box;
  1392. padding: 13rpx 15rpx;
  1393. &.none{
  1394. display: none;
  1395. }
  1396. .btn{
  1397. width: 200rpx;
  1398. height: 100%;
  1399. background:#ff2a2a;
  1400. font-size: $font-size-28;
  1401. line-height: 84rpx;
  1402. color: #FFFFFF;
  1403. display: flex;
  1404. border-radius: 42rpx;
  1405. justify-content: center;
  1406. align-items: center;
  1407. }
  1408. }
  1409. .footer-del{
  1410. width: 400rpx;
  1411. height: 110rpx;
  1412. position: absolute;
  1413. padding-left: 200rpx;
  1414. background: #FFFFFF;
  1415. right: 0;
  1416. top: 0;
  1417. z-index: 1000;
  1418. &.show{
  1419. animation: showDelbtn 0s linear both;
  1420. }
  1421. &.none{
  1422. animation: hideDelbtn 0s linear both;
  1423. }
  1424. .btn{
  1425. width: 50%;
  1426. height: 100%;
  1427. line-height: 110rpx;
  1428. font-size: $font-size-28;
  1429. color: #FFFFFF;
  1430. text-align: center;
  1431. float: left;
  1432. }
  1433. .btn.btn-cancel{
  1434. background:#EEC1AB;
  1435. }
  1436. .btn.btn-confirm{
  1437. background:#FF2A2A;
  1438. }
  1439. @keyframes showDelbtn {
  1440. 0% {
  1441. transform: translateX(0);
  1442. }
  1443. 100% {
  1444. transform: translateX(-100%);
  1445. }
  1446. }
  1447. @keyframes hideDelbtn {
  1448. 0% {
  1449. transform: translateX(-100%);
  1450. }
  1451. 100% {
  1452. transform: translateX(0);
  1453. }
  1454. }
  1455. }
  1456. }
  1457. </style>