You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

147 lines
3.9 KiB
Vue

<template>
<view>
<kevyloading v-if="loading" type="bsm-loader" color="#618af8" transparent></kevyloading>
<wd-form v-if="!loading" :model="form" :rules="rules" :disabled="mode == 'show'" ref="dialogForm"
label-width="100px">
<wd-form-item label="收款人" prop="user_name">
<wd-input placeholder="请输入收款人" v-model="dataForm.user_name" clearable
style="width: 100%"></wd-input>
</wd-form-item>
<wd-form-item label="联系电话" prop="user_mobile">
<wd-input placeholder="请输入联系电话" v-model="dataForm.user_mobile" clearable style="width: 100%"></wd-input>
</wd-form-item>
<wd-form-item label="提现金额" prop="user_name">
<wd-input type="number" placeholder="请输入提现金额" step="0.01" v-model.number="dataForm.cash_price" clearable
style="width: 100%"></wd-input>
</wd-form-item>
<wd-form-item label="提现类型" prop="user_name">
<wd-radio-group v-model="dataForm.type" :inline="true" shape='dot'>
<wd-radio :value="0">银行卡</wd-radio>
<wd-radio :value="1">微信</wd-radio>
<wd-radio :value="2">支付宝</wd-radio>
</wd-radio-group>
</wd-form-item>
<template v-if="dataForm.type == 0">
<wd-form-item label="开户行" prop="bank_name">
<wd-input placeholder="请输入开户行" v-model="dataForm.bank_name" clearable style="width: 100%"></wd-input>
</wd-form-item>
<wd-form-item label="银行卡号" prop="bank_code">
<wd-input placeholder="请输入银行卡号" v-model="dataForm.bank_code" clearable style="width: 100%"></wd-input>
</wd-form-item>
</template>
<template v-if="dataForm.type == 1">
<wd-form-item label="微信收款码" prop="wx_payee_pic">
<yUpload v-model="dataForm.wx_payee_pic" :size="1"></yUpload>
</wd-form-item>
</template>
<template v-if="dataForm.type == 2">
<wd-form-item label="支付宝账号" prop="ali_code">
<wd-input placeholder="请输入账号" v-model="dataForm.ali_code" clearable style="width: 100%"></wd-input>
</wd-form-item>
</template>
<!-- 提交按钮 -->
<view class="mt-2 px-12 py-3 bg-slate-50">
<wd-button type="primary" size="large" @click="handleSubmit" block>
保存
</wd-button>
</view>
</wd-form>
</view>
</template>
<script>
import yGoods from "@/components/yGoods/index.vue";
import uniDataPicker from "@/components/uni-data-picker/components/uni-data-picker/uni-data-picker.vue";
import kevyloading from "@/components/kevy-loading/kevy-loading";
import utils from '@/utils/utils.js'
import {
useApi
} from "@/hooks/useApi.js"
import discountApi from '@/api/mall/discount.js';
import yUpload from "@/components/yUpload/index.vue";
console.log(yGoods);
/**
* 从本地存储中获取用户信息
*/
const user_info = uni.getStorageSync("user_info");
export default {
components: {
yGoods,
uniDataPicker,
kevyloading,
yUpload
},
data() {
return {
utils,
user_info,
// 表单数据
dataForm: {
type: 0,
ali_code: "",
bank_code: "",
bank_name: "",
user_mobile: "",
user_name: "",
wx_payee_pic: "",
cash_price: ''
},
columns: [],
loading: false
};
},
onLoad(e) {
this.getData()
},
methods: {
async getData() {
const res = await discountApi.caiwu.shopData()
console.log(res, 'res')
this.dataForm = res.data.default_cash ? res.data.default_cash : {}
},
/**
* 处理表单提交
*/
async handleSubmit() {
uni.showLoading({
title: '提交中'
})
// 处理表单提交的逻辑
const res = await discountApi.caiwu.cashSubmit({
...this.dataForm,
});
uni.hideLoading()
uni.showToast({
title: res.msg,
icon: 'none'
});
if (res.code == 0) {
setTimeout(() => {
uni.navigateBack()
}, 1500);
}
},
},
};
</script>
<style>
/* 在这里添加样式,根据需要自定义表单样式 */
</style>