소스 검색

📦 移动静态资源至服务器,减少打包大小

快乐的梦鱼 2 주 전
부모
커밋
2c68e506a5
51개의 변경된 파일64개의 추가작업 그리고 398개의 파일을 삭제
  1. 5 2
      src/App.vue
  2. 1 1
      src/components/README.md
  3. 20 4
      src/components/basic/IconUtils.ts
  4. 1 1
      src/pages/dig/admin/components/VolunteerItem.vue
  5. 1 1
      src/pages/dig/admin/review.vue
  6. 10 10
      src/pages/home/discover/index.vue
  7. 3 3
      src/pages/home/index.vue
  8. 8 8
      src/pages/home/store/index.vue
  9. 6 6
      src/pages/index.vue
  10. 7 7
      src/pages/user/index.vue
  11. 1 1
      src/pages/user/login.vue
  12. 1 1
      src/pages/user/update/profile.vue
  13. 0 353
      src/static/css/font.css
  14. BIN
      src/static/images/BackgroundMask.jpg
  15. BIN
      src/static/images/MapArrow.png
  16. BIN
      src/static/images/home/icon-ancient-gate.png
  17. BIN
      src/static/images/home/icon-article.png
  18. BIN
      src/static/images/home/icon-compass.png
  19. BIN
      src/static/images/home/icon-pin-distance.png
  20. BIN
      src/static/images/home/icon-shining.png
  21. BIN
      src/static/images/icon_marker.png
  22. BIN
      src/static/images/icon_marker2.png
  23. BIN
      src/static/images/icons/icon-all.png
  24. BIN
      src/static/images/icons/icon-buliding.png
  25. BIN
      src/static/images/icons/icon-camera.png
  26. BIN
      src/static/images/icons/icon-envirounment.png
  27. BIN
      src/static/images/icons/icon-exampke.png
  28. BIN
      src/static/images/icons/icon-foods.png
  29. BIN
      src/static/images/icons/icon-history.png
  30. BIN
      src/static/images/icons/icon-location.png
  31. BIN
      src/static/images/icons/icon-mark.png
  32. BIN
      src/static/images/icons/icon-pac.png
  33. BIN
      src/static/images/icons/icon-resource.png
  34. BIN
      src/static/images/icons/icon-route.png
  35. BIN
      src/static/images/icons/icon-rules.png
  36. BIN
      src/static/images/tabs/dig.png
  37. BIN
      src/static/images/tabs/discover-active.png
  38. BIN
      src/static/images/tabs/discover.png
  39. BIN
      src/static/images/tabs/home-active.png
  40. BIN
      src/static/images/tabs/home.png
  41. BIN
      src/static/images/tabs/store-active.png
  42. BIN
      src/static/images/tabs/store.png
  43. BIN
      src/static/images/tabs/user-active.png
  44. BIN
      src/static/images/tabs/user.png
  45. BIN
      src/static/images/user/avatar.png
  46. BIN
      src/static/images/user/icon-chat.png
  47. BIN
      src/static/images/user/icon-edit.png
  48. BIN
      src/static/images/user/icon-function.png
  49. BIN
      src/static/images/user/icon-profile.png
  50. BIN
      src/static/images/user/icon-quit.png
  51. BIN
      src/static/images/user/icon-service.png

+ 5 - 2
src/App.vue

@@ -10,6 +10,7 @@ import { useAppInit } from './common/composeabe/AppInit';
 import MemoryTimeOut from './common/composeabe/MemoryTimeOut';
 import BugReporter, { type BugDetailDeviceInfo } from './common/BugReporter';
 import { BugReporterAbstractionUniapp } from './common/BugReporter/impl/BugReporterAbstractionUniapp';
+import { IconUtils } from './components/basic/IconUtils';
 
 const authStore = useAuthStore();
 const { init } = useAppInit();
@@ -66,14 +67,16 @@ configTheme(false, (theme, defaultDarkTheme) => {
   theme.colorConfigs.pressed.primary = '#00814b';
   theme.colorConfigs.background.primary = '#dcfff0';
 
-  theme.varOverrides['ImageDefaultImage'] = 'https://mn.wenlvti.net/app_static/minnan/EmptyImage.png';
+  theme.varOverrides['ImageDefaultImage'] = 'https://mncdn.wenlvti.net/app_static/xiangyuan/EmptyImage.png';
   return [theme, defaultDarkTheme];
 });
