分佣:user_cash 迁移
parent
34d222dc36
commit
50fcef07ee
|
|
@ -1,5 +1,10 @@
|
||||||
import request from "@/utils/request.js";
|
import request from "@/utils/request.js";
|
||||||
|
|
||||||
|
// 获得个人分销信息
|
||||||
|
export function getBrokerageUser() {
|
||||||
|
return request.get('app-api/trade/brokerage-user/get');
|
||||||
|
}
|
||||||
|
|
||||||
// 获得个人分销统计
|
// 获得个人分销统计
|
||||||
export function getBrokerageUserSummary() {
|
export function getBrokerageUserSummary() {
|
||||||
return request.get('app-api/trade/brokerage-user/get-summary');
|
return request.get('app-api/trade/brokerage-user/get-summary');
|
||||||
|
|
@ -30,6 +35,11 @@ export function getBrokerageWithdrawPage(data) {
|
||||||
return request.get('app-api/trade/brokerage-withdraw/page', data);
|
return request.get('app-api/trade/brokerage-withdraw/page', data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 创建分销提现
|
||||||
|
export function createBrokerageWithdraw(data) {
|
||||||
|
return request.post('app-api/trade/brokerage-withdraw/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
// 获得分销记录分页
|
// 获得分销记录分页
|
||||||
export function getBrokerageRecordPage(data) {
|
export function getBrokerageRecordPage(data) {
|
||||||
return request.get('app-api/trade/brokerage-record/page', data);
|
return request.get('app-api/trade/brokerage-record/page', data);
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
let domain = 'http://apif.java.crmeb.net'
|
// let domain = 'http://apif.java.crmeb.net'
|
||||||
// let domain = 'http://127.0.0.1:48080'
|
let domain = 'http://127.0.0.1:48080'
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
// 请求域名 格式: https://您的域名
|
// 请求域名 格式: https://您的域名
|
||||||
|
|
|
||||||
|
|
@ -316,7 +316,7 @@
|
||||||
getUserInfo(data) {
|
getUserInfo(data) {
|
||||||
this.$store.commit("SETUID", data.userId);
|
this.$store.commit("SETUID", data.userId);
|
||||||
// TODO 芋艿:换成自己的先
|
// TODO 芋艿:换成自己的先
|
||||||
if (false) {
|
if (true) {
|
||||||
UserApi.getUserInfo().then(res => {
|
UserApi.getUserInfo().then(res => {
|
||||||
this.$store.commit("UPDATE_USERINFO", res.data);
|
this.$store.commit("UPDATE_USERINFO", res.data);
|
||||||
// 调回登录前页面
|
// 调回登录前页面
|
||||||
|
|
|
||||||
|
|
@ -33,10 +33,10 @@
|
||||||
<view class='input'><input :placeholder='"最低提现金额"+minPrice' placeholder-class='placeholder' name="money" type='digit'></input></view>
|
<view class='input'><input :placeholder='"最低提现金额"+minPrice' placeholder-class='placeholder' name="money" type='digit'></input></view>
|
||||||
</view>
|
</view>
|
||||||
<view class='tip'>
|
<view class='tip'>
|
||||||
当前可提现金额: <text class="price">¥{{commission.commissionCount}},</text>冻结佣金:¥{{commission.brokenCommission}}
|
当前可提现金额: <text class="price">¥{{ fen2yuan(commission.brokeragePrice) }},</text>冻结佣金:¥{{ fen2yuan(commission.frozenBrokeragePrice) }}
|
||||||
</view>
|
</view>
|
||||||
<view class='tip'>
|
<view class='tip'>
|
||||||
说明: 每笔佣金的冻结期为{{commission.brokenDay}}天,到期后可提现
|
说明: 每笔佣金的冻结期为{{frozenDays}}天,到期后可提现
|
||||||
</view>
|
</view>
|
||||||
<button formType="submit" class='bnt bg-color'>提现</button>
|
<button formType="submit" class='bnt bg-color'>提现</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
@ -49,7 +49,7 @@
|
||||||
</view>
|
</view>
|
||||||
<view class='item acea-row row-between-wrapper'>
|
<view class='item acea-row row-between-wrapper'>
|
||||||
<view class='name'>提现</view>
|
<view class='name'>提现</view>
|
||||||
<view class='input'><input :placeholder='"最低提现金额"+minPrice' placeholder-class='placeholder' name="money" type='digit'></input></view>
|
<view class='input'><input :placeholder='"最低提现金额" + minPrice' placeholder-class='placeholder' name="money" type='digit'></input></view>
|
||||||
</view>
|
</view>
|
||||||
<view class='item acea-row row-top row-between'>
|
<view class='item acea-row row-top row-between'>
|
||||||
<view class='name'>收款码</view>
|
<view class='name'>收款码</view>
|
||||||
|
|
@ -65,10 +65,10 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class='tip'>
|
<view class='tip'>
|
||||||
当前可提现金额: <text class="price">¥{{commission.commissionCount}},</text>冻结佣金:¥{{commission.brokenCommission}}
|
当前可提现金额: <text class="price">¥{{ fen2yuan(commission.brokeragePrice) }},</text>冻结佣金:¥{{ fen2yuan(commission.frozenBrokeragePrice) }}
|
||||||
</view>
|
</view>
|
||||||
<view class='tip'>
|
<view class='tip'>
|
||||||
说明: 每笔佣金的冻结期为{{commission.brokenDay}}天,到期后可提现
|
说明: 每笔佣金的冻结期为{{frozenDays}}天,到期后可提现
|
||||||
</view>
|
</view>
|
||||||
<button formType="submit" class='bnt bg-color'>提现</button>
|
<button formType="submit" class='bnt bg-color'>提现</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
@ -97,43 +97,26 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class='tip'>
|
<view class='tip'>
|
||||||
当前可提现金额: <text class="price">¥{{commission.commissionCount}},</text>冻结佣金:¥{{commission.brokenCommission}}
|
当前可提现金额: <text class="price">¥{{ fen2yuan(commission.brokeragePrice) }},</text>冻结佣金:¥{{ fen2yuan(commission.frozenBrokeragePrice) }}
|
||||||
</view>
|
</view>
|
||||||
<view class='tip'>
|
<view class='tip'>
|
||||||
说明: 每笔佣金的冻结期为{{commission.brokenDay}}天,到期后可提现
|
说明: 每笔佣金的冻结期为{{frozenDays}}天,到期后可提现
|
||||||
</view>
|
</view>
|
||||||
<button formType="submit" class='bnt bg-color'>提现</button>
|
<button formType="submit" class='bnt bg-color'>提现</button>
|
||||||
</form>
|
</form>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- #ifdef MP -->
|
|
||||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
|
||||||
<!-- #endif -->
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {
|
import { extractBank } from '@/api/user.js';
|
||||||
extractCash,
|
import { toLogin } from '@/libs/login.js';
|
||||||
extractBank,
|
import { mapGetters } from "vuex";
|
||||||
extractUser
|
import * as TradeConfigApi from '@/api/trade/config.js';
|
||||||
} from '@/api/user.js';
|
import * as BrokerageAPI from '@/api/trade/brokerage.js'
|
||||||
import {
|
import * as Util from '@/utils/util.js';
|
||||||
toLogin
|
export default {
|
||||||
} from '@/libs/login.js';
|
|
||||||
import {
|
|
||||||
mapGetters
|
|
||||||
} from "vuex";
|
|
||||||
// #ifdef MP
|
|
||||||
import authorize from '@/components/Authorize';
|
|
||||||
// #endif
|
|
||||||
export default {
|
|
||||||
components: {
|
|
||||||
// #ifdef MP
|
|
||||||
authorize
|
|
||||||
// #endif
|
|
||||||
},
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
navList: [{
|
navList: [{
|
||||||
|
|
@ -151,22 +134,20 @@
|
||||||
],
|
],
|
||||||
currentTab: 0,
|
currentTab: 0,
|
||||||
index: 0,
|
index: 0,
|
||||||
array: [], //提现银行
|
array: [], // 提现银行
|
||||||
minPrice: 0.00, //最低提现金额
|
minPrice: 0.00, // 最低提现金额
|
||||||
userInfo: [],
|
frozenDays: 0, // 佣金冻结期
|
||||||
isClone: false,
|
isClone: false,
|
||||||
isAuto: false, //没有授权的不会自动授权
|
commission: {}, // 分销信息
|
||||||
isShowAuth: false, //是否隐藏授权
|
|
||||||
commission:{},
|
|
||||||
qrcodeUrlW:"",
|
qrcodeUrlW:"",
|
||||||
qrcodeUrlZ:"",
|
qrcodeUrlZ:"",
|
||||||
isCommitted: false //防止多次提交
|
isCommitted: false // 防止多次提交
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: mapGetters(['isLogin']),
|
computed: mapGetters(['isLogin']),
|
||||||
watch:{
|
watch:{
|
||||||
isLogin:{
|
isLogin:{
|
||||||
handler:function(newV,oldV){
|
handler: function(newV,oldV) {
|
||||||
if(newV){
|
if(newV){
|
||||||
this.getUserExtractBank();
|
this.getUserExtractBank();
|
||||||
this.getExtractUser();
|
this.getExtractUser();
|
||||||
|
|
@ -176,32 +157,26 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
if (this.isLogin) {
|
if (!this.isLogin) {
|
||||||
this.getUserExtractBank();
|
toLogin();
|
||||||
this.getExtractUser();
|
return;
|
||||||
} else {
|
|
||||||
toLogin();
|
|
||||||
}
|
}
|
||||||
|
// this.getUserExtractBank();
|
||||||
|
this.getExtractUser();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
uploadpic: function (type) {
|
uploadpic: function (type) {
|
||||||
let that = this;
|
this.$util.uploadImageOne({}, res => {
|
||||||
that.$util.uploadImageOne({
|
this.newAvatar = res.data;
|
||||||
url: 'user/upload/image',
|
if (type === 'W') {
|
||||||
name: 'multipart',
|
this.qrcodeUrlW = res.data;
|
||||||
model: "user",
|
} else {
|
||||||
pid: 1
|
this.qrcodeUrlZ = res.data;
|
||||||
}, function(res) {
|
}
|
||||||
if(type==='W'){
|
});
|
||||||
that.qrcodeUrlW = res.data.url;
|
|
||||||
}else{
|
|
||||||
that.qrcodeUrlZ = res.data.url;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 删除图片
|
* 删除图片
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
DelPicW: function () {
|
DelPicW: function () {
|
||||||
this.qrcodeUrlW = "";
|
this.qrcodeUrlW = "";
|
||||||
|
|
@ -209,20 +184,17 @@
|
||||||
DelPicZ: function () {
|
DelPicZ: function () {
|
||||||
this.qrcodeUrlZ = "";
|
this.qrcodeUrlZ = "";
|
||||||
},
|
},
|
||||||
onLoadFun: function() {
|
|
||||||
this.getUserExtractBank();
|
|
||||||
},
|
|
||||||
getExtractUser(){
|
getExtractUser(){
|
||||||
extractUser().then(res=>{
|
BrokerageAPI.getBrokerageUser().then(res=>{
|
||||||
this.commission = res.data;
|
this.commission = res.data;
|
||||||
this.minPrice = res.data.minPrice;
|
|
||||||
})
|
})
|
||||||
},
|
TradeConfigApi.getTradeConfig().then(res => {
|
||||||
// 授权关闭
|
this.minPrice = (res.data.brokerageWithdrawMinPrice || 0) / 100.0;
|
||||||
authColse: function(e) {
|
this.frozenDays = res.data.brokerageWithdrawMinPrice || 0;
|
||||||
this.isShowAuth = e
|
});
|
||||||
},
|
},
|
||||||
getUserExtractBank: function() {
|
getUserExtractBank: function() {
|
||||||
|
// TODO 芋艿:这里要搞个银行的列表;通过数据字典;
|
||||||
let that = this;
|
let that = this;
|
||||||
extractBank().then(res => {
|
extractBank().then(res => {
|
||||||
let array = res.data;
|
let array = res.data;
|
||||||
|
|
@ -238,68 +210,89 @@
|
||||||
},
|
},
|
||||||
moneyInput(e) {
|
moneyInput(e) {
|
||||||
//正则表达试
|
//正则表达试
|
||||||
e.target.value = (e.target.value.match(/^\d*(\.?\d{0,2})/g)[0]) || null
|
e.target.value = (e.target.value.match(/^\d*(\.?\d{0,2})/g)[0]) || null
|
||||||
//重新赋值给input
|
//重新赋值给input
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.money= e.target.value
|
this.money= e.target.value
|
||||||
})
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
subCash: function(e) {
|
subCash: function(e) {
|
||||||
let that = this,
|
let that = this,
|
||||||
value = e.detail.value;
|
value = e.detail.value;
|
||||||
if (that.currentTab == 0) { //银行卡
|
const form = {};
|
||||||
if (value.name.length == 0) return this.$util.Tips({
|
if (this.currentTab === 0) { // 银行卡
|
||||||
title: '请填写持卡人姓名'
|
form.type = 2;
|
||||||
});
|
if (value.name.length === 0) {
|
||||||
if (value.cardum.length == 0) return this.$util.Tips({
|
return this.$util.Tips({
|
||||||
title: '请填写卡号'
|
title: '请填写持卡人姓名'
|
||||||
});
|
});
|
||||||
if (that.index == 0) return this.$util.Tips({
|
}
|
||||||
title: "请选择银行"
|
if (value.cardum.length === 0) {
|
||||||
});
|
return this.$util.Tips({
|
||||||
value.extractType = 'bank';
|
title: '请填写卡号'
|
||||||
value.bankName = that.array[that.index];
|
});
|
||||||
} else if (that.currentTab == 1) { //微信
|
}
|
||||||
value.extractType = 'weixin';
|
if (that.index === 0) {
|
||||||
if (value.name.length == 0) return this.$util.Tips({
|
return this.$util.Tips({
|
||||||
title: '请填写微信号'
|
title: "请选择银行"
|
||||||
});
|
});
|
||||||
value.wechat = value.name;
|
}
|
||||||
value.qrcodeUrl = that.qrcodeUrlW;
|
// TODO 芋艿:整列要搞成字典;
|
||||||
} else if (that.currentTab == 2) { //支付宝
|
form.name = value.name;
|
||||||
value.extractType = 'alipay';
|
form.bankName = that.array[that.index];
|
||||||
if (value.name.length == 0) return this.$util.Tips({
|
} else if (that.currentTab === 1) { // 微信
|
||||||
title: '请填写账号'
|
form.type = 3;
|
||||||
});
|
if (value.name.length === 0) {
|
||||||
value.alipayCode = value.name;
|
return this.$util.Tips({
|
||||||
value.qrcodeUrl = that.qrcodeUrlZ;
|
title: '请填写微信号'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
form.accountNo = value.name;
|
||||||
|
form.accountQrCodeUrl = this.qrcodeUrlW;
|
||||||
|
} else if (that.currentTab === 2) { // 支付宝
|
||||||
|
form.type = 4;
|
||||||
|
if (value.name.length === 0) {
|
||||||
|
return this.$util.Tips({
|
||||||
|
title: '请填写账号'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
form.accountNo = value.name;
|
||||||
|
form.accountQrCodeUrl = this.qrcodeUrlZ;
|
||||||
}
|
}
|
||||||
if (value.money.length == 0) return this.$util.Tips({
|
if (value.money.length === 0) {
|
||||||
title: '请填写提现金额'
|
return this.$util.Tips({
|
||||||
});
|
title: '请填写提现金额'
|
||||||
if (!(/^(\d?)+(\.\d{0,2})?$/.test(value.money))) return this.$util.Tips({
|
});
|
||||||
title: '提现金额保留2位小数'
|
}
|
||||||
});
|
if (!(/^(\d?)+(\.\d{0,2})?$/.test(value.money))) {
|
||||||
if (value.money < that.minPrice) return this.$util.Tips({
|
return this.$util.Tips({
|
||||||
title: '提现金额不能低于' + that.minPrice
|
title: '提现金额保留2位小数'
|
||||||
});
|
});
|
||||||
if(this.isCommitted==false){
|
}
|
||||||
this.isCommitted=true;
|
if (value.money < that.minPrice) {
|
||||||
extractCash(value).then(res => {
|
return this.$util.Tips({
|
||||||
return this.$util.Tips({
|
title: '提现金额不能低于' + that.minPrice
|
||||||
title: "提现成功",
|
});
|
||||||
icon: 'success'
|
}
|
||||||
},{ tab: 2, url: '/pages/users/user_spread_user/index' });
|
form.price = value.money * 100;
|
||||||
this.isCommitted=false;
|
if (this.isCommitted === false){
|
||||||
|
this.isCommitted=true;
|
||||||
|
BrokerageAPI.createBrokerageWithdraw(form).then(res => {
|
||||||
|
return this.$util.Tips({
|
||||||
|
title: "提现成功",
|
||||||
|
icon: 'success'
|
||||||
|
},{ tab: 2, url: '/pages/users/user_spread_user/index' });
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
this.isCommitted=false;
|
this.isCommitted=false;
|
||||||
return this.$util.Tips({
|
return this.$util.Tips({
|
||||||
title: err
|
title: err
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
fen2yuan(price) {
|
||||||
|
return Util.fen2yuan(price)
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue