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. 18
      src/subpackage/device/pages/audio_manage/audio_manage.vue
  4. 2
      src/subpackage/device/pages/order_details/order_details.vue
  5. 35
      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);
_qyObj = this.setExt({ query: _qyObj, value: '', });
this.subpackInfo = _qyObj;
console.log(11111,_qyObj);
this.operateReq({ data: _qyObj, isTip: false });
},
methods: {

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

@ -117,7 +117,8 @@
mapState
} from 'vuex';
import util from '../../../../utils/util';
import DEVICE_FUN from '../../js/device_fun.js';
export default {
components: {
@ -404,7 +405,10 @@
let _data = this.getOperateReqData({
switchInfo,
status
})
})
_data = DEVICE_FUN.AC_filterCloudACData(data,switchInfo);
//->& 20201224 5
if (switchInfo.hardware_type === 'AccessControl' && status == 1) {
this.operateReq({
@ -460,7 +464,7 @@
}) {
let that = this
if (isLoad) util.showLoad();
console.log("123",data);
deviceServer.post({
url: deviceApi.ouxuanac,
data: data,
@ -514,6 +518,8 @@
// index,
// })
//TODO ,
// _data = DEVICE_FUN.AC_filterCloudACData(data,switchInfo);
util.showLoad();
setTimeout(()=>util.hideLoad(),1000)
}, 300, 300),
@ -668,7 +674,8 @@
let _obj = {
'Gpio': 'get-rpio', //
'SerialPort485': 'zzio404d-gpio-status',
'Tcp': 'zzio404d-gpio-status-tcp',
'Tcp': 'zzio404d-gpio-status-tcp',
'YZK':'zzio404d-gpio-status'
};
return _obj[hardware_connect_method] || ''
@ -682,7 +689,8 @@
let _obj = {
'Gpio': 'set-rpio', //
'SerialPort485': 'zzio404d-gpio',
'Tcp': 'zzio404d-gpio-tcp',
'Tcp': 'zzio404d-gpio-tcp',
'YZK':'zzio404d-gpio'
};
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="rp-name"><text class="rn-txt">*</text>退款金额</view>
<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 class="rp-tip">最多可退{{ (pageInfo.extension&&pageInfo.extension.refundable_amount) || 0 }}</view>
</view>

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

@ -65,6 +65,7 @@ import deviceApi from '../../js/device_api';
import { mapState } from 'vuex';
import util from '../../../../utils/util';
import DEVICE_FUN from '../../js/device_fun.js';
export default {
components: {
@ -174,10 +175,13 @@ export default {
console.log("icon tap status: ",status,switchInfo)
let _data = this.getOperateReqData({ switchInfo, status })
_data = DEVICE_FUN.AC_filterCloudACData(_data,switchInfo);
//->& 20201224 5
///
if(status == 2) return util.showNone("该功能暂未开放")
// if(status == 2) return util.showNone("")
if(status == 4){
@ -213,7 +217,11 @@ export default {
device: curStoreInfo.device_name, // ,
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
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({
data: this.getSwitchStatusQuery(switchInfo),
data: _data,
index,
})
},300,300),
@ -347,6 +358,7 @@ export default {
// src\subpackage\device\js\ouxuanac.md
// hardware_type === 'Air'
getSwitchQuery({ switchInfo, status = '' }){
let {
hardware_connect_method,
hardware_type,
@ -354,17 +366,19 @@ export default {
node_id,
hardware_net_addr
} = switchInfo;
const _hardware_connect_method = this.changeLowerCase(hardware_connect_method)
const postData = {
name: this.getQueryName(switchInfo),
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
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(hardware_type === 'Air'){ // key op
postData.value['op'] = this.getAirRelayStatus(status);
@ -375,17 +389,18 @@ export default {
postData.value['o'] = this.getRelayStatus(status); //
}
}
return postData;
},
changeLowerCase(str){
return str.toString().toLocaleLowerCase();
return str.toString().toLocaleLowerCase();
},
//
// Low = "low", //
// High = "high", //
// status 0 -> 1 -> ,2 -> ,3 -> , 4 ->()
getRelayStatus(status){
return [ 'high', 'low', '', 'high', ''][status] || ''
return [ 'high', 'low', 'low', 'high', ''][status] || ''
},
//
@ -403,6 +418,7 @@ export default {
'Gpio': 'get-rpio', //
'SerialPort485': 'zzio404d-gpio-status',
'Tcp': 'zzio404d-gpio-status-tcp',
'YZK':'zzio404d-gpio-status'
};
return _obj[hardware_connect_method] || ''
@ -415,6 +431,7 @@ export default {
'Gpio': 'set-rpio', //
'SerialPort485': 'zzio404d-gpio',
'Tcp': 'zzio404d-gpio-tcp',
'YZK':'zzio404d-gpio'
};
return _obj[hardware_connect_method] || ''

Loading…
Cancel
Save