|
@@ -51,10 +51,17 @@
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
import { ref, computed, onMounted, watch, onUnmounted } from 'vue'
|
|
import { ref, computed, onMounted, watch, onUnmounted } from 'vue'
|
|
|
|
|
+import { onLoad } from '@dcloudio/uni-app'
|
|
|
import { downloadWithAuth } from '@/utils/downloadWithAuth'
|
|
import { downloadWithAuth } from '@/utils/downloadWithAuth'
|
|
|
import CustomNav from '@/components/custom-nav.vue'
|
|
import CustomNav from '@/components/custom-nav.vue'
|
|
|
import { getNewsById } from '@/api/news'
|
|
import { getNewsById } from '@/api/news'
|
|
|
|
|
|
|
|
|
|
+const query = ref<Record<string, string>>({})
|
|
|
|
|
+
|
|
|
|
|
+onLoad((options) => {
|
|
|
|
|
+ query.value = options || {}
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
// 处理内联markdown
|
|
// 处理内联markdown
|
|
|
const processInline = (text: string) => {
|
|
const processInline = (text: string) => {
|
|
|
return text.replace(/\*\*(.*?)\*\*/g, '$1').replace(/\*(.*?)\*/g, '$1');
|
|
return text.replace(/\*\*(.*?)\*\*/g, '$1').replace(/\*(.*?)\*/g, '$1');
|
|
@@ -356,8 +363,7 @@ const onImageError = async (src?: string, e?: any) => {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
onMounted(async () => {
|
|
onMounted(async () => {
|
|
|
- const query: Record<string, string> = (((globalThis as any).getCurrentPages ? (globalThis as any).getCurrentPages().slice(-1)[0]?.options : {}) as Record<string, string>) || {}
|
|
|
|
|
- const id = query.id || ''
|
|
|
|
|
|
|
+ const id = query.value.id || ''
|
|
|
if (!id) {
|
|
if (!id) {
|
|
|
isLoading.value = false
|
|
isLoading.value = false
|
|
|
return
|
|
return
|