This commit is contained in:
zmj 2024-05-14 22:36:29 +08:00
parent d456784cab
commit 9d664f62d2
3 changed files with 103 additions and 143 deletions

View File

@ -9,12 +9,11 @@
{{form.is_own?'对公账户':'个人账户'}} {{form.is_own?'对公账户':'个人账户'}}
</view> </view>
<view style="display: flex;align-items: center;color: #20B128;" @click="showPop1=true"> <view style="display: flex;align-items: center;color: #20B128;" @click="showPop1=true">
<text>更换账户</text> <up-icon color="#20B128" name="arrow-right"></up-icon> <text>账户绑定</text> <up-icon color="#20B128" name="arrow-right"></up-icon>
</view> </view>
</view> </view>
<view class="form"> <view class="form">
<up-form labelPosition="left" borderBottom :label-style="{fontSize:'30rpx'}" :model="model1" :rules="rules" <up-form labelPosition="left" borderBottom :label-style="{fontSize:'30rpx'}" labelWidth='70'>
ref="form1" labelWidth='70'>
<up-form-item label="开户银行" prop="userInfo.name" borderBottom ref="item1" @click="showPop=true"> <up-form-item label="开户银行" prop="userInfo.name" borderBottom ref="item1" @click="showPop=true">
<text style="padding-left: 20rpx;" v-if="form.bank_id">{{form.bank_name}}</text> <text style="padding-left: 20rpx;" v-if="form.bank_id">{{form.bank_name}}</text>
<text v-else style="color: #20B128;padding-left: 20rpx;">点击选择开户银行</text> <text v-else style="color: #20B128;padding-left: 20rpx;">点击选择开户银行</text>
@ -59,10 +58,10 @@
<up-icon name="close" color="#303133" size="24" @click="showPop1=false" <up-icon name="close" color="#303133" size="24" @click="showPop1=false"
style="position: absolute;top: 20rpx;right: 20rpx;"></up-icon> style="position: absolute;top: 20rpx;right: 20rpx;"></up-icon>
<view class="bank-list"> <view class="bank-list">
<view class="bank-li" @click="form.is_own=0,showPop1=false"> <view class="bank-li" @click="choseAccount(0)">
<text>个人账户</text> <text>个人账户</text>
</view> </view>
<view class="bank-li" @click="form.is_own=1,showPop1=false"> <view class="bank-li" @click="choseAccount(1)">
<text>对公账户</text> <text>对公账户</text>
</view> </view>
</view> </view>
@ -75,7 +74,8 @@
<script setup> <script setup>
import { import {
bankListApi, bankListApi,
bindCradApi bindCradApi,
amountAccountApi
} from "@/api/balance.js" } from "@/api/balance.js"
import { import {
ref, ref,
@ -93,6 +93,48 @@
bankList.value = res.data.lists bankList.value = res.data.lists
} }
const bank_list = ref([])
const getBanlance = () => {
amountAccountApi().then(res => {
bank_list.value = res.data.bank_list
getFormData(form, res.data.bank_list[0])
})
}
getBanlance()
const form = reactive({
"name": "",
"bank_id": 1,
"bank_name": '',
"bank_code": "",
"bank_branch": "",
"financial_img": "",
"is_own": 0,
phone: '',
"id_card": "",
"mer_id": userStore?.userInfo?.merchant?.mer_id,
supplier_id: userStore?.userInfo?.supplier?.id,
user_type: userStore?.userInfo?.merchant?.mer_id ? '1' : '2'
})
const getFormData = (form, target) => {
form.name = target.name || ''
form.bank_id = target.bank_id || ''
form.bank_name = target.bank_name || ''
form.bank_code = target.bank_code || ''
form.bank_branch = target.bank_branch || ''
form.phone = target.phone || ''
form.id_card = target.id_card || ''
form.is_own = target.is_own
}
const choseAccount = (type) => {
getFormData(form, bank_list.value[type])
showPop1.value = false
}
const choseBank = (item) => { const choseBank = (item) => {
form.bank_name = item.name form.bank_name = item.name
form.bank_id = item.id form.bank_id = item.id
@ -107,20 +149,7 @@
} }
const form = reactive({
"name": "赵明军",
"bank_id": 1,
"bank_name": '中国见识过和',
"bank_code": "6213362109985515778",
"bank_branch": "支行",
"financial_img": "",
"is_own": 0,
phone: '19130550023',
"id_card": "513701200012105613",
"mer_id": userStore?.userInfo?.merchant?.mer_id,
supplier_id: userStore?.userInfo?.supplier?.id,
user_type: userStore?.userInfo?.merchant?.mer_id ? '1' : '2'
})
const submit = () => { const submit = () => {
@ -134,55 +163,6 @@
} }
// 使 reactive
const state = reactive({
showSex: false,
model1: {
userInfo: {
name: 'uview-plus UI',
sex: '',
},
},
actions: [{
name: '男'
},
{
name: '女'
},
{
name: '保密'
},
],
rules: {
'userInfo.name': {
type: 'string',
required: true,
message: '请填写姓名',
trigger: ['blur', 'change'],
},
'userInfo.sex': {
type: 'string',
max: 1,
required: true,
message: '请选择男或女',
trigger: ['blur', 'change'],
},
},
radio: '',
switchVal: false,
});
// 使 ref
const formRef = ref(null);
//
function sexSelect(e) {
state.model1.userInfo.sex = e.name;
if (formRef.value) {
formRef.value.validateField('userInfo.sex');
}
}
getBankList() getBankList()
</script> </script>

