cart.vue 39 KB

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