cart.vue 39 KB

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