Browse Source

钱包余额 佣金记录 提取记录接口(提取记录接口待后端优化)

twodate
Enzo 4 years ago
parent
commit
9088bfd6af
  1. 2
      common/api.js
  2. 6
      pages/center/invite.vue
  3. 98
      pages/center/wallet.vue

2
common/api.js

@ -58,6 +58,8 @@ export const API_WECHAT_SETPROFILE = '/api/wechat/setProfile'; // 用户授权
export const API_WXLOGIN_VIEW = '/api/wxlogin/view'; // 获取登录页协议
export const API_ARTICLE_DETAIL = '/api/article/detail'; // 协议文章详情
export const API_WXCODE = '/api/salesman/qrcode'//小程序二维码
export const API_INCOMELIST = '/api/salesman/income'//获取佣金记录
export const API_EXTRACTLIST = '/api/salesman/extract'//获取提取记录
/* 商户相关 */
export const API_CONFIRM_CODE = '/api/confirm/code'; // 扫码核销

6
pages/center/invite.vue

@ -118,15 +118,13 @@
that.canvasHidden = true
that.maskHidden = true
}
console.log('海报生成成功')
console.log(res)
console.log('图片链接', that.imagePath)
console.log('海报生成成功,图片链接', that.imagePath)
},
fail: function(res) {
console.log(res);
}
});
}, 900);
},800);
},
saveBill() {
var that = this

98
pages/center/wallet.vue

@ -3,7 +3,7 @@
<!-- 钱包余额信息 -->
<view class="wallet-top">
<view class="bg-white wallet-wraptop flex-direction flex justify-around align-center text-center">
<view class="text-black1 text-price1" style="font-size: 72rpx;">2000.48</view>
<view class="text-black1 text-price1" style="font-size: 72rpx;">{{walletBalance}}</view>
<view class="text-gray lf-font-24 lf-m-b-20">佣金</view>
<view>
<button class="btn" @click="$url('/pages/center/widthdraw')">提取佣金</button>
@ -14,7 +14,7 @@
<view class="bg-white lf-p-t-40 lf-p-b-40 flex justify-around align-center text-center solid-bottom">
<view class="tab-item" :class="current==index?'text-orange':'text-black1'"
v-for="(item, index) in tab_list" :key="index"
@click="current = index">{{ item.name }}
@click="changeTab(index)">{{ item.name }}
</view>
</view>
<!-- scroll page -->
@ -24,14 +24,14 @@
:refresher-triggered="isRefresher"
@scrolltolower="onScrolltolower"
@refresherrefresh="onRefresherrefresh">
<view class="flex flex-direction justify-between lf-p-t-20 lf-p-b-20 lf-p-l-32 lf-p-r-32 solid-bottom" v-for="item in 12" :key="item">
<view class="flex flex-direction justify-between lf-p-t-20 lf-p-b-20 lf-p-l-32 lf-p-r-32 solid-bottom" v-for="(item, index) in tab_list[current].list" :key="item">
<view class="flex align-center text-center justify-between">
<view class="lf-font-36 lf-color-price">-¥10.00</view>
<view class="lf-font-32 text-black1">结余 ¥34.43</view>
<view class="lf-font-36 lf-color-price">+¥{{item.add_price}}</view>
<view class="lf-font-32 text-black1">结余 ¥{{item.final_price}}</view>
</view>
<view class="flex align-center text-center justify-between lf-m-t-10">
<view class="lf-font-24 lf-color-999">内部粉丝购买商品获得</view>
<view class="lf-font-24 lf-color-999">2021-7-6 22:32:43</view>
<view class="lf-font-24 lf-color-999">{{item.reffer}}</view>
<view class="lf-font-24 lf-color-999">{{item.created_at}}</view>
</view>
</view>
<!-- 空数据的情况 -->
@ -48,14 +48,14 @@
:refresher-triggered="isRefresher"
@scrolltolower="onScrolltolower"
@refresherrefresh="onRefresherrefresh">
<view class="flex flex-direction justify-between lf-p-t-20 lf-p-b-20 lf-p-l-32 lf-p-r-32 solid-bottom">
<view class="flex flex-direction justify-between lf-p-t-20 lf-p-b-20 lf-p-l-32 lf-p-r-32 solid-bottom" v-for="(item, index) in tab_list[current].list" :key="item">
<view class="flex align-center text-center justify-between">
<view class="lf-font-36 lf-color-price">-¥11.00</view>
<view class="lf-font-28 text-orange">申请中</view>
<view class="lf-font-36 lf-color-price">+¥{{item.extract_price}}</view>
<view class="lf-font-28 text-orange">{{item.state}}</view>
</view>
<view class="flex align-center text-center justify-between lf-m-t-10">
<view class="lf-font-24 lf-color-999">流水号 638763485895875</view>
<view class="lf-font-24 lf-color-999">2021-7-6 22:32:43</view>
<view class="lf-font-24 lf-color-999">流水号 {{item.order_no}}</view>
<view class="lf-font-24 lf-color-999">{{item.created_at}}</view>
</view>
</view>
<!-- 空数据的情况 -->
@ -77,37 +77,99 @@
isRefresher: false, // scroll-view
tab_list: [{
name: '佣金记录',
list: [1,2,3,4,5,6,7,8,9],
list: [],
page: 1,
isPage: false,
loadingClass: false,
loadingText: '已加载全部数据'
},{
name: '提取记录',
list: [1],
list: [],
page: 1,
isPage: false,
loadingClass: true,
loadingText: '正在加载中'
}],
windowHeight: 0
windowHeight: 0,
walletBalance: 0
}
},
onLoad(){
this.windowHeight = uni.getSystemInfoSync().windowHeight;
this.getIncomeList()
},
methods: {
changeTab(index) {
if(this.current == index) {
return
}else {
this.current = index
if(index == 0) {
this.getIncomeList()
}else {
this.getWidthList()
}
}
},
//
getWidthList() {
let per_page = this.pageSize;
let tab_item = this.tab_list[this.current];
this.$http(this.API.API_EXTRACTLIST, {
page: tab_item.page,
limit: per_page
}).then(res => {
this.isRefresher = false;
let isPage = res.data.has_more_page;
tab_item.isPage = isPage;
if(!isPage){
tab_item.loadingClass = false;
tab_item.loadingText = '没有更多数据啦~';
}
if(tab_item.page == 1){
tab_item.list = res.data.items;
}else{
tab_item.list.push(...res.data.items);
}
})
},
//
getIncomeList() {
let per_page = this.pageSize;
let tab_item = this.tab_list[this.current];
this.$http(this.API.API_INCOMELIST, {
page: tab_item.page,
limit: per_page
}).then(res => {
this.isRefresher = false;
this.walletBalance = res.data.income
let isPage = res.data.has_more_page;
tab_item.isPage = isPage;
if(!isPage){
tab_item.loadingClass = false;
tab_item.loadingText = '没有更多数据啦~';
}
if(tab_item.page == 1){
tab_item.list = res.data.items;
}else{
tab_item.list.push(...res.data.items);
}
})
},
//
onScrolltolower(){
let tab_item = this.tab_list[this.current];
if(tab_item.isPage){
tab_item.page = tab_item.page + 1;
this.getIncomeList()
}
console.log('加载下一页')
},
// scroll-view
onRefresherrefresh(){
this.isRefresher = true;
console.log('下拉刷新')
setTimeout(() => {
this.isRefresher = false;
},1000)
this.getIncomeList()
}
}
}

Loading…
Cancel
Save