feat: release

This commit is contained in:
zzc
2026-05-20 23:28:57 +08:00
parent 48c7cebac1
commit c03a699ab9
2 changed files with 22 additions and 7 deletions

View File

@@ -37,7 +37,7 @@
<view class="cover-card" :class="{ 'has-cover': formData.coverUrl }" @tap="chooseCover">
<image
v-if="formData.coverUrl"
:src="formData.coverUrl"
:src="FILE_BASE_URL + formData.coverUrl"
class="cover-image"
mode="aspectFill"
/>
@@ -74,7 +74,7 @@
<view class="participant-avatar-wrap" @tap="chooseParticipantAvatar(index)">
<image
v-if="item.avatar"
:src="item.avatar"
:src="FILE_BASE_URL + item.avatar"
class="participant-avatar"
mode="aspectFill"
/>
@@ -160,10 +160,11 @@
import { reactive, ref } from "vue";
import { onLoad } from "@dcloudio/uni-app";
import { getStatusBarHeight } from "@/utils/system";
import { releaseTopic, fetchTopicCategories } from "@/api/release";
import { releaseTopic, fetchTopicCategories } from "@/api/topic";
import { smartNavigateBack } from "@/utils/page";
import {
uploadImage,
FILE_BASE_URL,
} from "@/utils/common.js";
const statusBarHeight = ref(getStatusBarHeight() || 0);
@@ -277,8 +278,21 @@ const onAvatarSelect = async (url) => {
const chooseParticipantAvatar = (index) => {
uni.chooseImage({
count: 1,
success: (res) => {
participants.value[index].avatar = res.tempFilePaths[0];
success: async (res) => {
const url = res.tempFilePaths[0];
uni.showLoading({ title: '上传中...' });
try {
const imageUrl = await uploadImage(url);
participants.value[index].avatar = imageUrl;
uni.hideLoading();
} catch (e) {
uni.hideLoading();
uni.showToast({
title: "上传失败",
icon: "none",
});
console.error(e);
}
},
});
};