Browse Source

v1.1.15 master Merge branch 'dev'

feat-230721
zmt 3 years ago
parent
commit
f89e226316
  1. 26
      src/subpackage/device/js/device_fun.js
  2. 1
      src/subpackage/device/pages/air_conditioner/detail/detail.vue
  3. 10
      src/subpackage/device/pages/audio_manage/audio_manage.vue
  4. 2
      src/subpackage/device/pages/order_details/order_details.vue
  5. 29
      src/subpackage/device/pages/switch_manage/switch_manage.vue

26
src/subpackage/device/js/device_fun.js

@ -0,0 +1,26 @@
/*
硬件处理函数
*/
var DEVICE_FUN = {
/*
@data:过滤数据
@switchInfo:操作的设备信息
使用: _data = DEVICE_FUN.AC_filterCloudACData(data,switchInfo);
场景: 目前需求只要求照明(中控状态更新,灯操控) 其它需要再对接
注意: 涉及deviceApi.ouxuanac 接口的,理论上来说都需要做兼容去在逻辑中传入硬件信息判断是否是云中控
*/
AC_filterCloudACData(data,switchInfo){
console.log("云中控参数检测 AC_filterCloudACData",data,switchInfo);
//处理云中控专用参数
// 这里device是设备名 一旦出现云中控 设备id被 (OUXUANAC_CLOUD_+hardware_net_addr) 串起来的字符串覆盖
if(!!switchInfo&&switchInfo.hardware_connect_method=="YZK"){
data.device = "OUXUANAC_CLOUD_"+switchInfo.hardware_net_addr;
}
return data
},
}
export default DEVICE_FUN;

1
src/subpackage/device/pages/air_conditioner/detail/detail.vue

@ -226,6 +226,7 @@ export default {
console.warn('_qyObj', _qyObj); console.warn('_qyObj', _qyObj);
_qyObj = this.setExt({ query: _qyObj, value: '', }); _qyObj = this.setExt({ query: _qyObj, value: '', });
this.subpackInfo = _qyObj; this.subpackInfo = _qyObj;
console.log(11111,_qyObj);
this.operateReq({ data: _qyObj, isTip: false }); this.operateReq({ data: _qyObj, isTip: false });
}, },
methods: { methods: {

10
src/subpackage/device/pages/audio_manage/audio_manage.vue

@ -118,6 +118,7 @@
} from 'vuex'; } from 'vuex';
import util from '../../../../utils/util'; import util from '../../../../utils/util';
import DEVICE_FUN from '../../js/device_fun.js';
export default { export default {
components: { components: {
@ -405,6 +406,9 @@
switchInfo, switchInfo,
status status
}) })
_data = DEVICE_FUN.AC_filterCloudACData(data,switchInfo);
//->& 20201224 5 //->& 20201224 5
if (switchInfo.hardware_type === 'AccessControl' && status == 1) { if (switchInfo.hardware_type === 'AccessControl' && status == 1) {
this.operateReq({ this.operateReq({
@ -460,7 +464,7 @@
}) { }) {
let that = this let that = this
if (isLoad) util.showLoad(); if (isLoad) util.showLoad();
console.log("123",data);
deviceServer.post({ deviceServer.post({
url: deviceApi.ouxuanac, url: deviceApi.ouxuanac,
data: data, data: data,
@ -514,6 +518,8 @@
// index, // index,
// }) // })
//TODO , //TODO ,
// _data = DEVICE_FUN.AC_filterCloudACData(data,switchInfo);
util.showLoad(); util.showLoad();
setTimeout(()=>util.hideLoad(),1000) setTimeout(()=>util.hideLoad(),1000)
}, 300, 300), }, 300, 300),
@ -669,6 +675,7 @@
'Gpio': 'get-rpio', // 'Gpio': 'get-rpio', //
'SerialPort485': 'zzio404d-gpio-status', 'SerialPort485': 'zzio404d-gpio-status',
'Tcp': 'zzio404d-gpio-status-tcp', 'Tcp': 'zzio404d-gpio-status-tcp',
'YZK':'zzio404d-gpio-status'
}; };
return _obj[hardware_connect_method] || '' return _obj[hardware_connect_method] || ''
@ -683,6 +690,7 @@
'Gpio': 'set-rpio', // 'Gpio': 'set-rpio', //
'SerialPort485': 'zzio404d-gpio', 'SerialPort485': 'zzio404d-gpio',
'Tcp': 'zzio404d-gpio-tcp', 'Tcp': 'zzio404d-gpio-tcp',
'YZK':'zzio404d-gpio'
}; };
return _obj[hardware_connect_method] || '' return _obj[hardware_connect_method] || ''

2
src/subpackage/device/pages/order_details/order_details.vue

@ -20,7 +20,7 @@
<view class="rc-price"> <view class="rc-price">
<view class="rp-name"><text class="rn-txt">*</text>退款金额</view> <view class="rp-name"><text class="rn-txt">*</text>退款金额</view>
<view class="rp-frame"> <view class="rp-frame">
<input class="rf-ipt" v-model="refundPrice" type="number" placeholder="请输入金额" />
<input class="rf-ipt" v-model="refundPrice" type="digit" placeholder="请输入金额" />
</view> </view>
<view class="rp-tip">最多可退{{ (pageInfo.extension&&pageInfo.extension.refundable_amount) || 0 }}</view> <view class="rp-tip">最多可退{{ (pageInfo.extension&&pageInfo.extension.refundable_amount) || 0 }}</view>
</view> </view>

29
src/subpackage/device/pages/switch_manage/switch_manage.vue

