Browse Source

代理主页、代理提现、代理提现历史

master
yangrz 2 years ago
parent
commit
ae5dd1d893
  1. 15
      agentApp/common/api.js
  2. 253
      agentApp/pages/cash/cash.vue
  3. 85
      agentApp/pages/history/history.vue
  4. 21
      agentApp/pages/index/index.vue

15
agentApp/common/api.js

@ -43,19 +43,12 @@ const userConfig = function() {
}
export const userGetMerchantInfo = (params) => http.post(baseUrl + '/api/user/getMerchantInfo', params, userConfig())
export const userCreateOrder = (params) => http.post(baseUrl + '/api/user/createOrder', params, userConfig())
export const userAccountInfo = () => http.post(baseUrl + '/api/user/accountInfo', {}, userConfig())
export const userQueueRebateList = (params) => http.post(baseUrl + '/api/user/queueRebateList', params, userConfig())
export const userOrderList = (params) => http.post(baseUrl + '/api/user/orderList', params, userConfig())
export const userFillAlipayAccount = (params) => http.post(baseUrl + '/api/user/fillAlipayAccount', params, userConfig())
export const userWithdraw = (params) => http.post(baseUrl + '/api/user/withdraw', params, userConfig())
export const userWithdrawList = (params) => http.post(baseUrl + '/api/user/withdrawList', params, userConfig())
@ -69,6 +62,10 @@ const agentConfig = function() {
}
export const agentSmsLogin = (params) => http.post(baseUrl + '/api/agent/smsLogin', params)
export const agentAccountInfo = (params) => http.post(baseUrl + '/api/agent/accountInfo', params, agentConfig())
export const agentFillAlipayAccount = (params) => http.post(baseUrl + '/api/agent/fillAlipayAccount', params, agentConfig())
export const agentWithdraw = (params) => http.post(baseUrl + '/api/agent/withdraw', params, agentConfig())
export const agentWithdrawList = (params) => http.post(baseUrl + '/api/agent/withdrawList', params, agentConfig())
// 带上商户token
@ -81,14 +78,10 @@ const merchantConfig = function() {
}
export const merchantSmsLogin = (params) => http.post(baseUrl + '/api/merchant/smsLogin', params)
export const merchantAccountInfo = (params) => http.post(baseUrl + '/api/merchant/accountInfo', params, merchantConfig())
export const merchantOrderList = (params) => http.post(baseUrl + '/api/merchant/orderList', params, merchantConfig())
export const merchantOrderRefund = (params) => http.post(baseUrl + '/api/merchant/orderRefund', params, merchantConfig())
export const publicSysConfig = (params) => http.post(baseUrl + '/api/public/sysConfig', params)
export const publicSendSms = (params) => http.post(baseUrl + '/api/public/sendSms', params)

253
agentApp/pages/cash/cash.vue

