Bladeren bron

🎨 优化首页细节

快乐的梦鱼 1 maand geleden
bovenliggende
commit
71722e3fc0

+ 4 - 4
src/api/light/LightVillageApi.ts

@@ -335,10 +335,10 @@ export class LightVillageApi extends AppServerRequestModule<DataModel> {
       sex_text?: string;
       status_text?: string;
       avatar?: string;
-    }[]>('/village/volunteer/getRanklist', '志愿者排行榜', params, undefined, undefined, {
+    }[]>('/village/volunteer/getRanklist', '志愿者排行榜', params, undefined, undefined, /* {
       cacheEnable: true,
       cacheTime: 1000 * 60 * 10, //10min
-    });
+    } */);
     return res.requireData();
   }
 
@@ -365,10 +365,10 @@ export class LightVillageApi extends AppServerRequestModule<DataModel> {
       region_text?: string;
       is_light_text?: string;
       image?: string;
-    }[]>('/village/village/getRanklist', '村社排行榜', params, undefined, undefined, {
+    }[]>('/village/village/getRanklist', '村社排行榜', params, undefined, undefined, /* {
       cacheEnable: true,
       cacheTime: 1000 * 60 * 10, //10min
-    });
+    } */);
     return res.requireData();
   }
 

+ 4 - 0
src/api/system/ConfigurationApi.ts

@@ -38,6 +38,10 @@ export interface IConfigurationItem {
     animWaterAnimProps: VillageTreeAnimProps;
     animFertilize: string[];
     animFertilizeAnimProps: VillageTreeAnimProps;
+  },
+  sharePost: {
+    villageDefault: string,
+    default: string
   }
 }
 

+ 4 - 0
src/api/system/DefaultConfiguration.json

@@ -54,5 +54,9 @@
       "offsetX": -0.15,
       "offsetY": 0.45
     }
+  },
+  "sharePost": {
+    "villageDefault": "https://mn.wenlvti.net/app_static/xiangyuan/images/index-post.jpg",
+    "default": "https://mn.wenlvti.net/app_static/xiangyuan/images/index-post.jpg"
   }
 }

+ 3 - 3
src/common/components/parts/IndexCommonImageItem.vue

@@ -8,8 +8,8 @@
     :imageHeight="260"
     :imageRadius="15"
     :defaultImage="defaultImage"
-    :titleProps="{ fontSize: 24, color: 'gray', lines: 2 }"
-    :descProps="{ fontSize: 24, color: 'gray', lines: 2 }"
+    :titleProps="{ fontSize: 34, color: 'gray', lines: 2 }"
+    :descProps="{ fontSize: 28, color: 'gray', lines: 2 }"
     backgroundColor="transparent"
     @click="$emit('click')"
   >
@@ -17,7 +17,7 @@
       <FlexRow v-if="userName || likes" justify="space-between" align="center" :padding="[10,0]" :margin="[10,0,0,0]">
         <FlexRow align="center" :gap="10">
           <Avatar :url="userAvatar || image" defaultAvatar="https://xy.wenlvti.net/app_static/images/mine/DefaultAvatar.png" :size="40" />
-          <Text :text="userName" :fontSize="24" color="gray" />
+          <Text :text="userName" :fontSize="24" :lines="1" color="gray" />
         </FlexRow>
         <FlexRow align="center" :gap="10">
           <Icon icon="good" :color="isLike ? 'primary' : 'gray'" :size="30" />

+ 2 - 1
src/components/display/loading/LoadingPage.vue

@@ -1,6 +1,7 @@
 <script setup lang="ts">
 import ActivityIndicator from '@/components/basic/ActivityIndicator.vue';
-import Text, { type TextProps } from '@/components/basic/Text.vue';
+import type { TextProps } from '@/components/basic/Text';
+import Text from '@/components/basic/Text.vue';
 import FlexView, { type FlexProps } from '@/components/layout/FlexView.vue';
 import { propGetThemeVar, useTheme, type ViewStyle } from '@/components/theme/ThemeDefine';
 

+ 1 - 1
src/components/loader/SimplePageContentLoader.vue

@@ -3,7 +3,7 @@
     v-if="loader?.status.value == 'loading'"
     class="loader-view center"
   >
-    <LoadingPage v-if="showLoading" loadingText="加载中" textSize="18" />
+    <LoadingPage v-if="showLoading" loadingText="加载中" textSize="18" position="absolute" :inset="0" />
   </view>
   <view
     v-else-if="loader?.status.value == 'error'"

+ 1 - 1
src/pages/article/details.vue

