|
|
@@ -68,40 +68,55 @@ Page({
|
|
|
manual: function () {
|
|
|
var that = this
|
|
|
var id = that.data.id
|
|
|
- //请求数据
|
|
|
- wx.request({
|
|
|
- url: 'https://wx.yfzhwlw.com/qxz_wechat_switch',
|
|
|
- header: {
|
|
|
- "Content-Type": "application/x-www-form-urlencoded"
|
|
|
- },
|
|
|
- method: "GET",
|
|
|
- data: {
|
|
|
- equip_id: id
|
|
|
- },
|
|
|
- success: function (res) {
|
|
|
- if (res.statusCode != 200) {
|
|
|
- app.showError()
|
|
|
- } else {
|
|
|
- //判断当前是否有数据
|
|
|
- if (res.data.length == 0) {
|
|
|
- wx.showToast({
|
|
|
- title: '该功能暂未开放',
|
|
|
- icon: 'none',
|
|
|
- duration: 2000
|
|
|
- })
|
|
|
+ var off = that.data.demo
|
|
|
+ //判断当前设备是否能有手动控制功能switch==0没有开关 switch==1有开关
|
|
|
+ console.log(off.switch)
|
|
|
+ if (off.switch == 0) {
|
|
|
+ //没有开关不能进入
|
|
|
+ wx.showToast({
|
|
|
+ title: '该功能暂未开放',
|
|
|
+ icon: 'none',
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ } else if (off.switch == 1) {
|
|
|
+ //有开关能进入
|
|
|
+ //请求数据
|
|
|
+ wx.request({
|
|
|
+ url: 'https://wx.yfzhwlw.com/qxz_wechat_switch',
|
|
|
+ header: {
|
|
|
+ "Content-Type": "application/x-www-form-urlencoded"
|
|
|
+ },
|
|
|
+ method: "GET",
|
|
|
+ data: {
|
|
|
+ equip_id: id
|
|
|
+ },
|
|
|
+ success: function (res) {
|
|
|
+ if (res.statusCode != 200) {
|
|
|
+ app.showError()
|
|
|
} else {
|
|
|
- var data = JSON.stringify(res.data)
|
|
|
- console.log(data)
|
|
|
- wx.navigateTo({
|
|
|
- url: '../weather-list-details-manual/weather-list-details-manual?data=' + data,
|
|
|
- })
|
|
|
+ //判断当前是否有数据
|
|
|
+ if (res.data.length == 0) {
|
|
|
+ wx.showToast({
|
|
|
+ title: '该功能暂未开放',
|
|
|
+ icon: 'none',
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ var data = JSON.stringify(res.data)
|
|
|
+ console.log(data)
|
|
|
+ wx.navigateTo({
|
|
|
+ url: '../weather-list-details-manual/weather-list-details-manual?data=' + data,
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
+ },
|
|
|
+ fail: function (err) {
|
|
|
+ app.showError()
|
|
|
}
|
|
|
- },
|
|
|
- fail: function (err) {
|
|
|
- app.showError()
|
|
|
- }
|
|
|
- })
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
@@ -113,8 +128,8 @@ Page({
|
|
|
})
|
|
|
//请求设备数据详情
|
|
|
var that = this;
|
|
|
- // var id = options.id
|
|
|
- var id = '16062012'
|
|
|
+ var id = options.id
|
|
|
+ // var id = '16062012'
|
|
|
that.setData({
|
|
|
id: id
|
|
|
})
|