分佣:user_spread_money 迁移
parent
9acaf3c27c
commit
c8db068547
|
@ -4,3 +4,13 @@ import request from "@/utils/request.js";
|
||||||
export function getBrokerageUserSummary() {
|
export function getBrokerageUserSummary() {
|
||||||
return request.get('app-api/member/brokerage-user/get-summary');
|
return request.get('app-api/member/brokerage-user/get-summary');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获得分销提现分页记录
|
||||||
|
export function getBrokerageWithdrawPage(data) {
|
||||||
|
return request.get('app-api/member/brokerage-withdraw/page', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获得分销记录分页
|
||||||
|
export function getBrokerageRecordPage(data) {
|
||||||
|
return request.get('app-api/member/brokerage-record/page', data);
|
||||||
|
}
|
||||||
|
|
|
@ -5,69 +5,57 @@
|
||||||
<view class='headerCon acea-row row-between-wrapper'>
|
<view class='headerCon acea-row row-between-wrapper'>
|
||||||
<view>
|
<view>
|
||||||
<view class='name'>{{name}}</view>
|
<view class='name'>{{name}}</view>
|
||||||
<view class='money' v-if="recordType == 4">¥<text class='num'>{{extractCount}}</text></view>
|
<view class='money' v-if="type === 1">¥<text class='num'>{{ fen2yuan(spreadInfo.withdrawBrokeragePrice, 0) }}</text></view>
|
||||||
<view class='money' v-else>¥<text class='num'>{{commissionCount}}</text></view>
|
<view class='money' v-else>¥<text class='num'>{{ fen2yuan(spreadInfo.brokeragePrice, 0) }}</text></view>
|
||||||
</view>
|
</view>
|
||||||
<view class='iconfont icon-jinbi1'></view>
|
<view class='iconfont icon-jinbi1'></view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class='sign-record' v-if="recordType == 4">
|
<!-- 情况一:提现列表 -->
|
||||||
<block v-for="(item,index) in recordList" :key="index" v-if="recordList.length>0">
|
<view class='sign-record' v-if="type === 1">
|
||||||
<view class='list pad30'>
|
<block v-for="(item,index) in recordList" :key="index" v-if="recordList.length > 0">
|
||||||
|
<view class='list'>
|
||||||
<view class='item'>
|
<view class='item'>
|
||||||
<view class='data'>{{item.date}}</view>
|
|
||||||
<view class='listn borRadius14'>
|
<view class='listn borRadius14'>
|
||||||
<block v-for="(child,indexn) in item.list" :key="indexn">
|
<block :key="index">
|
||||||
<view class='itemn acea-row row-between-wrapper'>
|
<view class='itemn acea-row row-between-wrapper'>
|
||||||
<view>
|
<view>
|
||||||
<view class='name line1'>{{child.status | statusFilter}}</view>
|
<view class='name line1'>{{ item.statusName }}</view>
|
||||||
<view>{{child.createTime}}</view>
|
<view>{{ formatDate(item.createTime) }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class='num font-color' v-if="child.status == 1">+{{child.extractPrice}}
|
<view class='num font-color'>+{{ fen2yuan(item.price) }}</view>
|
||||||
</view>
|
|
||||||
<view class='num' v-else>-{{child.extractPrice}}</view>
|
|
||||||
<!-- <view>
|
|
||||||
<view class='name line1'>{{child.status === -1 ? '提现失败' : '提现成功'}}<span
|
|
||||||
v-show="child.status === -1"
|
|
||||||
style="font-size: 12px;color: red;">{{'('+child.failMsg+')'}}</span>
|
|
||||||
</view>
|
|
||||||
<view>{{child.createTime}}</view>
|
|
||||||
</view>
|
|
||||||
<view class='num font-color' v-if="child.status == -1">+{{child.extractPrice}}
|
|
||||||
</view>
|
|
||||||
<view class='num' v-else>-{{child.extractPrice}}</view> -->
|
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
<view v-if="recordList.length == 0">
|
<view v-if="recordList.length === 0">
|
||||||
<emptyPage title='暂无提现记录~'></emptyPage>
|
<emptyPage title='暂无提现记录~'></emptyPage>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class='sign-record' v-else>
|
<!-- 情况二:佣金列表 -->
|
||||||
<block v-for="(item,index) in recordList" :key="index" v-if="recordList.length>0">
|
<view class='sign-record' v-else>
|
||||||
<view class='list pad30'>
|
<block v-for="(item,index) in recordList" :key="index" v-if="recordList.length > 0">
|
||||||
|
<view class='list'>
|
||||||
<view class='item'>
|
<view class='item'>
|
||||||
<view class='data'>{{item.date}}</view>
|
|
||||||
<view class='listn borRadius14'>
|
<view class='listn borRadius14'>
|
||||||
<block v-for="(child,indexn) in item.list" :key="indexn">
|
<block :key="index">
|
||||||
<view class='itemn acea-row row-between-wrapper'>
|
<view class='itemn acea-row row-between-wrapper'>
|
||||||
<view>
|
<view>
|
||||||
<view class='name line1'>{{child.title}}</view>
|
<view class='name line1'>{{ item.title }}</view>
|
||||||
<view>{{child.updateTime}}</view>
|
<view>{{ formatDate(item.createTime) }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class='num font-color' v-if="child.type == 1">+{{child.price}}
|
<view class='num font-color' v-if="item.price > 0">+{{item.price}}
|
||||||
</view>
|
</view>
|
||||||
<view class='num' v-else>-{{child.price}}</view>
|
<view class='num' v-else>{{item.price}}</view>
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
<view v-if="recordList.length == 0">
|
<view v-if="recordList.length === 0">
|
||||||
<emptyPage title='暂无佣金记录~'></emptyPage>
|
<emptyPage title='暂无佣金记录~'></emptyPage>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -77,69 +65,54 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getCommissionInfo, getRecordApi } from '@/api/user.js';
|
import { toLogin } from '@/libs/login.js';
|
||||||
import {
|
import { mapGetters } from "vuex";
|
||||||
toLogin
|
|
||||||
} from '@/libs/login.js';
|
|
||||||
import {
|
|
||||||
mapGetters
|
|
||||||
} from "vuex";
|
|
||||||
import emptyPage from '@/components/emptyPage.vue'
|
import emptyPage from '@/components/emptyPage.vue'
|
||||||
import home from '@/components/home';
|
import home from '@/components/home';
|
||||||
export default {
|
import * as BrokerageAPI from '@/api/member/brokerage.js'
|
||||||
|
import * as Util from '@/utils/util.js';
|
||||||
|
import dayjs from "@/plugin/dayjs/dayjs.min.js";
|
||||||
|
export default {
|
||||||
components: {
|
components: {
|
||||||
emptyPage,
|
emptyPage,
|
||||||
home
|
home
|
||||||
},
|
},
|
||||||
filters: {
|
|
||||||
statusFilter(status) {
|
|
||||||
const statusMap = {
|
|
||||||
'-1': '未通过',
|
|
||||||
'0': '审核中',
|
|
||||||
'1': '已提现'
|
|
||||||
}
|
|
||||||
return statusMap[status]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
name: '',
|
name: '', // 标题
|
||||||
type: 0,
|
type: 0, // 类型;1 - 提现;2 - 佣金
|
||||||
page: 1,
|
|
||||||
|
page: 1,
|
||||||
limit: 10,
|
limit: 10,
|
||||||
recordList: [],
|
recordList: [],
|
||||||
recordType: 0,
|
statuss: false, // 是否到达底部
|
||||||
statuss: false,
|
|
||||||
isAuto: false, //没有授权的不会自动授权
|
spreadInfo: {},
|
||||||
isShowAuth: false, //是否隐藏授权
|
};
|
||||||
extractCount: 0
|
|
||||||
};
|
|
||||||
},
|
},
|
||||||
computed: mapGetters(['isLogin']),
|
computed: mapGetters(['isLogin']),
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
if (this.isLogin) {
|
if (!this.isLogin) {
|
||||||
this.type = options.type;
|
toLogin();
|
||||||
this.extractCount = options.extractCount;
|
return;
|
||||||
this.commissionCount = options.commissionCount;
|
}
|
||||||
} else {
|
this.type = parseInt(options.type);
|
||||||
toLogin();
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
onShow: function() {
|
onShow: function() {
|
||||||
|
this.getSpreadInfo();
|
||||||
|
// 获得列表
|
||||||
let type = this.type;
|
let type = this.type;
|
||||||
if (type == 1) {
|
if (type === 1) {
|
||||||
uni.setNavigationBarTitle({
|
uni.setNavigationBarTitle({
|
||||||
title: "提现记录"
|
title: "提现记录"
|
||||||
});
|
});
|
||||||
this.name = '提现总额';
|
this.name = '提现总额';
|
||||||
this.recordType = 4;
|
|
||||||
this.getList();
|
this.getList();
|
||||||
} else if (type == 2) {
|
} else if (type === 2) {
|
||||||
uni.setNavigationBarTitle({
|
uni.setNavigationBarTitle({
|
||||||
title: "佣金记录"
|
title: "佣金记录"
|
||||||
});
|
});
|
||||||
this.name = '佣金明细';
|
this.name = '佣金明细';
|
||||||
this.recordType = 3;
|
|
||||||
this.getRecordList();
|
this.getRecordList();
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
|
@ -157,53 +130,73 @@
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
history.back();
|
history.back();
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
}, 1200)
|
}, 1200)
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
/**
|
||||||
|
* 获得提现列表
|
||||||
|
*/
|
||||||
getList: function() {
|
getList: function() {
|
||||||
let that = this;
|
if (this.statuss) {
|
||||||
let recordList = that.recordList;
|
return;
|
||||||
let recordListNew = [];
|
}
|
||||||
if (that.statuss == true) return;
|
const recordList = this.recordList;
|
||||||
getRecordApi({
|
let recordListNew = [];
|
||||||
page: that.page,
|
BrokerageAPI.getBrokerageWithdrawPage({
|
||||||
limit: that.limit
|
pageNo: this.page,
|
||||||
|
pageSize: this.limit
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
let len = res.data.list ? res.data.list.length : 0;
|
const len = res.data.list ? res.data.list.length : 0;
|
||||||
let recordListData = res.data.list || [];
|
const recordListData = res.data.list || [];
|
||||||
recordListNew = recordList.concat(recordListData);
|
recordListNew = recordList.concat(recordListData);
|
||||||
that.statuss = that.limit > len;
|
this.statuss = this.limit > len;
|
||||||
that.page = that.page + 1;
|
this.page = this.page + 1;
|
||||||
that.$set(that, 'recordList', recordListNew);
|
this.$set(this, 'recordList', recordListNew);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* 获得佣金列表
|
||||||
|
*/
|
||||||
getRecordList: function() {
|
getRecordList: function() {
|
||||||
let that = this;
|
if (this.statuss) {
|
||||||
let page = that.page;
|
return;
|
||||||
let limit = that.limit;
|
}
|
||||||
let statuss = that.statuss;
|
let page = this.page;
|
||||||
let recordList = that.recordList;
|
let limit = this.limit;
|
||||||
let recordListNew = [];
|
let recordList = this.recordList;
|
||||||
if (statuss == true) return;
|
let recordListNew = [];
|
||||||
getCommissionInfo({
|
BrokerageAPI.getBrokerageRecordPage({
|
||||||
page: page,
|
pageNo: this.page,
|
||||||
limit: limit
|
pageSize: this.limit
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res.data.list) {
|
if (!res.data.list) {
|
||||||
let len = res.data.list ? res.data.list.length : 0;
|
return;
|
||||||
let recordListData = res.data.list || [];
|
|
||||||
recordListNew = recordList.concat(recordListData);
|
|
||||||
that.statuss = limit > len;
|
|
||||||
that.page = page + 1;
|
|
||||||
that.$set(that, 'recordList', recordListNew);
|
|
||||||
}
|
}
|
||||||
|
const len = res.data.list ? res.data.list.length : 0;
|
||||||
|
const recordListData = res.data.list || [];
|
||||||
|
recordListNew = recordList.concat(recordListData);
|
||||||
|
this.statuss = limit > len;
|
||||||
|
this.page = page + 1;
|
||||||
|
this.$set(this, 'recordList', recordListNew);
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
|
/**
|
||||||
|
* 获取个人用户信息
|
||||||
|
*/
|
||||||
|
getSpreadInfo: function() {
|
||||||
|
BrokerageAPI.getBrokerageUserSummary().then(res => {
|
||||||
|
this.$set(this,'spreadInfo',res.data);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
fen2yuan(price) {
|
||||||
|
return Util.fen2yuan(price)
|
||||||
|
},
|
||||||
|
formatDate: function(date) {
|
||||||
|
return dayjs(date).format("YYYY-MM-DD HH:mm:ss");
|
||||||
|
},
|
||||||
},
|
},
|
||||||
onReachBottom: function() {
|
onReachBottom: function() {
|
||||||
this.getRecordList();
|
this.getRecordList();
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<view class="header">
|
<view class="header">
|
||||||
<view class='name acea-row row-center-wrapper'>
|
<view class='name acea-row row-center-wrapper'>
|
||||||
<view>当前佣金</view>
|
<view>当前佣金</view>
|
||||||
<navigator :url="'/pages/users/user_spread_money/index?type=1&extractCount='+spreadInfo.extractCount" hover-class="none" class='record'>
|
<navigator url='/pages/users/user_spread_money/index?type=1' hover-class="none" class='record'>
|
||||||
提现记录<text class='iconfont icon-xiangyou'></text>
|
提现记录<text class='iconfont icon-xiangyou'></text>
|
||||||
</navigator>
|
</navigator>
|
||||||
</view>
|
</view>
|
||||||
|
@ -35,7 +35,7 @@
|
||||||
<text class='iconfont icon-tongji'></text>
|
<text class='iconfont icon-tongji'></text>
|
||||||
<view>推广人统计</view>
|
<view>推广人统计</view>
|
||||||
</navigator>
|
</navigator>
|
||||||
<navigator :url="'/pages/users/user_spread_money/index?type=2&commissionCount='+spreadInfo.commissionCount" hover-class="none" class='item acea-row row-center-wrapper row-column'>
|
<navigator url="/pages/users/user_spread_money/index?type=2" hover-class="none" class='item acea-row row-center-wrapper row-column'>
|
||||||
<text class='iconfont icon-qiandai'></text>
|
<text class='iconfont icon-qiandai'></text>
|
||||||
<view>佣金明细</view>
|
<view>佣金明细</view>
|
||||||
</navigator>
|
</navigator>
|
||||||
|
|
Loading…
Reference in New Issue