WeatherProphet40.vue 41 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571
  1. <template>
  2. <view>
  3. <view @tap="common.navTo('/components/addressSelect/AddressSelect?option='+address)">
  4. <cu-custom bgColor="bg-gradual-earkblue" :isBack="false">
  5. <block slot="backText">
  6. <view style="height: 80rpx;line-height: 80rpx;">返回</view>
  7. </block>
  8. <block slot="content">
  9. <text :class="'cuIcon-locationfill'"></text>
  10. </block>
  11. <block slot="content">{{address}}</block>
  12. <block slot="content">
  13. <image style="width: 15px;height: 15px;margin-left: 4px;" src="../../static/picture/SanJiao.png">
  14. </block>
  15. </cu-custom>
  16. </view>
  17. <!-- 卡片 -->
  18. <view class="cu-card case" :class="isCard?'no-card':''">
  19. <view class="cardContenter">
  20. <!-- 选卡 -->
  21. <view class="dateAndChoice">
  22. <view class="date">
  23. {{startDate}}~{{endDate}}
  24. </view>
  25. <view class="choice">
  26. <div :class="[speedFlag==true?'speedButtonWhite':'speedButtonBlack']" :style="{'font-size':choiceFontSize,'margin-top':choiceMarginTop}" @click="speedSwitch()">风速</div>
  27. <div :class="[temperatureFlag==true?'temperatureButtonWhite':'temperatureButtonBlack']" :style="{'font-size':choiceFontSize,'margin-top':choiceMarginTop}" @click="temperatureSwitch()">温度</div>
  28. <div :class="[realFeelFlag==true?'realFeelButtonWhite':'realFeelButtonBlack']" :style="{'font-size':choiceFontSize,'margin-top':choiceMarginTop}" @click="realFeelSwitch()">体感温度</div>
  29. </view>
  30. </view>
  31. <!-- uCharts图 -->
  32. <!-- <scroll-view class="VerticalNav nav " scroll-y scroll-with-animation :scroll-top="10" style="height:100vh;"></scroll-view> -->
  33. <scroll-view scroll-x scroll-with-animation :scroll-left=scrollposition_uCharts class="scrollUcharts" @scroll="uChartsScrollEvent" :scroll-into-view="'uCharts-'+mainCur">
  34. <view class="qiun-charts">
  35. <canvas canvas-id="canvasLineA" id="canvasLineA" class="charts"></canvas>
  36. </view>
  37. </scroll-view>
  38. </view>
  39. </view>
  40. <!-- 矩阵 -->
  41. <scroll-view scroll-y scroll-with-animation :scroll-top=scrollposition_list class="scrollList" :style="{'height': scrollListHeight }" @scroll="listScrollEvent">
  42. <weatherCalendarCardList40 ref="weatherCalendarCardList40"></weatherCalendarCardList40>
  43. </scroll-view>
  44. </view>
  45. </template>
  46. <script>
  47. import uCharts from '../../components/tools/u-charts/u-charts.js';
  48. import weatherCalendarCardList40 from '../../components/weatherCalendarCardList40/weatherCalendarCardList40.vue'
  49. export default {
  50. components: {
  51. "weatherCalendarCardList40":weatherCalendarCardList40
  52. },
  53. data() {
  54. return {
  55. scrollposition_uCharts:0,
  56. scrollposition_list:0,
  57. address: '',
  58. option: '',
  59. isCard: false,
  60. cWidth:'',
  61. cHeight:'',
  62. pixelRatio:1,
  63. weatherProphetData_40: [
  64. {
  65. id: '238466634',
  66. recodedata: '2020/02/25 00:00:00',
  67. region: '石板泉风电场',
  68. windpowerstationid: 'SBQ_FDC',
  69. weather: '晴',
  70. maximumtem: '15',
  71. minimumtem: '-2',
  72. sunrise: '07:37',
  73. sunset: '18:48',
  74. sunduration: '11',
  75. weather1: '晴',
  76. temperature1: '-15',
  77. realfeel1: '15',
  78. precipitation1: '0',
  79. winddrection1: '0',
  80. speed1: '3',
  81. gust1: '3',
  82. weather2: '晴',
  83. temperature2: '-2',
  84. realfeel2: '-3',
  85. precipitation2: '0',
  86. winddirection2: '东北',
  87. speed2: '3',
  88. gust2: '3'
  89. },
  90. {
  91. id: '238466634',
  92. recodedata: '2020/02/26 00:00:00',
  93. region: '石板泉风电场',
  94. windpowerstationid: 'SBQ_FDC',
  95. weather: '晴',
  96. maximumtem: '15',
  97. minimumtem: '-2',
  98. sunrise: '07:37',
  99. sunset: '18:48',
  100. sunduration: '11',
  101. weather1: '晴',
  102. temperature1: '-10',
  103. realfeel1: '8',
  104. precipitation1: '0',
  105. winddrection1: '0',
  106. speed1: '6',
  107. gust1: '3',
  108. weather2: '晴',
  109. temperature2: '-2',
  110. realfeel2: '-3',
  111. precipitation2: '0',
  112. winddirection2: '东北',
  113. speed2: '3',
  114. gust2: '3'
  115. },
  116. {
  117. id: '238466634',
  118. recodedata: '2020/02/27 00:00:00',
  119. region: '石板泉风电场',
  120. windpowerstationid: 'SBQ_FDC',
  121. weather: '晴',
  122. maximumtem: '15',
  123. minimumtem: '-2',
  124. sunrise: '07:37',
  125. sunset: '18:48',
  126. sunduration: '11',
  127. weather1: '晴',
  128. temperature1: '10',
  129. realfeel1: '7',
  130. precipitation1: '0',
  131. winddrection1: '0',
  132. speed1: '2',
  133. gust1: '3',
  134. weather2: '晴',
  135. temperature2: '-2',
  136. realfeel2: '-3',
  137. precipitation2: '0',
  138. winddirection2: '东北',
  139. speed2: '3',
  140. gust2: '3'
  141. },
  142. {
  143. id: '238466634',
  144. recodedata: '2020/02/28 00:00:00',
  145. region: '石板泉风电场',
  146. windpowerstationid: 'SBQ_FDC',
  147. weather: '晴',
  148. maximumtem: '15',
  149. minimumtem: '-2',
  150. sunrise: '07:37',
  151. sunset: '18:48',
  152. sunduration: '11',
  153. weather1: '晴',
  154. temperature1: '12',
  155. realfeel1: '15',
  156. precipitation1: '0',
  157. winddrection1: '0',
  158. speed1: '10',
  159. gust1: '3',
  160. weather2: '晴',
  161. temperature2: '-2',
  162. realfeel2: '-3',
  163. precipitation2: '0',
  164. winddirection2: '东北',
  165. speed2: '3',
  166. gust2: '3'
  167. },
  168. {
  169. id: '238466634',
  170. recodedata: '2020/02/29 00:00:00',
  171. region: '石板泉风电场',
  172. windpowerstationid: 'SBQ_FDC',
  173. weather: '晴',
  174. maximumtem: '15',
  175. minimumtem: '-2',
  176. sunrise: '07:37',
  177. sunset: '18:48',
  178. sunduration: '11',
  179. weather1: '晴',
  180. temperature1: '15',
  181. realfeel1: '13',
  182. precipitation1: '0',
  183. winddrection1: '0',
  184. speed1: '12',
  185. gust1: '3',
  186. weather2: '晴',
  187. temperature2: '-2',
  188. realfeel2: '-3',
  189. precipitation2: '0',
  190. winddirection2: '东北',
  191. speed2: '3',
  192. gust2: '3'
  193. },
  194. {
  195. id: '238466634',
  196. recodedata: '2020/03/01 00:00:00',
  197. region: '石板泉风电场',
  198. windpowerstationid: 'SBQ_FDC',
  199. weather: '晴',
  200. maximumtem: '15',
  201. minimumtem: '-2',
  202. sunrise: '07:37',
  203. sunset: '18:48',
  204. sunduration: '11',
  205. weather1: '晴',
  206. temperature1: '-15',
  207. realfeel1: '15',
  208. precipitation1: '0',
  209. winddrection1: '0',
  210. speed1: '3',
  211. gust1: '3',
  212. weather2: '晴',
  213. temperature2: '-2',
  214. realfeel2: '-3',
  215. precipitation2: '0',
  216. winddirection2: '东北',
  217. speed2: '3',
  218. gust2: '3'
  219. },
  220. {
  221. id: '238466634',
  222. recodedata: '2020/03/02 00:00:00',
  223. region: '石板泉风电场',
  224. windpowerstationid: 'SBQ_FDC',
  225. weather: '晴',
  226. maximumtem: '15',
  227. minimumtem: '-2',
  228. sunrise: '07:37',
  229. sunset: '18:48',
  230. sunduration: '11',
  231. weather1: '晴',
  232. temperature1: '-15',
  233. realfeel1: '15',
  234. precipitation1: '0',
  235. winddrection1: '0',
  236. speed1: '3',
  237. gust1: '3',
  238. weather2: '晴',
  239. temperature2: '-2',
  240. realfeel2: '-3',
  241. precipitation2: '0',
  242. winddirection2: '东北',
  243. speed2: '3',
  244. gust2: '3'
  245. },
  246. {
  247. id: '238466634',
  248. recodedata: '2020/03/03 00:00:00',
  249. region: '石板泉风电场',
  250. windpowerstationid: 'SBQ_FDC',
  251. weather: '晴',
  252. maximumtem: '15',
  253. minimumtem: '-2',
  254. sunrise: '07:37',
  255. sunset: '18:48',
  256. sunduration: '11',
  257. weather1: '晴',
  258. temperature1: '-15',
  259. realfeel1: '15',
  260. precipitation1: '0',
  261. winddrection1: '0',
  262. speed1: '3',
  263. gust1: '3',
  264. weather2: '晴',
  265. temperature2: '-2',
  266. realfeel2: '-3',
  267. precipitation2: '0',
  268. winddirection2: '东北',
  269. speed2: '3',
  270. gust2: '3'
  271. },
  272. {
  273. id: '238466634',
  274. recodedata: '2020/03/04 00:00:00',
  275. region: '石板泉风电场',
  276. windpowerstationid: 'SBQ_FDC',
  277. weather: '晴',
  278. maximumtem: '15',
  279. minimumtem: '-2',
  280. sunrise: '07:37',
  281. sunset: '18:48',
  282. sunduration: '11',
  283. weather1: '晴',
  284. temperature1: '-15',
  285. realfeel1: '15',
  286. precipitation1: '0',
  287. winddrection1: '0',
  288. speed1: '3',
  289. gust1: '3',
  290. weather2: '晴',
  291. temperature2: '-2',
  292. realfeel2: '-3',
  293. precipitation2: '0',
  294. winddirection2: '东北',
  295. speed2: '3',
  296. gust2: '3'
  297. },
  298. {
  299. id: '238466634',
  300. recodedata: '2020/03/05 00:00:00',
  301. region: '石板泉风电场',
  302. windpowerstationid: 'SBQ_FDC',
  303. weather: '晴',
  304. maximumtem: '15',
  305. minimumtem: '-2',
  306. sunrise: '07:37',
  307. sunset: '18:48',
  308. sunduration: '11',
  309. weather1: '晴',
  310. temperature1: '-15',
  311. realfeel1: '15',
  312. precipitation1: '0',
  313. winddrection1: '0',
  314. speed1: '3',
  315. gust1: '3',
  316. weather2: '晴',
  317. temperature2: '-2',
  318. realfeel2: '-3',
  319. precipitation2: '0',
  320. winddirection2: '东北',
  321. speed2: '3',
  322. gust2: '3'
  323. },
  324. {
  325. id: '238466634',
  326. recodedata: '2020/03/06 00:00:00',
  327. region: '石板泉风电场',
  328. windpowerstationid: 'SBQ_FDC',
  329. weather: '晴',
  330. maximumtem: '15',
  331. minimumtem: '-2',
  332. sunrise: '07:37',
  333. sunset: '18:48',
  334. sunduration: '11',
  335. weather1: '晴',
  336. temperature1: '-15',
  337. realfeel1: '15',
  338. precipitation1: '0',
  339. winddrection1: '0',
  340. speed1: '3',
  341. gust1: '3',
  342. weather2: '晴',
  343. temperature2: '-2',
  344. realfeel2: '-3',
  345. precipitation2: '0',
  346. winddirection2: '东北',
  347. speed2: '3',
  348. gust2: '3'
  349. },
  350. {
  351. id: '238466634',
  352. recodedata: '2020/03/06 00:00:00',
  353. region: '石板泉风电场',
  354. windpowerstationid: 'SBQ_FDC',
  355. weather: '晴',
  356. maximumtem: '15',
  357. minimumtem: '-2',
  358. sunrise: '07:37',
  359. sunset: '18:48',
  360. sunduration: '11',
  361. weather1: '晴',
  362. temperature1: '-15',
  363. realfeel1: '15',
  364. precipitation1: '0',
  365. winddrection1: '0',
  366. speed1: '3',
  367. gust1: '3',
  368. weather2: '晴',
  369. temperature2: '-2',
  370. realfeel2: '-3',
  371. precipitation2: '0',
  372. winddirection2: '东北',
  373. speed2: '3',
  374. gust2: '3'
  375. },
  376. {
  377. id: '238466634',
  378. recodedata: '2020/03/07 00:00:00',
  379. region: '石板泉风电场',
  380. windpowerstationid: 'SBQ_FDC',
  381. weather: '晴',
  382. maximumtem: '15',
  383. minimumtem: '-2',
  384. sunrise: '07:37',
  385. sunset: '18:48',
  386. sunduration: '11',
  387. weather1: '晴',
  388. temperature1: '-15',
  389. realfeel1: '15',
  390. precipitation1: '0',
  391. winddrection1: '0',
  392. speed1: '3',
  393. gust1: '3',
  394. weather2: '晴',
  395. temperature2: '-2',
  396. realfeel2: '-3',
  397. precipitation2: '0',
  398. winddirection2: '东北',
  399. speed2: '3',
  400. gust2: '3'
  401. },
  402. {
  403. id: '238466634',
  404. recodedata: '2020/03/08 00:00:00',
  405. region: '石板泉风电场',
  406. windpowerstationid: 'SBQ_FDC',
  407. weather: '晴',
  408. maximumtem: '15',
  409. minimumtem: '-2',
  410. sunrise: '07:37',
  411. sunset: '18:48',
  412. sunduration: '11',
  413. weather1: '晴',
  414. temperature1: '-15',
  415. realfeel1: '15',
  416. precipitation1: '0',
  417. winddrection1: '0',
  418. speed1: '3',
  419. gust1: '3',
  420. weather2: '晴',
  421. temperature2: '-2',
  422. realfeel2: '-3',
  423. precipitation2: '0',
  424. winddirection2: '东北',
  425. speed2: '3',
  426. gust2: '3'
  427. },
  428. {
  429. id: '238466634',
  430. recodedata: '2020/03/09 00:00:00',
  431. region: '石板泉风电场',
  432. windpowerstationid: 'SBQ_FDC',
  433. weather: '晴',
  434. maximumtem: '15',
  435. minimumtem: '-2',
  436. sunrise: '07:37',
  437. sunset: '18:48',
  438. sunduration: '11',
  439. weather1: '晴',
  440. temperature1: '-15',
  441. realfeel1: '15',
  442. precipitation1: '0',
  443. winddrection1: '0',
  444. speed1: '3',
  445. gust1: '3',
  446. weather2: '晴',
  447. temperature2: '-2',
  448. realfeel2: '-3',
  449. precipitation2: '0',
  450. winddirection2: '东北',
  451. speed2: '3',
  452. gust2: '3'
  453. },
  454. {
  455. id: '238466634',
  456. recodedata: '2020/03/10 00:00:00',
  457. region: '石板泉风电场',
  458. windpowerstationid: 'SBQ_FDC',
  459. weather: '晴',
  460. maximumtem: '15',
  461. minimumtem: '-2',
  462. sunrise: '07:37',
  463. sunset: '18:48',
  464. sunduration: '11',
  465. weather1: '晴',
  466. temperature1: '-15',
  467. realfeel1: '15',
  468. precipitation1: '0',
  469. winddrection1: '0',
  470. speed1: '3',
  471. gust1: '3',
  472. weather2: '晴',
  473. temperature2: '-2',
  474. realfeel2: '-3',
  475. precipitation2: '0',
  476. winddirection2: '东北',
  477. speed2: '3',
  478. gust2: '3'
  479. },
  480. {
  481. id: '238466634',
  482. recodedata: '2020/03/11 00:00:00',
  483. region: '石板泉风电场',
  484. windpowerstationid: 'SBQ_FDC',
  485. weather: '晴',
  486. maximumtem: '15',
  487. minimumtem: '-2',
  488. sunrise: '07:37',
  489. sunset: '18:48',
  490. sunduration: '11',
  491. weather1: '晴',
  492. temperature1: '-15',
  493. realfeel1: '15',
  494. precipitation1: '0',
  495. winddrection1: '0',
  496. speed1: '3',
  497. gust1: '3',
  498. weather2: '晴',
  499. temperature2: '-2',
  500. realfeel2: '-3',
  501. precipitation2: '0',
  502. winddirection2: '东北',
  503. speed2: '3',
  504. gust2: '3'
  505. },
  506. {
  507. id: '238466634',
  508. recodedata: '2020/03/12 00:00:00',
  509. region: '石板泉风电场',
  510. windpowerstationid: 'SBQ_FDC',
  511. weather: '晴',
  512. maximumtem: '15',
  513. minimumtem: '-2',
  514. sunrise: '07:37',
  515. sunset: '18:48',
  516. sunduration: '11',
  517. weather1: '晴',
  518. temperature1: '-15',
  519. realfeel1: '15',
  520. precipitation1: '0',
  521. winddrection1: '0',
  522. speed1: '3',
  523. gust1: '3',
  524. weather2: '晴',
  525. temperature2: '-2',
  526. realfeel2: '-3',
  527. precipitation2: '0',
  528. winddirection2: '东北',
  529. speed2: '3',
  530. gust2: '3'
  531. },
  532. {
  533. id: '238466634',
  534. recodedata: '2020/03/13 00:00:00',
  535. region: '石板泉风电场',
  536. windpowerstationid: 'SBQ_FDC',
  537. weather: '晴',
  538. maximumtem: '15',
  539. minimumtem: '-2',
  540. sunrise: '07:37',
  541. sunset: '18:48',
  542. sunduration: '11',
  543. weather1: '晴',
  544. temperature1: '-15',
  545. realfeel1: '15',
  546. precipitation1: '0',
  547. winddrection1: '0',
  548. speed1: '3',
  549. gust1: '3',
  550. weather2: '晴',
  551. temperature2: '-2',
  552. realfeel2: '-3',
  553. precipitation2: '0',
  554. winddirection2: '东北',
  555. speed2: '3',
  556. gust2: '3'
  557. },
  558. {
  559. id: '238466634',
  560. recodedata: '2020/03/14 00:00:00',
  561. region: '石板泉风电场',
  562. windpowerstationid: 'SBQ_FDC',
  563. weather: '晴',
  564. maximumtem: '15',
  565. minimumtem: '-2',
  566. sunrise: '07:37',
  567. sunset: '18:48',
  568. sunduration: '11',
  569. weather1: '晴',
  570. temperature1: '-15',
  571. realfeel1: '15',
  572. precipitation1: '0',
  573. winddrection1: '0',
  574. speed1: '3',
  575. gust1: '3',
  576. weather2: '晴',
  577. temperature2: '-2',
  578. realfeel2: '-3',
  579. precipitation2: '0',
  580. winddirection2: '东北',
  581. speed2: '3',
  582. gust2: '3'
  583. },
  584. {
  585. id: '238466634',
  586. recodedata: '2020/03/15 00:00:00',
  587. region: '石板泉风电场',
  588. windpowerstationid: 'SBQ_FDC',
  589. weather: '晴',
  590. maximumtem: '15',
  591. minimumtem: '-2',
  592. sunrise: '07:37',
  593. sunset: '18:48',
  594. sunduration: '11',
  595. weather1: '晴',
  596. temperature1: '-15',
  597. realfeel1: '15',
  598. precipitation1: '0',
  599. winddrection1: '0',
  600. speed1: '3',
  601. gust1: '3',
  602. weather2: '晴',
  603. temperature2: '-2',
  604. realfeel2: '-3',
  605. precipitation2: '0',
  606. winddirection2: '东北',
  607. speed2: '3',
  608. gust2: '3'
  609. },
  610. {
  611. id: '238466634',
  612. recodedata: '2020/03/16 00:00:00',
  613. region: '石板泉风电场',
  614. windpowerstationid: 'SBQ_FDC',
  615. weather: '晴',
  616. maximumtem: '15',
  617. minimumtem: '-2',
  618. sunrise: '07:37',
  619. sunset: '18:48',
  620. sunduration: '11',
  621. weather1: '晴',
  622. temperature1: '-15',
  623. realfeel1: '15',
  624. precipitation1: '0',
  625. winddrection1: '0',
  626. speed1: '3',
  627. gust1: '3',
  628. weather2: '晴',
  629. temperature2: '-2',
  630. realfeel2: '-3',
  631. precipitation2: '0',
  632. winddirection2: '东北',
  633. speed2: '3',
  634. gust2: '3'
  635. },
  636. {
  637. id: '238466634',
  638. recodedata: '2020/03/17 00:00:00',
  639. region: '石板泉风电场',
  640. windpowerstationid: 'SBQ_FDC',
  641. weather: '晴',
  642. maximumtem: '15',
  643. minimumtem: '-2',
  644. sunrise: '07:37',
  645. sunset: '18:48',
  646. sunduration: '11',
  647. weather1: '晴',
  648. temperature1: '-15',
  649. realfeel1: '15',
  650. precipitation1: '0',
  651. winddrection1: '0',
  652. speed1: '3',
  653. gust1: '3',
  654. weather2: '晴',
  655. temperature2: '-2',
  656. realfeel2: '-3',
  657. precipitation2: '0',
  658. winddirection2: '东北',
  659. speed2: '3',
  660. gust2: '3'
  661. },
  662. {
  663. id: '238466634',
  664. recodedata: '2020/03/18 00:00:00',
  665. region: '石板泉风电场',
  666. windpowerstationid: 'SBQ_FDC',
  667. weather: '晴',
  668. maximumtem: '15',
  669. minimumtem: '-2',
  670. sunrise: '07:37',
  671. sunset: '18:48',
  672. sunduration: '11',
  673. weather1: '晴',
  674. temperature1: '-15',
  675. realfeel1: '15',
  676. precipitation1: '0',
  677. winddrection1: '0',
  678. speed1: '3',
  679. gust1: '3',
  680. weather2: '晴',
  681. temperature2: '-2',
  682. realfeel2: '-3',
  683. precipitation2: '0',
  684. winddirection2: '东北',
  685. speed2: '3',
  686. gust2: '3'
  687. },
  688. {
  689. id: '238466634',
  690. recodedata: '2020/03/19 00:00:00',
  691. region: '石板泉风电场',
  692. windpowerstationid: 'SBQ_FDC',
  693. weather: '晴',
  694. maximumtem: '15',
  695. minimumtem: '-2',
  696. sunrise: '07:37',
  697. sunset: '18:48',
  698. sunduration: '11',
  699. weather1: '晴',
  700. temperature1: '-15',
  701. realfeel1: '15',
  702. precipitation1: '0',
  703. winddrection1: '0',
  704. speed1: '3',
  705. gust1: '3',
  706. weather2: '晴',
  707. temperature2: '-2',
  708. realfeel2: '-3',
  709. precipitation2: '0',
  710. winddirection2: '东北',
  711. speed2: '3',
  712. gust2: '3'
  713. },
  714. {
  715. id: '238466634',
  716. recodedata: '2020/03/20 00:00:00',
  717. region: '石板泉风电场',
  718. windpowerstationid: 'SBQ_FDC',
  719. weather: '晴',
  720. maximumtem: '15',
  721. minimumtem: '-2',
  722. sunrise: '07:37',
  723. sunset: '18:48',
  724. sunduration: '11',
  725. weather1: '晴',
  726. temperature1: '-15',
  727. realfeel1: '15',
  728. precipitation1: '0',
  729. winddrection1: '0',
  730. speed1: '3',
  731. gust1: '3',
  732. weather2: '晴',
  733. temperature2: '-2',
  734. realfeel2: '-3',
  735. precipitation2: '0',
  736. winddirection2: '东北',
  737. speed2: '3',
  738. gust2: '3'
  739. },
  740. {
  741. id: '238466634',
  742. recodedata: '2020/03/21 00:00:00',
  743. region: '石板泉风电场',
  744. windpowerstationid: 'SBQ_FDC',
  745. weather: '晴',
  746. maximumtem: '15',
  747. minimumtem: '-2',
  748. sunrise: '07:37',
  749. sunset: '18:48',
  750. sunduration: '11',
  751. weather1: '晴',
  752. temperature1: '-15',
  753. realfeel1: '15',
  754. precipitation1: '0',
  755. winddrection1: '0',
  756. speed1: '3',
  757. gust1: '3',
  758. weather2: '晴',
  759. temperature2: '-2',
  760. realfeel2: '-3',
  761. precipitation2: '0',
  762. winddirection2: '东北',
  763. speed2: '3',
  764. gust2: '3'
  765. },
  766. {
  767. id: '238466634',
  768. recodedata: '2020/03/22 00:00:00',
  769. region: '石板泉风电场',
  770. windpowerstationid: 'SBQ_FDC',
  771. weather: '晴',
  772. maximumtem: '15',
  773. minimumtem: '-2',
  774. sunrise: '07:37',
  775. sunset: '18:48',
  776. sunduration: '11',
  777. weather1: '晴',
  778. temperature1: '-15',
  779. realfeel1: '15',
  780. precipitation1: '0',
  781. winddrection1: '0',
  782. speed1: '3',
  783. gust1: '3',
  784. weather2: '晴',
  785. temperature2: '-2',
  786. realfeel2: '-3',
  787. precipitation2: '0',
  788. winddirection2: '东北',
  789. speed2: '3',
  790. gust2: '3'
  791. },
  792. {
  793. id: '238466634',
  794. recodedata: '2020/03/23 00:00:00',
  795. region: '石板泉风电场',
  796. windpowerstationid: 'SBQ_FDC',
  797. weather: '晴',
  798. maximumtem: '15',
  799. minimumtem: '-2',
  800. sunrise: '07:37',
  801. sunset: '18:48',
  802. sunduration: '11',
  803. weather1: '晴',
  804. temperature1: '-15',
  805. realfeel1: '15',
  806. precipitation1: '0',
  807. winddrection1: '0',
  808. speed1: '3',
  809. gust1: '3',
  810. weather2: '晴',
  811. temperature2: '-2',
  812. realfeel2: '-3',
  813. precipitation2: '0',
  814. winddirection2: '东北',
  815. speed2: '3',
  816. gust2: '3'
  817. },
  818. {
  819. id: '238466634',
  820. recodedata: '2020/03/24 00:00:00',
  821. region: '石板泉风电场',
  822. windpowerstationid: 'SBQ_FDC',
  823. weather: '晴',
  824. maximumtem: '15',
  825. minimumtem: '-2',
  826. sunrise: '07:37',
  827. sunset: '18:48',
  828. sunduration: '11',
  829. weather1: '晴',
  830. temperature1: '-15',
  831. realfeel1: '15',
  832. precipitation1: '0',
  833. winddrection1: '0',
  834. speed1: '3',
  835. gust1: '3',
  836. weather2: '晴',
  837. temperature2: '-2',
  838. realfeel2: '-3',
  839. precipitation2: '0',
  840. winddirection2: '东北',
  841. speed2: '3',
  842. gust2: '3'
  843. },
  844. {
  845. id: '238466634',
  846. recodedata: '2020/03/25 00:00:00',
  847. region: '石板泉风电场',
  848. windpowerstationid: 'SBQ_FDC',
  849. weather: '晴',
  850. maximumtem: '15',
  851. minimumtem: '-2',
  852. sunrise: '07:37',
  853. sunset: '18:48',
  854. sunduration: '11',
  855. weather1: '晴',
  856. temperature1: '-15',
  857. realfeel1: '15',
  858. precipitation1: '0',
  859. winddrection1: '0',
  860. speed1: '3',
  861. gust1: '3',
  862. weather2: '晴',
  863. temperature2: '-2',
  864. realfeel2: '-3',
  865. precipitation2: '0',
  866. winddirection2: '东北',
  867. speed2: '3',
  868. gust2: '3'
  869. },
  870. {
  871. id: '238466634',
  872. recodedata: '2020/03/26 00:00:00',
  873. region: '石板泉风电场',
  874. windpowerstationid: 'SBQ_FDC',
  875. weather: '晴',
  876. maximumtem: '15',
  877. minimumtem: '-2',
  878. sunrise: '07:37',
  879. sunset: '18:48',
  880. sunduration: '11',
  881. weather1: '晴',
  882. temperature1: '-15',
  883. realfeel1: '15',
  884. precipitation1: '0',
  885. winddrection1: '0',
  886. speed1: '3',
  887. gust1: '3',
  888. weather2: '晴',
  889. temperature2: '-2',
  890. realfeel2: '-3',
  891. precipitation2: '0',
  892. winddirection2: '东北',
  893. speed2: '3',
  894. gust2: '3'
  895. },
  896. {
  897. id: '238466634',
  898. recodedata: '2020/03/27 00:00:00',
  899. region: '石板泉风电场',
  900. windpowerstationid: 'SBQ_FDC',
  901. weather: '晴',
  902. maximumtem: '15',
  903. minimumtem: '-2',
  904. sunrise: '07:37',
  905. sunset: '18:48',
  906. sunduration: '11',
  907. weather1: '晴',
  908. temperature1: '-15',
  909. realfeel1: '15',
  910. precipitation1: '0',
  911. winddrection1: '0',
  912. speed1: '3',
  913. gust1: '3',
  914. weather2: '晴',
  915. temperature2: '-2',
  916. realfeel2: '-3',
  917. precipitation2: '0',
  918. winddirection2: '东北',
  919. speed2: '3',
  920. gust2: '3'
  921. },
  922. {
  923. id: '238466634',
  924. recodedata: '2020/03/28 00:00:00',
  925. region: '石板泉风电场',
  926. windpowerstationid: 'SBQ_FDC',
  927. weather: '晴',
  928. maximumtem: '15',
  929. minimumtem: '-2',
  930. sunrise: '07:37',
  931. sunset: '18:48',
  932. sunduration: '11',
  933. weather1: '晴',
  934. temperature1: '-15',
  935. realfeel1: '15',
  936. precipitation1: '0',
  937. winddrection1: '0',
  938. speed1: '3',
  939. gust1: '3',
  940. weather2: '晴',
  941. temperature2: '-2',
  942. realfeel2: '-3',
  943. precipitation2: '0',
  944. winddirection2: '东北',
  945. speed2: '3',
  946. gust2: '3'
  947. },
  948. {
  949. id: '238466634',
  950. recodedata: '2020/03/29 00:00:00',
  951. region: '石板泉风电场',
  952. windpowerstationid: 'SBQ_FDC',
  953. weather: '晴',
  954. maximumtem: '15',
  955. minimumtem: '-2',
  956. sunrise: '07:37',
  957. sunset: '18:48',
  958. sunduration: '11',
  959. weather1: '晴',
  960. temperature1: '-15',
  961. realfeel1: '15',
  962. precipitation1: '0',
  963. winddrection1: '0',
  964. speed1: '3',
  965. gust1: '3',
  966. weather2: '晴',
  967. temperature2: '-2',
  968. realfeel2: '-3',
  969. precipitation2: '0',
  970. winddirection2: '东北',
  971. speed2: '3',
  972. gust2: '3'
  973. },
  974. {
  975. id: '238466634',
  976. recodedata: '2020/03/30 00:00:00',
  977. region: '石板泉风电场',
  978. windpowerstationid: 'SBQ_FDC',
  979. weather: '晴',
  980. maximumtem: '15',
  981. minimumtem: '-2',
  982. sunrise: '07:37',
  983. sunset: '18:48',
  984. sunduration: '11',
  985. weather1: '晴',
  986. temperature1: '-15',
  987. realfeel1: '15',
  988. precipitation1: '0',
  989. winddrection1: '0',
  990. speed1: '3',
  991. gust1: '3',
  992. weather2: '晴',
  993. temperature2: '-2',
  994. realfeel2: '-3',
  995. precipitation2: '0',
  996. winddirection2: '东北',
  997. speed2: '3',
  998. gust2: '3'
  999. },
  1000. {
  1001. id: '238466634',
  1002. recodedata: '2020/03/31 00:00:00',
  1003. region: '石板泉风电场',
  1004. windpowerstationid: 'SBQ_FDC',
  1005. weather: '晴',
  1006. maximumtem: '15',
  1007. minimumtem: '-2',
  1008. sunrise: '07:37',
  1009. sunset: '18:48',
  1010. sunduration: '11',
  1011. weather1: '晴',
  1012. temperature1: '-15',
  1013. realfeel1: '15',
  1014. precipitation1: '0',
  1015. winddrection1: '0',
  1016. speed1: '3',
  1017. gust1: '3',
  1018. weather2: '晴',
  1019. temperature2: '-2',
  1020. realfeel2: '-3',
  1021. precipitation2: '0',
  1022. winddirection2: '东北',
  1023. speed2: '3',
  1024. gust2: '3'
  1025. },
  1026. {
  1027. id: '238466634',
  1028. recodedata: '2020/04/01 00:00:00',
  1029. region: '石板泉风电场',
  1030. windpowerstationid: 'SBQ_FDC',
  1031. weather: '晴',
  1032. maximumtem: '15',
  1033. minimumtem: '-2',
  1034. sunrise: '07:37',
  1035. sunset: '18:48',
  1036. sunduration: '11',
  1037. weather1: '晴',
  1038. temperature1: '-15',
  1039. realfeel1: '15',
  1040. precipitation1: '0',
  1041. winddrection1: '0',
  1042. speed1: '3',
  1043. gust1: '3',
  1044. weather2: '晴',
  1045. temperature2: '-2',
  1046. realfeel2: '-3',
  1047. precipitation2: '0',
  1048. winddirection2: '东北',
  1049. speed2: '3',
  1050. gust2: '3'
  1051. },
  1052. {
  1053. id: '238466634',
  1054. recodedata: '2020/04/02 00:00:00',
  1055. region: '石板泉风电场',
  1056. windpowerstationid: 'SBQ_FDC',
  1057. weather: '晴',
  1058. maximumtem: '15',
  1059. minimumtem: '-2',
  1060. sunrise: '07:37',
  1061. sunset: '18:48',
  1062. sunduration: '11',
  1063. weather1: '晴',
  1064. temperature1: '-15',
  1065. realfeel1: '15',
  1066. precipitation1: '0',
  1067. winddrection1: '0',
  1068. speed1: '3',
  1069. gust1: '3',
  1070. weather2: '晴',
  1071. temperature2: '-2',
  1072. realfeel2: '-3',
  1073. precipitation2: '0',
  1074. winddirection2: '东北',
  1075. speed2: '3',
  1076. gust2: '3'
  1077. },
  1078. {
  1079. id: '238466634',
  1080. recodedata: '2020/04/03 00:00:00',
  1081. region: '石板泉风电场',
  1082. windpowerstationid: 'SBQ_FDC',
  1083. weather: '晴',
  1084. maximumtem: '15',
  1085. minimumtem: '-2',
  1086. sunrise: '07:37',
  1087. sunset: '18:48',
  1088. sunduration: '11',
  1089. weather1: '晴',
  1090. temperature1: '-15',
  1091. realfeel1: '15',
  1092. precipitation1: '0',
  1093. winddrection1: '0',
  1094. speed1: '3',
  1095. gust1: '3',
  1096. weather2: '晴',
  1097. temperature2: '-2',
  1098. realfeel2: '-3',
  1099. precipitation2: '0',
  1100. winddirection2: '东北',
  1101. speed2: '3',
  1102. gust2: '3'
  1103. }
  1104. ],
  1105. weatherProphetDataAll_40:[],
  1106. startDate:"",
  1107. endDate:"",
  1108. realFeelFlag:true,
  1109. temperatureFlag:false,
  1110. speedFlag:false,
  1111. tabCur: 0,
  1112. mainCur: 0,
  1113. windPowerStationId:"MHS_FDC",
  1114. windowWidth:"",
  1115. windowHeight:"",
  1116. choiceFontSize:"",
  1117. choiceMarginTop:"",
  1118. xAxisFontSize:"",
  1119. seriesTextSize:"",
  1120. cardWidth:"",
  1121. cardHeight:"",
  1122. scrollListHeight:""
  1123. };
  1124. },
  1125. created: function() {
  1126. //this.pushWindPowerStationNameToSessionStorage("麻黄山");
  1127. this.address = this.getWindPowerStationNameToSessionStorage();
  1128. this.windPowerStationId=uni.getStorageSync('windPowerStationId');
  1129. //this.getServerData();
  1130. this.getWeatherData();
  1131. //alert(this.address);
  1132. this.windowWidth=uni.getSystemInfoSync().windowWidth;
  1133. this.windowHeight=uni.getSystemInfoSync().windowHeight;
  1134. if(this.windowWidth>=768){
  1135. this.choiceFontSize="22px";
  1136. this.choiceMarginTop="27.5px";
  1137. this.xAxisFontSize=18;
  1138. this.seriesTextSize=18;
  1139. this.cardWidth=100;
  1140. this.cardHeight=130;
  1141. this.scrollListHeight=(this.windowHeight-550)+"px";
  1142. }else{
  1143. this.choiceFontSize="15px";
  1144. this.choiceMarginTop="0";
  1145. this.xAxisFontSize=12;
  1146. this.seriesTextSize=12;
  1147. this.cardWidth=100;
  1148. this.cardHeight=100;
  1149. this.scrollListHeight=(this.windowHeight-360)+"px";
  1150. }
  1151. },
  1152. onShow() {
  1153. this.address = this.getWindPowerStationNameToSessionStorage();
  1154. this.windPowerStationId=uni.getStorageSync('windPowerStationId');
  1155. this.getWeatherData();
  1156. },
  1157. methods: {
  1158. pushWindPowerStationNameToSessionStorage(windpowerstationName) {
  1159. uni.setStorageSync('windpowerstationName',windpowerstationName);
  1160. //sessionStorage.setItem('windpowerstationName', windpowerstationName);
  1161. //alert("v"+ sessionStorage.getItem("windpowerstationName"));
  1162. //this.common.goback('/pages/index/Index');
  1163. },
  1164. getWindPowerStationNameToSessionStorage() {
  1165. uni.getStorageSync('windpowerstationName');
  1166. return uni.getStorageSync('windpowerstationName');
  1167. },
  1168. realFeelSwitch(){
  1169. this.realFeelFlag=true;
  1170. this.temperatureFlag=false;
  1171. this.speedFlag=false;
  1172. this.getServerData();
  1173. },
  1174. temperatureSwitch(){
  1175. this.realFeelFlag=false;
  1176. this.temperatureFlag=true;
  1177. this.speedFlag=false;
  1178. this.getServerData();
  1179. },
  1180. speedSwitch(){
  1181. this.realFeelFlag=false;
  1182. this.temperatureFlag=false;
  1183. this.speedFlag=true;
  1184. this.getServerData();
  1185. },
  1186. getWeatherData: function() {
  1187. let _this = this;
  1188. // 创建一个this.socketTask对象【发送、接收、关闭socket都由这个对象操作】
  1189. this.socketTask = uni.connectSocket({
  1190. // 【非常重要】必须确保你的服务器是成功的,如果是手机测试千万别使用ws://127.0.0.1:9099【特别容易犯的错误】
  1191. url: "ws://49.4.78.143:8081/websocket/pageNumber_5/functionNumber_1",
  1192. success(data) {
  1193. console.log("websocket连接成功");
  1194. },
  1195. });
  1196. // 消息的发送和接收必须在正常连接打开中,才能发送或接收【否则会失败】
  1197. this.socketTask.onOpen((res) => {
  1198. console.log("WebSocket连接正常打开中...!");
  1199. this.is_open_socket = true;
  1200. // 注:只有连接正常打开中 ,才能正常收到消息
  1201. this.socketTask.onMessage((res) => {
  1202. //console.log("收到服务器内容:" + res.data);
  1203. _this.weatherProphetDataAll_40 =res.data;
  1204. _this.weatherProphetDataAll_40=JSON.parse(res.data);
  1205. _this.weatherProphetData_40 = [];
  1206. //判断风场id 40天
  1207. for(let i = 0; i < _this.weatherProphetDataAll_40.length; i++) {
  1208. if(_this.weatherProphetDataAll_40[i].windpowerstationid == _this.windPowerStationId) {
  1209. _this.weatherProphetData_40.push(_this.weatherProphetDataAll_40[i]);
  1210. }
  1211. }
  1212. //console.log(_this.weatherProphetData_40);
  1213. let startMonth = new Date(_this.weatherProphetData_40[0].recodedata).getMonth() + 1;
  1214. let startDay = new Date(_this.weatherProphetData_40[0].recodedata).getDate() ;
  1215. _this.startDate = startMonth + "月" + startDay+"日";
  1216. let endMonth = new Date(_this.weatherProphetData_40[_this.weatherProphetData_40.length-1].recodedata).getMonth() + 1;
  1217. let endDay = new Date(_this.weatherProphetData_40[_this.weatherProphetData_40.length-1].recodedata).getDate() ;
  1218. _this.endDate = endMonth + "月" + endDay+"日";
  1219. _this.$refs.weatherCalendarCardList40.getWeatherData(this.cardWidth, this.cardHeight, _this.weatherProphetData_40);
  1220. _this.getServerData();
  1221. });
  1222. })
  1223. // 这里仅是事件监听【如果socket关闭了会执行】
  1224. this.socketTask.onClose(() => {
  1225. console.log("已经被关闭了")
  1226. })
  1227. /* let _this = this;
  1228. if(typeof(WebSocket) == "undefined") {
  1229. console.log("您的浏览器不支持WebSocket");
  1230. } else {
  1231. console.log("您的浏览器支持WebSocket");
  1232. //实现化WebSocket对象,指定要连接的服务器地址与端口 建立连接
  1233. this.socket = new WebSocket("ws://49.4.78.143:8081/websocket/pageNumber_5/functionNumber_1");
  1234. this.openSocket();
  1235. //获得消息事件
  1236. this.socket.onmessage = function onMessage(message) {
  1237. _this.weatherProphetDataAll_40 = eval(message.data);
  1238. _this.weatherProphetData_40 = [];
  1239. //判断风场id 40天
  1240. for(let i = 0; i < _this.weatherProphetDataAll_40.length; i++) {
  1241. if(_this.weatherProphetDataAll_40[i].windpowerstationid == _this.windPowerStationId) {
  1242. _this.weatherProphetData_40.push(_this.weatherProphetDataAll_40[i]);
  1243. }
  1244. }
  1245. //console.log(_this.weatherProphetData_40);
  1246. let startMonth = new Date(_this.weatherProphetData_40[0].recodedata).getMonth() + 1;
  1247. let startDay = new Date(_this.weatherProphetData_40[0].recodedata).getDate() ;
  1248. _this.startDate = startMonth + "月" + startDay+"日";
  1249. let endMonth = new Date(_this.weatherProphetData_40[_this.weatherProphetData_40.length-1].recodedata).getMonth() + 1;
  1250. let endDay = new Date(_this.weatherProphetData_40[_this.weatherProphetData_40.length-1].recodedata).getDate() ;
  1251. _this.endDate = endMonth + "月" + endDay+"日";
  1252. _this.$refs.weatherCalendarCardList40.getWeatherData("79", "100", _this.weatherProphetData_40);
  1253. _this.getServerData();
  1254. }
  1255. } */
  1256. },
  1257. getServerData(){
  1258. let LineA={
  1259. categories: ['2012', '2013', '2014', '2015', '2016', '2017'],
  1260. series: [{
  1261. name: '体感温度',
  1262. data: [35, 20, 25, 37, 4, 20],
  1263. color: '#FFFFFF',
  1264. textColor:"#FFFFFF",
  1265. textSize:this.seriesTextSize,
  1266. format:(val)=>{return val+'℃'}
  1267. }, {
  1268. name: '温度',
  1269. data: [70, 40, 65, 100, 44, 68],
  1270. color: '#FFFFFF',
  1271. textColor:"#FFFFFF",
  1272. textSize:this.seriesTextSize,
  1273. format:(val)=>{return val+'℃'}
  1274. }, {
  1275. name: '风速',
  1276. data: [100, 80, 95, 150, 112, 132],
  1277. color: '#FFFFFF',
  1278. textColor:"#FFFFFF",
  1279. textSize:this.seriesTextSize,
  1280. format:(val)=>{return val+'km/h'}
  1281. }]
  1282. };
  1283. LineA.categories=[];
  1284. LineA.series[0].data=[];
  1285. LineA.series[1].data=[];
  1286. LineA.series[2].data=[];
  1287. if(this.realFeelFlag){
  1288. for(let i=0;i<this.weatherProphetData_40.length;i++){
  1289. let xAxisMonth = new Date(this.weatherProphetData_40[i].recodedata).getMonth()+ 1;
  1290. let xAxisData = new Date(this.weatherProphetData_40[i].recodedata).getDate();
  1291. if(xAxisMonth<10){
  1292. xAxisMonth="0"+xAxisMonth;
  1293. }
  1294. LineA.categories.push(xAxisMonth + '/' + xAxisData );
  1295. LineA.series[0].data.push(this.weatherProphetData_40[i].realfeel1);
  1296. }
  1297. }else if(this.temperatureFlag){
  1298. for(let i=0;i<this.weatherProphetData_40.length;i++){
  1299. let xAxisMonth = new Date(this.weatherProphetData_40[i].recodedata).getMonth()+ 1;
  1300. let xAxisData = new Date(this.weatherProphetData_40[i].recodedata).getDate();
  1301. if(xAxisMonth<10){
  1302. xAxisMonth="0"+xAxisMonth;
  1303. }
  1304. LineA.categories.push(xAxisMonth + '/' + xAxisData );
  1305. LineA.series[1].data.push(this.weatherProphetData_40[i].temperature1);
  1306. }
  1307. }else if(this.speedFlag){
  1308. for(let i=0;i<this.weatherProphetData_40.length;i++){
  1309. let xAxisMonth = new Date(this.weatherProphetData_40[i].recodedata).getMonth()+ 1;
  1310. let xAxisData = new Date(this.weatherProphetData_40[i].recodedata).getDate();
  1311. if(xAxisMonth<10){
  1312. xAxisMonth="0"+xAxisMonth;
  1313. }
  1314. LineA.categories.push(xAxisMonth + '/' + xAxisData );
  1315. LineA.series[2].data.push(this.weatherProphetData_40[i].speed1);
  1316. }
  1317. }
  1318. this.showLineA("canvasLineA",LineA);
  1319. },
  1320. showLineA(canvasId,chartData){
  1321. var _self = this;
  1322. var canvaLineA=new uCharts({
  1323. $this:_self,
  1324. canvasId: canvasId,
  1325. type: 'line',
  1326. fontSize:11,
  1327. legend:{show:false},//图例
  1328. dataLabel:true,//数据点标签
  1329. dataPointShape:true,
  1330. background:'#FFFFFF',
  1331. pixelRatio:_self.pixelRatio,
  1332. categories: chartData.categories,
  1333. series: chartData.series,
  1334. animation: true,
  1335. xAxis: {
  1336. type:'grid',
  1337. gridColor:'#CCCCCC',
  1338. gridType:'dash',
  1339. dashLength:8,
  1340. disableGrid:true,//网格线
  1341. axisLine:true,//x轴轴线
  1342. fontColor:"#FFFFFF",
  1343. fontSize:_self.xAxisFontSize
  1344. },
  1345. yAxis: {
  1346. data:{
  1347. disabled:false//y轴轴线
  1348. },
  1349. disableGrid:true,//网格线
  1350. gridType:'dash',
  1351. gridColor:'#CCCCCC',
  1352. dashLength:8,
  1353. splitNumber:5,
  1354. min:-40,
  1355. max:40,
  1356. format:(val)=>{return val.toFixed(0)+'元'}
  1357. },
  1358. width: _self.cWidth*_self.pixelRatio,
  1359. height: _self.cHeight*_self.pixelRatio,
  1360. padding:[0,0,10,-30],//画布填充边距,顺序为上右下左,同css,但必须4位
  1361. extra: {
  1362. line:{
  1363. type: 'curve'//曲线
  1364. }
  1365. }
  1366. });
  1367. },
  1368. // touchLineA(e) {
  1369. // canvaLineA.showToolTip(e, {
  1370. // format: function (item, category) {
  1371. // return category + ' ' + item.name + ':' + item.data
  1372. // }
  1373. // });
  1374. // },
  1375. uChartsScrollEvent(e){
  1376. this.scrollposition_uCharts = e.detail.scrollLeft;
  1377. if(e.detail.scrollLeft<237){
  1378. this.scrollposition_list=0;
  1379. }else if(e.detail.scrollLeft<487&&e.detail.scrollLeft>237){
  1380. this.scrollposition_list=104;
  1381. }else if(e.detail.scrollLeft<737&&e.detail.scrollLeft>487){
  1382. this.scrollposition_list=208;
  1383. }else if(e.detail.scrollLeft<987&&e.detail.scrollLeft>737){
  1384. this.scrollposition_list=312;
  1385. }else if(e.detail.scrollLeft<1237&&e.detail.scrollLeft>987){
  1386. this.scrollposition_list=416;
  1387. }else if(e.detail.scrollLeft<1487&&e.detail.scrollLeft>1237){
  1388. this.scrollposition_list=520;
  1389. }else if(e.detail.scrollLeft<1737&&e.detail.scrollLeft>1487){
  1390. this.scrollposition_list=624;
  1391. }else if(e.detail.scrollLeft>1737){
  1392. this.scrollposition_list=656;
  1393. }
  1394. },
  1395. listScrollEvent(e){
  1396. this.scrollposition_list = e.detail.scrollTop;
  1397. if(e.detail.scrollTop<104){
  1398. this.scrollposition_uCharts=0;
  1399. }else if(e.detail.scrollTop<208&&e.detail.scrollTop>104){
  1400. this.scrollposition_uCharts=237;
  1401. }else if(e.detail.scrollTop<312&&e.detail.scrollTop>208){
  1402. this.scrollposition_uCharts=487;
  1403. }else if(e.detail.scrollTop<416&&e.detail.scrollTop>312){
  1404. this.scrollposition_uCharts=737;
  1405. }else if(e.detail.scrollTop<520&&e.detail.scrollTop>416){
  1406. this.scrollposition_uCharts=987;
  1407. }else if(e.detail.scrollTop<624&&e.detail.scrollTop>520){
  1408. this.scrollposition_uCharts=1237;
  1409. }else if(e.detail.scrollTop<656&&e.detail.scrollTop>624){
  1410. this.scrollposition_uCharts=1487;
  1411. }
  1412. },
  1413. closeSocket: function() {
  1414. this.socket.onclose;
  1415. },
  1416. openSocket: function() {
  1417. this.socket.onOpen;
  1418. }
  1419. },
  1420. onLoad() {
  1421. this.cWidth=uni.upx2px(5000);
  1422. this.cHeight=uni.upx2px(350);
  1423. this.address = this.getWindPowerStationNameToSessionStorage();;
  1424. // this.getWeatherData();
  1425. }
  1426. }
  1427. </script>
  1428. <style>
  1429. page {
  1430. background: -webkit-gradient(linear, 0% 100%, 0% 0%, from(#2F698E), color-stop(0.15, #5C757C), to(#004C90));
  1431. /* background-color: #108ADA; */
  1432. }
  1433. .cardContenter{
  1434. border-radius: 20px;
  1435. margin: 20px auto;
  1436. width: 90%;
  1437. height: 450upx;
  1438. background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#024F93), color-stop(1.5, #cccccc), to(#437193));
  1439. background: rgba(0, 0, 0, 0.1);
  1440. }
  1441. .dateAndChoice{
  1442. width: 100%;
  1443. height: 100upx;
  1444. }
  1445. .date{
  1446. width: 40%;
  1447. height: 100upx;
  1448. line-height: 100upx;
  1449. color: white;
  1450. margin-left: 5px;
  1451. float: left;
  1452. }
  1453. .choice{
  1454. width: calc(60% - 5px);
  1455. height: 100upx;
  1456. float: right;
  1457. }
  1458. .realFeelButtonWhite {
  1459. height: 37px;
  1460. // margin-top: 3px;
  1461. line-height: 44px;
  1462. /* margin-left: 20px; */
  1463. color: white;
  1464. font-size: 15px;
  1465. border-style: solid;
  1466. border-top-width: 0px;
  1467. border-right-width: 0px;
  1468. border-bottom-width: 3px;
  1469. border-bottom-color: #FFEE35;
  1470. border-left-width: 0px;
  1471. font-family: "microsoft yahei";
  1472. float: right;
  1473. }
  1474. .realFeelButtonBlack{
  1475. height: 37px;
  1476. // margin-top: 3px;
  1477. line-height: 44px;
  1478. /* margin-left: 20px; */
  1479. color: #DEDEDE;
  1480. font-size: 15px;
  1481. font-family: "microsoft yahei";
  1482. float: right;
  1483. }
  1484. .temperatureButtonWhite {
  1485. height: 37px;
  1486. // margin-top: 3px;
  1487. line-height: 44px;
  1488. margin-left: 20px;
  1489. color: white;
  1490. font-size: 15px;
  1491. border-style: solid;
  1492. border-top-width: 0px;
  1493. border-right-width: 0px;
  1494. border-bottom-width: 3px;
  1495. border-bottom-color: #FFEE35;
  1496. border-left-width: 0px;
  1497. font-family: "microsoft yahei";
  1498. float: right;
  1499. }
  1500. .temperatureButtonBlack{
  1501. height: 37px;
  1502. // margin-top: 3px;
  1503. line-height: 44px;
  1504. margin-left: 20px;
  1505. color: #DEDEDE;
  1506. font-size: 15px;
  1507. font-family: "microsoft yahei";
  1508. float: right;
  1509. }
  1510. .speedButtonWhite {
  1511. height: 37px;
  1512. // margin-top: 3px;
  1513. line-height: 44px;
  1514. margin-left: 20px;
  1515. margin-right: 20px;
  1516. color: white;
  1517. font-size: 15px;
  1518. border-style: solid;
  1519. border-top-width: 0px;
  1520. border-right-width: 0px;
  1521. border-bottom-width: 3px;
  1522. border-bottom-color: #FFEE35;
  1523. border-left-width: 0px;
  1524. font-family: "microsoft yahei";
  1525. float: right;
  1526. }
  1527. .speedButtonBlack{
  1528. height: 37px;
  1529. // margin-top: 3px;
  1530. line-height: 44px;
  1531. margin-left: 20px;
  1532. margin-right: 20px;
  1533. color: #DEDEDE;
  1534. font-size: 15px;
  1535. font-family: "microsoft yahei";
  1536. float: right;
  1537. }
  1538. .scrollUcharts{
  1539. white-space: nowrap;
  1540. }
  1541. .scrollList{
  1542. height: 330px;
  1543. }
  1544. .qiun-charts {
  1545. width: 5000upx;
  1546. height: 350upx;
  1547. //background-color: #FFFFFF;
  1548. }
  1549. .charts {
  1550. width: 5000upx;
  1551. height: 350upx;
  1552. //background-color: #FFFFFF;
  1553. }
  1554. </style>