对接很多接口

master
chen 2022-08-10 18:18:06 +08:00
parent 9d13330cc6
commit bce9d1cf5e
18 changed files with 548 additions and 107 deletions

View File

@ -323,6 +323,10 @@ button:after{content: none!important;}
.mar-x160{margin-bottom: 160rpx;} .mar-x160{margin-bottom: 160rpx;}
.mar-x180{margin-bottom: 180rpx;} .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-z10{margin-left: 10rpx;}
.mar-z20{margin-left: 20rpx;} .mar-z20{margin-left: 20rpx;}
.mar-z25{margin-left: 25rpx;} .mar-z25{margin-left: 25rpx;}

View File

@ -6,4 +6,8 @@ export function uploadImg(data) {
// 视频上传\音频\文件 // 视频上传\音频\文件
export function uploadFile(data) { export function uploadFile(data) {
return request.upload("/universal/api.upload/upload", data, 'file'); return request.upload("/universal/api.upload/upload", data, 'file');
} }
// 视频播放记录上报
export function reportRecord(data) {
return request.post("/api/user/video-view", data);
}

View File

@ -57,11 +57,12 @@
statusBarHeight: uni.getSystemInfoSync().statusBarHeight, // statusBarHeight: uni.getSystemInfoSync().statusBarHeight, //
newHeight:uni.getSystemInfoSync().screenHeight, // newHeight:uni.getSystemInfoSync().screenHeight, //
isLoading:false, // isLoading:false, //
// {src:'/static/tabbar/icon-panh.png',title:''},
funList:[ funList:[
{src:'/static/tabbar/icon-set.png',title:'个人资料'}, {src:'/static/tabbar/icon-set.png',title:'个人资料'},
{src:'/static/tabbar/icon-course.png',title:'我的课程'}, {src:'/static/tabbar/icon-course.png',title:'我的课程'},
{src:'/static/tabbar/icon-order.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-coupon.png',title:'我的优惠券'},
{src:'/static/tabbar/icon-score.png',title:'我的积分'}, {src:'/static/tabbar/icon-score.png',title:'我的积分'},
{src:'/static/tabbar/icon-address.png',title:'我的地址'}, {src:'/static/tabbar/icon-address.png',title:'我的地址'},
@ -96,11 +97,12 @@
// //
chooseFun(index){ chooseFun(index){
// '/pagesA/my-video/my-video',
let list = [ let list = [
'/pagesA/my-data/my-data', '/pagesA/my-data/my-data',
'/pagesA/my-course/my-course', '/pagesA/my-course/my-course',
'/pagesA/my-order/my-order', '/pagesA/my-order/my-order',
'/pagesA/my-video/my-video',
'/pagesA/my-coupon/my-coupon', '/pagesA/my-coupon/my-coupon',
'/pagesA/my-integral/my-integral', '/pagesA/my-integral/my-integral',
'/pagesA/my-address/my-address', '/pagesA/my-address/my-address',

View File

@ -68,6 +68,7 @@
import footTab from '@/components/foot-tabs/foot-tab.vue'; import footTab from '@/components/foot-tabs/foot-tab.vue';
import list from '@/components/list.vue'; import list from '@/components/list.vue';
import pitera from '@/components/nothing/pitera.vue'; import pitera from '@/components/nothing/pitera.vue';
import {reportRecord} from '@/jsFile/public-api.js';
export default { export default {
components:{ components:{
'foot-tab' :footTab, 'foot-tab' :footTab,
@ -210,7 +211,9 @@
wx.openChannelsActivity({ wx.openChannelsActivity({
finderUserName:this.videoList[index].video_number, finderUserName:this.videoList[index].video_number,
feedId:this.videoList[index].subtitle, feedId:this.videoList[index].subtitle,
success:(res)=>{},fail:()=>{ success:(res)=>{
reportRecord({id:this.videoList[index].id}).then(result=>{})
},fail:()=>{
this.$toolAll.tools.showToast('视频已丢失或已删除') this.$toolAll.tools.showToast('视频已丢失或已删除')
} }
}) })
@ -222,6 +225,7 @@
uni.navigateTo({ uni.navigateTo({
url:`/pagesB/play-video/play-video?current=${index}` url:`/pagesB/play-video/play-video?current=${index}`
}) })
reportRecord({id:this.videoList[index].id}).then(result=>{})
} }
}, },
// //

View File

@ -43,6 +43,7 @@
// //
import footTab from '@/components/foot-tabs/foot-tab.vue'; import footTab from '@/components/foot-tabs/foot-tab.vue';
import pitera from '@/components/nothing/pitera.vue'; import pitera from '@/components/nothing/pitera.vue';
import {reportRecord} from '@/jsFile/public-api.js';
export default { export default {
components:{ components:{
'foot-tab' :footTab, 'foot-tab' :footTab,
@ -95,7 +96,13 @@
wx.openChannelsActivity({ wx.openChannelsActivity({
finderUserName:this.dataList[index].video_number, finderUserName:this.dataList[index].video_number,
feedId:this.dataList[index].subtitle, 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('视频已丢失或已删除') this.$toolAll.tools.showToast('视频已丢失或已删除')
} }
}) })
@ -107,6 +114,11 @@
uni.navigateTo({ uni.navigateTo({
url:`/pagesB/play-video/play-video?current=${index}` url:`/pagesB/play-video/play-video?current=${index}`
}) })
reportRecord({id:this.dataList[index].id}).then(result=>{
if(result.code==0){
this.dataList[index].view++;
}
})
} }
}, },
} }

View File

@ -20,10 +20,10 @@
</view> </view>
<view class="flexs mar-z20 radius26 colf disjcac" style="width: 124rpx;height: 52rpx;" :style="{backgroundColor:current!=0?'#c0c0c0':'#f37717'}">去使用</view> <view class="flexs mar-z20 radius26 colf disjcac" style="width: 124rpx;height: 52rpx;" :style="{backgroundColor:current!=0?'#c0c0c0':'#f37717'}">去使用</view>
</view> </view>
<view class="disac fon20 pad-s20" style="color: #747474;"> <!-- <view class="disac fon20 pad-s20" style="color: #747474;">
<span @tap="lookDetail(index)"></span> <span @tap="lookDetail(index)"></span>
<view @tap="lookDetail(index)" class="icon icon-return fon20 mar-z10" :class="item.show?'isshow':'noshow'"></view> <view @tap="lookDetail(index)" class="icon icon-return fon20 mar-z10" :class="item.show?'isshow':'noshow'"></view>
</view> </view> -->
<!-- 图标 --> <!-- 图标 -->
<view class="posia" v-if="current!=0" style="position: absolute;right: 120rpx;top: 60rpx;"> <view class="posia" v-if="current!=0" style="position: absolute;right: 120rpx;top: 60rpx;">
<image v-if="current==1" src="/static/tabbar/icon-used.png" style="width: 90rpx;height: 86rpx;" mode="" lazy-load></image> <image v-if="current==1" src="/static/tabbar/icon-used.png" style="width: 90rpx;height: 86rpx;" mode="" lazy-load></image>
@ -31,17 +31,17 @@
</view> </view>
</view> </view>
</view> </view>
<view v-if="item.show" class="fon20 line-h36 pad-zy20 pad-s20" style="color: #898989;"> <!-- <view v-if="item.show" class="fon20 line-h36 pad-zy20 pad-s20" style="color: #898989;">
<view class="">时间2022.07.11 00:00:00 - 2022.07.30 23:59:59</view> <view class="">时间2022.07.11 00:00:00 - 2022.07.30 23:59:59</view>
<view class="">来源秒杀抢卷所得</view> <view class="">来源秒杀抢卷所得</view>
<view class="">渠道全部渠道可</view> <view class="">渠道全部渠道可</view>
<view class="disac">编号全部渠道可 <view class="disac">编号全部渠道可
<image class="mar-z10" src="/static/tabbar/icon-bh.png" mode="" style="width: 22rpx;height: 22rpx;" lazy-load></image> <image class="mar-z10" src="/static/tabbar/icon-bh.png" mode="" style="width: 22rpx;height: 22rpx;" lazy-load></image>
</view> </view>
</view> </view> -->
</view> </view>
</view> </view>
<view class="pad-zy20"> <view class="pad-zy20" v-if="noMore">
<pitera textStr="上滑加载更多/到底了~~" textColor="#b0aaa9" paddingStr="40rpx 0 20rpx 0"></pitera> <pitera textStr="上滑加载更多/到底了~~" textColor="#b0aaa9" paddingStr="40rpx 0 20rpx 0"></pitera>
</view> </view>
</view> </view>
@ -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}, {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: { methods: {
// tab // tab
clickTab(index){ clickTab(index){
this.current = index; this.current = index;
this.status = ['normal','used','invalid'][this.current];
this.page = 1;
this.getCouponList();
}, },
// //
goDetail(id){ goDetail(id){
@ -93,6 +110,24 @@
this.dataList.forEach(item=>item.show=false); this.dataList.forEach(item=>item.show=false);
this.dataList[index].show = true; 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;
// }
}
})
} }
} }
} }

