分享按钮点击穿透后转发后,接收者收到的消息卡片是空白的
发布于 5 年前 作者 xiejun 17053 次浏览 来自 问答

wxml代码

<text style="font-size:66px">占行测试</text>

<text style="font-size:66px">占行测试</text>

<text style="font-size:66px">占行测试</text>

<form bindsubmit="formsubmit" report-submit="{{true}}">

  <button formType="submit"  open-type="share" class='btncss'>
      <button formType="submit"  open-type="share" class='btncss'>
          <button formType="submit"  open-type="share" class='btncss'>
                <button formType="submit"  open-type="share" class='btncss'>
                      <button formType="submit"  open-type="share" class='btncss'>
                            <button formType="submit" open-type="share" class='btncss'>
                                <view class='share-btn'>转发</view>
                            </button>
                      </button>
                </button>
          </button>
      </button>
  </button>
</form>

css代码

form button{
  padding: 0;
}
 
form button::after{
  content: '';
  display: none;
}
 
.share-btn{
  position: fixed;
  bottom: 50rpx;
  left: 50%;
  transform: translateX(-50%);
  width: 698rpx;
  line-height: 90rpx;
  border-radius: 4rpx;
  background: #1a1a1a;
  font-size: 38rpx;
  font-weight: bolder;
  color: #fff;
}

js代码

formSubmit: function (e) {
    if (e.detail.formId != 'the formId is a mock one') {
      this.setData({
        formIdString: e.detail.formId + "," + this.data.formIdString
      })
    }
    console.log(e.detail, this.data.formIdString)
  }

上述代码从log可以看出实现了批量formid获取,但是真机测试时转发页面后,收到消息卡片的用户得到的小程序卡片是空白的

2 回复

为什么要套这么多层的分享按钮呢?

找到答案了,除了最内层的opentype = share 外面的 opentype = share 全部删除就好了

回到顶部