+
+IconUtils.loadDefaultIcons('https://mncdn.wenlvti.net/app_static/xiangyuan/data/DefaultIcon.json');
 </script>
 
 <style lang="scss">
 	/*每个页面公共css */
-  @import "@/static/css/font.css";
+  @import "https://mncdn.wenlvti.net/app_static/xiangyuan/font.css";
   @import "@/components/index.scss";
 
   page {

+ 1 - 1
src/components/README.md

@@ -6,7 +6,7 @@ NaEasy UI 是一款简单的 UniApp 移动端UI组件库。
 
 ## 版本
 
-当前版本:1.0.9-26031101
+当前版本:1.0.9-26031102
 
 ## 版权说明
 

+ 20 - 4
src/components/basic/IconUtils.ts

@@ -1,5 +1,3 @@
-import DefaultIcons from "../data/DefaultIcon.json";
-
 export type IconItem = {
   type: 'iconfont'|'image'|'svg'|'none',
   value: string,
@@ -74,6 +72,26 @@ export const IconUtils = {
   getIconDataFromMap(key: string) {
     return iconMap[key];
   },
+  /**
+   * 加载默认图标。可选从本地或者网络加载。
+   * @param urlOrJson 图标URL或者JSON字符串
+   */
+  loadDefaultIcons(urlOrJson: string) {
+    if (urlOrJson.startsWith('http') || urlOrJson.startsWith('https')) {
+      uni.request({
+        url: urlOrJson,
+        method: 'GET',
+        success: (res) => {
+          this.configIconMap(JSON.parse(res.data as string));
+        },
+        fail: (err) => {
+          console.error('加载默认图标失败', err);
+        },
+      });
+    } else {
+      this.configIconMap(JSON.parse(urlOrJson));
+    }
+  },
 }
 
 function toDataSvg(str: string) {
@@ -81,5 +99,3 @@ function toDataSvg(str: string) {
     str = str.replace("<svg ", "<svg xmlns='http://www.w3.org/2000/svg' ");
   return `data:image/svg+xml,${encodeURIComponent(str.replace(/\'/g, '"'))}`.replace(/\#/g, '%23');
 }
-
-IconUtils.configIconMap(DefaultIcons);

+ 1 - 1
src/pages/dig/admin/components/VolunteerItem.vue

@@ -32,7 +32,7 @@
 <script setup lang="ts">
 import type { VolunteerInfo } from '@/api/inhert/VillageApi';
 import type { PropType } from 'vue'
-import UserHead from '@/static/images/user/avatar.png';
+import UserHead from '@https://mncdn.wenlvti.net/app_static/xiangyuan/images/user/avatar.png';
 import FlexRow from '@/components/layout/FlexRow.vue';
 import Image from '@/components/basic/Image.vue';
 import FlexCol from '@/components/layout/FlexCol.vue';

+ 1 - 1
src/pages/dig/admin/review.vue

@@ -81,7 +81,7 @@ import SearchBar from '@/components/form/SearchBar.vue';
 import FlexCol from '@/components/layout/FlexCol.vue';
 import FlexRow from '@/components/layout/FlexRow.vue';
 import CommonRoot from '@/components/dialog/CommonRoot.vue';
-import UserHead from '@/static/images/user/avatar.png';
+import UserHead from '@https://mncdn.wenlvti.net/app_static/xiangyuan/images/user/avatar.png';
 import VolunteerItem from './components/VolunteerItem.vue';
 import Popup from '@/components/dialog/Popup.vue';
 import DynamicForm from '@/components/dynamic/DynamicForm.vue';

+ 10 - 10
src/pages/home/discover/index.vue

@@ -1,24 +1,24 @@
 <template>
   <FlexCol :gap="20" :padding="20">
-    <Box title="导览" icon="/static/images/home/icon-compass.png">
+    <Box title="导览" icon="https://mncdn.wenlvti.net/app_static/xiangyuan/images/home/icon-compass.png">
       <ProvideVar :vars="{
         GridItemIconSize: 90,
         GridItemBackgroundColor: 'transparent',
         GridItemPaddingHorizontal: 0,
       }">
         <Grid :borderGrid="false" :mainAxisCount="4">
-          <GridItem title="全部" icon="/static/images/icons/icon-all.png" touchable @click="goList('')" />
-          <GridItem title="历史文化" icon="/static/images/icons/icon-history.png" touchable @click="goList('历史文化')" />
-          <GridItem title="环境格局" icon="/static/images/icons/icon-envirounment.png" touchable @click="goList('环境格局')" />
-          <GridItem title="传统建筑" icon="/static/images/icons/icon-buliding.png" touchable @click="goList('传统建筑')" />
-          <GridItem title="民俗文化" icon="/static/images/icons/icon-location.png" touchable @click="goList('民俗文化')" />
-          <GridItem title="地道美食" icon="/static/images/icons/icon-foods.png" touchable @click="goList('美食物产')" />
-          <GridItem title="物产资源" icon="/static/images/icons/icon-resource.png" touchable @click="goList('历史人物')" />
-          <GridItem title="旅游线路" icon="/static/images/icons/icon-route.png" touchable @click="goList('旅游线路')" />
+          <GridItem title="全部" icon="https://mncdn.wenlvti.net/app_static/xiangyuan/images/icons/icon-all.png" touchable @click="goList('')" />
+          <GridItem title="历史文化" icon="https://mncdn.wenlvti.net/app_static/xiangyuan/images/icons/icon-history.png" touchable @click="goList('历史文化')" />
+          <GridItem title="环境格局" icon="https://mncdn.wenlvti.net/app_static/xiangyuan/images/icons/icon-envirounment.png" touchable @click="goList('环境格局')" />
+          <GridItem title="传统建筑" icon="https://mncdn.wenlvti.net/app_static/xiangyuan/images/icons/icon-buliding.png" touchable @click="goList('传统建筑')" />
+          <GridItem title="民俗文化" icon="https://mncdn.wenlvti.net/app_static/xiangyuan/images/icons/icon-location.png" touchable @click="goList('民俗文化')" />
+          <GridItem title="地道美食" icon="https://mncdn.wenlvti.net/app_static/xiangyuan/images/icons/icon-foods.png" touchable @click="goList('美食物产')" />
+          <GridItem title="物产资源" icon="https://mncdn.wenlvti.net/app_static/xiangyuan/images/icons/icon-resource.png" touchable @click="goList('历史人物')" />
+          <GridItem title="旅游线路" icon="https://mncdn.wenlvti.net/app_static/xiangyuan/images/icons/icon-route.png" touchable @click="goList('旅游线路')" />
         </Grid>
       </ProvideVar>
     </Box>
-    <Box title="最新推荐" icon="/static/images/home/icon-article.png">  
+    <Box title="最新推荐" icon="https://mncdn.wenlvti.net/app_static/xiangyuan/images/home/icon-article.png">  
       <SimplePageContentLoader :loader="discoverLoader">
         <FlexCol :gap="25">
           <ImageBlock2 

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

@@ -12,7 +12,7 @@
         ]"
       />
     </FlexCol>
-    <Box title="村社分布" icon="/static/images/home/icon-pin-distance.png">
+    <Box title="村社分布" icon="https://mncdn.wenlvti.net/app_static/xiangyuan/images/home/icon-pin-distance.png">
       <map 
         id="prevMap"
         map-id="prevMap"
@@ -24,7 +24,7 @@
         @markertap="goVillageDetails($event)"
       />
     </Box>
-    <Box title="线上史馆展示" icon="/static/images/home/icon-ancient-gate.png">
+    <Box title="线上史馆展示" icon="https://mncdn.wenlvti.net/app_static/xiangyuan/images/home/icon-ancient-gate.png">
       <SimplePageContentLoader :loader="recommendLoader">
         <FlexRow justify="space-between" align="center" wrap :gap="25">
           <Touchable 
@@ -48,7 +48,7 @@
         </FlexRow>
       </SimplePageContentLoader>
     </Box>
-    <Box title="发现" icon="/static/images/home/icon-compass.png" showMore @moreClicked="$emit('goDiscover')">  
+    <Box title="发现" icon="https://mncdn.wenlvti.net/app_static/xiangyuan/images/home/icon-compass.png" showMore @moreClicked="$emit('goDiscover')">  
       <SimplePageContentLoader :loader="discoverLoader">
         <FlexCol :gap="25">
           <Touchable 

+ 8 - 8
src/pages/home/store/index.vue

@@ -10,23 +10,23 @@
         ]"
       />
     </FlexCol>
-    <Box title="主题导览" icon="/static/images/home/icon-compass.png">
+    <Box title="主题导览" icon="https://mncdn.wenlvti.net/app_static/xiangyuan/images/home/icon-compass.png">
       <ProvideVar :vars="{
         GridItemIconSize: 70,
         GridItemBackgroundColor: 'transparent',
         GridItemPaddingHorizontal: 0,
       }">
         <Grid :borderGrid="false" :mainAxisCount="3">
