webview.js 787 Bytes
let app = getApp();
Page({
  data: {
    isOverShare: true,
    isShow: false, // 控制组件显示隐藏
    url: '',
  },
  onShareAppMessage(res) {
    if (res.from === 'button') {
      // 来自页面内转发按钮
    }
    let url = encodeURIComponent(this.data.url);
    let path = `/pages/webview/webview?url=${url}`;
    return {
      title: "家有儿孙",
      path: path,
      // imageUrl: ''
    }
  },
  onLoad(options = {}) {
    wx.showLoading();
    let url = decodeURIComponent(options.url);
    if (url) {
      this.setData({
        url: url,
        isShow: true
      })

    } else {
      wx.showToast({
        title: '未找到页面地址',
        title: 'none',
      });
      wx.hideLoading();
    }
  },
  loadSucc() {
    wx.hideLoading();
  }
})