Преглед на файлове

🎨 修改细节问题

快乐的梦鱼 преди 1 седмица
родител
ревизия
bb93f1d33e

+ 3 - 1
src/api/BaseAppServerRequestModule.ts

@@ -191,7 +191,7 @@ export class BaseAppServerRequestModule<T extends DataModel> extends RequestCore
             errCodeStr = res.errCodeStr;
           }
 
-          return new RequestApiError(
+          const res = new RequestApiError(
             errType,
             errString,
             errCodeStr,
@@ -201,6 +201,8 @@ export class BaseAppServerRequestModule<T extends DataModel> extends RequestCore
             response.headers,
             apiInfo
           );
+          console.log(res);
+          return res;
         }
       } catch (err) {
         if (err instanceof RequestApiError) {

+ 1 - 1
src/common/components/RequireLogin.vue

@@ -23,6 +23,6 @@ defineProps({
 })
 
 function goLogin() {
-  navTo('user/login');
+  navTo('/pages/user/login');
 }
 </script>

+ 0 - 60
src/common/components/tabs/tabbar.vue

@@ -1,60 +0,0 @@
-<template>
-  <TabBar
-    :selectedTabIndex="current"
-    @update:selectedTabIndex="changeTab"
-    fixed
-    xbarSpace
-    :innerStyle="{ 
-      zIndex: 999 ,
-      boxShadow: '0 -2rpx 4rpx rgba(0, 0, 0, 0.1)',
-      backdropFilter: 'blur(10px)',
-      backgroundColor: 'rgba(246, 242, 231, 0.7)',
-    }"
-  >
-    <TabBarItem icon="https://mncdn.wenlvti.net/app_static/minnan/images/tabs/icon_home_off.png" activeIcon="https://mncdn.wenlvti.net/app_static/minnan/images/tabs/icon_home_on.png" text="首页" />
-    <TabBarItem icon="https://mncdn.wenlvti.net/app_static/minnan/images/tabs/icon_discover_off.png" activeIcon="https://mncdn.wenlvti.net/app_static/minnan/images/tabs/icon_discover_on.png" text="资讯" />
-    <TabBarItem icon="https://mncdn.wenlvti.net/app_static/minnan/images/tabs/icon_inhert_off.png" activeIcon="https://mncdn.wenlvti.net/app_static/minnan/images/tabs/icon_inhert_on.png" hump :humpHeight="[0,0]" :humpSpace="[20,20]" :iconSize="140" text="传承" />
-    <TabBarItem icon="https://mncdn.wenlvti.net/app_static/minnan/images/tabs/icon_shop_off.png" activeIcon="https://mncdn.wenlvti.net/app_static/minnan/images/tabs/icon_shop_on.png" text="文旅" />
-    <TabBarItem icon="https://mncdn.wenlvti.net/app_static/minnan/images/tabs/icon_profile_off.png" activeIcon="https://mncdn.wenlvti.net/app_static/minnan/images/tabs/icon_profile_on.png" text="我的" />
-  </TabBar>
-</template>
-
-<script setup lang="ts">
-import TabBar from '@/components/nav/TabBar.vue';
-import TabBarItem from '@/components/nav/TabBarItem.vue';
-import { watch } from 'vue';
-
-const props = defineProps({
-  current: {
-    type: Number,
-    default: 0
-  }
-});
-function changeTab(newVal: number) {
-  switch(newVal) {
-    case 0:
-      switchTab('/pages/home/index', 0);
-      break;
-    case 1:
-      switchTab('/pages/article/index', 1);
-      break;
-    case 2:
-      switchTab('/pages/inhert/index', 2);
-      break;
-    case 3:
-      switchTab('/pages/travel/index', 3);
-      break;
-    case 4:
-      switchTab('/pages/user/index', 4);
-      break;
-  }
-}
-
-function switchTab(path: string, index: number) {
-  if (props.current === index) 
-    return;
-  uni.switchTab({
-    url: path
-  });
-}
-</script>

+ 12 - 0
src/common/composeabe/ErrorDisplay.ts

@@ -1,3 +1,5 @@
+import { RequestApiError } from "@imengyu/imengyu-utils";
+
 export function showError(e: any, title = '糟糕,出错了', callback?: () => void) {
   console.log('showError', e);
   let message = '';
@@ -15,3 +17,13 @@ export function showError(e: any, title = '糟糕,出错了', callback?: () =>
   })
   uni.hideLoading();
 }
