分佣:user_cash 迁移

pull/1/MERGE
YunaiV 2023-09-07 00:15:00 +08:00
parent 34d222dc36
commit 50fcef07ee
4 changed files with 150 additions and 147 deletions

View File

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

View File

@ -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://您的域名

View File

@ -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);
// //

View File

@ -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>
@ -308,22 +301,22 @@
page { page {
background-color: #fff !important; background-color: #fff !important;
} }
.cash-withdrawal .nav { .cash-withdrawal .nav {
height: 130rpx; height: 130rpx;
box-shadow: 0 10rpx 10rpx #f8f8f8; box-shadow: 0 10rpx 10rpx #f8f8f8;
} }
.cash-withdrawal .nav .item { .cash-withdrawal .nav .item {
font-size: 26rpx; font-size: 26rpx;
flex: 1; flex: 1;
text-align: center; text-align: center;
} }
.cash-withdrawal .nav .item~.item { .cash-withdrawal .nav .item~.item {
border-left: 1px solid #f0f0f0; border-left: 1px solid #f0f0f0;
} }
.cash-withdrawal .nav .item .iconfont { .cash-withdrawal .nav .item .iconfont {
width: 40rpx; width: 40rpx;
height: 40rpx; height: 40rpx;
@ -335,28 +328,28 @@
font-size: 22rpx; font-size: 22rpx;
box-sizing: border-box; box-sizing: border-box;
} }
.cash-withdrawal .nav .item .iconfont.on { .cash-withdrawal .nav .item .iconfont.on {
background-color: $theme-color; background-color: $theme-color;
color: #fff; color: #fff;
border-color: $theme-color; border-color: $theme-color;
} }
.cash-withdrawal .nav .item .line { .cash-withdrawal .nav .item .line {
width: 2rpx; width: 2rpx;
height: 20rpx; height: 20rpx;
margin: 0 auto; margin: 0 auto;
transition: height 0.3s; transition: height 0.3s;
} }
.cash-withdrawal .nav .item .line.on { .cash-withdrawal .nav .item .line.on {
height: 39rpx; height: 39rpx;
} }
.cash-withdrawal .wrapper .list { .cash-withdrawal .wrapper .list {
padding: 0 30rpx; padding: 0 30rpx;
} }
.cash-withdrawal .wrapper .list .item { .cash-withdrawal .wrapper .list .item {
border-bottom: 1rpx solid #eee; border-bottom: 1rpx solid #eee;
min-height: 28rpx; min-height: 28rpx;
@ -364,19 +357,19 @@
color: #333; color: #333;
padding: 39rpx 0; padding: 39rpx 0;
} }
.cash-withdrawal .wrapper .list .item .name { .cash-withdrawal .wrapper .list .item .name {
width: 130rpx; width: 130rpx;
} }
.cash-withdrawal .wrapper .list .item .input { .cash-withdrawal .wrapper .list .item .input {
width: 505rpx; width: 505rpx;
} }
.cash-withdrawal .wrapper .list .item .input .placeholder { .cash-withdrawal .wrapper .list .item .input .placeholder {
color: #bbb; color: #bbb;
} }
.cash-withdrawal .wrapper .list .item .picEwm,.cash-withdrawal .wrapper .list .item .pictrue{ .cash-withdrawal .wrapper .list .item .picEwm,.cash-withdrawal .wrapper .list .item .pictrue{
width:140rpx; width:140rpx;
height:140rpx; height:140rpx;
@ -384,38 +377,38 @@
position: relative; position: relative;
margin-right: 23rpx; margin-right: 23rpx;
} }
.cash-withdrawal .wrapper .list .item .picEwm image{ .cash-withdrawal .wrapper .list .item .picEwm image{
width:100%; width:100%;
height:100%; height:100%;
border-radius:3rpx; border-radius:3rpx;
} }
.cash-withdrawal .wrapper .list .item .picEwm .icon-guanbi1{ .cash-withdrawal .wrapper .list .item .picEwm .icon-guanbi1{
position:absolute; position:absolute;
right: -14rpx; right: -14rpx;
top: -16rpx; top: -16rpx;
font-size:40rpx; font-size:40rpx;
} }
.cash-withdrawal .wrapper .list .item .pictrue{ .cash-withdrawal .wrapper .list .item .pictrue{
border:1px solid rgba(221,221,221,1); border:1px solid rgba(221,221,221,1);
font-size:22rpx; font-size:22rpx;
color: #BBBBBB; color: #BBBBBB;
} }
.cash-withdrawal .wrapper .list .item .pictrue .icon-icon25201{ .cash-withdrawal .wrapper .list .item .pictrue .icon-icon25201{
font-size: 47rpx; font-size: 47rpx;
color: #DDDDDD; color: #DDDDDD;
margin-bottom: 3px; margin-bottom: 3px;
} }
.cash-withdrawal .wrapper .list .tip { .cash-withdrawal .wrapper .list .tip {
font-size: 26rpx; font-size: 26rpx;
color: #999; color: #999;
margin-top: 25rpx; margin-top: 25rpx;
} }
.cash-withdrawal .wrapper .list .bnt { .cash-withdrawal .wrapper .list .bnt {
font-size: 32rpx; font-size: 32rpx;
color: #fff; color: #fff;
@ -426,14 +419,14 @@
line-height: 90rpx; line-height: 90rpx;
margin: 64rpx auto; margin: 64rpx auto;
} }
.cash-withdrawal .wrapper .list .tip2 { .cash-withdrawal .wrapper .list .tip2 {
font-size: 26rpx; font-size: 26rpx;
color: #999; color: #999;
text-align: center; text-align: center;
margin: 44rpx 0 20rpx 0; margin: 44rpx 0 20rpx 0;
} }
.cash-withdrawal .wrapper .list .value { .cash-withdrawal .wrapper .list .value {
height: 135rpx; height: 135rpx;
line-height: 135rpx; line-height: 135rpx;
@ -441,18 +434,18 @@
width: 690rpx; width: 690rpx;
margin: 0 auto; margin: 0 auto;
} }
.cash-withdrawal .wrapper .list .value input { .cash-withdrawal .wrapper .list .value input {
font-size: 80rpx; font-size: 80rpx;
color: #282828; color: #282828;
height: 135rpx; height: 135rpx;
text-align: center; text-align: center;
} }
.cash-withdrawal .wrapper .list .value .placeholder2 { .cash-withdrawal .wrapper .list .value .placeholder2 {
color: #bbb; color: #bbb;
} }
.price { .price {
color: $theme-color; color: $theme-color;
} }