Просмотр исходного кода

🎨 按要求修复分享跳转村落问题和我的细节修改

快乐的梦鱼 12 часов назад
Родитель
Сommit
b4db822f56

+ 1 - 1
src/pages/home/index.vue

@@ -450,7 +450,7 @@ async function loadInfo() {
   handleShowLightTip();
   handleShowLightTip();
 
 
   try {
   try {
-    if (villageStore.myFollowVillages.length > 0) {
+    if (!villageStore.currentVillage && villageStore.myFollowVillages.length > 0) {
       const currentVillage = villageStore.loadCurrentVillage();
       const currentVillage = villageStore.loadCurrentVillage();
       const id = (villageStore.myFollowVillages.find(p => p.id === currentVillage) as VillageListItem || villageStore.myFollowVillages[0]).id;
       const id = (villageStore.myFollowVillages.find(p => p.id === currentVillage) as VillageListItem || villageStore.myFollowVillages[0]).id;
       const res = await LightVillageApi.getVillageDetails(id)
       const res = await LightVillageApi.getVillageDetails(id)

+ 16 - 0
src/pages/home/village/bless/recharge.vue

@@ -28,6 +28,16 @@
           </FlexRow>
           </FlexRow>
         </BoxMid>
         </BoxMid>
       </FlexCol>
       </FlexCol>
+
+      <SimplePageContentLoader :loader="infoLoader">
+        <FlexCol gap="gap.md" padding="padding.md">
+          <IconTextBlock icon="prompt" :iconProps="{ 
+            color: 'text.content',
+            size: 40,
+          }" :title="infoLoader.content?.value?.title" />
+          <Parse :content="infoLoader.content?.value?.content || ''" />
+        </FlexCol>
+      </SimplePageContentLoader>
     </FlexCol>
     </FlexCol>
   </CommonTopBanner>
   </CommonTopBanner>
 </template>
 </template>
@@ -47,12 +57,18 @@ import FlexCol from '@/components/layout/FlexCol.vue';
 import FlexRow from '@/components/layout/FlexRow.vue';
 import FlexRow from '@/components/layout/FlexRow.vue';
 import Image from '@/components/basic/Image.vue';
 import Image from '@/components/basic/Image.vue';
 import TreeApi from '@/api/light/TreeApi';
 import TreeApi from '@/api/light/TreeApi';
+import CommonContent from '@/api/CommonContent';
+import IconTextBlock from '@/components/display/block/IconTextBlock.vue';
+import SimplePageContentLoader from '@/components/loader/SimplePageContentLoader.vue';
+import Parse from '@/components/display/parse/Parse.vue';
 
 
 const { requireLoginAsync } = useRequireLogin();
 const { requireLoginAsync } = useRequireLogin();
 const { querys } = useLoadQuerys({
 const { querys } = useLoadQuerys({
   villageId: 0,
   villageId: 0,
 });
 });
 
 
+const infoLoader = useSimpleDataLoader(async () => await CommonContent.getContentDetail(7023, undefined, 18));
+
 const listLoader = useSimpleDataLoader(async () => {
 const listLoader = useSimpleDataLoader(async () => {
   return (await TreeApi.getFruitDepositList({ page: 1, pageSize: 30 })).list;
   return (await TreeApi.getFruitDepositList({ page: 1, pageSize: 30 })).list;
 });
 });

+ 2 - 2
src/pages/home/village/introd/card.vue

@@ -68,11 +68,11 @@
         </FlexRow>
         </FlexRow>
       </FlexRow>
       </FlexRow>
 
 
-      <FlexRow gap="gap.md" align="flex-start">
+      <FlexRow gap="gap.md" justify="space-between" align="flex-start">
         <!-- 简介 -->
         <!-- 简介 -->
         <TextEllipsis 
         <TextEllipsis 
           fontConfig="secondText"
           fontConfig="secondText"
-          :outerProps="{ direction: 'row', width: '480rpx' }"
+          :outerProps="{ direction: 'row', width: '490rpx' }"
           :lines="1" 
           :lines="1" 
           :expandable="(villageInfoLoader.content.value?.desc as string || '').length > 20"
           :expandable="(villageInfoLoader.content.value?.desc as string || '').length > 20"
           :text="(villageInfoLoader.content.value?.desc as string) || '暂无简介,欢迎您来编写完善!'"
           :text="(villageInfoLoader.content.value?.desc as string) || '暂无简介,欢迎您来编写完善!'"

+ 3 - 1
src/pages/index.vue

@@ -101,8 +101,10 @@ async function loadShareVillageInfo(id?: number) {
 function getShareVillageInfo() {
 function getShareVillageInfo() {
   if (villageStore.currentVillage) {
   if (villageStore.currentVillage) {
     //分享村社信息
     //分享村社信息
+    const villageInfoInList = villageStore.myJoinedVillages.find(v => v.id === villageStore.currentVillage?.id);
+    const myNickName = villageInfoInList?.villageNickname || authStore.userInfo?.nickname || authStore.userInfo?.username || '老友';
     return {
     return {
-      title: `同乡 ${authStore.userInfo?.nickname} 邀您回 ${villageStore.currentVillage.name} 村看看,心系故土,携手共建美好家乡`,
+      title: `同乡 ${myNickName} 邀您回 ${villageStore.currentVillage.name} 村看看,心系故土,携手共建美好家乡`,
       path: `/pages/index?villageId=${villageStore.currentVillage.id}&userId=${authStore.userInfo?.id || 0}`,
       path: `/pages/index?villageId=${villageStore.currentVillage.id}&userId=${authStore.userInfo?.id || 0}`,
       imageUrl: villageStore.currentVillage.image || 'https://mn.wenlvti.net/app_static/xiangyuan/images/index-post.jpg',
       imageUrl: villageStore.currentVillage.image || 'https://mn.wenlvti.net/app_static/xiangyuan/images/index-post.jpg',
     }
     }

+ 19 - 12
src/pages/user/index.vue

@@ -45,18 +45,24 @@
       :padding="[40,20]"
       :padding="[40,20]"
       direction="row"
       direction="row"
     >
     >
-      <FlexRow :flex="1" :gap="10" center>
-        <Text>我的乡源果: </Text>
-        <Text fontConfig="lightGoldTitle">{{ userInfo?.fruit || 0 }}</Text>
-        <FrameButton size="small" text="充值" @click="navTo('/pages/home/village/bless/recharge')" />
-      </FlexRow>
-      <FlexRow :flex="1" :gap="10" center>
-        <Touchable direction="row" align="center" :gap="10" @click="navTo('/pages/dig/about/point')">
-          <Text>文化积分:</Text>
-          <Icon icon="help-filling" color="primary" :size="40" />
-        </Touchable>
-        <Text fontConfig="lightGoldTitle">{{ volunteerInfoLoader.content.value?.points || 0 }}</Text>
-      </FlexRow>
+      <FlexCol :flex="1" center>
+        <FlexRow :gap="10" center>
+          <Image src="https://xy.wenlvti.net/app_static/images/village/IconFruit.png" width="30rpx" height="30rpx" mode="aspectFill" />
+          <Text fontConfig="lightGoldTitle">{{ userInfo?.fruit || 0 }}</Text>
+          <Width :size="12" />
+          <FrameButton size="small" text="充值" @click="navTo('/pages/home/village/bless/recharge')" />
+        </FlexRow>
+        <Text fontConfig="subText">我的乡源果</Text>
+      </FlexCol>
+        <FlexCol :flex="1" center>
+        <FlexRow :gap="10" center>
+          <Touchable direction="row" align="center" :gap="10" @click="navTo('/pages/dig/about/point')">
+            <Icon icon="help-filling" color="primary" :size="40" />
+          </Touchable>
+          <Text fontConfig="lightGoldTitle">{{ volunteerInfoLoader.content.value?.points || 0 }}</Text>
+        </FlexRow>
+        <Text fontConfig="subText">文化积分</Text>
+      </FlexCol>
     </BoxMid>
     </BoxMid>
 
 
     <ProvideVar :vars="{
     <ProvideVar :vars="{
@@ -107,6 +113,7 @@ import Grid from '@/components/layout/grid/Grid.vue';
 import GridItem from '@/components/layout/grid/GridItem.vue';
 import GridItem from '@/components/layout/grid/GridItem.vue';
 import BoxMid from '@/common/components/box/BoxMid.vue';
 import BoxMid from '@/common/components/box/BoxMid.vue';
 import FrameButton from '@/common/components/FrameButton.vue';
 import FrameButton from '@/common/components/FrameButton.vue';
+import Width from '@/components/layout/space/Width.vue';
 
 
 const UserHead = 'https://mncdn.wenlvti.net/app_static/xiangyuan/images/user/avatar.png';
 const UserHead = 'https://mncdn.wenlvti.net/app_static/xiangyuan/images/user/avatar.png';