|
@@ -31,23 +31,77 @@
|
|
|
</div>
|
|
</div>
|
|
|
<div class="bottom">
|
|
<div class="bottom">
|
|
|
<div class="btn-withdraw" @click="withdraw">提现</div>
|
|
<div class="btn-withdraw" @click="withdraw">提现</div>
|
|
|
- <div class="btn-recharge" @click="recharge">充值</div>
|
|
|
|
|
|
|
+ <div class="btn-recharge" @click="recharge" v-if="enableRecharge">充值</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <van-action-sheet v-model:show="showWithdrawDialog" :closeable="false">
|
|
|
|
|
- <div class="recharge-dialog">
|
|
|
|
|
- <div class="title">
|
|
|
|
|
- <div class="text">充值详情</div>
|
|
|
|
|
- <div class="close">
|
|
|
|
|
- <img src="@assets/icon_dialog_close.png" />
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <van-action-sheet v-model:show="showRechargeDialog" :closeable="false" class="recharge-dialog">
|
|
|
|
|
+ <div class="title">
|
|
|
|
|
+ <div class="text">充值详情</div>
|
|
|
|
|
+ <div class="close" @click="showRechargeDialog = false">
|
|
|
|
|
+ <img src="@assets/icon_dialog_close.png" />
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <div class="content">
|
|
|
|
|
+ <div class="amount">
|
|
|
|
|
+ <div class="text">充值金额(元)</div>
|
|
|
|
|
+ <div class="num">{{ amount }}</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="line"></div>
|
|
|
|
|
+ <div class="title-methods">充值方式</div>
|
|
|
|
|
+ <div style="padding: 0 16px">
|
|
|
|
|
+ <pay-method-pick v-model="payMethod" :showBalance="false"></pay-method-pick>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="btn-wrapper">
|
|
|
|
|
+ <div class="btn-recharge" @click="confirmRecharge">确认支付</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </van-action-sheet>
|
|
|
|
|
+
|
|
|
|
|
+ <van-action-sheet v-model:show="showWithdrawDialog" :closeable="false" class="recharge-dialog">
|
|
|
|
|
+ <div class="title">
|
|
|
|
|
+ <div class="text">提现详情</div>
|
|
|
|
|
+ <div class="close" @click="showWithdrawDialog = false">
|
|
|
|
|
+ <img src="@assets/icon_dialog_close.png" />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="content">
|
|
|
|
|
+ <div class="amount">
|
|
|
|
|
+ <div class="text">提现金额(元)</div>
|
|
|
|
|
+ <div class="num">{{ amount }}</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="line"></div>
|
|
|
|
|
+ <van-cell v-if="bankCard" title="提现帐户" :value="bankCard.bankName">
|
|
|
|
|
+ <template #value>
|
|
|
|
|
+ <span>
|
|
|
|
|
+ {{ bankCard.bankName }} <br />
|
|
|
|
|
+ ****{{ bankCard.bankNo.slice(-4) }}
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </van-cell>
|
|
|
|
|
+ <van-cell v-else title="提现帐户" value="添加" is-link to="mineBanksAdd"></van-cell>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="btn-wrapper">
|
|
|
|
|
+ <van-button
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ color="#373A60"
|
|
|
|
|
+ round
|
|
|
|
|
+ block
|
|
|
|
|
+ class="btn-recharge"
|
|
|
|
|
+ @click="confirmWithdraw"
|
|
|
|
|
+ :disabled="!bankCard"
|
|
|
|
|
+ >
|
|
|
|
|
+ 确认提现
|
|
|
|
|
+ </van-button>
|
|
|
|
|
+ </div>
|
|
|
</van-action-sheet>
|
|
</van-action-sheet>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
<script>
|
|
<script>
|
|
|
|
|
+import PayMethodPick from '@/components/PayMethodPick';
|
|
|
|
|
+import resolveUrl from 'resolve-url';
|
|
|
|
|
+import { mapState } from 'vuex';
|
|
|
export default {
|
|
export default {
|
|
|
|
|
+ components: { PayMethodPick },
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
userBalance: {
|
|
userBalance: {
|
|
@@ -56,18 +110,29 @@ export default {
|
|
|
amountOptions: [100, 500, 1000, 2000, 5000, 10000],
|
|
amountOptions: [100, 500, 1000, 2000, 5000, 10000],
|
|
|
amount: null,
|
|
amount: null,
|
|
|
minAmount: 100,
|
|
minAmount: 100,
|
|
|
- showWithdrawDialog: true
|
|
|
|
|
|
|
+ showRechargeDialog: false,
|
|
|
|
|
+ payMethod: null,
|
|
|
|
|
+ showWithdrawDialog: false,
|
|
|
|
|
+ enableRecharge: false
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
|
- this.$http.get('/sysConfig/get/min_recharge_amount').then(res => {
|
|
|
|
|
- this.minAmount = Number(res.value);
|
|
|
|
|
- });
|
|
|
|
|
- this.$http.get('/userBalance/my').then(res => {
|
|
|
|
|
- this.userBalance = res;
|
|
|
|
|
|
|
+ this.$http.get('/sysConfig/get/min_recharge_amount,enable_recharge').then(res => {
|
|
|
|
|
+ this.minAmount = Number(res['min_recharge_amount'].value);
|
|
|
|
|
+ this.enableRecharge = res['enable_recharge'].value === '1';
|
|
|
});
|
|
});
|
|
|
|
|
+ this.$store.dispatch('getBankCard');
|
|
|
|
|
+ this.getBalance();
|
|
|
|
|
+ },
|
|
|
|
|
+ computed: {
|
|
|
|
|
+ ...mapState(['bankCard'])
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ getBalance() {
|
|
|
|
|
+ this.$http.get('/userBalance/my').then(res => {
|
|
|
|
|
+ this.userBalance = res;
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
recharge() {
|
|
recharge() {
|
|
|
if (!this.amount) {
|
|
if (!this.amount) {
|
|
|
this.$toast('请输入充值金额');
|
|
this.$toast('请输入充值金额');
|
|
@@ -82,30 +147,75 @@ export default {
|
|
|
this.$toast('充值金额不能大于50000');
|
|
this.$toast('充值金额不能大于50000');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- this.$toast.loading('充值中');
|
|
|
|
|
|
|
+ this.showRechargeDialog = true;
|
|
|
|
|
+ },
|
|
|
|
|
+ confirmRecharge() {
|
|
|
|
|
+ if (!this.payMethod) {
|
|
|
|
|
+ this.$toast('请选择支付方式');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ this.showRechargeDialog = false;
|
|
|
|
|
+ switch (this.payMethod) {
|
|
|
|
|
+ case 'ALIPAY':
|
|
|
|
|
+ this.$toast.loading('充值中');
|
|
|
|
|
+ this.$http
|
|
|
|
|
+ .post('/payOrder/v2/recharge', { amount: this.amount })
|
|
|
|
|
+ .then(res => {
|
|
|
|
|
+ this.openScheme(res);
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ this.$toast.clear();
|
|
|
|
|
+ }, 1000);
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(e => {
|
|
|
|
|
+ this.$toast(e.error || '充值失败');
|
|
|
|
|
+ });
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 'UNION':
|
|
|
|
|
+ window.open(
|
|
|
|
|
+ resolveUrl(
|
|
|
|
|
+ this.$baseUrl,
|
|
|
|
|
+ '/payOrder/v2/recharge/sandQuick?userId=' +
|
|
|
|
|
+ this.$store.state.userInfo.id +
|
|
|
|
|
+ '&amount=' +
|
|
|
|
|
+ this.amount
|
|
|
|
|
+ )
|
|
|
|
|
+ .replace('www.raex.vip', 'jump.raex.vip')
|
|
|
|
|
+ .replace('test.raex.vip', 'jumptest.raex.vip'),
|
|
|
|
|
+ '_blank'
|
|
|
|
|
+ );
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 'SYXPAY':
|
|
|
|
|
+ this.$router.push({
|
|
|
|
|
+ name: 'bankPay',
|
|
|
|
|
+ query: {
|
|
|
|
|
+ type: 'recharge',
|
|
|
|
|
+ amount: this.amount
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ withdraw() {
|
|
|
|
|
+ if (!this.amount) {
|
|
|
|
|
+ this.$toast('请输入提现金额');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (Number(this.amount) > this.userBalance.balance) {
|
|
|
|
|
+ this.$toast('提现金额不能大于余额');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ this.showWithdrawDialog = true;
|
|
|
|
|
+ },
|
|
|
|
|
+ confirmWithdraw() {
|
|
|
|
|
+ this.showWithdrawDialog = false;
|
|
|
|
|
+ this.$toast.loading('申请提现');
|
|
|
this.$http
|
|
this.$http
|
|
|
- .post('/payOrder/v2/recharge', { amount: this.amount })
|
|
|
|
|
|
|
+ .post('/withdrawApply/apply', { amount: this.amount })
|
|
|
.then(res => {
|
|
.then(res => {
|
|
|
- this.openScheme(res);
|
|
|
|
|
- setTimeout(() => {
|
|
|
|
|
- this.$toast.clear();
|
|
|
|
|
- }, 1000);
|
|
|
|
|
|
|
+ this.$toast.success('申请提现成功');
|
|
|
|
|
+ this.getBalance();
|
|
|
})
|
|
})
|
|
|
.catch(e => {
|
|
.catch(e => {
|
|
|
- this.$toast(e.error || '充值失败');
|
|
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
- withdraw() {
|
|
|
|
|
- this.$dialog
|
|
|
|
|
- .confirm({
|
|
|
|
|
- message: '是否申请提现?'
|
|
|
|
|
- })
|
|
|
|
|
- .then(() => {
|
|
|
|
|
- this.$toast.loading('申请提现');
|
|
|
|
|
- setTimeout(() => {
|
|
|
|
|
- this.$toast.clear();
|
|
|
|
|
- this.$dialog.alert({ message: '申请提现成功,预计1个工作日后到账' });
|
|
|
|
|
- }, 1000);
|
|
|
|
|
|
|
+ this.$toast(e.error || '申请提现失败');
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -270,7 +380,6 @@ export default {
|
|
|
.btn-withdraw {
|
|
.btn-withdraw {
|
|
|
flex: 1 0 0;
|
|
flex: 1 0 0;
|
|
|
border-radius: 19px;
|
|
border-radius: 19px;
|
|
|
- margin-right: 20px;
|
|
|
|
|
height: 38px;
|
|
height: 38px;
|
|
|
font-size: 16px;
|
|
font-size: 16px;
|
|
|
font-weight: bold;
|
|
font-weight: bold;
|
|
@@ -281,6 +390,9 @@ export default {
|
|
|
&:active {
|
|
&:active {
|
|
|
background: fade(#393d62, 30%);
|
|
background: fade(#393d62, 30%);
|
|
|
}
|
|
}
|
|
|
|
|
+ & + div {
|
|
|
|
|
+ margin-left: 20px;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
.btn-recharge {
|
|
.btn-recharge {
|
|
|
flex: 1 0 0;
|
|
flex: 1 0 0;
|
|
@@ -298,15 +410,107 @@ export default {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-.recharge {
|
|
|
|
|
|
|
+::v-deep(.recharge-dialog .van-action-sheet__content) {
|
|
|
|
|
+ overflow: auto !important;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ flex-direction: column;
|
|
|
|
|
+}
|
|
|
|
|
+.recharge-dialog {
|
|
|
|
|
+ overflow: auto;
|
|
|
|
|
+ .content {
|
|
|
|
|
+ flex-basis: calc(80vh - 150px);
|
|
|
|
|
+ flex-grow: 1;
|
|
|
|
|
+ overflow: auto;
|
|
|
|
|
+ //height: calc(100vh - 300px);
|
|
|
|
|
+ }
|
|
|
.title {
|
|
.title {
|
|
|
|
|
+ height: 50px;
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ &::after {
|
|
|
|
|
+ .setBottomLine();
|
|
|
|
|
+ }
|
|
|
.flex();
|
|
.flex();
|
|
|
.text {
|
|
.text {
|
|
|
margin-left: 16px;
|
|
margin-left: 16px;
|
|
|
font-size: 14px;
|
|
font-size: 14px;
|
|
|
color: black;
|
|
color: black;
|
|
|
font-weight: bold;
|
|
font-weight: bold;
|
|
|
|
|
+ flex-grow: 1;
|
|
|
|
|
+ }
|
|
|
|
|
+ .close {
|
|
|
|
|
+ padding: 10px 16px;
|
|
|
|
|
+ img {
|
|
|
|
|
+ width: 24px;
|
|
|
|
|
+ height: 24px;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ .amount {
|
|
|
|
|
+ background: @bg3;
|
|
|
|
|
+ border-radius: 4px;
|
|
|
|
|
+ margin: 16px;
|
|
|
|
|
+ padding: 17px 0 20px 0;
|
|
|
|
|
+ .flex-col();
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ .text {
|
|
|
|
|
+ font-size: 16px;
|
|
|
|
|
+ color: black;
|
|
|
|
|
+ }
|
|
|
|
|
+ .num {
|
|
|
|
|
+ font-size: 36px;
|
|
|
|
|
+ font-family: DIN;
|
|
|
|
|
+ margin-top: 10px;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ .line {
|
|
|
|
|
+ background: @bg3;
|
|
|
|
|
+ height: 1px;
|
|
|
|
|
+ margin: 0 16px;
|
|
|
|
|
+ }
|
|
|
|
|
+ .title-methods {
|
|
|
|
|
+ font-size: 14px;
|
|
|
|
|
+ line-height: 24px;
|
|
|
|
|
+ font-weight: bold;
|
|
|
|
|
+ margin-left: 16px;
|
|
|
|
|
+ margin-top: 20px;
|
|
|
|
|
+ margin-right: 16px;
|
|
|
|
|
+ .bank-name {
|
|
|
|
|
+ font-size: 14px;
|
|
|
|
|
+ color: @text3;
|
|
|
|
|
+ font-weight: normal;
|
|
|
|
|
+ float: right;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ .btn-wrapper {
|
|
|
|
|
+ height: 56px;
|
|
|
|
|
+ min-height: 56px;
|
|
|
|
|
+ .flex();
|
|
|
|
|
+ padding-bottom: env(safe-area-inset-bottom);
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ &::after {
|
|
|
|
|
+ .setTopLine();
|
|
|
|
|
+ }
|
|
|
|
|
+ .btn-recharge {
|
|
|
|
|
+ // flex-grow: 1;
|
|
|
|
|
+ // height: 38px;
|
|
|
|
|
+ // border-radius: 19px;
|
|
|
|
|
+ // background: #373a60;
|
|
|
|
|
+ // font-size: 16px;
|
|
|
|
|
+ // color: white;
|
|
|
|
|
+ // font-weight: bold;
|
|
|
|
|
+ // .flex();
|
|
|
|
|
+ // justify-content: center;
|
|
|
|
|
+ margin: 0 48px;
|
|
|
|
|
+ ::v-deep(.van-button__content) {
|
|
|
|
|
+ font-weight: bold;
|
|
|
|
|
+ }
|
|
|
|
|
+ // &:active {
|
|
|
|
|
+ // background: shade(#373a60, 20%);
|
|
|
|
|
+ // }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+::v-deep(.van-cell__title) {
|
|
|
|
|
+ font-weight: bold;
|
|
|
}
|
|
}
|
|
|
</style>
|
|
</style>
|