添加账户提示优化

This commit is contained in:
WindowBird 2025-08-21 14:24:15 +08:00
parent 37efccf38e
commit dfe501a7c4
2 changed files with 19 additions and 15 deletions

View File

@ -18,7 +18,7 @@
class="upload-btn" class="upload-btn"
@click="uploadImage" @click="uploadImage"
> >
{{ uploading ? '上传中...' : '上传图片' }} {{ uploading ? '上传中...' : '确认上传' }}
</button> </button>
<!-- 结果展示 --> <!-- 结果展示 -->

View File

@ -20,10 +20,10 @@
<textarea <textarea
v-if="typeOptions[typeIndex].value === 'QR'" v-if="typeOptions[typeIndex].value === 'QR'"
v-model="bankForm.no" v-model="bankForm.no"
:placeholder="typeOptions[typeIndex].noPlaceholder"
class="form-input qr-input"
:maxlength="500" :maxlength="500"
:placeholder="typeOptions[typeIndex].noPlaceholder"
auto-height auto-height
class="form-input qr-input"
/> />
<input <input
v-else v-else
@ -33,7 +33,11 @@
maxlength="30" maxlength="30"
/> />
<!-- 收款二维码类型时显示上传按钮 --> <!-- 收款二维码类型时显示上传按钮 -->
<view v-if="typeOptions[typeIndex].value === 'QR'" class="upload-btn" @click="goToImageUpload"> <view
v-if="typeOptions[typeIndex].value === 'QR'"
class="upload-btn"
@click="goToImageUpload"
>
<text class="upload-text">上传</text> <text class="upload-text">上传</text>
</view> </view>
</view> </view>
@ -110,8 +114,8 @@ export default {
{ {
label: '收款二维码', label: '收款二维码',
value: 'QR', value: 'QR',
noLabel: '收款码图片', noLabel: '收款码图片url',
noPlaceholder: '请输入收款码图片URL', noPlaceholder: '请点击上传-上传收款二维码图片自动获得收款码图片URL',
}, },
], ],
bankForm: { bankForm: {
@ -144,7 +148,7 @@ export default {
console.log('AddCard组件卸载移除图片上传事件监听') console.log('AddCard组件卸载移除图片上传事件监听')
uni.$off('image-upload-success', this.onImageUploadSuccess) uni.$off('image-upload-success', this.onImageUploadSuccess)
}, },
beforeDestroy() { beforeUnmount() {
// //
console.log('AddCard组件销毁移除图片上传事件监听') console.log('AddCard组件销毁移除图片上传事件监听')
uni.$off('image-upload-success', this.onImageUploadSuccess) uni.$off('image-upload-success', this.onImageUploadSuccess)
@ -238,9 +242,9 @@ export default {
success: () => { success: () => {
console.log('成功跳转到图片上传页面') console.log('成功跳转到图片上传页面')
}, },
fail: (err) => { fail: err => {
console.error('跳转到图片上传页面失败:', err) console.error('跳转到图片上传页面失败:', err)
} },
}) })
}, },
@ -255,13 +259,13 @@ export default {
uni.showToast({ uni.showToast({
title: '图片上传成功', title: '图片上传成功',
icon: 'success' icon: 'success',
}) })
} else { } else {
console.error('接收到的imageUrl无效:', imageUrl) console.error('接收到的imageUrl无效:', imageUrl)
uni.showToast({ uni.showToast({
title: '图片URL无效', title: '图片URL无效',
icon: 'none' icon: 'none',
}) })
} }
}, },