@@ -1,7 +1,7 @@
 <template>
   <FlexCol :padding="[0,0,50,0]">
     <SimplePageContentLoader :loader="loader">
-      <template v-if="loader.content.value">
+      <template v-if="loader.content.value && loader.isLoaded.value">
         <FlexCol :gap="20">
           <swiper 
             v-if="loader.content.value.images.length > 0"

+ 15 - 0
src/pages/article/web/webPassToken.ts

@@ -0,0 +1,15 @@
+import { useAuthStore } from "@/store/auth";
+import { computed } from "vue";
+
+export function useWebPassToken(url: string, subUrl: string) {
+  const authStore = useAuthStore();
+  const finalUrl = computed(() => {
+    return `${url}?token=${authStore.token}#${subUrl}`;
+  });
+
+  function getFinalUrl(url: string, subUrl: string) {
+     return `${url}?token=${authStore.token}#${subUrl}`;
+  }
+
+  return { finalUrl, getFinalUrl };
+}

+ 0 - 1
src/pages/home/components/VillageRankList.vue

@@ -1,5 +1,4 @@
 <template>
-  <Empty v-if="list.length === 0" description="暂无排名数据" />
   <FlexRow :gap="20">
     <Touchable 
       v-for="(item) in list" 

+ 1 - 1
src/pages/home/discover/details.vue

@@ -17,7 +17,7 @@
       />
     </FlexCol>
     <SimplePageContentLoader :loader="loader">
-      <template v-if="loader.content.value">
+      <template v-if="loader.content.value && loader.isLoaded.value">
         <FlexCol gap="gap.md">
           <swiper 
             v-if="loader.content.value.images.length > 0"

+ 13 - 4
src/pages/home/village/games/index.vue

@@ -40,6 +40,7 @@ import FlexCol from '@/components/layout/FlexCol.vue';
 import FlexRow from '@/components/layout/FlexRow.vue';
 import Height from '@/components/layout/space/Height.vue';
 import { navTo } from '@/components/utils/PageAction';
