请问解决了吗,我也遇到这个问题了
wx-open-launch-weapp在javascript不显示是怎么回事?wx-open-launch-weapp在javascript不显示是怎么回事? 代码是按照官网文档写的,直接把官网文档代码粘贴进去也不显示 <wx-open-launch-weapp id="launch-btn" username="gh_xxxxxxxx" path="pages/home/index.html?user=123&action=abc" > <template> <style>.btn { padding: 12px }</style> <button class="btn">打开小程序</button> </template> </wx-open-launch-weapp>
2020-12-22请问解决了吗,我也遇到这个问题了
wx-open-launch-weapp跳转按钮没有显示微信公从号H5跳转小程序,wx.config已弹出“config:ok”,但是页面上wx-open-launch-weapp标签大小为0x0,“打开小程序”这个按钮没有显示出来,请问是什么原因? 代码: <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <meta name="viewport" content="minimum-scale=1, initial-scale=1, width=device-width" /> <title>weapp</title> <script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script> <style type="text/css"> div { width: 100%; height: 80px; border: 1px solid; background: greenyellow; } </style> </head> <body> <div> <wx-open-launch-weapp id="launch-btn" username="gh_XXXXXXXXXXXX"> <template> <style>.btn { padding: 12px }</style> <button class="btn">打开小程序</button> </template> </wx-open-launch-weapp> </div> <script> window.onload = onready; function onready () { var btn = document.getElementById('launch-btn'); btn.addEventListener('launch', function (e) { console.log('success'); }); btn.addEventListener('error', function (e) { console.log('fail', e.detail); }); var wxBrower = false; var ua = navigator.userAgent.toLowerCase(); if (ua.match(/MicroMessenger/i)=='micromessenger') { wxBrower = true; } alert(ua); if (wxBrower) { wx.config({ debug: true, appId: 'wxXXXXXXXXXXXXXXX', nonceStr: '123456', timestamp: 1604560136120, signature: '0dcbc0a225a4a487b2ea51f4c04e8d4d814183d2', jsApiList: ["onMenuShareTimeline", "onMenuShareAppMessage", "checkJsApi", "scanQRCode"], openTagList: ['wx-open-launch-weap'] }); wx.ready(function () { alert("wx ready"); }); wx.error( function () { alert("wx error: "+ err); }); } } </script> </body> </html>
2020-12-22都解决的了吗 我的也出不来
wx-open-launch-weapp 不展示按钮?<template> <wx-open-launch-weapp id="launch-btn" username="gh_bbc1673996b8" path="/pages/index/index.html" @ready="launchAppReady" > <script type="text/wxtag-template"> <style>.btn { padding: 12px }</style> <button class="btn">打开小程序</button> </script> </wx-open-launch-weapp> </template> <script> wx.config({ beta: true, // debug: true, // 开启调试模式 appId: appid, // 必填,公众号的唯一标识 timestamp: timestamp, // 必填,生成签名的时间戳 nonceStr: nonceStr, // 必填,生成签名的随机串 signature: nonceStr, // 必填,签名,见附录1 jsApiList: [ "updateAppMessageShareData", "updateTimelineShareData" ], openTagList: ["wx-open-launch-app"] // 可选,需要使用的开放标签列表,例如['wx-open-launch-app'] }); wx.ready(function() { console.log(11111111111); }); wx.error(function(res) { console.log(res); }); </script> [图片]
2020-12-21