From df7340642966fa2e009a4853cfd4156030203f25 Mon Sep 17 00:00:00 2001 From: chen <2659004835@qq.com> Date: Tue, 1 Mar 2022 14:29:24 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E5=88=86=E7=B1=BB=E5=8F=AF?= =?UTF-8?q?=E6=BB=91=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/cart-subgroup/cart.vue | 31 ++++++++-------- pages/tabbar/pagehome/pagehome.vue | 8 +++- .../distributionCenter/distributionCenter.vue | 8 ++-- pagesA/getReadyDan/getReadyDan.vue | 14 ------- pagesA/myAddress/myAddress.vue | 37 +++++++++---------- pagesA/myOrder/myOrder.vue | 10 ++--- pagesB/orderDetail/orderDetail.vue | 14 +++---- pagesB/shopDetail/shopDetail.vue | 8 ++-- 8 files changed, 60 insertions(+), 70 deletions(-) diff --git a/components/cart-subgroup/cart.vue b/components/cart-subgroup/cart.vue index 98c54c1..eae6caa 100644 --- a/components/cart-subgroup/cart.vue +++ b/components/cart-subgroup/cart.vue @@ -38,7 +38,7 @@ - + @@ -169,7 +169,7 @@ }, methods:{ touchBottomEv(){// scroll-view触底事件 - if(this.total != this.dataList.length){ + if(this.total != this.dataList.length && this.dataList.length!=0){ this.page++; this.checkList(); } @@ -283,7 +283,6 @@ this.total = res.data.total; if(res.data.list.length){ res.data.list.forEach(item=>{ - console.log(item,286); // let newspec = []; // if(item.sku.spec_text.length){ // item.sku.spec_text.forEach(itemspec=>{ @@ -292,19 +291,21 @@ // } // }) // } - let obj = { - id:item.id, - coding:item.sku.coding, - isActive:false, - imgSrc:item.spu.spu_cover, - title:item.spu_name, - specs:item.sku.spec_text, - // price:this.$toolAll.tools.changeNum(item.price*1), - price:item.price, - reckonPrice:item.price, - num:item.num + if(item.sku!=null){ + let obj = { + id:item.id, + coding:item.sku.coding, + isActive:false, + imgSrc:item.spu.spu_cover, + title:item.spu_name, + specs:item.sku.spec_info, + // price:this.$toolAll.tools.changeNum(item.price*1), + price:item.price, + reckonPrice:item.price, + num:item.num + } + this.dataList.push(obj); } - this.dataList.push(obj); }) this.dataList.concat(this.dataList); } else { diff --git a/pages/tabbar/pagehome/pagehome.vue b/pages/tabbar/pagehome/pagehome.vue index d12fc49..d4f4447 100644 --- a/pages/tabbar/pagehome/pagehome.vue +++ b/pages/tabbar/pagehome/pagehome.vue @@ -373,5 +373,11 @@ diff --git a/pagesA/distributionCenter/distributionCenter.vue b/pagesA/distributionCenter/distributionCenter.vue index 53a058d..ca6a7e5 100644 --- a/pagesA/distributionCenter/distributionCenter.vue +++ b/pagesA/distributionCenter/distributionCenter.vue @@ -122,7 +122,7 @@ } }, onReachBottom() { - if(this.total!=this.dataList){ + if(this.total!=this.dataList.length){ this.page++; // 调取查询分享信息事件 this.checkCommissionEv(); @@ -156,11 +156,11 @@ this.distributionInfo.withdrawal_total = this.$toolAll.tools.addXiaoShu(this.distributionInfo.withdrawal_total); // 我的佣金 this.commission = this.distributionInfo.commission; - // 设置列表 - this.dataList = this.dataList.concat(this.distributionInfo.log.list); // 设置总数 this.total = this.distributionInfo.log.total; - this.log(this.total,this.dataList.length) + // 设置列表 + this.dataList = this.dataList.concat(this.distributionInfo.log.list); + // this.log(this.total,this.dataList.length) } else { this.$toolAll.tools.showToast(err.msg); } diff --git a/pagesA/getReadyDan/getReadyDan.vue b/pagesA/getReadyDan/getReadyDan.vue index fa8c460..0f2ac3c 100644 --- a/pagesA/getReadyDan/getReadyDan.vue +++ b/pagesA/getReadyDan/getReadyDan.vue @@ -78,18 +78,6 @@ - - - - - 支付成功 - ¥{{jsPrice<0?0:jsPrice}} - - 查看订单 - 再逛一逛 - - - @@ -110,9 +98,7 @@ addressInfo:'',//地址信息 zPhone:'',//自提时的手机号 isFocus:false, - isSuccess:false,//支付成功 times:0,//点击次数 - checkGrounpId:0, expressInfo:{ code:'',//快递编号 default_price:0 //快递费 diff --git a/pagesA/myAddress/myAddress.vue b/pagesA/myAddress/myAddress.vue index a295485..3c124d1 100644 --- a/pagesA/myAddress/myAddress.vue +++ b/pagesA/myAddress/myAddress.vue @@ -95,26 +95,25 @@ export default { data() { return { - statusHNH:uni.getStorageSync('statusHNH'), publicColor:uni.getStorageSync('publicColor'),//主题颜色 dataList:[], idEdit:false, - userName:'', - userPhone:'', - userProvince:'', - userCity:'', - userCounty:'', - userAddress:'', + userName:'',//名字 + userPhone:'',//电话 + userProvince:'',//省份 + userCity:'',//城市 + userCounty:'',//区县 + userAddress:'',//详细地址 isChoose:'',//选中的id delNum:0,//删除条件 loading:false, - provinceArr:[], - cityArr:[], - countyArr:[], - isAddress:0, - isWhere:1, - isMo:0, - flag:true + provinceArr:[],//省份列表 + cityArr:[],//城市列表 + countyArr:[],//区县列表 + isAddress:0,//选中的是哪个地址选项 + isWhere:1,//来自哪个页面 + isMo:0,//是否是默认地址 + flag:true//允许点击 } }, onShow() { @@ -228,7 +227,7 @@ this.userCounty = this.countyArr[index].name; }, async checkList(){//查询地址列表 - this.$requst.post('/api/user/address').then(res=>{ + this.$requst.post('/api/user/address',{page:1,size:100}).then(res=>{ if(res.code==0){ this.flag = true; this.dataList = []; @@ -256,8 +255,8 @@ uni.removeStorageSync('chooseAddress'); } this.loading = true; - } - }) + } else this.$toolAll.tools.showToast(res.msg); + }).catch(err=>{this.$toolAll.tools.showToast(err.msg);}) }, checkActive(){//把默认地址放到第一位 let have = this.dataList.findIndex((res)=>{ @@ -339,8 +338,8 @@ this.dataList[index].isActive = true; this.dataList[index].is_default = 1; this.checkActive(); - } - }) + } else this.$toolAll.tools.showToast(res.msg); + }).catch(err=>{this.$toolAll.tools.showToast(err.msg);}) }, editAddress(index){//编辑按钮 this.idEdit = true; diff --git a/pagesA/myOrder/myOrder.vue b/pagesA/myOrder/myOrder.vue index df3a503..2223284 100644 --- a/pagesA/myOrder/myOrder.vue +++ b/pagesA/myOrder/myOrder.vue @@ -204,8 +204,8 @@ this.orderList[this.current].push(obj); }) } - } - }) + } else this.$toolAll.tools.showToast(res.msg); + }).catch(err=>{this.$toolAll.tools.showToast(err.msg);}) }, payMentEv(coding){//付款 if(this.times==0){ @@ -228,7 +228,7 @@ this.implementListEv(); } else this.$toolAll.tools.showToast(res.msg); - }) + }).catch(err=>{this.$toolAll.tools.showToast(err.msg);}) }, fail:()=> { this.$toolAll.tools.showToast('取消支付'); @@ -264,7 +264,7 @@ // 调用查询列表事件 this.implementListEv(); } else this.$toolAll.tools.showToast(res.msg); - }) + }).catch(err=>{this.$toolAll.tools.showToast(err.msg);}) } }, confirmReceipt(id){//确认收货事件 @@ -274,7 +274,7 @@ // 调用查询列表事件 this.implementListEv(); } else this.$toolAll.tools.showToast(res.msg); - }) + }).catch(err=>{this.$toolAll.tools.showToast(err.msg);}) }, goDetail(id){//去订单详情 uni.navigateTo({ diff --git a/pagesB/orderDetail/orderDetail.vue b/pagesB/orderDetail/orderDetail.vue index 8ee0e84..fcaacbd 100644 --- a/pagesB/orderDetail/orderDetail.vue +++ b/pagesB/orderDetail/orderDetail.vue @@ -176,7 +176,7 @@ this.$toolAll.tools.showToast('收货成功'); this.checkInfo(this.orderInfo.id); } else this.$toolAll.tools.showToast(res.msg); - }) + }).catch(err=>{this.$toolAll.tools.showToast(err.msg);}) }, make(index){ this.isHeyan = true; @@ -195,8 +195,8 @@ this.checkInfo(this.orderInfo.id); clearInterval(this.timer); } - } - }) + } else this.$toolAll.tools.showToast(res.msg); + }).catch(err=>{this.$toolAll.tools.showToast(err.msg);}) },3000) }, cancleEv(){//取消订单 @@ -207,8 +207,8 @@ this.$toolAll.tools.showToast('取消订单成功'); this.checkInfo(this.orderInfo.id); this.times = 0; - } - }) + } else this.$toolAll.tools.showToast(res.msg); + }).catch(err=>{this.$toolAll.tools.showToast(err.msg);}) } else { setTimeout(()=>{ this.times = 0; @@ -241,8 +241,8 @@ }) } }); - } - }) + } else this.$toolAll.tools.showToast(res.msg); + }).catch(err=>{this.$toolAll.tools.showToast(err.msg);}) } }, checkInfo(id){//查询订单信息 diff --git a/pagesB/shopDetail/shopDetail.vue b/pagesB/shopDetail/shopDetail.vue index 8271a8a..c8d9811 100644 --- a/pagesB/shopDetail/shopDetail.vue +++ b/pagesB/shopDetail/shopDetail.vue @@ -198,9 +198,7 @@ this.discountPrice = this.detailObj.price; // 设置富文本 this.shopRich = this.$toolAll.tools.escape2Html(res.data.detail.content); - } else { - - } + } else this.$toolAll.tools.showToast(res.msg); }).catch(err=>{ this.$toolAll.tools.showToast(err.msg); }) @@ -245,8 +243,8 @@ this.$toolAll.tools.showToast('添加购物车成功(*^▽^*)'); this.csNum = 0; } - } - }) + } else this.$toolAll.tools.showToast(res.msg); + }).catch(err=>{this.$toolAll.tools.showToast(err.msg);}) } } else { this.$toolAll.tools.showToast('请选择商品参数')