补贴申请

This commit is contained in:
George
2025-10-31 16:54:39 +08:00
parent 878503d685
commit b5e5ff8277
15 changed files with 234 additions and 10 deletions

View File

@ -36,6 +36,10 @@
</view>
</view>
</view>
<view class="recordBtn" @click="() => toTarget('/pages/capital/mtSubsidy/index')">
{{ $t('home.subsidy') }}
<image src="/static/capital/capitalRightArrow.png" mode="aspectFit" style="width: 4px; height: 8px"></image>
</view>
<view class="recordBtn" @click="() => toTarget('/pages/capital/tradeRecord/index')">
{{ $t('common.viewTradeRecord') }}
<image src="/static/capital/capitalRightArrow.png" mode="aspectFit" style="width: 4px; height: 8px"></image>

View File

@ -0,0 +1,89 @@
.container {
padding: 0 24px 24px 16px;
.title {
margin: 14px 0 15px;
}
.minAmount {
margin-top: 4px;
color: #14cc9e;
font-size: 10px;
line-height: 14px;
&.unavailable {
color: #ff5733;
}
}
.availableMoneyOut {
display: flex;
align-items: center;
column-gap: 16px;
margin-bottom: 16px;
font-size: 14px;
color: #777777;
.value {
font-size: 18px;
font-weight: 700;
color: #29bbe4;
}
}
.exchangeRate {
display: flex;
justify-content: space-between;
margin-bottom: 12px;
font-size: 14px;
color: #777777;
.value {
font-weight: 700;
}
}
.currency_amount {
display: flex;
justify-content: space-between;
margin-bottom: 12px;
.label {
font-size: 14px;
color: #777777;
}
.value {
font-size: 14px;
color: #29bbe4;
font-weight: 700;
}
}
.detailModal {
position: relative;
width: calc(100vw - 50px);
max-width: 363px;
padding: 32px 29px 42px;
background-color: #fff;
box-sizing: border-box;
.closeIcon {
position: absolute;
top: 18px;
right: 21px;
width: 17px;
height: 17px;
}
.titleWrapper {
display: flex;
flex-direction: column;
align-items: center;
row-gap: 12px;
color: #333333;
padding: 12px;
margin: 24px 0;
box-shadow: -1px 0 5px 1px rgba(0, 0, 0, 0.1);
.title {
margin: 0;
font-size: 24px;
font-weight: 700;
line-height: 34px;
}
.value {
font-size: 36px;
font-weight: 700;
color: #29bbe4;
line-height: 52px;
}
}
}
}

View File

@ -0,0 +1,109 @@
<template>
<view>
<NavBar />
<view class="container">
<view class="title">
<PageTitle :title="$t('home.subsidy')" />
</view>
<view>
<uni-forms ref="withdrawForm" :modelValue="withdrawFormData" :rules="withdrawFormRules">
<uni-forms-item name="mt_login">
<text class="uni-subtitle">{{ $t('form.mtAccount.label') }}</text>
<uni-data-select
:placeholder="$t('form.pleaseSelect')"
:emptyTips="$t('common.empty')"
:localdata="mtLoginOptions"
v-model="withdrawFormData.mt_login"
@change="mtLoginChange"
></uni-data-select>
</uni-forms-item>
</uni-forms>
<button class="primaryButton" :disabled="submitBtnLoading" @click="handleSaveWithdraw">
<image v-show="submitBtnLoading" src="/static/loadingCircle.svg" mode="aspectFit" style="width: 16px; height: 16px"></image>
{{ $t('form.submit') }}
</button>
</view>
</view>
</view>
</template>
<script>
import { getMTAccounts, getIfChargeCommission } from '@/services/home/home.ts';
import { applySubsidy } from '@/services/capital/deposit.ts';
export default {
name: '',
data() {
return {
mtLoginOptions: [],
mtlogins: {},
selectedMtLogin: null,
submitBtnLoading: false,
withdrawFormData: { mt_login: '' },
withdrawFormRules: {
mt_login: {
rules: [
{
required: true,
errorMessage: this.$t('form.mtAccount.required')
}
]
}
},
};
},
methods: {
async getMtLoginData() {
const res = await getMTAccounts({ server_type: 'live' });
if (res && res.code === 0) {
this.mtLoginOptions = res.data?.map((mtAccount) => ({
text: `${mtAccount.mt4_server_name} ${mtAccount.mt4_login}`,
value: mtAccount.mt4_login?.toString()
}));
res.data?.forEach((mtAccount) => {
this.mtlogins[mtAccount.mt4_login] = mtAccount;
});
}
},
async handleSaveWithdraw() {
this.$refs.withdrawForm.validate().then(async (fields) => {
this.submitBtnLoading = true;
const res = await applySubsidy({
...fields,
mt_server: this.selectedMtLogin?.mt4_server
});
this.submitBtnLoading = false;
if (res && res.code === 0) {
this.$nextTick(() => {
this.$cusModal.showModal({
type: 'message',
status: 'success',
contentText: this.$t('activity.dh')
});
})
} else {
this.$nextTick(() => {
this.$cusModal.showModal({
type: 'message',
status: 'warning',
contentText: res.msg ?? this.$t('common.error.sysError')
});
})
}
});
},
mtLoginChange(val) {
this.selectedMtLogin = this.mtlogins[val];
},
back(){
uni.navigateBack();
}
},
onLoad(params) {
this.getMtLoginData();
}
};
</script>
<style lang="scss" scoped>
@import './index.scss';
</style>