Merge branch 'dev/1.0' of https://git.aigc-quickapp.com/Uniapp/lucky_shop into dev/1.0
This commit is contained in:
@@ -156,7 +156,7 @@ const localDevConfig = ({
|
|||||||
// })['2485']; // 验证电子表单前后端数据一致性
|
// })['2485']; // 验证电子表单前后端数据一致性
|
||||||
// })['5g-11']; // 数码
|
// })['5g-11']; // 数码
|
||||||
// })['5g-213']; // 选择要使用的环境配置
|
// })['5g-213']; // 选择要使用的环境配置
|
||||||
})['5g-165']; // 鸡肉调理品, 优惠卷显示不全,及逻辑错误
|
})['2811']; // 鸡肉调理品, 优惠卷显示不全,及逻辑错误
|
||||||
// })['2811']; // 选择要使用的环境配置
|
// })['2811']; // 选择要使用的环境配置
|
||||||
// })['local-11']; // 选择要使用的环境配置
|
// })['local-11']; // 选择要使用的环境配置
|
||||||
// })['local-1']; // 本地
|
// })['local-1']; // 本地
|
||||||
|
|||||||
@@ -636,30 +636,35 @@ export default {
|
|||||||
const diyTabBar = store.state.tabBarList;
|
const diyTabBar = store.state.tabBarList;
|
||||||
if (diyTabBar && diyTabBar.list && Array.isArray(diyTabBar.list)) {
|
if (diyTabBar && diyTabBar.list && Array.isArray(diyTabBar.list)) {
|
||||||
const cleanUrl = url.split('?')[0];
|
const cleanUrl = url.split('?')[0];
|
||||||
const isDiyTabRoot = diyTabBar.list.some(item => {
|
// 检查目标页面是否在排除列表中(如 VR、webview 等特殊页面)
|
||||||
if (!item || !item.link || !item.link.wap_url) return false;
|
// 如果在排除列表中,不应该被当作 DIY tabBar 根页处理
|
||||||
const normalizedTab = adaptSubpackageUrl(item.link.wap_url.startsWith('/') ? item.link.wap_url : '/' + item.link.wap_url).split('?')[0];
|
const isExcludedPage = NO_TAB_PAGES.has(cleanUrl);
|
||||||
const normalizedUrl = adaptSubpackageUrl(cleanUrl.startsWith('/') ? cleanUrl : '/' + cleanUrl).split('?')[0];
|
if (!isExcludedPage) {
|
||||||
return normalizedTab === normalizedUrl;
|
const isDiyTabRoot = diyTabBar.list.some(item => {
|
||||||
});
|
if (!item || !item.link || !item.link.wap_url) return false;
|
||||||
if (isDiyTabRoot) {
|
const normalizedTab = adaptSubpackageUrl(item.link.wap_url.startsWith('/') ? item.link.wap_url : '/' + item.link.wap_url).split('?')[0];
|
||||||
const adaptedUrl = adaptSubpackageUrl(cleanUrl);
|
const normalizedUrl = adaptSubpackageUrl(cleanUrl.startsWith('/') ? cleanUrl : '/' + cleanUrl).split('?')[0];
|
||||||
const inSystemTabBar = systemTabBarList.some(sysUrl => adaptedUrl === sysUrl || cleanUrl === sysUrl);
|
return normalizedTab === normalizedUrl;
|
||||||
// 首页用switchTab,其他DIY tab根页用reLaunch确保页面栈干净
|
|
||||||
let navApi = inSystemTabBar ? (adaptedUrl === INDEX_PAGE_URL ? uni.switchTab : uni.reLaunch) : uni.reLaunch;
|
|
||||||
|
|
||||||
// 鸿蒙元服务环境下 uni.switchTab 有兼容性问题, 全部使用 reLaunch
|
|
||||||
// #ifdef MP-HARMONY
|
|
||||||
navApi = uni.reLaunch;
|
|
||||||
// #endif
|
|
||||||
|
|
||||||
navApi({
|
|
||||||
url,
|
|
||||||
fail: (err) => {
|
|
||||||
console.error('[navigate] tabBar 跳转失败:', cleanUrl, err);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
return;
|
if (isDiyTabRoot) {
|
||||||
|
const adaptedUrl = adaptSubpackageUrl(cleanUrl);
|
||||||
|
const inSystemTabBar = systemTabBarList.some(sysUrl => adaptedUrl === sysUrl || cleanUrl === sysUrl);
|
||||||
|
// 首页用switchTab,其他DIY tab根页用reLaunch确保页面栈干净
|
||||||
|
let navApi = inSystemTabBar ? (adaptedUrl === INDEX_PAGE_URL ? uni.switchTab : uni.reLaunch) : uni.reLaunch;
|
||||||
|
|
||||||
|
// 鸿蒙元服务环境下 uni.switchTab 有兼容性问题, 全部使用 reLaunch
|
||||||
|
// #ifdef MP-HARMONY
|
||||||
|
navApi = uni.reLaunch;
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
navApi({
|
||||||
|
url,
|
||||||
|
fail: (err) => {
|
||||||
|
console.error('[navigate] tabBar 跳转失败:', cleanUrl, err);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1097,7 +1097,7 @@
|
|||||||
{
|
{
|
||||||
"path": "vr/index",
|
"path": "vr/index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": ""
|
"navigationBarTitleText": "工厂展示"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<view :style="themeColor">
|
<view :style="themeColor" class="vr-page">
|
||||||
<web-view :src="src"></web-view>
|
<web-view :src="src" class="vr-webview"></web-view>
|
||||||
<!-- 顶部导航覆盖层:使用 cover-view 兼容微信小程序的 web-view 原生组件 -->
|
|
||||||
<cover-view class="vr-nav-back icondiy icon-system-arrow-go-back-line" @click="navigateBack"></cover-view>
|
|
||||||
<cover-view class="vr-nav-home icondiy icon-system-home-2-line" @click="goHome"></cover-view>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -15,68 +12,37 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
// this.src = decodeURIComponent(option.src);
|
// 确保导航栏标题显示
|
||||||
|
uni.setNavigationBarTitle({
|
||||||
|
title: '工厂展示'
|
||||||
|
});
|
||||||
|
|
||||||
this.$api.sendRequest({
|
this.$api.sendRequest({
|
||||||
url: '/api/config/defaultvr',
|
url: '/api/config/defaultvr',
|
||||||
success: res => {
|
success: res => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
uni.setNavigationBarTitle({
|
uni.setNavigationBarTitle({
|
||||||
title:res.data.title
|
title: res.data.title || '工厂展示'
|
||||||
})
|
});
|
||||||
this.src = res.data.url
|
this.src = res.data.url
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
fail: res => {
|
fail: res => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
navigateBack() {
|
|
||||||
const pages = getCurrentPages();
|
|
||||||
if (pages.length > 1) {
|
|
||||||
uni.navigateBack({
|
|
||||||
delta: 1
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
// 直接进入的场景(分享链接 / 外部链接 / 扫码等),页面栈只有当前页,
|
|
||||||
// navigateBack 会失败。重定向到首页,保证用户能离开 VR 页面。
|
|
||||||
uni.reLaunch({
|
|
||||||
url: this.$util.PAGE_KEY_MAP.PAGE_INDEX
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
goHome() {
|
|
||||||
uni.reLaunch({
|
|
||||||
url: this.$util.PAGE_KEY_MAP.PAGE_INDEX
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.vr-nav-back,
|
.vr-page {
|
||||||
.vr-nav-home {
|
height: 100vh;
|
||||||
position: absolute;
|
width: 100%;
|
||||||
top: 34rpx;
|
background: #fff;
|
||||||
z-index: 5;
|
|
||||||
width: 72rpx;
|
|
||||||
height: 72rpx;
|
|
||||||
background-color: rgba(0, 0, 0, 0.5);
|
|
||||||
color: #fff;
|
|
||||||
border-radius: 50%;
|
|
||||||
text-align: center;
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.vr-nav-back {
|
.vr-webview {
|
||||||
left: 34rpx;
|
width: 100%;
|
||||||
line-height: 60rpx;
|
height: 100%;
|
||||||
}
|
|
||||||
|
|
||||||
.vr-nav-home {
|
|
||||||
right: 34rpx;
|
|
||||||
font-size: 40rpx;
|
|
||||||
line-height: 72rpx;
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user