问题截图:
在 redmi 手机不显示跳转按钮:
在 iPhone 16、一加 Ace 3 等机型可正常显示:
redmi 手机配置如下:
微信版本:8.0.55
相关代码如下:
Vue.config.ignoredElements = ['wx-open-launch-weapp']
<template>
<div class="bind">
<img class="launch-bg" src="@/assets/images/launch.svg" alt="" />
<p class="launch-tips">即将跳转小程序</p>
<wx-open-launch-weapp
appid="***"
username="***"
path="pages/index/index.html"
:env-version="env"
@
>
<script type="text/wxtag-template">
<style>
.btn {
margin-top: 25px;
width: 140px;
height: 42px;
border-radius: 1px;
background: #3F5BD6;
color: #FFF;
font-family: "PingFang SC";
font-size: 16px;
font-style: normal;
font-weight: 400;
line-height: 42px;
text-align: center;
}
</style>
<div class="btn">跳转</div>
</script>
</wx-open-launch-weapp>
</div>
</template>
<script>
export default {
data() {
const env = "prod" === location.host ? "release" : "trial";
return {
env,
};
},
beforeCreate() {
this.$axios
.post(api, {
url: location.href,
})
.then(({ data }) => {
const { appId, nonceStr, signature, timestamp } = data;
wx.config({
debug: false,
appId,
timestamp,
nonceStr,
signature,
jsApiList: ["closeWindow"],
openTagList: ["wx-open-launch-weapp"],
});
});
},
methods: {
launch() {
wx.closeWindow();
},
},
};
</script>
你好,控制台一步步Debug,打印config入参和跳转的小程序appid,提供下控制台相应截图