index.vue 40 KB

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