index.js 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. // pages/tabber/news/index.js
  2. Page({
  3. /**
  4. * 页面的初始数据
  5. */
  6. data: {
  7. selectInfo: {},
  8. logolist: [
  9. {
  10. title: '创星汇科技园45栋门前',
  11. isp: 1,
  12. id: 0
  13. }, {
  14. title: '创星汇科技园45栋门前',
  15. isp: 0,
  16. id: 1
  17. }, {
  18. title: '创星汇科技园45栋门前',
  19. isp: 1,
  20. id: 2
  21. }, {
  22. title: '创星汇科技园45栋门前',
  23. isp: 0,
  24. id: 3
  25. }, {
  26. title: '创星汇科技园45栋门前',
  27. isp:0,
  28. id: 5
  29. }, {
  30. title: '创星汇科技园45栋门前',
  31. isp: 0,
  32. id: 6
  33. }, {
  34. title: '创星汇科技园45栋门前',
  35. isp: 0,
  36. id: 7
  37. }, {
  38. title: '创星汇科技园45栋门前',
  39. isp: 1,
  40. id: 8
  41. }, {
  42. title: '创星汇科技园45栋门前',
  43. id: 9,
  44. isp: 1,
  45. }, {
  46. title: '创星汇科技园45栋门前',
  47. id: 10,
  48. isp: 1
  49. },
  50. ],
  51. state: "",
  52. detashow: 2,
  53. },
  54. /**
  55. * 生命周期函数--监听页面加载
  56. */
  57. onLoad: function (options) {
  58. },
  59. DevicesList(city_id, title, sort) {
  60. var that = this;
  61. app.api.useApi(app.globalData.baseAppUrl + "api/admin/DevicesList", {
  62. lng: wx.getStorageSync('latitude'),
  63. lat: wx.getStorageSync('longitude'),
  64. city_id: city_id,
  65. title: title,
  66. sort: sort
  67. }, "post").then(function (res) {
  68. console.log(res);
  69. if (res.code == 200) {
  70. wx.showLoading({
  71. title: '请重新登录',
  72. })
  73. setTimeout(function () {
  74. wx.hideLoading();
  75. wx.reLaunch({
  76. url: '/pages/home/index',
  77. })
  78. }, 1000);
  79. } else {
  80. wx.hideLoading();
  81. that.setdata({
  82. userinfo: res.message.data
  83. })
  84. }
  85. }).catch(function (err) {
  86. console.log(222);
  87. })
  88. },
  89. /**
  90. * 生命周期函数--监听页面初次渲染完成
  91. */
  92. onReady: function () {
  93. // const query = wx.createSelectorQuery()
  94. // query.select('#nav').boundingClientRect((res) => {
  95. // console.log(res);
  96. // this.setData({
  97. // selectInfo: res
  98. // })
  99. // })
  100. // query.exec()
  101. },
  102. //点击变色 显示按钮
  103. seled: function (e) {
  104. this.setData({
  105. state: e.currentTarget.dataset.key,
  106. detashow: 2,
  107. });
  108. },
  109. deta: function () {
  110. this.setData({
  111. detashow: 0,
  112. });
  113. return false;
  114. if (this.data.detashow) {
  115. this.setData({
  116. detashow: false,
  117. });
  118. } else {
  119. this.setData({
  120. detashow: true,
  121. });
  122. }
  123. }
  124. })