fix:修复一些已知错误

This commit is contained in:
ctw committed 2025-12-04 10:44:45 +08:00
1 parent 221876ae89
commit aeafc90ddc
8 files changed
+141 -104

No files matched your search

+28 -33
View File
@@ -18,12 +18,7 @@
{{ userDetail.member?.memberCity ? userDetail.member?.memberCity + ' · ' : '' }}
{{ userDetail.distance?.toFixed(2) }}km
</view>
<uni-icons
type="more-filled"
size="28"
color="#D29E52"
@click="actionShow = true"
></uni-icons>
<uni-icons type="more-filled" size="28" color="#D29E52" @click="actionShow = true" />
</view>
</template>
</wd-navbar>
@@ -82,6 +77,7 @@
<view class="m-4">
<view class="my-2 text-size-base">相册</view>
<image
v-if="photoListUrls.length"
class="size-140rpx rounded-1 mr-2 mb-1"
v-for="(item, index) in photoListUrls"
:key="index"
@@ -89,26 +85,30 @@
mode="aspectFill"
@click="previewPhoto(index)"
/>
<view class="text-center c-#949494" v-else>相册暂无照片</view>
</view>
<view class="m-4">
<view class="my-2 text-base">评价</view>
<view class="my-2 text-base">
<text>评价</text>
<text class="text-sm ml-1">{{ userDetail.operationTotal?.recentShieldTotal || 0 }}</text>
</view>
<view class="flex justify-around flex-wrap text-color-theme text-base">
<view class="bg-color-dark flex items-center px-2 py-1 mb-2 rounded-2 gap-2">
<text>身材</text>
<uni-rate v-model="rating.scoreSc" size="18" />
<uni-rate v-model="rating.scoreSc" size="18" readonly />
</view>
<view class="bg-color-dark flex items-center px-2 py-1 mb-2 rounded-2 gap-2">
<text>颜值</text>
<uni-rate v-model="rating.scoreSk" size="18" />
<uni-rate v-model="rating.scoreSk" size="18" readonly />
</view>
<view class="bg-color-dark flex items-center px-2 py-1 mb-2 rounded-2 gap-2">
<text>耐心</text>
<uni-rate v-model="rating.scoreNx" size="18" />
<uni-rate v-model="rating.scoreNx" size="18" readonly />
</view>
<view class="bg-color-dark flex items-center px-2 py-1 mb-2 rounded-2 gap-2">
<text>有趣</text>
<uni-rate v-model="rating.scoreYq" size="18" />
<uni-rate v-model="rating.scoreYq" size="18" readonly />
</view>
</view>
</view>
@@ -143,7 +143,7 @@
@click="handleLike"
>
<uni-icons
v-if="userDetail.operationStatus?.isLike"
v-if="userDetail.userOperationStatus?.isLike"
type="heart-filled"
size="24"
color="#D29E52"
@@ -170,7 +170,7 @@
import ScrollList from '@/sheep/components/scroll-list/scroll-list.vue';
import useScroll from '@/sheep/hooks/use-scroll';
import RecentApi from '@/sheep/api/member/recent';
import { onHide, onUnload, onLoad } from '@dcloudio/uni-app';
import { onLoad } from '@dcloudio/uni-app';
import { getGender } from '@/sheep/util/index';
import sheep from '@/sheep';
import useConfigStore from '@/chat-store/configStore.js';
@@ -197,10 +197,11 @@
scoreYq: 0, // 有趣评分
});
const photoListUrls = computed(() =>
userDetail.value.memberPhotoList
?.filter((i) => i.resourceType === 'IMAGE')
.map((item) => item.address),
const photoListUrls = computed(
() =>
userDetail.value.memberPhotoList
?.filter((i) => i.resourceType === 'IMAGE')
.map((item) => item.address) || [],
);
onLoad(async (options: any) => {
@@ -343,26 +344,20 @@
// 喜欢
const handleLike = async () => {
await RecentApi.recentOperate({
const { code } = await RecentApi.recentOperate({
memberId: userDetail.value.member.memberId,
action: 'MEMBER_COLLECT',
});
if (code !== 0) return;
await getDetail();
};
// 评价
const rate = async () => {
await RecentApi.recentOperate({
memberId: userDetail.value.member.memberId,
action: 'MEMBER_RATING',
...rating,
});
};
onHide(() => {
rate();
});
onUnload(() => {
rate();
});
// 评分
// const rate = async () => {
// await RecentApi.recentOperate({
// memberId: userDetail.value.member.memberId,
// action: 'MEMBER_RATING',
// ...rating,
// });
// };
</script>
+2
View File
@@ -375,6 +375,8 @@
break;
case 1000:
uni.showToast({ title: '您已认证成功', icon: 'none' });
await UserApi.updateUser(userinfo);
sheep.$store('user').getInfo();
break;
case 1001:
await RecentApi.cancelFaceVerify({ authId });
+1 -1
View File
@@ -21,7 +21,7 @@
@refresh="refreshList"
@loadMore="listLoadMore"
>
<moment-card v-for="item in listData" :data="item" :showChat="false" />
<moment-card v-for="item in listData" :data="item" :showChat="false" :showLike="false" />
</scroll-list>
</wd-config-provider>
</template>
+7 -2
View File
@@ -106,7 +106,10 @@
:safe-area-inset-bottom="true"
>
<view class="w-90vw h-400rpx flex-col-center gap-4 flex-wrap">
<view class="text-color-theme text-lg">我的评价{{ myEvaluation.evaluateCount }}</view>
<view class="text-color-theme text-lg">
<text>我的评价</text>
<text class="ml-1 text-sm">{{ myEvaluation.evaluateCount }}</text>
</view>
<view class="w-90% flex justify-around">
<view class="bg-color-theme-dark flex items-center p-1 rounded-1">
<text class="mr-2 text-xs">身材</text>
@@ -127,7 +130,9 @@
<wd-rate v-model="myEvaluation.scoreNx" readonly />
</view>
</view>
<view class="text-color-theme text-lg">综合评分 {{ myEvaluation.avgScore }}</view>
<view class="text-color-theme text-lg">
综合评分 {{ myEvaluation.avgScore?.toFixed(2) || 0 }}
</view>
</view>
</wd-popup>
<wd-curtain
+17 -5
View File
@@ -10,17 +10,29 @@
<view class="text-base mx-4 my-2">微信号</view>
<view class="mx-4 rounded-3">
<wd-input
<input
class="h-100rpx rounded-50rpx bg-color-light px-40rpx text-32rpx text-color-theme"
v-model.trim="params.wechatNum"
placeholder="填写我的微信号"
clearable
type="text"
placeholder="请输入您的微信号"
placeholder-style="color: rgba(255, 255, 255, 0.6)"
:maxlength="20"
:focus="true"
/>
</view>
<view class="text-base mx-4 my-2">上传我的微信二维码</view>
<view class="text-base mx-4 mt-6 mb-4">上传您的微信二维码</view>
<view class="px-4">
<s-uploader v-model:url="params.wechatQrCode" fileMediatype="image" limit="1" mode="grid" />
<s-uploader
v-model:url="params.wechatQrCode"
fileMediatype="image"
limit="1"
mode="grid"
:imageStyles="{
width: '268rpx',
height: '268rpx',
border: { width: '6rpx', color: '#D29E52', radius: '50rpx' },
}"
/>
</view>
<view
class="mt-80rpx w-1/3 mx-auto rounded-full bg-color-theme-dark text-base text-center py-2 active:bg-color-theme"
+63 -56
View File
@@ -37,64 +37,70 @@
/>
</view>
<view class="ml-5 mb-3">语音签名</view>
<wd-cell-group>
<wd-cell title="单元格" value="去录制" is-link>
<template #title>
<view class="flex items-center">
<uni-icons type="mic" size="30" color="#D29E52"></uni-icons>
<text class="truncate">添加语音签名,让你更受关注</text>
</view>
</template>
</wd-cell>
</wd-cell-group>
<template v-if="false">
<view class="ml-5 mb-3">语音签名</view>
<view class="px-2">
<wd-cell-group>
<wd-cell title="单元格" value="去录制" is-link>
<template #title>
<view class="flex items-center">
<uni-icons type="mic" size="30" color="#D29E52"></uni-icons>
<text class="truncate">添加语音签名,让你更受关注</text>
</view>
</template>
</wd-cell>
</wd-cell-group>
</view>
</template>
<view class="ml-5 my-3">基本资料</view>
<wd-cell-group>
<wd-cell title="昵称" value="输入">
<template #default>
<input type="text" v-model="userinfo.nickname" :maxlength="12" />
</template>
</wd-cell>
<wd-datetime-picker
v-model="userinfo.birthday"
label="生日"
title="生日"
type="date"
align-right
:default-value="Date.now()"
:min-date="new Date(1980, 1, 1).getTime()"
:max-date="Date.now()"
/>
<wd-picker
v-model="userinfo.height"
:columns="columnsHeight"
label="身高"
title="身高"
align-right
:default-value="180"
/>
<wd-picker
v-model="userinfo.weight"
:columns="columnsWeight"
label="体重"
title="体重"
align-right
:default-value="60"
/>
<wd-picker
v-model="userinfo.occ"
:columns="columnsOcc"
label="从事职业"
title="从事职业"
align-right
/>
</wd-cell-group>
<view class="px-2">
<wd-cell-group>
<wd-cell title="昵称" value="输入">
<template #default>
<input type="text" v-model="userinfo.nickname" :maxlength="12" />
</template>
</wd-cell>
<wd-datetime-picker
v-model="userinfo.birthday"
label="生日"
title="生日"
type="date"
align-right
:default-value="Date.now()"
:min-date="new Date(1980, 1, 1).getTime()"
:max-date="Date.now()"
/>
<wd-picker
v-model="userinfo.height"
:columns="columnsHeight"
label="身高"
title="身高"
align-right
:default-value="180"
/>
<wd-picker
v-model="userinfo.weight"
:columns="columnsWeight"
label="体重"
title="体重"
align-right
:default-value="60"
/>
<wd-picker
v-model="userinfo.occ"
:columns="columnsOcc"
label="从事职业"
title="从事职业"
align-right
/>
</wd-cell-group>
<view class="ml-5 my-3">个人简介</view>
<wd-cell-group>
<wd-textarea v-model="userinfo.description" :maxlength="50" clearable show-word-limit />
</wd-cell-group>
<view class="ml-5 my-3">个人简介</view>
<wd-cell-group>
<wd-textarea v-model="userinfo.description" :maxlength="50" clearable show-word-limit />
</wd-cell-group>
</view>
<!-- <view class="mx-5 my-3 flex justify-between">
<text>个人相册</text>
@@ -151,8 +157,9 @@
import SUploader from '@/sheep/components/s-uploader/s-uploader.vue';
onLoad(async () => {
uni.showLoading({ title: '加载中...' });
// 获取用户信息
const { data } = await UserApi.getUserInfo();
const { data } = await UserApi.getUserInfo().finally(() => uni.hideLoading());
Object.assign(userinfo, data, {
// photo: data.photo?.map((item: { address: string }) => item.address),
});
+2 -1
View File
@@ -146,7 +146,8 @@ const RecentApi = {
method: 'GET',
params,
custom: {
showLoading: false,
showLoading: true,
loadingMsg: '加载中',
},
});
},
@@ -56,16 +56,16 @@
<text> {{ data.issueCity }} · {{ data.distance?.toFixed(2) || 0 }}km </text>
</view>
<view class="flex gap-60rpx pl-130rpx text-white">
<view class="flex items-center gap-10rpx text-sm">
<view v-if="props.showLike" class="flex items-center gap-10rpx text-sm">
<uni-icons
v-if="isLike || data.operationStatus?.isLike"
v-if="isLike || data.recentOperationStatus?.isLike"
type="heart-filled"
size="22"
color="#D29E52"
@click="handleunLike"
/>
<uni-icons v-else type="heart" size="22" color="#B5B4BC" @click="handleLike" />
<text>{{ data.operationTotal || 0 }} 喜欢</text>
<text>{{ operationTotal.recentLikeTotal || 0 }} 喜欢</text>
</view>
<view v-if="props.showChat" class="flex items-center gap-10rpx text-sm" @click="goChat">
<uni-icons type="chat" size="22" color="#B5B4BC" />
@@ -78,7 +78,7 @@
<script setup lang="ts">
// @ts-nocheck
import RecentApi from '@/sheep/api/member/recent';
import { computed, reactive, ref } from 'vue';
import { computed, onMounted, reactive, ref } from 'vue';
import { formatDate } from '@/sheep/util/index';
import { getGender } from '@/sheep/util/index';
import useConfigStore from '@/chat-store/configStore.js';
@@ -89,9 +89,11 @@
const props = withDefaults(
defineProps<{
data: any;
showLike?: boolean;
showChat?: boolean;
}>(),
{
showLike: true,
showChat: true,
},
);
@@ -109,6 +111,11 @@
// RECENT_SHIELD-朋友圈-屏蔽
// RECENT_REPORT-朋友圈-举报
});
const operationTotal = ref({});
onMounted(() => {
operationTotal.value = props.data.operationTotal;
});
// 图片预览
const previewImage = (img: string) => {
@@ -121,8 +128,16 @@
const handleLike = async () => {
params.action = 'RECENT_LIKE';
const { code } = await RecentApi.recentOperate(params);
if (code === 0) {
isLike.value = true;
if (code !== 0) return;
isLike.value = true;
if (
operationTotal.value.recentLikeTotal === undefined ||
operationTotal.value.recentLikeTotal === null
) {
operationTotal.value.recentLikeTotal = 1;
} else {
operationTotal.value.recentLikeTotal++;
}
};