projectSelectView.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. var app = getApp();
  2. Page({
  3. /**
  4. * 页面的初始数据
  5. */
  6. data: {
  7. show: false,
  8. headUrl: '',
  9. includepoints: [],
  10. reportTempInputValue: '',
  11. reportDesc: '',
  12. reportInputFocus: false,
  13. openid: '',
  14. //1 跳转到测站选择列表,2 跳转到测站导航列表
  15. model: '1',
  16. projectList: []
  17. },
  18. /**
  19. * 生命周期函数--监听页面加载
  20. */
  21. onLoad: function (options) {
  22. this.data.openid = wx.getStorageSync('openid');
  23. var model = options.model;
  24. this.setData({
  25. model: model
  26. })
  27. this.getProjectList();
  28. },
  29. /**
  30. * 生命周期函数--监听页面初次渲染完成
  31. */
  32. onReady: function () {
  33. },
  34. /**
  35. * 生命周期函数--监听页面显示
  36. */
  37. onShow: function () {
  38. // this.getLocationReportList();
  39. console.log("orgid", this.data.orgId)
  40. },
  41. /**
  42. * 生命周期函数--监听页面隐藏
  43. */
  44. onHide: function () {
  45. },
  46. /**
  47. * 生命周期函数--监听页面卸载
  48. */
  49. onUnload: function () {
  50. },
  51. /**
  52. * 页面相关事件处理函数--监听用户下拉动作
  53. */
  54. onPullDownRefresh: function () {
  55. },
  56. /**
  57. * 页面上拉触底事件的处理函数
  58. */
  59. onReachBottom: function () {
  60. },
  61. /**
  62. * 用户点击右上角分享
  63. */
  64. onShareAppMessage: function () {
  65. },
  66. getProjectList: function () {
  67. wx.showNavigationBarLoading()
  68. var that = this;
  69. var url = app.globalData.cloudBase + "/Wx/User/Project/" + this.data.openid;
  70. wx.request({
  71. url: url,
  72. method: 'GET',
  73. header: {
  74. "Content-Type": "json"
  75. },
  76. success: function (res) {
  77. wx.hideNavigationBarLoading();
  78. if (res.data.code === "0") {
  79. that.setData({
  80. projectList: res.data.data
  81. });
  82. }
  83. },
  84. fail: function (error) {
  85. wx.hideNavigationBarLoading();
  86. }
  87. })
  88. },
  89. checkProgHandle: function (e) {
  90. var projectId = e.currentTarget.dataset.projectid;
  91. if (this.data.model == '1') {
  92. wx.navigateTo({
  93. url: '/pages/rtu/rtuList/rtuSelectView?projectId=' + projectId
  94. });
  95. } else if (this.data.model == '2') {
  96. wx.navigateTo({
  97. url: '/pages/rtu/rtuNavigate/rtuNavigateListView?projectId=' + projectId
  98. });
  99. }
  100. }
  101. })