index.vue 24 KB

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