Commit 75d186ae authored by 王炽's avatar 王炽

6666

parent 6565a152
......@@ -6,7 +6,14 @@
<My v-if="globalStore.curTabIndex == 3 && !globalStore.isWxFriendCircle" />
<TabBar v-if="!globalStore.isWxFriendCircle" :curTabIndex="globalStore.curTabIndex" @tabClick="handleTabClick" />
<WxFriendCircleSimplePage v-if="globalStore.isWxFriendCircle" />
<button v-if="isBackApp" class="back-app" open-type="launchApp" app-parameter="wechat" @binderror="handleLaunchAppError"
:style="{
backgroundImage: `url(${$baseUrl}homepage/backAppBtn.png)`,
}"
>
<!-- <text class="back-text">返回app</text> -->
</button>
</view>
</template>
......@@ -26,6 +33,7 @@ const { proxy } = getCurrentInstance();
const $baseUrl = proxy.$baseUrl;
const homeRef = ref(null);
const scrollTop = ref(0);
const isBackApp = ref(false);
const shareOptions = {
0: {
title: "8000万中国妈妈信赖的育儿品牌",
......@@ -44,6 +52,23 @@ const shareOptions = {
},
};
// 处理返回APP失败的情况
const handleLaunchAppError = (e) => {
console.error('返回APP失败:', e.detail.errMsg);
// 根据错误类型给出不同的提示
let errorMessage = '返回APP失败';
if (e.detail.errMsg.includes('fail')) {
errorMessage = '无法返回APP,请检查APP是否已安装';
}
uni.showToast({
title: errorMessage,
icon: 'none',
duration: 2000
});
};
function handleTabClick({ index }) {
globalStore.setCurTabIndex(index);
}
......@@ -54,6 +79,12 @@ onLoad((options) => {
globalStore.setIsWxFriendCircle(true)
}
if(optionsSync.scene == '1069'){
isBackApp.value = true;
}else{
isBackApp.value = false;
}
console.warn('options231',options,globalStore.isWxFriendCircle)
if (options.pageType) {
switch (options.pageType) {
......@@ -103,6 +134,43 @@ onPageScroll((e) => {
flex-direction: column;
align-items: center;
justify-content: center;
}
// .back-app{
// position: fixed;
// top: 100rpx;
// border-radius: 34rpx;
// height: 68rpx;
// width: 250rpx;
// left:20rpx;
// // background-image: url('https://course.feihe.com/momclub-picture/back_app.png');
// // .back-text{
// // position: absolute;
// // font-size: 28rpx;
// // left: 30rpx;
// // }
// }
.back-app{
position: fixed;
top: 100rpx;
border-radius: 34rpx;
height: 68rpx;
width: 150rpx;
left:20rpx;
border: none;
background-size: 100% 100%;
background-repeat: no-repeat;
background-position: center;
z-index: 999;
&:active {
transform: scale(0.98);
}
&::after {
border: none !important;
}
}
.logo {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment