school.js 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. // pages/findword/findword.js
  2. var app = getApp();
  3. var utils = require("../../../utils/http");
  4. Page({
  5. /**
  6. * 页面的初始数据
  7. */
  8. data: {
  9. webUrl: '',
  10. },
  11. /**
  12. * 生命周期函数--监听页面加载
  13. */
  14. onLoad: function (options) {
  15. if (options.type == '121') {
  16. this.setData({
  17. webUrl: app.globalData.webUrl + 'applet.html#/traincourse?token=' + app.globalData.token + '&client_type=' + app.globalData.clientype + '&empid=' + app.globalData.personMsg.binded.id + '&type=1',
  18. })
  19. } else if (options.type == '212') {
  20. this.setData({
  21. webUrl: app.globalData.webUrl + 'applet.html#/traincourse?token=' + app.globalData.token + '&client_type=' + app.globalData.clientype + '&empid=' + app.globalData.personMsg.binded.id + '&type=2',
  22. })
  23. } else if (options.type == '313') {
  24. this.setData({
  25. webUrl: app.globalData.webUrl + 'applet.html#/staffAssess?token=' + app.globalData.token + '&client_type=' + app.globalData.clientype + '&empid=' + app.globalData.personMsg.binded.id,
  26. })
  27. } else if (options.type == '11') {
  28. this.setData({
  29. webUrl: app.globalData.webUrl + 'applet.html#/daystudy?token=' + app.globalData.token + '&client_type=' + app.globalData.clientype + '&empid=' + app.globalData.personMsg.binded.id,
  30. })
  31. }
  32. if (app.globalData.companyobj && app.globalData.companyobj.root_id != 23) {
  33. wx.hideShareMenu();
  34. }
  35. },
  36. /**
  37. * 生命周期函数--监听页面初次渲染完成
  38. */
  39. onReady: function () {
  40. },
  41. /**
  42. * 生命周期函数--监听页面显示
  43. */
  44. onShow: function () {
  45. },
  46. /**
  47. * 生命周期函数--监听页面隐藏
  48. */
  49. onHide: function () {
  50. },
  51. /**
  52. * 生命周期函数--监听页面卸载
  53. */
  54. onUnload: function () {
  55. },
  56. /**
  57. * 页面相关事件处理函数--监听用户下拉动作
  58. */
  59. onPullDownRefresh: function () {
  60. },
  61. /**
  62. * 页面上拉触底事件的处理函数
  63. */
  64. onReachBottom: function () {
  65. },
  66. /**
  67. * 分享记录
  68. */
  69. addsharetap: function () {
  70. let that = this;
  71. utils.$post({
  72. url: app.globalData.webUrl + 'api/share/addlog',
  73. header: {
  74. 'Authorization': 'bearer ' + app.globalData.token
  75. },
  76. data: {
  77. id: app.globalData.companyobj.root_id,
  78. type: 'TrainClassList',
  79. },
  80. success: function (r) {}
  81. })
  82. },
  83. /**
  84. * 用户点击右上角分享
  85. */
  86. onShareAppMessage(e) {
  87. this.addsharetap();
  88. return {
  89. title: app.globalData.companyobj.company_name + '~培训课程',
  90. imageUrl: '',
  91. path: '/share/pages/courselist/courselist?cty='+app.globalData.clientype+'&uid='+app.globalData.personMsg.id
  92. }
  93. }
  94. })