Forecast.vue 30 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075
  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;mapdelete();"> <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. },created: function() {
  289. // this.pushWindPowerStationNameToSessionStorage("麻黄山");
  290. this.viewUserid();
  291. this.monitoringAuthority();
  292. this.address = this.dataprocessing.getWindPowerStationName();
  293. this.FDC=this.dataprocessing.getWindPowerStationId();
  294. this.windPowerStationId =this.dataprocessing.getWindPowerStationId();
  295. this.$nextTick(function() {
  296. //this.getWeatherDataToday();
  297. //this.getWeatherData7();
  298. });
  299. this.cWidth = uni.upx2px(2000);
  300. this.cHeight = uni.upx2px(350);
  301. this.cWidth40 = uni.upx2px(5000);
  302. this.cHeight40 = uni.upx2px(350);
  303. this.windStation =this.dataprocessing.getWindPowerStationNameByNames(this.address);
  304. this.windStationName = this.windStation[0].replace('风电场', '');
  305. },
  306. onLoad(pointKey) {
  307. let _this = this;
  308. this.pointKey = pointKey.pointKey;
  309. this.targetName = pointKey.callTargetName;
  310. this.targetUnit = pointKey.callTargetUnit;
  311. this.braceletData();
  312. /* console.log(_this.bracelet[_this.deviceName]);
  313. console.log(_this.bracelet[_this.deviceName][_this.targetName_pld][0]); */
  314. /* uni.getLocation({//获取当前的位置坐标
  315. type: 'wgs84',
  316. success: function (res) {
  317. console.log('当前位置的经度:' + res.longitude);
  318. console.log('当前位置的纬度:' + res.latitude);
  319. }
  320. }); */
  321. },
  322. onReady() {},
  323. computed: {
  324. targetName_xtpl: function() {
  325. return this.deviceName + '_XTPL';
  326. },
  327. targetName_xtpl_size: function() {
  328. return this.bracelet[this.deviceName][this.targetName_xtpl].length - 1;
  329. },
  330. targetName_pld: function() {
  331. return this.deviceName + '_PLD';
  332. },
  333. targetName_pld_size: function() {
  334. return this.bracelet[this.deviceName][this.targetName_pld].length - 1;
  335. },
  336. targetName_bs: function() {
  337. return this.deviceName + '_BS';
  338. },
  339. targetName_bs_size: function() {
  340. return this.bracelet[this.deviceName][this.targetName_bs].length - 1;
  341. },
  342. targetName_ssxy: function() {
  343. return this.deviceName + '_SSXY';
  344. },
  345. targetName_ssxy_size: function() {
  346. return this.bracelet[this.deviceName][this.targetName_ssxy].length - 1;
  347. },
  348. targetName_szxy: function() {
  349. return this.deviceName + '_SZXY';
  350. },
  351. targetName_szxy_size: function() {
  352. return this.bracelet[this.deviceName][this.targetName_szxy].length - 1;
  353. },
  354. targetName_xynd: function() {
  355. return this.deviceName + '_XYND';
  356. },
  357. targetName_xynd_size: function() {
  358. return this.bracelet[this.deviceName][this.targetName_xynd].length - 1;
  359. },
  360. backStageIp: function() {
  361. return this.$store.state.wholeSituationBackStageIp;
  362. },
  363. backStagePort: function() {
  364. return this.$store.state.wholeSituationBackStagePort;
  365. },
  366. windpowerstationNameToId: function() {
  367. return this.$store.state.windpowerstationNameToId;
  368. }
  369. },
  370. methods: {
  371. viewUserid: function() {
  372. this.plusDrawerList=uni.getStorageSync('plusList');
  373. },
  374. monitoringAuthority: function() {
  375. this.drawerList=uni.getStorageSync('leftlist3');
  376. },
  377. mapdelete(){
  378. //#ifdef H5
  379. if(this.bool){
  380. this.$delete(this.polyline[0],'points');
  381. this.braceletCurve_LNG = this.bracelet[this.deviceName][this.deviceNameLng];
  382. this.braceletCurve_LAT = this.bracelet[this.deviceName][this.deviceNameLat];
  383. this.points[0].longitude=this.bracelet[this.deviceName][this.deviceNameLng][0].value;
  384. this.points[0].latitude=this.bracelet[this.deviceName][this.deviceNameLat][0].value;
  385. this.points[1].longitude=this.bracelet[this.deviceName][this.deviceNameLng][this.braceletCurve_LNG.length-1].value;
  386. this.points[1].latitude=this.bracelet[this.deviceName][this.deviceNameLat][this.braceletCurve_LAT.length-1].value;
  387. for(let val of this.polyline){
  388. this.$set(val,'points',this.points);
  389. this.bool = false;
  390. console.log("true");
  391. }
  392. /* 定义地图经纬度中心 */
  393. var lat= parseFloat(this.mapBegin_2)+parseFloat(this.mapEnd_2);
  394. var lng= parseFloat(this.mapBegin_1)+parseFloat(this.mapEnd_1);
  395. this.latitude = lat/2;
  396. this.longitude = lng/2;
  397. }else{
  398. /* this.braceletCurve_LNG = this.bracelet[this.deviceName][this.deviceNameLng];
  399. this.braceletCurve_LAT = this.bracelet[this.deviceName][this.deviceNameLat];
  400. this.points[0].longitude=this.bracelet[this.deviceName][this.deviceNameLng][0].value;
  401. this.points[0].latitude=this.bracelet[this.deviceName][this.deviceNameLat][0].value;
  402. this.points[1].longitude=this.bracelet[this.deviceName][this.deviceNameLng][this.braceletCurve_LNG.length-1].value;
  403. this.points[1].latitude=this.bracelet[this.deviceName][this.deviceNameLat][this.braceletCurve_LAT.length-1].value;
  404. */
  405. /* this.$replace(this.polyline[0],'points'); */
  406. /* this.latitude = this.mapBegin_2+this.mapEnd_2/2;
  407. this.longitude = this.mapBegin_1+this.mapEnd_1/2; */
  408. console.log("false");
  409. /* 还原定位中心位置 */
  410. this.latitude = this.mapBegin_2;
  411. this.longitude = this.mapBegin_1;
  412. this.bool = true;
  413. }
  414. this.$forceUpdate();
  415. //#endif
  416. //#ifdef APP-PLUS
  417. if(this.bool){
  418. this.$delete(this.polyline[0],'points');
  419. this.braceletCurve_LNG = this.bracelet[this.deviceName][this.deviceNameLng];
  420. this.braceletCurve_LAT = this.bracelet[this.deviceName][this.deviceNameLat];
  421. this.points[0].longitude=this.bracelet[this.deviceName][this.deviceNameLng][0].value;
  422. this.points[0].latitude=this.bracelet[this.deviceName][this.deviceNameLat][0].value;
  423. this.points[1].longitude=this.bracelet[this.deviceName][this.deviceNameLng][this.braceletCurve_LNG.length-1].value;
  424. this.points[1].latitude=this.bracelet[this.deviceName][this.deviceNameLat][this.braceletCurve_LAT.length-1].value;
  425. for(let val of this.polyline){
  426. this.$set(val,'points',this.points);
  427. this.bool = false;
  428. console.log("true");
  429. }
  430. /* 定义地图经纬度中心 */
  431. var lat= parseFloat(this.mapBegin_2)+parseFloat(this.mapEnd_2);
  432. var lng= parseFloat(this.mapBegin_1)+parseFloat(this.mapEnd_1);
  433. this.latitude = lat/2;
  434. this.longitude = lng/2;
  435. }else{
  436. /* this.braceletCurve_LNG = this.bracelet[this.deviceName][this.deviceNameLng];
  437. this.braceletCurve_LAT = this.bracelet[this.deviceName][this.deviceNameLat];
  438. this.points[0].longitude=this.bracelet[this.deviceName][this.deviceNameLng][0].value;
  439. this.points[0].latitude=this.bracelet[this.deviceName][this.deviceNameLat][0].value;
  440. this.points[1].longitude=this.bracelet[this.deviceName][this.deviceNameLng][this.braceletCurve_LNG.length-1].value;
  441. this.points[1].latitude=this.bracelet[this.deviceName][this.deviceNameLat][this.braceletCurve_LAT.length-1].value;
  442. */
  443. this.$delete(this.polyline[0],'points');
  444. /* this.latitude = this.mapBegin_2+this.mapEnd_2/2;
  445. this.longitude = this.mapBegin_1+this.mapEnd_1/2; */
  446. console.log("false");
  447. /* 还原定位中心位置 */
  448. this.latitude = this.mapBegin_2;
  449. this.longitude = this.mapBegin_1;
  450. this.bool = true;
  451. }
  452. this.$forceUpdate();
  453. //#endif
  454. },
  455. mapDate(){
  456. },
  457. openDrawer: function() {
  458. this.monitoringAuthority();
  459. this.kg=false;
  460. this.$refs.drawer.openDrawer(250, this.drawerList, this.inconList,this.leftNavigationtitle);
  461. },
  462. closeDrawer: function() {
  463. this.drawerIsShow = false;
  464. },
  465. pushWindPowerStationNameToSessionStorage(windpowerstationName) {
  466. uni.setStorageSync('windpowerstationName', windpowerstationName);
  467. //sessionStorage.setItem('windpowerstationName', windpowerstationName);
  468. //alert("v"+ sessionStorage.getItem("windpowerstationName"));
  469. //this.common.goback('/pages/index/Index');
  470. },
  471. getWindPowerStationNameToSessionStorage() {
  472. uni.getStorageSync('windpowerstationName');
  473. return uni.getStorageSync('windpowerstationName');
  474. },
  475. leftbar(){
  476. this.kg=true;
  477. },
  478. onHide() {
  479. this.$refs.drawer.closeDrawer();
  480. this.hideModal();
  481. },
  482. onShow: function() {
  483. this.leftbar();
  484. this.windPowerStationId = uni.getStorageSync('windPowerStationId');
  485. this.address = this.getWindPowerStationNameToSessionStorage();
  486. this.viewUserid();
  487. this.monitoringAuthority();
  488. },
  489. showModal(e) {
  490. this.viewUserid();
  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%2009:26:27&&endDate=2020-04-25%2009: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/all',
  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-left: 3%;
  760. height: 180px;
  761. width: 95%;
  762. margin-bottom: 100px;
  763. text-align: center;
  764. color: #B8B7B7;
  765. font-size: 12px;
  766. line-height:65px ;
  767. font-weight: 1000;
  768. }
  769. .healthy_H,
  770. .healthy_N,
  771. .healthy_W {
  772. background-color:#242424;
  773. position: relative;
  774. width: 100%;
  775. height: 42%;
  776. text-align: center;
  777. /* padding-bottom: 1%; */
  778. }
  779. .details_z {
  780. position: absolute;
  781. background: -webkit-linear-gradient(top, rgba(159, 131, 111, 0.1) 0%, rgba(193, 94, 21, 0.2) 100%);
  782. width: 30%;
  783. left:3%;
  784. height: 60px;
  785. top: 3%;
  786. margin-top: 2%;
  787. }
  788. .details_m {
  789. position: absolute;
  790. background: -webkit-linear-gradient(top, rgba(159, 131, 111, 0.1) 0%, rgba(193, 94, 21, 0.2) 100%);
  791. width: 30%;
  792. left: 35.5%;
  793. height: 60px;
  794. top: 3%;
  795. margin-top: 2%;
  796. }
  797. .details_y {
  798. position: absolute;
  799. background: -webkit-linear-gradient(top, rgba(159, 131, 111, 0.1) 0%, rgba(193, 94, 21, 0.2) 100%);
  800. width: 30%;
  801. left: 68%;
  802. height: 60px;
  803. top: 3%;
  804. margin-top: 2%;
  805. /* margin-bottom: 0.6%;
  806. margin-top: 0.6%;
  807. float: right;
  808. margin-left: 0.2%;
  809. margin-right: 1.2%;
  810. width: 31%;
  811. height: 100%;
  812. background: -webkit-linear-gradient(top, rgba(159, 131, 111, 0.1) 0%, rgba(193, 94, 21, 0.2) 100%);
  813. color: silver;
  814. text-align: center;
  815. padding-top: 10px;
  816. background-color: #ffffff;
  817. font-size: 12px;
  818. padding-bottom: 4px;
  819. line-height: 13px;
  820. border-radius: 5px;
  821. padding-top: 8px; */
  822. }
  823. .navigation::after {
  824. content: url(../../static/picture/forcast/position.png);
  825. }
  826. /* .greater {
  827. position: relative;
  828. width: 249px;
  829. height: 35px;
  830. border: 1px solid #000;
  831. } */
  832. .greater{
  833. float: right;
  834. content: "";
  835. margin-top: 0.8%;
  836. margin-right: 0.8%;
  837. /* position: absolute; */
  838. /* top: 8px;
  839. right: 15px; */
  840. width: 8px;
  841. height: 8px;
  842. border-right: 2px solid #fff;
  843. border-bottom: 2px solid #fff;
  844. transform: rotate(-45deg);
  845. }
  846. .windStationNameAndChoice {
  847. clear: both;
  848. width: 100%;
  849. height: 30px;
  850. margin-top: 1%;
  851. color: silver;
  852. /* border: 1px solid red; */
  853. }
  854. .windStationName {
  855. width: 50%;
  856. height: 100%;
  857. float: left;
  858. line-height: 30px;
  859. font-size: 14px;
  860. margin-left: 9.5%;
  861. }
  862. .windStationChoice {
  863. width: 20%;
  864. height: 100%;
  865. float: right;
  866. text-align: right;
  867. line-height: 30px;
  868. font-size: 14px;
  869. margin-right: 5%;
  870. }
  871. .s-popup-wrapper {
  872. width: 500rpx;
  873. background-color: #f0f0f0;
  874. }
  875. .s-popup-title {
  876. width: 100%;
  877. height: 50px;
  878. background-color: #211E21;
  879. }
  880. .s-popup-word {
  881. width: calc(100% - 65px);
  882. height: 50px;
  883. font-size: 14px;
  884. color: white;
  885. line-height: 50px;
  886. float: left;
  887. margin-left: 25px;
  888. }
  889. .s-popup-cha {
  890. width: 40px;
  891. height: 50px;
  892. text-align: center;
  893. line-height: 50px;
  894. float: right;
  895. font-size: 24px;
  896. }
  897. .windStationItemContainer {
  898. width: 100%;
  899. }
  900. .windStationItemContainerBlack {
  901. width: 100%;
  902. background-color: grey;
  903. color: white;
  904. }
  905. .windStationItem {
  906. width: 80%;
  907. height: 50px;
  908. border-bottom: 1px solid #c8c8c8;
  909. text-align: left;
  910. line-height: 50px;
  911. margin-left: 10%;
  912. color: #333333;
  913. }
  914. .DrawerPage {
  915. position: fixed;
  916. width: 100vw;
  917. height: 100vh;
  918. left: 0vw;
  919. background-color: #1f1f1f;
  920. transition: all 0.4s;
  921. }
  922. .DrawerPage.show {
  923. transform: scale(0.9, 0.9);
  924. left: 85vw;
  925. box-shadow: 0 0 60upx rgba(0, 0, 0, 0.2);
  926. transform-origin: 0;
  927. }
  928. .DrawerPage .cu-bar.tabbar .action button.cuIcon {
  929. width: 64upx;
  930. height: 64upx;
  931. line-height: 64upx;
  932. margin: 0;
  933. display: inline-block;
  934. }
  935. .DrawerPage .cu-bar.tabbar .action .cu-avatar {
  936. margin: 0;
  937. }
  938. .DrawerPage .nav {
  939. flex: 1;
  940. }
  941. .DrawerPage .nav .cu-item.cur {
  942. border-bottom: 0;
  943. position: relative;
  944. }
  945. .DrawerPage .nav .cu-item.cur::after {
  946. content: '';
  947. width: 10upx;
  948. height: 10upx;
  949. background-color: currentColor;
  950. position: absolute;
  951. bottom: 10upx;
  952. border-radius: 10upx;
  953. left: 0;
  954. right: 0;
  955. margin: auto;
  956. }
  957. .DrawerPage .cu-bar.tabbar .action {
  958. flex: initial;
  959. }
  960. </style>