index.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972
  1. <template>
  2. <view>
  3. <view class="weather">
  4. <image
  5. :src="
  6. 'https://webstaticimg.oss-cn-hangzhou.aliyuncs.com/bigdata_app/img/weather/' +
  7. weatherinfo.wea +
  8. '.png'
  9. "
  10. mode=""
  11. class="weaimg"
  12. ></image>
  13. <view class="weatext">
  14. <view class="weatext_title">
  15. {{ hello }}
  16. </view>
  17. <view class=""> 欢迎登录云飞智控 </view>
  18. </view>
  19. </view>
  20. <view class="weatherinfo">
  21. <view class="weatherinfo_item">
  22. <image
  23. src="https://www.hnyfwlw.com:8006/bigdata_app/newindex/weizhi.png"
  24. mode=""
  25. class="weaimg"
  26. ></image>
  27. <view class="textbox">
  28. {{ weatherinfo.district || '-' }}
  29. </view>
  30. </view>
  31. <view class="weatherinfo_item">
  32. <image
  33. src="https://www.hnyfwlw.com:8006/bigdata_app/newindex/wendu.png"
  34. mode=""
  35. class="weaimg"
  36. ></image>
  37. <view class="textbox"> {{ weatherinfo.at || '-' }}℃ </view>
  38. </view>
  39. <view class="weatherinfo_item">
  40. <image
  41. src="https://www.hnyfwlw.com:8006/bigdata_app/newindex/shidu.png"
  42. mode=""
  43. class="weaimg"
  44. ></image>
  45. <view class="textbox"> {{ weatherinfo.ah || '-' }} </view>
  46. </view>
  47. <view class="weatherinfo_item">
  48. <view class="first_item"> PM2.5 </view>
  49. <view class="textbox">
  50. {{ weatherinfo.air_pm25 || '-' }}
  51. </view>
  52. </view>
  53. </view>
  54. <view class="functionbox">
  55. <view class="functionbox_title"> 功能应用 </view>
  56. <view class="functionbox_text">
  57. <view
  58. class="functionbox_text_item"
  59. v-if="jurisdiction.sqtf"
  60. @click="tabfunction(0)"
  61. >
  62. <image
  63. src="https://www.hnyfwlw.com:8006/bigdata_app/newindex/base.png"
  64. mode=""
  65. class="itemimg"
  66. ></image>
  67. <view class=""> 四情基地 </view>
  68. </view>
  69. <view class="functionbox_text_item" @click="tabfunction(1)">
  70. <image
  71. src="https://www.hnyfwlw.com:8006/bigdata_app/newindex/worm.png"
  72. mode=""
  73. class="itemimg"
  74. ></image>
  75. <view class=""> 田间随识 </view>
  76. </view>
  77. <view
  78. class="functionbox_text_item"
  79. v-if="jurisdiction.zjtf"
  80. @click="tabfunction(2)"
  81. >
  82. <image
  83. src="https://www.hnyfwlw.com:8006/bigdata_app/newindex/knowledge.png"
  84. mode=""
  85. class="itemimg"
  86. ></image>
  87. <view class=""> 知识百科 </view>
  88. </view>
  89. <view class="functionbox_text_item" @click="tabfunction(3)">
  90. <image
  91. src="https://www.hnyfwlw.com:8006/bigdata_app/newindex/aftersale.png"
  92. mode=""
  93. class="itemimg"
  94. ></image>
  95. <view class=""> 售后服务 </view>
  96. </view>
  97. </view>
  98. </view>
  99. <view class="facilitybox">
  100. <view class="facilitybox_title"> 系统设备 </view>
  101. <view class="facilitybox_itembox">
  102. <view
  103. class="facilitybox_item"
  104. v-if="jurisdiction.cbtf"
  105. @click="tabequipment('../cb/index/index')"
  106. >
  107. <image
  108. src="https://www.hnyfwlw.com:8006/bigdata_app/newindex/cb.png"
  109. mode=""
  110. class="itemimg"
  111. ></image>
  112. <view class=""> 测报系统 </view>
  113. </view>
  114. <view
  115. class="facilitybox_item"
  116. v-if="jurisdiction.cbyj"
  117. @click="tabequipment('../cbqxyj/cbwarn')"
  118. >
  119. <image
  120. src="https://www.hnyfwlw.com:8006/bigdata_app/newindex/cbyj.png"
  121. mode=""
  122. class="itemimg"
  123. ></image>
  124. <view class=""> 测报预警 </view>
  125. </view>
  126. <view
  127. class="facilitybox_item"
  128. v-if="jurisdiction.fztf"
  129. @click="tabequipment('../prevention/index')"
  130. >
  131. <image
  132. src="https://www.hnyfwlw.com:8006/bigdata_app/newindex/fz.png"
  133. mode=""
  134. class="itemimg"
  135. ></image>
  136. <view class=""> 防治系统 </view>
  137. </view>
  138. <view
  139. class="facilitybox_item"
  140. v-if="jurisdiction.jktf"
  141. @click="tabequipment('../monitor/index')"
  142. >
  143. <image
  144. src="https://www.hnyfwlw.com:8006/bigdata_app/newindex/jk.png"
  145. mode=""
  146. class="itemimg"
  147. ></image>
  148. <view class=""> 监控系统 </view>
  149. </view>
  150. <view
  151. class="facilitybox_item"
  152. v-if="jurisdiction.hjtf"
  153. @click="tabequipment('../environment/index')"
  154. >
  155. <image
  156. src="https://www.hnyfwlw.com:8006/bigdata_app/newindex/hj.png"
  157. mode=""
  158. class="itemimg"
  159. ></image>
  160. <view class=""> 环境监测 </view>
  161. </view>
  162. <view
  163. class="facilitybox_item"
  164. v-if="jurisdiction.qxz"
  165. @click="tabequipment('../qxzyj/cbwarn', 5)"
  166. >
  167. <image
  168. src="https://www.hnyfwlw.com:8006/bigdata_app/newindex/qxyj.png"
  169. mode=""
  170. class="itemimg"
  171. ></image>
  172. <view class=""> 气象预警 </view>
  173. </view>
  174. <view
  175. class="facilitybox_item"
  176. v-if="jurisdiction.sq"
  177. @click="tabequipment('../qxzyj/cbwarn', '15')"
  178. >
  179. <image
  180. src="https://www.hnyfwlw.com:8006/bigdata_app/newindex/sqyj.png"
  181. mode=""
  182. class="itemimg"
  183. >
  184. </image>
  185. <view class=""> 墒情预警 </view>
  186. </view>
  187. <view
  188. class="facilitybox_item"
  189. v-if="jurisdiction.ggtf"
  190. @click="tabequipment('../irrigate/index')"
  191. >
  192. <image
  193. src="https://www.hnyfwlw.com:8006/bigdata_app/newindex/guangai.png"
  194. mode=""
  195. class="itemimg"
  196. ></image>
  197. <view class=""> 智能灌溉 </view>
  198. </view>
  199. <view
  200. class="facilitybox_item"
  201. v-if="jurisdiction.sbtf"
  202. @click="tabequipment('../equipMange/index/index')"
  203. >
  204. <image
  205. src="https://www.hnyfwlw.com:8006/bigdata_app/newindex/user.png"
  206. mode=""
  207. class="itemimg"
  208. ></image>
  209. <view class=""> 用户管理 </view>
  210. </view>
  211. </view>
  212. </view>
  213. <view class="insectattack">
  214. <view class="insectattack_title" @click="worm">
  215. <view class=""> 虫情百科 </view>
  216. <view class="iconbox">
  217. <u-icon name="arrow-right"></u-icon>
  218. </view>
  219. </view>
  220. <!-- <view class="insectattack_listbox">
  221. <view class="insectattack_list">
  222. <view class="list_box list_box1" @click="introduce(79,'虫情百科')">
  223. <view class="list_boxbg">
  224. <image src="https://www.hnyfwlw.com:8006/bigdata_app/newindex/cao.png" mode="" class="list_boxbg_img"></image>
  225. </view>
  226. <view class="list_box_xiang">
  227. <view class="list_box_xiang_click">
  228. 详情
  229. </view>
  230. </view>
  231. <view class="list_box_info">
  232. <view class="list_box_info_name">
  233. 小地老虎
  234. </view>
  235. <view class="list_box_info_text">
  236. 该虫能危害百余种植物,是对农、林木幼苗危害很大的地下害虫, 在东北主要危害落叶松、红松、水曲柳、核桃楸等苗木
  237. </view>
  238. </view>
  239. </view>
  240. <view class="list_box list_box2" @click="introduce(369,'虫情百科')">
  241. <view class="list_boxbg">
  242. <image src="https://www.hnyfwlw.com:8006/bigdata_app/newindex/yee.jpg" mode="" class="list_boxbg_img"></image>
  243. </view>
  244. <view class="list_box_xiang">
  245. <view class="list_box_xiang_click">
  246. 详情
  247. </view>
  248. </view>
  249. <view class="list_box_info">
  250. <view class="list_box_info_name">
  251. 草地贪夜蛾
  252. </view>
  253. <view class="list_box_info_text">
  254. 草地贪夜蛾被认为是世界上最具破坏性的害虫之一,其巨大的破坏性主要源于其“贪”的本性——贪吃、贪育、贪婪、广适、耐药。
  255. </view>
  256. </view>
  257. </view>
  258. <view class="list_box list_box3" @click="introduce(6,'虫情百科')">
  259. <view class="list_boxbg">
  260. <image src="https://www.hnyfwlw.com:8006/bigdata_app/newindex/lingc.jpg" mode="" class="list_boxbg_img"></image>
  261. </view>
  262. <view class="list_box_xiang">
  263. <view class="list_box_xiang_click">
  264. 详情
  265. </view>
  266. </view>
  267. <view class="list_box_info">
  268. <view class="list_box_info_name">
  269. 棉铃虫
  270. </view>
  271. <view class="list_box_info_text">
  272. 棉铃虫具有高度多食性,可以为害20余科200多种植物,但比较喜食禾本科、锦葵科、茄科和豆科植物的花蕾和果实等繁殖器官。
  273. </view>
  274. </view>
  275. </view>
  276. <view class="list_box list_box4" @click="introduce(67,'虫情百科')">
  277. <view class="list_boxbg">
  278. <image src="https://www.hnyfwlw.com:8006/bigdata_app/newindex/ming.png" mode="" class="list_boxbg_img"></image>
  279. </view>
  280. <view class="list_box_xiang">
  281. <view class="list_box_xiang_click">
  282. 详情
  283. </view>
  284. </view>
  285. <view class="list_box_info">
  286. <view class="list_box_info_name">
  287. 稻纵卷叶螟
  288. </view>
  289. <view class="list_box_info_text">
  290. 生命潜能强,寿命长,产卵期长,产卵量也多。各代雌、雄蛾比例几乎各占半数。蛾子有强烈的趋荫蔽栖息习性
  291. </view>
  292. </view>
  293. </view>
  294. </view>
  295. </view> -->
  296. </view>
  297. <view class="insectattack">
  298. <view class="insectattack_title" @click="virus">
  299. <view class=""> 病害百科 </view>
  300. <view class="iconbox">
  301. <u-icon name="arrow-right"></u-icon>
  302. </view>
  303. </view>
  304. <!-- <view class="insectattack_listbox">
  305. <view class="insectattack_list">
  306. <view class="list_box list_box5" @click="introduce(267,'病害百科')">
  307. <view class="list_boxbg">
  308. <image src="https://www.hnyfwlw.com:8006/bigdata_app/newindex/mai.png" mode="" class="list_boxbg_img"></image>
  309. </view>
  310. <view class="list_box_xiang">
  311. <view class="list_box_xiang_click">
  312. 详情
  313. </view>
  314. </view>
  315. <view class="list_box_info">
  316. <view class="list_box_info_name">
  317. 小麦赤霉病
  318. </view>
  319. <view class="list_box_info_text">
  320. 小麦赤霉病从苗期到穗期均可发生,引起苗腐、茎基腐、秆腐和穗腐,以穗腐危害最大。湿度大时,病部均可见粉红色霉层。
  321. </view>
  322. </view>
  323. </view>
  324. <view class="list_box list_box6" @click="introduce(320,'病害百科')">
  325. <view class="list_boxbg">
  326. <image src="https://www.hnyfwlw.com:8006/bigdata_app/newindex/dadou.jpg" mode="" class="list_boxbg_img"></image>
  327. </view>
  328. <view class="list_box_xiang">
  329. <view class="list_box_xiang_click">
  330. 详情
  331. </view>
  332. </view>
  333. <view class="list_box_info">
  334. <view class="list_box_info_name">
  335. 大豆根腐病
  336. </view>
  337. <view class="list_box_info_text">
  338. 初期茎基部或胚根表皮出现淡红褐色不规则的小斑,后变红褐色凹陷坏死斑,绕根茎扩展致根皮枯死
  339. </view>
  340. </view>
  341. </view>
  342. <view class="list_box list_box7" @click="introduce(292,'病害百科')">
  343. <view class="list_boxbg">
  344. <image src="https://www.hnyfwlw.com:8006/bigdata_app/newindex/yumi.png" mode="" class="list_boxbg_img"></image>
  345. </view>
  346. <view class="list_box_xiang">
  347. <view class="list_box_xiang_click">
  348. 详情
  349. </view>
  350. </view>
  351. <view class="list_box_info">
  352. <view class="list_box_info_name">
  353. 玉米大斑病
  354. </view>
  355. <view class="list_box_info_text">
  356. 玉米大斑病主要为害叶片,严重时也为害叶鞘和苞叶。植株下部叶片先发病,然后向上扩展。
  357. </view>
  358. </view>
  359. </view>
  360. <view class="list_box list_box8" @click="introduce(278,'病害百科')">
  361. <view class="list_boxbg">
  362. <image src="https://www.hnyfwlw.com:8006/bigdata_app/newindex/dao.png" mode="" class="list_boxbg_img"></image>
  363. </view>
  364. <view class="list_box_xiang">
  365. <view class="list_box_xiang_click">
  366. 详情
  367. </view>
  368. </view>
  369. <view class="list_box_info">
  370. <view class="list_box_info_name">
  371. 水稻稻瘟病
  372. </view>
  373. <view class="list_box_info_text">
  374. 发生于三叶前,由种子带菌所致。病苗基部灰黑,上部变褐,卷缩而死,湿度较大时病部产生大量灰黑色霉层。
  375. </view>
  376. </view>
  377. </view>
  378. </view>
  379. </view> -->
  380. </view>
  381. </view>
  382. </template>
  383. <script>
  384. export default {
  385. data() {
  386. return {
  387. weatherinfo: {
  388. wea: '晴',
  389. },
  390. hello: '',
  391. jurisdiction: {
  392. cbtf: false,
  393. jktf: false,
  394. hjtf: false,
  395. fztf: false,
  396. sytf: false,
  397. sbtf: false,
  398. sqtf: false,
  399. zjtf: false,
  400. ggtf: false,
  401. qxz: false,
  402. sq: false,
  403. cbyj: false,
  404. },
  405. show: false,
  406. url: '',
  407. loadTF: false,
  408. };
  409. },
  410. watch: {
  411. url(news) {
  412. if (news != '') {
  413. uni.pageScrollTo({
  414. scrollTop: 0,
  415. duration: 500,
  416. });
  417. }
  418. },
  419. },
  420. methods: {
  421. moveHandle() {
  422. return;
  423. },
  424. async getcity(lng, lat) {
  425. const res = await this.$myRequest({
  426. url: '/api/api_gateway?method=device.device_manage.weathers',
  427. data: {
  428. lng: lng,
  429. lat: lat,
  430. },
  431. });
  432. console.log(res);
  433. this.weatherinfo = res[0];
  434. },
  435. async getUserlogin() {
  436. const res = await this.$myRequest({
  437. url: '/api/api_gateway?method=user.login.user_login_info',
  438. });
  439. // this.jurisdiction = {
  440. // cbtf: false,
  441. // jktf: false,
  442. // hjtf: false,
  443. // fztf: false,
  444. // sytf: false,
  445. // sbtf: false,
  446. // sqtf: false,
  447. // zjtf: false,
  448. // }
  449. uni.setStorage({
  450. key: 'jurisdiction',
  451. data: JSON.stringify(res.children),
  452. });
  453. uni.setStorage({
  454. key: 'myuser_type',
  455. data: JSON.stringify(res.myuser_type),
  456. });
  457. uni.setStorage({
  458. key: 'myuid',
  459. data: JSON.stringify(res.myuid),
  460. });
  461. let QueryPermission = (id) => {
  462. let list = res.children;
  463. for (var i = 0; i < list.length; i++) {
  464. if (list[i].children) {
  465. var data = list[i].children;
  466. for (var j = 0; j < data.length; j++) {
  467. if (data[j].children) {
  468. var item = data[j].children;
  469. for (var k = 0; k < item.length; k++) {
  470. if (item[k].pur_id == id) {
  471. return true;
  472. }
  473. }
  474. }
  475. }
  476. }
  477. }
  478. return false;
  479. };
  480. this.jurisdiction = {
  481. cbtf: false,
  482. jktf: false,
  483. hjtf: false,
  484. fztf: false,
  485. sytf: false,
  486. sbtf: false,
  487. sqtf: false,
  488. zjtf: false,
  489. qxz: QueryPermission(242),
  490. sq: QueryPermission(284),
  491. cbyj: QueryPermission(243),
  492. };
  493. console.log(res.children);
  494. for (var i = 0; i < res.children.length; i++) {
  495. switch (res.children[i].pur_id) {
  496. case 36:
  497. this.jurisdiction.cbtf = true; //"测报系统"
  498. break;
  499. case 42:
  500. this.jurisdiction.jktf = true; //"可视农业"
  501. break;
  502. case 40:
  503. this.jurisdiction.hjtf = true; //"环境监测系统"
  504. break;
  505. case 44:
  506. this.jurisdiction.fztf = true; //"防治系统"
  507. break;
  508. case 58:
  509. this.jurisdiction.sytf = true; //"溯源系统"
  510. break;
  511. case 28:
  512. this.jurisdiction.sbtf = true; //"系统管理"
  513. break;
  514. case 25:
  515. this.jurisdiction.sqtf = true; //"四情基地"
  516. break;
  517. case 124:
  518. this.jurisdiction.zjtf = true; //"专家诊断"
  519. break;
  520. // case "灌溉控制系统":
  521. // this.jurisdiction.sftf = true
  522. // break;
  523. case 202:
  524. this.jurisdiction.ggtf = true; //"灌溉控制系统"
  525. break;
  526. }
  527. }
  528. },
  529. tabfunction(index) {
  530. if (index == 0) {
  531. uni.navigateTo({
  532. url: '../fourBase/index',
  533. });
  534. } else if (index == 1) {
  535. // var that = this
  536. // this.show = true
  537. uni.navigateTo({
  538. url: '/pages/identifyPest/identifyPest',
  539. });
  540. } else if (index == 2) {
  541. uni.navigateTo({
  542. url: '../expertDiagnosis/index',
  543. });
  544. } else if (index == 3) {
  545. uni.navigateTo({
  546. url: '../afterSale/index',
  547. });
  548. }
  549. },
  550. tabequipment(url, type) {
  551. console.log(url);
  552. uni.navigateTo({
  553. url: `${url}${type ? `?typeId=${type}` : ''}`,
  554. });
  555. },
  556. // onok(ev) {
  557. // this.path = this.url;
  558. // console.log(ev);
  559. // this.loadTF = true;
  560. // uni.showLoading({
  561. // mask: true,
  562. // success: function () {
  563. // console.log(999);
  564. // },
  565. // });
  566. // var publiukey = `-----BEGIN PUBLIC KEY-----
  567. // MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC6m92fXUrccS4SoLg4W4jPRNua
  568. // 4BcRk4ldLcqPuQpD2Mds2+hw+Gi+0MUnshF/r/DTcCJgkt7rtoY9EB6/XJ6MFw14
  569. // whhESFie/lZUWRsk8M89Rkr8m5rwmBl+uLAd5LopyshFqKTBXeT2ytHP1JCQLPBO
  570. // 34Fy4/yEz4qEzkzBuwIDAQAB
  571. // -----END PUBLIC KEY-----`;
  572. // var time = +new Date();
  573. // var str2 = 'YuNfEi' + time + 'YuNfEi';
  574. // var pubblicData = jsencrypt.setEncrypt(publiukey, str2);
  575. // if (this.flag == 2) {
  576. // console.log('111');
  577. // // pest.pests.insect_discern 虫害
  578. // uni.uploadFile({
  579. // // url: 'http://114.115.147.140:8002/api/api_gateway?method=base.bases.base_photo', //仅为示例,非真实的接口地址
  580. // url: 'https://wx.hnyfwlw.com/api/api_gateway?method=pest.pests.insect_discern', //仅为示例,非真实的接口地址
  581. // filePath: ev.path,
  582. // name: 'img_file',
  583. // formData: {
  584. // user: 'test',
  585. // sign: pubblicData,
  586. // },
  587. // success: (uploadFileRes) => {
  588. // this.loadTF = false;
  589. // console.log(JSON.parse(uploadFileRes.data));
  590. // uni.navigateTo({
  591. // url:
  592. // '../disandpests/index?datas=' +
  593. // uploadFileRes.data +
  594. // '&path=' +
  595. // ev.path,
  596. // });
  597. // },
  598. // fail(res) {
  599. // console.log(res);
  600. // },
  601. // });
  602. // } else if (this.flag == 1) {
  603. // //pest.pests.insect_discern病害识别
  604. // // uni.showLoading({
  605. // // title: '加载中'
  606. // // });
  607. // uni.uploadFile({
  608. // // url: 'http://114.115.147.140:8002/api/api_gateway?method=base.bases.base_photo', //仅为示例,非真实的接口地址
  609. // url: 'https://wx.hnyfwlw.com/api/api_gateway?method=pest.pests.plant_discern', //仅为示例,非真实的接口地址
  610. // filePath: ev.path,
  611. // name: 'img_file',
  612. // formData: {
  613. // user: 'test',
  614. // sign: pubblicData,
  615. // },
  616. // success: (uploadFileRes) => {
  617. // this.loadTF = false;
  618. // console.log(JSON.parse(uploadFileRes.data));
  619. // uni.navigateTo({
  620. // url:
  621. // '../disandpests/index?datas=' +
  622. // uploadFileRes.data +
  623. // '&path=' +
  624. // ev.path,
  625. // });
  626. // },
  627. // });
  628. // }
  629. // this.url = '';
  630. // },
  631. // oncancle() {
  632. // // url设置为空,隐藏控件
  633. // this.url = '';
  634. // },
  635. // confirm() {
  636. // this.flag = 1;
  637. // uni.chooseImage({
  638. // count: 1, //默认9
  639. // // sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  640. // sourceType: ['camera', 'album'], //从相册选择
  641. // success: (res) => {
  642. // this.url = res.tempFilePaths[0];
  643. // },
  644. // });
  645. // console.log(1);
  646. // },
  647. // cancel() {
  648. // this.flag = 2;
  649. // uni.chooseImage({
  650. // count: 1, //默认9
  651. // // sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  652. // sourceType: ['camera', 'album'], //从相册选择
  653. // success: (res) => {
  654. // console.log(1);
  655. // this.url = res.tempFilePaths[0];
  656. // },
  657. // });
  658. // },
  659. worm() {
  660. uni.navigateTo({
  661. url: '../expertDiagnosis/wormcase?name=虫情百科',
  662. });
  663. },
  664. virus() {
  665. uni.navigateTo({
  666. url: '../expertDiagnosis/wormcase?name=病害百科',
  667. });
  668. },
  669. introduce(id, title) {
  670. uni.navigateTo({
  671. url: '../expertDiagnosis/introduce?id=' + id + '&title=' + title,
  672. });
  673. },
  674. },
  675. onLoad() {
  676. console.log(this.$isneutral);
  677. var time = new Date();
  678. var hours = time.getHours();
  679. if (hours < 12) {
  680. this.hello = '上午好!';
  681. } else {
  682. this.hello = '下午好!';
  683. }
  684. uni.getFuzzyLocation({
  685. type: 'wgs84 ',
  686. success: (res) => {
  687. console.log(res, 'loacation');
  688. this.getcity(res.longitude, res.latitude);
  689. },
  690. });
  691. this.getUserlogin();
  692. },
  693. onShow() {
  694. this.loadTF = false;
  695. this.getUserlogin();
  696. },
  697. };
  698. </script>
  699. <style lang="less">
  700. page {
  701. background-image: url(https://www.hnyfwlw.com:8006/bigdata_app/newindex/bg.png);
  702. background-size: 100%;
  703. background-repeat: no-repeat;
  704. background-color: #f9f9f9;
  705. }
  706. .weather {
  707. display: flex;
  708. width: 85%;
  709. margin: 0 auto;
  710. padding-top: 40rpx;
  711. .weaimg {
  712. width: 296rpx;
  713. height: 296rpx;
  714. }
  715. .weatext {
  716. width: 300rpx;
  717. text-align: center;
  718. font-size: 36rpx;
  719. color: #fff;
  720. padding-top: 60rpx;
  721. margin-left: 60rpx;
  722. .weatext_title {
  723. font-size: 80rpx;
  724. margin-bottom: 30rpx;
  725. }
  726. }
  727. }
  728. .weatherinfo {
  729. display: flex;
  730. background-color: rgba(255, 255, 255, 0.2);
  731. width: 85%;
  732. margin: 60rpx auto;
  733. padding: 30rpx;
  734. justify-content: space-around;
  735. border-radius: 170rpx;
  736. .weatherinfo_item {
  737. text-align: center;
  738. .first_item {
  739. height: 50rpx;
  740. margin-bottom: 10rpx;
  741. color: #fff;
  742. line-height: 50rpx;
  743. }
  744. .weaimg {
  745. width: 50rpx;
  746. height: 50rpx;
  747. }
  748. .textbox {
  749. text-align: center;
  750. color: #fff;
  751. }
  752. }
  753. }
  754. .functionbox {
  755. width: 85%;
  756. margin: 0 auto;
  757. padding: 30rpx;
  758. // box-sizing: border-box;
  759. background-color: #fff;
  760. border-radius: 30rpx;
  761. .functionbox_title {
  762. padding-left: 20rpx;
  763. font-size: 34rpx;
  764. }
  765. .functionbox_text {
  766. display: flex;
  767. justify-content: space-around;
  768. margin-top: 30rpx;
  769. .functionbox_text_item {
  770. text-align: center;
  771. color: #616666;
  772. .itemimg {
  773. width: 60rpx;
  774. height: 60rpx;
  775. margin-bottom: 20rpx;
  776. }
  777. }
  778. }
  779. }
  780. .facilitybox {
  781. width: 90%;
  782. margin: 0 auto;
  783. padding: 30rpx;
  784. .facilitybox_title {
  785. font-size: 34rpx;
  786. // padding-left: 20rpx;
  787. }
  788. .facilitybox_itembox {
  789. display: flex;
  790. // justify-content: space-around;
  791. flex-wrap: wrap;
  792. margin-top: 30rpx;
  793. .facilitybox_item {
  794. width: 25%;
  795. text-align: center;
  796. color: #616666;
  797. margin-bottom: 20rpx;
  798. .itemimg {
  799. width: 100rpx;
  800. height: 100rpx;
  801. margin-bottom: 20rpx;
  802. }
  803. }
  804. }
  805. }
  806. .insectattack {
  807. width: 90%;
  808. margin: 0 auto;
  809. padding: 30rpx;
  810. .insectattack_title {
  811. font-size: 34rpx;
  812. // padding-left: 20rpx;
  813. display: flex;
  814. justify-content: space-between;
  815. .iconbox {
  816. width: 40rpx;
  817. height: 40rpx;
  818. background-color: #cfd6d6;
  819. color: #909696;
  820. border-radius: 40rpx;
  821. line-height: 40rpx;
  822. text-align: center;
  823. font-size: 20rpx;
  824. }
  825. }
  826. .insectattack_listbox {
  827. // padding: 0 20rpx;
  828. overflow-x: auto;
  829. .insectattack_list {
  830. width: 1104rpx;
  831. display: flex;
  832. margin-top: 30rpx;
  833. flex-wrap: wrap;
  834. .list_box {
  835. // background-color: #f00;
  836. background-size: 100% 100%;
  837. width: 246rpx;
  838. height: 324rpx;
  839. margin-right: 30rpx;
  840. border-radius: 20rpx;
  841. position: relative;
  842. .list_boxbg {
  843. width: 100%;
  844. height: 100%;
  845. position: absolute;
  846. top: 0;
  847. left: 0;
  848. z-index: -1;
  849. .list_boxbg_img {
  850. width: 100%;
  851. height: 100%;
  852. }
  853. }
  854. .list_box_xiang {
  855. width: 95%;
  856. margin-top: 0rpx auto;
  857. display: flex;
  858. justify-content: flex-end;
  859. padding-top: 20rpx;
  860. .list_box_xiang_click {
  861. padding: 8rpx 15rpx;
  862. background-color: rgba(0, 0, 0, 0.2);
  863. color: #fff;
  864. font-size: 20rpx;
  865. border-radius: 52rpx;
  866. }
  867. }
  868. .list_box_info {
  869. width: 90%;
  870. margin: 130rpx auto 0;
  871. height: 120rpx;
  872. border-radius: 10rpx;
  873. background-image: linear-gradient(
  874. to right,
  875. #ffffff,
  876. rgba(255, 255, 255, 0.44)
  877. );
  878. padding: 10rpx;
  879. box-sizing: border-box;
  880. .list_box_info_name {
  881. font-weight: 700;
  882. }
  883. .list_box_info_text {
  884. font-size: 18rpx;
  885. overflow: hidden;
  886. text-overflow: ellipsis;
  887. display: -webkit-box;
  888. -webkit-box-orient: vertical;
  889. -webkit-line-clamp: 2;
  890. }
  891. }
  892. }
  893. // .list_box1 {
  894. // background-image: url(../../static/images/newindex/cao.png);
  895. // }
  896. // .list_box2 {
  897. // background-image: url(../../static/images/newindex/yee.jpg);
  898. // }
  899. // .list_box3 {
  900. // background-image: url(../../static/images/newindex/lingc.jpg);
  901. // }
  902. // .list_box4 {
  903. // background-image: url(../../static/images/newindex/ming.png);
  904. // }
  905. // .list_box5 {
  906. // background-image: url(../../static/images/newindex/mai.png);
  907. // }
  908. // .list_box6 {
  909. // background-image: url(../../static/images/newindex/dadou.jpg)
  910. // }
  911. // .list_box7 {
  912. // background-image: url(../../static/images/newindex/yumi.png);
  913. // }
  914. // .list_box8 {
  915. // background-image: url(../../static/images/newindex/dao.png);
  916. // }
  917. }
  918. }
  919. }
  920. .loading {
  921. position: absolute;
  922. top: 0;
  923. left: 0;
  924. z-index: 100;
  925. width: 100%;
  926. height: 100vh;
  927. background-color: rgba(0, 0, 0, 0.5);
  928. display: flex;
  929. justify-content: center;
  930. align-items: center;
  931. }
  932. </style>