feat: 改变了欢迎ip 的动态配置
This commit is contained in:
@@ -5,18 +5,11 @@
|
||||
<!-- 隐藏 -->
|
||||
<view class="flex-full h-full flex flex-items-center flex-justify-center">
|
||||
<!-- ChatTopWelcome不在可视区:显示并添加动画;在可视区:隐藏 -->
|
||||
<view
|
||||
v-show="show"
|
||||
:class="['w-32 h-32', { 'image-animated': show }]"
|
||||
:style="getStyle"
|
||||
></view>
|
||||
<text
|
||||
v-show="show"
|
||||
:class="[
|
||||
<view v-show="show" :class="['w-32 h-32', { 'image-animated': show }]" :style="getStyle"></view>
|
||||
<text v-show="show" :class="[
|
||||
'font-size-14 font-500 color-171717 ml-10',
|
||||
{ 'text-animated': show },
|
||||
]"
|
||||
>
|
||||
]">
|
||||
{{ config.name }}
|
||||
</text>
|
||||
</view>
|
||||
@@ -32,22 +25,31 @@ import { getCurrentConfig } from "@/constant/base";
|
||||
const props = defineProps({
|
||||
mainPageDataModel: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
default: () => ({
|
||||
initPageImages: {},
|
||||
}),
|
||||
},
|
||||
});
|
||||
|
||||
const initPageImages = computed(() => {
|
||||
return props.mainPageDataModel?.initPageImages || {};
|
||||
});
|
||||
|
||||
const show = ref(false);
|
||||
const config = getCurrentConfig();
|
||||
const getStyle = computed(() => {
|
||||
return {
|
||||
"--ipSmallImageStep": config.ipSmallImageStep,
|
||||
"--ipSmallImageHeight": config.ipSmallImageHeight,
|
||||
"--ipSmallTime": config.ipSmallTime,
|
||||
backgroundImage: `url(${config.ipSmallImage})`,
|
||||
const images = initPageImages.value;
|
||||
const style = {
|
||||
"--ipSmallImageStep": images.ipSmallImageStep ?? config.ipSmallImageStep,
|
||||
"--ipSmallImageHeight": images.ipSmallImageHeight ?? config.ipSmallImageHeight,
|
||||
"--ipSmallTime": images.ipSmallTime ?? config.ipSmallTime,
|
||||
backgroundImage: `url(${images.ipSmallImage ?? config.ipSmallImage})`,
|
||||
backgroundRepeat: "no-repeat",
|
||||
backgroundSize: "32px auto",
|
||||
backgroundPosition: "0 0",
|
||||
};
|
||||
console.log("top nav bar image style:", style);
|
||||
return style;
|
||||
});
|
||||
|
||||
const showDrawer = () => uni.$emit("SHOW_DRAWER");
|
||||
|
||||
@@ -2,13 +2,9 @@ v
|
||||
<template>
|
||||
<view class="welcome-content border-box p-12">
|
||||
<view class="wrap rounded-20">
|
||||
<view
|
||||
class="flex flex-items-center flex-justify-between border-box pl-12 pr-12"
|
||||
>
|
||||
<view class="flex flex-items-center flex-justify-between border-box pl-12 pr-12">
|
||||
<view class="ip" :style="getStyle"></view>
|
||||
<view
|
||||
class="welcome-text font-size-14 font-500 font-family-misans-vf color-171717 line-height-24"
|
||||
>
|
||||
<view class="welcome-text font-size-14 font-500 font-family-misans-vf color-171717 line-height-24">
|
||||
{{ welcomeContent }}
|
||||
</view>
|
||||
</view>
|
||||
@@ -49,19 +45,27 @@ const props = defineProps({
|
||||
},
|
||||
});
|
||||
|
||||
const getStyle = computed(() => {
|
||||
const config = getCurrentConfig();
|
||||
const initPageImages = computed(() => {
|
||||
return props.mainPageDataModel?.initPageImages || {};
|
||||
});
|
||||
|
||||
return {
|
||||
"--ipLargeImageStep": config.ipLargeImageStep,
|
||||
"--ipLargeImageHeight": config.ipLargeImageHeight,
|
||||
"--ipLargeTime": config.ipLargeTime,
|
||||
backgroundImage: `url(${config.ipLargeImage})`,
|
||||
const config = getCurrentConfig();
|
||||
|
||||
const getStyle = computed(() => {
|
||||
const images = initPageImages.value;
|
||||
const style = {
|
||||
"--ipLargeImageStep": images.ipLargeImageStep ?? config.ipLargeImageStep,
|
||||
"--ipLargeImageHeight": images.ipLargeImageHeight ?? config.ipLargeImageHeight,
|
||||
"--ipLargeTime": images.ipLargeTime ?? config.ipLargeTime,
|
||||
backgroundImage: `url(${images.ipLargeImage || config.ipLargeImage})`,
|
||||
backgroundRepeat: "no-repeat",
|
||||
backgroundSize: "158px auto",
|
||||
backgroundPosition: "0 0",
|
||||
};
|
||||
console.log("welcome image style:", style);
|
||||
return style;
|
||||
});
|
||||
|
||||
const welcomeContent = computed(() => props.mainPageDataModel.welcomeContent);
|
||||
const guideWords = computed(() => props.mainPageDataModel.guideWords);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user