-          <GridItem title="全部" icon="/static/images/icons/icon-all.png" touchable @click="goList(undefined, '知识库 · 全部')" />
-          <GridItem title="优秀案例" icon="/static/images/icons/icon-camera.png" touchable @click="goList(359, '知识库 · 优秀案例')" />
-          <GridItem title="经验分享" icon="/static/images/icons/icon-rules.png" touchable @click="goList(358, '知识库 · 经验分享')" />
-          <GridItem title="常见问题" icon="/static/images/icons/icon-mark.png" touchable @click="goList(357, '知识库 · 常见问题')" />
-          <GridItem title="挖掘技巧" icon="/static/images/icons/icon-pac.png" touchable @click="goList(356, '知识库 · 挖掘技巧')" />
-          <GridItem title="认知基础" icon="/static/images/icons/icon-route.png" touchable @click="goList(355, '知识库 · 认知基础')" />
+          <GridItem title="全部" icon="https://mncdn.wenlvti.net/app_static/xiangyuan/images/icons/icon-all.png" touchable @click="goList(undefined, '知识库 · 全部')" />
+          <GridItem title="优秀案例" icon="https://mncdn.wenlvti.net/app_static/xiangyuan/images/icons/icon-camera.png" touchable @click="goList(359, '知识库 · 优秀案例')" />
+          <GridItem title="经验分享" icon="https://mncdn.wenlvti.net/app_static/xiangyuan/images/icons/icon-rules.png" touchable @click="goList(358, '知识库 · 经验分享')" />
+          <GridItem title="常见问题" icon="https://mncdn.wenlvti.net/app_static/xiangyuan/images/icons/icon-mark.png" touchable @click="goList(357, '知识库 · 常见问题')" />
+          <GridItem title="挖掘技巧" icon="https://mncdn.wenlvti.net/app_static/xiangyuan/images/icons/icon-pac.png" touchable @click="goList(356, '知识库 · 挖掘技巧')" />
+          <GridItem title="认知基础" icon="https://mncdn.wenlvti.net/app_static/xiangyuan/images/icons/icon-route.png" touchable @click="goList(355, '知识库 · 认知基础')" />
         </Grid>
       </ProvideVar>
     </Box>