@ -10,7 +10,7 @@
</view>
<view class="au-num">
458.00
{{accountInfo.wallet_balance}}
</view>
</view>
<view class="age-font">
@ -20,20 +20,20 @@
<img src="../../static/page/line-style.png" style="width: 200rpx;height: 2rpx;" alt="" srcset="" />
</view>
<view class="age-wait">
体现500.00
提现{{accountInfo.withdraw_total}}
</view>
<view class="age-linemore">
<img src="../../static/page/divider-style.png" style="width: 690rpx;height: 2rpx;" alt="" srcset="" />
</view>
<div class="age-mnum">
<view class="mtext">
待入账1000
待入账{{accountInfo.waiting_amount}}
</view>
<view class="mline">
</view>
<view class="mtext">
提现中458
提现中{{accountInfo.withdrawing_amount}}
</view>
</div>
</view>
@ -44,36 +44,181 @@
支付宝账户
</view>
</view>
<view class="agp-detail">
<view class="agp-make" @click="makecash">
<view class="agp-detail" v-if="!accountInfo.alipay_account">
<view class="agp-make" @click="showInputForm(1)">
去开通
</view>
</view>
</view>
<template v-if="isInputForm">
<view class="apt-main u-border-top u-border-bottom" v-if="isInputForm">
<view class="apm-cell">
<view class="am-title">
支付宝账号
</view>
<view class="am-value" style="width:70%;">
<u--input placeholder="绑定的手机号或邮箱" border="surround" v-model="inputAlipayAccount"></u--input>
</view>
</view>
<view class="apm-cell">
<view class="am-title">
支付宝姓名
</view>
<view class="am-value" style="width:70%;">
<u--input placeholder="账号真实姓名" border="surround" v-model="inputAlipayName"></u--input>
</view>
</view>
</view>
<view class="apt-btn">
<view class="savebtn" @click="saveAlipayAccount">
保存
</view>
</view>
</template>
<template v-if="accountInfo.alipay_account && !isInputForm">
<view class="apt-main u-border-top u-border-bottom">
<view class="apm-cell">
<view class="am-title">
提现账户
</view>
<view class="am-value">
<view class="mphone">
{{accountInfo.alipay_account}}
</view>
<view class="mlink" @click="showInputForm(2)">
修改
</view>
</view>
</view>
<view class="apm-cell">
<view class="am-title">
可提现金额
</view>
<view class="am-value">
<view class="mnum">
{{accountInfo.wallet_balance}}
</view>
</view>
</view>
</view>
<view class="apt-btn">
<view class="cashbtn" @click="showWithdrawForm">
提现
</view>
</view>
</template>
</view>
</view>
<u-modal title="确认提现金额" :show="isWithdrawForm" :showCancelButton="true" @confirm="confirmWithdraw"
@cancel="isWithdrawForm=false">
<view class="withdraw-form">
<u--input prefixIcon="¥" placeholder="提现金额" border="surround" v-model="inputAmount"></u--input>
<view class="fee-desc">
扣手续费{{calcFee}}实际到账{{calcReceiveAmount}}
</view>
<view class="tips">
<view class="tips-item" v-for="(line,index) in sysConfig.withdraw_tips.split('\n')" :key="index">{{line}}
</view>
</view>
</view>
</u-modal>
</view>
</template>
<script>
import {
agentAccountInfo,
agentFillAlipayAccount,
agentWithdraw,
publicSysConfig
} from '../../common/api.js'
export default {
data() {
return {
accountInfo: {},
isInputForm: false,
inputAlipayAccount: '',
inputAlipayName: '',
isWithdrawForm: false,
inputAmount: '',
sysConfig: {}
}
},
computed: {
calcFee() {
if (!this.inputAmount || isNaN(this.inputAmount)) {
return '--';
}
if (!this.sysConfig.withdraw_fee_rate) {
return '--';
}
let fee = (this.inputAmount * this.sysConfig.withdraw_fee_rate / 100).toFixed(2);
return fee;
},
calcReceiveAmount() {
if (!this.inputAmount || isNaN(this.inputAmount)) {
return '--';
}
if (!this.sysConfig.withdraw_fee_rate) {
return '--';
}
let fee = this.calcFee;
let receiveAmount = (this.inputAmount - parseFloat(fee)).toFixed(2);
return receiveAmount;
}
},
onLoad() {
this.getAccountInfo();
this.getSysConfig();
},
methods: {
makecash() {
uni.navigateTo({
url: '/pages/cashdetail/cashdetail'
});
getAccountInfo() {
agentAccountInfo().then(data => this.accountInfo = data)
},
saveAlipayAccount() {
agentFillAlipayAccount({
alipay_account: this.inputAlipayAccount,
alipay_name: this.inputAlipayName,
}).then(() => {
this.getAccountInfo()
this.isInputForm = false
})
},
showInputForm(flag) {
this.isInputForm = true
if (flag == 2) {
this.inputAlipayAccount = this.accountInfo.alipay_account
this.inputAlipayName = this.accountInfo.alipay_name
}
// uni.navigateTo({
// url: '/pages/account-opened/account-opened'
// });
},
showWithdrawForm() {
this.isWithdrawForm = true
this.inputAmount = this.accountInfo.wallet_balance
},
confirmWithdraw() {
agentWithdraw({
amount: this.inputAmount
}).then(() => {
this.getAccountInfo()
this.isWithdrawForm = false
})
},
cashManager() {
uni.navigateTo({
url: '/pages/history/history'
});
}
},
getSysConfig() {
publicSysConfig().then(data => this.sysConfig = data)
},
}
}
</script>
@ -82,6 +227,7 @@ export default {
.uni-page-body {
background: #f7f7f7;
}
.agent-content {
position: relative;
width: 100%;
@ -218,5 +364,88 @@ export default {
}
}
}
.apt-main {
padding: 10rpx 0;
.apm-cell {
display: flex;
justify-content: space-between;
.am-title {
height: 70rpx;
line-height: 70rpx;
color: 454545;
font-size: 12px;
}
.am-value {
display: flex;
justify-content: flex-end;
height: 70rpx;
line-height: 70rpx;
.mphone {
margin-right: 20rpx;
font-size: 12px;
color: #454545;
}
.mlink {
font-size: 12px;
color: #32A2FC;
}
.mnum {
font-size: 14px;
color: 454545;
font-weight: bold;
}
}
}
}
.u-border-bottom,
.u-border-top {
border-color: #eee !important;
}
.apt-btn {
display: flex;
justify-content: flex-end;
padding: 30rpx 0;
.cashbtn {
width: 110rpx;
height: 48rpx;
text-align: center;
line-height: 48rpx;
color: #fff;
font-size: 12px;
background: #1783FF;
border-radius: 100rpx;
}
.savebtn {
width: 110rpx;
height: 48rpx;
text-align: center;
line-height: 48rpx;
color: #fff;
font-size: 12px;
background: #00aaff;
border-radius: 100rpx;
}
}
}
.withdraw-form {
font-size: 28rpx;
.tips {
margin-top: 20rpx;
.tips-item {
margin-top: 6rpx;
}
}
}
</style>