View File

@ -2,22 +2,22 @@
<view> <view>
<status-container titlet="我的课程" returnc="#FFFFFF"> <status-container titlet="我的课程" returnc="#FFFFFF">
<view slot="content" style="margin-top: -20rpx;"> <view slot="content" style="margin-top: -20rpx;">
<view class="pad-zy30 bacf pad-x30"> <view class="pad-zy30 bacf pad-x30" v-if="total">
<view class="pad-sx30 disac fon24 bbot" v-for="(item,index) in dataList" :key="index"> <view class="pad-sx30 disac fon24 bbot" v-for="(item,index) in dataList" :key="index">
<image class="flexs" :src="item.imgsrc" mode="aspectFill" style="width: 228rpx;height: 160rpx;"></image> <image class="flexs" :src="item.cover" mode="aspectFill" style="width: 228rpx;height: 160rpx;"></image>
<view class="disjbac fc width100 mar-z20" style="height: 160rpx;"> <view class="disjbac fc width100 mar-z20" style="height: 160rpx;">
<view class="fon26 col26 width100"> <view class="fon26 col26 width100">
<view class="clips2">{{item.title}}</view> <view class="clips2">{{item.name}}</view>
<view class="fon20 mar-s10" style="color: #7f7f7f;">{{item.time}}</view> <view class="fon20 mar-s10" style="color: #7f7f7f;">{{item.created_at}}</view>
</view> </view>
<view class="disjbac width100"> <view class="disjbac width100">
<view class="fon24">{{item.price}}</view> <view class="fon24">{{item.price}}</view>
<view class="disjcac fon22 radius26" style="width: 144rpx;height: 52rpx;color: #f37717;border: 2rpx solid #f37717;">点击学习</view> <view @tap="$toolAll.tools.goPage(`/pagesB/course-detail/course-detail?id=${item.id}`)" class="disjcac fon22 radius26" style="width: 144rpx;height: 52rpx;color: #f37717;border: 2rpx solid #f37717;">点击学习</view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view class="pad-zy20"> <view class="pad-zy20" v-if="noMore">
<pitera textStr="上滑加载更多/到底了~~" textColor="#b0aaa9" paddingStr="40rpx 0 20rpx 0"></pitera> <pitera textStr="上滑加载更多/到底了~~" textColor="#b0aaa9" paddingStr="40rpx 0 20rpx 0"></pitera>
</view> </view>
</view> </view>
@ -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'}, {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(); this.getCouresList();
}, },
onReachBottom() {
if(this.total!=this.dataList.lenght){
this.page++;
this.getCouresList();
}
},
methods: { methods: {
// //
getCouresList(){ getCouresList(){
uni.showLoading({ this.$requst.get('/api/user/course').then(res=>{
title:'加载中' this.total = res.data.total;
}); if(this.page==1){this.dataList=[];}
this.$requst.get('/api/spu/course').then(res=>{ this.dataList = [...this.dataList,...res.data.list];
console.log(res,'课程列表') if(this.total==this.dataList.length && this.page!=1){
if(res.code==0) { this.noMore = true;
this.userInfo = res.data;
} }
uni.hideLoading();
this.isLoading = true;
}) })
}, },

View File

@ -1,10 +1,10 @@
<template> <template>
<view> <view>
<status-container titlet="我的推广" returnc="#FFFFFF"> <status-container titlet="我的推广" returnc="#FFFFFF">
<view slot="content" style="margin-top: -20rpx;"> <view slot="content" style="margin-top: -20rpx;" v-if="loading">
<view class="bacf pad-zy20 boxshow2"> <view class="bacf pad-zy20 boxshow2">
<view class="disjcac pad-sx30 bbot"> <view class="disjcac pad-sx30 bbot">
<image src="https://s6.jpg.cm/2022/02/14/L4oDhy.jpg" mode="aspectFill" style="width: 242rpx;height: 242rpx;" lazy-load></image> <image :src="personCode" mode="aspectFill" style="width: 242rpx;height: 242rpx;" lazy-load></image>
</view> </view>
<view class="disjbac pad-sx20 pad-zy10"> <view class="disjbac pad-sx20 pad-zy10">
<view class="fon22 col26">推广获取积分</view> <view class="fon22 col26">推广获取积分</view>
@ -12,7 +12,7 @@
</view> </view>
</view> </view>
<view class="mar-s30 pad-zy20 bacf boxshow2"> <view class="mar-s30 pad-zy20 bacf boxshow2">
<view class=" col26 pad-sx20 pad-zy10 disac borbot" v-for="(item,index) in 20" :key="index" @tap="$toolAll.tools.goPage(`/pagesB/second-level/second-level?id=${0}`)"> <view @tap="$toolAll.tools.goPage(`/pagesB/second-level/second-level?id=${0}`)" class=" col26 pad-sx20 pad-zy10 disac borbot" v-for="(item,index) in 20" :key="index">
<image src="https://s6.jpg.cm/2022/02/14/L4oDhy.jpg" class="flexs radius_100 mar-y20" style="width: 78rpx;height: 78rpx;" mode="aspectFill" lazy-load></image> <image src="https://s6.jpg.cm/2022/02/14/L4oDhy.jpg" class="flexs radius_100 mar-y20" style="width: 78rpx;height: 78rpx;" mode="aspectFill" lazy-load></image>
<view class="width100"> <view class="width100">
<view class="disjbac"> <view class="disjbac">
@ -26,7 +26,9 @@
</view> </view>
</view> </view>
</view> </view>
<pitera textStr="上滑加载更多/到底了~~" textColor="#b0aaa9" paddingStr="40rpx 0 20rpx 0"></pitera> <view class="" v-if="noMore">
<pitera textStr="上滑加载更多/到底了~~" textColor="#b0aaa9" paddingStr="40rpx 0 20rpx 0"></pitera>
</view>
</view> </view>
</status-container> </status-container>
</view> </view>
@ -34,17 +36,70 @@
<script> <script>
import pitera from '@/components/nothing/pitera.vue'; import pitera from '@/components/nothing/pitera.vue';
import {base64ToPath} from '@/jsFile/base64-src.js';
export default { export default {
components:{ components:{
pitera pitera
}, },
data() { data() {
return { return {
dataList:[],
page:1,
size:20,
total:0,
noMore:false,
personCode:'',
loading:false
}
},
onLoad() {
this.getCode();
this.getExtend();
},
onReachBottom() {
if(this.total!=this.dataList.lenght){
this.page++;
this.getExtend();
} }
}, },
methods: { methods: {
// 广
getExtend(){
let params = {
grade:'first',
page:this.page,
size:this.size
}
this.$requst.get('/api/user/share-users',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;
}
}
})
},
// 广
getCode(){
if(uni.getStorageSync('personCode')){
this.loading = true;
this.personCode = uni.getStorageSync('personCode');
} else {
this.$toolAll.tools.showToast('加载中...');
this.$requst.get('/api/user/personal-qr').then(res=>{
if(res.code==0){
base64ToPath(res.data.qr).then(result=>{
this.personCode = result;
uni.setStorageSync('personCode',this.personCode);
this.loading = true;
uni.hideToast();
})
}
})
}
}
} }
} }
</script> </script>