-    <Box title="最新" icon="/static/images/home/icon-shining.png" showMore @moreClicked="goList(undefined, '知识库 · 全部')">  
+    <Box title="最新" icon="https://mncdn.wenlvti.net/app_static/xiangyuan/images/home/icon-shining.png" showMore @moreClicked="goList(undefined, '知识库 · 全部')">  
       <SimplePageContentLoader :loader="discoverLoader">
         <FlexCol :gap="20">
           <Touchable 

+ 6 - 6
src/pages/index.vue

@@ -19,11 +19,11 @@
         fixed
         xbarSpace
       >
-        <TabBarItem icon="/static/images/tabs/home.png" activeIcon="/static/images/tabs/home-active.png" text="首页" />
-        <TabBarItem icon="/static/images/tabs/discover.png" activeIcon="/static/images/tabs/discover-active.png" text="发现" />
-        <TabBarItem icon="/static/images/tabs/dig.png" hump :humpHeight="[ 10, 10 ]" :humpSpace="[20,20]" :iconSize="140" />
-        <TabBarItem icon="/static/images/tabs/store.png" activeIcon="/static/images/tabs/store-active.png" text="知识库" />
-        <TabBarItem icon="/static/images/tabs/user.png" activeIcon="/static/images/tabs/user-active.png" text="我的" />
+        <TabBarItem icon="https://mncdn.wenlvti.net/app_static/xiangyuan/images/tabs/home.png" activeIcon="https://mncdn.wenlvti.net/app_static/xiangyuan/images/tabs/home-active.png" text="首页" />
+        <TabBarItem icon="https://mncdn.wenlvti.net/app_static/xiangyuan/images/tabs/discover.png" activeIcon="https://mncdn.wenlvti.net/app_static/xiangyuan/images/tabs/discover-active.png" text="发现" />
+        <TabBarItem icon="https://mncdn.wenlvti.net/app_static/xiangyuan/images/tabs/dig.png" hump :humpHeight="[ 10, 10 ]" :humpSpace="[20,20]" :iconSize="140" />
+        <TabBarItem icon="https://mncdn.wenlvti.net/app_static/xiangyuan/images/tabs/store.png" activeIcon="https://mncdn.wenlvti.net/app_static/xiangyuan/images/tabs/store-active.png" text="知识库" />
+        <TabBarItem icon="https://mncdn.wenlvti.net/app_static/xiangyuan/images/tabs/user.png" activeIcon="https://mncdn.wenlvti.net/app_static/xiangyuan/images/tabs/user-active.png" text="我的" />
       </TabBar>
     </CommonRoot>
 	</view>