View File

@ -15,15 +15,16 @@
</view> </view>
</view> </view>
<view style="margin-top: 20rpx;" @click="showDate=true"> <view style="margin-top: 20rpx; display: flex;align-items: center;" @click="showDate=true">
<text>2024-4-7</text>-<text>2024-4-7</text> <text>{{formatTimestampToYearMonth(nowTimes) }}</text> <up-icon name="arrow-down"></up-icon>
</view> </view>
<view class="recoder"> <view class="recoder" v-if="lists.length">
<view class="card" v-for="(item,index) in lists" :key="index"> <view class="card" v-for="(item,index) in lists" :key="index">
<view class="right"> <view class="right">
<view class="item" style="justify-content: flex-start;"> <view class="item" style="justify-content: flex-start;">
<text class="rest">余额提现至</text> <text class="rest">余额提现至</text>
<text class="code">{{item.merchant_bank_info.bank_code}}</text> <text v-if="item.merchant_bank_info.bank_code"
class="code">({{item.merchant_bank_info.bank_code.substring(item.merchant_bank_info.bank_code.length - 4)}})</text>
<text class="withdraw-type legal_company">{{ item.merchant_bank_info.is_own?"对公" :"个人"}}</text> <text class="withdraw-type legal_company">{{ item.merchant_bank_info.is_own?"对公" :"个人"}}</text>
</view> </view>
<view class="item"> <view class="item">
@ -39,17 +40,12 @@
</view> </view>
<view class="remark" v-if="item.fail_msg">{{item.fail_msg}}</view> <view class="remark" v-if="item.fail_msg">{{item.fail_msg}}</view>
</view> </view>
</view> </view>
<up-empty v-else mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png">
</up-empty>
<up-datetime-picker :show="showDate" @confirm='confirmDate' :maxDate='now' @cancel='showDate=false'
<!-- <up-popup :show="showPop" :round="10" mode="bottom" @close="showPop=false" @open="showPop=true"> @close='showDate=false' v-model="nowTimes" mode="year-month"></up-datetime-picker>
<hDatetimePicker ref="pickerDate" @reset="showPop=false" @confirm="confirm">
</hDatetimePicker>
</up-popup> -->
<up-datetime-picker hasInput :show="showDate" @confirm='confirmDate' :maxDate='now' @cancel='showDate=false'
@close='showDate=false' v-model="times" mode="year-month"></up-datetime-picker>
</view> </view>
</template> </template>
@ -61,12 +57,16 @@
} from "vue" } from "vue"
import { import {
UserWithdrawListsApi, UserWithdrawListsApi,
UserWithdrawIndexApi UserWithdrawIndexApi,
} from "@/api/balance.js" } from "@/api/balance.js"
const showDate = ref(false) const showDate = ref(false)
const count = ref(0) const count = ref(0)
const total = ref(0) const total = ref(0)
const nowTimes = ref(new Date().getFullYear() + '-' + (new Date().getMonth() + 1))
const getInfo = async () => { const getInfo = async () => {
let res = await UserWithdrawIndexApi() let res = await UserWithdrawIndexApi()
count.value = res.data.count count.value = res.data.count
@ -77,19 +77,29 @@
const lists = ref([]) const lists = ref([])
const getList = async () => { const getList = async () => {
let res = await UserWithdrawListsApi({ let res = await UserWithdrawListsApi({
create_time: '2024-05 ' create_time: nowTimes.value
}) })
lists.value = res.data.lists lists.value = res.data.lists
console.log(res)
} }
getList() getList()
let now = ref(new Date().getTime()) let now = ref(new Date().getTime())
const confirmDate = (e) => { function formatTimestampToYearMonth(timestamp) {
var date = new Date(timestamp);
var year = date.getFullYear();
var month = date.getMonth() + 1; // 01
if (month < 10) {
month = '0' + month; // 10
}
return year + '-' + month;
}
console.log(e) const confirmDate = (e) => {
nowTimes.value = formatTimestampToYearMonth(e.value)
getList()
showDate.value = false
} }
@ -102,7 +112,6 @@
showPop.value = true showPop.value = true
} }
const confirm = (e) => { const confirm = (e) => {
console.log(e)
showPop.value = false showPop.value = false
} }
</script> </script>

