feat:修复地址

This commit is contained in:
2026-07-16 22:08:56 +08:00
parent a879198143
commit 16fef18079
3 changed files with 112 additions and 26 deletions
+68 -13
View File
@@ -1,15 +1,15 @@
<template>
<view v-if="pageReady" class="home_warp" :class="platformType ? '' : 'iosplatformType'">
<view class="home_warp" :class="platformType ? '' : 'iosplatformType'">
<!-- 带背景的头部 -->
<view class="home_content_z_warp">
<view class="home_header_warp">
<view class="header_title_warp">
<view class="language_warp" style="width: 100%; justify-content: flex-start" @click="jumpSearch">
<view style="margin-top: 10rpx">
<view class="home_header_warp" :style="mpHeaderWarpStyle">
<view class="header_title_warp" :style="mpHeaderStyle">
<view class="language_warp" :style="mpLanguageStyle" style="width: 100%; justify-content: flex-start;" @click="jumpSearch">
<view :style="isMP ? 'display: flex; align-items: center;' : 'margin-top: 10rpx;'">
<up-image src="https://static.tbmall.xin/static/home/search_b.png" width="20" height="20"
bgColor="#f1f6ff00"></up-image>
</view>
<text class="search_msg_warp">搜索</text>
<text class="search_msg_warp" :style="isMP ? 'line-height: 1;' : ''">搜索</text>
</view>
<image src="https://static.tbmall.xin/static/chart.png" class="chart_img" @click.stop="jumpNewSearch('list')">
</image>
@@ -62,8 +62,10 @@
<!-- <up-loading-icon :show="productLoading"></up-loading-icon> -->
<view class="yp_item" v-for="item in faddishProduct" :key="item.id" @click.stop="jumpInfo(item)">
<view class="yp_item_image_wrapper">
<up-image :src="item.url" width="100%" height="88" bgColor="#f1f6ff00" shape="square"
radius="15"></up-image>
<image :src="item.url" mode="aspectFill" class="yp_item_image" shape="square"
radius="15"></image>
<!-- <up-image :src="item.url" width="100%" height="88" bgColor="#f1f6ff00" shape="square"
radius="15"></up-image> -->
</view>
<view class="yp_item_info">
<view class="yp_item_name">{{ item.title }}</view>
@@ -279,7 +281,11 @@ export default {
], // 首页活动列表
activedTabId: "seckill", // 当前选中的活动类型
attributes: {},
seckillActivedType: 'seckill'
seckillActivedType: 'seckill',
isMP: false,
mpHeaderWarpStyle: {},
mpHeaderStyle: {},
mpLanguageStyle: {},
};
},
onShow() {
@@ -315,13 +321,56 @@ export default {
uni.hideTabBar({
animation: false,
});
/*#endif*/
// 不需要启动页,才渲染首页
this.pageReady = true;
// #ifdef MP
this.isMP = true;
this.initMPHeader();
// #endif
},
mounted() { },
methods: {
initMPHeader() {
try {
const menuButton = uni.getMenuButtonBoundingClientRect();
const systemInfo = uni.getSystemInfoSync();
const statusBarHeight = systemInfo.statusBarHeight || 0;
const menuButtonHeight = menuButton.height;
const menuButtonTop = menuButton.top;
const menuButtonLeft = menuButton.left;
const windowWidth = systemInfo.windowWidth;
// Calculate padding-right to avoid the capsule button (add extra margin of 10px)
const paddingRight = windowWidth - menuButtonLeft + 10;
// Dynamic styles for MP
this.mpHeaderStyle = {
paddingTop: `${menuButtonTop}px`,
paddingRight: `${paddingRight}px`,
paddingBottom: '10px',
paddingLeft: '15px',
height: `${menuButtonHeight}px`,
boxSizing: 'content-box',
display: 'flex',
alignItems: 'center'
};
this.mpLanguageStyle = {
height: `${menuButtonHeight}px`,
boxSizing: 'border-box',
display: 'flex',
alignItems: 'center'
};
const warpPaddingTop = menuButtonTop + menuButtonHeight + 15;
this.mpHeaderWarpStyle = {
paddingTop: `${warpPaddingTop}px`
};
} catch (e) {
console.error("initMPHeader error:", e);
}
},
// 切换活动类型
jumpTab(item, type) {
if (this.activedTabId === type) return;
@@ -339,7 +388,7 @@ export default {
console.log("获取秒杀", res);
if (res.bizcode === 100) {
this.seckillGoodsList = [];
if(res.data.activityId){
if(res.data?.activityId){
this.onGetSeckillGoodsList(res.data.activityId, "seckillGoodsList");
}
}
@@ -882,6 +931,12 @@ export default {
width: 100%;
display: flex;
justify-content: center;
.yp_item_image{
width: 100%;
height: 176rpx;
border-radius: 15rpx;
}
}
.yp_item_info {