iphone web-view 分享无法获取当前地址
发布于 6 年前 作者 jun92 20145 次浏览 来自 问答

在iphone 打开的 web-view 页面多次点击后分享的页面是第一次进入的地址安卓正常

onShareAppMessage: function (options) {
    let that = this

    console.log(options)

//options 网站内打开链接,不是最新网站的地址

    let return_url = encodeURIComponent(options.webViewUrl)
    let share_title =  '分享'
    let image_url = ''
    var paths = 'pages/sharepage/sharepage?sharesssUrl=' + return_url
    return {
      title: share_title,
      path: paths,
      imageUrl: image_url,
      success: function (res) {
        // 转发成功
        wx.showToast({
          title: "转发成功",
          icon: 'success',
          duration: 2000
        })
      },
      fail: function (res) {
        // 转发失败
      }
    }
  },

3 回复

您好,web-view怎么实现的分享

你好,请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。

web-view 嵌入网站, 新打开网站上的链接,跳转后进行分享, 分享的地址是第一次加载 web-view的地址,不是最新的网站地址, 这个问题只在 iphone 上出现了

回到顶部