View File

@ -12,7 +12,7 @@
<view class=""> <view class="">
提现至 提现至
</view> </view>
<view style="font-weight: bold;"> <view style="font-weight: bold;" @click="showPop1=true">
{{target_bank.is_own?'对公账户':"个人账户"}} {{target_bank.is_own?'对公账户':"个人账户"}}
</view> </view>
<view style="display: flex;align-items: center;color: #20B128;" <view style="display: flex;align-items: center;color: #20B128;"
@ -21,8 +21,7 @@
</view> </view>
</view> </view>
<view class="form" v-if='true'> <view class="form" v-if='true'>
<up-form labelPosition="left" borderBottom :label-style="{fontSize:'30rpx'}" :model="model1" :rules="rules" <up-form labelPosition="left" borderBottom :label-style="{fontSize:'30rpx'}" ref="form1" labelWidth='70'>
ref="form1" labelWidth='70'>
<up-form-item label="银行卡" prop="userInfo.name" borderBottom ref="item1"> <up-form-item label="银行卡" prop="userInfo.name" borderBottom ref="item1">
<up-input style="border: none;" v-model="target_bank.bank_name" /> <up-input style="border: none;" v-model="target_bank.bank_name" />
</up-form-item> </up-form-item>
@ -44,8 +43,6 @@
</text> </text>
</up-form> </up-form>
</view> </view>
<up-empty mode="data" v-else :text='emptyText' <up-empty mode="data" v-else :text='emptyText'
icon="https://lihai001.oss-cn-chengdu.aliyuncs.com/attach/89e93202405131146497294.png" /> icon="https://lihai001.oss-cn-chengdu.aliyuncs.com/attach/89e93202405131146497294.png" />
<view class="detail" @click="navgo('/pageQuota/Balance/detail')"> <view class="detail" @click="navgo('/pageQuota/Balance/detail')">
@ -54,6 +51,21 @@
<view class="submit-btn"> <view class="submit-btn">
<up-button text="提现" @click="submit" shape="circle" color="#50C758"></up-button> <up-button text="提现" @click="submit" shape="circle" color="#50C758"></up-button>
</view> </view>
<up-popup :show="showPop1" :round="10" mode="bottom" @close="showPop1=false" @open="showPop1=true">
<view class="popContent">
<view style="text-align: center;font-weight: bold;">请选择提现账户</view>
<up-icon name="close" color="#303133" size="24" @click="showPop1=false"
style="position: absolute;top: 20rpx;right: 20rpx;"></up-icon>
<view class="bank-list">
<view class="bank-li" @click="choseAccount(0)">
<text>个人账户</text>
</view>
<view class="bank-li" @click="choseAccount(1)">
<text>对公账户</text>
</view>
</view>
</view>
</up-popup>
</view> </view>
</template> </template>
@ -68,6 +80,14 @@
reactive reactive
} from 'vue'; } from 'vue';
const emptyText = '您尚未绑定提现账户,\n点击右上角"添加账户"' const emptyText = '您尚未绑定提现账户,\n点击右上角"添加账户"'
const showPop1 = ref(false)
const choseAccount = (type) => {
target_bank.value = bank_list.value[type]
console.log(target_bank.value)
showPop1.value = false
}
const showPop = ref(false) const showPop = ref(false)
const navgo = (url) => { const navgo = (url) => {
@ -124,55 +144,6 @@
} }
// 使 reactive
const state = reactive({
showSex: false,
model1: {
userInfo: {
name: 'uview-plus UI',
sex: '',
},
},
actions: [{
name: '男'
},
{
name: '女'
},
{
name: '保密'
},
],
rules: {
'userInfo.name': {
type: 'string',
required: true,
message: '请填写姓名',
trigger: ['blur', 'change'],
},
'userInfo.sex': {
type: 'string',
max: 1,
required: true,
message: '请选择男或女',
trigger: ['blur', 'change'],
},
},
radio: '',
switchVal: false,
});
// 使 ref
const formRef = ref(null);
//
function sexSelect(e) {
state.model1.userInfo.sex = e.name;
if (formRef.value) {
formRef.value.validateField('userInfo.sex');
}
}
getBankList() getBankList()
</script> </script>