123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144 |
- // pages/tabber/news/index.js
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- selectInfo: {},
- logolist: [
- {
- title: '创星汇科技园45栋门前',
- isp: 1,
- id: 0
- }, {
- title: '创星汇科技园45栋门前',
- isp: 0,
- id: 1
- }, {
- title: '创星汇科技园45栋门前',
- isp: 1,
- id: 2
- }, {
- title: '创星汇科技园45栋门前',
- isp: 0,
- id: 3
- }, {
- title: '创星汇科技园45栋门前',
- isp:0,
- id: 5
- }, {
- title: '创星汇科技园45栋门前',
- isp: 0,
- id: 6
- }, {
- title: '创星汇科技园45栋门前',
- isp: 0,
- id: 7
- }, {
- title: '创星汇科技园45栋门前',
- isp: 1,
- id: 8
- }, {
- title: '创星汇科技园45栋门前',
- id: 9,
- isp: 1,
- }, {
- title: '创星汇科技园45栋门前',
- id: 10,
- isp: 1
- },
- ],
- state: "",
- detashow: 2,
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
- },
- DevicesList(city_id, title, sort) {
- var that = this;
- app.api.useApi(app.globalData.baseAppUrl + "api/admin/DevicesList", {
- lng: wx.getStorageSync('latitude'),
- lat: wx.getStorageSync('longitude'),
- city_id: city_id,
- title: title,
- sort: sort
- }, "post").then(function (res) {
- console.log(res);
- if (res.code == 200) {
- wx.showLoading({
- title: '请重新登录',
- })
- setTimeout(function () {
- wx.hideLoading();
- wx.reLaunch({
- url: '/pages/home/index',
- })
- }, 1000);
- } else {
- wx.hideLoading();
- that.setdata({
- userinfo: res.message.data
- })
- }
- }).catch(function (err) {
- console.log(222);
- })
- },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady: function () {
- // const query = wx.createSelectorQuery()
- // query.select('#nav').boundingClientRect((res) => {
- // console.log(res);
- // this.setData({
- // selectInfo: res
- // })
- // })
- // query.exec()
- },
- //点击变色 显示按钮
- seled: function (e) {
- this.setData({
- state: e.currentTarget.dataset.key,
- detashow: 2,
- });
- },
- deta: function () {
- this.setData({
- detashow: 0,
- });
- return false;
- if (this.data.detashow) {
- this.setData({
- detashow: false,
- });
- } else {
- this.setData({
- detashow: true,
- });
- }
- }
- })
|