|
@@ -13,7 +13,9 @@
|
|
|
ref
|
|
|
} from 'vue'
|
|
|
import {
|
|
|
- onLoad
|
|
|
+ onLoad,
|
|
|
+ onShareAppMessage,
|
|
|
+ onShareTimeline
|
|
|
} from '@dcloudio/uni-app'
|
|
|
import {
|
|
|
getDynamicDetail
|
|
@@ -23,7 +25,7 @@
|
|
|
content: "", // 假设这是后端返回的内容
|
|
|
date: "" // ISO格式日期
|
|
|
})
|
|
|
-
|
|
|
+ const currentId = ref(null);
|
|
|
function formatDate(dateString) {
|
|
|
const options = {
|
|
|
year: 'numeric',
|
|
@@ -44,8 +46,24 @@
|
|
|
const {
|
|
|
id
|
|
|
} = option
|
|
|
+ currentId.value = id
|
|
|
init(id)
|
|
|
})
|
|
|
+
|
|
|
+ onShareAppMessage(async (res) => {
|
|
|
+ return {
|
|
|
+ title: announcement.value.title,
|
|
|
+ path: `/pages/dynamic/dynamicDetail/dynamicDetail?id=${currentId.value}`
|
|
|
+ };
|
|
|
+ })
|
|
|
+
|
|
|
+ onShareTimeline(async () => {
|
|
|
+ // console.log(imgurl.value)
|
|
|
+ return {
|
|
|
+ title: announcement.value.title,
|
|
|
+ query: `id=${currentId.value}`
|
|
|
+ };
|
|
|
+ })
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|