// pages/corporateInfo/corporateInfo.js var BASEURL = require('../../utils/wxconstant.js') var baseUrl = BASEURL.BaseUrl() var netUtil = require('../../utils/network.js') Page({ /** * 页面的初始数据 */ data: { comInfoDatas:{}, }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { this.getInfo() }, getInfo:function(){ var that = this var data = { empId: wx.getStorageSync('empId')} var url = baseUrl + BASEURL.getUrl.getByEmp netUtil.requestLoading(url, data, '正在加载数据...', 'POST', function (res) { if (res.data && res.data.success && res.data.data) { that.setData({ comInfoDatas:res.data.data }) } else { wx.showToast({ title: res.data.msg, icon: 'none', duration: 2000 }) } }, function (res) { wx.showToast({ title: '加载数据失败', icon: 'none', duration: 2000 }) }) }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function () { }, /** * 生命周期函数--监听页面显示 */ onShow: function () { }, /** * 生命周期函数--监听页面隐藏 */ onHide: function () { }, /** * 生命周期函数--监听页面卸载 */ onUnload: function () { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh: function () { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function () { }, /** * 用户点击右上角分享 */ onShareAppMessage: function () { } })