使用的是vue框架,wx-open-launch-weapp为蓝色区域(由阻止了底部的点击事件判断出来的),可以点击跳转到小程序的区域只有红色的区域
代码如下
<div class="order-shop-skip-album-wxapp" v-if="openWxapp">
<wx-open-launch-weapp style="width: 100%; height: 100%;" id="launch-btn" username="gh_********" :path="wxappPath">
<script type="text/wxtag-template">
<div style="width: 100%; height: 100%;"> </div>
</script>
</wx-open-launch-weapp>
</div>
.order-shop-skip-album-wxapp {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
z-index: 100;
overflow: hidden;
}
你好,麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)
你好 你这个问题怎么解决的呢?
//我是用vue写的,可以参考一下,一些地方的写法与原生有细微差别
<div class="container">
<img class="img" src="@/assets/image/hostCustomer.png" />
<div class="text">跳转</div>
<wx-open-launch-weapp
style="position:absolute;top:0;right:0;bottom:0;left:0;z-index:10;overflow:hidden;"
id="launch-btn"
username="gh_xxxxxxx"
:path="pages/xxx"
>
<script type="text/wxtag-template">
<div style="width:10000px;height:10000px;"></div>
</script>
</wx-open-launch-weapp>
</div>
// 样式部分
.container{position:relative;}
.img和.text的样式正常写就可以
wx-open-launch-weapp标签使用绝对定位把container占满,并使用overflow:hidden;
里边的div设置宽高10000px,足够大就可以,多出的部分会被剪裁掉的