View File

@ -12,7 +12,7 @@
</view> </view>
<swiper-tab id="tab" :ifBetween="false" :ifPadding="true" :list="tabList" v-model="current" @changeEv="clickTab" :itemColor="'#e42417'" :lineColor="'#e42417'"></swiper-tab> <swiper-tab id="tab" :ifBetween="false" :ifPadding="true" :list="tabList" v-model="current" @changeEv="clickTab" :itemColor="'#e42417'" :lineColor="'#e42417'"></swiper-tab>
</view> </view>
<view class="mar-s30 bacf pad-zy40 pad-sx20 boxshow2"> <view class="mar-s30 bacf pad-zy40 pad-sx20 boxshow2" v-if="total">
<view class="pad-sx20 col26 bbot" v-for="(item,index) in dataList" :key="index"> <view class="pad-sx20 col26 bbot" v-for="(item,index) in dataList" :key="index">
<view class="fon26 disjbac"> <view class="fon26 disjbac">
<view class="">{{item.title}}</view> <view class="">{{item.title}}</view>
@ -21,7 +21,7 @@
<view class="fon20" style="color: #8b8b8b;">{{item.time}}</view> <view class="fon20" style="color: #8b8b8b;">{{item.time}}</view>
</view> </view>
</view> </view>
<view class="pad-zy20"> <view class="pad-zy20" v-if="noMore">
<pitera textStr="上滑加载更多/到底了~~" textColor="#b0aaa9" paddingStr="40rpx 0 20rpx 0"></pitera> <pitera textStr="上滑加载更多/到底了~~" textColor="#b0aaa9" paddingStr="40rpx 0 20rpx 0"></pitera>
</view> </view>
</view> </view>
@ -55,13 +55,48 @@
{price:10,title:'签到',time:'2022.07.11-2022.07.30'}, {price:10,title:'签到',time:'2022.07.11-2022.07.30'},
{price:10,title:'分享',time:'2022.07.11-2022.07.30'}, {price:10,title:'分享',time:'2022.07.11-2022.07.30'},
{price:10,title:'推荐消费',time:'2022.07.11-2022.07.30'}, {price:10,title:'推荐消费',time:'2022.07.11-2022.07.30'},
] ],
page:1,
size:20,
type:'',
total:0,
noMore:false
}
},
onLoad() {
this.getIntegral();
},
onReachBottom() {
if(this.total!=this.dataList.length){
this.page++;
this.getIntegral();
} }
}, },
methods: { methods: {
// tab // tab
clickTab(index){ clickTab(index){
this.current = index; this.current = index;
this.type = ['','in','out'][this.current];
this.page = 1;
this.getIntegral();
},
//
getIntegral(){
let params = {
type:this.type,
page:this.page,
size:this.size
}
this.$requst.get('/api/user/score-log',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;
}
}
})
} }
} }
} }

