|
|
@@ -0,0 +1,785 @@
|
|
|
+<script setup lang="ts">
|
|
|
+import { ref, computed } from 'vue'
|
|
|
+import '@/utils/dateFormat'
|
|
|
+import { netBankcardUpdate, getBankList, getBankSignRecord, getBankCardInfo } from '@/api/pay'
|
|
|
+import { getImageUrl } from '@/utils/imageUtil'
|
|
|
+import Upload from '@/components/upload/index.vue';
|
|
|
+import BankCardSelector from './bankCard-select.vue';
|
|
|
+
|
|
|
+// 域名
|
|
|
+const domain = ref('')
|
|
|
+// 审核状态:00-初始,01-签约成功, 02-拒绝, 03-待审核, 04-待签约
|
|
|
+const auditStatus = ref('')
|
|
|
+// 审核失败的错误信息
|
|
|
+const auditMessage = ref('')
|
|
|
+// 是否处于可提交状态
|
|
|
+const isReSubmit = ref(false)
|
|
|
+
|
|
|
+// 表单数据
|
|
|
+const form = ref({
|
|
|
+ name: '',
|
|
|
+ contractedPhone: '',
|
|
|
+ phone: '',
|
|
|
+ bankId: '',
|
|
|
+ bankName: '',
|
|
|
+ bankCardNumber: '',
|
|
|
+ openingBank: '',
|
|
|
+ startDate: '',
|
|
|
+ endDate: '',
|
|
|
+ idCard: '',
|
|
|
+ idAddress: '',
|
|
|
+ frontCard: '',
|
|
|
+ backCard: '',
|
|
|
+})
|
|
|
+
|
|
|
+// 表单校验规则
|
|
|
+const rules = ref({
|
|
|
+ bankName: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请选择存管银行',
|
|
|
+ trigger: ['blur', 'change'],
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ bankCardNumber: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请输入银行卡号',
|
|
|
+ trigger: ['blur', 'change'],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ min: 13,
|
|
|
+ max: 19,
|
|
|
+ message: '银行卡号位数不正确',
|
|
|
+ trigger: ['blur', 'change'],
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ name: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请输入姓名',
|
|
|
+ trigger: ['blur', 'change'],
|
|
|
+ },
|
|
|
+ { max: 20, message: '不能超过20个字符', trigger: ['blur', 'change'] },
|
|
|
+ ],
|
|
|
+ contractedPhone: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请输入手机号',
|
|
|
+ trigger: ['blur', 'change'],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ pattern: /^1[3-9]\d{9}$/,
|
|
|
+ message: '手机号码不正确',
|
|
|
+ trigger: ['blur', 'change'],
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ phone: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请输入手机号',
|
|
|
+ trigger: ['blur', 'change'],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ pattern: /^1[3-9]\d{9}$/,
|
|
|
+ message: '手机号码不正确',
|
|
|
+ trigger: ['blur', 'change'],
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ idCard: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请输入证件号码',
|
|
|
+ trigger: ['blur', 'change'],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ pattern: /^[1-9]\d{5}(18|19|20)\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])\d{3}[\dXx]$/,
|
|
|
+ message: '证件号码不正确',
|
|
|
+ trigger: ['blur', 'change'],
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ idAddress: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请输入证件地址',
|
|
|
+ trigger: ['blur', 'change'],
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ endDate: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请选择证件截止有效期',
|
|
|
+ trigger: ['blur', 'change'],
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ startDate: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请选择证件起始有效期',
|
|
|
+ trigger: ['blur', 'change'],
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ backCard: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请上传身份证国徽面',
|
|
|
+ trigger: ['change'],
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ frontCard: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请上传身份证人像面',
|
|
|
+ trigger: ['change'],
|
|
|
+ },
|
|
|
+ ],
|
|
|
+})
|
|
|
+
|
|
|
+// 银行数据
|
|
|
+const bankData = ref([])
|
|
|
+const isAgreed = ref([])
|
|
|
+const showDate = ref(false)
|
|
|
+type DateFieldName = 'startDate' | 'endDate'
|
|
|
+const datetimeKey = ref<DateFieldName | undefined>(undefined) // 当前操作的日期字段名
|
|
|
+const datetimeValue = ref(new Date().getTime()) // 日期选择器的值(时间戳)
|
|
|
+const maxDate = new Date('2200-12-31').getTime()
|
|
|
+
|
|
|
+// 上传组件的文件列表
|
|
|
+type UploadFileItem = {
|
|
|
+ url: string
|
|
|
+ localUrl?: string
|
|
|
+ status?: 'success' | 'uploading' | 'error'
|
|
|
+ message?: string
|
|
|
+}
|
|
|
+
|
|
|
+const idCardBackList = ref<UploadFileItem[]>([])
|
|
|
+const idCardFrontList = ref<UploadFileItem[]>([])
|
|
|
+
|
|
|
+const fileListMap: Record<string, Ref<UploadFileItem[]>> = {
|
|
|
+ idCardFrontList,
|
|
|
+ idCardBackList
|
|
|
+}
|
|
|
+
|
|
|
+// 计算属性
|
|
|
+const idCardFrontUrl = computed(() => {
|
|
|
+ return idCardFrontList.value.length > 0 ? idCardFrontList.value[0].url : ''
|
|
|
+})
|
|
|
+
|
|
|
+const idCardBackUrl = computed(() => {
|
|
|
+ return idCardBackList.value.length > 0 ? idCardBackList.value[0].url : ''
|
|
|
+})
|
|
|
+
|
|
|
+const isFormDisabled = computed(() => {
|
|
|
+ return ['00', '02', '03', '04'].includes(auditStatus.value) && !isReSubmit.value
|
|
|
+})
|
|
|
+
|
|
|
+const statusIcon = computed(() => {
|
|
|
+ switch (auditStatus.value) {
|
|
|
+ case '00':
|
|
|
+ case '03':
|
|
|
+ case '04':
|
|
|
+ return 'clock'
|
|
|
+ case '02':
|
|
|
+ return 'close-circle'
|
|
|
+ default:
|
|
|
+ return 'clock'
|
|
|
+ }
|
|
|
+})
|
|
|
+
|
|
|
+// 审核状态
|
|
|
+const statusText = computed(() => {
|
|
|
+ switch (auditStatus.value) {
|
|
|
+ case '00':
|
|
|
+ return '银行卡信息已提交'
|
|
|
+ case '02':
|
|
|
+ return '银行卡审核被拒绝'
|
|
|
+ case '03':
|
|
|
+ return '银行卡待审核'
|
|
|
+ case '04':
|
|
|
+ return '银行卡待签约'
|
|
|
+ default:
|
|
|
+ return ''
|
|
|
+ }
|
|
|
+})
|
|
|
+
|
|
|
+// 页面加载
|
|
|
+onLoad((options?: Record<string, string>) => {
|
|
|
+ fetchBankList()
|
|
|
+ const { type, cardId } = options || {}
|
|
|
+ if (type === 'update' && cardId) {
|
|
|
+ fetchBankAccountDetail(cardId)
|
|
|
+ } else {
|
|
|
+ getSignStatus()
|
|
|
+ }
|
|
|
+
|
|
|
+ // #ifdef H5
|
|
|
+ domain.value = extractDomain(window.location.href)
|
|
|
+ // #endif
|
|
|
+ // #ifndef H5
|
|
|
+ domain.value = extractDomain(import.meta.env.VITE_SERVER_BASEURL)
|
|
|
+ // #endif
|
|
|
+})
|
|
|
+
|
|
|
+onShow(() => {
|
|
|
+ // form.value.phone = uni.getStorageSync('user')?.userInfo?.phone;
|
|
|
+})
|
|
|
+
|
|
|
+const formRef = ref()
|
|
|
+onReady(() => {
|
|
|
+ formRef.value.setRules(rules.value);
|
|
|
+})
|
|
|
+
|
|
|
+// 获取银行列表
|
|
|
+function fetchBankList() {
|
|
|
+ getBankList().then((res: any) => {
|
|
|
+ if (res.data.code === 200 && res.data.result) {
|
|
|
+ bankData.value = res.data.result;
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+// 获取签约状态
|
|
|
+function getSignStatus() {
|
|
|
+ getBankSignRecord().then((res: any) => {
|
|
|
+ if (res.data.code === 200 && res.data.result) {
|
|
|
+ const { state } = res.data.result;
|
|
|
+ switch (state) {
|
|
|
+ case '01':
|
|
|
+ // 签约成功跳转银行卡列表
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/packageB/payment/bankCard-list',
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ case '00':
|
|
|
+ case '02':
|
|
|
+ case '03':
|
|
|
+ case '04':
|
|
|
+ // 查详情接口
|
|
|
+ fetchBankAccountDetail(res.data.result.id);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }).catch((err: any) => {
|
|
|
+ console.error('获取审核状态失败:', err);
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+// 获取银行账户信息详情
|
|
|
+function fetchBankAccountDetail(id: string) {
|
|
|
+ return getBankCardInfo(id).then((res: any) => {
|
|
|
+ if (res.data.code === 200 && res.data.result) {
|
|
|
+ auditStatus.value = res.data.result.state;
|
|
|
+ auditMessage.value = res.data.result.reason;
|
|
|
+ const bankCard = res.data.result.bankCard || {};
|
|
|
+ const idCardInfo = res.data.result.idCardInfo || {};
|
|
|
+ const accountInfo = {
|
|
|
+ name: bankCard.name || idCardInfo.name || '',
|
|
|
+ bankId: bankCard.bankId || '',
|
|
|
+ bankName: bankCard.bankName || '',
|
|
|
+ idCard: idCardInfo.identityNo || '',
|
|
|
+ startDate: formatIdCardDate(idCardInfo.idEffectiveDate),
|
|
|
+ endDate: formatIdCardDate(idCardInfo.idExpiryDate),
|
|
|
+ idAddress: idCardInfo.addr || '',
|
|
|
+ bankCardNumber: bankCard.bankCardNumber || '',
|
|
|
+ contractedPhone: bankCard.contractedPhone || '',
|
|
|
+ phone: bankCard.reservedPhone || '',
|
|
|
+ };
|
|
|
+ form.value = { ...form.value, ...accountInfo };
|
|
|
+ form.value.frontCard = idCardInfo.idPhotoFront || '';
|
|
|
+ form.value.backCard = idCardInfo.idPhotoBack || '';
|
|
|
+ idCardFrontList.value = idCardInfo.idPhotoFront ? [{ url: idCardInfo.idPhotoFront }] : [];
|
|
|
+ idCardBackList.value = idCardInfo.idPhotoBack ? [{ url: idCardInfo.idPhotoBack }] : [];
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+// 银行选择
|
|
|
+const bcSelector = ref()
|
|
|
+function onShowBank() {
|
|
|
+ bcSelector.value?.open()
|
|
|
+}
|
|
|
+
|
|
|
+const selectedId = ref('') // 选中的银行ID
|
|
|
+type BankCardItem = {
|
|
|
+ id: string | number
|
|
|
+ logo: string
|
|
|
+ bankName: string
|
|
|
+ last4?: string
|
|
|
+}
|
|
|
+
|
|
|
+function onSelectBank(e: BankCardItem) {
|
|
|
+ form.value.bankId = String(e.id);
|
|
|
+ form.value.bankName = e.bankName;
|
|
|
+ validateField('bankName')
|
|
|
+}
|
|
|
+
|
|
|
+// 日期选择
|
|
|
+function onShowDate(fieldName: DateFieldName) {
|
|
|
+ datetimeKey.value = fieldName
|
|
|
+ // 如果form中已有值,使用该值;否则使用当前日期
|
|
|
+ const currentValue = form.value[fieldName]
|
|
|
+ datetimeValue.value = currentValue
|
|
|
+ ? new Date(currentValue).getTime()
|
|
|
+ : new Date().getTime()
|
|
|
+ showDate.value = true
|
|
|
+}
|
|
|
+
|
|
|
+function onSelectDate(e: { value: number }) {
|
|
|
+ form.value[datetimeKey.value!] = new Date(e.value).Format('YYYY-MM-DD')
|
|
|
+ showDate.value = false
|
|
|
+ // 手动触发表单校验
|
|
|
+ validateField(datetimeKey.value!)
|
|
|
+}
|
|
|
+
|
|
|
+// 校验指定字段
|
|
|
+function validateField(field: string) {
|
|
|
+ if (formRef.value) {
|
|
|
+ formRef.value.validateField(field)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// 上传回调
|
|
|
+function onUpload(e: any[], t: string) {
|
|
|
+ const listRef = fileListMap[t]
|
|
|
+ if (listRef) {
|
|
|
+ listRef.value = e // ✅ 正确赋值
|
|
|
+ console.log(`${t} 已更新:`, e)
|
|
|
+ }
|
|
|
+ if (e.length > 0) {
|
|
|
+ // 获取身份证识别信息
|
|
|
+ getIdCardInfo(t);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// 获取身份证识别信息
|
|
|
+function getIdCardInfo(type: string) {
|
|
|
+ const fileList = type === 'idCardFrontList' ? idCardFrontList.value : idCardBackList.value;
|
|
|
+ const fileItem = fileList[0];
|
|
|
+ // 使用保留的本地文件路径
|
|
|
+ let localFilePath = fileItem.localUrl;
|
|
|
+ uni.uploadFile({
|
|
|
+ url: import.meta.env.VITE_SERVER_BASEURL + '/order/identify/idCard',
|
|
|
+ filePath: localFilePath,
|
|
|
+ name: type === 'idCardFrontList' ? 'image1' : 'image2',
|
|
|
+ header: {
|
|
|
+ 'X-Access-Token': uni.getStorageSync('token'),
|
|
|
+ // #ifdef MP-WEIXIN
|
|
|
+ AppType: '6',
|
|
|
+ deviceId: uni.getStorageSync('openId'),
|
|
|
+ // #endif
|
|
|
+ // #ifdef H5
|
|
|
+ AppType: 1,
|
|
|
+ deviceId: 'h5',
|
|
|
+ // #endif
|
|
|
+ },
|
|
|
+ success: uploadFileRes => {
|
|
|
+ formRef.value.setRules({});
|
|
|
+ let res = JSON.parse(uploadFileRes.data);
|
|
|
+ if (res.code == 200) {
|
|
|
+ let idCardInfo = res.result.customerInfo;
|
|
|
+ if (type === 'idCardFrontList') {
|
|
|
+ form.value.name = idCardInfo.name || '';
|
|
|
+ form.value.idCard = idCardInfo.identifyNumber || '';
|
|
|
+ form.value.idAddress = idCardInfo.addr || '';
|
|
|
+ } else {
|
|
|
+ // 处理身份证起始日期格式转换
|
|
|
+ if (idCardInfo.identifyValidDate) {
|
|
|
+ form.value.startDate = idCardInfo.identifyValidDate.replace(/^(\d{4})(\d{2})(\d{2})$/, '$1-$2-$3');
|
|
|
+ }
|
|
|
+ if (idCardInfo.identifyValidEndDate) {
|
|
|
+ form.value.endDate = idCardInfo.identifyValidEndDate.replace(/^(\d{4})(\d{2})(\d{2})$/, '$1-$2-$3');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ nextTick(() => {
|
|
|
+ // 恢复校验规则
|
|
|
+ formRef.value.setRules(rules);
|
|
|
+ // 如果需要,清除校验状态
|
|
|
+ formRef.value.clearValidate();
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ uni.$u.toast(res.message);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+// 身份证日期格式转换
|
|
|
+function formatIdCardDate(dateStr?: string): string {
|
|
|
+ if (!dateStr) return ''
|
|
|
+ return dateStr.replace(/^(\d{4})(\d{2})(\d{2})$/, '$1-$2-$3')
|
|
|
+}
|
|
|
+
|
|
|
+// 会员注册确认-跳转三方链接
|
|
|
+function confirmRegister(url: string, id?: string) {
|
|
|
+ const validate = openExternalLink(url)
|
|
|
+ if (validate) {
|
|
|
+ // #ifdef H5
|
|
|
+ window.location.href = url
|
|
|
+ // #endif
|
|
|
+ // #ifndef H5
|
|
|
+ uni.navigateTo({
|
|
|
+ url: `/pages-B/payment/web-view?webUrl=${encodeURIComponent(url)}&memberId=${id || ''}`,
|
|
|
+ })
|
|
|
+ // #endif
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ title: '打开失败,请检查链接',
|
|
|
+ icon: 'none',
|
|
|
+ })
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// 校验URL格式
|
|
|
+function openExternalLink(url: string): boolean {
|
|
|
+ if (!url || !/^https?:\/\/.+/.test(url)) {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ return true
|
|
|
+}
|
|
|
+
|
|
|
+// 提交
|
|
|
+async function onSubmit() {
|
|
|
+ // if(isAgreed.value === 0) {
|
|
|
+ // uni.showToast({ title: '请先同意用户协议', icon: 'none' });
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ // 将计算属性的值赋给form对象,以便校验
|
|
|
+ form.value.frontCard = idCardFrontUrl.value
|
|
|
+ form.value.backCard = idCardBackUrl.value
|
|
|
+
|
|
|
+ formRef.value.validate().then((res: any) => {
|
|
|
+ // console.log('表单校验成功', form.value);
|
|
|
+ let str = uni.$u.queryParams({
|
|
|
+ signStatus: '01'
|
|
|
+ });
|
|
|
+ let callbackUrl = `${domain.value}/pages-B/payment/certification-status${str}`
|
|
|
+ let params = {
|
|
|
+ bankCard: {
|
|
|
+ bankId: form.value.bankId,
|
|
|
+ bankName: form.value.bankName,
|
|
|
+ bankCardNumber: form.value.bankCardNumber,
|
|
|
+ name: form.value.name,
|
|
|
+ contractedPhone: form.value.contractedPhone,
|
|
|
+ reservedPhone: form.value.phone,
|
|
|
+ callbackUrl: callbackUrl,
|
|
|
+ },
|
|
|
+ idCardInfo: {
|
|
|
+ name: form.value.name,
|
|
|
+ identityNo: form.value.idCard,
|
|
|
+ idEffectiveDate: form.value.startDate,
|
|
|
+ idExpiryDate: form.value.endDate,
|
|
|
+ addr: form.value.idAddress,
|
|
|
+ idPhotoFront: form.value.frontCard,
|
|
|
+ idPhotoBack: form.value.backCard,
|
|
|
+ },
|
|
|
+ };
|
|
|
+ // console.log(params.bankCard.callbackUrl,'------------------');
|
|
|
+
|
|
|
+ uni.showLoading({
|
|
|
+ title: '处理中...',
|
|
|
+ mask: true,
|
|
|
+ });
|
|
|
+ netBankcardUpdate(params)
|
|
|
+ .then((res: any) => {
|
|
|
+ uni.hideLoading();
|
|
|
+ if (res.data.code === 200 && res.data.result) {
|
|
|
+ if (res.data.result.state == '01' && res.data.result.cerUrl) {
|
|
|
+ // 会员注册确认
|
|
|
+ confirmRegister(res.data.result.cerUrl, res.data.result.meberId);
|
|
|
+ } else {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages-B/payment/certification-status?signStatus=' + res.data.result.state,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ uni.$u.toast(res.data.message);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch((err: any) => {
|
|
|
+ uni.hideLoading();
|
|
|
+ uni.$u.toast('网络异常,请稍后重试');
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch((errors: any) => {
|
|
|
+ let f = errors.some((item: any) => ['idCardBackUrl', 'idCardFrontUrl'].indexOf(item.field) !== -1);
|
|
|
+ if (f) uni.$u.toast(errors[0].message);
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+// 重新提交
|
|
|
+function onReSubmit() {
|
|
|
+ isReSubmit.value = true
|
|
|
+}
|
|
|
+
|
|
|
+// 取主域名
|
|
|
+function extractDomain(url: string): string {
|
|
|
+ const regex = /^(https?:\/\/[^\/]+)/
|
|
|
+ const match = url.match(regex)
|
|
|
+ return match ? match[1] : ''
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<template>
|
|
|
+ <view class='new-content'>
|
|
|
+ <u-navbar title="绑定银行卡" :autoBack="true" :placeholder="true" :title-style="{ fontWeight: 'bold' }"></u-navbar>
|
|
|
+ <!-- 审核状态 -->
|
|
|
+ <view class="audit-status" v-if="auditStatus && auditStatus != '01'">
|
|
|
+ <view class="status-content">
|
|
|
+ <view class="status-info">
|
|
|
+ <u-icon :name="statusIcon" size="42rpx" class="status-icon"></u-icon>
|
|
|
+ <text class="status-text">{{ statusText }}</text>
|
|
|
+ </view>
|
|
|
+ <view class="status-btn">
|
|
|
+ <u-button
|
|
|
+ v-if="auditStatus == '02' && !isReSubmit"
|
|
|
+ type="primary"
|
|
|
+ @click="onReSubmit"
|
|
|
+ :customStyle="{
|
|
|
+ height: '59rpx',
|
|
|
+ fontSize: '29rpx',
|
|
|
+ color: '#FE171B',
|
|
|
+ backgroundColor: 'rgba(254, 23, 27, 0.05)',
|
|
|
+ border: '1rpx solid #FE171B',
|
|
|
+ padding: '3rpx 31rpx 8rpx',
|
|
|
+ }"
|
|
|
+ >重新提交</u-button
|
|
|
+ >
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <!-- 审核失败错误信息 -->
|
|
|
+ <view class="error-message" v-if="auditStatus != '01' && auditMessage">
|
|
|
+ <text class="message-text">{{ auditMessage }}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="page-container">
|
|
|
+ <u--form
|
|
|
+ ref="formRef"
|
|
|
+ :model="form"
|
|
|
+ :rules="rules"
|
|
|
+ labelPosition="left"
|
|
|
+ labelWidth="180rpx"
|
|
|
+ :labelStyle="{
|
|
|
+ fontWeight: '500',
|
|
|
+ fontSize: '28rpx',
|
|
|
+ color: '#333333',
|
|
|
+ }"
|
|
|
+ >
|
|
|
+ <view class="form-section">
|
|
|
+ <view class="idcard-upload">
|
|
|
+ <view>
|
|
|
+ <view
|
|
|
+ class="upload-wrapper"
|
|
|
+ :style="{
|
|
|
+ backgroundImage: `url(${getImageUrl('@local/mine/img-bank-bg.png')})`,
|
|
|
+ }"
|
|
|
+ >
|
|
|
+ <Upload name="idCardFront" width="300rpx" height="180rpx" :maxCount="1" @fileList="onUpload($event, 'idCardFrontList')" :disabled="isFormDisabled" :initList="idCardFrontList">
|
|
|
+ <template v-slot:content>
|
|
|
+ <view class="upload-slot">
|
|
|
+ <image class="slot-image" :src="getImageUrl('@local/mine/img-bank0.png')" mode="aspectFit"> </image>
|
|
|
+ </view>
|
|
|
+ </template>
|
|
|
+ </Upload>
|
|
|
+ </view>
|
|
|
+ <view style="font-size: 24rpx; color: #666; text-align: center">身份证人像面</view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view>
|
|
|
+ <view
|
|
|
+ class="upload-wrapper"
|
|
|
+ :style="{
|
|
|
+ backgroundImage: `url(${getImageUrl('@local/mine/img-bank-bg.png')})`,
|
|
|
+ }"
|
|
|
+ >
|
|
|
+ <Upload name="idCardBack" width="300rpx" height="180rpx" :maxCount="1" @fileList="onUpload($event, 'idCardBackList')" :disabled="isFormDisabled" :initList="idCardBackList">
|
|
|
+ <template v-slot:content>
|
|
|
+ <view class="upload-slot">
|
|
|
+ <image class="slot-image" :src="getImageUrl('@local/mine/img-bank1.png')" mode="aspectFit"> </image>
|
|
|
+ </view>
|
|
|
+ </template>
|
|
|
+ </Upload>
|
|
|
+ </view>
|
|
|
+ <view style="font-size: 24rpx; color: #666; text-align: center">身份证国徽面</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <!-- 隐藏的表单项,用于校验图片 -->
|
|
|
+ <u-form-item prop="frontCard" style="display: none"></u-form-item>
|
|
|
+ <u-form-item prop="backCard" style="display: none"></u-form-item>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="form-section">
|
|
|
+ <u-form-item label="姓名" prop="name" :border-bottom="true">
|
|
|
+ <u--input v-model="form.name" border="none" placeholder="请输入姓名" :disabled="isFormDisabled"></u--input>
|
|
|
+ </u-form-item>
|
|
|
+ <u-form-item label="证件号码" prop="idCard" :border-bottom="true">
|
|
|
+ <u--input v-model="form.idCard" border="none" placeholder="请输入证件号码" :disabled="isFormDisabled"></u--input>
|
|
|
+ </u-form-item>
|
|
|
+ <u-form-item label="证件有效期始" prop="startDate" :border-bottom="true" @click="onShowDate('startDate')" :disabled="isFormDisabled">
|
|
|
+ <u--input v-model="form.startDate" border="none" placeholder="请选择" :disabled="isFormDisabled"></u--input>
|
|
|
+ <template #right>
|
|
|
+ <u-icon name="arrow-right"></u-icon>
|
|
|
+ </template>
|
|
|
+ </u-form-item>
|
|
|
+ <u-form-item label="证件有效期止" prop="endDate" :border-bottom="true" @click="onShowDate('endDate')" :disabled="isFormDisabled">
|
|
|
+ <u--input v-model="form.endDate" border="none" placeholder="请选择" :disabled="isFormDisabled"></u--input>
|
|
|
+ <template #right>
|
|
|
+ <u-icon name="arrow-right"></u-icon>
|
|
|
+ </template>
|
|
|
+ <!-- <u-icon slot="right" name="arrow-right"></u-icon> -->
|
|
|
+ </u-form-item>
|
|
|
+ <u-form-item label="证件地址" prop="idAddress" :border-bottom="true">
|
|
|
+ <u--input v-model="form.idAddress" border="none" placeholder="请输入证件地址" :disabled="isFormDisabled"></u--input>
|
|
|
+ </u-form-item>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="form-section">
|
|
|
+ <u-form-item label="银行" prop="bankName" :border-bottom="true" @click="onShowBank" :disabled="isFormDisabled">
|
|
|
+ <u--input v-model="form.bankName" border="none" placeholder="请选择" :disabled="isFormDisabled"></u--input>
|
|
|
+ <template #right>
|
|
|
+ <u-icon name="arrow-right"></u-icon>
|
|
|
+ </template>
|
|
|
+ </u-form-item>
|
|
|
+ <u-form-item label="银行卡号" prop="bankCardNumber" :border-bottom="true">
|
|
|
+ <u--input v-model="form.bankCardNumber" type="number" border="none" placeholder="请输入银行卡号" :disabled="isFormDisabled"></u--input>
|
|
|
+ </u-form-item>
|
|
|
+ <u-form-item label="开卡人姓名" prop="name" :border-bottom="true">
|
|
|
+ <u--input v-model="form.name" border="none" placeholder="请输入姓名" :disabled="isFormDisabled"></u--input>
|
|
|
+ </u-form-item>
|
|
|
+ <u-form-item label="签约手机号" prop="contractedPhone" :border-bottom="true">
|
|
|
+ <u--input v-model="form.contractedPhone" border="none" type="number" placeholder="请输入手机号" :disabled="isFormDisabled"></u--input>
|
|
|
+ </u-form-item>
|
|
|
+ <u-form-item label="预留手机号" prop="phone" :border-bottom="true">
|
|
|
+ <u--input v-model="form.phone" border="none" type="number" placeholder="请输入手机号" :disabled="isFormDisabled"></u--input>
|
|
|
+ </u-form-item>
|
|
|
+ </view>
|
|
|
+ </u--form>
|
|
|
+
|
|
|
+ <view class="agreement-section" v-if="0">
|
|
|
+ <u-checkbox-group v-model="isAgreed">
|
|
|
+ <u-checkbox name="agree" shape="circle" label="我已阅读并同意《用户服务协议》" labelSize="24rpx" labelColor="#606266"></u-checkbox>
|
|
|
+ </u-checkbox-group>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="footer-bar">
|
|
|
+ <u-button type="primary" @click="onSubmit" v-if="(auditStatus == '02' && isReSubmit) || !auditStatus || auditStatus == '01'">保 存</u-button>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <!-- 选择器组件 -->
|
|
|
+ <BankCardSelector ref="bcSelector" :showChangeCard="false" :dataList="bankData" v-model="selectedId" @select="onSelectBank" />
|
|
|
+ <!-- 日期选择 -->
|
|
|
+ <u-datetime-picker
|
|
|
+ ref="datetimeRef"
|
|
|
+ mode="date"
|
|
|
+ :show="showDate"
|
|
|
+ :min-date="new Date('1950-01-01').getTime()"
|
|
|
+ :max-date="maxDate"
|
|
|
+ :close-on-click-overlay="true"
|
|
|
+ v-model="datetimeValue"
|
|
|
+ @close="showDate = false"
|
|
|
+ @cancel="showDate = false"
|
|
|
+ @confirm="onSelectDate"
|
|
|
+ ></u-datetime-picker>
|
|
|
+ </view>
|
|
|
+</template>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.page-container {
|
|
|
+ min-height: 100vh;
|
|
|
+ padding: 24rpx 24rpx;
|
|
|
+ background-color: #f8f8fa;
|
|
|
+
|
|
|
+ .form-section {
|
|
|
+ margin: 0 0 24rpx;
|
|
|
+ padding: 20rpx 24rpx;
|
|
|
+ box-shadow: 0 2rpx 8rpx 0 rgba(214, 225, 237, 0.1);
|
|
|
+ border-radius: 16rpx;
|
|
|
+ border: 1rpx solid #f0f3f5;
|
|
|
+ background-color: #fff;
|
|
|
+ }
|
|
|
+
|
|
|
+ .idcard-upload {
|
|
|
+ width: 100%;
|
|
|
+ display: flex;
|
|
|
+ gap: calc(100% - 600rpx - 16rpx);
|
|
|
+
|
|
|
+ .upload-wrapper {
|
|
|
+ padding: 4rpx;
|
|
|
+ background-repeat: no-repeat;
|
|
|
+ background-size: 100% 100%;
|
|
|
+
|
|
|
+ ::v-deep .u-upload__wrap__preview {
|
|
|
+ margin: 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .upload-slot {
|
|
|
+ width: 300rpx;
|
|
|
+ height: 180rpx;
|
|
|
+ border-radius: 8rpx;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ flex-direction: column;
|
|
|
+ justify-content: center;
|
|
|
+
|
|
|
+ .slot-image {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .agreement-section {
|
|
|
+ padding: 20rpx 30rpx;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.footer-bar {
|
|
|
+ ::v-deep .u-button {
|
|
|
+ width: 100%;
|
|
|
+ height: 76rpx;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+/* 审核状态样式 */
|
|
|
+.audit-status {
|
|
|
+ padding: 20rpx 33rpx;
|
|
|
+ background-color: #fff;
|
|
|
+ box-shadow: 0 2rpx 8rpx 0 rgba(214, 225, 237, 0.1);
|
|
|
+
|
|
|
+ .status-content {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+
|
|
|
+ .status-info {
|
|
|
+ display: flex;
|
|
|
+ font-size: 37.5rpx;
|
|
|
+ color: #333333;
|
|
|
+
|
|
|
+ .status-icon {
|
|
|
+ margin-right: 12rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .status-text {
|
|
|
+ font-size: 38rpx;
|
|
|
+ color: #333333;
|
|
|
+ font-weight: 500;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .status-btn {
|
|
|
+ width: 200rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .error-message {
|
|
|
+ font-size: 27rpx;
|
|
|
+ font-weight: 400;
|
|
|
+ color: #666666;
|
|
|
+ line-height: 1.5;
|
|
|
+ margin-top: 16rpx;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|