@@ -81,7 +81,7 @@ onShareTimeline(() => {
   background-position: top left;
   background-size: 100% auto;
   background-repeat: no-repeat;
-  background-image: url('@/static/images/BackgroundMask.jpg');
+  background-image: url('@https://mncdn.wenlvti.net/app_static/xiangyuan/images/BackgroundMask.jpg');
   overflow-x: hidden;
 }
 </style>

+ 7 - 7
src/pages/user/index.vue

@@ -25,17 +25,17 @@
     </Touchable>
     <Height :height="50" />
     <CellGroup round>
-      <Cell v-if="userInfo" icon="/static/images/user/icon-edit.png" title="我的投稿" showArrow touchable @click="navTo('/pages/dig/forms/submits', { 
+      <Cell v-if="userInfo" icon="https://mncdn.wenlvti.net/app_static/xiangyuan/images/user/icon-edit.png" title="我的投稿" showArrow touchable @click="navTo('/pages/dig/forms/submits', { 
         villageVolunteerId: volunteerInfoLoader.content.value?.id || 0 
       })" />
-      <Cell v-if="userInfo" icon="/static/images/user/icon-profile.png" title="编辑资料" showArrow touchable @click="goUserProfile" />
+      <Cell v-if="userInfo" icon="https://mncdn.wenlvti.net/app_static/xiangyuan/images/user/icon-profile.png" title="编辑资料" showArrow touchable @click="goUserProfile" />
       <Cell v-if="userInfo && !isBindWx" icon="wechat" title="绑定微信" showArrow touchable @click="navTo('/pages/dig/sharereg/bind-wx')" />
-      <Cell icon="/static/images/user/icon-function.png" title="关于我们" showArrow touchable @click="navTo('/pages/home/about/about')" />
+      <Cell icon="https://mncdn.wenlvti.net/app_static/xiangyuan/images/user/icon-function.png" title="关于我们" showArrow touchable @click="navTo('/pages/home/about/about')" />
       <button open-type="contact" class="remove-button-style">
-        <Cell icon="/static/images/user/icon-service.png" title="联系客服" showArrow touchable />
+        <Cell icon="https://mncdn.wenlvti.net/app_static/xiangyuan/images/user/icon-service.png" title="联系客服" showArrow touchable />
       </button>
-      <Cell icon="/static/images/user/icon-chat.png" title="商务合作" showArrow touchable @click="navTo('/pages/home/about/contract')" />
-      <Cell v-if="userInfo" icon="/static/images/user/icon-quit.png" title="退出登录" showArrow touchable @click="doLogout" />
+      <Cell icon="https://mncdn.wenlvti.net/app_static/xiangyuan/images/user/icon-chat.png" title="商务合作" showArrow touchable @click="navTo('/pages/home/about/contract')" />
+      <Cell v-if="userInfo" icon="https://mncdn.wenlvti.net/app_static/xiangyuan/images/user/icon-quit.png" title="退出登录" showArrow touchable @click="doLogout" />
     </CellGroup>
     <DebugButton />
   </FlexCol>
