const app=getApp(); Page({ /** * 页面的初始数据 */ data: { weburl:'' }, /** * 生命周期函数--监听页面加载 */ onLoad: function () { this.setData({ weburl:app.globalData.webUrl+'applet.html#/set?token='+app.globalData.token+"&empid="+app.globalData.personMsg.binded.id+ '&client_type=' + app.globalData.clientype, }) }, setpersontap(e){ console.log(e) let arr=e.detail.data; // name: "肖绪明" // nickname: "测试" // position: "" // wx: "" // type img person let imgtype='',persontype=''; for(let i in arr){ if(arr[i].type=='img'){ app.globalData.personMsg.headimgurl=app.globalData.imgUrl+arr[i].headimg; } if(arr[i].type=='person'){ app.globalData.personMsg.nickname=arr[i].nickname; app.globalData.personMsg.binded.name=arr[i].name; } } console.log(app.globalData.personMsg) }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function () { }, /** * 生命周期函数--监听页面显示 */ onShow: function () { }, /** * 生命周期函数--监听页面隐藏 */ onHide: function () { }, /** * 生命周期函数--监听页面卸载 */ onUnload: function () { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh: function () { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function () { }, })