View File

@ -6,21 +6,23 @@
<swiper-tab id="tab" :list="dataList" v-model="current" @changeEv="clickTab" :itemColor="'#e42417'" :lineColor="'#e42417'"></swiper-tab> <swiper-tab id="tab" :list="dataList" v-model="current" @changeEv="clickTab" :itemColor="'#e42417'" :lineColor="'#e42417'"></swiper-tab>
</view> </view>
<view class="bacf mar-s20 pad-x20"> <view class="bacf mar-s20 pad-x20">
<view @tap="$toolAll.tools.goPage(`/pagesB/order-detail/order-detail?id=${0}`)" class="bbot disac pad30 col26" v-for="(item,index) in 3" :key="index"> <view @tap="$toolAll.tools.goPage(`/pagesB/order-detail/order-detail?id=${0}`)" class="bbot disac pad30 col26" v-for="(item,index) in orderList" :key="index">
<image class="flexs mar-y20" src="https://s6.jpg.cm/2022/02/14/L4oDhy.jpg" style="width: 192rpx;height: 134rpx;" mode="aspectFill" lazy-load></image> <image class="flexs mar-y20" :src="item.skus[0].spu_cover" style="width: 192rpx;height: 134rpx;" mode="aspectFill" lazy-load></image>
<view class="fon24 width100 disjbac fc" style="height: 134rpx;"> <view class="fon24 width100 disjbac fc" style="height: 134rpx;">
<view class="dis width100"> <view class="dis width100">
<view class="clips2">武术用品商品名称后用品商品名称后 台上传基础动作教学</view> <view class="clips2 width100">{{item.skus[0].spu_name}}</view>
<view class="mar-z50">x3</view> <view class="mar-z50">x{{item.skus[0].num}}</view>
</view> </view>
<view class="disjbac width100"> <view class="disjbac width100">
<view class="">实付199.00</view> <view class="">实付{{item.skus[0].price}}</view>
<view @tap.stop="clickBtn(index)" class="fon22 radius26 disjcac" :style="{backgroundColor:['#FFFFF','#f37717','#FFFFF'][index],color:['#f37717','#FFFFFF','#969696'][index],borderColor:['#f37717','#f37717','#c9c9c9'][index]}" style="border: 2rpx solid #f37717;color: #f37717;width: 134rpx;height: 50rpx;">{{['确认收货','去付款','查看物流'][index]}}</view> <view v-if="item.status=='paid'" @tap.stop="clickBtn(index)" class="fon22 radius26 disjcac" style="background-color:#f37717;border: 2rpx solid #f37717;color: #FFFFFF;width: 134rpx;height: 50rpx;"></view>
<!-- <view @tap.stop="clickBtn(index)" class="fon22 radius26 disjcac" :style="{backgroundColor:['#FFFFF','#f37717','#FFFFF'][index],color:['#f37717','#FFFFFF','#969696'][index],borderColor:['#f37717','#f37717','#c9c9c9'][index]}" style="border: 2rpx solid #f37717;color: #f37717;width: 134rpx;height: 50rpx;">{{['确认收货','去付款','查看物流'][index]}}</view>
<view @tap.stop="clickBtn(index)" class="fon22 radius26 disjcac" :style="{backgroundColor:['#FFFFF','#f37717','#FFFFF'][index],color:['#f37717','#FFFFFF','#969696'][index],borderColor:['#f37717','#f37717','#c9c9c9'][index]}" style="border: 2rpx solid #f37717;color: #f37717;width: 134rpx;height: 50rpx;">{{['确认收货','去付款','查看物流'][index]}}</view> -->
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view class="pad-zy20"> <view class="pad-zy20" v-if="noMore">
<pitera textStr="上滑加载更多/到底了~~" textColor="#b0aaa9" paddingStr="40rpx 0 20rpx 0"></pitera> <pitera textStr="上滑加载更多/到底了~~" textColor="#b0aaa9" paddingStr="40rpx 0 20rpx 0"></pitera>
</view> </view>
</view> </view>
@ -50,11 +52,22 @@
tipsTitle:'提示信息', tipsTitle:'提示信息',
dynamicText:{ dynamicText:{
content:'' content:''
} },
page:1,
size:20,
total:0,
noMore:false,
orderList:[]
} }
}, },
onLoad() { onLoad() {
this.getOrderList();
},
onReachBottom() {
if(this.total!=this.orderList.length){
this.page++;
this.getOrderList();
}
}, },
methods: { methods: {
// tab // tab
@ -67,6 +80,23 @@
this.showType = [2,3,1][index]; this.showType = [2,3,1][index];
this.$refs.refFrame.ifLogistics = true; this.$refs.refFrame.ifLogistics = true;
this.$refs.refFrame.ifAnimated = true; this.$refs.refFrame.ifAnimated = true;
},
//
getOrderList(){
let params = {
page:this.page,
size:this.size
}
if(this.page==1) this.orderList = [];
this.$requst.get('/api/user/order',params).then(res=>{
if(res.code==0){
this.total = res.data.total;
this.orderList = [...this.orderList,...res.data.list];
if(this.total==this.orderList.length && this.page!=1){
this.noMore = true;
}
}
})
} }
} }
} }

