index.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985
  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 || '-' }}%RH </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. <!-- <u-modal v-model="show" :mask-close-able="true" title="病虫害识别" :show-cancel-button="true" confirm-text="拍病害"
  382. cancel-text="拍虫害" cancel-color="#4BB85F" content="拍照识别病虫害" @confirm="confirm" @cancel="cancel"></u-modal>
  383. <kps-image-cutter @ok="onok" @cancel="oncancle" :url="url" :fixed="false" :blob="true" :maxWidth="500"
  384. :maxHeight="380" :height="380"></kps-image-cutter> -->
  385. <view class="loading" v-if="loadTF" @touchmove.stop.prevent="moveHandle">
  386. <u-loading mode="flower" size="100" :show="true"></u-loading>
  387. </view>
  388. </view>
  389. </template>
  390. <script>
  391. import kpsImageCutter from '@/components/ksp-image-cutter/ksp-image-cutter.vue';
  392. import jsencrypt from '@/components/jsencrypt/jsencrypt.vue';
  393. // Vue.use(QueryPermission)
  394. export default {
  395. components: {
  396. kpsImageCutter,
  397. },
  398. data() {
  399. return {
  400. weatherinfo: {
  401. wea: '晴',
  402. },
  403. hello: '',
  404. jurisdiction: {
  405. cbtf: false,
  406. jktf: false,
  407. hjtf: false,
  408. fztf: false,
  409. sytf: false,
  410. sbtf: false,
  411. sqtf: false,
  412. zjtf: false,
  413. ggtf: false,
  414. qxz: false,
  415. sq: false,
  416. cbyj: false,
  417. },
  418. show: false,
  419. url: '',
  420. loadTF: false,
  421. };
  422. },
  423. watch: {
  424. url(news) {
  425. if (news != '') {
  426. uni.pageScrollTo({
  427. scrollTop: 0,
  428. duration: 500,
  429. });
  430. }
  431. },
  432. },
  433. methods: {
  434. moveHandle() {
  435. return;
  436. },
  437. async getcity(lng, lat) {
  438. const res = await this.$myRequest({
  439. url: '/api/api_gateway?method=device.device_manage.weathers',
  440. data: {
  441. lng: lng,
  442. lat: lat,
  443. },
  444. });
  445. console.log(res);
  446. this.weatherinfo = res[0];
  447. },
  448. async getUserlogin() {
  449. const res = await this.$myRequest({
  450. url: '/api/api_gateway?method=user.login.user_login_info',
  451. });
  452. // this.jurisdiction = {
  453. // cbtf: false,
  454. // jktf: false,
  455. // hjtf: false,
  456. // fztf: false,
  457. // sytf: false,
  458. // sbtf: false,
  459. // sqtf: false,
  460. // zjtf: false,
  461. // }
  462. uni.setStorage({
  463. key: 'jurisdiction',
  464. data: JSON.stringify(res.children),
  465. });
  466. uni.setStorage({
  467. key: 'myuser_type',
  468. data: JSON.stringify(res.myuser_type),
  469. });
  470. uni.setStorage({
  471. key: 'myuid',
  472. data: JSON.stringify(res.myuid),
  473. });
  474. let QueryPermission = (id) => {
  475. let list = res.children;
  476. for (var i = 0; i < list.length; i++) {
  477. if (list[i].children) {
  478. var data = list[i].children;
  479. for (var j = 0; j < data.length; j++) {
  480. if (data[j].children) {
  481. var item = data[j].children;
  482. for (var k = 0; k < item.length; k++) {
  483. if (item[k].pur_id == id) {
  484. return true;
  485. }
  486. }
  487. }
  488. }
  489. }
  490. }
  491. return false;
  492. };
  493. this.jurisdiction = {
  494. cbtf: false,
  495. jktf: false,
  496. hjtf: false,
  497. fztf: false,
  498. sytf: false,
  499. sbtf: false,
  500. sqtf: false,
  501. zjtf: false,
  502. qxz: QueryPermission(242),
  503. sq: QueryPermission(284),
  504. cbyj: QueryPermission(243),
  505. };
  506. console.log(res.children);
  507. for (var i = 0; i < res.children.length; i++) {
  508. switch (res.children[i].pur_id) {
  509. case 36:
  510. this.jurisdiction.cbtf = true; //"测报系统"
  511. break;
  512. case 42:
  513. this.jurisdiction.jktf = true; //"可视农业"
  514. break;
  515. case 40:
  516. this.jurisdiction.hjtf = true; //"环境监测系统"
  517. break;
  518. case 44:
  519. this.jurisdiction.fztf = true; //"防治系统"
  520. break;
  521. case 58:
  522. this.jurisdiction.sytf = true; //"溯源系统"
  523. break;
  524. case 28:
  525. this.jurisdiction.sbtf = true; //"系统管理"
  526. break;
  527. case 25:
  528. this.jurisdiction.sqtf = true; //"四情基地"
  529. break;
  530. case 124:
  531. this.jurisdiction.zjtf = true; //"专家诊断"
  532. break;
  533. // case "灌溉控制系统":
  534. // this.jurisdiction.sftf = true
  535. // break;
  536. case 202:
  537. this.jurisdiction.ggtf = true; //"灌溉控制系统"
  538. break;
  539. }
  540. }
  541. },
  542. tabfunction(index) {
  543. if (index == 0) {
  544. uni.navigateTo({
  545. url: '../fourBase/index',
  546. });
  547. } else if (index == 1) {
  548. // var that = this
  549. // this.show = true
  550. uni.navigateTo({
  551. url: '/pages/identifyPest/identifyPest',
  552. });
  553. } else if (index == 2) {
  554. uni.navigateTo({
  555. url: '../expertDiagnosis/index',
  556. });
  557. } else if (index == 3) {
  558. uni.navigateTo({
  559. url: '../afterSale/index',
  560. });
  561. }
  562. },
  563. tabequipment(url, type) {
  564. console.log(url);
  565. uni.navigateTo({
  566. url: `${url}${type ? `?typeId=${type}` : ''}`,
  567. });
  568. },
  569. onok(ev) {
  570. this.path = this.url;
  571. console.log(ev);
  572. this.loadTF = true;
  573. uni.showLoading({
  574. mask: true,
  575. success: function () {
  576. console.log(999);
  577. },
  578. });
  579. var publiukey = `-----BEGIN PUBLIC KEY-----
  580. MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC6m92fXUrccS4SoLg4W4jPRNua
  581. 4BcRk4ldLcqPuQpD2Mds2+hw+Gi+0MUnshF/r/DTcCJgkt7rtoY9EB6/XJ6MFw14
  582. whhESFie/lZUWRsk8M89Rkr8m5rwmBl+uLAd5LopyshFqKTBXeT2ytHP1JCQLPBO
  583. 34Fy4/yEz4qEzkzBuwIDAQAB
  584. -----END PUBLIC KEY-----`;
  585. var time = +new Date();
  586. var str2 = 'YuNfEi' + time + 'YuNfEi';
  587. var pubblicData = jsencrypt.setEncrypt(publiukey, str2);
  588. if (this.flag == 2) {
  589. console.log('111');
  590. // pest.pests.insect_discern 虫害
  591. uni.uploadFile({
  592. // url: 'http://114.115.147.140:8002/api/api_gateway?method=base.bases.base_photo', //仅为示例,非真实的接口地址
  593. url: 'http://192.168.2.183:8006/api/api_gateway?method=pest.pests.insect_discern', //仅为示例,非真实的接口地址
  594. filePath: ev.path,
  595. name: 'img_file',
  596. formData: {
  597. user: 'test',
  598. sign: pubblicData,
  599. },
  600. success: (uploadFileRes) => {
  601. this.loadTF = false;
  602. console.log(JSON.parse(uploadFileRes.data));
  603. uni.navigateTo({
  604. url:
  605. '../disandpests/index?datas=' +
  606. uploadFileRes.data +
  607. '&path=' +
  608. ev.path,
  609. });
  610. },
  611. fail(res) {
  612. console.log(res);
  613. },
  614. });
  615. } else if (this.flag == 1) {
  616. //pest.pests.insect_discern病害识别
  617. // uni.showLoading({
  618. // title: '加载中'
  619. // });
  620. uni.uploadFile({
  621. // url: 'http://114.115.147.140:8002/api/api_gateway?method=base.bases.base_photo', //仅为示例,非真实的接口地址
  622. url: 'http://192.168.2.183:8006/api/api_gateway?method=pest.pests.plant_discern', //仅为示例,非真实的接口地址
  623. filePath: ev.path,
  624. name: 'img_file',
  625. formData: {
  626. user: 'test',
  627. sign: pubblicData,
  628. },
  629. success: (uploadFileRes) => {
  630. this.loadTF = false;
  631. console.log(JSON.parse(uploadFileRes.data));
  632. uni.navigateTo({
  633. url:
  634. '../disandpests/index?datas=' +
  635. uploadFileRes.data +
  636. '&path=' +
  637. ev.path,
  638. });
  639. },
  640. });
  641. }
  642. this.url = '';
  643. },
  644. oncancle() {
  645. // url设置为空,隐藏控件
  646. this.url = '';
  647. },
  648. confirm() {
  649. this.flag = 1;
  650. uni.chooseImage({
  651. count: 1, //默认9
  652. // sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  653. sourceType: ['camera', 'album'], //从相册选择
  654. success: (res) => {
  655. this.url = res.tempFilePaths[0];
  656. },
  657. });
  658. console.log(1);
  659. },
  660. cancel() {
  661. this.flag = 2;
  662. uni.chooseImage({
  663. count: 1, //默认9
  664. // sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  665. sourceType: ['camera', 'album'], //从相册选择
  666. success: (res) => {
  667. console.log(1);
  668. this.url = res.tempFilePaths[0];
  669. },
  670. });
  671. },
  672. worm() {
  673. uni.navigateTo({
  674. url: '../expertDiagnosis/wormcase?name=虫情百科',
  675. });
  676. },
  677. virus() {
  678. uni.navigateTo({
  679. url: '../expertDiagnosis/wormcase?name=病害百科',
  680. });
  681. },
  682. introduce(id, title) {
  683. uni.navigateTo({
  684. url: '../expertDiagnosis/introduce?id=' + id + '&title=' + title,
  685. });
  686. },
  687. },
  688. onLoad() {
  689. console.log(this.$isneutral);
  690. var time = new Date();
  691. var hours = time.getHours();
  692. if (hours < 12) {
  693. this.hello = '上午好!';
  694. } else {
  695. this.hello = '下午好!';
  696. }
  697. uni.getFuzzyLocation({
  698. type: 'wgs84 ',
  699. success: (res) => {
  700. console.log(res, 'loacation');
  701. this.getcity(res.longitude, res.latitude);
  702. },
  703. });
  704. this.getUserlogin();
  705. },
  706. onShow() {
  707. this.loadTF = false;
  708. this.getUserlogin();
  709. },
  710. };
  711. </script>
  712. <style lang="less">
  713. page {
  714. background-image: url(https://www.hnyfwlw.com:8006/bigdata_app/newindex/bg.png);
  715. background-size: 100%;
  716. background-repeat: no-repeat;
  717. background-color: #f9f9f9;
  718. }
  719. .weather {
  720. display: flex;
  721. width: 85%;
  722. margin: 0 auto;
  723. padding-top: 40rpx;
  724. .weaimg {
  725. width: 296rpx;
  726. height: 296rpx;
  727. }
  728. .weatext {
  729. width: 300rpx;
  730. text-align: center;
  731. font-size: 36rpx;
  732. color: #fff;
  733. padding-top: 60rpx;
  734. margin-left: 60rpx;
  735. .weatext_title {
  736. font-size: 80rpx;
  737. margin-bottom: 30rpx;
  738. }
  739. }
  740. }
  741. .weatherinfo {
  742. display: flex;
  743. background-color: rgba(255, 255, 255, 0.2);
  744. width: 85%;
  745. margin: 60rpx auto;
  746. padding: 30rpx;
  747. justify-content: space-around;
  748. border-radius: 170rpx;
  749. .weatherinfo_item {
  750. text-align: center;
  751. .first_item {
  752. height: 50rpx;
  753. margin-bottom: 10rpx;
  754. color: #fff;
  755. line-height: 50rpx;
  756. }
  757. .weaimg {
  758. width: 50rpx;
  759. height: 50rpx;
  760. }
  761. .textbox {
  762. text-align: center;
  763. color: #fff;
  764. }
  765. }
  766. }
  767. .functionbox {
  768. width: 85%;
  769. margin: 0 auto;
  770. padding: 30rpx;
  771. // box-sizing: border-box;
  772. background-color: #fff;
  773. border-radius: 30rpx;
  774. .functionbox_title {
  775. padding-left: 20rpx;
  776. font-size: 34rpx;
  777. }
  778. .functionbox_text {
  779. display: flex;
  780. justify-content: space-around;
  781. margin-top: 30rpx;
  782. .functionbox_text_item {
  783. text-align: center;
  784. color: #616666;
  785. .itemimg {
  786. width: 60rpx;
  787. height: 60rpx;
  788. margin-bottom: 20rpx;
  789. }
  790. }
  791. }
  792. }
  793. .facilitybox {
  794. width: 90%;
  795. margin: 0 auto;
  796. padding: 30rpx;
  797. .facilitybox_title {
  798. font-size: 34rpx;
  799. // padding-left: 20rpx;
  800. }
  801. .facilitybox_itembox {
  802. display: flex;
  803. // justify-content: space-around;
  804. flex-wrap: wrap;
  805. margin-top: 30rpx;
  806. .facilitybox_item {
  807. width: 25%;
  808. text-align: center;
  809. color: #616666;
  810. margin-bottom: 20rpx;
  811. .itemimg {
  812. width: 100rpx;
  813. height: 100rpx;
  814. margin-bottom: 20rpx;
  815. }
  816. }
  817. }
  818. }
  819. .insectattack {
  820. width: 90%;
  821. margin: 0 auto;
  822. padding: 30rpx;
  823. .insectattack_title {
  824. font-size: 34rpx;
  825. // padding-left: 20rpx;
  826. display: flex;
  827. justify-content: space-between;
  828. .iconbox {
  829. width: 40rpx;
  830. height: 40rpx;
  831. background-color: #cfd6d6;
  832. color: #909696;
  833. border-radius: 40rpx;
  834. line-height: 40rpx;
  835. text-align: center;
  836. font-size: 20rpx;
  837. }
  838. }
  839. .insectattack_listbox {
  840. // padding: 0 20rpx;
  841. overflow-x: auto;
  842. .insectattack_list {
  843. width: 1104rpx;
  844. display: flex;
  845. margin-top: 30rpx;
  846. flex-wrap: wrap;
  847. .list_box {
  848. // background-color: #f00;
  849. background-size: 100% 100%;
  850. width: 246rpx;
  851. height: 324rpx;
  852. margin-right: 30rpx;
  853. border-radius: 20rpx;
  854. position: relative;
  855. .list_boxbg {
  856. width: 100%;
  857. height: 100%;
  858. position: absolute;
  859. top: 0;
  860. left: 0;
  861. z-index: -1;
  862. .list_boxbg_img {
  863. width: 100%;
  864. height: 100%;
  865. }
  866. }
  867. .list_box_xiang {
  868. width: 95%;
  869. margin-top: 0rpx auto;
  870. display: flex;
  871. justify-content: flex-end;
  872. padding-top: 20rpx;
  873. .list_box_xiang_click {
  874. padding: 8rpx 15rpx;
  875. background-color: rgba(0, 0, 0, 0.2);
  876. color: #fff;
  877. font-size: 20rpx;
  878. border-radius: 52rpx;
  879. }
  880. }
  881. .list_box_info {
  882. width: 90%;
  883. margin: 130rpx auto 0;
  884. height: 120rpx;
  885. border-radius: 10rpx;
  886. background-image: linear-gradient(
  887. to right,
  888. #ffffff,
  889. rgba(255, 255, 255, 0.44)
  890. );
  891. padding: 10rpx;
  892. box-sizing: border-box;
  893. .list_box_info_name {
  894. font-weight: 700;
  895. }
  896. .list_box_info_text {
  897. font-size: 18rpx;
  898. overflow: hidden;
  899. text-overflow: ellipsis;
  900. display: -webkit-box;
  901. -webkit-box-orient: vertical;
  902. -webkit-line-clamp: 2;
  903. }
  904. }
  905. }
  906. // .list_box1 {
  907. // background-image: url(../../static/images/newindex/cao.png);
  908. // }
  909. // .list_box2 {
  910. // background-image: url(../../static/images/newindex/yee.jpg);
  911. // }
  912. // .list_box3 {
  913. // background-image: url(../../static/images/newindex/lingc.jpg);
  914. // }
  915. // .list_box4 {
  916. // background-image: url(../../static/images/newindex/ming.png);
  917. // }
  918. // .list_box5 {
  919. // background-image: url(../../static/images/newindex/mai.png);
  920. // }
  921. // .list_box6 {
  922. // background-image: url(../../static/images/newindex/dadou.jpg)
  923. // }
  924. // .list_box7 {
  925. // background-image: url(../../static/images/newindex/yumi.png);
  926. // }
  927. // .list_box8 {
  928. // background-image: url(../../static/images/newindex/dao.png);
  929. // }
  930. }
  931. }
  932. }
  933. .loading {
  934. position: absolute;
  935. top: 0;
  936. left: 0;
  937. z-index: 100;
  938. width: 100%;
  939. height: 100vh;
  940. background-color: rgba(0, 0, 0, 0.5);
  941. display: flex;
  942. justify-content: center;
  943. align-items: center;
  944. }
  945. </style>