修复插件bug

wx-program
pangdundun 2023-12-22 16:27:01 +08:00
parent 8a07725056
commit a3622d4fd7
43 changed files with 108 additions and 126 deletions

View File

@ -52,7 +52,8 @@
"mp-weixin" : {
"appid" : "wx05b45a2699f02a2b",
"setting" : {
"urlCheck" : false
"urlCheck" : false,
"minified" : true
},
"usingComponents" : true
},

View File

@ -5,7 +5,7 @@
<!-- 金华权限 -->
<view class="content" v-if="purviewList.indexOf('10')!=-1">
<div class="item">
<u-collapse :accordion='false' :item-style="itemStyle" :head-style='headStyle'>
<u-collapse :accordion='false' :item-style="itemStyle" :head-style='headStyle' ref="collapseView">
<u-collapse-item :title="item.nickName" v-for="(item,index) in itemList" :key="index" align="center"
v-show="isInclude(item)">
<view class="collapseItem">
@ -631,6 +631,11 @@
]
};
},
onReady(){
setTimeout(() => {
this.$refs.collapseView.init();
}, 500);
},
onLoad(options) {
console.log(options);
this.typeList = this.api.typeList

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1557,7 +1557,7 @@ function initData(vueOptions, context) {
try {
data = data.call(context); // 支持 Vue.prototype 上挂的数据
} catch (e) {
if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"greenhouse-wisdom-applet","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
if (Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"greenhouse-wisdom-applet","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
}
}
@ -8934,7 +8934,7 @@ function type(obj) {
function flushCallbacks$1(vm) {
if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"greenhouse-wisdom-applet","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
if (Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"greenhouse-wisdom-applet","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
var mpInstance = vm.$scope;
console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
@ -8955,14 +8955,14 @@ function nextTick$1(vm, cb) {
//1.nextTick 之前 已 setData 且 setData 还未回调完成
//2.nextTick 之前存在 render watcher
if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
if(Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"greenhouse-wisdom-applet","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
if(Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"greenhouse-wisdom-applet","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
var mpInstance = vm.$scope;
console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
']:nextVueTick');
}
return nextTick(cb, vm)
}else{
if(Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"greenhouse-wisdom-applet","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
if(Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"greenhouse-wisdom-applet","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
var mpInstance$1 = vm.$scope;
console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
']:nextMPTick');
@ -9058,7 +9058,7 @@ var patch = function(oldVnode, vnode) {
});
var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
if (Object.keys(diffData).length) {
if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"greenhouse-wisdom-applet","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
if (Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"greenhouse-wisdom-applet","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
']差量更新',
JSON.stringify(diffData));
@ -12674,7 +12674,7 @@ function _extends() {
var formatRegExp = /%[sdj%]/g;
var warning = function warning() {}; // don't print warning message when in production env or node runtime
if (typeof process !== 'undefined' && Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"greenhouse-wisdom-applet","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}) && "development" !== 'production' && typeof window !== 'undefined' && typeof document !== 'undefined') {
if (typeof process !== 'undefined' && Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"greenhouse-wisdom-applet","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}) && "development" !== 'production' && typeof window !== 'undefined' && typeof document !== 'undefined') {
warning = function warning(type, errors) {
if (typeof console !== 'undefined' && console.warn) {
if (errors.every(function (e) {

View File

@ -841,6 +841,12 @@ var _default = {
}]
};
},
onReady: function onReady() {
var _this = this;
setTimeout(function () {
_this.$refs.collapseView.init();
}, 500);
},
onLoad: function onLoad(options) {
console.log(options);
this.typeList = this.api.typeList;
@ -861,21 +867,21 @@ var _default = {
methods: {
// 小程序手机控制权限数据
getcontrol_wxgetpermission: function getcontrol_wxgetpermission() {
var _this = this;
var _this2 = this;
var deviceId = this.deviceId;
this.$http({
url: this.api.getcontrol_wxgetpermission + '?deviceId=' + deviceId,
method: 'GET'
}).then(function (res) {
if (res.code == 200) {
_this.wxgetpermission = res.data;
_this.itemList = _this.itemList.map(function (i) {
_this2.wxgetpermission = res.data;
_this2.itemList = _this2.itemList.map(function (i) {
return _objectSpread(_objectSpread({}, i), {}, {
nickName: ''
});
});
_this.itemList.forEach(function (h) {
var s = _this.wxgetpermission.filter(function (m) {
_this2.itemList.forEach(function (h) {
var s = _this2.wxgetpermission.filter(function (m) {
return m.name == h.head;
});
if (s.length > 0) {
@ -968,7 +974,7 @@ var _default = {
},
//切换btn的限制 写入停止后j*100毫秒调取函数
delayTimerBtn: function delayTimerBtn(i, data) {
var _this2 = this;
var _this3 = this;
var that = this;
//整体接口
var j = 10;
@ -978,7 +984,7 @@ var _default = {
++i;
if (i == j) {
that.changeData(data);
clearInterval(_this2.timer);
clearInterval(_this3.timer);
}
}, 100);
},
@ -997,36 +1003,36 @@ var _default = {
},
// 读取所有寄存器的状态值
dataInit: function dataInit() {
var _this3 = this;
var _this4 = this;
var deviceId = this.deviceId;
this.$http({
url: this.api.getcontrol_cpermission + '?deviceId=' + deviceId,
method: 'POST'
}).then(function (res) {
res.data.forEach(function (el, index) {
_this3.purviewList.push(el.id.toString());
_this4.purviewList.push(el.id.toString());
});
//查看金华权限
if (_this3.purviewList.indexOf('10') != -1) {
if (_this4.purviewList.indexOf('10') != -1) {
// 小程序手机控制权限数据
_this3.getcontrol_wxgetpermission();
_this3.$http({
url: _this3.api.readJinHuaControl_reg + '?deviceId=' + deviceId,
_this4.getcontrol_wxgetpermission();
_this4.$http({
url: _this4.api.readJinHuaControl_reg + '?deviceId=' + deviceId,
method: 'POST'
}).then(function (res) {
// console.log(res, 'deviceId读取所有寄存器的状态值');
if (res.code == 200) {
uni.hideLoading();
uni.stopPullDownRefresh();
_this3.inputData = res.data;
for (var i = 0; i < _this3.itemList.length; i++) {
if (!_this3.itemList[i].type_2) {
_this3.itemList[i].open_value = _this3.inputData[Number('21681') + i * 3];
_this3.itemList[i].close_value = _this3.inputData[Number('21682') + i * 3];
_this3.getType(21680 + i * 3, 1);
_this4.inputData = res.data;
for (var i = 0; i < _this4.itemList.length; i++) {
if (!_this4.itemList[i].type_2) {
_this4.itemList[i].open_value = _this4.inputData[Number('21681') + i * 3];
_this4.itemList[i].close_value = _this4.inputData[Number('21682') + i * 3];
_this4.getType(21680 + i * 3, 1);
} else {
_this3.itemList[i].value = _this3.inputData[21711 + (i - 10) * 2];
_this3.getType(21710 + (i - 10) * 2, 2);
_this4.itemList[i].value = _this4.inputData[21711 + (i - 10) * 2];
_this4.getType(21710 + (i - 10) * 2, 2);
}
}
@ -1039,32 +1045,32 @@ var _default = {
});
}
//查看丽水权限
if (_this3.purviewList.indexOf('9') != -1) {
_this3.getControl_getState();
_this3.getReadControlliShuiControl();
clearInterval(_this3.statusInterval) && _this3.statusInterval;
_this3.statusInterval = setInterval(function () {
_this3.getControl_getState();
if (_this4.purviewList.indexOf('9') != -1) {
_this4.getControl_getState();
_this4.getReadControlliShuiControl();
clearInterval(_this4.statusInterval) && _this4.statusInterval;
_this4.statusInterval = setInterval(function () {
_this4.getControl_getState();
}, 3000);
}
// 查看五防项目权限
if (_this3.purviewList.indexOf('8') != -1) {
_this3.$http({
url: _this3.api.readControl_fiveControl + '?deviceId=' + deviceId,
if (_this4.purviewList.indexOf('8') != -1) {
_this4.$http({
url: _this4.api.readControl_fiveControl + '?deviceId=' + deviceId,
method: 'GET'
}).then(function (res) {
if (res.code == 200) {
uni.hideLoading();
uni.stopPullDownRefresh();
_this3.fiveControl = res.data;
_this4.fiveControl = res.data;
}
});
}
});
},
getReadControlliShuiControl: function getReadControlliShuiControl() {
var _this4 = this;
var _this5 = this;
var data = {
deviceId: this.deviceId
};
@ -1073,24 +1079,24 @@ var _default = {
data: data,
method: 'GET'
}).then(function (res) {
_this4.inputData2 = res.data;
_this4.openIndex = _this4.inputData2[21600];
_this4.getAct21601();
_this5.inputData2 = res.data;
_this5.openIndex = _this5.inputData2[21600];
_this5.getAct21601();
});
},
getAct21601: function getAct21601() {
var _this5 = this;
var _this6 = this;
this.actList1 = [];
var num = this.inputData2['21601'];
var num1 = this.padString(num.toString(2), 5);
var openListNew = [];
openListNew = num1.split("");
openListNew.forEach(function (el, index) {
_this5.actList1.push(openListNew[openListNew.length - index - 1]);
_this6.actList1.push(openListNew[openListNew.length - index - 1]);
});
},
getControl_getState: function getControl_getState() {
var _this6 = this;
var _this7 = this;
var data = {
deviceId: this.deviceId
};
@ -1100,14 +1106,14 @@ var _default = {
method: 'GET'
}).then(function (res) {
if (res.code == 200) {
_this6.fanStatus.open = res.data['1023'];
_this6.fanStatus.status = [];
_this7.fanStatus.open = res.data['1023'];
_this7.fanStatus.status = [];
var num = res.data['1024'];
var num1 = _this6.padString(num.toString(2), 5);
var num1 = _this7.padString(num.toString(2), 5);
var openListNew = [];
openListNew = num1.split("");
_this6.fanStatus.status = openListNew.reverse();
_this6.statusList = [];
_this7.fanStatus.status = openListNew.reverse();
_this7.statusList = [];
for (var i = 0; i < 4; i++) {
var statusData = {
name: "\u9876\u5377\u819C".concat(i + 1),
@ -1115,11 +1121,11 @@ var _default = {
progress: res.data[1027 + i * 3],
index: res.data[1026 + i * 3]
};
_this6.statusList.push(statusData);
_this7.statusList.push(statusData);
}
// 五防项目状态
_this6.fiveControlList.forEach(function (el) {
_this7.fiveControlList.forEach(function (el) {
el.controlState = res.data[el.num];
if (el.progress_num) {
el.progress = res.data[el.progress_num];
@ -1275,7 +1281,7 @@ var _default = {
this.delayTimer(0, data);
},
delayTimer: function delayTimer(i, data) {
var _this7 = this;
var _this8 = this;
var that = this;
//整体接口
var j = 5;
@ -1285,12 +1291,12 @@ var _default = {
++i;
if (i == j) {
that.changeData(data);
clearInterval(_this7.timer);
clearInterval(_this8.timer);
}
}, 100);
},
changeData: function changeData(data) {
var _this8 = this;
var _this9 = this;
var that = this;
this.$http({
url: this.api.writeJinHuaControl_write,
@ -1302,7 +1308,7 @@ var _default = {
title: res.msg,
icon: "success"
});
_this8.dataInit();
_this9.dataInit();
} else {
uni.showToast({
title: "失败!",

File diff suppressed because one or more lines are too long

View File

@ -8,7 +8,7 @@
"urlCheck": false,
"es6": false,
"postcss": false,
"minified": false,
"minified": true,
"newFeature": true,
"bigPackageSizeSupport": true,
"ignoreUploadUnusedFiles": true,
@ -22,24 +22,7 @@
"libVersion": "3.2.0",
"appid": "wx05b45a2699f02a2b",
"projectname": "greenhouse-wisdom-applet",
"condition": {
"search": {
"current": -1,
"list": []
},
"conversation": {
"current": -1,
"list": []
},
"game": {
"current": -1,
"list": []
},
"miniprogram": {
"current": -1,
"list": []
}
},
"condition": {},
"editorSetting": {
"tabIndent": "insertSpaces",
"tabSize": 4

View File

@ -3,18 +3,5 @@
"projectname": "wszhyWx",
"setting": {
"compileHotReLoad": true
},
"condition": {
"miniprogram": {
"list": [
{
"name": "",
"pathName": "pages/controller/controller",
"query": "id=2023042214250018",
"launchMode": "default",
"scene": null
}
]
}
}
}