!92 【修复】小程序端银行卡提现,银行名称改为下拉选择。【新增接口】新增系统字典查询接口

Merge pull request !92 from heyho/master
This commit is contained in:
芋道源码
2024-09-05 11:23:14 +00:00
committed by Gitee
2 changed files with 60 additions and 6 deletions
+44 -6
View File
@@ -98,12 +98,24 @@
v-show="state.accountInfo.type === '2'" v-show="state.accountInfo.type === '2'"
> >
<view class="unit" /> <view class="unit" />
<uni-easyinput <!-- <uni-easyinput
:inputBorder="false" :inputBorder="false"
class="ss-flex-1 ss-p-l-10" class="ss-flex-1 ss-p-l-10"
v-model="state.accountInfo.bankName" v-model="state.accountInfo.bankName"
placeholder="请输入提现银行" placeholder="请输入提现银行"
/> /> -->
<!--银行改为下拉选择-->
<picker @change="bankChange" :value="state.accountInfo.bankName" :range="state.bankList" range-key="label" style="width:100%">
<uni-easyinput
:inputBorder="false"
:value="state.selectedBankName"
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 +164,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,17 +189,19 @@
frozenDays: 0, // 冻结天数 frozenDays: 0, // 冻结天数
minPrice: 0, // 最低提现金额 minPrice: 0, // 最低提现金额
withdrawTypes: [], // 提现方式 withdrawTypes: [], // 提现方式
bankList:[], //银行字典数据
selectedBankName:"",//选中的银行名称
}); });
// 打开提现方式的弹窗 // 打开提现方式的弹窗
const onAccountSelect = (e) => { const onAccountSelect = (e) => {
state.accountSelect = e; state.accountSelect = e;
}; };
// 提交提现 // 提交提现
const onConfirm = async () => { const onConfirm = async () => {
// 参数校验 // 参数校验
debugger; //debugger;
if ( if (
!state.accountInfo.price || !state.accountInfo.price ||
state.accountInfo.price > state.brokerageInfo.price || state.accountInfo.price > state.brokerageInfo.price ||
@@ -233,7 +248,7 @@
if (data) { if (data) {
state.minPrice = data.brokerageWithdrawMinPrice || 0; state.minPrice = data.brokerageWithdrawMinPrice || 0;
state.frozenDays = data.brokerageFrozenDays || 0; state.frozenDays = data.brokerageFrozenDays || 0;
state.withdrawTypes = data.brokerageWithdrawTypes; state.withdrawTypes = data.brokerageWithdrawTypes;
} }
} }
@@ -244,10 +259,33 @@
state.brokerageInfo = data; state.brokerageInfo = data;
} }
} }
//获取提现银行配置字典
async function getDictDataListByType(){
let { code, data } = await DictApi.getDictDataListByType('brokerage_bank_name');
if (code !== 0) {
return;
}
if(data && data.length > 0) {
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>
+16
View File
@@ -0,0 +1,16 @@
import request from '@/sheep/request';
const DictApi = {
// 根据字典类型查询字典数据信息
getDictDataListByType: (type) => {
return request({
url: `/system/dict-data/type`,
method: 'GET',
params: {
type,
},
});
},
};
export default DictApi;