From 8191c8c8fba3eff2f1c247e7726c7d079d898e4e Mon Sep 17 00:00:00 2001 From: youmengting <2080639302@qq.com> Date: Wed, 10 May 2023 18:09:23 +0800 Subject: [PATCH] 5/10 --- .../address/addNewAddress/addNewAddress.vue | 13 ++- physical-merchants/address/address.vue | 39 ++++----- physical-merchants/classify/cart/cart.vue | 74 +++++++++-------- .../classify/goods-search/goods-search.vue | 37 +++++---- .../classify/goodsDetail/goodsDetail.vue | 39 +++++---- .../classify/order/orderDetail.vue | 7 +- .../classify/order/paymentResult.vue | 5 +- .../classify/order/wuliuPupup/wuliuPupup.vue | 79 ++++++++++--------- .../settleAccounts/settleAccounts.vue | 4 +- 9 files changed, 171 insertions(+), 126 deletions(-) diff --git a/physical-merchants/address/addNewAddress/addNewAddress.vue b/physical-merchants/address/addNewAddress/addNewAddress.vue index 1902251..2065352 100644 --- a/physical-merchants/address/addNewAddress/addNewAddress.vue +++ b/physical-merchants/address/addNewAddress/addNewAddress.vue @@ -17,7 +17,7 @@ 联系人* - @@ -114,6 +114,17 @@ onLoad(params) { this.dataParams = params }, + watch:{ + 'userAddress.name':{ + handler(n) { + if(n.length>5){ + setTimeout(()=>{ + this.userAddress.name = this.userAddress.name.substr(0,5) + },0) + } + }, + }, + }, computed: { // regionName() { diff --git a/physical-merchants/address/address.vue b/physical-merchants/address/address.vue index 1ff58b7..79c6ef5 100644 --- a/physical-merchants/address/address.vue +++ b/physical-merchants/address/address.vue @@ -84,27 +84,30 @@ }); this.addressList=[]; getDeliveryAddressList().then(res => { - uni.hideLoading(); - if (res.return_code == '000000') { + + setTimeout(()=>{ + + uni.hideLoading(); + if (res.return_code == '000000') { + + if (res.return_data.length > 0) { + // console.log(res.return_data) + this.addressList = res.return_data; + this.addressList.map(item => { + if (item.whetherDefault) { + this.selectId = item.id; + } + }) + } - if (res.return_data.length > 0) { - // console.log(res.return_data) - this.addressList = res.return_data; - this.addressList.map(item => { - if (item.whetherDefault) { - this.selectId = item.id; - } + } else { + uni.showToast({ + title: res.return_msg, + icon: 'none', + duration: 2000 }) } - - } else { - uni.showToast({ - title: res.return_msg, - icon: 'none', - duration: 2000 - }) - } - + },100) }) }, diff --git a/physical-merchants/classify/cart/cart.vue b/physical-merchants/classify/cart/cart.vue index 52fe5b6..d0c2c66 100644 --- a/physical-merchants/classify/cart/cart.vue +++ b/physical-merchants/classify/cart/cart.vue @@ -82,7 +82,7 @@ - 编辑 + 编辑 删除 @@ -208,37 +208,37 @@ this.initData(); }, methods: { - initData(status) { - if(!status){ + initData() { + uni.showLoading({ title: '加载中', mask:true, duration:2000 }); - // console.log(20) - } - getShoppingCartList().then(res => { - if(!status){ - uni.hideLoading(); - } - if (res.return_code == '000000') { - this.allCheck.whetherCheck = false; - this.cartList = res.return_data; - // 测试失效数据 - // this.cartList[0].loseEfficacy=true; - - - - this.allCheckInit(); //全选是否勾中判断 - - } else { - uni.showToast({ - title: res.return_msg, - icon: 'none', - duration: 2000 - }) - } + + getShoppingCartList().then(res => { + setTimeout(()=>{ + uni.hideLoading(); + if (res.return_code == '000000') { + this.allCheck.whetherCheck = false; + this.cartList = res.return_data; + + // 测试失效数据 + // this.cartList[0].loseEfficacy=true; + + this.allCheckInit(); //全选是否勾中判断 + + } else { + uni.showToast({ + title: res.return_msg, + icon: 'none', + duration: 2000 + }) + } + },100) + + }) }, editDelete() { @@ -503,14 +503,17 @@ //重新刷新数据 this.initData(); } else { - //增加数量失败 - uni.showToast({ - title: res.return_msg, - icon: 'none', - duration: 2000 - }) + //增加数量失败 + setTimeout(()=>{ + uni.showToast({ + title: res.return_msg, + icon: 'none', + duration: 2000 + }) + },200) + //重新刷新数据 - this.initData(2); + this.initData(); } @@ -708,7 +711,10 @@ .tool-jiesuan {} .jiesuan-btn { - width: 240rpx; + max-width: 240rpx; + min-width: 100px; + font-size: 16px; + flex: 1; height: 50px; line-height: 50px; text-align: center; diff --git a/physical-merchants/classify/goods-search/goods-search.vue b/physical-merchants/classify/goods-search/goods-search.vue index efb4049..d0e0d48 100644 --- a/physical-merchants/classify/goods-search/goods-search.vue +++ b/physical-merchants/classify/goods-search/goods-search.vue @@ -122,27 +122,30 @@ getListGoodsDetail(params).then(res => { - uni.hideLoading(); - if (res.return_code == '000000') { + setTimeout(()=>{ + uni.hideLoading(); + if (res.return_code == '000000') { - if (res.return_data.list.length > 0) { - _this.data_list = _this.data_list.concat(res.return_data.list); - this.page.pageStart = res.return_data.pageNum; - this.page.pageSize = res.return_data.pageSize; - this.page.total = res.return_data.total; - this.page.navigateLastPage = res.return_data.navigateLastPage + if (res.return_data.list.length > 0) { + _this.data_list = _this.data_list.concat(res.return_data.list); + this.page.pageStart = res.return_data.pageNum; + this.page.pageSize = res.return_data.pageSize; + this.page.total = res.return_data.total; + this.page.navigateLastPage = res.return_data.navigateLastPage + + } else { + _this.data_list = [] + } } else { - _this.data_list = [] + uni.showToast({ + title: res.return_msg, + icon: 'none', + duration: 2000 + }) } - - } else { - uni.showToast({ - title: res.return_msg, - icon: 'none', - duration: 2000 - }) - } + },100) + }) } } diff --git a/physical-merchants/classify/goodsDetail/goodsDetail.vue b/physical-merchants/classify/goodsDetail/goodsDetail.vue index 66777fe..f6a97a0 100644 --- a/physical-merchants/classify/goodsDetail/goodsDetail.vue +++ b/physical-merchants/classify/goodsDetail/goodsDetail.vue @@ -282,26 +282,33 @@ }); findGoodsDetailById(params).then(res => { - uni.hideLoading(); + + setTimeout(()=>{ + + uni.hideLoading(); - if (res.return_code == '000000') { + if (res.return_code == '000000') { - this.goodsDetail = res.return_data; - this.goodsDetail.bannerImg = res.return_data.bannerImg.split(",").map(temp => this - .imageUrl + temp); - this.goodsDetail.detailImg = res.return_data.detailImg.split(",").map(temp => this - .imageUrl + temp); - console.log(this.goodsDetail, ) + this.goodsDetail = res.return_data; + this.goodsDetail.bannerImg = res.return_data.bannerImg.split(",").map(temp => this + .imageUrl + temp); + this.goodsDetail.detailImg = res.return_data.detailImg.split(",").map(temp => this + .imageUrl + temp); + console.log(this.goodsDetail, ) - // let list =item.map(temp=>this.imageUrl + temp) + // let list =item.map(temp=>this.imageUrl + temp) - } else { - uni.showToast({ - title: res.return_msg, - icon: 'none', - duration: 2000 - }) - } + } else { + uni.showToast({ + title: res.return_msg, + icon: 'none', + duration: 2000 + }) + } + + },100) + + }) }, diff --git a/physical-merchants/classify/order/orderDetail.vue b/physical-merchants/classify/order/orderDetail.vue index f491363..86a611e 100644 --- a/physical-merchants/classify/order/orderDetail.vue +++ b/physical-merchants/classify/order/orderDetail.vue @@ -370,7 +370,12 @@ orderNo: this.orderId, } getDetailByOrderNo(params).then(res => { - uni.hideLoading(); + + setTimeout(()=>{ + uni.hideLoading(); + },100) + + if (res.return_code == '000000') { this.recinfo = res.return_data; // if (res.return_data.productType == 6) { diff --git a/physical-merchants/classify/order/paymentResult.vue b/physical-merchants/classify/order/paymentResult.vue index 5fb6592..0769f49 100644 --- a/physical-merchants/classify/order/paymentResult.vue +++ b/physical-merchants/classify/order/paymentResult.vue @@ -75,7 +75,10 @@ orderNo: this.orderId, } getDetailByOrderNo(params).then(res => { - uni.hideLoading(); + setTimeout(()=>{ + uni.hideLoading(); + },100) + if (res.return_code == '000000') { this.recinfo = res.return_data; diff --git a/physical-merchants/classify/order/wuliuPupup/wuliuPupup.vue b/physical-merchants/classify/order/wuliuPupup/wuliuPupup.vue index bd97c16..722117e 100644 --- a/physical-merchants/classify/order/wuliuPupup/wuliuPupup.vue +++ b/physical-merchants/classify/order/wuliuPupup/wuliuPupup.vue @@ -154,48 +154,53 @@ mask:true, }); getLogisticsMsg(params).then(res=>{ - uni.hideLoading(); - if (res.return_code == '000000') { - - this.tracesData=res.return_data; - this.tracesData.logisticsTraceDetails =JSON.parse(this.tracesData.logisticsTraceDetails) + + setTimeout(()=>{ + + uni.hideLoading(); + if (res.return_code == '000000') { + + this.tracesData=res.return_data; + this.tracesData.logisticsTraceDetails =JSON.parse(this.tracesData.logisticsTraceDetails) - this.tracesData.logisticsTraceDetails=this.tracesData.logisticsTraceDetails.sort((item,item2)=>{ + this.tracesData.logisticsTraceDetails=this.tracesData.logisticsTraceDetails.sort((item,item2)=>{ + + if(item.logisticsStatus == 'TRANSPORT'){ + item.isMainNode=false; + }else{ + item.isMainNode=true; + } + + return item2.time - item.time; + }) - if(item.logisticsStatus == 'TRANSPORT'){ - item.isMainNode=false; - }else{ - item.isMainNode=true; - } - return item2.time - item.time; - }) - - - let mobile = /(1[0-9]{10})|([0-9]{3,4})?[0-9]{7,8}/g; //匹配手机号或固话 - let phone = []; - this.tracesData.logisticsTraceDetails.map(item=>{ - // 提取电话号码 - // if(item.logisticsStatus == 'SIGN'||item.logisticsStatus == 'DELIVERING'){ - let num = item.desc.replace(/\s|[(]|[)]|[(]|[)]|[-]*/g, ''); //去除字符串中所有空格、小括号和横杠 - if(num.match(mobile)){ - phone.push((num.match(mobile))) - } - // } + let mobile = /(1[0-9]{10})|([0-9]{3,4})?[0-9]{7,8}/g; //匹配手机号或固话 + let phone = []; + this.tracesData.logisticsTraceDetails.map(item=>{ + // 提取电话号码 + // if(item.logisticsStatus == 'SIGN'||item.logisticsStatus == 'DELIVERING'){ + let num = item.desc.replace(/\s|[(]|[)]|[(]|[)]|[-]*/g, ''); //去除字符串中所有空格、小括号和横杠 + if(num.match(mobile)){ + phone.push((num.match(mobile))) + } + // } + + }) + + this.phoneNumber =phone.flat(Infinity); + // console.log(this.phoneNumber, phone) + + } else { + uni.showToast({ + title: res.return_msg, + icon: 'none', + duration: 2000 }) - - this.phoneNumber =phone.flat(Infinity); - // console.log(this.phoneNumber, phone) - - - } else { - uni.showToast({ - title: res.return_msg, - icon: 'none', - duration: 2000 - }) - } + } + },100) + }) }, // 复制 diff --git a/physical-merchants/settleAccounts/settleAccounts.vue b/physical-merchants/settleAccounts/settleAccounts.vue index 682f29c..6d82545 100644 --- a/physical-merchants/settleAccounts/settleAccounts.vue +++ b/physical-merchants/settleAccounts/settleAccounts.vue @@ -478,7 +478,9 @@ }); this.postPrice = 0; getAddressPrice().then(res => { - uni.hideLoading(); + setTimeout(()=>{ + uni.hideLoading(); + },100) this.isFirstSearchAddress = false; if (res.return_code == '000000') { if (res.return_data) {