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

pull/91/MERGE
YunaiV 2024-09-05 20:08:48 +08:00
parent 1cfd974fed
commit 81cd02bbee
3 changed files with 49 additions and 59 deletions

View File

@ -15,7 +15,10 @@
<view class="num-title">可提现金额</view> <view class="num-title">可提现金额</view>
<view class="wallet-num">{{ fen2yuan(state.brokerageInfo.brokeragePrice) }}</view> <view class="wallet-num">{{ fen2yuan(state.brokerageInfo.brokeragePrice) }}</view>
</view> </view>
<button class="ss-reset-button log-btn" @tap="sheep.$router.go('/pages/commission/wallet', { type: 2 })"> <button
class="ss-reset-button log-btn"
@tap="sheep.$router.go('/pages/commission/wallet', { type: 2 })"
>
提现记录 提现记录
</button> </button>
</view> </view>
@ -98,24 +101,23 @@
v-show="state.accountInfo.type === '2'" v-show="state.accountInfo.type === '2'"
> >
<view class="unit" /> <view class="unit" />
<!-- <uni-easyinput <!--银行改为下拉选择-->
:inputBorder="false" <picker
class="ss-flex-1 ss-p-l-10" @change="bankChange"
v-model="state.accountInfo.bankName" :value="state.bankListSelectedIndex"
placeholder="请输入提现银行" :range="state.bankList"
/> --> range-key="label"
<!--银行改为下拉选择--> style="width: 100%"
<picker @change="bankChange" :value="state.accountInfo.bankName" :range="state.bankList" range-key="label" style="width:100%"> >
<uni-easyinput <uni-easyinput
:inputBorder="false" :inputBorder="false"
:value="state.selectedBankName" :value="state.accountInfo.bankName"
placeholder="请选择银行" placeholder="请选择银行"
suffixIcon="right" suffixIcon="right"
disabled disabled
:styles="{disableColor:'#fff',borderColor:'#fff',color:'#333!important'}" :styles="{ disableColor: '#fff', borderColor: '#fff', color: '#333!important' }"
/> />
</picker> </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>
@ -189,13 +191,13 @@
frozenDays: 0, // frozenDays: 0, //
minPrice: 0, // minPrice: 0, //
withdrawTypes: [], // withdrawTypes: [], //
bankList:[], // bankList: [], //
selectedBankName:"",// bankListSelectedIndex: '', // bankList index
}); });
// //
const onAccountSelect = (e) => { const onAccountSelect = (e) => {
state.accountSelect = e; state.accountSelect = e;
}; };
// //
@ -230,12 +232,12 @@
confirmText: '查看记录', confirmText: '查看记录',
success: (res) => { success: (res) => {
if (res.confirm) { if (res.confirm) {
sheep.$router.go('/pages/commission/wallet', { type: 2 }) sheep.$router.go('/pages/commission/wallet', { type: 2 });
return; return;
} }
getBrokerageUser(); getBrokerageUser();
state.accountInfo = {}; state.accountInfo = {};
} },
}); });
}; };
@ -248,7 +250,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;
} }
} }
@ -259,34 +261,30 @@
state.brokerageInfo = data; state.brokerageInfo = data;
} }
} }
// //
async function getDictDataListByType(){ async function getDictDataListByType() {
let { code, data } = await DictApi.getDictDataListByType('brokerage_bank_name'); let { code, data } = await DictApi.getDictDataListByType('brokerage_bank_name');
if (code !== 0) { if (code !== 0) {
return; return;
} }
if(data && data.length > 0) { if (data && data.length > 0) {
state.bankList = data; state.bankList = data;
} }
} }
function bankChange(e){ //
console.log(e); function bankChange(e) {
let value = e.target.value; const value = e.detail.value;
state.accountInfo.bankName = value; state.bankListSelectedIndex = value;
let curr = state.bankList?.filter(item=>{ state.accountInfo.bankName = state.bankList[value].label;
return item.value == value
})[0];
console.log(curr);
state.selectedBankName = curr.label;
} }
onBeforeMount(() => { onBeforeMount(() => {
getWithdrawRules(); getWithdrawRules();
getBrokerageUser(); getBrokerageUser();
getDictDataListByType();// getDictDataListByType(); //
}) });
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@ -2,14 +2,6 @@ import request from '@/sheep/request';
// 拼团 API // 拼团 API
const CombinationApi = { const CombinationApi = {
// 获得拼团活动列表
getCombinationActivityList: (count) => {
return request({
url: '/promotion/combination-activity/list',
method: 'GET',
params: { count },
});
},
// 获得拼团活动分页 // 获得拼团活动分页
getCombinationActivityPage: (params) => { getCombinationActivityPage: (params) => {

View File

@ -6,11 +6,11 @@ const DictApi = {
return request({ return request({
url: `/system/dict-data/type`, url: `/system/dict-data/type`,
method: 'GET', method: 'GET',
params: { params: {
type, type,
}, },
}); });
}, },
}; };
export default DictApi; export default DictApi;