【修复】小程序端银行卡提现,银行名称改为下拉选择。

由于后端接收的是银行名称参数会由配置字典进行解析,所以小程序端银行名称是不能让用户输入框手动输入的,需要查询后端字典配置进行显示和选择。提交的值是银行字典对应的value。

Signed-off-by: heyho <heywsk@qq.com>
pull/92/head
heyho 2024-09-04 09:22:18 +00:00 committed by Gitee
parent ed3d370de2
commit 9f33e44db0
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 42 additions and 7 deletions

View File

@ -98,12 +98,17 @@
v-show="state.accountInfo.type === '2'" v-show="state.accountInfo.type === '2'"
> >
<view class="unit" /> <view class="unit" />
<!--银入输入改为下拉-->
<picker @change="bankChange" :value="state.accountInfo.bankName" :range="state.bankList" range-key="label" style="width:100%">
<uni-easyinput <uni-easyinput
:inputBorder="false" :inputBorder="false"
class="ss-flex-1 ss-p-l-10" :value="state.selectedBankName"
v-model="state.accountInfo.bankName" placeholder="请选择银行"
placeholder="请输入提现银行" suffixIcon="right"
disabled
:styles="{disableColor:'#fff',borderColor:'#fff',color:'#333!important'}"
/> />
</picker>
</view> </view>
<!-- 开户地址 --> <!-- 开户地址 -->
<view class="card-title" v-show="state.accountInfo.type === '2'"></view> <view class="card-title" v-show="state.accountInfo.type === '2'"></view>
@ -152,6 +157,7 @@
import { fen2yuan } from '@/sheep/hooks/useGoods'; import { fen2yuan } from '@/sheep/hooks/useGoods';
import TradeConfigApi from '@/sheep/api/trade/config'; import TradeConfigApi from '@/sheep/api/trade/config';
import BrokerageApi from '@/sheep/api/trade/brokerage'; import BrokerageApi from '@/sheep/api/trade/brokerage';
import DictApi from '@/sheep/api/system/dict';
const headerBg = sheep.$url.css('/static/img/shop/user/withdraw_bg.png'); const headerBg = sheep.$url.css('/static/img/shop/user/withdraw_bg.png');
const statusBarHeight = sheep.$platform.device.statusBarHeight * 2; const statusBarHeight = sheep.$platform.device.statusBarHeight * 2;
@ -176,6 +182,8 @@
frozenDays: 0, // frozenDays: 0, //
minPrice: 0, // minPrice: 0, //
withdrawTypes: [], // withdrawTypes: [], //
bankList:[], //
selectedBankName:"",//
}); });
// //
@ -245,9 +253,36 @@
} }
} }
//
async function getDictDataListByType(){
let { code, data } = await DictApi.getDictDataListByType('brokerage_bank_name');
if (code !== 0) {
return;
}
if(data && data.length > 0) {
data.map(item=>{
item.text = item.label;
})
state.bankList = data;
}
}
//
function bankChange(e){
console.log(e);
let value = e.target.value;
state.accountInfo.bankName = value;
let curr = state.bankList?.filter(item=>{
return item.value == value
})[0];
console.log(curr);
state.selectedBankName = curr.label;
}
onBeforeMount(() => { onBeforeMount(() => {
getWithdrawRules(); getWithdrawRules();
getBrokerageUser() getBrokerageUser();
getDictDataListByType();//
}) })
</script> </script>