Forecast.vue 29 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058
  1. <template>
  2. <view class="content">
  3. <!-- <third-comp :key="menuKey"></third-comp> -->
  4. <view v-if="toggleSwitch==false">
  5. <view>
  6. <cu-custom bgColor="bg-blacks" :isBack="false">
  7. <block slot="right"><image src="../../static/picture/fourLine.png" style="width: 30px;height: 30px;margin-left: 2%;" @tap="openDrawer"></image></block>
  8. <block slot="right">
  9. <view class="icon cuIcon-notice text-white" v-if="badge != 0" style="margin-left: -70%;">
  10. <view class="cu-tag looknumber" style="margin-top: -2%;">
  11. <block v-if="badge != 1">{{ badge > 99 ? '99+' : badge }}</block>
  12. </view>
  13. </view>
  14. </block>
  15. <block slot="right"></block>
  16. <block slot="content">{{ address }}</block>
  17. <block slot="right"><view class="plus" @tap="showModal" data-target="viewModal">+</view></block>
  18. <!-- <block slot="right"><view class="plus" @tap="showModal" data-target="viewModal">+</view></block> -->
  19. </cu-custom>
  20. </view>
  21. <!-- 抽屉组件 -->
  22. <!-- 地图组件 -->
  23. <div>
  24. <drawer ref="drawer" @tap="closeDrawer"></drawer>
  25. </div>
  26. <div class="plusDrawer" @tap="hideModal">
  27. <plusDrawer ref="plusDrawer"></plusDrawer>
  28. </div>
  29. <view v-if="kg==true">
  30. <!-- <div class="plusDrawer" @tap="hideModal"><plusDrawer ref="plusDrawer"></plusDrawer></div> -->
  31. <view class="page-body">
  32. <view class="page-section page-section-gap">
  33. <map style="width: 100%; height: 300px;"
  34. :controls="controls"
  35. :circles="circles"
  36. :polyline="polyline"
  37. :scale="scale"
  38. :latitude="latitude"
  39. :longitude="longitude"
  40. :markers="covers"
  41. >
  42. <cover-view style="color: #000000;" > 经度:{{ mapEnd_1 }}</cover-view>
  43. <cover-view style="color: #000000;"> 纬度:{{ mapEnd_2 }}</cover-view>
  44. </map>
  45. </view>
  46. </view>
  47. </view>
  48. <!--经纬度组件-->
  49. <!-- <view class="InformationCard">
  50. <view class="informationCardAll">
  51. <view class="informationCardTextOne">
  52. <view class="informationCardText">
  53. <view class="textSilver">经度:</view>
  54. <view class="textWhite">{{ mapEnd_1 }}</view>
  55. </view>
  56. </view>
  57. <view class="informationCardTextOne">
  58. <view class="informationCardText">
  59. <view class="textSilver">纬度:</view>
  60. <view class="textWhite">{{ mapEnd_2 }}</view>
  61. </view>
  62. </view>
  63. </view>
  64. </view> -->
  65. <scroll-view @tap="hideModal" scroll-y class="DrawerPage" :class="modalName == 'viewModal' ? 'show' : ''">
  66. <!-- 个人信息组件 -->
  67. <view class="Personal_information_W">
  68. <view class="name">姓名:李占国</view>
  69. <view class="history" @click="mapDate"> <span class="navigation"></span> </view>
  70. <view class="skills">技能:电力类,机械类</view>
  71. </view>
  72. <!-- 历史曲线组件 -->
  73. <view class="curve" >
  74. <view class="curve_l">健康情况</view>
  75. <view class="curve_r" @tap="common.navTo('/components/bracelet/braceletHistoryCurve?braceletCurve=' + braceletCurve)">历史曲线</view>
  76. <div class="greater"></div>
  77. </view>
  78. <!-- 健康详情组件 -->
  79. <view class="healthy" >
  80. <view class="healthy_H">
  81. <view class="details_z">心跳频率:{{xtpl_computed}}<!-- ({{ bracelet[deviceName][targetName_xtpl][targetName_xtpl_size].value }}) --></view>
  82. <view class="details_m">步数:{{bs_computed}}</view>
  83. <view class="details_y">收缩血压:{{ssxy_computed}}</view>
  84. </view>
  85. <view class="healthy_N">
  86. <view class="details_z">舒张血压:{{szxy_computed}}<!-- ({{ bracelet[deviceName][targetName_szxy][targetName_szxy_size].value }}) --></view>
  87. <view class="details_m">疲劳度:{{pld_computed}}<!-- ({{ bracelet[deviceName][targetName_pld][targetName_pld_size].value }}) --></view>
  88. <view class="details_y">血氧浓度:{{xynd_computed}}<!-- ({{ bracelet[deviceName][targetName_xynd][targetName_xynd_size].value }}) --></view>
  89. </view>
  90. </view>
  91. </scroll-view>
  92. </view>
  93. <view v-if="toggleSwitch==true">
  94. <WeatherProphethomepage ref="r1"></WeatherProphethomepage>
  95. </view>
  96. <!-- <view class="DrawerClose" :class="modalName == 'viewModal' ? 'show' : ''" @tap="hideModal"><text class="cuIcon-pullright"></text></view> -->
  97. </view>
  98. </template>
  99. <script>
  100. import res from '../../common/data.json';
  101. import drawer from '../../components/drawer/threeLineDrawer.vue';
  102. import plusDrawer from '../../components/drawer/plusDrawer.vue';
  103. import WeatherProphethomepage from '../../components/weatherProphethomepage/WeatherProphethomepage.vue';
  104. var _self;
  105. export default {
  106. components: {
  107. drawer: drawer,
  108. plusDrawer: plusDrawer,
  109. WeatherProphethomepage:WeatherProphethomepage
  110. },
  111. data: function() {
  112. return {
  113. kg:true,
  114. leftNavigationtitle:'预测功能分组',
  115. leftbarkg:false,
  116. bs_computed:'',
  117. xtpl_computed:'',
  118. ssxy_computed:'',
  119. szxy_computed:'',
  120. pld_computed:'',
  121. xynd_computed:'',
  122. WeatherProphethomepagebool:true,
  123. toggleSwitch:false,
  124. menuKey:1,
  125. pointKey: 'MHSFCJSFW.NX_GD_MHSF_XX_XX_XXX_XXX_CI0087',
  126. socketTask_bracelet: '',
  127. socketTask_close_bracelet: '',
  128. deviceName: 'Y1-A0BC',
  129. deviceNamePld: 'Y1-A0BC_PLD',
  130. deviceNameBs: 'Y1-A0BC_BS',
  131. deviceNameSsxy: 'Y1-A0BC_SSXY',
  132. deviceNameXtpl: 'Y1-A0BC_XTPL',
  133. deviceNameXynd: 'Y1-A0BC_XYND',
  134. deviceNameSzxy: 'Y1-A0BC_SZXY',
  135. deviceNameLng: 'Y1-A0BC_LNG',
  136. deviceNameLat: 'Y1-A0BC_LAT',
  137. bracelet: {
  138. deviceName: '',
  139. deviceNamePld: '',
  140. deviceNameBs: '',
  141. deviceNameSsxy: '',
  142. deviceNameXtpl: '',
  143. deviceNameXynd: '',
  144. deviceNameSzxy: '',
  145. },
  146. braceletCurve: {},
  147. mapBegin_1:'',
  148. mapEnd_1:'',
  149. mapBegin_2:'',
  150. mapEnd_2:'',
  151. points:[
  152. {
  153. latitude:'',
  154. longitude:''
  155. },
  156. {
  157. latitude:'',
  158. longitude:''
  159. }
  160. ],
  161. list:{},
  162. braceletCurve_SSXY: [],
  163. braceletCurve_PLD: [],
  164. braceletCurve_SZXY: [],
  165. braceletCurve_XTPL: [],
  166. braceletCurve_BS: [],
  167. braceletCurve_XYND: [],
  168. braceletCurve_LNG: [],
  169. braceletCurve_LAT: [],
  170. /* targetdetail_visable: { targetdetail_target: true, targetdetail_curve: true, targetdetail_histogram: true},
  171. targetdetail: { targetdetail_target: '', targetdetail_curve: '', targetdetail_histogram: ''}, */
  172. targetName: '日发电量',
  173. targetUnit: '万kwh',
  174. bool:true,
  175. pld: '',
  176. ssxy: '',
  177. lng: '',
  178. szxy: '',
  179. lat: '',
  180. xtpl: '',
  181. bs: '',
  182. xynd: '',
  183. device_nam: '',
  184. title: 'map',
  185. latitude: 39.907,//定位中心
  186. longitude: 116.39742,//
  187. covers: [
  188. {
  189. latitude:39.909 , //纬度坐标点
  190. longitude:116.39742 , //经度
  191. iconPath: '../../static/picture/forcast/DingWei.png', //显示的图标
  192. title: '阿打算', //标注点名
  193. label: {
  194. //为标记点旁边增加标签
  195. content: '', //文本1
  196. color: '#F76350', //文本颜色
  197. anchorX: 0, //label的坐标,原点是 marker 对应的经纬度
  198. anchorY: -80, //label的坐标,原点是 marker 对应的经纬度
  199. // x:39.909,//这个组件微信在1.2.0以后就废弃了
  200. // y:116.39742,
  201. bgColor: '#fff', //背景色
  202. padding: 5, //文本边缘留白
  203. borderWidth: 1, //边框宽度
  204. borderColor: '#D84C29', //边框颜色
  205. textAlign: 'right' //文本对齐方式。
  206. },
  207. callout: {
  208. //自定义标记点上方的气泡窗口 点击有效
  209. content: '地点1',
  210. color: '#F76350',
  211. fontSize: 12,
  212. borderRadius: 5
  213. }
  214. // anchor:{//经纬度在标注图标的锚点,默认底边中点
  215. // x:5,
  216. // y:1,
  217. // }
  218. } , {
  219. latitude:39.90 ,//最后点
  220. longitude: 116.399,//
  221. iconPath: '../../static/picture/forcast/DingWei.png',
  222. title:'阿迪达斯',
  223. x:'',//
  224. y: '',//116.399
  225. label:{
  226. content:'',
  227. color:'#F76350',
  228. bgColor:'#fff',
  229. padding:5,
  230. borderRadius:4,
  231. },
  232. callout:{
  233. content:'地点2',
  234. color:'#F76350',
  235. fontSize:12
  236. }
  237. }
  238. ],
  239. scale: 15, //地图层级
  240. controls: [
  241. {
  242. //在地图上显示控件,控件不随着地图移动
  243. id: 1, //控件id
  244. /* iconPath: '../../static/picture/forcast/DingWei.png', *///显示的图标
  245. position: {
  246. //控件在地图的位置
  247. left: 15,
  248. top: 15,
  249. width: 40,
  250. height: 40
  251. }
  252. }
  253. ],
  254. circles: [
  255. {
  256. //在地图上显示圆
  257. latitude: 39.9,
  258. longitude: 116.39,
  259. fillColor: '#FFC41F', //填充颜色
  260. color: '#12A1DD', //描边的颜色
  261. radius: 0, //半径
  262. strokeWidth: 2 //描边的宽度
  263. }
  264. ],
  265. polyline: [
  266. { /* .polyline[0].points */
  267. points:[{}],
  268. //指定一系列坐标点,从数组第一项连线至最后一项
  269. /* points: [{ latitude:this.mapBegin_1, longitude:this.mapBegin_2 }, { latitude: this.mapEnd_1, longitude:this.mapEnd_2 }], */
  270. /* points: [{ latitude: 0, longitude: 0 }, { latitude: 0, longitude: 0 }], */
  271. color: '#0000AA', //线的颜色
  272. width: 2, //线的宽度
  273. dottedLine: true, //是否虚线
  274. arrowLine: true //带箭头的线 开发者工具暂不支持该属性
  275. }
  276. ],
  277. badge: 22,
  278. inconList: ['form', 'favor', 'question', 'edit'],
  279. modalName: null,
  280. address: '',
  281. drawerList: [],
  282. plusDrawerList: [],
  283. permissionsInformation:[]
  284. };
  285. },
  286. mounted() {
  287. //document.querySelector('body').setAttribute('style', 'background-color:#000000');
  288. },
  289. created: function() {
  290. // this.pushWindPowerStationNameToSessionStorage("麻黄山");
  291. this.viewUserid();
  292. this.monitoringAuthority();
  293. this.address = this.dataprocessing.getWindPowerStationName();
  294. this.FDC=this.dataprocessing.getWindPowerStationId();
  295. this.windPowerStationId =this.dataprocessing.getWindPowerStationId();
  296. this.$nextTick(function() {
  297. //this.getWeatherDataToday();
  298. //this.getWeatherData7();
  299. });
  300. this.cWidth = uni.upx2px(2000);
  301. this.cHeight = uni.upx2px(350);
  302. this.cWidth40 = uni.upx2px(5000);
  303. this.cHeight40 = uni.upx2px(350);
  304. this.windStation =this.dataprocessing.getWindPowerStationNameByNames(this.address);
  305. this.windStationName = this.windStation[0].replace('风电场', '');
  306. },
  307. onLoad(pointKey) {
  308. let _this = this;
  309. this.pointKey = pointKey.pointKey;
  310. this.targetName = pointKey.callTargetName;
  311. this.targetUnit = pointKey.callTargetUnit;
  312. this.braceletData();
  313. /* console.log(_this.bracelet[_this.deviceName]);
  314. console.log(_this.bracelet[_this.deviceName][_this.targetName_pld][0]); */
  315. /* uni.getLocation({//获取当前的位置坐标
  316. type: 'wgs84',
  317. success: function (res) {
  318. console.log('当前位置的经度:' + res.longitude);
  319. console.log('当前位置的纬度:' + res.latitude);
  320. }
  321. }); */
  322. },
  323. onReady() {},
  324. computed: {
  325. targetName_xtpl: function() {
  326. return this.deviceName + '_XTPL';
  327. },
  328. targetName_xtpl_size: function() {
  329. return this.bracelet[this.deviceName][this.targetName_xtpl].length - 1;
  330. },
  331. targetName_pld: function() {
  332. return this.deviceName + '_PLD';
  333. },
  334. targetName_pld_size: function() {
  335. return this.bracelet[this.deviceName][this.targetName_pld].length - 1;
  336. },
  337. targetName_bs: function() {
  338. return this.deviceName + '_BS';
  339. },
  340. targetName_bs_size: function() {
  341. return this.bracelet[this.deviceName][this.targetName_bs].length - 1;
  342. },
  343. targetName_ssxy: function() {
  344. return this.deviceName + '_SSXY';
  345. },
  346. targetName_ssxy_size: function() {
  347. return this.bracelet[this.deviceName][this.targetName_ssxy].length - 1;
  348. },
  349. targetName_szxy: function() {
  350. return this.deviceName + '_SZXY';
  351. },
  352. targetName_szxy_size: function() {
  353. return this.bracelet[this.deviceName][this.targetName_szxy].length - 1;
  354. },
  355. targetName_xynd: function() {
  356. return this.deviceName + '_XYND';
  357. },
  358. targetName_xynd_size: function() {
  359. return this.bracelet[this.deviceName][this.targetName_xynd].length - 1;
  360. },
  361. backStageIp: function() {
  362. return this.$store.state.wholeSituationBackStageIp;
  363. },
  364. backStagePort: function() {
  365. return this.$store.state.wholeSituationBackStagePort;
  366. },
  367. windpowerstationNameToId: function() {
  368. return this.$store.state.windpowerstationNameToId;
  369. }
  370. },
  371. methods: {
  372. viewUserid:function(){
  373. let _this = this;
  374. _this.userid =uni.getStorageSync('userid')
  375. //_this.userid = sessionStorage.getItem('userid');
  376. uni.request({
  377. url: 'http://' + this.backStageIp + ':' + this.backStagePort + '/GyeeorganController/GyeeOrganList?userid=' + _this.userid,
  378. data: {},
  379. method: 'GET',
  380. success: function(res) {
  381. for(let i=0;i<res.data.data.length;i++){
  382. // _this.name.push(res.data.data[i].describes);
  383. // _this.windId.push(res.data.data[i].name);
  384. }
  385. for(let j=0;j<res.data.data.length;j++){
  386. var a = {};
  387. _this.$set(a,"name",res.data.data[j].describes);
  388. _this.$set(a,"windId",res.data.data[j].name);
  389. _this.plusDrawerList.push(a);
  390. }
  391. },
  392. })
  393. },
  394. monitoringAuthority:function(){
  395. let _this = this;
  396. uni.request({
  397. url: 'http://' + this.backStageIp + ':' + this.backStagePort +
  398. '/GyeepermissionController/GyeePermissionList?userid=' + _this.userid,
  399. data: {},
  400. method: 'GET',
  401. success: function(res) {
  402. console.log(res);
  403. for (let i = 0; i < res.data.data.length; i++) {
  404. if (res.data.data[i].describes == "预测") {
  405. var b = {};
  406. _this.$set(b, "gyeePermissionList", res.data.data[i].gyeePermissionList);
  407. _this.permissionsInformation.push(b);
  408. console.log(_this.permissionsInformation);
  409. for (let k = 0; k < _this.permissionsInformation[0].gyeePermissionList.length; k++) {
  410. if (_this.permissionsInformation[0].gyeePermissionList[k].parent == 3) {
  411. var c = {};
  412. var d = {};
  413. _this.$set(c, "name", _this.permissionsInformation[0].gyeePermissionList[k].permisssionname);
  414. _this.$set(c, "remark1",_this.permissionsInformation[0].gyeePermissionList[k].remark1);
  415. _this.drawerList.push(c);
  416. }
  417. }
  418. console.log(_this.drawerList)
  419. }
  420. }
  421. }
  422. })
  423. },
  424. mapDate(){
  425. if(this.bool){
  426. this.$delete(this.polyline[0],'points');
  427. this.braceletCurve_LNG = this.bracelet[this.deviceName][this.deviceNameLng];
  428. this.braceletCurve_LAT = this.bracelet[this.deviceName][this.deviceNameLat];
  429. this.points[0].longitude=this.bracelet[this.deviceName][this.deviceNameLng][0].value;
  430. this.points[0].latitude=this.bracelet[this.deviceName][this.deviceNameLat][0].value;
  431. this.points[1].longitude=this.bracelet[this.deviceName][this.deviceNameLng][this.braceletCurve_LNG.length-1].value;
  432. this.points[1].latitude=this.bracelet[this.deviceName][this.deviceNameLat][this.braceletCurve_LAT.length-1].value;
  433. for(let val of this.polyline){
  434. this.$set(val,'points',this.points);
  435. this.bool = false;
  436. console.log("true");
  437. }
  438. /* 定义地图经纬度中心 */
  439. var lat= parseFloat(this.mapBegin_2)+parseFloat(this.mapEnd_2);
  440. var lng= parseFloat(this.mapBegin_1)+parseFloat(this.mapEnd_1);
  441. this.latitude = lat/2;
  442. this.longitude = lng/2;
  443. }else{
  444. /* this.braceletCurve_LNG = this.bracelet[this.deviceName][this.deviceNameLng];
  445. this.braceletCurve_LAT = this.bracelet[this.deviceName][this.deviceNameLat];
  446. this.points[0].longitude=this.bracelet[this.deviceName][this.deviceNameLng][0].value;
  447. this.points[0].latitude=this.bracelet[this.deviceName][this.deviceNameLat][0].value;
  448. this.points[1].longitude=this.bracelet[this.deviceName][this.deviceNameLng][this.braceletCurve_LNG.length-1].value;
  449. this.points[1].latitude=this.bracelet[this.deviceName][this.deviceNameLat][this.braceletCurve_LAT.length-1].value;
  450. */
  451. this.$delete(this.polyline[0],'points');
  452. /* this.latitude = this.mapBegin_2+this.mapEnd_2/2;
  453. this.longitude = this.mapBegin_1+this.mapEnd_1/2; */
  454. console.log("false");
  455. /* 还原定位中心位置 */
  456. this.latitude = this.mapBegin_2;
  457. this.longitude = this.mapBegin_1;
  458. this.bool = true;
  459. }
  460. this.$forceUpdate();
  461. },
  462. openDrawer: function() {
  463. this.kg=false;
  464. this.$refs.drawer.openDrawer(250, this.drawerList, this.inconList,this.leftNavigationtitle);
  465. },
  466. closeDrawer: function() {
  467. this.drawerIsShow = false;
  468. },
  469. pushWindPowerStationNameToSessionStorage(windpowerstationName) {
  470. uni.setStorageSync('windpowerstationName', windpowerstationName);
  471. //sessionStorage.setItem('windpowerstationName', windpowerstationName);
  472. //alert("v"+ sessionStorage.getItem("windpowerstationName"));
  473. //this.common.goback('/pages/index/Index');
  474. },
  475. getWindPowerStationNameToSessionStorage() {
  476. uni.getStorageSync('windpowerstationName');
  477. return uni.getStorageSync('windpowerstationName');
  478. },
  479. leftbar(){
  480. this.kg=true;
  481. },
  482. onHide() {
  483. this.$refs.drawer.closeDrawer();
  484. this.hideModal();
  485. },
  486. onShow() {
  487. this.windPowerStationId = uni.getStorageSync('windPowerStationId');
  488. this.address = this.getWindPowerStationNameToSessionStorage();
  489. },
  490. showModal(e) {
  491. this.kg=false;
  492. this.modalName = e.currentTarget.dataset.target;
  493. this.$refs.plusDrawer.showModal(this.plusDrawerList, this.modalName);
  494. },
  495. hideModal() {
  496. this.leftbar();
  497. this.modalName = null;
  498. //this.$refs.plusDrawer.hideModal(this.modalName);
  499. },
  500. braceletData() {
  501. let _this = this;
  502. let ip;
  503. uni.request({
  504. url: 'http://' + _this.backStageIp + ':' + _this.backStagePort + '/bracelet/bracelet?beginDate=2020-04-20 09:26:27&&endDate=2020-04-25 09:26:29',
  505. success: res => {
  506. ip = res.data;
  507. }
  508. });
  509. // 创建一个this.socketTask对象【发送、接收、关闭socket都由这个对象操作】
  510. this.socketTask_bracelet = uni.connectSocket({
  511. /* 【非常重要】必须确保你的服务器是成功的,如果是手机测试千万别使用ws://127.0.0.1:9099【特别容易犯的错误】 */
  512. url: 'ws://' + _this.backStageIp + ':' + _this.backStagePort + '/websocket/pageNumber_9/functionNumber_1',
  513. success(data) {
  514. console.log('websocket连接成功');
  515. }
  516. });
  517. // 消息的发送和接收必须在正常连接打开中,才能发送或接收【否则会失败】
  518. this.socketTask_bracelet.onOpen(res => {
  519. console.log('WebSocket连接正常打开中...!');
  520. _this.is_open_socket = true;
  521. // 注:只有连接正常打开中 ,才能正常收到消息
  522. _this.socketTask_bracelet.onMessage(res => {
  523. //console.log("收到服务器内容:" + res.data);
  524. _this.bracelet = JSON.parse(res.data)[ip];
  525. _this.braceletCurve = JSON.stringify(_this.bracelet[_this.deviceName]);
  526. /* 获取起始经纬度 */
  527. _this.braceletCurve_LNG = _this.bracelet[_this.deviceName][_this.deviceNameLng];
  528. _this.braceletCurve_LAT = _this.bracelet[_this.deviceName][_this.deviceNameLat];
  529. _this.mapBegin_1 = (_this.bracelet[_this.deviceName][_this.deviceNameLng][0].value);
  530. _this.mapBegin_2 = (_this.bracelet[_this.deviceName][_this.deviceNameLat][0].value);
  531. _this.mapEnd_1 = (_this.bracelet[_this.deviceName][_this.deviceNameLng][_this.braceletCurve_LNG.length-1].value);
  532. _this.mapEnd_2 = (_this.bracelet[_this.deviceName][_this.deviceNameLat][_this.braceletCurve_LAT.length-1].value);
  533. _this.latitude = _this.mapBegin_2;
  534. _this.longitude = _this.mapBegin_1;
  535. _this.covers[0].latitude = _this.mapBegin_2;
  536. _this.covers[0].longitude = _this.mapBegin_1;
  537. _this.covers[1].latitude = _this.mapEnd_2;
  538. _this.covers[1].longitude = _this.mapEnd_1;
  539. _this.bs_computed = _this.bracelet[_this.deviceName][_this.targetName_bs][_this.targetName_bs_size].value;
  540. _this.xtpl_computed = _this.bracelet[_this.deviceName][_this.targetName_xtpl][_this.targetName_xtpl_size].value;
  541. _this.ssxy_computed = _this.bracelet[_this.deviceName][_this.targetName_ssxy][_this.targetName_ssxy_size].value;
  542. _this.szxy_computed = _this.bracelet[_this.deviceName][_this.targetName_szxy][_this.targetName_szxy_size].value;
  543. _this.pld_computed = _this.bracelet[_this.deviceName][_this.targetName_pld][_this.targetName_pld_size].value;
  544. _this.xynd_computed = _this.bracelet[_this.deviceName][_this.targetName_xynd][_this.targetName_xynd_size].value;
  545. /* this.braceletCurve_LNG = this.bracelet[this.deviceName][this.deviceNameLng];
  546. this.braceletCurve_LAT = this.bracelet[this.deviceName][this.deviceNameLat];
  547. this.points[0].longitude=this.bracelet[this.deviceName][this.deviceNameLng][0].value;
  548. this.points[0].latitude=this.bracelet[this.deviceName][this.deviceNameLat][0].value;
  549. this.points[1].longitude=this.bracelet[this.deviceName][this.deviceNameLng][this.braceletCurve_LNG.length-1].value;
  550. this.points[1].latitude=this.bracelet[this.deviceName][this.deviceNameLat][this.braceletCurve_LAT.length-1].value; */
  551. /* _this.mapDate(); */
  552. /* _this.polyline[0].points[0].latitude=_this.mapBegin_2;
  553. _this.polyline[0].points[0].longitude=_this.mapBegin_1;
  554. _this.polyline[0].points[1].latitude=_this.mapEnd_2;
  555. _this.polyline[0].points[1].longitude=_this.mapEnd_1; */
  556. /* _this.braceletCurve_SSXY = _this.bracelet[_this.deviceName][_this.deviceNameSsxy];
  557. _this.braceletCurve_SZXY = _this.bracelet[_this.deviceName][_this.deviceNameSzxy];
  558. _this.braceletCurve_XYND = _this.bracelet[_this.deviceName][_this.deviceNameXynd];
  559. _this.braceletCurve_XTPL = _this.bracelet[_this.deviceName][_this.deviceNameXtpl];
  560. _this.braceletCurve_BS = _this.bracelet[_this.deviceName][_this.deviceNameBs];
  561. console.log(_this.braceletCurve_BS[0].value); */
  562. });
  563. });
  564. // 这里仅是事件监听【如果socket关闭了会执行】
  565. this.socketTask_bracelet.onClose(() => {
  566. uni.request({
  567. url: 'http://' + _this.backStageIp + ':' + _this.backStagePort + '/bracelet/close_bracelet?pointKey=' + _this.pointKey,
  568. success: res => {}
  569. });
  570. });
  571. }
  572. }
  573. };
  574. </script>
  575. <style>
  576. body {
  577. font-family: '方正兰亭细黑_GBK';
  578. font-size: 15px;
  579. color: silver;
  580. background: #000;
  581. }
  582. @font-face {
  583. font-family: '方正兰亭细黑_GBK';
  584. src: url(../../static/fzltxh.TTF);
  585. }
  586. .content{
  587. //background-color: #000000;
  588. }
  589. page {
  590. background-color: #1f1f1f;
  591. font-family: '方正兰亭细黑_GBK';
  592. overflow-x: hidden;
  593. }
  594. .top {
  595. width: 100%;
  596. height: 130upx;
  597. padding-top: 5upx;
  598. background-color: #1f1f1f;
  599. position: fixed;
  600. top: 0px;
  601. left: 0px;
  602. z-index: 100;
  603. }
  604. .threeLine {
  605. width: 50px;
  606. height: 45px;
  607. float: left;
  608. }
  609. .text {
  610. width: calc(100% - 100px);
  611. height: 45px;
  612. float: left;
  613. user-select: text;
  614. -webkit-user-select: text;
  615. -moz-user-select: text;
  616. -ms-user-select: text;
  617. color: silver;
  618. line-height: 45px;
  619. margin-top: 11px;
  620. font-size: 18px;
  621. }
  622. .notice {
  623. width: 50px;
  624. height: 45px;
  625. float: left;
  626. }
  627. .plus {
  628. width: 30px;
  629. height: 45px;
  630. float: right;
  631. color: white;
  632. font-size: 35px;
  633. line-height: 45px;
  634. text-align: right;
  635. margin-right: 2.5%;
  636. }
  637. .textWindpowerstation {
  638. width: 180px;
  639. height: 45px;
  640. float: left;
  641. text-align: center;
  642. margin-left: 18px;
  643. }
  644. .InformationCard {
  645. position: absolute;
  646. top: 50px;
  647. left: 0px;
  648. margin-top: 0px;
  649. width: 50%;
  650. height: 8%;
  651. background: rgba(0, 0, 0, 0);
  652. float: left;
  653. }
  654. .informationCardAll {
  655. width: 95%;
  656. margin-left: 2.5%;
  657. margin-top: 10px;
  658. height: 60px;
  659. float: left;
  660. }
  661. .informationCardTextOne {
  662. width: 100%;
  663. height: 35px;
  664. float: left;
  665. margin-top: -10px;
  666. }
  667. .informationCardText {
  668. /* margin-left: 2%; */
  669. width: 65px;
  670. height: 35px;
  671. line-height: 35px;
  672. user-select: text;
  673. -webkit-user-select: text;
  674. -moz-user-select: text;
  675. -ms-user-select: text;
  676. color: silver;
  677. font-size: 10px;
  678. transform: scale(0.975);
  679. float: left;
  680. font-weight: 1000;
  681. }
  682. .textSilver {
  683. user-select: text;
  684. -webkit-user-select: text;
  685. -moz-user-select: text;
  686. -ms-user-select: text;
  687. color: black;
  688. float: left;
  689. }
  690. .textWhite {
  691. color: black;
  692. float: right;
  693. width: 24px;
  694. font-size: 10px;
  695. margin-right: 13%;
  696. transform: scale(0.975);
  697. /* text-align: right; */
  698. }
  699. .Personal_information_W {
  700. position: relative;
  701. margin-top: 3%;
  702. width: 90%;
  703. height: 80px;/*
  704. background-color: #242424; */
  705. border-bottom: #BDBDBD solid 0.5px;
  706. transform: translateX(-50%);
  707. left: 50%;
  708. color: #B8B7B7;
  709. }
  710. .name{
  711. position: absolute;
  712. height: 30px;
  713. width: 130px;
  714. left: 3%;
  715. /* background: -webkit-linear-gradient(top, rgba(159, 131, 111, 0.1) 0%, rgba(193, 94, 21, 0.2) 100%); */
  716. text-align: left;
  717. line-height: 30px;
  718. margin-top: 1%;
  719. font-weight: 1000;
  720. }
  721. .history {
  722. position: absolute;
  723. margin-top: 6%;
  724. right: 3%;
  725. height: 30px;
  726. height: 20px;
  727. text-align: center;
  728. line-height: 30px;
  729. }
  730. .skills {
  731. position: absolute;
  732. top: 56%;
  733. left: 3%;
  734. height: 25px;
  735. width: 180px;/*
  736. background: -webkit-linear-gradient(top, rgba(159, 131, 111, 0.1) 0%, rgba(193, 94, 21, 0.2) 100%); */
  737. text-align: left;
  738. line-height: 30px;
  739. }
  740. .curve{
  741. position: relative;
  742. width: 90%;
  743. transform: translateX(-50%);
  744. left: 50%;
  745. height: 30px;
  746. margin-top: 3%;
  747. color: #B8B7B7;
  748. font-weight: 1000;
  749. }
  750. .curve_l{
  751. position: absolute;
  752. left: 3%;
  753. }
  754. .curve_r{
  755. position: absolute;
  756. right: 3%;
  757. }
  758. .healthy {
  759. /* margin-top: 6%; */
  760. margin-left: 3%;
  761. height: 180px;
  762. width: 95%;
  763. margin-bottom: 100px;
  764. text-align: center;
  765. color: #B8B7B7;
  766. font-size: 12px;
  767. line-height:65px ;
  768. font-weight: 1000;
  769. }
  770. .healthy_H,
  771. .healthy_N,
  772. .healthy_W {
  773. background-color:#242424;
  774. position: relative;
  775. width: 100%;
  776. height: 42%;
  777. text-align: center;
  778. /* padding-bottom: 1%; */
  779. }
  780. .details_z {
  781. position: absolute;
  782. background: -webkit-linear-gradient(top, rgba(159, 131, 111, 0.1) 0%, rgba(193, 94, 21, 0.2) 100%);
  783. width: 30%;
  784. left:3%;
  785. height: 60px;
  786. top: 3%;
  787. margin-top: 2%;
  788. }
  789. .details_m {
  790. position: absolute;
  791. background: -webkit-linear-gradient(top, rgba(159, 131, 111, 0.1) 0%, rgba(193, 94, 21, 0.2) 100%);
  792. width: 30%;
  793. left: 35.5%;
  794. height: 60px;
  795. top: 3%;
  796. margin-top: 2%;
  797. }
  798. .details_y {
  799. position: absolute;
  800. background: -webkit-linear-gradient(top, rgba(159, 131, 111, 0.1) 0%, rgba(193, 94, 21, 0.2) 100%);
  801. width: 30%;
  802. left: 68%;
  803. height: 60px;
  804. top: 3%;
  805. margin-top: 2%;
  806. /* margin-bottom: 0.6%;
  807. margin-top: 0.6%;
  808. float: right;
  809. margin-left: 0.2%;
  810. margin-right: 1.2%;
  811. width: 31%;
  812. height: 100%;
  813. background: -webkit-linear-gradient(top, rgba(159, 131, 111, 0.1) 0%, rgba(193, 94, 21, 0.2) 100%);
  814. color: silver;
  815. text-align: center;
  816. padding-top: 10px;
  817. background-color: #ffffff;
  818. font-size: 12px;
  819. padding-bottom: 4px;
  820. line-height: 13px;
  821. border-radius: 5px;
  822. padding-top: 8px; */
  823. }
  824. .navigation::after {
  825. content: url(../../static/picture/forcast/position.png);
  826. }
  827. /* .greater {
  828. position: relative;
  829. width: 249px;
  830. height: 35px;
  831. border: 1px solid #000;
  832. } */
  833. .greater{
  834. float: right;
  835. content: "";
  836. margin-top: 0.8%;
  837. margin-right: 0.8%;
  838. /* position: absolute; */
  839. /* top: 8px;
  840. right: 15px; */
  841. width: 8px;
  842. height: 8px;
  843. border-right: 2px solid #fff;
  844. border-bottom: 2px solid #fff;
  845. transform: rotate(-45deg);
  846. }
  847. .windStationNameAndChoice {
  848. clear: both;
  849. width: 100%;
  850. height: 30px;
  851. margin-top: 1%;
  852. color: silver;
  853. /* border: 1px solid red; */
  854. }
  855. .windStationName {
  856. width: 50%;
  857. height: 100%;
  858. float: left;
  859. line-height: 30px;
  860. font-size: 14px;
  861. margin-left: 9.5%;
  862. }
  863. .windStationChoice {
  864. width: 20%;
  865. height: 100%;
  866. float: right;
  867. text-align: right;
  868. line-height: 30px;
  869. font-size: 14px;
  870. margin-right: 5%;
  871. }
  872. .s-popup-wrapper {
  873. width: 500rpx;
  874. background-color: #f0f0f0;
  875. }
  876. .s-popup-title {
  877. width: 100%;
  878. height: 50px;
  879. background-color: #211E21;
  880. }
  881. .s-popup-word {
  882. width: calc(100% - 65px);
  883. height: 50px;
  884. font-size: 14px;
  885. color: white;
  886. line-height: 50px;
  887. float: left;
  888. margin-left: 25px;
  889. }
  890. .s-popup-cha {
  891. width: 40px;
  892. height: 50px;
  893. text-align: center;
  894. line-height: 50px;
  895. float: right;
  896. font-size: 24px;
  897. }
  898. .windStationItemContainer {
  899. width: 100%;
  900. }
  901. .windStationItemContainerBlack {
  902. width: 100%;
  903. background-color: grey;
  904. color: white;
  905. }
  906. .windStationItem {
  907. width: 80%;
  908. height: 50px;
  909. border-bottom: 1px solid #c8c8c8;
  910. text-align: left;
  911. line-height: 50px;
  912. margin-left: 10%;
  913. color: #333333;
  914. }
  915. .DrawerPage {
  916. position: fixed;
  917. width: 100vw;
  918. height: 100vh;
  919. left: 0vw;
  920. background-color: #1f1f1f;
  921. transition: all 0.4s;
  922. }
  923. .DrawerPage.show {
  924. transform: scale(0.9, 0.9);
  925. left: 85vw;
  926. box-shadow: 0 0 60upx rgba(0, 0, 0, 0.2);
  927. transform-origin: 0;
  928. }
  929. .DrawerPage .cu-bar.tabbar .action button.cuIcon {
  930. width: 64upx;
  931. height: 64upx;
  932. line-height: 64upx;
  933. margin: 0;
  934. display: inline-block;
  935. }
  936. .DrawerPage .cu-bar.tabbar .action .cu-avatar {
  937. margin: 0;
  938. }
  939. .DrawerPage .nav {
  940. flex: 1;
  941. }
  942. .DrawerPage .nav .cu-item.cur {
  943. border-bottom: 0;
  944. position: relative;
  945. }
  946. .DrawerPage .nav .cu-item.cur::after {
  947. content: '';
  948. width: 10upx;
  949. height: 10upx;
  950. background-color: currentColor;
  951. position: absolute;
  952. bottom: 10upx;
  953. border-radius: 10upx;
  954. left: 0;
  955. right: 0;
  956. margin: auto;
  957. }
  958. .DrawerPage .cu-bar.tabbar .action {
  959. flex: initial;
  960. }
  961. </style>