From 1ac9c5046e81c3e68ad4524873aee2ec3b9043be Mon Sep 17 00:00:00 2001 From: chen <2659004835@qq.com> Date: Thu, 11 Nov 2021 15:33:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pagesA/activityTask/activityTask.vue | 5 +- pagesA/coupon/coupon.vue | 2 +- pagesA/getReadyDan/getReadyDan.vue | 3 + pagesA/myOrder/myOrder.vue | 87 +++++++++++++++++++++++----- pagesB/orderDetail/orderDetail.vue | 25 +++++++- 5 files changed, 102 insertions(+), 20 deletions(-) diff --git a/pagesA/activityTask/activityTask.vue b/pagesA/activityTask/activityTask.vue index debc341..33656fc 100644 --- a/pagesA/activityTask/activityTask.vue +++ b/pagesA/activityTask/activityTask.vue @@ -132,7 +132,7 @@ return { statusHNH:uni.getStorageSync('statusHNH'), publicColor:uni.getStorageSync('publicColor'),//主题颜色 - isScreenshot:true, + isScreenshot:false, upImg:'', chooseIndex:0, activityList:[],//活动列表 @@ -243,10 +243,9 @@ count:1, sourceType:['album'], success: (res) => { - console.log(res); this.upImg = res.tempFilePaths[0]; this.$requst.upload('file/upload/image',{file:this.upImg}).then(res=>{ - this.upImg = this.$http + res.data.src + this.upImg = this.$http + res.data.src; this.$toolAll.tools.showToast('图片上传成功(*^▽^*)') },error=>{}) } diff --git a/pagesA/coupon/coupon.vue b/pagesA/coupon/coupon.vue index 5cf6de1..516798d 100644 --- a/pagesA/coupon/coupon.vue +++ b/pagesA/coupon/coupon.vue @@ -33,7 +33,7 @@ - + 体验券使用 diff --git a/pagesA/getReadyDan/getReadyDan.vue b/pagesA/getReadyDan/getReadyDan.vue index 6807002..cf09f8c 100644 --- a/pagesA/getReadyDan/getReadyDan.vue +++ b/pagesA/getReadyDan/getReadyDan.vue @@ -484,6 +484,9 @@ }, fail() { this.times = 0; + uni.navigateTo({ + url:'/pagesA/myOrder/myOrder' + }) } }); } else { diff --git a/pagesA/myOrder/myOrder.vue b/pagesA/myOrder/myOrder.vue index f3dc452..c55180c 100644 --- a/pagesA/myOrder/myOrder.vue +++ b/pagesA/myOrder/myOrder.vue @@ -12,7 +12,10 @@ - {{item.isShop==0?'商城订单':'积分商城订单'}}{{item.establish}} + {{item.isShop==0?'商城订单':'积分商城订单'}} + {{item.group_make_end_at}} + {{item.establish}} + 订单号:{{item.orderNum}} {{['','待付款','待发货','待核验','待收货','交易完成'][item.orderStatus]}} @@ -31,7 +34,7 @@ 线上核销 - 已核验 x{{itemc.not_check_num}} + 待核验 x{{itemc.not_check_num}} 确认收货 @@ -57,7 +60,7 @@ - + 订单二维码 @@ -134,7 +137,9 @@ size: 162, colorDark: '#000000', colorLight: '#ffffff', - timer:null + timer:null, + zanArr:[], + timeList:[] } }, onReachBottom() { @@ -163,6 +168,14 @@ options.index==undefined ? this.activeIndex = 0 : this.activeIndex = options.index; }, methods: { + comeing(coding){ + this.$requst.post('user/open-one',{order_coding:coding}).then(res=>{ + if(res.code==0){ + this.$toolAll.tools.showToast('免拼成功'); + this.checkList(this.activeIndex); + } + }) + }, make(index,index2){ this.isHeyan = true; this.text = `${this.orderList[index].orderNum},${this.orderList[index].childrenList[index2].id}`; @@ -216,16 +229,18 @@ duration: 0 }); this.orderList = []; + this.zanArr = []; + this.timeList = []; } this.total = res.data.total; if(res.data.list.length!=0){ res.data.list.forEach(item=>{ let statusNum = 0; if(item.status=="waiting") statusNum = 1; - if(item.status=="paid" && item.has_virtual==1) { - statusNum = 3; - } - if(item.status=="paid" && item.has_virtual==0) { + // if(item.status=="paid" && item.has_virtual==1) { + // statusNum = 3; + // } + if(item.status=="paid") { statusNum = 2; } // if(item.status=="check") @@ -262,15 +277,61 @@ isShop:item.is_score,//0 商城订单,1 积分商城订单 total: nprice,//合计 coin:item.coin,//孔雀币 - is_only:item.is_only,//是否单独购买 + is_only:item.is_only,//是否单独购买,1、单独购买 virtual_check:item.virtual_check, - // open_one:item.open_one + open_one:item.open_one, + is_group_make:item.is_group_make, + open_one_success:item.open_one_success, + group_make_end_at:item.group_make_end_at } - this.orderList.push(obj); + this.zanArr.push(obj); }) + this.zanArr.forEach((item,index)=>{ + if(item.group_make_end_at!='' && item.group_make_end_at!=null) { + let obj = { + id:item.id, + time:item.group_make_end_at, + nIndex:index + } + this.timeList.push(obj); + } + }) + if(this.timeList!=0){ + uni.showToast({ + title:'加载中...', + icon:'none', + duration:100000 + }) + this.timer = setInterval(()=>{//定时器 + if(this.timeList.length!=0){ + this.timeList.forEach((item,index)=>{ + if(item.id==this.zanArr[item.nIndex].id){ + let endTime = new Date(this.timeList[index].time).getTime();//把结束时间转时间戳 + let startTime = new Date().getTime() + 1000;//请求接口的时间递增,即:开始时间 + if(startTime - endTime >=0) {//如果开始时间的时间戳 - 结束时间的时间戳 >= 0 活动结束 + // this.checkList(this.activeIndex); + } else { + // 继续进行倒计时 + this.zanArr[item.nIndex].group_make_end_at = this.$toolAll.tools.dayTime(this.timeList[index].time,startTime); + } + } + }) + } + },1000) + setTimeout(()=>{ + uni.hideToast(); + this.orderList = this.zanArr; + // this.search_result = true; + },1000) + } else { + uni.hideToast(); + this.orderList = this.zanArr; + } this.zanList = this.orderList; if(index==0) { this.orderList = this.zanList; + } else if(index==3){ + console.log(1234); } else { this.orderList = this.zanList.filter(item=>{ return item.orderStatus==index; diff --git a/pagesB/orderDetail/orderDetail.vue b/pagesB/orderDetail/orderDetail.vue index 1b78099..51af501 100644 --- a/pagesB/orderDetail/orderDetail.vue +++ b/pagesB/orderDetail/orderDetail.vue @@ -17,7 +17,8 @@ 订单已取消 订单号:{{orderInfo.coding}} - {{orderInfo.created_at}} + {{daoTime}} + {{orderInfo.created_at}} @@ -78,6 +79,7 @@ 分享 + 直接免拼 - + 订单二维码 @@ -137,7 +139,8 @@ size: 162, colorDark: '#000000', colorLight: '#ffffff', - timer:null + timer:null, + daoTime:'' } }, onUnload() { @@ -150,6 +153,14 @@ this.checkInfo(options.id); }, methods: { + comeing(coding){ + this.$requst.post('user/open-one',{order_coding:coding}).then(res=>{ + if(res.code==0){ + this.$toolAll.tools.showToast('免拼成功'); + this.checkInfo(this.orderInfo.id); + } + }) + }, confirmReceipt(id){//确认收货事件 this.$requst.post('order/accepted',{order_id:id}).then(res=>{ if(res.code==0){ @@ -251,6 +262,14 @@ this.allPrice = this.allPrice; } this.orderInfo = narr; + this.daoTime = this.$toolAll.tools.dayTime(this.orderInfo.group_make_end_at,new Date().getTime()); + this.timerDao = setInterval(()=>{ + if(new Date().getTime()-new Date().getTime(this.orderInfo.group_make_end_at)>0){ + this.checkInfo(this.orderInfo.id); + } else { + this.daoTime = this.$toolAll.tools.dayTime(this.orderInfo.group_make_end_at,new Date().getTime()); + } + },1000) let naddress = this.orderInfo.address.split(','); if(naddress[0]!='自提'){ let nphone = this.$toolAll.tools.hideMPhone(naddress[1].trim())