View File

@ -4,28 +4,30 @@
<image src="/static/tabbar/my-back.png" mode="" class="width100 posia" style="top: 0;z-index: -1;" lazy-load :style="{height:newHeight+'px'}"></image> <image src="/static/tabbar/my-back.png" mode="" class="width100 posia" style="top: 0;z-index: -1;" lazy-load :style="{height:newHeight+'px'}"></image>
<view class="disac colf fon42" style="height: 42px;padding: 0 30rpx;"><view class="icon icon-return fon38 colf" @tap="goBack"></view><span @tap="goBack"></span></view> <view class="disac colf fon42" style="height: 42px;padding: 0 30rpx;"><view class="icon icon-return fon38 colf" @tap="goBack"></view><span @tap="goBack"></span></view>
</view> </view>
<view class="disjcac mar-x20"> <view class="" v-if="loading">
<view class="posir disjcac" @tap="signEv"> <view class="disjcac mar-x20">
<image src="/static/public/icon-sign-box.png" mode="" style="width: 166rpx;height: 166rpx;" lazy-load></image> <view class="posir disjcac" @tap="signEv">
<view class="disjcac fc posia fon38 bold" style="color: #f37c20;"> <image src="/static/public/icon-sign-box.png" mode="" style="width: 166rpx;height: 166rpx;" lazy-load></image>
<image class="mar-x10" src="/static/public/icon-sign.png" mode="" style="width: 40rpx;height: 36rpx;" lazy-load></image> <view class="disjcac fc posia fon38 bold" style="color: #f37c20;">
{{signText}} <image class="mar-x10" src="/static/public/icon-sign.png" mode="" style="width: 40rpx;height: 36rpx;" lazy-load></image>
{{signText}}
</view>
</view> </view>
</view> </view>
</view> <view class="pad-zy30">
<view class="pad-zy30"> <view class="disjbac" style="background: linear-gradient(to bottom, #fefcfc 0%, #f8efed 100%);border-radius: 24rpx 24rpx 0 0;">
<view class="disjbac" style="background: linear-gradient(to bottom, #fefcfc 0%, #f8efed 100%);border-radius: 24rpx 24rpx 0 0;"> <view class="disjcac fc fon24 pad-sx30 width100" :class="item.is_today==1?'activeDay':''" v-for="(item,index) in signList" :key="index">
<view class="disjcac fc fon24 pad-sx30 width100" :class="sameDay==index?'activeDay':''" v-for="(item,index) in signList" :key="index"> <view class="">{{item.score}}</view>
<view class="">{{item.score}}</view> <view class="mar-s10">{{item.key}}</view>
<view class="mar-s10">{{item.day}}</view> </view>
</view> </view>
</view> </view>
</view> <view class="pad-zy20">
<view class="pad-zy20"> <view class="posir bacf disac fw pad-zy10 boxshow2 pad-x30" style="z-index: 1;">
<view class="posir bacf disac fw pad-zy10 boxshow2 pad-x30" style="z-index: 1;"> <view class="disjbac bbot width100 pad-sx20 pad-zy30" v-for="(item,index) in dataList" :key="index">
<view class="disjbac bbot width100 pad-sx20 pad-zy30" v-for="(item,index) in dataList" :key="index"> <view class="fon24 col-e42417">{{item.num}}</view>
<view class="fon24 col-e42417">{{item.price}}</view> <view class="fon20" style="color: #676767;" v-if="item.created_at">{{item.created_at.slice(0,10).split('-').join('.')}}</view>
<view class="fon20" style="color: #676767;">{{item.time}}</view> </view>
</view> </view>
</view> </view>
</view> </view>
@ -65,23 +67,55 @@
], ],
sameDay:1, sameDay:1,
signText:'签到', signText:'签到',
showType:4 showType:4,
page:1,
size:20,
loading:false
} }
}, },
onLoad() { onLoad() {
this.getSignInfo();
}, },
methods: { methods: {
//
getSignInfo(){
this.$requst.get('/api/sign/info').then(res=>{
if(res.code==0){
this.signList = res.data.week;
this.signText = ['签到','已签到'][res.data.today_sign];
this.loading = true;
this.getSignList();
}
})
},
// //
goBack(){ goBack(){
uni.navigateBack({ uni.navigateBack({
delta:1 delta:1
}) })
}, },
//
signEv(){ signEv(){
this.signText = "已签到"; this.$requst.post('/api/sign/sign').then(res=>{
this.$refs.refFrame.ifLogistics = true; if(res.code==0){
this.$refs.refFrame.ifAnimated = true; this.signText = "已签到";
this.$refs.refFrame.ifLogistics = true;
this.$refs.refFrame.ifAnimated = true;
this.getSignList();
}
})
},
//
getSignList(){
let params = {
page:this.page,
size:this.size
}
this.$requst.get('/api/user/sign-score',params).then(res=>{
if(res.code==0){
this.dataList = res.data.list;
}
})
} }
} }
} }

View File

