vite开发H5通过wx-open-launch-weapp组件点击跳转小程序,Android手机可以正常打开小程序,但是IOS不能正常显示标签。
代码:<template>
<div class="container">
<div class="nextBtn">
<wx-open-launch-weapp username="gh_xxxx" :path="pathStr">
<component :is="'script'" type="text/wxtag-template">
<div
style="
width: 100%;
height: 80px;
color: #ffffff;
font-size: 18px;
margin-top: 12px;
"
>
下一步
</div>
</component>
</wx-open-launch-weapp>
</div>
</div>
</template>
<script>
import { getWxSign } from "@/api/common";
import wx from "weixin-js-sdk";
export default {
setup() {
let nonceStr = Math.ceil(Date.now() / 1000) + "";
let timestampValue = nonceStr;
let urlValue = location.href.split("#")[0];
getWxSign({
nonce: nonceStr,
timestamp: timestampValue,
url: window.encodeURI(urlValue),
}).then((res) => {
if (res.code == 0) {
wx.config({
debug: false, // 开启调试模式
appId: "wx1xxxxxxxxx", // 必填,公众号的唯一标识
timestamp: timestampValue, // 必填,生成签名的时间戳
nonceStr: nonceStr, // 必填,生成签名的随机串
signature: res.data, // 必填,签名
jsApiList: ["chooseImage"], // 必填,需要使用的JS接口列表,填写一个当前公众号有权限的接口
openTagList: ["wx-open-launch-weapp"], // 可选,需要使用的开放标签列表
});
if (type.value == 1) {
pathStr.value =
"pages/setWifi/setWifi?serverType=1&method=" +
type.value +
"&user_name=" +
username +
"&group=" +
group;
} else {
pathStr.value =
"pages/setWifi/setWifi?serverType=0&method=" +
type.value +
"&user_name=" +
username +
"&group=" +
group;
}
} else {
showConfirmDialog({
title: "获取签名失败",
message: res.reason,
});
}
});
document.title = title.value;
const nextLink = () => {
showConfirmDialog({
title: "",
message: "即将跳转“设备连接”小程序",
})
.then(() => {
// on confirm
})
.catch(() => {
// on cancel
});
};
return {
nextLink,
type,
username,
group,
pathStr,
};
},
};
</script>
请教如何解决,谢谢
提供一下复现链接
解决了吗