Преглед изворни кода

🎨 按要求修改顶部背景图

快乐的梦鱼 пре 1 недеља
родитељ
комит
31cf1a8b33

BIN
server/images/home/BannerHome.png


+ 8 - 2
src/common/components/CommonTopBanner.vue

@@ -1,7 +1,7 @@
 <template>
   <CommonRoot>
     <FlexCol :innerStyle="{
-      backgroundImage: 'url(https://xy.wenlvti.net/app_static/images/dig/TopBanner.png)',
+      backgroundImage: `url('https://xy.wenlvti.net/app_static/images/home/BannerHome.png')`,
       backgroundSize: '100% auto',
       backgroundRepeat: 'no-repeat',
       backgroundPosition: 'top center',
@@ -13,6 +13,13 @@
         v-if="showNav"
         :title="title" 
         leftButton="back" 
+        :leftButtonProps="{
+          buttonStyle: {
+            marginLeft: '20rpx',
+          },
+          shape: 'round-full',
+          backgroundColor: 'background.primary',
+        }"
         :customBack="customBack" 
         @backPressed="emit('backPressed')" 
       />
@@ -39,5 +46,4 @@ withDefaults(defineProps<{
 });
 
 const emit = defineEmits(['backPressed']);
-
 </script>

+ 7 - 7
src/components/nav/NavBar.vue

@@ -18,8 +18,8 @@
       <slot v-if="showLeftButton && leftButton" name="left">
         <IconButton 
           :icon="getButton(leftButton)"
-          v-bind="iconProps"
           shape="square-full"
+          v-bind="leftButtonProps"
           @click="handleButtonNavBack(leftButton, () => emit('leftButtonPressed'))"
         />
       </slot>
@@ -63,7 +63,7 @@
       <slot v-if="showRightButton && rightButton" name="right">
         <IconButton 
           :icon="getButton(rightButton)"
-          v-bind="iconProps"
+          v-bind="rightButtonProps"
           shape="square-full"
           @click="handleButtonNavBack(rightButton, () => emit('rightButtonPressed'))"
         />
@@ -79,7 +79,7 @@ import { propGetThemeVar, useTheme } from '../theme/ThemeDefine';
 import { DynamicSize } from '../theme/ThemeTools';
 import HorizontalScrollText from '../typography/HorizontalScrollText.vue';
 import Text from '../basic/Text.vue';
-import IconButton from '../basic/IconButton.vue';
+import IconButton, { type IconButtonProps } from '../basic/IconButton.vue';
 import { isTopLevelPage } from '../utils/PageAction';
 
 export type NavBarButtonTypes = 'back'|'menu'|'search'|'setting'|'custom';
@@ -101,6 +101,8 @@ export interface NavBarProps {
    * @default ''
    */
   leftButton?: NavBarButtonTypes|string,
+  /** 左侧按钮透传样式 */
+  leftButtonProps?: IconButtonProps;
   /**
    * 标题文字,支持自定义元素
    */
@@ -114,6 +116,8 @@ export interface NavBarProps {
    * 右侧按钮
    */
   rightButton?: NavBarButtonTypes|string,
+  /** 右侧按钮透传样式 */
+  rightButtonProps?: IconButtonProps;
   /**
    * 是否显示右侧按钮
    * @default true
@@ -162,10 +166,6 @@ export interface NavBarProps {
    */
   titleScroll?: boolean;
   /**
-   * 图标透传样式
-   */
-  iconProps?: IconProps;
-  /**
    * 自定义类名
    */
   innerClass?: any;

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

@@ -1,6 +1,6 @@
 <template>
   <CommonRoot>
-    <FlexCol v-if="showSwitch" position="absolute" :left="0" :top="0" :right="0" backgroundColor="rgba(255,255,255,0.5)">
+    <FlexCol v-if="showSwitch" position="absolute" :left="0" :top="0" :right="0">
       <StatusBarSpace />
       <FlexRow gap="gap.lg" :padding="30">
         <BubbleTip

+ 5 - 1
src/pages/index.vue

@@ -1,6 +1,8 @@
 <template>
 	<view class="index" :style="{
-    backgroundImage: tabIndex === 4 ? `url('https://xy.wenlvti.net/app_static/images/mine/TopBanner.png')` : `url('https://xy.wenlvti.net/app_static/images/dig/TopBanner.png')`,
+    backgroundImage: tabIndex === 4 ? 
+      `url('https://xy.wenlvti.net/app_static/images/mine/TopBanner.png')` 
+      : `url('https://xy.wenlvti.net/app_static/images/home/BannerHome.png')`,
     backgroundRepeat: 'no-repeat',
     backgroundSize: '100% auto',
     backgroundPosition: 'top center',
@@ -58,11 +60,13 @@ import VillageIndex from './home/village/index.vue';
 import CommonRoot from '@/components/dialog/CommonRoot.vue';
 import LightVillageApi from '@/api/light/LightVillageApi';
 import { waitTimeOut } from '@imengyu/imengyu-utils';
+import { injectAppConfiguration } from '@/api/system/useAppConfiguration';
 
 const tabIndex = ref(0);
 const themeContext = useTheme();
 const villageStore = useVillageStore();
 const authStore = useAuthStore();
+const appConfiguration = injectAppConfiguration();
 
 const villageIndex = ref<InstanceType<typeof VillageIndex>>();