收藏
回答

wx-open-launch-weapp 在 redmi 手机没有显示按钮?

问题截图:

在 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>
回答关注问题邀请回答
收藏

1 个回答

  • 社区技术运营专员--许涛
    社区技术运营专员--许涛
    1天前

    你好,控制台一步步Debug,打印config入参和跳转的小程序appid,提供下控制台相应截图

    1天前
    有用
    回复 4
    • 神经蛙
      神经蛙
      1天前
      问题是iPhone和其他安卓机型可以显示,就这个 redmi 手机显示不了按钮
      1天前
      回复
    • 神经蛙
      神经蛙
      1天前
      1天前
      回复
    • 社区技术运营专员--许涛
      社区技术运营专员--许涛
      1天前回复神经蛙
      提供下复现链接
      1天前
      回复
    • 神经蛙
      神经蛙
      1天前回复社区技术运营专员--许涛
      你好,现在又显示按钮了,中午换了个手机登录微信后,现在重新用redmi登录微信后,显示按钮了,跳转也正常
      1天前
      回复
登录 后发表内容