corporateInfo.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. // pages/corporateInfo/corporateInfo.js
  2. var BASEURL = require('../../utils/wxconstant.js')
  3. var baseUrl = BASEURL.BaseUrl()
  4. var netUtil = require('../../utils/network.js')
  5. Page({
  6. /**
  7. * 页面的初始数据
  8. */
  9. data: {
  10. comInfoDatas:{},
  11. },
  12. /**
  13. * 生命周期函数--监听页面加载
  14. */
  15. onLoad: function (options) {
  16. this.getInfo()
  17. },
  18. getInfo:function(){
  19. var that = this
  20. var data = { empId: wx.getStorageSync('empId')}
  21. var url = baseUrl + BASEURL.getUrl.getByEmp
  22. netUtil.requestLoading(url, data, '正在加载数据...', 'POST', function (res) {
  23. if (res.data && res.data.success && res.data.data) {
  24. that.setData({
  25. comInfoDatas:res.data.data
  26. })
  27. } else {
  28. wx.showToast({
  29. title: res.data.msg,
  30. icon: 'none',
  31. duration: 2000
  32. })
  33. }
  34. }, function (res) {
  35. wx.showToast({
  36. title: '加载数据失败',
  37. icon: 'none',
  38. duration: 2000
  39. })
  40. })
  41. },
  42. /**
  43. * 生命周期函数--监听页面初次渲染完成
  44. */
  45. onReady: function () {
  46. },
  47. /**
  48. * 生命周期函数--监听页面显示
  49. */
  50. onShow: function () {
  51. },
  52. /**
  53. * 生命周期函数--监听页面隐藏
  54. */
  55. onHide: function () {
  56. },
  57. /**
  58. * 生命周期函数--监听页面卸载
  59. */
  60. onUnload: function () {
  61. },
  62. /**
  63. * 页面相关事件处理函数--监听用户下拉动作
  64. */
  65. onPullDownRefresh: function () {
  66. },
  67. /**
  68. * 页面上拉触底事件的处理函数
  69. */
  70. onReachBottom: function () {
  71. },
  72. /**
  73. * 用户点击右上角分享
  74. */
  75. onShareAppMessage: function () {
  76. }
  77. })