// pages/findword/findword.js var app = getApp(); var utils = require("../../../utils/http"); Page({ /** * 页面的初始数据 */ data: { webUrl: '', }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { if (options.type == '121') { this.setData({ webUrl: app.globalData.webUrl + 'applet.html#/traincourse?token=' + app.globalData.token + '&client_type=' + app.globalData.clientype + '&empid=' + app.globalData.personMsg.binded.id + '&type=1', }) } else if (options.type == '212') { this.setData({ webUrl: app.globalData.webUrl + 'applet.html#/traincourse?token=' + app.globalData.token + '&client_type=' + app.globalData.clientype + '&empid=' + app.globalData.personMsg.binded.id + '&type=2', }) } else if (options.type == '313') { this.setData({ webUrl: app.globalData.webUrl + 'applet.html#/staffAssess?token=' + app.globalData.token + '&client_type=' + app.globalData.clientype + '&empid=' + app.globalData.personMsg.binded.id, }) } else if (options.type == '11') { this.setData({ webUrl: app.globalData.webUrl + 'applet.html#/daystudy?token=' + app.globalData.token + '&client_type=' + app.globalData.clientype + '&empid=' + app.globalData.personMsg.binded.id, }) } if (app.globalData.companyobj && app.globalData.companyobj.root_id != 23) { wx.hideShareMenu(); } }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function () { }, /** * 生命周期函数--监听页面显示 */ onShow: function () { }, /** * 生命周期函数--监听页面隐藏 */ onHide: function () { }, /** * 生命周期函数--监听页面卸载 */ onUnload: function () { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh: function () { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function () { }, /** * 分享记录 */ addsharetap: function () { let that = this; utils.$post({ url: app.globalData.webUrl + 'api/share/addlog', header: { 'Authorization': 'bearer ' + app.globalData.token }, data: { id: app.globalData.companyobj.root_id, type: 'TrainClassList', }, success: function (r) {} }) }, /** * 用户点击右上角分享 */ onShareAppMessage(e) { this.addsharetap(); return { title: app.globalData.companyobj.company_name + '~培训课程', imageUrl: '', path: '/share/pages/courselist/courselist?cty='+app.globalData.clientype+'&uid='+app.globalData.personMsg.id } } })