• wx小程序 button 属性open-typ 用法 按钮分享


    wx.ml

      <button class="btn" open-type="share" data-mode="teacher" data-type="1">hello world</button>

    wx.js 内wx 定义的分享方法

      /**
       * 用户点击右上角分享
       */
      onShareAppMessage: function (e) {
        console.log(e)
        let that = this;
        let type = that.data.shareToObjType;
        let mode = e.target.dataset.mode;
        let userInfo = that.data.userInfo;
        let teamId = that.data.teamId;
        let teamName = that.data.teamName;
        if (mode == "teacher") {
          return {
            title: userInfo.name + "邀请您加入机构",
            path: "/pages/common/invitejoinclass/index?type=2&schoolName=" + userInfo.schoolName + "&schoolId=" + userInfo.schoolId,
            imageUrl: "/image/share.png"
          }
        } else {
          if (type == 1) {
            //student
            return {
              title: userInfo.name + "邀请您加入班级",
              path: "/pages/common/invitejoinclass/index?type=1&teamId=" + teamId + "&teamName=" + teamName + "&schoolId=" + userInfo.schoolId + "&schoolName=" + userInfo.schoolName,
              imageUrl: "/image/share.png"
            }
          }
        }
      }
    View Code
  • 相关阅读:
    vue-amap地图组件的使用
    数据分析
    爬虫之scrapy框架
    爬虫之selenium
    记录一下最近的pwn
    内核提权姿势笔记
    CVE-2016-5343分析
    CVE-2015-8660分析
    Docker远程访问get(root)shell姿势
    Linux内核ROP学习
  • 原文地址:https://www.cnblogs.com/lvlisn/p/15109545.html
Copyright © 2020-2023  润新知