85
agentApp/pages/history/history.vue

@ -2,80 +2,71 @@
<view class="app-container">
<u-gap height="10rpx" bgColor="#F7F7F7"></u-gap>
<view class="his-content">
<view class="his-item u-border-bottom">
<view class="his-item u-border-bottom" v-if="!withdrawList.length">暂无数据</view>
<view class="his-item u-border-bottom" v-for="(item,index) in withdrawList" :key="item.id">
<view class="hit-left">
<view class="his-name">
流水号: 139812983213
</view>
<view class="his-state">
提现成功
</view>
<view class="his-time">
2023-11-28 15:45:39
流水号: {{item.out_biz_no}}
</view>
<view class="his-state" v-if="item.status==0">
审核状态审核中
</view>
<view class="hit-right">
-458.00
<view class="his-state" v-if="item.status==1">
审核状态<text style="color:green">提现成功</text>
</view>
</view>
<view class="his-item u-border-bottom">
<view class="hit-left">
<view class="his-name">
流水号: 139812983213
<view class="his-state" v-if="item.status==2">
审核状态<text style="color:red">审核不通过原因{{item.review_remark}})</text>
</view>
<view class="his-state">
提现成功
</view>
<view class="his-time">
2023-11-28 15:45:39
</view>
</view>
<view class="hit-right">
-458.00
</view>
</view>
<view class="his-item u-border-bottom">
<view class="hit-left">
<view class="his-name">
流水号: 139812983213
提现金额{{item.amount}}
</view>
<view class="his-state">
提现成功
</view>
<view class="his-time">
2023-11-28 15:45:39
</view>
扣手续费{{item.fee}}
</view>
<view class="hit-right">
-458.00
</view>
</view>
<view class="his-item u-border-bottom">
<view class="hit-left">
<view class="his-name">
流水号: 139812983213
<view class="his-state">
实际到账{{item.receive_amount}}
</view>
<view class="his-state">
提现成功
提现账户{{item.alipay_account}}
</view>
<view class="his-time">
2023-11-28 15:45:39
申请时间{{item.created_at}}
</view>
<view class="his-time">
审核时间{{item.reviewed_at}}
</view>
<view class="hit-right">
-458.00
</view>
<!-- <view class="hit-right">
<view class="amount">提现金额{{item.amount}}</view>
<view class="fee">手续费{{item.fee}}</view>
<view class="receive-amount">实到账{{item.receive_amount}}</view>
</view> -->
</view>
</view>
</view>
</template>
<script>
import {
agentWithdrawList
} from '../../common/api.js'
export default {
data() {
return {
withdrawList: [],
};
},
onLoad() {
this.getWithdrawList()
},
methods: {
getWithdrawList() {
agentWithdrawList({
page: 1,
page_size: 15,
}).then(data => this.withdrawList = data.list)
}
}
}
</script>

21
agentApp/pages/index/index.vue

@ -10,7 +10,7 @@
</view>
<view class="au-num">
458.00
{{accountInfo.wallet_balance}}
</view>
</view>
<view class="age-font">
@ -20,7 +20,7 @@
<img src="../../static/index/line-style.png" style="width: 200rpx;height: 2rpx;" alt="" srcset="" />
</view>
<view class="age-wait">
待入账200.00
待入账{{accountInfo.waiting_amount}}
</view>
<view class="divider-style"></view>
<view class="information-id-content">
@ -30,7 +30,7 @@
代理ID
</view>
<view class="id-value">
56231fd
{{accountInfo.id}}
</view>
</view>
</view>
@ -141,16 +141,23 @@
</template>
<script>
import {
agentAccountInfo
} from '../../common/api.js'
export default {
data() {
return {
accountInfo: {},
}
},
onLoad() {
this.getAccountInfo();
},
methods: {
getAccountInfo() {
agentAccountInfo().then(data => this.accountInfo = data)
},
cashManager() {
uni.navigateTo({
url: '/pages/cash/cash'
@ -315,21 +322,25 @@ export default {
background: #9ECBFF;
margin: 20rpx 0;
}
.information-id-content {
display: flex;
justify-content: center;
align-items: center;
}
.content-id-item {
display: flex;
justify-content: center;
align-items: center;
}
.id-text {
font-family: PingFangSC-Regular, sans-serif;
font-size: 24rpx;
color: #fff;
}
.id-value {
font-family: PingFangSC-Regular, sans-serif;
font-size: 24rpx;

Loading…
Cancel
Save