修复包间图片上传错误的问题

This commit is contained in:
wangxiaowei
2025-12-27 17:49:45 +08:00
parent c4c20bc893
commit 4596ecd386

View File

@ -133,7 +133,6 @@
image-mode="scaleToFill"
:action="action"
@success="RoomDetail.handleUploadSuccess">
<wd-img width="184rpx" height="184rpx" :src="form.img || `${OSS}images/store/my/image1.png`" mode="aspectFill" radius="16rpx" />
</wd-upload>
</view>
</view>
@ -380,7 +379,7 @@
<!-- 输入框 -->
<view class="mb-40rpx">
<wd-input v-model="newTagName" no-border placeholder="标签名称" :maxlength="5"
<wd-input v-model="newTagName" type="text" no-border placeholder="标签名称"
custom-class="!bg-[#F6F7F8] !rounded-16rpx !px-28rpx !py-20rpx" />
</view>
@ -416,7 +415,8 @@
// 标签相关
const showTagSelectPopup = ref(false)
const showCreateTagPopup = ref(false)
const newTagName = ref('')
const newTagName = ref<string>('')
console.log("🚀 ~ newTagName:", newTagName.value)
const isTagManageMode = ref(false) // 是否处于管理模式
const selectedTags = ref<number[]>([]) // 临时选中的标签,点击确认后才回填到表单
// Mock 已有标签列表
@ -522,9 +522,7 @@
const response = JSON.parse(e.file.response)
if (response.code) {
const avatarUrl = response.data.url
await updateUserInfo({ avatar: avatarUrl })
form.image = avatarUrl
toast.info('图片上传成功')
} else {
throw new Error('上传失败')
}
@ -642,6 +640,9 @@
*/
handleCompleteCreateTag: async () => {
const tagName = newTagName.value.trim()
console.log("🚀 ~ tagName:", newTagName.value)
console.log("🚀 ~ tagName:", tagName)
if (!tagName) {
toast.info('请输入标签名称')
return
@ -650,6 +651,7 @@
toast.info('标签不能超过5个字')
return
}
console.log("🚀 ~ tagName:", tagName)
uni.showLoading({
title: '操作者中...'
@ -727,7 +729,7 @@
let params = {
id: roomId.value,
img: form.image,
img: form.image.replace(import.meta.env.VITE_UPLOAD_IMAGE_URL, ''),
title: form.title,
label_id: tags.value.map(tag => tag.id).join(','),
price: Number(form.price),