添加账户提示优化

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"
@click="uploadImage"
>
{{ uploading ? '上传中...' : '上传图片' }}
{{ uploading ? '上传中...' : '确认上传' }}
</button>
<!-- 结果展示 -->
@ -115,7 +115,7 @@ export default {
//
console.log('触发图片上传成功事件:', this.uploadResult)
uni.$emit('image-upload-success', this.uploadResult)
//
uni.showToast({
title: '上传成功',

View File

@ -20,10 +20,10 @@
<textarea
v-if="typeOptions[typeIndex].value === 'QR'"
v-model="bankForm.no"
:placeholder="typeOptions[typeIndex].noPlaceholder"
class="form-input qr-input"
:maxlength="500"
:placeholder="typeOptions[typeIndex].noPlaceholder"
auto-height
class="form-input qr-input"
/>
<input
v-else
@ -33,7 +33,11 @@
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>
</view>
</view>
@ -110,8 +114,8 @@ export default {
{
label: '收款二维码',
value: 'QR',
noLabel: '收款码图片',
noPlaceholder: '请输入收款码图片URL',
noLabel: '收款码图片url',
noPlaceholder: '请点击上传-上传收款二维码图片自动获得收款码图片URL',
},
],
bankForm: {
@ -144,7 +148,7 @@ export default {
console.log('AddCard组件卸载移除图片上传事件监听')
uni.$off('image-upload-success', this.onImageUploadSuccess)
},
beforeDestroy() {
beforeUnmount() {
//
console.log('AddCard组件销毁移除图片上传事件监听')
uni.$off('image-upload-success', this.onImageUploadSuccess)
@ -238,9 +242,9 @@ export default {
success: () => {
console.log('成功跳转到图片上传页面')
},
fail: (err) => {
fail: err => {
console.error('跳转到图片上传页面失败:', err)
}
},
})
},
@ -248,20 +252,20 @@ export default {
onImageUploadSuccess(imageUrl) {
console.log('接收到图片上传成功事件:', imageUrl)
console.log('当前表单状态:', this.bankForm)
if (imageUrl && typeof imageUrl === 'string') {
this.bankForm.no = imageUrl
console.log('URL已设置到表单:', this.bankForm.no)
uni.showToast({
title: '图片上传成功',
icon: 'success'
icon: 'success',
})
} else {
console.error('接收到的imageUrl无效:', imageUrl)
uni.showToast({
title: '图片URL无效',
icon: 'none'
icon: 'none',
})
}
},
@ -381,7 +385,7 @@ export default {
border-color: #ff803a;
background: #fff;
}
&.qr-input {
font-size: 24rpx;
line-height: 1.4;