你这两个数据结构就不合理,关联性极差,就算合成估计也会有数据错乱
一维数组循环按条件合并给二维数组的问题,逻辑实在想不通了,请教各位大神?//数组1 var sensorList:[ {"id":10000,"category": "sensor","name": "温度","value": "1"}, {"id":10001,"category": "sensor","name": "湿度","value": "2"}, {"id":10002,"category": "sensor","name": "气压","value": "3"}, {"id":10003,"category": "sensor","name": "光照","value": "4"}, {"id":10004,"category": "sensor","name": "风速","value": "5"}, {"id":10005,"category": "sensor","name": "雨量","value": "6"}, {"id":10006,"category": "sensor","name": "PM2.5","value": "20"}, {"id":10007,"category": "sensor","name": "PM10","value": "21"}, {"id":10008,"category": "sensor","name": "风向","value": "37"}, {"id":10009,"category": "sensor","name": "风向","value": "38"}, {"id":10000,"category": "sensorUnit","name": "℃","value": "1"}, {"id":10101,"category": "sensorUnit","name": "%","value": "2"}, {"id":10102,"category": "sensorUnit","name": "kPa","value": "3"}, {"id":10103,"category": "sensorUnit","name": "kLux","value": "4"}, {"id":10104,"category": "sensorUnit","name": "m/s","value": "5"}, {"id":10105,"category": "sensorUnit","name": "mm/h","value": "6"}, {"id":10106,"category": "sensorUnit","name": "ug/m3","value": "20"}, {"id":10107,"category": "sensorUnit","name": "ug/m3","value": "21"}, {"id":10108,"category": "sensorUnit","name": "°","value": "37"}, {"id":10109,"category": "sensorUnit","name": "","value": "38"}, {"id":10002,"category": "windDir","name": "北","value": "16"}, {"id":10003,"category": "windDir","name": "北偏东","value": "1"}, {"id":10004,"category": "windDir","name": "东北","value": "2"}, {"id":10005,"category": "windDir","name": "东偏北","value": "3"}, {"id":10006,"category": "windDir","name": "东","value": "4"}, {"id":10007,"category": "windDir","name": "东偏南","value": "5"}, {"id":10008,"category": "windDir","name": "东南","value": "6"}, {"id":10009,"category": "windDir","name": "南偏东","value": "7"}, {"id":10000,"category": "windDir","name": "南","value": "8"}, {"id":10101,"category": "windDir","name": "南偏西","value": "9"}, {"id":10102,"category": "windDir","name": "西南","value": "10"}, {"id":10103,"category": "windDir","name": "西偏南","value": "11"}, {"id":10104,"category": "windDir","name": "西","value": "12"}, {"id":10105,"category": "windDir","name": "西偏北","value": "13"}, {"id":10106,"category": "windDir","name": "西北","value": "14"}, {"id":10107,"category": "windDir","name": "北偏西","value": "15"}, {"id":10108,"category": "windDir","name": "静风","value": "17"}, {"id":10109,"category": "windDir","name": "静风","value": "18"} ], //数组2 var monitorList:[ { id: 10001382, name: "测试01", listsensor:[ {monitorid:10001382,sensorid:1,value: 11.1}, {monitorid:10001382,sensorid:2,value: 22.2}, {monitorid:10001382,sensorid:37,value: 180}, {monitorid:10001382,sensorid:38,value: 2} ]}, { id: 10001383, name: "测试02", listsensor:[ {monitorid:10001383,sensorid:3,value: 11.1}, {monitorid:10001383,sensorid:4,value: 22.2}, {monitorid:10001383,sensorid:37,value: 180}, {monitorid:10001383,sensorid:38,value: 2} ]} ] //需求结果 /* newList:[ {id: 10001382,name: "测试01",listsensor:[ {monitorid:10001382,sensorid:1,value: 11.1,name:"温度",unit:"℃"}, {monitorid:10001382,sensorid:2,value: 22.2,name:"湿度",unit:"%"}, {monitorid:10001382,sensorid:37,value: 180,name:"风向",unit:"°"}, {monitorid:10001382,sensorid:38,value: 4,name:"风向",unit:"东"} ]}, {id: 10001383,name: "测试02",listsensor:[ {monitorid:10001383,sensorid:3,value: 11.1,name:"气压",unit:"kPA"}, {monitorid:10001383,sensorid:4,value: 22.2,name:"光照",unit:"kLux"}, {monitorid:10001383,sensorid:37,value: 180,name:"风向",unit:"°"}, {monitorid:10001383,sensorid:38,value: 2,name:"风向",unit:"东北"} ]} ] */
2022-04-11看下res.errMsg的提示是什么
调用wx.login总是进入错误回调wx.login在微信开发者工具和真机调试模式下都能正常走成功回调 在预览和体验版下,无论怎样都是走的失败回调 [图片] [图片]
2018-12-25502不是服务器无响应么和小程序没啥关系吧
调用线上https接口报502我们在接口联调时,调用线上环境的https 接口时,报 502 错误。 我们已经在微信公众平台配置 后端接口 域名了。 小程序还没有发布,现在属于测试阶段(也就是想调试线上环境接口,调试通过以后就提交审核并发布) 这是怎么回事啊,各路大神,帮帮忙呀、、
2018-08-09这种情况我们改如何处理
提供的资质文件主体名称需与小程序注册主体名称保持一致[图片] 新闻许可证已经提交,主体法人是同一人,小程序主体名称指的是什么
2018-08-09