fix:修复分销提现页银行名称存储问题,兼容管理端回显

pull/174/MERGE
greyfilm 2026-02-01 17:49:49 +08:00
parent 3c3ee616fd
commit f2bfb2d79b
1 changed files with 12 additions and 3 deletions

View File

@ -115,7 +115,7 @@
>
<uni-easyinput
:inputBorder="false"
:value="state.accountInfo.bankName"
:value="bankNameLabel"
placeholder="请选择银行"
suffixIcon="right"
disabled
@ -164,7 +164,7 @@
</template>
<script setup>
import { onBeforeMount, reactive } from 'vue';
import { onBeforeMount, reactive, computed } from 'vue';
import sheep from '@/sheep';
import accountTypeSelect from './components/account-type-select.vue';
import { fen2yuan } from '@/sheep/hooks/useGoods';
@ -199,6 +199,14 @@
bankListSelectedIndex: '', // bankList index
});
const bankNameLabel = computed(() => {
if (!state.accountInfo.bankName || !state.bankList || state.bankList.length === 0) {
return '';
}
const item = state.bankList.find((it) => it.value === state.accountInfo.bankName);
return item ? item.label : '';
});
//
const onAccountSelect = (e) => {
state.accountSelect = e;
@ -300,7 +308,8 @@
function bankChange(e) {
const value = e.detail.value;
state.bankListSelectedIndex = value;
state.accountInfo.bankName = state.bankList[value].label;
const item = state.bankList[value];
state.accountInfo.bankName = item ? item.value : undefined;
}
onBeforeMount(() => {