Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
monorepo
/
venus
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
1
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit feca21ab
authored
Apr 10, 2026
by
岑成威
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix:样式
1 parent
2d8e13eb
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
121 additions
and
9 deletions
apps/uniappX/uniapp-x-tape/assets/images/home/scene-change.png
apps/uniappX/uniapp-x-tape/assets/images/home/setting.png
apps/uniappX/uniapp-x-tape/components/HomeFrame/TabbarLandscape.uvue
apps/uniappX/uniapp-x-tape/components/HomeFrame/tabbarShared.uts
apps/uniappX/uniapp-x-tape/pages/index/index.uvue
apps/uniappX/uniapp-x-tape/pages/person/MyCenterMain.uvue
apps/uniappX/uniapp-x-tape/static/images/home/scene-change.png
apps/uniappX/uniapp-x-tape/static/images/home/setting.png
apps/uniappX/uniapp-x-tape/utils/userSceneEvents.uts
apps/uniappX/uniapp-x-tape/assets/images/home/scene-change.png
0 → 100644
View file @
feca21a
1.14 KB
apps/uniappX/uniapp-x-tape/assets/images/home/setting.png
0 → 100644
View file @
feca21a
2.93 KB
apps/uniappX/uniapp-x-tape/components/HomeFrame/TabbarLandscape.uvue
View file @
feca21a
...
...
@@ -6,9 +6,14 @@
src="/static/images/home/left-bg.png" />
<view class="user-box user-box-clickable hf-landscape-user"
@click="emit('jumpPersonCenter')">
<view class="user-info">
<view class="user-avatar"></view>
<text class="user-name-text">{{ userName }}</text>
<view class="hf-landscape-profile">
<un-avatar :text="avatarText"
shape="circle"
size="52"
bgColor="#2f6af7"
color="#ffffff"
fontSize="20" />
<text class="hf-landscape-name">{{ userName }}</text>
</view>
</view>
<view class="landscape-tabbar-wrap">
...
...
@@ -31,8 +36,18 @@
</view>
</view>
<view class="home-tabbar-footer flex-col hf-landscape-footer">
<view class="btn-placeholder" @tap="emit('sceneChange')"></view>
<view class="btn-placeholder" @tap="emit('setting')"></view>
<view class="hf-landscape-footer-btn"
@tap="emit('sceneChange')">
<image class="hf-landscape-footer-icon"
mode="aspectFit"
src="/static/images/home/scene-change.png" />
</view>
<view class="hf-landscape-footer-btn hf-landscape-footer-btn--after"
@tap="emit('setting')">
<image class="hf-landscape-footer-icon"
mode="aspectFit"
src="/static/images/home/setting.png" />
</view>
</view>
<CenterPopup :list="sceneTypeList"
title="选择场景"
...
...
@@ -76,6 +91,19 @@ const emit = defineEmits<{
const tabs = HOME_FRAME_TABS;
/** 与 MyCenterMain 一致:姓名首字,空则「我」 */
const avatarText = computed((): string => {
const n = props.userName;
if (n == null || n === "") {
return "我";
}
const s = n as string;
if (s.length <= 0) {
return "我";
}
return s.substring(0, 1);
});
const iconImageStyle = computed((): any => {
const s = props.landscapeTabbarIconSize;
return {
...
...
@@ -107,6 +135,28 @@ function onTabItemClick(index: number): void {
flex-direction: column;
align-items: center;
box-sizing: border-box;
padding-top: 20px;
}
.hf-landscape-profile {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
}
/* 与 MyCenterMain .name 一致 */
.hf-landscape-name {
margin-top: 10px;
font-size: 19px;
font-weight: 600;
color: #1a2433;
line-height: 24px;
text-align: center;
max-width: 108px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.hf-landscape-footer {
...
...
@@ -117,6 +167,25 @@ function onTabItemClick(index: number): void {
box-sizing: border-box;
}
.hf-landscape-footer-btn {
width: 44px;
height: 44px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
.hf-landscape-footer-btn--after {
margin-top: 12px;
}
.hf-landscape-footer-icon {
width: 40px;
height: 40px;
flex-shrink: 0;
}
/* 与原先 .landscape-un-tabbar 占位一致,内部强制纵向排列 item */
.landscape-vertical-tabs {
display: flex;
...
...
@@ -132,10 +201,14 @@ function onTabItemClick(index: number): void {
flex-direction: row;
justify-content: center;
align-items: center;
padding: 1
0
px 0;
padding: 1
8
px 0;
box-sizing: border-box;
}
.landscape-vertical-tabs__item + .landscape-vertical-tabs__item {
margin-top: 10px;
}
.landscape-vertical-tabs__inner {
display: flex;
flex-direction: column;
...
...
@@ -148,7 +221,7 @@ function onTabItemClick(index: number): void {
}
.landscape-vertical-tabs__label {
margin-top:
4
px;
margin-top:
6
px;
font-size: 12px;
color: #8a98b5;
text-align: center;
...
...
apps/uniappX/uniapp-x-tape/components/HomeFrame/tabbarShared.uts
View file @
feca21a
...
...
@@ -2,6 +2,7 @@ import { computed, ref } from "vue";
import { cssClassRef } from "@/services/adapter";
import { storage } from "@/utils/storage.uts";
import { notifyUserSceneTypeChanged } from "@/utils/userSceneEvents.uts";
import { hideNativeTabBar } from "@/utils/tabBarShell.uts";
import { getLandscapeConfig } from "./styles/landscape.uts";
...
...
@@ -290,6 +291,7 @@ export function useHomeFrameTabbar(source: HomeFrameTabbarSource) {
info.sceneType = sceneType;
uni.showLoading({ title: "切换中", mask: true });
storage.set("userInfo", info, 0);
notifyUserSceneTypeChanged(sceneType);
uni.switchTab({
url: "/pages/index/index",
success: () => {
...
...
apps/uniappX/uniapp-x-tape/pages/index/index.uvue
View file @
feca21a
...
...
@@ -8,7 +8,8 @@
:active-tab-index="0">
<template #default="{ userInfo }">
<view class="tab-panel">
<HomeMainTab :logic="logic"
<HomeMainTab :key="homeMainTabSceneKey"
:logic="logic"
:user-info="userInfo" />
</view>
</template>
...
...
@@ -19,15 +20,18 @@
</template>
<script setup lang="uts">
import { ComponentPublicInstance, ref } from "vue";
import { ComponentPublicInstance,
onMounted, onUnmounted,
ref } from "vue";
import SceneShell from "@/components/HomeFrame/SceneShell.uvue";
import HomeMainTab from "@/components/HomeFrame/presets/HomeMainTab.uvue";
import { useBoutiqueLogic } from "@/pages/boutique/useBoutiqueLogic.uts";
import { storage } from "@/utils/storage.uts";
import { USER_SCENE_TYPE_CHANGED } from "@/utils/userSceneEvents.uts";
const shellRef = ref(null);
const logic = useBoutiqueLogic();
/** 场景切换后强制重建 HomeMainTab,避免 userInfo 引用未变导致子树不更新 */
const homeMainTabSceneKey = ref(0);
function readSceneType(): number {
const raw = storage.get("userInfo");
...
...
@@ -38,6 +42,30 @@ function readSceneType(): number {
return st != null ? st : 1;
}
async function syncHomeAfterSceneChange(_sceneType: number): Promise<void> {
if (shellRef.value != null) {
(shellRef.value as ComponentPublicInstance).$callMethod("updateApp");
}
homeMainTabSceneKey.value = homeMainTabSceneKey.value + 1;
const st = readSceneType();
if (st === 1) {
await logic.initIfNeeded();
logic.getBoutiquePackageList();
}
}
function onUserSceneTypeChanged(sceneType: number): void {
void syncHomeAfterSceneChange(sceneType);
}
onMounted((): void => {
uni.$on(USER_SCENE_TYPE_CHANGED, onUserSceneTypeChanged);
});
onUnmounted((): void => {
uni.$off(USER_SCENE_TYPE_CHANGED);
});
onShow(async () => {
if (logic.ensureLoginOrRelauch() === false) {
return;
...
...
apps/uniappX/uniapp-x-tape/pages/person/MyCenterMain.uvue
View file @
feca21a
...
...
@@ -86,6 +86,7 @@ import { computed, ref, onMounted } from "vue";
import CenterPopup from "@/components/CenterPopup.uvue";
import { resolveMainHomeUrl } from "@/utils/homeRoute.uts";
import { storage } from "@/utils/storage.uts";
import { notifyUserSceneTypeChanged } from "@/utils/userSceneEvents.uts";
import { hideNativeTabBar } from "@/utils/tabBarShell.uts";
import SettingBox from "./SettingBox.uvue";
...
...
@@ -238,6 +239,7 @@ function onChooseScene(index: number): void {
info.sceneType = sceneType;
uni.showLoading({ title: "切换中", mask: true });
storage.set("userInfo", info, 0);
notifyUserSceneTypeChanged(sceneType);
uni.switchTab({
url: resolveMainHomeUrl(),
success: () => {
...
...
apps/uniappX/uniapp-x-tape/static/images/home/scene-change.png
0 → 100644
View file @
feca21a
1.14 KB
apps/uniappX/uniapp-x-tape/static/images/home/setting.png
0 → 100644
View file @
feca21a
2.93 KB
apps/uniappX/uniapp-x-tape/utils/userSceneEvents.uts
0 → 100644
View file @
feca21a
/** 用户切换「业务场景」sceneType 后广播,供首页等同步 UI / 拉数 */
export const USER_SCENE_TYPE_CHANGED = "user-scene-type-changed";
export function notifyUserSceneTypeChanged(sceneType: number): void {
uni.$emit(USER_SCENE_TYPE_CHANGED, sceneType);
}
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment