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 @@