+import { useWebPassToken } from '@/pages/article/web/webPassToken';
 
 const gamesLoader = useSimpleDataLoader(async () => {
   const games = [
@@ -47,7 +48,10 @@ const gamesLoader = useSimpleDataLoader(async () => {
       id: 1,
       name: '知识竞赛',
       image: 'https://xy.wenlvti.net/app_static/images/home/games/Games1.png',
-      link: 'https://xy.wenlvti.net/app_static/yunexamine/index.html#/pages/home/index',
+      link: [
+        'https://xycdn.wenlvti.net/assets/addons/yunexamine/h5/',
+        '/pages/home/index'
+      ],
       unlock: true,
     },
     {
@@ -84,13 +88,18 @@ const gamesLoader = useSimpleDataLoader(async () => {
   return games;
 });
 
-const openGame = (game: { link?: string }) => {
+const { getFinalUrl } = useWebPassToken('https://xycdn.wenlvti.net/assets/addons/yunexamine/h5/', '');
+
+const openGame = (game: { link?: string|string[] }) => {
   if (game.link) {
-    if (game.link.startsWith('nav:')) {
+    if (typeof game.link === 'string' && game.link.startsWith('nav:')) {
       navTo(game.link.substring(4));
     } else {
+      let url = game.link;
+      if (Array.isArray(game.link))
+        url = getFinalUrl(game.link[0], game.link[1]);
       navTo('/pages/article/web/ewebview', {
-        url: game.link
+        url
       });
     }
   }

+ 18 - 2
src/pages/home/village/goods/detail.vue

@@ -73,6 +73,8 @@ import { useAuthStore } from '@/store/auth';
 import { computed, onMounted } from 'vue';
 import { backAndCallOnPageBack, navTo } from '@/components/utils/PageAction';
 import { useUserTools } from '@/common/composeabe/UserTools';
+import { confirm } from '@/components/dialog/CommonRoot';
+import { assertNotNull } from '@imengyu/imengyu-utils';
 
 const { querys } = useLoadQuerys({
   id: 0,
@@ -98,8 +100,22 @@ const handleModify = () => {
     collectModuleId: goodLoader.content.value.collectModuleId || 0,
   });
 };
-const handleConsult = () => {
-  toast('暂未开放,敬请期待!');
+const handleConsult = async () => {
+  assertNotNull(goodLoader.content.value)
+  if (!goodLoader.content.value.contactNumber) {
+    alert('作者很懒~暂未留下联系方式');
+    return;
+  }
+  const goContract = await confirm({
+    title: '联系方式',
+    content: `联系人:${goodLoader.content.value.contact}\n电话:${goodLoader.content.value.contactNumber}`,
+    confirmText: '拨打电话',
+  })
+  if (goContract) {
+    uni.makePhoneCall({
+      phoneNumber: goodLoader.content.value.contactNumber as string,
+    })
+  }
 };
 
 onMounted(() => {

+ 1 - 1
src/pages/home/village/volunteer/detail.vue

@@ -1,7 +1,7 @@
 <template>
   <CommonTopBanner title="志愿者详情">
     <SimplePageContentLoader :loader="infoLoader" :showLoading="false">
-      <FlexCol v-if="infoLoader.content.value" gap="gap.md" padding="padding.md">
+      <FlexCol v-if="infoLoader.isLoaded.value && infoLoader.content.value" gap="gap.md" padding="padding.md">
         <BackgroundBox 
           backgroundImage="https://xy.wenlvti.net/app_static/images/village/BoxLarge.png"
           :backgroundCutBorder="32"

+ 3 - 3
src/pages/index.vue

@@ -104,15 +104,15 @@ function getShareVillageInfo() {
     const villageInfoInList = villageStore.myJoinedVillages.find(v => v.id === villageStore.currentVillage?.id);
     const myNickName = villageInfoInList?.villageNickname || authStore.userInfo?.nickname || authStore.userInfo?.username || '老友';
     return {
-      title: `同乡 ${myNickName} 邀您回 ${villageStore.currentVillage.name} 看看,心系故土,携手共建美好家乡`,
+      title: `同乡 ${myNickName} 邀您回 ${villageStore.currentVillage.name} 看看,心系故土,携手共建美好家乡`,
       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 || appConfiguration.value.sharePost.villageDefault,
     }
   }
   return {
     title: '村社文化资源挖掘平台',
     path: '/pages/index',
-    imageUrl: 'https://mn.wenlvti.net/app_static/xiangyuan/images/index-post.jpg',
+    imageUrl: appConfiguration.value.sharePost.default,
   };
 }
 async function paySuccessAndRefresh() {

+ 5 - 4
src/pages/user/index.vue

@@ -93,13 +93,12 @@ import { confirm } from '@/components/dialog/CommonRoot';
 import { useAuthStore } from '@/store/auth';
 import { useRequireLogin } from '@/common/composeabe/RequireLogin';
 import { useSimpleDataLoader } from '@/components/composeabe/loader/SimpleDataLoader';
-import { toast } from '@/components/utils/DialogAction';
+import { useWebPassToken } from '../article/web/webPassToken';
 import CellGroup from '@/components/basic/CellGroup.vue';
 import Cell from '@/components/basic/Cell.vue';
 import Image from '@/components/basic/Image.vue';
 import H4 from '@/components/typography/H4.vue';
 import Text from '@/components/basic/Text.vue';
-import Height from '@/components/layout/space/Height.vue';
 import Touchable from '@/components/feedback/Touchable.vue';
 import FlexCol from '@/components/layout/FlexCol.vue';
 import AppCofig from '@/common/config/AppCofig';
@@ -121,6 +120,8 @@ const authStore = useAuthStore();
 const userInfo = computed(() => authStore.isLogged ? authStore.userInfo : null);
 const volunteerInfoLoader = useSimpleDataLoader(async () => await VillageApi.getVolunteerInfo(), true);
 const { requireLogin } = useRequireLogin();
+const { finalUrl: storeOrderFinalUrl } = useWebPassToken('https://xycdn.wenlvti.net/assets/addons/yunexamine/h5/', '/pages/gift/order');
+const { finalUrl: storeFinalUrl } = useWebPassToken('https://xycdn.wenlvti.net/assets/addons/yunexamine/h5/', '/pages/gift/index');
 
 function goUserProfile() {
   userInfo.value ? navTo('/pages/user/update/profile') : navTo('/pages/user/login');
@@ -138,12 +139,12 @@ function doLogout() {
 }
 function goStoreList() {
   requireLogin(() => navTo('/pages/article/web/ewebview', {
-    url: 'https://xy.wenlvti.net/app_static/yunexamine/index.html#/pages/gift/order'
+    url: storeOrderFinalUrl.value
   }), '登录后查看我的哦');
 }
 function goStore() {
   requireLogin(() => navTo('/pages/article/web/ewebview', {
-    url: 'https://xy.wenlvti.net/app_static/yunexamine/index.html#/pages/gift/index'
+    url: storeFinalUrl.value
   }), '登录后查看我的哦');
 }