ソースを参照

🎨 按要求调整首页

快乐的梦鱼 3 日 前
コミット
96b677a299

+ 1 - 1
src/pages/article/data/api/CommonCategoryApi.ts

@@ -51,7 +51,7 @@ export class CommonCategoryApi extends UpdateServerRequestModule<DataModel> {
    * @returns 
    */
   async editConfig(json: ICommonCategoryConfigHistoryItem['data'], name?: string, saveToHistoryId?: number) {
-    return (await this.post(`/app-configuration-edit/${CommonCategoryConfig.appConfigId}?saveToHistoryId=${saveToHistoryId}`, '编辑配置', {
+    return (await this.post(`/app-configuration-edit/${CommonCategoryConfig.appConfigId}?saveToHistoryId=${saveToHistoryId ?? ''}`, '编辑配置', {
       id: CommonCategoryConfig.appConfigId,
       name,
       data: json,

+ 5 - 0
src/pages/article/data/defines/Home.ts

@@ -32,6 +32,11 @@ export interface IHomeCommonCategoryHomeDefine {
        */
       title: string,
       /**
+       * 按钮标题
+       * @default true
+       */
+      showTitle?: boolean,
+      /**
        * 按钮图标
        */
       icon: string,

+ 3 - 0
src/pages/article/data/editor/editors/HomePropsEditor.vue

@@ -22,6 +22,9 @@
             <a-form-item label="标题">
               <a-input v-model:value="btn.title" />
             </a-form-item>
+            <a-form-item label="是否显示标题">
+              <a-checkbox v-model:checked="btn.showTitle" :indeterminate="btn.showTitle === undefined" />
+            </a-form-item>
             <a-form-item label="按钮样式">
               <a-select v-model:value="btn.style">
                 <a-select-option value="text">文本按钮</a-select-option>

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

@@ -1,6 +1,6 @@
 <template>
   <view class="home-container page-home d-flex flex-col bg-base">
-    <Image 
+    <NImage 
       innerClass="main-banner position-absolute"
       width="100%"
       :src="pageContentDefine?.props.homeBanner"
@@ -9,20 +9,17 @@
     <view class="content d-flex flex-col wing-l">
 
       <view class="shadow-base radius-l border-all-base main-banner-box mb-25">
-        <Image 
-          innerClass="logo"
+        <image 
+          class="logo"
           src="https://mncdn.wenlvti.net/app_static/minnan/images/home/MainLogo1.png"
-          :width="140"
-          :height="85"
         />
         <view>
           <text class="title">{{pageContentDefine?.props.title || ''}}</text>
           <text>{{pageContentDefine?.props.subTitle || ''}}</text>
         </view>
-        <Image 
-          innerClass="footer"
-          src="https://mncdn.wenlvti.net/app_static/minnan/images/home/MainBanner2.png"
-          :width="280"
+        <image 
+          class="footer"
+          src="https://mncdn.wenlvti.net/app_static/minnan/images/home/MainBanner3.png"
           mode="widthFix"
         />
       </view>
@@ -31,7 +28,7 @@
         <HomeButton
           v-for="item in pageContentDefine?.props.homeButtons || []"
           :key="item.title"
-          :title="item.title"
+          :title="item.showTitle !== false ? item.title : ''"
           :icon="item.icon"
           :size="item.size"
           :buttonStyle="item.style"
@@ -53,7 +50,7 @@ import { navTo } from '@/components/utils/PageAction';
 import { injectCommonCategory } from '../article/data/CommonCategoryGlobalLoader';
 import { CommonCategoryListTabNestCategoryDataToContent, type IHomeCommonCategoryHomeDefine } from '../article/data/CommonCategoryDefine';
 import Tabbar from '@/common/components/tabs/Tabbar.vue';
-import Image from '@/components/basic/Image.vue';
+import NImage from '@/components/basic/Image.vue';
 import HomeButton from '../parts/HomeButton.vue';
 import CommonCategoryBlocks from '../article/data/CommonCategoryBlocks.vue';
 import type { CategoryDefine } from '../article/data/CommonCategoryBlocks';
@@ -142,7 +139,7 @@ onShareAppMessage(() => {
     align-items: center;
     justify-content: space-around;
     overflow: hidden;
-    background: linear-gradient(180deg, #E5CDAB 0%, #F0E3D6 100%), #F7F3E8;
+    background: linear-gradient(180deg, #f9efe5 0%, #ebcab5 100%), #F7F3E8;
     padding: 50rpx 20rpx;
     font-family: "SongtiSCBlack";
     color: #432A04;
@@ -150,10 +147,13 @@ onShareAppMessage(() => {
     > view {
       display: flex;
       flex-direction: column;
-      margin-left: -30rpx;
+      margin-left: -20rpx;
+      margin-right: 60rpx;
     }
 
     .logo {
+      width: 140rpx;
+      height: 85rpx;
       margin-left: -10rpx;
       margin-right: 0rpx;
     }
@@ -163,6 +163,7 @@ onShareAppMessage(() => {
     }
     text {
       font-size: 35rpx;
+      letter-spacing: -0.06rem;
       margin-top: 10rpx;
     }
     .more {
@@ -183,12 +184,11 @@ onShareAppMessage(() => {
     }
     .footer {
       position: absolute;
-      right: -80rpx;
+      right: -10rpx;
       bottom: -10rpx;
-      width: 180rpx;
+      width: 220rpx;
       z-index: 2;
       height: auto;
-      opacity: 0.15;
     }
   }
 }

+ 14 - 3
src/pages/parts/HomeButton.vue

@@ -12,7 +12,7 @@
       } : {}),
       ...(buttonStyle === 'large-bg' ? {
         padding: '20rpx',
-        height: '200rpx',
+        aspectRatio: '172 / 100',
         backgroundSize: '100% 100%',
         backgroundRepeat: 'no-repeat',
         backgroundImage: `url(${icon})`,
@@ -21,7 +21,12 @@
     @click="onClick"
   >
     <Image v-if="buttonStyle === 'text'" :src="icon" width="40rpx" height="40rpx" />
-    <text class="size-l color-primary">{{ title }}</text>
+    <text :class="[
+      buttonStyle === 'large-bg' ? 'size-ll font-songti font-bold color-large-title' : 'size-l color-primary'
+    ]"
+    >
+      {{ title }}
+    </text>
     <Image 
       v-if="buttonStyle === 'text' && bg" :src="bg" 
       :width="160" 
@@ -73,4 +78,10 @@ defineOptions({
     virtualHost: true
   }
 })
-</script>
+</script>
+
+<style scoped lang="scss">
+.color-large-title {
+  color: #893400;
+}
+</style>