From bce9d1cf5e2dbcf1992b4d19847fa302553f1b6a Mon Sep 17 00:00:00 2001 From: chen <2659004835@qq.com> Date: Wed, 10 Aug 2022 18:18:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E6=8E=A5=E5=BE=88=E5=A4=9A=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commons/base.css | 4 ++ jsFile/public-api.js | 6 +- pages/tabbar/my/my.vue | 6 +- pages/tabbar/pagehome/pagehome.vue | 6 +- pages/tabbar/video/video.vue | 14 ++++- pagesA/my-coupon/my-coupon.vue | 47 +++++++++++++-- pagesA/my-course/my-course.vue | 41 +++++++------ pagesA/my-extend/my-extend.vue | 67 +++++++++++++++++++-- pagesA/my-integral/my-integral.vue | 41 ++++++++++++- pagesA/my-order/my-order.vue | 48 ++++++++++++--- pagesA/my-sign/my-sign.vue | 80 ++++++++++++++++++------- pagesB/buy-now/buy-now.vue | 83 ++++++++++++++++++++++---- pagesB/cart/cart.vue | 33 +++++++--- pagesB/confirm-order/confirm-order.vue | 78 +++++++++++++++++++++--- pagesB/course-detail/course-detail.vue | 52 +++++++++++++--- pagesB/play-video/play-video.nvue | 3 +- pagesB/second-level/second-level.vue | 43 +++++++++++-- pagesB/shop-detail/shop-detail.vue | 3 + 18 files changed, 548 insertions(+), 107 deletions(-) diff --git a/commons/base.css b/commons/base.css index 9908f69..ceceafe 100644 --- a/commons/base.css +++ b/commons/base.css @@ -323,6 +323,10 @@ button:after{content: none!important;} .mar-x160{margin-bottom: 160rpx;} .mar-x180{margin-bottom: 180rpx;} /* 左---外边距 */ +.mar-z2{margin-left: 2rpx;} +.mar-z4{margin-left: 4rpx;} +.mar-z6{margin-left: 6rpx;} +.mar-z8{margin-left: 8rpx;} .mar-z10{margin-left: 10rpx;} .mar-z20{margin-left: 20rpx;} .mar-z25{margin-left: 25rpx;} diff --git a/jsFile/public-api.js b/jsFile/public-api.js index 346769a..b312055 100644 --- a/jsFile/public-api.js +++ b/jsFile/public-api.js @@ -6,4 +6,8 @@ export function uploadImg(data) { // 视频上传\音频\文件 export function uploadFile(data) { return request.upload("/universal/api.upload/upload", data, 'file'); -} \ No newline at end of file +} +// 视频播放记录上报 +export function reportRecord(data) { + return request.post("/api/user/video-view", data); +} diff --git a/pages/tabbar/my/my.vue b/pages/tabbar/my/my.vue index 9a5eb46..81d5d74 100644 --- a/pages/tabbar/my/my.vue +++ b/pages/tabbar/my/my.vue @@ -57,11 +57,12 @@ statusBarHeight: uni.getSystemInfoSync().statusBarHeight, // 状态栏高度 newHeight:uni.getSystemInfoSync().screenHeight, // 窗口高度 isLoading:false, //加载完成 + // {src:'/static/tabbar/icon-panh.png',title:'我的练习视频'}, funList:[ {src:'/static/tabbar/icon-set.png',title:'个人资料'}, {src:'/static/tabbar/icon-course.png',title:'我的课程'}, {src:'/static/tabbar/icon-order.png',title:'我的订单'}, - {src:'/static/tabbar/icon-panh.png',title:'我的练习视频'}, + {src:'/static/tabbar/icon-coupon.png',title:'我的优惠券'}, {src:'/static/tabbar/icon-score.png',title:'我的积分'}, {src:'/static/tabbar/icon-address.png',title:'我的地址'}, @@ -96,11 +97,12 @@ // 导航跳转 chooseFun(index){ + // '/pagesA/my-video/my-video', let list = [ '/pagesA/my-data/my-data', '/pagesA/my-course/my-course', '/pagesA/my-order/my-order', - '/pagesA/my-video/my-video', + '/pagesA/my-coupon/my-coupon', '/pagesA/my-integral/my-integral', '/pagesA/my-address/my-address', diff --git a/pages/tabbar/pagehome/pagehome.vue b/pages/tabbar/pagehome/pagehome.vue index 69adfb0..dd86299 100644 --- a/pages/tabbar/pagehome/pagehome.vue +++ b/pages/tabbar/pagehome/pagehome.vue @@ -68,6 +68,7 @@ import footTab from '@/components/foot-tabs/foot-tab.vue'; import list from '@/components/list.vue'; import pitera from '@/components/nothing/pitera.vue'; + import {reportRecord} from '@/jsFile/public-api.js'; export default { components:{ 'foot-tab' :footTab, @@ -210,7 +211,9 @@ wx.openChannelsActivity({ finderUserName:this.videoList[index].video_number, feedId:this.videoList[index].subtitle, - success:(res)=>{},fail:()=>{ + success:(res)=>{ + reportRecord({id:this.videoList[index].id}).then(result=>{}) + },fail:()=>{ this.$toolAll.tools.showToast('视频已丢失或已删除') } }) @@ -222,6 +225,7 @@ uni.navigateTo({ url:`/pagesB/play-video/play-video?current=${index}` }) + reportRecord({id:this.videoList[index].id}).then(result=>{}) } }, // 更多 diff --git a/pages/tabbar/video/video.vue b/pages/tabbar/video/video.vue index a3b187f..2922a86 100644 --- a/pages/tabbar/video/video.vue +++ b/pages/tabbar/video/video.vue @@ -43,6 +43,7 @@ // 底部组件 import footTab from '@/components/foot-tabs/foot-tab.vue'; import pitera from '@/components/nothing/pitera.vue'; + import {reportRecord} from '@/jsFile/public-api.js'; export default { components:{ 'foot-tab' :footTab, @@ -95,7 +96,13 @@ wx.openChannelsActivity({ finderUserName:this.dataList[index].video_number, feedId:this.dataList[index].subtitle, - success:(res)=>{},fail:()=>{ + success:(res)=>{ + reportRecord({id:this.dataList[index].id}).then(result=>{ + if(result.code==0){ + this.dataList[index].view++; + } + }) + },fail:()=>{ this.$toolAll.tools.showToast('视频已丢失或已删除') } }) @@ -107,6 +114,11 @@ uni.navigateTo({ url:`/pagesB/play-video/play-video?current=${index}` }) + reportRecord({id:this.dataList[index].id}).then(result=>{ + if(result.code==0){ + this.dataList[index].view++; + } + }) } }, } diff --git a/pagesA/my-coupon/my-coupon.vue b/pagesA/my-coupon/my-coupon.vue index 98b5067..c2ea78b 100644 --- a/pagesA/my-coupon/my-coupon.vue +++ b/pagesA/my-coupon/my-coupon.vue @@ -20,10 +20,10 @@ 去使用 - + @@ -31,17 +31,17 @@ - + - + @@ -71,13 +71,30 @@ {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, + size:20, + total:0, + noMore:false } }, + onReachBottom() { + if(this.total!=this.dataList.length){ + this.page++; + this.getCouponList(); + } + }, + onLoad() { + this.getCouponList(); + }, methods: { // tab点击事件 clickTab(index){ this.current = index; + this.status = ['normal','used','invalid'][this.current]; + this.page = 1; + this.getCouponList(); }, // 去商品详情 goDetail(id){ @@ -93,6 +110,24 @@ this.dataList.forEach(item=>item.show=false); this.dataList[index].show = true; } + }, + // 获取优惠券列表 + getCouponList(){ + let params = { + status:this.status, + page:this.page, + size:this.size + } + 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; + // } + } + }) } } } diff --git a/pagesA/my-course/my-course.vue b/pagesA/my-course/my-course.vue index 8a13089..53af573 100644 --- a/pagesA/my-course/my-course.vue +++ b/pagesA/my-course/my-course.vue @@ -2,22 +2,22 @@ - + - + - {{item.title}} - {{item.time}} + {{item.name}} + {{item.created_at}} ¥{{item.price}} - 点击学习 + 点击学习 - + @@ -40,26 +40,33 @@ {imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'思通造化随通而行为术基础动作教学思通造化随通而行为术基础动作教学',time:'2022.07.20 12:12:12',price:'199.00'}, {imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'思通造化随通而行为术基础动作教学思通造化随通而行为术基础动作教学',time:'2022.07.20 12:12:12',price:'199.00'}, {imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'思通造化随通而行为术基础动作教学思通造化随通而行为术基础动作教学',time:'2022.07.20 12:12:12',price:'199.00'}, - ] + ], + page:1, + size:20, + total:0, + noMore:false, } }, - onShow() { + onLoad() { // 获取课程列表 this.getCouresList(); }, + onReachBottom() { + if(this.total!=this.dataList.lenght){ + this.page++; + this.getCouresList(); + } + }, methods: { // 获取课程列表 getCouresList(){ - uni.showLoading({ - title:'加载中' - }); - this.$requst.get('/api/spu/course').then(res=>{ - console.log(res,'课程列表') - if(res.code==0) { - this.userInfo = res.data; + this.$requst.get('/api/user/course').then(res=>{ + 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; } - uni.hideLoading(); - this.isLoading = true; }) }, diff --git a/pagesA/my-extend/my-extend.vue b/pagesA/my-extend/my-extend.vue index ad6cceb..a984393 100644 --- a/pagesA/my-extend/my-extend.vue +++ b/pagesA/my-extend/my-extend.vue @@ -1,10 +1,10 @@