|
@@ -16,7 +16,7 @@ import {
|
|
|
getCircleUpvotes,
|
|
|
shareCircle,
|
|
|
} from '../../../core/libs/requests'
|
|
|
-import { handleUpvoteClick } from '../../../core/libs/actions'
|
|
|
+import { handleShareClick, handleUpvoteClick } from '../../../core/libs/actions'
|
|
|
import CommentItem from '../components/comment-item.vue'
|
|
|
import { useUserStore } from '../../../store'
|
|
|
import { storeToRefs } from 'pinia'
|
|
@@ -27,11 +27,14 @@ import BottomAppBar from '@/components/bottom-app-bar.vue'
|
|
|
import { likeActived, likeBlack } from '@designer-hub/assets/src/icons'
|
|
|
import NavBarEvo from '@/components/navbar-evo.vue'
|
|
|
import { useRouter } from '../../../core/utils/router'
|
|
|
+import { usePermissions } from '../../../composables/permissions'
|
|
|
|
|
|
+const { features } = usePermissions()
|
|
|
const userStore = useUserStore()
|
|
|
const { userInfo } = storeToRefs(userStore)
|
|
|
const router = useRouter()
|
|
|
const id = ref()
|
|
|
+const isShared = ref(false)
|
|
|
const { data, run } = useRequest(() => getCircle(id.value), { initialData: {} })
|
|
|
const { data: reviews, run: runGetReviews } = useRequest(
|
|
|
() => getCircleReviews({ circleId: id.value }),
|
|
@@ -84,21 +87,35 @@ const handleSend = async () => {
|
|
|
}
|
|
|
}
|
|
|
onMounted(async () => {})
|
|
|
-onLoad(async (query: { id: string }) => {
|
|
|
+onLoad(async (query: { id: string; isShared?: boolean }) => {
|
|
|
id.value = query.id
|
|
|
+ isShared.value = query.isShared
|
|
|
await run()
|
|
|
await runGetReviews()
|
|
|
await setSwiperStyle()
|
|
|
await setCircleUpvotes()
|
|
|
})
|
|
|
-onShareAppMessage(async () => {
|
|
|
+// onShareAppMessage(async () => {
|
|
|
+// await shareCircle(id.value)
|
|
|
+// return { title: data.value?.circleDesc }
|
|
|
+// })
|
|
|
+onShareAppMessage(async ({ from, target }) => {
|
|
|
+ console.log('from', from)
|
|
|
+ console.log('target', target)
|
|
|
+ if (!features.value.shareMoment) {
|
|
|
+ return handleShareClick()
|
|
|
+ }
|
|
|
+ const res: Page.CustomShareContent = {}
|
|
|
await shareCircle(id.value)
|
|
|
- return { title: data.value?.circleDesc }
|
|
|
+ res.path = `/pages/home/moment/index?id=${id.value}&isShared=true`
|
|
|
+ res.imageUrl = data.value?.bannerUrls[0]
|
|
|
+ res.title = `${data.value?.stylistName}: ${data.value?.circleDesc}`
|
|
|
+ return res
|
|
|
})
|
|
|
</script>
|
|
|
<template>
|
|
|
<view class="bg-white flex-grow">
|
|
|
- <NavBarEvo placeholder>
|
|
|
+ <NavBarEvo placeholder :isShowBack="!isShared">
|
|
|
<template #prepend>
|
|
|
<div
|
|
|
class="flex items-center gap-2"
|