@@ -47,7 +47,7 @@ import { navTo } from '@/components/utils/PageAction';
 import { confirm } from '@/components/dialog/CommonRoot';
 import { useAuthStore } from '@/store/auth';
 import { useSimpleDataLoader } from '@/common/composeabe/SimpleDataLoader';
-import UserHead from '@/static/images/user/avatar.png';
+import UserHead from '@https://mncdn.wenlvti.net/app_static/xiangyuan/images/user/avatar.png';
 import CellGroup from '@/components/basic/CellGroup.vue';
 import Cell from '@/components/basic/Cell.vue';
 import Image from '@/components/basic/Image.vue';

+ 1 - 1
src/pages/user/login.vue

@@ -95,7 +95,7 @@ import RadioGroup from '@/components/form/RadioGroup.vue';
 import Radio from '@/components/form/Radio.vue';
 import Button from '@/components/basic/Button.vue';
 import Height from '@/components/layout/space/Height.vue';
-import baseLogo from '/static/logo.png';
+import baseLogo from 'https://mncdn.wenlvti.net/app_static/xiangyuan/logo.png';
 import FlexRow from '@/components/layout/FlexRow.vue';
 import CommonRoot from '@/components/dialog/CommonRoot.vue';
 import StatusBarSpace from '@/components/layout/space/StatusBarSpace.vue';

+ 1 - 1
src/pages/user/update/profile.vue

@@ -40,7 +40,7 @@
 import { ref, onMounted } from 'vue';
 import { useAuthStore } from '@/store/auth';
 import UserApi from '@/api/auth/UserApi';
-import DefaultAvatar from '/static/images/home/UserHead.png';
+import DefaultAvatar from 'https://mncdn.wenlvti.net/app_static/xiangyuan/images/home/UserHead.png';
 import CommonContent from '@/api/CommonContent';
 import Form from '@/components/form/Form.vue';
 import Field from '@/components/form/Field.vue';

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 353
src/static/css/font.css


BIN
src/static/images/BackgroundMask.jpg


BIN
src/static/images/MapArrow.png


BIN
src/static/images/home/icon-ancient-gate.png


BIN
src/static/images/home/icon-article.png


BIN
src/static/images/home/icon-compass.png


BIN
src/static/images/home/icon-pin-distance.png


BIN
src/static/images/home/icon-shining.png


BIN
src/static/images/icon_marker.png


BIN
src/static/images/icon_marker2.png


BIN
src/static/images/icons/icon-all.png


BIN
src/static/images/icons/icon-buliding.png


BIN
src/static/images/icons/icon-camera.png


BIN
src/static/images/icons/icon-envirounment.png


BIN
src/static/images/icons/icon-exampke.png


BIN
src/static/images/icons/icon-foods.png


BIN
src/static/images/icons/icon-history.png


BIN
src/static/images/icons/icon-location.png


BIN
src/static/images/icons/icon-mark.png


BIN
src/static/images/icons/icon-pac.png


BIN
src/static/images/icons/icon-resource.png


BIN
src/static/images/icons/icon-route.png


BIN
src/static/images/icons/icon-rules.png


BIN
src/static/images/tabs/dig.png


BIN
src/static/images/tabs/discover-active.png


BIN
src/static/images/tabs/discover.png


BIN
src/static/images/tabs/home-active.png


BIN
src/static/images/tabs/home.png


BIN
src/static/images/tabs/store-active.png


BIN
src/static/images/tabs/store.png


BIN
src/static/images/tabs/user-active.png


BIN
src/static/images/tabs/user.png


BIN
src/static/images/user/avatar.png


BIN
src/static/images/user/icon-chat.png


BIN
src/static/images/user/icon-edit.png


BIN
src/static/images/user/icon-function.png


BIN
src/static/images/user/icon-profile.png


BIN
src/static/images/user/icon-quit.png


BIN
src/static/images/user/icon-service.png