feat:列表轮播;显示修改;用户协议;隐私政策;关于页;

This commit is contained in:
ctw committed 2025-11-28 09:25:16 +08:00
1 parent 7267cf93c9
commit 03fd985d20
16 files changed
+415 -246

No files matched your search

+7
View File
@@ -232,6 +232,13 @@
"navigationBarTitleText": "问题反馈",
"navigationStyle": "custom"
}
},
{
"path": "about",
"style": {
"navigationBarTitleText": "关于",
"navigationStyle": "custom"
}
}
]
},
+89
View File
@@ -0,0 +1,89 @@
<template>
<scroll-list
class="h-full"
:loadMoreStatus="loadMoreStatus"
@refresh="refreshList"
@loadMore="listLoadMore"
@scroll="scroll"
:scroll-top="scrollTop"
>
<user-card
v-if="listData.length"
v-for="user in listData"
:key="user.id"
:data="user"
@click="detail(user)"
/>
<view v-else class="py-2 px-4" v-for="index in 4" :key="index">
<view class="flex">
<wd-skeleton :row-col="[{ size: '100px', type: 'rect' }]" animation="gradient" />
<wd-skeleton
:custom-style="{ width: '100%', marginLeft: '12px' }"
:row-col="[{ width: '100%' }, { width: '100%' }]"
animation="gradient"
/>
</view>
<view class="flex -mt-50px">
<wd-skeleton :row-col="[{ size: '100px', type: 'rect' }]" animation="gradient" />
<wd-skeleton
:custom-style="{ width: '100%', marginLeft: '12px' }"
:row-col="[{ width: '100%' }, { width: '50%' }]"
animation="gradient"
/>
</view>
</view>
</scroll-list>
</template>
<script setup lang="ts">
import { computed, onMounted, reactive, ref, watch } from 'vue';
// @ts-ignore
import sheep from '@/sheep';
import ScrollList from '@/sheep/components/scroll-list/scroll-list.vue';
import UserCard from '@/sheep/components/user-card/user-card.vue';
import useScroll from '@/sheep/hooks/use-scroll';
import RecentApi from '@/sheep/api/member/recent';
const props = defineProps<{
scene: string;
}>();
const scrollTop = ref(0);
const userCity = computed(() => sheep.$store('user').userCity);
const params = reactive({
scene: props.scene,
province: '',
city: userCity.value.t,
memberId: '',
});
const { listData, loadMoreStatus, refreshList, listLoadMore } = useScroll(
RecentApi.quickPage,
params,
);
onMounted(() => {
refreshList();
});
watch(
() => userCity.value,
async (city) => {
params.city = city.t;
await refreshList();
scrollTop.value = 0;
},
);
const scroll = (e: any) => {
scrollTop.value = e.detail.scrollTop;
};
const detail = (user: any) => {
uni.navigateTo({
url: `/pages/home/detail?memberId=${user.memberId}`,
success: function (res) {
res.eventChannel.emit('recentDetail', user);
},
});
};
</script>
+15 -16
View File
@@ -15,7 +15,7 @@
<template #right>
<view class="flex items-center">
<view class="py-1 px-2 text-xs bg-color-theme-dark rounded-full mr-3">
{{ userDetail.issueCity }}km · 在线
{{ userDetail.member?.memberCity || userDetail.issueCity }}
</view>
<uni-icons type="more-filled" size="28" color="#ffcd32"></uni-icons>
</view>
@@ -32,11 +32,11 @@
<view class="w-full h-600rpx relative">
<image
class="w-full h-full absolute inset-0"
:src="userDetail.coverPic"
:src="userDetail.coverPic.split(',')[0]"
mode="aspectFill"
/>
<view
class="absolute bottom-40rpx left-0 right-0 text-xs flex flex-col items-center z-100 w-full"
class="absolute bottom-60rpx left-0 right-0 text-xs flex flex-col items-center z-100 w-full"
>
<image
class="text-center size-150rpx rounded-full bg-#333 mb-20rpx"
@@ -53,16 +53,16 @@
<view class="flex flex-wrap justify-center mb-20rpx">
<text class="px-2 py-1 rounded-1 mr-2 bg-#222 text-color-theme-dark">
{{ '未知性别 · ' + userDetail.member?.memberAge || '' + '岁' }}
{{ getGender(userDetail.member.memberSex) }}·{{ userDetail.member.memberAge }}岁
</text>
<text class="px-2 py-1 rounded-1 mr-2 bg-#222 text-color-theme-dark">
{{ userDetail.member?.memberHeight || '' + 'cm' }}
{{ userDetail.member?.memberHeight || '' }}cm
</text>
<text class="px-2 py-1 rounded-1 mr-2 bg-#222 text-color-theme-dark">
{{ userDetail.member?.memberWeight || '' + 'kg' }}
{{ userDetail.member?.memberWeight || '' }}kg
</text>
<text class="px-2 py-1 rounded-1 mr-2 bg-#222 text-color-theme-dark">
{{ userDetail.member?.memberOcc || '' + 'kg' }}
{{ userDetail.member?.memberOcc || '' }}
</text>
</view>
<view class="px-8">
@@ -76,16 +76,11 @@
<view class="my-2 text-size-base">相册</view>
<image
class="size-140rpx rounded-1 mr-2 mb-1"
v-for="(item, index) in [
userDetail.member?.memberAvatar,
userDetail.member?.memberAvatar,
]"
v-for="(item, index) in userDetail.coverPic?.split(',')"
:key="index"
:src="item"
mode="aspectFill"
@click="
previewPhoto([userDetail.member?.memberAvatar, userDetail.member?.memberAvatar], index)
"
@click="previewPhoto(userDetail.coverPic?.split(','), index)"
/>
</view>
@@ -142,14 +137,18 @@
import useScroll from '@/sheep/hooks/use-scroll';
import RecentApi from '@/sheep/api/member/recent';
import { onLoad } from '@dcloudio/uni-app';
// @ts-ignore
import { getGender } from '@/sheep/util/index';
// @ts-ignore
import sheep from '@/sheep';
const userCity = computed(() => sheep.$store('user').userCity);
const params = reactive({
scene: 'DYNAMIC_RECOMMEND',
province: '',
city: '',
city: userCity.value.t,
memberId: '',
});
const scrollTop = ref(0);
const userDetail = ref<any>({});
+14 -69
View File
@@ -9,57 +9,32 @@
</template>
<template #title>
<view class="flex items-center h-full">
<segmented v-model="current" :items="segmentedItems" @change="segmentedChange" />
<segmented v-model="current" :items="segmentedItems" />
</view>
</template>
</wd-navbar>
<scroll-list
style="height: calc(100dvh - 44px - 50px)"
:loadMoreStatus="loadMoreStatus"
@refresh="refreshList"
@loadMore="listLoadMore"
@scroll="(e) => (scrollTop = e.detail.scrollTop)"
:scroll-top="scrollTop"
<swiper
:current="current"
style="height: calc(100vh - 44rpx - 100rpx)"
@change="(e) => (current = e.detail.current)"
:duration="200"
disable-touch
>
<user-card
v-if="listData.length"
v-for="user in listData"
:key="user.id"
:data="user"
@click="detail(user)"
/>
<view v-else class="py-2 px-4" v-for="index in 4" :key="index">
<view class="flex">
<wd-skeleton :row-col="[{ size: '100px', type: 'rect' }]" animation="gradient" />
<wd-skeleton
:custom-style="{ width: '100%', marginLeft: '12px' }"
:row-col="[{ width: '100%' }, { width: '100%' }]"
animation="gradient"
/>
</view>
<view class="flex -mt-50px">
<wd-skeleton :row-col="[{ size: '100px', type: 'rect' }]" animation="gradient" />
<wd-skeleton
:custom-style="{ width: '100%', marginLeft: '12px' }"
:row-col="[{ width: '100%' }, { width: '50%' }]"
animation="gradient"
/>
</view>
</view>
</scroll-list>
<swiper-item v-for="(item, index) in segmentedItems" :key="index">
<scroll-user :scene="item['search-action']" />
</swiper-item>
</swiper>
</wd-config-provider>
<s-auth-modal />
</template>
<script setup lang="ts">
import { computed, reactive, ref } from 'vue';
import { computed, ref } from 'vue';
import segmented from '@/sheep/components/segmented/segmented.vue';
import RecentApi from '@/sheep/api/member/recent';
import ScrollList from '@/sheep/components/scroll-list/scroll-list.vue';
import UserCard from '@/sheep/components/user-card/user-card.vue';
import useScroll from '@/sheep/hooks/use-scroll';
import ScrollUser from './components/scroll-user.vue';
// @ts-ignore
import sheep from '@/sheep';
import { onLoad } from '@dcloudio/uni-app';
@@ -67,25 +42,12 @@
const current = ref(0);
const segmentedItems = ref([]);
const userCity = computed(() => sheep.$store('user').userCity);
const params = reactive({
scene: '',
province: '',
city: userCity.value.t,
memberId: '',
});
const { listData, loadMoreStatus, refreshList, listLoadMore } = useScroll(
RecentApi.quickPage,
params,
);
const scrollTop = ref(0);
onLoad(async () => {
// 获取顶部导航栏tab菜单
const { data } = await RecentApi.getSquareTabMenu();
if (data && data.length > 0) {
segmentedItems.value = data;
params.scene = data[0]['search-action'];
refreshList();
}
});
@@ -94,26 +56,9 @@
url: '/pages/home/city',
events: {
changeCity: async () => {
scrollTop.value = 0;
params.city = userCity.value.t;
await refreshList();
// await refreshList();
},
},
});
};
const detail = (user: any) => {
uni.navigateTo({
url: `/pages/home/detail?memberId=${user.memberId}`,
success: function (res) {
res.eventChannel.emit('recentDetail', user);
},
});
};
const segmentedChange = async (item: any) => {
params.scene = item['search-action'];
scrollTop.value = 0;
await refreshList();
};
</script>
+32 -1
View File
@@ -78,14 +78,36 @@
</view>
<view class="absolute bottom-40rpx w-full text-center text-14px text-white">
登录即同意《用户协议》和《隐私政策》并同意授权
登录即同意《
<text
class="text-#ffcd32 underline underline-1 underline-solid underline-amber"
@click="alert(2, '用户协议')"
>
用户协议
</text>
》和《
<text
class="text-#ffcd32 underline underline-1 underline-solid underline-amber"
@click="alert(3, '隐私政策')"
>
隐私政策
</text>
》并同意授权
</view>
</view>
<wd-config-provider theme="dark">
<wd-message-box></wd-message-box>
</wd-config-provider>
</template>
<script setup>
import { ref } from 'vue';
import AuthUtil from '@/sheep/api/member/auth';
import { useMessage } from '@/uni_modules/wot-design-uni';
import RecentApi from '@/sheep/api/member/recent';
const message = useMessage();
const phone = ref('');
const smsCode = ref('');
@@ -128,4 +150,13 @@
// uni.reLaunch({ url: '/pages/home/home' });
// }
// };
// 2-用户协议;3-隐私协议;
async function alert(type, title) {
const { data } = await RecentApi.getPromotionArticle({ id: type });
message.alert({
msg: data.content.replace(/<\/?[^>]+>/g, ''),
title,
});
}
</script>
@@ -0,0 +1,102 @@
<template>
<scroll-list
class="h-full"
:loadMoreStatus="loadMoreStatus"
@refresh="refreshList"
@loadMore="listLoadMore"
@scroll="scroll"
:scroll-top="scrollTop"
>
<swiper
class="h-300rpx mx-4"
indicator-dots
indicator-color="#fff"
indicator-active-color="#ffcd32"
autoplay
circular
>
<swiper-item>
<image
class="w-full h-full rounded-20rpx"
src="https://img3.redocn.com/tupian/20160316/qingxinpugongyingqingxinbeijing_6012341.jpg"
mode="aspectFill"
/>
</swiper-item>
<swiper-item>
<image
class="w-full h-full rounded-20rpx"
src="https://img3.redocn.com/tupian/20160316/qingxinpugongyingqingxinbeijing_6012341.jpg"
mode="aspectFill"
/>
</swiper-item>
</swiper>
<moment-card
v-if="listData.length"
v-for="item in listData"
:data="item"
@detail="goDetail(item)"
/>
<view v-else class="flex px-4 py-4" v-for="index in 3" :key="index">
<wd-skeleton :row-col="[{ size: '50px', type: 'circle' }]" animation="flashed" />
<wd-skeleton
:custom-style="{ width: '100%', marginLeft: '12px' }"
animation="flashed"
theme="paragraph"
/>
</view>
</scroll-list>
</template>
<script setup lang="ts">
import { computed, onMounted, reactive, ref, watch } from 'vue';
// @ts-ignore
import sheep from '@/sheep';
import ScrollList from '@/sheep/components/scroll-list/scroll-list.vue';
import MomentCard from '@/sheep/components/moment-card/moment-card.vue';
import useScroll from '@/sheep/hooks/use-scroll';
import RecentApi from '@/sheep/api/member/recent';
const props = defineProps<{
scene: string;
}>();
const scrollTop = ref(0);
const userCity = computed(() => sheep.$store('user').userCity);
const params = reactive({
scene: props.scene,
province: '',
city: userCity.value.t,
memberId: '',
});
const { listData, loadMoreStatus, refreshList, listLoadMore } = useScroll(
RecentApi.quickPage,
params,
);
onMounted(() => {
refreshList();
});
watch(
() => userCity.value,
async (city) => {
params.city = city.t;
await refreshList();
scrollTop.value = 0;
},
);
const scroll = (e: any) => {
scrollTop.value = e.detail.scrollTop;
};
// 查看用户详情
const goDetail = (user: any) => {
uni.navigateTo({
url: `/pages/home/detail?memberId=${user.memberId}`,
success: function (res) {
res.eventChannel.emit('recentDetail', user);
},
});
};
</script>
+14 -90
View File
@@ -3,7 +3,7 @@
<wd-navbar title="" safeAreaInsetTop style="z-index: 999999 !important" :bordered="false">
<template #left>
<view class="flex items-center h-full">
<segmented v-model="current" :items="segmentedItems" @change="segmentedChange" />
<segmented v-model="current" :items="segmentedItems" />
</view>
</template>
<template #right>
@@ -13,111 +13,35 @@
</template>
</wd-navbar>
<scroll-list
style="height: calc(100dvh - 44px - 50px)"
:loadMoreStatus="loadMoreStatus"
@refresh="refreshList"
@loadMore="listLoadMore"
@scroll="(e) => (scrollTop = e.detail.scrollTop)"
:scroll-top="scrollTop"
<swiper
:current="current"
style="height: calc(100vh - 44rpx - 100rpx)"
@change="(e) => (current = e.detail.current)"
:duration="200"
disable-touch
>
<swiper
class="h-300rpx mx-4"
indicator-dots
indicator-color="#fff"
indicator-active-color="#ffcd32"
autoplay
circular
>
<swiper-item>
<image
class="w-full h-full rounded-20rpx"
src="https://img3.redocn.com/tupian/20160316/qingxinpugongyingqingxinbeijing_6012341.jpg"
mode="aspectFill"
/>
</swiper-item>
<swiper-item>
<image
class="w-full h-full rounded-20rpx"
src="https://img3.redocn.com/tupian/20160316/qingxinpugongyingqingxinbeijing_6012341.jpg"
mode="aspectFill"
/>
</swiper-item>
</swiper>
<moment-card
v-if="listData.length"
v-for="item in listData"
:data="item"
@detail="goDetail(item)"
/>
<view v-else class="flex px-4 py-4" v-for="index in 3" :key="index">
<wd-skeleton :row-col="[{ size: '50px', type: 'circle' }]" animation="flashed" />
<wd-skeleton
:custom-style="{ width: '100%', marginLeft: '12px' }"
animation="flashed"
theme="paragraph"
/>
</view>
</scroll-list>
<swiper-item v-for="(item, index) in segmentedItems" :key="index">
<scroll-moment :scene="item['search-action']" />
</swiper-item>
</swiper>
</wd-config-provider>
</template>
<script setup lang="ts">
import { computed, reactive, ref, watch } from 'vue';
import { ref } from 'vue';
import segmented from '@/sheep/components/segmented/segmented.vue';
import MomentCard from '@/sheep/components/moment-card/moment-card.vue';
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 ScrollMoment from './components/scroll-moment.vue';
import { onLoad } from '@dcloudio/uni-app';
// @ts-ignore
import sheep from '@/sheep';
import RecentApi from '@/sheep/api/member/recent';
const userCity = computed(() => sheep.$store('user').userCity);
const params = reactive({
scene: '',
province: '',
city: userCity.value.t,
memberId: '',
});
const { listData, loadMoreStatus, refreshList, listLoadMore } = useScroll(
RecentApi.quickPage,
params,
);
const current = ref(0);
const segmentedItems = ref([]);
const scrollTop = ref(0);
onLoad(async () => {
// 获取顶部导航栏tab菜单
const { data } = await RecentApi.getDynamicTabMenu();
if (data && data.length > 0) {
segmentedItems.value = data;
params.scene = data[0]['search-action'];
refreshList();
}
});
watch(
() => userCity.value,
(val) => {
params.city = val.value.t;
},
);
// 查看用户详情
const goDetail = (user: any) => {
uni.navigateTo({
url: `/pages/home/detail?memberId=${user.memberId}`,
success: function (res) {
res.eventChannel.emit('recentDetail', user);
},
});
};
const segmentedChange = async (item: any) => {
params.scene = item['search-action'];
scrollTop.value = 0;
await refreshList();
};
</script>
+39
View File
@@ -0,0 +1,39 @@
<template>
<wd-config-provider theme="dark">
<wd-navbar title="关于" safeAreaInsetTop :bordered="false">
<template #left>
<navigator open-type="navigateBack" hover-class="navigator-hover">
<uni-icons type="back" size="30" color="#ffcd32"></uni-icons>
</navigator>
</template>
</wd-navbar>
<view class="mt-40 mx-10">
<wd-cell-group>
<wd-cell title="用户协议" value="" is-link ellipsis @click="alert(2, '用户协议')" />
<wd-cell title="隐私政策" value="" is-link ellipsis @click="alert(3, '隐私政策')" />
<wd-cell title="版本" :value="version" is-link ellipsis />
</wd-cell-group>
</view>
<wd-message-box></wd-message-box>
</wd-config-provider>
</template>
<script setup lang="ts">
import { useMessage } from '@/uni_modules/wot-design-uni';
import RecentApi from '@/sheep/api/member/recent';
import packageInfo from '@/../package.json';
const { version } = packageInfo;
const message = useMessage();
// 2-用户协议;3-隐私协议;
async function alert(type: number | string, title: string = '') {
const { data } = await RecentApi.getPromotionArticle({ id: type });
message.alert({
msg: data.content.replace(/<\/?[^>]+>/g, ''),
title,
});
}
</script>
@@ -1,32 +0,0 @@
<template>
<scroll-list
:loadMoreStatus="loadMoreStatus"
@refresh="refreshList"
@loadMore="listLoadMore"
:show-scrollbar="false"
:refresherEnabled="false"
>
<slot :list="listData" />
</scroll-list>
</template>
<script setup lang="ts">
import ScrollList from '@/sheep/components/scroll-list/scroll-list.vue';
import useScroll from '@/sheep/hooks/use-scroll';
const props = withDefaults(
defineProps<{
load?: (...arg: any) => Promise<any>;
requestBody?: any;
}>(),
{
load: () => Promise.resolve([]),
requestBody: {},
},
);
const { listData, loadMoreStatus, refreshList, listLoadMore } = useScroll(
props.load,
props.requestBody,
);
</script>
+45 -10
View File
@@ -17,12 +17,27 @@
@change="(e) => (current = e.detail.current)"
:duration="200"
>
<swiper-item v-for="index in segmentedItems.length" :key="index">
<swiper-scroll class="h-full" :load="load[index]">
<template #default="{ list }">
<user-card v-for="user in list" :key="user.id" :data="user" @click="detail(user)" />
</template>
</swiper-scroll>
<swiper-item>
<scroll-list
:loadMoreStatus="loadMoreStatus0"
@refresh="refreshList0"
@loadMore="listLoadMore0"
:show-scrollbar="false"
:refresherEnabled="false"
>
<user-card v-for="user in listData0" :key="user.id" :data="user" @click="detail(user)" />
</scroll-list>
</swiper-item>
<swiper-item>
<scroll-list
:loadMoreStatus="loadMoreStatus1"
@refresh="refreshList1"
@loadMore="listLoadMore1"
:show-scrollbar="false"
:refresherEnabled="false"
>
<user-card v-for="user in listData1" :key="user.id" :data="user" @click="detail(user)" />
</scroll-list>
</swiper-item>
</swiper>
</wd-config-provider>
@@ -30,21 +45,41 @@
<script setup lang="ts">
import { onLoad } from '@dcloudio/uni-app';
import { ref } from 'vue';
import { onMounted, ref } from 'vue';
import segmented from '@/sheep/components/segmented/segmented.vue';
import UserCard from '@/sheep/components/user-card/user-card.vue';
import SwiperScroll from './components/swiper-scroll.vue';
import ScrollList from '@/sheep/components/scroll-list/scroll-list.vue';
import useScroll from '@/sheep/hooks/use-scroll';
import RecentApi from '@/sheep/api/member/recent';
const current = ref<0 | 1 | number>(0);
const segmentedItems = ['我喜欢', '喜欢我'];
const load = [RecentApi.likeIt, RecentApi.likeMe];
const segmentedItems = [
{ code: 0, label: '我喜欢' },
{ code: 1, label: '喜欢我' },
];
const {
listData: listData0,
loadMoreStatus: loadMoreStatus0,
refreshList: refreshList0,
listLoadMore: listLoadMore0,
} = useScroll(RecentApi.likeIt);
const {
listData: listData1,
loadMoreStatus: loadMoreStatus1,
refreshList: refreshList1,
listLoadMore: listLoadMore1,
} = useScroll(RecentApi.likeMe);
onLoad((options: any) => {
const { type = 0 } = options;
current.value = type;
});
onMounted(() => {
refreshList0();
refreshList1();
});
const detail = (user: any) => {
uni.navigateTo({
url: `/pages/home/detail?memberId=${user.memberId}`,
+1
View File
@@ -220,5 +220,6 @@
{ title: '客服助手', value: '', icon: 'service', to: '' },
{ title: '关注公众号√', value: '获取最新消息', icon: 'qrcode', to: '', click: subOfficial },
{ title: '设置', value: '', icon: 'setting1', to: '' },
{ title: '关于√', value: '', icon: 'info-circle', to: '/pages/profile/about' },
];
</script>
+12
View File
@@ -199,6 +199,18 @@ const RecentApi = {
},
});
},
// 获得用户协议或隐私政策文章
getPromotionArticle: (params: any) => {
return request({
url: '/promotion/article/get',
method: 'GET',
params,
custom: {
showLoading: true,
loadingMsg: '加载中',
},
});
},
};
export default RecentApi;
@@ -17,40 +17,39 @@
<text>真人认证</text>
</view>
</view>
<text class="text-22rpx c-gray">近期</text>
<text class="text-22rpx c-gray">{{ formatDate(data.createTime) }}</text>
</view>
<view class="mt-1 text-xs c-gray">
{{ `未知性别 · ${member?.memberAge}岁 | ${member?.memberOcc}` }}
{{ getGender(member.memberSex) }}·{{ member.memberAge }}岁
<text class="px-1">|</text>
{{ member?.memberOcc }}
</view>
</view>
</view>
<view class="mb-30rpx pl-130rpx">
<text class="leading-[1.5] text-white">{{ data.description }}</text>
<view
class="mt-20rpx flex flex-wrap gap-20rpx"
v-if="data.coverPic && data.coverPic.length > 0"
>
<template v-for="item in [data.coverPic]">
<view class="mt-20rpx flex flex-wrap gap-20rpx">
<image
v-for="(pic, index) in data.coverPic.split(',')"
:key="index"
:src="pic"
class="size-260rpx rounded-10rpx bg-#333333"
mode="aspectFill"
@click="previewImage(pic)"
/>
<template v-for="video in data.coverVideo.split(',')">
<!-- #ifdef APP-PLUS -->
<su-video v-if="item.endsWith('mp4')" :src="item" />
<su-video class="size-260rpx rounded-10rpx bg-#333333" :src="video" />
<!-- #endif -->
<!-- #ifndef APP-PLUS -->
<video v-if="item.endsWith('mp4')" :src="item" />
<video class="rounded-10rpx" :src="video" />
<!-- #endif -->
<image
v-else
v-if="item.startsWith('http')"
:src="item"
class="size-260rpx rounded-10rpx bg-#333333"
mode="aspectFill"
@click="previewImage(item)"
/>
</template>
</view>
</view>
<view class="mb-2 flex items-center pl-130rpx text-xs text-white/70">
<uni-icons type="location" size="16" color="#B5B4BC"></uni-icons>
<text>{{ data.issueAddress }} · 1km</text>
<text>{{ data.issueProvince }} {{ data.issueCity }} {{ data.issueAddress }}</text>
</view>
<view class="flex gap-60rpx pl-130rpx text-white">
<view class="flex items-center gap-10rpx text-sm">
@@ -60,13 +59,13 @@
size="24"
color="#ffcd32"
@click="handleunLike"
></uni-icons>
<uni-icons v-else type="heart" size="24" color="#B5B4BC" @click="handleLike"></uni-icons>
<text>{{ data.likes || 0 }} 喜欢</text>
/>
<uni-icons v-else type="heart" size="24" color="#B5B4BC" @click="handleLike" />
<text>{{ data.operationTotal || 0 }} 喜欢</text>
</view>
<view class="flex items-center gap-10rpx text-sm" @click="goChat">
<uni-icons type="chat" size="24" color="#B5B4BC"></uni-icons>
<text>{{ data.comments || 0 }} 打招呼</text>
<uni-icons type="chat" size="24" color="#B5B4BC" />
<text>打招呼</text>
</view>
</view>
</view>
@@ -75,6 +74,10 @@
<script setup lang="ts">
import RecentApi from '@/sheep/api/member/recent';
import { computed, reactive, ref } from 'vue';
// @ts-ignore
import { formatDate } from '@/sheep/util/index';
// @ts-ignore
import { getGender } from '@/sheep/util/index';
const props = defineProps<{
data: any;
+2 -2
View File
@@ -34,7 +34,7 @@
);
const emit = defineEmits<{
(e: 'update:modelValue', index: number): void;
(e: 'change', target: { label: string }): void;
(e: 'change', item: { label: string }, index: number): void;
}>();
const activeStyle = computed(() => {
@@ -52,6 +52,6 @@
function segmentedItem(item: { label: string }, index: number) {
if (props.modelValue === index) return;
emit('update:modelValue', index);
emit('change', item);
emit('change', item, index);
}
</script>
+5 -3
View File
@@ -2,7 +2,7 @@
<view class="flex px-4 py-2">
<image
class="w-200rpx h-300rpx mr-3 rounded-2 bg-#777"
:src="member.memberAvatar"
:src="data.coverPic.split(',')[0]"
mode="aspectFill"
/>
<view class="flex-1">
@@ -16,7 +16,7 @@
</view>
<view class="mt-2 flex flex-wrap gap-3">
<text class="bg-#333 text-color-theme-dark text-xs px-2 py-1 rounded-1">
{{ '未知性别' }}·{{ member.memberAge }}岁
{{ getGender(member.memberSex) }}·{{ member.memberAge }}岁
</text>
<text class="bg-#333 text-color-theme-dark text-xs px-2 py-1 rounded-1">
{{ member.memberHeight }}cm
@@ -28,7 +28,7 @@
{{ member.memberOcc }}
</text>
<text class="bg-#333 text-color-theme-dark text-xs px-2 py-1 rounded-1">
{{ data.issueCity }}km
{{ member.memberCity || data.issueCity }}
</text>
</view>
</view>
@@ -37,6 +37,8 @@
<script setup lang="ts">
import { computed } from 'vue';
// @ts-ignore
import { getGender } from '@/sheep/util/index';
const props = defineProps<{
data?: any;
+12
View File
@@ -151,3 +151,15 @@ export function jsonParse(str) {
return '';
}
}
// 判断性别
export const getGender = (genderType) => {
switch (genderType) {
case 1:
return '男';
case 2:
return '女';
default:
return '其他性别';
}
};