+export function formatError(e: any) {
+  if (e?.errMsg) 
+    return e.errMsg;
+  if (e instanceof RequestApiError) 
+    return e.errorMessage + (e.errorCodeMessage ? ` (${e.errorCodeMessage})` : '');
+  if (e instanceof Error) 
+    return e.message;
+  else 
+    return '' + (e ?? '未知错误');
+}

+ 2 - 1
src/common/composeabe/SimpleDataLoader.ts

@@ -1,5 +1,6 @@
 import { onMounted, ref, type Ref } from "vue";
 import type { ILoaderCommon, LoaderLoadType } from "./LoaderCommon";
+import { formatError } from "./ErrorDisplay";
 
 export interface ISimpleDataLoader<T, P> extends ILoaderCommon<P> {
   content: Ref<T|null>;
@@ -36,7 +37,7 @@ export function useSimpleDataLoader<T, P = any>(
         loadStatus.value = 'finished';
       loadError.value = '';
     } catch(e) {
-      loadError.value = '' + e;
+      loadError.value = formatError(e);
       loadStatus.value = 'error';
       console.log(e);
       

+ 2 - 1
src/common/composeabe/SimplePageContentLoader.ts

@@ -1,5 +1,6 @@
 import { ref, type Ref } from "vue";
 import type { ILoaderCommon, LoaderLoadType } from "./LoaderCommon";
+import { formatError } from "./ErrorDisplay";
 
 export interface ISimplePageContentLoader<T, P> extends ILoaderCommon<P> {
   content: Ref<T|null>;
@@ -26,7 +27,7 @@ export function useSimplePageContentLoader<T, P = any>(
       loadStatus.value = 'finished';
       loadError.value = '';
     } catch(e) {
-      loadError.value = '' + e;
+      loadError.value = formatError(e);
       loadStatus.value = 'error';
     }
   }

+ 3 - 1
src/common/composeabe/SimplePageListLoader.ts

@@ -1,6 +1,7 @@
 import { onPullDownRefresh, onReachBottom } from "@dcloudio/uni-app";
 import { ref, type Ref } from "vue";
 import type { ILoaderCommon, LoaderLoadType } from "./LoaderCommon";
+import { formatError } from "./ErrorDisplay";
 
 export interface ISimplePageListLoader<T, P> extends ILoaderCommon<P> {
   list: Ref<T[]>;
@@ -47,7 +48,8 @@ export function useSimplePageListLoader<T, P = any>(
       loadError.value = '';
       loading = false;
     } catch(e) {
-      loadError.value = '' + e;
+      console.log(e);
+      loadError.value = formatError(e);
       loadStatus.value = 'error';
       loading = false;
     } finally {

+ 1 - 1
src/pages.json

@@ -110,7 +110,7 @@
     {
       "path": "pages/travel/fashion/list",
       "style": {
-        "navigationBarTitleText": "闽南时尚",
+        "navigationBarTitleText": "闽南歌曲",
         "enablePullDownRefresh": true
       }
     },

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

@@ -1,7 +1,7 @@
 <template>
   <view class="home-container page-home d-flex flex-col bg-base">
     <Image 
-      innerClass="position-absolute"
+      innerClass="main-banner position-absolute"
       width="100%"
       src="https://mncdn.wenlvti.net/app_static/minnan/images/home/BackgroundBanner5.jpg"
       mode="widthFix"
@@ -12,7 +12,7 @@
       <view class="shadow-base radius-l bg-base p-3">
         <view 
           class="main-banner-box mb-25"
-          @click="navTo('home/introduction')"
+          @click="navTo('introduction')"
         >
           <text class="title">闽南文化生态保护区(厦门市)</text>
           <text>世界闽南文化交流中心</text>
@@ -128,7 +128,7 @@
           :enable-zoom="false"
           :enable-scroll="false"
           :scale="15"
-          @click="navTo('inhert/map/index', { tab: mapTab })"
+          @click="navTo('/pages/inhert/map/index', { tab: mapTab })"
         />
         <scroll-view class="map-tags position-absolute" :scroll-x="true">
           <view class="tag-bar d-flex flex-row flex-nowrap">
@@ -433,8 +433,12 @@ onShareAppMessage(() => {
 
 <style lang="scss">
 .page-home {
+
+  .main-banner {
+    top: -150rpx;
+  }
   .content {
-    margin-top: 470rpx;
+    margin-top: 260rpx;
   }
 
   .map-tags {

+ 1 - 1
src/pages/introduction/explore.vue

@@ -108,7 +108,7 @@ import Footer from '@/components/display/Footer.vue';
 
 const categoryDefine = [
   {
-    title: '文化常识和闽南历史地理背景',
+    title: '文化概况',
     content: HistoryContent,
   },
   {

+ 6 - 5
src/pages/introduction/travel.vue

@@ -2,8 +2,8 @@
   <FlexCol :padding="30" backgroundColor="background.page">
     
     <!-- 闽南节庆日历 -->
-    <!-- <HomeTitle title="闽南节庆日历" showMore @clickMore="navTo('/pages/travel/calendar/index')" />
-    <CalendarBlock /> -->
+    <HomeTitle title="闽南节庆日历" showMore @clickMore="navTo('/pages/travel/calendar/index')" />
+    <CalendarBlock />
 
     <!-- 闽南文化景区、景点 -->
     <HomeTitle title="闽南文化景区、景点" showMore @clickMore="navTo('/pages/travel/scenic-spot/list')" />
@@ -25,8 +25,8 @@
       </scroll-view>
     </SimplePageContentLoader>
 
-    <!-- 闽南时尚 -->
-    <HomeTitle title="闽南时尚" showMore @clickMore="navTo('/pages/travel/fashion/list')" />
+    <!-- 闽南歌曲 -->
+    <HomeTitle title="闽南歌曲" showMore @clickMore="navTo('/pages/travel/fashion/list')" />
     <SimplePageContentLoader :loader="songsData">
       <FlexRow wrap align="stretch" justify="space-between" overflow="visible">
         <Box2LineLargeImageUserShadow
@@ -119,6 +119,7 @@ import Box2LineImageRightShadow from '../parts/Box2LineImageRightShadow.vue';
 import ScenicSpotContent from '@/api/fusion/ScenicSpotContent';
 import FlexRow from '@/components/layout/FlexRow.vue';
 import Footer from '@/components/display/Footer.vue';
+import CalendarBlock from '../travel/calendar/block.vue';
 
 const spotData = useSimpleDataLoader(async () => 
   (await ScenicSpotContent.getContentList(new GetContentListParams(), 1, 4)).list.map(p => ({
@@ -139,7 +140,7 @@ const {
   loader: songsData,
   goDetail: goSongsDetail,
 } = useHomePageMiniCommonListGoMoreAndGoDetail({
-  title: '闽南时尚',
+  title: '闽南歌曲',
   mainBodyColumnId: [315],
   modelId: 16,
   itemType: 'article-common',

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

@@ -65,7 +65,7 @@
           </template>
         </Cell>
         <Cell icon="https://mncdn.wenlvti.net/uploads/20250313/66d4665b1da5075e60148312469b2630.png" title="我的投稿" showArrow touchable @click="goContributeList" />
-        <Cell icon="https://mncdn.wenlvti.net/uploads/20250313/042236758da5aaed21c1010e5b9440ce.png" title="我的收藏" showArrow touchable @click="navTo('collect/index')" />
+        <Cell icon="https://mncdn.wenlvti.net/uploads/20250313/042236758da5aaed21c1010e5b9440ce.png" title="我的收藏" showArrow touchable @click="goCollectList" />
         <button open-type="contact" class="remove-button-style">
           <Cell icon="https://mncdn.wenlvti.net/uploads/20250313/d2e9010323d098aa51e268fc32f14d3d.png" title="在线客服" showArrow touchable />
         </button>
@@ -127,6 +127,9 @@ function doLogout() {
 function goContributeList() {
   requireLogin(() => navTo('contribute/list'), '登录后才能投稿哦!');
 }
+function goCollectList() {
+  requireLogin(() => navTo('collect/index'), '登录后才能查看收藏哦!');
+}
 function goContribute() {
   requireLogin(() => navTo('contribute/submit'), '登录后才能投稿哦!');
 }
@@ -136,14 +139,6 @@ function goUserProfile() {
   else
     navTo('login');
 }
-function showService() {
-  uni.showModal({
-    title: '联系客服',
-    content: '联系电话:18888888888',
-  });
-}
-
-
 </script>
 
 <style lang="scss" scoped>