|
|
@@ -112,51 +112,44 @@
|
|
|
/>
|
|
|
|
|
|
</FlexCol>
|
|
|
- <template v-else-if="node.type === 'Card:Level'">
|
|
|
-
|
|
|
- <!-- 状态与申请 -->
|
|
|
- <FlexRow
|
|
|
- backgroundColor="background.tertiary"
|
|
|
- radius="radius.md"
|
|
|
- padding="space.md"
|
|
|
- justify="space-between"
|
|
|
- >
|
|
|
- <FlexRow align="center">
|
|
|
- <FlexCol gap="gap.md">
|
|
|
- <FlexRow gap="gap.lg" align="center">
|
|
|
- <Icon v-if="villageInfoLoader.content.value?.vipLevel === 4" name="https://xy.wenlvti.net/app_static/images/village/IconGov.png" :size="70" />
|
|
|
- <Text :text="`${villageInfoLoader.content.value?.vipLevelText || '默认级别'}`" fontConfig="secondText" />
|
|
|
- </FlexRow>
|
|
|
- <Text v-if="villageInfoLoader.content.value?.sizeLimit" :text="`存储空间:${villageInfoLoader.content.value?.sizeText || ''}`" :fontSize="22" fontConfig="secondText" />
|
|
|
- <Text v-else text="无限存储空间" :fontSize="22" fontConfig="secondText" />
|
|
|
- </FlexCol>
|
|
|
- </FlexRow>
|
|
|
- <FlexRow align="center" gap="gap.md">
|
|
|
- <IconButton icon="help-filling" @click="navTo('/pages/article/details', { id: 7021, modelId: 18, showRecommend: false })" />
|
|
|
- <Button
|
|
|
- v-if="(villageInfoLoader.content.value?.vipLevel || 0) < 4"
|
|
|
- icon="https://xy.wenlvti.net/app_static/images/village/IconUser.png"
|
|
|
- radius="radius.lgr"
|
|
|
- :padding="[10, 30]"
|
|
|
- backgroundColor="white"
|
|
|
- text="升级村社"
|
|
|
- @click="upgradeRef?.show()"
|
|
|
- />
|
|
|
- </FlexRow>
|
|
|
+ <!-- 状态与申请 -->
|
|
|
+ <FlexRow
|
|
|
+ v-else-if="node.type === 'Card:Level'"
|
|
|
+ backgroundColor="background.tertiary"
|
|
|
+ radius="radius.md"
|
|
|
+ padding="space.md"
|
|
|
+ justify="space-between"
|
|
|
+ >
|
|
|
+ <FlexRow align="center">
|
|
|
+ <FlexCol gap="gap.md">
|
|
|
+ <FlexRow gap="gap.lg" align="center">
|
|
|
+ <Icon v-if="villageInfoLoader.content.value?.vipLevel === 4" name="https://xy.wenlvti.net/app_static/images/village/IconGov.png" :size="70" />
|
|
|
+ <Text :text="`${villageInfoLoader.content.value?.vipLevelText || '默认级别'}`" fontConfig="secondText" />
|
|
|
+ </FlexRow>
|
|
|
+ <Text v-if="villageInfoLoader.content.value?.sizeLimit" :text="`存储空间:${villageInfoLoader.content.value?.sizeText || ''}`" :fontSize="22" fontConfig="secondText" />
|
|
|
+ <Text v-else text="无限存储空间" :fontSize="22" fontConfig="secondText" />
|
|
|
+ </FlexCol>
|
|
|
</FlexRow>
|
|
|
-
|
|
|
- </template>
|
|
|
- <template v-else-if="node.type === 'Card:Gallery'">
|
|
|
-
|
|
|
- <!-- 图片 -->
|
|
|
- <VillageGallery
|
|
|
- v-if="villageInfoLoader.content.value"
|
|
|
- ref="villageGalleryRef"
|
|
|
- :villageId="villageStore.currentVillage?.id ?? 0"
|
|
|
- @goGallery="handleGoGallery"
|
|
|
- />
|
|
|
-
|
|
|
- </template>
|
|
|
+ <FlexRow align="center" gap="gap.md">
|
|
|
+ <IconButton icon="help-filling" @click="navTo('/pages/article/details', { id: 7021, modelId: 18, showRecommend: false })" />
|
|
|
+ <Button
|
|
|
+ v-if="(villageInfoLoader.content.value?.vipLevel || 0) < 4"
|
|
|
+ icon="https://xy.wenlvti.net/app_static/images/village/IconUser.png"
|
|
|
+ radius="radius.lgr"
|
|
|
+ :padding="[10, 30]"
|
|
|
+ backgroundColor="white"
|
|
|
+ text="升级村社"
|
|
|
+ @click="upgradeRef?.show()"
|
|
|
+ />
|
|
|
+ </FlexRow>
|
|
|
+ </FlexRow>
|
|
|
+ <!-- 图片相册 -->
|
|
|
+ <VillageGallery
|
|
|
+ v-else-if="node.type === 'Card:Gallery' && villageInfoLoader.content.value"
|
|
|
+ ref="villageGalleryRef"
|
|
|
+ :villageId="villageStore.currentVillage?.id ?? 0"
|
|
|
+ @goGallery="handleGoGallery"
|
|
|
+ />
|
|
|
<template v-else-if="node.type === 'Card:AddressAndMap'">
|
|
|
|
|
|
<!-- 地图 -->
|
|
|
@@ -235,124 +228,30 @@
|
|
|
</FlexRow>
|
|
|
|
|
|
</template>
|
|
|
- <template v-else-if="node.type === 'Block:Rank'">
|
|
|
-
|
|
|
- <!-- 排行榜 -->
|
|
|
- <HomeTitle
|
|
|
- :title="node.props?.title"
|
|
|
- showMore
|
|
|
- @moreClicked="navTo('/pages/home/village/rank/volunteer', {
|
|
|
- villageId: villageStore.currentVillage?.id ?? undefined,
|
|
|
- })"
|
|
|
- />
|
|
|
- <Height height="gap.md" />
|
|
|
- <VillageUserRankList
|
|
|
- :list="villageUserRankListLoader.content.value ?? []"
|
|
|
- scoreSuffix="文化积分"
|
|
|
- @goDetails="navTo('/pages/home/village/volunteer/detail', { id: $event.id })"
|
|
|
- />
|
|
|
-
|
|
|
- </template>
|
|
|
- <template v-else-if="node.type === 'Block:Collect'">
|
|
|
-
|
|
|
- <!-- 魅力乡源 -->
|
|
|
- <HomeTitle :title="node.props?.title">
|
|
|
- <template #right>
|
|
|
- <FlexRow align="center" gap="gap.md">
|
|
|
- <FrameButton
|
|
|
- text="管理"
|
|
|
- size="small"
|
|
|
- primary
|
|
|
- @click="handleGoDigManage()"
|
|
|
- />
|
|
|
- <FrameButton
|
|
|
- text="共编村史"
|
|
|
- icon="https://xy.wenlvti.net/app_static/images/village/IconHistory.png"
|
|
|
- size="small"
|
|
|
- @click="handleGoCollect()"
|
|
|
- />
|
|
|
- <Width :size="15" />
|
|
|
- </FlexRow>
|
|
|
- </template>
|
|
|
- </HomeTitle>
|
|
|
- <Height height="gap.md" />
|
|
|
- <Grid :borderGrid="false" :mainAxisCount="4">
|
|
|
- <GridItem title="村社概况" icon="https://xy.wenlvti.net/app_static/images/village/IconLargeIntrod.png" touchable @click="handleGoCollect(11, '村社概况')" />
|
|
|
- <GridItem title="自然风光" icon="https://xy.wenlvti.net/app_static/images/village/IconLargeEnvirounment.png" touchable @click="handleGoCollect(13, '自然风光')" />
|
|
|
- <GridItem title="历史沿革" icon="https://xy.wenlvti.net/app_static/images/village/IconLargeHistory.png" touchable @click="handleGoCollect(2, '历史沿革')" />
|
|
|
- <GridItem title="特色产业" icon="https://xy.wenlvti.net/app_static/images/village/IconLargeIndustry.png" touchable @click="handleGoCollect(9, '特色产业' )" />
|
|
|
- <GridItem title="文艺活动" icon="https://xy.wenlvti.net/app_static/images/village/IconLargeActivity.png" touchable @click="handleGoCollect(12, '文艺活动')" />
|
|
|
- <GridItem title="非遗展示" icon="https://xy.wenlvti.net/app_static/images/village/IconLargeShow.png" touchable @click="handleGoCollect(10, '非遗展示')" />
|
|
|
- <GridItem title="民俗风采" icon="https://xy.wenlvti.net/app_static/images/village/IconLargeFolkloreVibe.png" touchable @click="handleGoCollect(8, '民俗风采')" />
|
|
|
- <GridItem title="历史人物" icon="https://xy.wenlvti.net/app_static/images/village/IconGoods.png" touchable @click="handleGoCollect(7, '历史人物')" />
|
|
|
- </Grid>
|
|
|
-
|
|
|
- </template>
|
|
|
- <template v-else-if="node.type === 'Block:Games'">
|
|
|
-
|
|
|
- <!-- 活力乡源 -->
|
|
|
- <HomeTitle :title="node.props?.title" />
|
|
|
- <Height height="gap.md" />
|
|
|
- <Grid :borderGrid="false" :mainAxisCount="4">
|
|
|
- <GridItem
|
|
|
- v-for="item in node.props?.items"
|
|
|
- :key="item.title"
|
|
|
- :title="item.title"
|
|
|
- :icon="item.icon"
|
|
|
- touchable
|
|
|
- @click="() => context.getScriptEngine().execute(item.handler, node.getNodeScriptContext?.())"
|
|
|
- />
|
|
|
- </Grid>
|
|
|
-
|
|
|
- </template>
|
|
|
- <template v-else-if="node.type === 'Block:Official'">
|
|
|
-
|
|
|
- <!-- 文脉乡源 -->
|
|
|
- <FlexCol>
|
|
|
- <FlexCol gap="gap.md" padding="padding.lg">
|
|
|
- <HomeTitle :title="node.props?.title" :showTopMargin="false">
|
|
|
- <template #right>
|
|
|
- <FlexRow align="center" gap="gap.md">
|
|
|
- <BubbleTip
|
|
|
- v-model:show="showManageTip"
|
|
|
- position="bottom"
|
|
|
- crossPosition="right"
|
|
|
- arrowOffsetX="180rpx"
|
|
|
- content="村社贴图太乱?点这里整理"
|
|
|
- @contentClick="handleCloseManageTip(true)"
|
|
|
- @close="handleCloseManageTip(false)"
|
|
|
- >
|
|
|
- <FrameButton
|
|
|
- text="管理"
|
|
|
- size="small"
|
|
|
- primary
|
|
|
- @click="handleGoOfficalManage()"
|
|
|
- />
|
|
|
- </BubbleTip>
|
|
|
- <FrameButton
|
|
|
- text="乡源AI帮你写"
|
|
|
- size="small"
|
|
|
- icon="https://xy.wenlvti.net/app_static/images/village/IconLargeHistory.png"
|
|
|
- @click="handleGoPublish()"
|
|
|
- />
|
|
|
- </FlexRow>
|
|
|
- </template>
|
|
|
- </HomeTitle>
|
|
|
- <Height height="gap.md" />
|
|
|
- <RoundTags
|
|
|
- v-model:active="listActiveTag"
|
|
|
- :tags="tagsLoader.content.value || []"
|
|
|
- />
|
|
|
- </FlexCol>
|
|
|
- <OfficialAccountPublishWrap
|
|
|
- :topic="recommendTagName"
|
|
|
- :path="recommendPath"
|
|
|
- @publishsuccess="onPublishSuccess"
|
|
|
- @empty="isOfficialEmpty=true"
|
|
|
- />
|
|
|
- </FlexCol>
|
|
|
-
|
|
|
- </template>
|
|
|
+ <!-- 排行榜 -->
|
|
|
+ <Rank
|
|
|
+ v-else-if="node.type === 'Block:Rank'"
|
|
|
+ :title="node.props?.title"
|
|
|
+ :villageId="villageStore.currentVillage?.id ?? 0"
|
|
|
+ />
|
|
|
+ <!-- 4网格 -->
|
|
|
+ <GridButtonBlock4
|
|
|
+ v-else-if="node.type === 'Block:GridButtonBlock4'"
|
|
|
+ :title="node.props?.title"
|
|
|
+ :titleRightButtons="node.props?.titleRightButtons"
|
|
|
+ :items="node.props?.items"
|
|
|
+ @click="(script) => context.getScriptEngine().execute(script, node.getNodeScriptContext?.())"
|
|
|
+ />
|
|
|
+ <!-- 文脉乡源 -->
|
|
|
+ <OfficialAccountPublish
|
|
|
+ ref="officialAccountPublishRef"
|
|
|
+ v-else-if="node.type === 'Block:Official'"
|
|
|
+ :villageId="villageStore.currentVillage?.id ?? 0"
|
|
|
+ :villageTitle="villageStore.currentVillage?.name ?? ''"
|
|
|
+ :title="node.props?.title"
|
|
|
+ :tags="tagsLoader.content.value || []"
|
|
|
+ @goOfficalManage="handleGoOfficalManage"
|
|
|
+ />
|
|
|
</template>
|
|
|
</DynamicXNodeChild>
|
|
|
</template>
|
|
|
@@ -419,7 +318,6 @@
|
|
|
<script setup lang="ts">
|
|
|
import { computed, inject, reactive, ref, watch, type Ref } from 'vue';
|
|
|
import { useUserTools } from '@/common/composeabe/UserTools';
|
|
|
-import { useOfficialAccount } from '../../composeabe/OfficialAccount';
|
|
|
import { useAuthStore } from '@/store/auth';
|
|
|
import { useSimpleDataLoader } from '@/components/composeabe/loader/SimpleDataLoader';
|
|
|
import { useVillageStore } from '@/store/village';
|
|
|
@@ -432,7 +330,6 @@ import { alert, confirm } from '@/components/dialog/CommonRoot';
|
|
|
import { isDevEnv } from '@/common/config/AppCofig';
|
|
|
import { defaultTags } from './data/DefaultTag';
|
|
|
import DefaultCard from './data/DefaultCard.json';
|
|
|
-import HomeTitle from '@/common/components/parts/HomeTitle.vue';
|
|
|
import Icon from '@/components/basic/Icon.vue';
|
|
|
import Text from '@/components/basic/Text.vue';
|
|
|
import BackgroundBox from '@/components/display/block/BackgroundBox.vue';
|
|
|
@@ -441,13 +338,7 @@ import FlexCol from '@/components/layout/FlexCol.vue';
|
|
|
import FlexRow from '@/components/layout/FlexRow.vue';
|
|
|
import VillageMiniMap from '../../components/VillageMiniMap.vue';
|
|
|
import Divider from '@/components/display/Divider.vue';
|
|
|
-import RoundTags from '@/common/components/parts/RoundTags.vue';
|
|
|
-import VillageUserRankList from '../../components/VillageUserRankList.vue';
|
|
|
import ProvideVar from '@/components/theme/ProvideVar.vue';
|
|
|
-import Grid from '@/components/layout/grid/Grid.vue';
|
|
|
-import GridItem from '@/components/layout/grid/GridItem.vue';
|
|
|
-import LightVillageApi from '@/api/light/LightVillageApi';
|
|
|
-import OfficialAccountPublishWrap from '@/common/components/OfficialAccountPublishWrap.vue';
|
|
|
import UpgradeDialog from '../dialogs/UpgradeDialog.vue';
|
|
|
import VillageGallery from '../components/VillageGallery.vue';
|
|
|
import WxButton from '@/components/basic/WxButton.vue';
|
|
|
@@ -472,6 +363,9 @@ import DynamicXNodeChild from '@/components/dynamic/x/DynamicXNodeChild.vue';
|
|
|
import SimplePageContentLoader from '@/components/loader/SimplePageContentLoader.vue';
|
|
|
import HomeLargeTitle from '@/common/components/parts/HomeLargeTitle.vue';
|
|
|
import SkinApi from '@/api/light/SkinApi';
|
|
|
+import OfficialAccountPublish from './card/blocks/OfficialAccountPublish.vue';
|
|
|
+import Rank from './card/blocks/Rank.vue';
|
|
|
+import GridButtonBlock4 from './card/blocks/GridButtonBlock4.vue';
|
|
|
|
|
|
const emit = defineEmits<{
|
|
|
(e: 'goTree'): void;
|
|
|
@@ -479,19 +373,11 @@ const emit = defineEmits<{
|
|
|
}>();
|
|
|
|
|
|
const authStore = useAuthStore();
|
|
|
+const villageStore = useVillageStore();
|
|
|
const { getIsVolunteer } = useUserTools();
|
|
|
const { requireLogin } = useRequireLogin();
|
|
|
-const { onPublishSuccess, makeOfficialPublishLinkPathAndParams } = useOfficialAccount(() => {
|
|
|
- return {
|
|
|
- villageId: villageStore.currentVillage?.id ?? 0,
|
|
|
- userId: authStore.userId,
|
|
|
- tag: recommendTagName.value,
|
|
|
- };
|
|
|
-});
|
|
|
-const villageStore = useVillageStore();
|
|
|
const { isFollowed, onFollow, onUnFollow } = useFollow();
|
|
|
const { getIsJoinedVillage } = useUserTools();
|
|
|
-const isOfficialEmpty = ref(false);
|
|
|
const isJoined = ref(false);
|
|
|
const villageInfoLoader = useSimpleDataLoader(async () => {
|
|
|
const village = villageStore.currentVillage;
|
|
|
@@ -503,10 +389,9 @@ const villageInfoLoader = useSimpleDataLoader(async () => {
|
|
|
isJoined.value = false;
|
|
|
}
|
|
|
handleShowFollowTip();
|
|
|
- isOfficialEmpty.value = false;
|
|
|
showUnLight.value = !villageStore.currentVillage?.isLight;
|
|
|
setTimeout(() => {
|
|
|
- handleManageFollowTip();
|
|
|
+ officialAccountPublishRef.value?.handleManageFollowTip();
|
|
|
}, 3000);
|
|
|
return {
|
|
|
title: village?.name || '',
|
|
|
@@ -541,22 +426,8 @@ const isStaff = computed(() => staffInfo.value?.type === 'staff');
|
|
|
const shareQRDialog = ref<InstanceType<typeof ShareQRDialog>>();
|
|
|
|
|
|
const descOpen = ref(false);
|
|
|
-const listActiveTag = ref('广场');
|
|
|
|
|
|
-const villageUserRankListLoader = useSimpleDataLoader(async () => {
|
|
|
- const res = (await LightVillageApi.getVolunteerRankList({
|
|
|
- num: 3,
|
|
|
- village_id: villageStore.currentVillage?.id ?? undefined,
|
|
|
- }))
|
|
|
- .map((item, i) => ({
|
|
|
- id: item.id,
|
|
|
- image: item.avatar ?? '',
|
|
|
- title: item.name,
|
|
|
- rank: i + 1,
|
|
|
- score: item.points,
|
|
|
- }));
|
|
|
- return res
|
|
|
-});
|
|
|
+
|
|
|
|
|
|
const showFollowTipTimeout = new MemoryTimeOut('FollowTip', 1000 * 3600);//1h
|
|
|
const showFollowTip = ref(false);
|
|
|
@@ -571,23 +442,6 @@ function handleCloseFollowTip() {
|
|
|
}
|
|
|
|
|
|
const showUnLight = ref(false);
|
|
|
-const showManageTipTimeout = new MemoryTimeOut('VillageManageTip', 1000 * 3600 * 20);//30h
|
|
|
-const showManageTip = ref(false);
|
|
|
-
|
|
|
-function handleManageFollowTip() {
|
|
|
- if (showManageTipTimeout.isTimeout() && !isOfficialEmpty.value)
|
|
|
- showManageTip.value = true;
|
|
|
-}
|
|
|
-function handleCloseManageTip(goComp: boolean) {
|
|
|
- showManageTipTimeout.recordTime();
|
|
|
-}
|
|
|
-
|
|
|
-const recommendTagName = computed(() => {
|
|
|
- return '亮乡源·' + villageInfoLoader.content.value?.title + '·' + listActiveTag.value;
|
|
|
-});
|
|
|
-const recommendPath = computed(() => {
|
|
|
- return makeOfficialPublishLinkPathAndParams('/pages/index');
|
|
|
-});
|
|
|
|
|
|
function handleGoJoin() {
|
|
|
if (isJoined.value)
|
|
|
@@ -615,14 +469,6 @@ function handleGoCollect(collectModuleId?: number, title?: string) {
|
|
|
title: title,
|
|
|
});
|
|
|
}
|
|
|
-function handleGoPublish() {
|
|
|
- requireLogin(async () => {
|
|
|
- navTo('/pages/home/chat/dependent/post/publish', {
|
|
|
- tag: recommendTagName.value,
|
|
|
- villageId: villageStore.currentVillage?.id ?? undefined,
|
|
|
- });
|
|
|
- }, '登录后以便发布文章使用更多功能哦!');
|
|
|
-}
|
|
|
function handleGoGallery() {
|
|
|
navTo('/pages/home/village/gallery/index', {
|
|
|
villageId: villageStore.currentVillage?.id ?? 0 ,
|
|
|
@@ -672,13 +518,13 @@ async function checkIsStaff(needTopic?: boolean) {
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
-async function handleGoOfficalManage() {
|
|
|
+async function handleGoOfficalManage(recommendTagName: string) {
|
|
|
assertNotNull(villageStore.currentVillage?.id)
|
|
|
if (!await checkIsStaff(true))
|
|
|
return;
|
|
|
navTo('/pages/home/village/post/management-list', {
|
|
|
villageId: villageStore.currentVillage.id,
|
|
|
- topic: recommendTagName.value,
|
|
|
+ topic: recommendTagName,
|
|
|
});
|
|
|
}
|
|
|
async function handleGoEdit() {
|
|
|
@@ -704,6 +550,7 @@ const { currentNoticeContent, noticeListLoader } = useGetNotice(() => villageSto
|
|
|
const upgradeRef = ref<InstanceType<typeof UpgradeDialog>>();
|
|
|
const villageGalleryRef = ref<InstanceType<typeof VillageGallery>>();
|
|
|
const changeNickRef = ref<InstanceType<typeof ChangeNickDialog>>();
|
|
|
+const officialAccountPublishRef = ref<InstanceType<typeof OfficialAccountPublish>>();
|
|
|
|
|
|
const pageScriptGlobal = reactive({
|
|
|
handleGoGallery,
|
|
|
@@ -741,8 +588,6 @@ watch(() => villageStore.currentVillage, async () => {
|
|
|
await waitTimeOut(100);
|
|
|
await villageInfoLoader.reload();
|
|
|
await waitTimeOut(100);
|
|
|
- await villageUserRankListLoader.reload();
|
|
|
- await waitTimeOut(100);
|
|
|
await noticeListLoader.reload();
|
|
|
}, { immediate: true });
|
|
|
|
|
|
@@ -751,9 +596,7 @@ defineExpose({
|
|
|
if (name === 'refreshVillageGrallery') {
|
|
|
villageGalleryRef.value?.refresh();
|
|
|
} else if (name === 'refreshOfficialAccount') {
|
|
|
- const tag = listActiveTag.value;
|
|
|
- listActiveTag.value = '';
|
|
|
- setTimeout(() => listActiveTag.value = tag, 100);
|
|
|
+ officialAccountPublishRef.value?.refresh();
|
|
|
} else if (name === 'showVillageUpgrade') {
|
|
|
upgradeRef.value?.show();
|
|
|
} else if (name === 'backShowVillageJoin') {
|