set.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. const app=getApp();
  2. Page({
  3. /**
  4. * 页面的初始数据
  5. */
  6. data: {
  7. weburl:''
  8. },
  9. /**
  10. * 生命周期函数--监听页面加载
  11. */
  12. onLoad: function () {
  13. this.setData({
  14. weburl:app.globalData.webUrl+'applet.html#/set?token='+app.globalData.token+"&empid="+app.globalData.personMsg.binded.id+ '&client_type=' + app.globalData.clientype,
  15. })
  16. },
  17. setpersontap(e){
  18. console.log(e)
  19. let arr=e.detail.data;
  20. // name: "肖绪明"
  21. // nickname: "测试"
  22. // position: ""
  23. // wx: ""
  24. // type img person
  25. let imgtype='',persontype='';
  26. for(let i in arr){
  27. if(arr[i].type=='img'){
  28. app.globalData.personMsg.headimgurl=app.globalData.imgUrl+arr[i].headimg;
  29. }
  30. if(arr[i].type=='person'){
  31. app.globalData.personMsg.nickname=arr[i].nickname;
  32. app.globalData.personMsg.binded.name=arr[i].name;
  33. }
  34. }
  35. console.log(app.globalData.personMsg)
  36. },
  37. /**
  38. * 生命周期函数--监听页面初次渲染完成
  39. */
  40. onReady: function () {
  41. },
  42. /**
  43. * 生命周期函数--监听页面显示
  44. */
  45. onShow: function () {
  46. },
  47. /**
  48. * 生命周期函数--监听页面隐藏
  49. */
  50. onHide: function () {
  51. },
  52. /**
  53. * 生命周期函数--监听页面卸载
  54. */
  55. onUnload: function () {
  56. },
  57. /**
  58. * 页面相关事件处理函数--监听用户下拉动作
  59. */
  60. onPullDownRefresh: function () {
  61. },
  62. /**
  63. * 页面上拉触底事件的处理函数
  64. */
  65. onReachBottom: function () {
  66. },
  67. })