|
|
@@ -2,11 +2,23 @@
|
|
|
<FlexCol :padding="[0,0,50,0]">
|
|
|
<FlexCol position="absolute" :zIndex="100" :inset="{ l: 0, r: 0, t: 0 }">
|
|
|
<StatusBarSpace />
|
|
|
- <NavBar :title="loader.content.value?.title || '文章详情'" leftButton="back" />
|
|
|
+ <NavBar
|
|
|
+ :title="loader.content.value?.title || '文章详情'"
|
|
|
+ leftButton="back"
|
|
|
+ :leftButtonProps="{
|
|
|
+ buttonStyle: {
|
|
|
+ marginLeft: '20rpx',
|
|
|
+ },
|
|
|
+ shape: 'round-full',
|
|
|
+ backgroundColor: 'background.primary',
|
|
|
+ }"
|
|
|
+ customBack
|
|
|
+ @backPressed="handleBack"
|
|
|
+ />
|
|
|
</FlexCol>
|
|
|
<SimplePageContentLoader :loader="loader">
|
|
|
<template v-if="loader.content.value">
|
|
|
- <FlexCol gap="games">
|
|
|
+ <FlexCol gap="gap.md">
|
|
|
<swiper
|
|
|
v-if="loader.content.value.images.length > 0"
|
|
|
circular
|
|
|
@@ -100,6 +112,10 @@
|
|
|
@click="goDetails(item.id)"
|
|
|
/>
|
|
|
</FlexCol>
|
|
|
+ <LikeFooter
|
|
|
+ :content="loader.content.value"
|
|
|
+ @refresh="loader.reload(); isChangedStatus=true"
|
|
|
+ />
|
|
|
</FlexCol>
|
|
|
</template>
|
|
|
</SimplePageContentLoader>
|
|
|
@@ -107,11 +123,11 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
-import { computed } from "vue";
|
|
|
+import { computed, ref } from "vue";
|
|
|
import { useSimpleDataLoader } from "@/components/composeabe/loader/SimpleDataLoader";
|
|
|
import { useSwiperImagePreview } from "@/common/composeabe/SwiperImagePreview";
|
|
|
import { useLoadQuerys } from "@/components/composeabe/LoadQuerys";
|
|
|
-import { backAndCallOnPageBack, navTo } from "@/components/utils/PageAction";
|
|
|
+import { backAndCallOnPageBack, navTo, back } from "@/components/utils/PageAction";
|
|
|
import { onShareTimeline, onShareAppMessage } from "@dcloudio/uni-app";
|
|
|
import { DataDateUtils } from "@imengyu/js-request-transform";
|
|
|
import SimplePageContentLoader from "@/components/loader/SimplePageContentLoader.vue";
|
|
|
@@ -130,6 +146,7 @@ import Avatar from "@/components/display/Avatar.vue";
|
|
|
import Touchable from "@/components/feedback/Touchable.vue";
|
|
|
import StatusBarSpace from "@/components/layout/space/StatusBarSpace.vue";
|
|
|
import NavBar from "@/components/nav/NavBar.vue";
|
|
|
+import LikeFooter from "./components/LikeFooter.vue";
|
|
|
|
|
|
const { onPreviewImage } = useSwiperImagePreview(() => loader.content.value?.images || []);
|
|
|
const emptyContent = computed(() =>
|
|
|
@@ -155,6 +172,8 @@ const { querys } = useLoadQuerys({
|
|
|
keywords: '',
|
|
|
}, (t) => loader.load(false, t));
|
|
|
|
|
|
+const isChangedStatus = ref(false);
|
|
|
+
|
|
|
function goDetails(id: number) {
|
|
|
navTo('details', {
|
|
|
id,
|
|
|
@@ -169,6 +188,14 @@ function handleGoVillageDetails(id: number) {
|
|
|
backAndCallOnPageBack('goVillage', { id });
|
|
|
}
|
|
|
|
|
|
+function handleBack() {
|
|
|
+ if (isChangedStatus.value) {
|
|
|
+ backAndCallOnPageBack('refresh', { needRefresh: true });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ back();
|
|
|
+}
|
|
|
+
|
|
|
function getPageShareData() {
|
|
|
if (!loader.content.value)
|
|
|
return { title: '文章详情', imageUrl: '' }
|