@ -3,24 +3,24 @@
<status-container titlet="课程购买" returnc="#FFFFFF"> <status-container titlet="课程购买" returnc="#FFFFFF">
<view slot="content" style="margin-top: -20rpx;"> <view slot="content" style="margin-top: -20rpx;">
<view class="bacf pad30 fon24 boxshowb"> <view class="bacf pad30 fon24 boxshowb">
<view class="disac bbot pad-x30"> <view class="disac bbot pad-x30" v-for="(item,index) in courseInfo.list" :key="index">
<image src="https://s6.jpg.cm/2022/02/14/L4oDhy.jpg" mode="aspectFill" class="flexs mar-y20" style="width: 228rpx;height: 160rpx;" lazy-load></image> <image :src="item.spu_cover" mode="aspectFill" class="flexs mar-y20" style="width: 228rpx;height: 160rpx;" lazy-load></image>
<view class="disjb fc pad-s10 pad-x20" style="height: 160rpx;"> <view class="disjb fc pad-s10 pad-x20" style="height: 160rpx;">
<view class="fon26 col26 clips2">止戈为武思通造化随通而 行为术基础动作教学</view> <view class="fon26 col26 clips2">{{item.spu_name}}</view>
<view class="col-e42417 dis ae"> <view class="col-e42417 dis ae">
<view class="bold">199.00</view> <view class="bold">{{item.price}}</view>
<view class="tline-through fon20 col-969696 mar-z10">220.00</view> <view class="tline-through fon20 col-969696 mar-z10">{{item.original_price}}</view>
</view> </view>
</view> </view>
</view> </view>
<view class="bbot pad-sx30"> <view class="bbot pad-sx30">
<view class="disjbac"> <view class="disjbac">
<view class="">商品金额</view> <view class="">商品金额</view>
<view class="">199.00</view> <view class="">{{$toolAll.tools.addXiaoShu(courseInfo.original_total*1)}}</view>
</view> </view>
<view class="disjbac mar-s30"> <view class="disjbac mar-s30">
<view class="">优惠券抵扣</view> <view class="">优惠券抵扣</view>
<view class="disjbac col-e42417">-10.00 <i class="icon icon-next fon20" style="color: #7f7f7f;"></i></view> <view class="disjbac col-e42417">-{{couponInfo.coupon_price}} <i class="icon icon-next fon20" style="color: #7f7f7f;"></i></view>
</view> </view>
</view> </view>
</view> </view>
@ -30,8 +30,8 @@
</view> </view>
<!-- 立即购买 --> <!-- 立即购买 -->
<view class="posixzy bacf pad-sx20 disjbac pad-zy30 boxshowt"> <view class="posixzy bacf pad-sx20 disjbac pad-zy30 boxshowt">
<view class="fon30 col-e42417 bold">189.00</view> <view class="fon30 col-e42417 bold">{{realityPrice}}</view>
<view class="fon24 colf radius32 disjcac" style="background-color: #f37617;width: 184rpx;height: 64rpx;">去支付</view> <view @tap="goPay" class="fon24 colf radius32 disjcac" style="background-color: #f37617;width: 184rpx;height: 64rpx;">去支付</view>
</view> </view>
</view> </view>
</status-container> </status-container>
@ -45,14 +45,73 @@
components:{'foot-tab' :footTab}, components:{'foot-tab' :footTab},
data() { data() {
return { return {
courseInfo:'',
couponInfo:{
coupon_id:'',//ID
coupon_price:0//
},
flag:true
} }
}, },
onLoad() { onLoad() {
this.courseInfo = uni.getStorageSync('courseInfo');
// uni.getStorageSync('skuList');
},
computed:{
realityPrice(){
let newPrice = 0;
if(this.courseInfo){
this.courseInfo.list.forEach(item=>{
let tempprice = this.$toolAll.tools.operationEv(item.price,item.num,'*',2)
newPrice = this.$toolAll.tools.operationEv(tempprice,newPrice,'+',2);
})
}
//
newPrice = this.$toolAll.tools.operationEv(newPrice,this.couponInfo.coupon_price,'-',2);
return newPrice;
}
}, },
methods: { methods: {
//
goPay(){
if(this.flag){
this.flag = false;
this.$toolAll.tools.showToast('正在调起支付...');
let params = {
sku_list:uni.getStorageSync('skuList'),
total:this.realityPrice,// 使
...this.couponInfo,
type:'course',// spu= course=
}
this.$requst.post('/api/order/create',params).then(res=>{
if(res.code==0){
let info = res.data;
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:info.coding}).then(res=>{
if(res.code==0){
this.$toolAll.tools.showToast('支付成功(*^▽^*)');
} else this.$toolAll.tools.showToast(res.msg);
})
},
fail:()=> {
this.$toolAll.tools.showToast('支付已取消o(╥﹏╥)o');
},
complete:()=> {
this.flag = true;
}
});
}
})
}
}
} }
} }
</script> </script>

View File