@ -65,6 +65,7 @@ import deviceApi from '../../js/device_api';
import { mapState } from 'vuex'; import { mapState } from 'vuex';
import util from '../../../../utils/util'; import util from '../../../../utils/util';
import DEVICE_FUN from '../../js/device_fun.js';
export default { export default {
components: { components: {
@ -174,10 +175,13 @@ export default {
console.log("icon tap status: ",status,switchInfo) console.log("icon tap status: ",status,switchInfo)
let _data = this.getOperateReqData({ switchInfo, status }) let _data = this.getOperateReqData({ switchInfo, status })
_data = DEVICE_FUN.AC_filterCloudACData(_data,switchInfo);
//->& 20201224 5 //->& 20201224 5
/// ///
if(status == 2) return util.showNone("该功能暂未开放")
// if(status == 2) return util.showNone("")
if(status == 4){ if(status == 4){
@ -214,6 +218,10 @@ export default {
data: _query, // src\subpackage\device\js\ouxuanac.md data: _query, // src\subpackage\device\js\ouxuanac.md
}; };
//2021-12-17 set-rpio set-rpio-lock () set-rpio-lock
if(switchInfo.hardware_type=="Light"&&_data.data.value.status=="high")_data.data.name = "set-rpio-lock"
if(switchInfo.hardware_type=="Light"&&status==2)_data.data.name = "set-rpio-lock"
//->& 20201224 5 //->& 20201224 5
if(switchInfo.hardware_type === 'AccessControl'&&status == 0)_data['delay'] = '5'; if(switchInfo.hardware_type === 'AccessControl'&&status == 0)_data['delay'] = '5';
@ -263,8 +271,11 @@ export default {
}) })
} }
let _data = this.getSwitchStatusQuery(switchInfo);
_data = DEVICE_FUN.AC_filterCloudACData(data,switchInfo);
this.getStatusReq({ this.getStatusReq({
data: this.getSwitchStatusQuery(switchInfo),
data: _data,
index, index,
}) })
},300,300), },300,300),
@ -347,6 +358,7 @@ export default {
// src\subpackage\device\js\ouxuanac.md // src\subpackage\device\js\ouxuanac.md
// hardware_type === 'Air' // hardware_type === 'Air'
getSwitchQuery({ switchInfo, status = '' }){ getSwitchQuery({ switchInfo, status = '' }){
let { let {
hardware_connect_method, hardware_connect_method,
hardware_type, hardware_type,
@ -354,17 +366,19 @@ export default {
node_id, node_id,
hardware_net_addr hardware_net_addr
} = switchInfo; } = switchInfo;
const _hardware_connect_method = this.changeLowerCase(hardware_connect_method)
const postData = { const postData = {
name: this.getQueryName(switchInfo), name: this.getQueryName(switchInfo),
value: { id: hardware_id + '', } // value String value: { id: hardware_id + '', } // value String
}; };
if (this.changeLowerCase(hardware_connect_method) === 'gpio') postData.value['status'] = this.getRelayStatus(status);
if (_hardware_connect_method === 'gpio') postData.value['status'] = this.getRelayStatus(status);
// tcp hardware_net_addr // tcp hardware_net_addr
if (this.changeLowerCase(hardware_connect_method) === 'tcp') postData.value['tcp'] = hardware_net_addr + '';
let _flag = this.changeLowerCase(hardware_connect_method) === 'serialport485' || this.changeLowerCase(hardware_connect_method) === 'tcp';
if (_hardware_connect_method === 'tcp') postData.value['tcp'] = hardware_net_addr + '';
// let _flag = _hardware_connect_method === 'serialport485' || _hardware_connect_method === 'tcp'||_hardware_connect_method==='yzk';
let _flag = ['serialport485','tcp','yzk'].some(e=> e===_hardware_connect_method);
if (_flag){ if (_flag){
if(hardware_type === 'Air'){ // key op if(hardware_type === 'Air'){ // key op
postData.value['op'] = this.getAirRelayStatus(status); postData.value['op'] = this.getAirRelayStatus(status);
@ -375,6 +389,7 @@ export default {
postData.value['o'] = this.getRelayStatus(status); // postData.value['o'] = this.getRelayStatus(status); //
} }
} }
return postData; return postData;
}, },
changeLowerCase(str){ changeLowerCase(str){
@ -385,7 +400,7 @@ export default {
// High = "high", // // High = "high", //
// status 0 -> 1 -> ,2 -> ,3 -> , 4 ->() // status 0 -> 1 -> ,2 -> ,3 -> , 4 ->()
getRelayStatus(status){ getRelayStatus(status){
return [ 'high', 'low', '', 'high', ''][status] || ''
return [ 'high', 'low', 'low', 'high', ''][status] || ''
}, },
// //
@ -403,6 +418,7 @@ export default {
'Gpio': 'get-rpio', // 'Gpio': 'get-rpio', //
'SerialPort485': 'zzio404d-gpio-status', 'SerialPort485': 'zzio404d-gpio-status',
'Tcp': 'zzio404d-gpio-status-tcp', 'Tcp': 'zzio404d-gpio-status-tcp',
'YZK':'zzio404d-gpio-status'
}; };
return _obj[hardware_connect_method] || '' return _obj[hardware_connect_method] || ''
@ -415,6 +431,7 @@ export default {
'Gpio': 'set-rpio', // 'Gpio': 'set-rpio', //
'SerialPort485': 'zzio404d-gpio', 'SerialPort485': 'zzio404d-gpio',
'Tcp': 'zzio404d-gpio-tcp', 'Tcp': 'zzio404d-gpio-tcp',
'YZK':'zzio404d-gpio'
}; };
return _obj[hardware_connect_method] || '' return _obj[hardware_connect_method] || ''

Loading…
Cancel
Save