diff --git a/components/custom-coupon.vue b/components/custom-coupon.vue new file mode 100644 index 0000000..1f82ecf --- /dev/null +++ b/components/custom-coupon.vue @@ -0,0 +1,152 @@ + + + + + \ No newline at end of file diff --git a/jsFile/requst.js b/jsFile/requst.js index 47ae354..d9d3cee 100644 --- a/jsFile/requst.js +++ b/jsFile/requst.js @@ -39,6 +39,7 @@ const checkError = (e) => { flag = false; switch (Number(e.data.code)) { case 500: + case 4000:// 参数错误 case 4003:// 参数错误 case 4004:// 记录不存在 case 5000:// xxx错误 @@ -50,7 +51,7 @@ const checkError = (e) => { icon:'none' }) if(Number(e.data.code)==5050){ - // 调用到登录页 + // 跳转到登录页 setTimeout(()=>{ goLogin(); },1000) diff --git a/pages/tabbar/course/course.vue b/pages/tabbar/course/course.vue index 9a0c5ea..bb9bd18 100644 --- a/pages/tabbar/course/course.vue +++ b/pages/tabbar/course/course.vue @@ -79,12 +79,12 @@ if(this.dataList.length){ // 设置分类id this.classId = this.dataList[0].id; - // 调用获取商品产品列表 + // 调用获取课程列表 this.getCourseList(); } }) }, - // 获取商品产品列表 + // 获取课程列表 getCourseList(){ let params = { category_id:this.classId, @@ -97,7 +97,7 @@ // 设置总数 this.total = res.data.total; if(this.page==1){this.$refs.refcourse.list=[];} - // 设置产品列表 + // 设置课程列表 this.$refs.refcourse.list = [...this.$refs.refcourse.list,...res.data.list]; if(this.total==this.$refs.refcourse.list.length && this.page!=1){ this.noMore = true; @@ -108,7 +108,7 @@ // 去课程详情 goDetail(id){ uni.navigateTo({ - url:`/pagesB/course-detail/course-detail?id=${id}&category_id=${this.classId}` + url:`/pagesB/course-detail/course-detail?id=${id}` }) }, } diff --git a/pagesA/my-coupon/my-coupon.vue b/pagesA/my-coupon/my-coupon.vue index c2ea78b..5c5f009 100644 --- a/pagesA/my-coupon/my-coupon.vue +++ b/pagesA/my-coupon/my-coupon.vue @@ -8,15 +8,15 @@ - + - {{item.price}} + {{item.amount}} - - - {{item.title}} - 有限期:{{item.time}} + + + {{item.name}} + 有限期:{{item.begin_at.slice(0,10).split('-').join('.')}}-{{item.end_at.slice(0,10).split('-').join('.')}} 去使用 @@ -25,7 +25,7 @@ --> - + @@ -67,10 +67,10 @@ {title:'已过期'} ], dataList:[ - {price:10,title:'【满减卷】满100元减10元抵扣卷',time:'2022.07.11-2022.07.30',show:false}, - {price:10,title:'【满减卷】满100元减10元抵扣卷',time:'2022.07.11-2022.07.30',show:false}, - {price:10,title:'【满减卷】满100元减10元抵扣卷',time:'2022.07.11-2022.07.30',show:false}, - {price:10,title:'【满减卷】满100元减10元抵扣卷',time:'2022.07.11-2022.07.30',show:false}, + // {price:10,title:'【满减卷】满100元减10元抵扣卷',time:'2022.07.11-2022.07.30',show:false}, + // {price:10,title:'【满减卷】满100元减10元抵扣卷',time:'2022.07.11-2022.07.30',show:false}, + // {price:10,title:'【满减卷】满100元减10元抵扣卷',time:'2022.07.11-2022.07.30',show:false}, + // {price:10,title:'【满减卷】满100元减10元抵扣卷',time:'2022.07.11-2022.07.30',show:false}, ], status:'normal', page:1, @@ -91,6 +91,7 @@ methods: { // tab点击事件 clickTab(index){ + this.dataList = []; this.current = index; this.status = ['normal','used','invalid'][this.current]; this.page = 1; @@ -120,12 +121,12 @@ } this.$requst.get('/api/user/coupon-list',params).then(res=>{ if(res.code==0){ - // this.total = res.data.total; - // if(this.page==1){this.dataList=[];} - // this.dataList = [...this.dataList,...res.data.list]; - // if(this.total==this.dataList.length && this.page!=1){ - // this.noMore = true; - // } + this.total = res.data.total; + if(this.page==1){this.dataList=[];} + this.dataList = [...this.dataList,...res.data.list]; + if(this.total==this.dataList.length && this.page!=1){ + this.noMore = true; + } } }) } @@ -134,9 +135,6 @@ diff --git a/pagesA/my-data/my-data.vue b/pagesA/my-data/my-data.vue index 278e60a..57b9fa2 100644 --- a/pagesA/my-data/my-data.vue +++ b/pagesA/my-data/my-data.vue @@ -25,6 +25,7 @@ + 联系电话 {{phone || '未填写'}} @@ -74,15 +75,34 @@ this.$refs.refFrame.tempText = JSON.parse(JSON.stringify(this.phone || '')); } }, - //确认修改 returnEv(obj){ if(this.showType==5){ + if(this.realName!=obj.content){ + // 如果修改后的跟修改前的不一样 + this.setData('real_name',obj.content); + } this.realName = obj.content; } if(this.showType==6){ + if(this.phone!=obj.content){ + // 如果修改后的跟修改前的不一样 + this.setData('mobile',obj.content); + } this.phone = obj.content; } + }, + // 执行修改事件 + setData(field,value){ + let params = { + field, + value + } + this.$requst.post('/api/user/update-info',params).then(res=>{ + if(res.code==0){ + this.$toolAll.tools.showToast('修改成功'); + } + }) } } } diff --git a/pagesA/my-integral/my-integral.vue b/pagesA/my-integral/my-integral.vue index 160de18..49c04c2 100644 --- a/pagesA/my-integral/my-integral.vue +++ b/pagesA/my-integral/my-integral.vue @@ -4,7 +4,7 @@ - 积分:6548 + 积分:{{allScore}} 签到 @@ -15,10 +15,10 @@ - {{item.title}} - {{item.price}} + {{item.name}} + +{{item.num}} - {{item.time}} + {{item.created_at}} @@ -40,6 +40,7 @@ data() { return { newtop:uni.getSystemInfoSync().statusBarHeight + 42, + allScore:uni.getStorageSync('userInfo').score, current:0, tabList:[ {title:'全部'}, diff --git a/pagesA/my-order/my-order.vue b/pagesA/my-order/my-order.vue index a7dc508..55c26ba 100644 --- a/pagesA/my-order/my-order.vue +++ b/pagesA/my-order/my-order.vue @@ -5,8 +5,8 @@ - - + + @@ -15,9 +15,12 @@ 实付:¥{{item.skus[0].price}} - 去付款 - + + 去付款 + + 查看物流 + 确认收货 + @@ -50,18 +53,21 @@ ], showType:-1, tipsTitle:'提示信息', - dynamicText:{ - content:'' - }, page:1, size:20, + tag:'', total:0, noMore:false, - orderList:[] + orderList:[], + flag:true } }, - onLoad() { + onShow() { + uni.removeStorageSync('orderDetail'); this.getOrderList(); + }, + onLoad() { + }, onReachBottom() { if(this.total!=this.orderList.length){ @@ -73,6 +79,11 @@ // tab点击事件 clickTab(index){ this.current = index; + this.page = 1; + this.orderList = []; + this.noMore = false; + this.tag = ['','waiting','accept','completed'][this.current]; + this.getOrderList(); }, // 按钮点击 clickBtn(index){ @@ -85,7 +96,8 @@ getOrderList(){ let params = { page:this.page, - size:this.size + size:this.size, + tag:this.tag } if(this.page==1) this.orderList = []; this.$requst.get('/api/user/order',params).then(res=>{ @@ -97,6 +109,62 @@ } } }) + }, + // 获取订单详情 + getOrderDetail(id){ + this.$toolAll.tools.goPage(`/pagesB/order-detail/order-detail?id=${id}`) + }, + // 确认收货 + confirmReceipt(id){ + this.$requst.post('/api/order/accepted',{order_id:id}).then(res=>{ + if(res.code==0){ + this.clickBtn(0); + this.getOrderList(); + } + }) + }, + // 去支付 + goPay(index){ + if(this.flag){ + this.flag = false; + this.$requst.post('/api/order/pay',{order_coding:this.orderList[index].coding}).then(res=>{ + if(res.code==0){ + let info = res.data; + if(info.status!='completed'){ + uni.requestPayment({ + provider: 'wxpay', + appId:info.payment_params.appId,//appId + timeStamp: info.payment_params.timeStamp,//时间戳 + nonceStr: info.payment_params.nonceStr,//随机字符串 + package: info.payment_params.package,//package + signType: info.payment_params.signType,//MD5 + paySign: info.payment_params.sign,//签名 + success:(result)=> { + this.$requst.post('/api/order/paid',{order_coding:this.orderList[index].coding}).then(res=>{ + if(res.code==0){ + this.clickBtn(1); + this.getOrderList(); + } else this.$toolAll.tools.showToast(res.msg); + }) + }, + fail:()=> { + this.$toolAll.tools.showToast('支付已取消o(╥﹏╥)o'); + }, + complete:()=> { + this.flag = true; + } + }); + } else { + this.$toolAll.tools.showToast('支付成功(*^▽^*)'); + setTimeout(()=>{ + uni.navigateTo({ + url:'/pagesA/my-order/my-order' + }) + },1000) + } + } + }) + } } } } diff --git a/pagesA/my-sign/my-sign.vue b/pagesA/my-sign/my-sign.vue index 4fedf15..898a66d 100644 --- a/pagesA/my-sign/my-sign.vue +++ b/pagesA/my-sign/my-sign.vue @@ -45,27 +45,8 @@ return { statusBarHeight: uni.getSystemInfoSync().statusBarHeight, newHeight:uni.getSystemInfoSync().screenHeight, - dataList:[ - {price:10,time:'2022.07.23'}, - {price:10,time:'2022.07.23'}, - {price:10,time:'2022.07.23'}, - {price:10,time:'2022.07.23'}, - {price:10,time:'2022.07.23'}, - {price:10,time:'2022.07.23'}, - {price:10,time:'2022.07.23'}, - {price:10,time:'2022.07.23'}, - {price:10,time:'2022.07.23'}, - ], - signList:[ - {score:'+5',day:'7-11'}, - {score:'+5',day:'7-12'}, - {score:'+5',day:'7-13'}, - {score:'+5',day:'7-14'}, - {score:'+5',day:'7-15'}, - {score:'+5',day:'7-16'}, - {score:'+5',day:'7-17'}, - ], - sameDay:1, + dataList:[],// 记录列表 + signList:[],// 日期列表 signText:'签到', showType:4, page:1, diff --git a/pagesB/buy-now/buy-now.vue b/pagesB/buy-now/buy-now.vue index 2074abb..fb0eb43 100644 --- a/pagesB/buy-now/buy-now.vue +++ b/pagesB/buy-now/buy-now.vue @@ -18,11 +18,12 @@ 商品金额 ¥{{$toolAll.tools.addXiaoShu(courseInfo.original_total*1)}} - + 优惠券抵扣 -¥{{couponInfo.coupon_price}} + 合计:{{realityPrice}} 支付方式 @@ -35,14 +36,19 @@ + + + + diff --git a/pagesB/shop-detail/shop-detail.vue b/pagesB/shop-detail/shop-detail.vue index 72e9071..e049c73 100644 --- a/pagesB/shop-detail/shop-detail.vue +++ b/pagesB/shop-detail/shop-detail.vue @@ -35,12 +35,12 @@ - + - + ¥{{shopInfo.price}} 加入购物车 @@ -73,7 +73,8 @@ moSpecList:[],//默认规格 haveSpecList:[],//有这个规格商品 isLoading:true, - shopList:[] + shopList:[], + ifDetail:false } }, onShow() { @@ -128,6 +129,8 @@ // 商品规格 this.$requst.get('/api/spu/spec',{id:this.shopId}).then(resspec=>{ if(resspec.code==0){ + // + this.ifDetail = true; // 所有规格列表 this.specList = resspec.data.spec; // 默认规格 diff --git a/static/public/icon-choose.png b/static/public/icon-choose.png new file mode 100644 index 0000000..2d520f4 Binary files /dev/null and b/static/public/icon-choose.png differ