@ -49,8 +49,7 @@
</view> </view>
</view> </view>
<view class="pad-zy20"> <view class="pad-zy20">
<list @goDetail="goDetail"></list> <list ref="refproduct" @goDetail="goDetail"></list>
<list @goDetail="goDetail"></list>
</view> </view>
<!-- 底部导航 --> <!-- 底部导航 -->
<view class="disjbac bacf pad20 posixzy fon24 boxshowt"> <view class="disjbac bacf pad20 posixzy fon24 boxshowt">
@ -103,6 +102,8 @@
this.getCartList(); this.getCartList();
// //
this.judgeSelectAllEv(); this.judgeSelectAllEv();
uni.removeStorageSync('orderInfo');
uni.removeStorageSync('skuList');
}, },
onHide() { onHide() {
// banner // banner
@ -134,6 +135,20 @@
}, },
methods: { methods: {
//
getShopList(){
let params = {
page:1,
size:1000,
is_hot:1
}
this.$requst.post('/api/spu/list',params).then(res=>{
if(res.code==0){
//
this.$refs.refproduct.list = res.data.list;
}
})
},
// //
getCartList(){ getCartList(){
let params = { let params = {
@ -155,6 +170,7 @@
}) })
} }
this.loading = true; this.loading = true;
this.getShopList();
} }
}) })
}, },
@ -182,11 +198,13 @@
if(exit!=-1){ if(exit!=-1){
let newList = []; let newList = [];
this.datalist.forEach(item=>{ this.datalist.forEach(item=>{
let obj = { if(item.ifcheck){
sku_coding:item.sku.coding, let obj = {
num:item.num, sku_coding:item.sku.coding,
num:item.num,
}
newList.push(obj);
} }
newList.push(obj);
}) })
let params = { let params = {
sku_list:newList sku_list:newList
@ -197,6 +215,7 @@
url:'/pagesB/confirm-order/confirm-order' url:'/pagesB/confirm-order/confirm-order'
}) })
uni.setStorageSync('orderInfo',res.data); uni.setStorageSync('orderInfo',res.data);
uni.setStorageSync('skuList',params.sku_list);
} }
}) })
} else { } else {
@ -234,7 +253,7 @@
// //
goDetail(id){ goDetail(id){
uni.navigateTo({ uni.navigateTo({
url:'/pagesB/shop-detail/shop-detail' url:`/pagesB/shop-detail/shop-detail?id=${id}`
}) })
}, },
// //

View File

@ -20,7 +20,7 @@
<view class="mar-x10">{{item.sku_name}}</view> <view class="mar-x10">{{item.sku_name}}</view>
<view class=" disjbac"> <view class=" disjbac">
<view class="">{{item.price}}</view> <view class="">{{item.price}}</view>
<view style="letter-spacing: 6rpx;">X{{item.num}}</view> <view>X <span class="mar-z6">{{item.num}}</span></view>
</view> </view>
</view> </view>
</view> </view>
@ -28,24 +28,24 @@
<view class="bbot pad-sx30"> <view class="bbot pad-sx30">
<view class="disjbac"> <view class="disjbac">
<view class="">商品金额</view> <view class="">商品金额</view>
<view class="">{{orderInfo.original_total}}</view> <view class="">{{$toolAll.tools.addXiaoShu(orderInfo.original_total*1)}}</view>
</view> </view>
<view class="disjbac mar-s30"> <view class="disjbac mar-s30">
<view class="">优惠券抵扣</view> <view class="">优惠券抵扣</view>
<view class="disjbac col-e42417">-10.00 <view class="icon icon-next fon28 mar-z10" style="color: #777777;"></view></view> <view class="disjbac col-e42417">-{{couponInfo.coupon_price}} <view class="icon icon-next fon28 mar-z10" style="color: #777777;"></view></view>
</view> </view>
<view class="disjbac mar-s30"> <view class="disjbac mar-s30">
<view class="">积分抵扣</view> <view class="">积分抵扣</view>
<view class="disjbac col-e42417">-10.00 <view class="icon icon-next fon28 mar-z10" style="color: #777777;"></view></view> <view class="disjbac col-e42417">-{{score}} <view class="icon icon-next fon28 mar-z10" style="color: #777777;"></view></view>
</view> </view>
</view> </view>
<view class="disje pad-s30 pad-x10 pad-y30"> <view class="disje pad-s30 pad-x10 pad-y30">
合计1168.00 合计{{realityPrice}}
</view> </view>
</view> </view>
<!-- 立即购买 --> <!-- 立即购买 -->
<view class="posixzy bacf pad-sx20 disjbac pad-zy30 boxshowt"> <view class="posixzy bacf pad-sx20 disjbac pad-zy30 boxshowt">
<view class="fon24">合计<span class="col-e42417 fon34 bold">189.00</span></view> <view class="fon24">合计<span class="col-e42417 fon34 bold">{{realityPrice}}</span></view>
<view @tap="goPay" class="fon24 colf radius32 disjcac" style="background-color: #f37617;width: 184rpx;height: 64rpx;">去支付</view> <view @tap="goPay" class="fon24 colf radius32 disjcac" style="background-color: #f37617;width: 184rpx;height: 64rpx;">去支付</view>
</view> </view>
</view> </view>
@ -62,7 +62,12 @@
return { return {
addressInfo:'', addressInfo:'',
orderInfo:'', orderInfo:'',
flag:true flag:true,
couponInfo:{
coupon_id:'',//ID
coupon_price:0//
},
score:0
} }
}, },
onShow() { onShow() {
@ -71,6 +76,22 @@
onLoad() { onLoad() {
this.getAddress(); this.getAddress();
}, },
computed:{
realityPrice(){
let newPrice = 0;
if(this.orderInfo){
this.orderInfo.list.forEach(item=>{
let tempprice = this.$toolAll.tools.operationEv(item.price,item.num,'*',2)
newPrice = this.$toolAll.tools.operationEv(tempprice,newPrice,'+',2);
})
}
//
newPrice = this.$toolAll.tools.operationEv(newPrice,this.couponInfo.coupon_price,'-',2);
//
newPrice = this.$toolAll.tools.operationEv(newPrice,this.score,'-',2);
return newPrice;
}
},
methods: { methods: {
// //
getAddress(){ getAddress(){
@ -94,6 +115,49 @@
if(this.flag){ if(this.flag){
this.flag = false; this.flag = false;
this.$toolAll.tools.showToast('正在调起支付...'); this.$toolAll.tools.showToast('正在调起支付...');
let params = {
sku_list:uni.getStorageSync('skuList'),
total:this.realityPrice,// 使
express_code:'',
freight:0,//
...this.couponInfo,
address_id:this.addressInfo.id,//ID
type:'spu',// spu= course=
score:0,//使
score_deduct_price:0//
}
this.$requst.post('/api/order/create',params).then(res=>{
if(res.code==0){
let info = res.data;
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:info.coding}).then(res=>{
if(res.code==0){
this.$toolAll.tools.showToast('支付成功(*^▽^*)');
setTimeout(()=>{
uni.navigateTo({
url:'/pagesA/my-order/my-order'
})
},1000)
} else this.$toolAll.tools.showToast(res.msg);
})
},
fail:()=> {
this.$toolAll.tools.showToast('支付已取消o(╥﹏╥)o');
},
complete:()=> {
this.flag = true;
}
});
}
})
} }
} }
} }

View File

