fix(withdraw): resolve remote 404 route, db reason column patch and avatar tmp path fallback
这个提交包含在:
@@ -168,6 +168,10 @@
|
||||
<image class="action-svg" :src="ICONS.chat" mode="aspectFit" />
|
||||
<text class="action-text">私聊</text>
|
||||
</view>
|
||||
<view class="icon-action btn-active" @click="toggleFavorite">
|
||||
<image class="action-svg" :src="isFav ? ICONS.starFilled : ICONS.starOutline" mode="aspectFit" />
|
||||
<text class="action-text" :class="{ 'fav-active': isFav }">{{ isFav ? '已收藏' : '收藏' }}</text>
|
||||
</view>
|
||||
<view class="icon-action btn-active" @click="openReportModal">
|
||||
<image class="action-svg" :src="ICONS.shield" mode="aspectFit" />
|
||||
<text class="action-text">举报</text>
|
||||
@@ -239,10 +243,11 @@
|
||||
import { ref, computed } from 'vue';
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import SkeletonScreen from '@/components/SkeletonScreen.vue';
|
||||
import { getCompanionDetail, getExpertReviews, replyOrderReview, submitReport as submitReportApi } from '@/common/api.js';
|
||||
import { getCompanionDetail, getExpertReviews, replyOrderReview, submitReport as submitReportApi, checkFavorite, addFavorite as addFavApi, removeFavorite as removeFavApi } from '@/common/api.js';
|
||||
import { ICONS } from '@/common/icons.js';
|
||||
|
||||
const isLoading = ref(true);
|
||||
const isFav = ref(false);
|
||||
const expert = ref({
|
||||
id: '',
|
||||
nickname: '同城陪伴师',
|
||||
@@ -264,6 +269,23 @@ const expert = ref({
|
||||
const selectedServiceId = ref(null);
|
||||
const isPlayingVoice = ref(false);
|
||||
|
||||
const toggleFavorite = async () => {
|
||||
try {
|
||||
const targetId = Number(expert.value.id || 101);
|
||||
if (isFav.value) {
|
||||
await removeFavApi(targetId);
|
||||
isFav.value = false;
|
||||
uni.showToast({ title: '已取消收藏', icon: 'none' });
|
||||
} else {
|
||||
await addFavApi(targetId);
|
||||
isFav.value = true;
|
||||
uni.showToast({ title: '已收藏该陪玩', icon: 'success' });
|
||||
}
|
||||
} catch (err) {
|
||||
uni.showToast({ title: err.message || '操作失败', icon: 'none' });
|
||||
}
|
||||
};
|
||||
|
||||
const handleReplyReview = (rev) => {
|
||||
const defaultReplies = [
|
||||
'感谢老板的支持与五星好评!开黑配合非常默契,期待下次一起上大分!',
|
||||
@@ -302,6 +324,10 @@ onLoad(async (query) => {
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
isFav.value = await checkFavorite(targetId);
|
||||
} catch (_) {}
|
||||
|
||||
try {
|
||||
const liveReviews = await getExpertReviews(targetId);
|
||||
if (Array.isArray(liveReviews) && liveReviews.length > 0) {
|
||||
@@ -945,6 +971,11 @@ const submitReportTicket = async () => {
|
||||
font-size: 18rpx;
|
||||
color: #94A3B8;
|
||||
margin-top: 4rpx;
|
||||
|
||||
&.fav-active {
|
||||
color: #F59E0B;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
在新工单中引用
屏蔽一个用户