|
@@ -1,7 +1,10 @@
|
|
|
-<route lang="yaml">
|
|
|
-style:
|
|
|
- navigationBarTitleText: '详情'
|
|
|
- navigationBarBackgroundColor: '#fff'
|
|
|
+<route lang="json">
|
|
|
+{
|
|
|
+ "style": {
|
|
|
+ "navigationBarTitleText": "详情",
|
|
|
+ "navigationBarBackgroundColor": "#fff"
|
|
|
+ }
|
|
|
+}
|
|
|
</route>
|
|
|
<script setup lang="ts">
|
|
|
import Tag from '@/components/tag.vue'
|
|
@@ -9,7 +12,7 @@ import {
|
|
|
createCircleReview,
|
|
|
getCircle,
|
|
|
getCircleReviews,
|
|
|
- getMoment,
|
|
|
+ shareCircle,
|
|
|
} from '../../../core/libs/requests'
|
|
|
import { handleUpvoteClick } from '../../../core/libs/actions'
|
|
|
import { thumbsUp } from '../../../core/libs/svgs'
|
|
@@ -17,6 +20,7 @@ import CommentItem from '../components/comment-item.vue'
|
|
|
import AvatarGroupCasual from '@/components/avatar-group-casual/avatar-group-casual.vue'
|
|
|
import { useUserStore } from '../../../store'
|
|
|
import { storeToRefs } from 'pinia'
|
|
|
+import { isImageOrVideo } from '@/core/utils/common'
|
|
|
|
|
|
const userStore = useUserStore()
|
|
|
const { userInfo } = storeToRefs(userStore)
|
|
@@ -34,6 +38,7 @@ const current = ref(0)
|
|
|
const swiperSizes = ref()
|
|
|
const swiperStyle = ref()
|
|
|
const reviewContent = ref('')
|
|
|
+const isVideo = ref(false)
|
|
|
const handleChange = ({ detail: { current } }) => {
|
|
|
swiperStyle.value = {
|
|
|
height: swiperSizes.value[current].height + 'px',
|
|
@@ -41,6 +46,10 @@ const handleChange = ({ detail: { current } }) => {
|
|
|
}
|
|
|
const setSwiperStyle = async () => {
|
|
|
const { screenWidth } = await uni.getSystemInfo()
|
|
|
+ if (data.value.bannerUrls.length === 1 && isImageOrVideo(data.value.bannerUrls[0]) === 'video') {
|
|
|
+ isVideo.value = true
|
|
|
+ return
|
|
|
+ }
|
|
|
swiperSizes.value = (
|
|
|
await Promise.all(data.value.bannerUrls.map((src) => uni.getImageInfo({ src })))
|
|
|
).map(({ width, height }) => ({ width: screenWidth, height: height / (width / screenWidth) }))
|
|
@@ -69,13 +78,17 @@ onLoad(async (query: { id: string }) => {
|
|
|
await runGetReviews()
|
|
|
await setSwiperStyle()
|
|
|
})
|
|
|
+onShareAppMessage(async () => {
|
|
|
+ await shareCircle(id.value)
|
|
|
+ return { title: data.value?.circleDesc }
|
|
|
+})
|
|
|
</script>
|
|
|
<template>
|
|
|
<view class="bg-white flex-grow">
|
|
|
<!-- <div class="my-4 text-black/90 text-lg font-normal font-['PingFang SC'] leading-[10.18px]">
|
|
|
{{ data?.content }}
|
|
|
</div> -->
|
|
|
- <template v-if="swiperSizes">
|
|
|
+ <template v-if="swiperSizes && !isVideo">
|
|
|
<swiper :style="swiperStyle" @change="handleChange">
|
|
|
<template v-for="it of data?.bannerUrls" :key="it">
|
|
|
<swiper-item>
|
|
@@ -84,6 +97,9 @@ onLoad(async (query: { id: string }) => {
|
|
|
</template>
|
|
|
</swiper>
|
|
|
</template>
|
|
|
+ <template v-if="isVideo">
|
|
|
+ <video width="100%" class="w-full aspect-[1.64/1]" :src="data?.bannerUrls[0]"></video>
|
|
|
+ </template>
|
|
|
<!-- <wd-swiper
|
|
|
v-model="current"
|
|
|
custom-class="my-1"
|
|
@@ -97,7 +113,7 @@ onLoad(async (query: { id: string }) => {
|
|
|
<div class="text-black/90 text-base font-normal font-['PingFang SC'] leading-[10.18px]">
|
|
|
{{ data?.circleDesc }}
|
|
|
</div>
|
|
|
- <view class="my-5.5 flex gap-3.5">
|
|
|
+ <view class="my-5.5 flex gap-3.5 flex-wrap">
|
|
|
<!-- <TiltedButton>按钮</TiltedButton> -->
|
|
|
<template v-if="data?.tagName !== ''">
|
|
|
<template v-for="it of data?.tagName?.split(',')" :key="it">
|
|
@@ -185,12 +201,16 @@ onLoad(async (query: { id: string }) => {
|
|
|
></wd-input>
|
|
|
</div>
|
|
|
<view class="flex justify-around flex-1">
|
|
|
- <view
|
|
|
- class="flex flex-col items-center text-[rgba(0,0,0,0.85)] text-3.5 font-400 line-height-5.5"
|
|
|
- >
|
|
|
- <wd-img width="15" height="15" src="/static/svgs/share.svg"></wd-img>
|
|
|
- <view class="">{{ data?.shareCount }}</view>
|
|
|
- </view>
|
|
|
+ <div>
|
|
|
+ <button open-type="share" class="bg-transparent! p-0!">
|
|
|
+ <view
|
|
|
+ class="flex flex-col items-center text-[rgba(0,0,0,0.85)] text-3.5 font-400 line-height-5.5"
|
|
|
+ >
|
|
|
+ <wd-img width="15" height="15" src="/static/svgs/share.svg"></wd-img>
|
|
|
+ <view class="">{{ data?.shareCount || 0 }}</view>
|
|
|
+ </view>
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
<view
|
|
|
class="flex flex-col items-center text-[rgba(0,0,0,0.85)] text-3.5 font-400 line-height-5.5"
|
|
|
>
|