wx-open-launch-app 开放标签自带一个内容空白的按钮,这个怎么可以设置相关样式?
发布于 6 年前 作者 pengwei 2160 次浏览 来自 问答

代码:

<script>
//当前页URL
var pageurl = encodeURIComponent(location.href.split('#')[0]);

			$.ajax({
				url: "/jssdk/index?url=" + pageurl,
				dataType: "json",
				success: function(data) {
					wx.config({
						debug: true,
						appId: data.appId,
						timestamp: data.timestamp,
						nonceStr: data.nonceStr,
						signature: data.signature,
						jsApiList: ['checkJsApi', 'onMenuShareTimeline', 'onMenuShareAppMessage',
							'onMenuShareQQ', 'onMenuShareWeibo', 'previewImage',
							'chooseImage', 'uploadImage', 'downloadImage',
							'hideOptionMenu', 'hideMenuItems', 'hideAllNonBaseMenuItem'
						],
						openTagList: ['wx-open-launch-app']
					});
				}
			});
	</script>
</head>
<body>
<wx-open-launch-app
  id="launch-btn"
  appid="wx740ad8508cb83826"
  extinfo="http://mdev.hzpgc.com/brand/detail/257"
>
  <template>
    <style>.btn { padding: 12px }</style>
    <button class="btn">App内查看<button>
  </template>
</wx-open-launch-app>
<script>
  var btn = document.getElementById('launch-btn');
  btn.addEventListener('launch', function (e) {
    console.log('success');
  });
  btn.addEventListener('error', function (e) {
    //console.log('fail', e.detail);
	alert(e.detail.errMsg);
  });
</script>
</body>
</html>

1 回复

你好,是指哪里?请提供可复现问题链接看下

回到顶部