@ -26,7 +26,7 @@
<view class="disjcac pad-sx40"> <view class="disjcac pad-sx40">
<view class="disjcac fon28 radius34" <view class="disjcac fon28 radius34"
style="width: 290rpx;height: 68rpx;border: 2rpx solid #e42417;color: #e42417;" style="width: 290rpx;height: 68rpx;border: 2rpx solid #e42417;color: #e42417;"
@tap="$toolAll.tools.goPage('/pagesB/buy-now/buy-now')">立即购买</view> @tap="goBuy">立即购买</view>
</view> </view>
</view> </view>
<view class="pad-zy20"> <view class="pad-zy20">
@ -67,29 +67,53 @@
classId:'', //id classId:'', //id
id:'', //id id:'', //id
page:1, // page:1, //
size:6, // size:1000, //
courseList:[]
} }
}, },
onLoad(op) { onLoad(op) {
if(op.category_id){
this.classId = op.category_id
}
if(op.id){ if(op.id){
this.id = op.id; this.id = op.id;
this.classId = op.category_id
// //
this.getCouresDetail(op.id); this.getCouresDetail(op.id);
} }
}, },
onShareAppMessage(res) {
var shareObj = {
     title: ``, // (slogan)
     path: `/pagesB/course-detail/course-detail?id=${this.id}&category_id=${this.classId}&is_activity=${this.detailObj.is_activity==0 ? 0 : 1}&invite_code=${uni.getStorageSync('invite_code')}`, // /
     imageUrl: ``//PNGJPG imageUrl 使 5:4
  };
  return shareObj;
},
onShow() {
uni.removeStorageSync('courseInfo');
uni.removeStorageSync('skuList');
},
methods: { methods: {
// //
getCouresDetail(id){ getCouresDetail(id){
uni.showLoading({ uni.showLoading({
title:'加载中' title:'加载中'
}); });
this.$requst.get('/api/spu/detail',{id:id}).then(res=>{ this.$requst.get('/api/spu/detail',{id}).then(res=>{
console.log(res,'课程详情') console.log(res,'课程详情')
if(res.code==0) { if(res.code==0) {
this.couresDetail = res.data.detail; this.couresDetail = res.data.detail;
//
this.$requst.get('/api/spu/spec',{id}).then(resspec=>{
if(resspec.code==0){
this.courseList.push({
sku_list:[
{
sku_coding:resspec.data.sku.coding,
num:1,
}
]
})
}
})
// //
this.getCouresRecommend(); this.getCouresRecommend();
} }
@ -97,7 +121,21 @@
this.isLoading = true; this.isLoading = true;
}) })
}, },
//
goBuy(){
let params = {
sku_list:this.courseList[0].sku_list
};
this.$requst.post('/api/order/prepare-info',params).then(res=>{
if(res.code==0){
uni.setStorageSync('courseInfo',res.data);
uni.setStorageSync('skuList',params.sku_list);
uni.navigateTo({
url:'/pagesB/buy-now/buy-now'
})
}
})
},
// //
getCouresRecommend(){ getCouresRecommend(){
let params = { let params = {

View File

@ -40,7 +40,8 @@
}, },
onLoad(op) { onLoad(op) {
this.currentIndex = op.current; // this.currentIndex = op.current;
this.currentIndex = 0;
uni.getStorageSync('videoList').forEach(item=>{ uni.getStorageSync('videoList').forEach(item=>{
let obj = { let obj = {
...item, ...item,

View File

@ -4,7 +4,7 @@
<view slot="content" style="margin-top: -20rpx;"> <view slot="content" style="margin-top: -20rpx;">
<view class="bacf pad-zy20 boxshow2"> <view class="bacf pad-zy20 boxshow2">
<view class="disjcac pad-sx30 bbot"> <view class="disjcac pad-sx30 bbot">
<image src="https://s6.jpg.cm/2022/02/14/L4oDhy.jpg" mode="aspectFill" style="width: 242rpx;height: 242rpx;" lazy-load></image> <image :src="personCode" mode="aspectFill" style="width: 242rpx;height: 242rpx;" lazy-load></image>
</view> </view>
<view class="disjbac fon24 col26 pad-sx20 pad-zy10"> <view class="disjbac fon24 col26 pad-sx20 pad-zy10">
<view class="">代理登记</view> <view class="">代理登记</view>
@ -30,7 +30,9 @@
</view> </view>
</view> </view>
</view> </view>
<pitera textStr="上滑加载更多/到底了~~" textColor="#b0aaa9" paddingStr="40rpx 0 20rpx 0"></pitera> <view class="" v-if="noMore">
<pitera textStr="上滑加载更多/到底了~~" textColor="#b0aaa9" paddingStr="40rpx 0 20rpx 0"></pitera>
</view>
</view> </view>
</status-container> </status-container>
</view> </view>
@ -44,11 +46,44 @@
}, },
data() { data() {
return { return {
dataList:[],
page:1,
size:20,
total:0,
noMore:false,
personCode:'',
loading:false
}
},
onLoad() {
this.personCode = uni.getStorageSync('personCode');
this.getExtend();
},
onReachBottom() {
if(this.total!=this.dataList.lenght){
this.page++;
this.getExtend();
} }
}, },
methods: { methods: {
// 广
getExtend(){
let params = {
grade:'second',
page:this.page,
size:this.size
}
this.$requst.get('/api/user/share-users',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;
}
}
})
}
} }
} }
</script> </script>

View File

@ -80,6 +80,8 @@
// banner // banner
this.$store.commit('setAutoplay',true); this.$store.commit('setAutoplay',true);
uni.removeStorageSync('addressInfo'); uni.removeStorageSync('addressInfo');
uni.removeStorageSync('orderInfo');
uni.removeStorageSync('skuList');
}, },
onHide() { onHide() {
// banner // banner
@ -178,6 +180,7 @@
url:'/pagesB/confirm-order/confirm-order' url:'/pagesB/confirm-order/confirm-order'
}) })
uni.setStorageSync('orderInfo',res.data); uni.setStorageSync('orderInfo',res.data);
uni.setStorageSync('skuList',params.sku_list);
} }
}) })
}, },