mirror of
https://gitee.com/elegant_wings/dbd-meeting-wx-small.git
synced 2025-08-08 15:12:43 +08:00
描述: 智能设备
This commit is contained in:
parent
a4681d407b
commit
fc232f8e8a
@ -2,19 +2,19 @@ App({
|
|||||||
// 上海长阳-配置信息
|
// 上海长阳-配置信息
|
||||||
APPID: 'wx08bf0d440e446e7c',
|
APPID: 'wx08bf0d440e446e7c',
|
||||||
APPSECRET: 'e0ef2bac28df376d8855d04ee8828d73',
|
APPSECRET: 'e0ef2bac28df376d8855d04ee8828d73',
|
||||||
tenantId : '12', // 地区
|
tenantId: '12', // 地区
|
||||||
parkId : '26', // 园区id
|
parkId: '26', // 园区id
|
||||||
parkName : '长阳智会云控', // 园区名称
|
parkName: '长阳智会云控', // 园区名称
|
||||||
// 本地测试
|
// 本地测试
|
||||||
DOMAIN_NAME_PREFIX: 'http://192.168.0.30',
|
// DOMAIN_NAME_PREFIX: ' http://wrqhey.natappfree.cc',
|
||||||
DOMAIN_NAME: 'http://192.168.0.30:9227', //接口域名
|
// DOMAIN_NAME: ' http://wrqhey.natappfree.cc', //接口域名
|
||||||
IMG_NAME: 'http://192.168.0.30:9227',
|
// IMG_NAME: ' http://wrqhey.natappfree.cc',
|
||||||
socketUrl: 'wss://company.haxy.com.cn:4443/changyang-office/websocket-server',
|
|
||||||
// 生产
|
|
||||||
// DOMAIN_NAME_PREFIX: 'https://www.chuangzhikj.com',
|
|
||||||
// DOMAIN_NAME: 'https://www.chuangzhikj.com/saas-ics', //接口域名
|
|
||||||
// IMG_NAME: 'https://www.chuangzhikj.com/saas-ics',
|
|
||||||
// socketUrl: 'wss://company.haxy.com.cn:4443/changyang-office/websocket-server',
|
// socketUrl: 'wss://company.haxy.com.cn:4443/changyang-office/websocket-server',
|
||||||
|
// 生产
|
||||||
|
DOMAIN_NAME_PREFIX: 'https://www.chuangzhikj.com',
|
||||||
|
DOMAIN_NAME: 'https://www.chuangzhikj.com/saas-ics', //接口域名
|
||||||
|
IMG_NAME: 'https://www.chuangzhikj.com/saas-ics',
|
||||||
|
socketUrl: 'wss://company.haxy.com.cn:4443/changyang-office/websocket-server',
|
||||||
globals: {
|
globals: {
|
||||||
refreshMyPages: false,
|
refreshMyPages: false,
|
||||||
homedata: {},
|
homedata: {},
|
||||||
@ -304,4 +304,50 @@ App({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 消息提示
|
||||||
|
vantNotify(Notify, msg, type, top) {
|
||||||
|
let data = {
|
||||||
|
type,
|
||||||
|
message: msg,
|
||||||
|
}
|
||||||
|
if (!type) {
|
||||||
|
data.type = 'primary'
|
||||||
|
}
|
||||||
|
if (top) {
|
||||||
|
data.top = top
|
||||||
|
}
|
||||||
|
Notify(data);
|
||||||
|
},
|
||||||
|
// 消息提示
|
||||||
|
vantNotifySuccess(Notify, msg) {
|
||||||
|
this.vantNotify(Notify, msg, 'primary')
|
||||||
|
},
|
||||||
|
// 消息提示
|
||||||
|
vantNotifyErr(Notify, msg) {
|
||||||
|
this.vantNotify(Notify, msg, 'danger')
|
||||||
|
},
|
||||||
|
// 消息提示
|
||||||
|
vantNotifySuccessTop(Notify, msg) {
|
||||||
|
this.vantNotify(Notify, msg, 'primary', 90)
|
||||||
|
},
|
||||||
|
// 消息提示
|
||||||
|
vantNotifyErrTop(Notify, msg) {
|
||||||
|
this.vantNotify(Notify, msg, 'danger', 90)
|
||||||
|
},
|
||||||
|
// 自定义后退
|
||||||
|
selfBackPage(step) {
|
||||||
|
let currentPages = getCurrentPages();
|
||||||
|
// 大于就后退,否则直接跳转首页
|
||||||
|
if (currentPages.length > step) {
|
||||||
|
wx.navigateBack({
|
||||||
|
delta: step
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
// 跳转首页
|
||||||
|
wx.reLaunch({
|
||||||
|
url: '/pages/index/index',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
@ -1,5 +1,8 @@
|
|||||||
const app = getApp()
|
const app = getApp()
|
||||||
|
|
||||||
|
import Notify from '@vant/weapp/notify/notify';
|
||||||
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
getAllDeviceInfoByRoomIdRq,
|
getAllDeviceInfoByRoomIdRq,
|
||||||
getAllPanelInfoByRoomIdRq,
|
getAllPanelInfoByRoomIdRq,
|
||||||
@ -283,8 +286,15 @@ Page({
|
|||||||
let _this = this
|
let _this = this
|
||||||
let lockDoor = _this.data.lockDoor
|
let lockDoor = _this.data.lockDoor
|
||||||
// 调用设备接口
|
// 调用设备接口
|
||||||
_this.callApiByDevice({
|
callApiByDeviceIdRq({
|
||||||
"deviceId": lockDoor.id,
|
"deviceId": lockDoor.id,
|
||||||
|
}).then(res => {
|
||||||
|
console.log('callApiByDeviceIdRq', res);
|
||||||
|
if(res.code == 0){
|
||||||
|
app.vantNotifySuccess(Notify, res.msg)
|
||||||
|
}else{
|
||||||
|
app.vantNotifyErr(Notify, res.msg)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -297,7 +307,6 @@ Page({
|
|||||||
|
|
||||||
// 初始化socket
|
// 初始化socket
|
||||||
initSocket() {
|
initSocket() {
|
||||||
return
|
|
||||||
let _this = this
|
let _this = this
|
||||||
let socketTask = wx.connectSocket({
|
let socketTask = wx.connectSocket({
|
||||||
url: app.socketUrl,
|
url: app.socketUrl,
|
||||||
@ -324,7 +333,7 @@ Page({
|
|||||||
if (type == 'KONKE_ZIGBEE_CHOPIN_LIGHT_PROJECT') { // 灯控面板、雾化玻璃
|
if (type == 'KONKE_ZIGBEE_CHOPIN_LIGHT_PROJECT') { // 灯控面板、雾化玻璃
|
||||||
let id = pushMsg.id
|
let id = pushMsg.id
|
||||||
let on = pushMsg.status.on // true 开 false 关
|
let on = pushMsg.status.on // true 开 false 关
|
||||||
let equipmentData = equipmentList.find(item => item.id == id)
|
let equipmentData = equipmentList.find(item => item.equipmentNum == id)
|
||||||
if (equipmentData) {
|
if (equipmentData) {
|
||||||
equipmentData.status = on
|
equipmentData.status = on
|
||||||
}
|
}
|
||||||
@ -336,7 +345,7 @@ Page({
|
|||||||
let whiteBri = pushMsg.status.whiteBri // 白光亮度 [1,100]
|
let whiteBri = pushMsg.status.whiteBri // 白光亮度 [1,100]
|
||||||
let colourTemperature = pushMsg.status.colourTemperature // 色温[1,100]
|
let colourTemperature = pushMsg.status.colourTemperature // 色温[1,100]
|
||||||
//
|
//
|
||||||
let equipmentData = equipmentList.find(item => item.id == id)
|
let equipmentData = equipmentList.find(item => item.equipmentNum == id)
|
||||||
if (equipmentData) {
|
if (equipmentData) {
|
||||||
equipmentData.status = on
|
equipmentData.status = on
|
||||||
}
|
}
|
||||||
@ -344,13 +353,13 @@ Page({
|
|||||||
} else if (type == 'KONKE_ZIGBEE_CHOPIN_CURTAIN_CUSTOM') { // 窗帘
|
} else if (type == 'KONKE_ZIGBEE_CHOPIN_CURTAIN_CUSTOM') { // 窗帘
|
||||||
let id = pushMsg.id
|
let id = pushMsg.id
|
||||||
let MotorStatus = pushMsg.status.MotorStatus // OPEN 开 、CLOSE 关、 STOP 暂停
|
let MotorStatus = pushMsg.status.MotorStatus // OPEN 开 、CLOSE 关、 STOP 暂停
|
||||||
let equipmentData = equipmentList.find(item => item.id == id)
|
let equipmentData = equipmentList.find(item => item.equipmentNum == id)
|
||||||
equipmentData.status = MotorStatus
|
equipmentData.status = MotorStatus
|
||||||
|
|
||||||
} else if (type == 'KONKE_ZIGBEE_CHOPIN_10A_SOCKET') { // 插座
|
} else if (type == 'KONKE_ZIGBEE_CHOPIN_10A_SOCKET') { // 插座
|
||||||
let id = pushMsg.id
|
let id = pushMsg.id
|
||||||
let on = pushMsg.status.on // on 开关状态 true开 false关
|
let on = pushMsg.status.on // on 开关状态 true开 false关
|
||||||
let equipmentData = equipmentList.find(item => item.id == id)
|
let equipmentData = equipmentList.find(item => item.equipmentNum == id)
|
||||||
equipmentData.status = on
|
equipmentData.status = on
|
||||||
|
|
||||||
} else if (type == 'KONKE_ZIGBEE_KIT_TEMPSENSOR') { // 温度
|
} else if (type == 'KONKE_ZIGBEE_KIT_TEMPSENSOR') { // 温度
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
{
|
{
|
||||||
"usingComponents": {},
|
"usingComponents": {
|
||||||
|
"van-notify": "@vant/weapp/notify/index"
|
||||||
|
},
|
||||||
"navigationBarTitleText": "房间"
|
"navigationBarTitleText": "房间"
|
||||||
}
|
}
|
@ -79,3 +79,6 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<!-- 消息提示 -->
|
||||||
|
<van-notify id="van-notify" />
|
||||||
|
@ -6,6 +6,13 @@
|
|||||||
"condition": {
|
"condition": {
|
||||||
"miniprogram": {
|
"miniprogram": {
|
||||||
"list": [
|
"list": [
|
||||||
|
{
|
||||||
|
"name": "pages/test/test",
|
||||||
|
"pathName": "pages/test/test",
|
||||||
|
"query": "",
|
||||||
|
"launchMode": "default",
|
||||||
|
"scene": null
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "pages/test/test",
|
"name": "pages/test/test",
|
||||||
"pathName": "pages/test/test",
|
"pathName": "pages/test/test",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user