index2.vue 27 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150
  1. <template>
  2. <view class="home">
  3. <view class="welcom">{{ hello }} 欢迎登录</view>
  4. <view class="weather-bg">
  5. <view class="weather-box">
  6. <view class="weather">
  7. <view class="weatext">
  8. <view>今天<span class="text-span">{{weatherinfo.air_level}}</span></view>
  9. <view class="text-value">{{weatherinfo.at}}℃</view>
  10. </view>
  11. <view class="weatext">
  12. <image :src="
  13. 'https://webstaticimg.oss-cn-hangzhou.aliyuncs.com/bigdata_app/img/weather/' +
  14. weatherinfo.wea +
  15. '.png'
  16. " mode="" class="weaimg"></image>
  17. <view class="weatext_title">
  18. {{ weatherinfo.wea }}
  19. </view>
  20. </view>
  21. </view>
  22. <view class="weather">
  23. <view class="weatext">
  24. <view>湿度<span class="text-span">{{weatherinfo.ah | ahFilter}}</span></view>
  25. <view class="text-value">{{weatherinfo.ah}}%</view>
  26. </view>
  27. <view class="weatext">
  28. <view>PM2.5</view>
  29. <view class="textbox">
  30. {{ weatherinfo.air_pm25 }}
  31. </view>
  32. </view>
  33. </view>
  34. </view>
  35. <view class="weather-warning">
  36. <image class="weather-alert" :src="$imageURL+'/bigdata_app/newImg/home/weather-alert.png'" mode=""></image>
  37. {{weatherinfo.alarm_content}}
  38. </view>
  39. </view>
  40. <view class="ai-box">
  41. <view class="ai-content">
  42. <image :src="$imageURL+'/bigdata_app/newImg/home/ai-bot.png'" class="float-left" mode=""></image>
  43. <view class="ai-text">
  44. <view class="ai-text-title">我是千耘农业种植大模型</view>
  45. <view class="ai-text-subtitle">耕耘千百变,智慧一点通</view>
  46. </view>
  47. <view class="float-right">
  48. 问一问
  49. </view>
  50. </view>
  51. </view>
  52. <view class="functionbox">
  53. <view class="functionbox_text">
  54. <view class="functionbox_text_item" @click="tabfunction(0)" v-if="index < 9" v-for="(item,index) in menuList" :key="index">
  55. <image :src="item.app_menu_icon" mode="" class="itemimg">
  56. </image>
  57. <view class=""> {{ item.purview_name }} </view>
  58. </view>
  59. <!-- <view class="functionbox_text_item" @click="tabfunction(1)">
  60. <image :src="$imageURL+'/bigdata_app/newImg/home/zngg.png'" mode="" class="itemimg">
  61. </image>
  62. <view class=""> 智能灌溉 </view>
  63. </view>
  64. <view class="functionbox_text_item" v-if="jurisdiction.zjtf" @click="tabfunction(2)">
  65. <image :src="$imageURL+'/bigdata_app/newImg/home/yhgl.png'" mode="" class="itemimg"></image>
  66. <view class=""> 用户管理 </view>
  67. </view>
  68. <view class="functionbox_text_item" @click="tabfunction(3)">
  69. <image :src="$imageURL+'/bigdata_app/newImg/home/shfw.png'" mode="" class="itemimg"></image>
  70. <view class=""> 售后服务 </view>
  71. </view>
  72. <view class="functionbox_text_item" @click="tabfunction(3)">
  73. <image :src="$imageURL+'/bigdata_app/newImg/home/shfw.png'" mode="" class="itemimg"></image>
  74. <view class=""> 售后服务 </view>
  75. </view>
  76. <view class="functionbox_text_item" @click="tabfunction(3)">
  77. <image :src="$imageURL+'/bigdata_app/newImg/home/shfw.png'" mode="" class="itemimg"></image>
  78. <view class=""> 售后服务 </view>
  79. </view>
  80. <view class="functionbox_text_item" @click="tabfunction(3)">
  81. <image :src="$imageURL+'/bigdata_app/newImg/home/shfw.png'" mode="" class="itemimg"></image>
  82. <view class=""> 售后服务 </view>
  83. </view> -->
  84. <view class="functionbox_text_item" @click="tabfunction(9)" v-if="menuList.length >= 9">
  85. <image :src="$imageURL+'/bigdata_app/newImg/home/shfw.png'" mode="" class="itemimg"></image>
  86. <view class=""> 更多功能 </view>
  87. </view>
  88. </view>
  89. <!-- <swiper class="swiper" circular :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval"
  90. :duration="duration">
  91. <swiper-item>
  92. </swiper-item>
  93. <swiper-item>
  94. <view class="swiper-item uni-bg-green">B</view>
  95. </swiper-item>
  96. </swiper> -->
  97. </view>
  98. <view class="facilitybox">
  99. <view class="facilitybox-content">
  100. <view class="facilitybox_title"> 智慧助手 </view>
  101. <view style="display: flex;gap:24rpx;flex-direction: column;">
  102. <view class="facilitybox_itembox">
  103. <view class="facilitybox_item facilitybox-zhuanjia" v-if="jurisdiction.zjtf"
  104. @click="tabfunction(2)">
  105. <image :src="$imageURL+'/bigdata_app/newImg/home/zjhk.png'" mode="" class="itemimg">
  106. </image>
  107. <view class="facilitybox_span">
  108. <text> 专家库 </text>
  109. <view class="text">农业相关博士、教授、研究员</view>
  110. </view>
  111. </view>
  112. <view class="facilitybox_item" style="display: flex; flex-direction: column;gap: 24rpx;">
  113. <view class="facilitybox-suishi"
  114. @click="tabfunction(1)">
  115. <image style="width: 72rpx;height:72rpx;margin-right: 10rpx;"
  116. :src="$imageURL+'/bigdata_app/newImg/home/tjss.png'" mode=""
  117. class="itemimg float-right">
  118. </image>
  119. <view class="facilitybox_span"> 田间随识 </view>
  120. </view>
  121. <view class="facilitybox-bchk"
  122. @click="worm">
  123. <image :src="$imageURL+'/bigdata_app/newImg/home/cshk.png'" mode="" class="itemimg">
  124. </image>
  125. <view style="width: 69%;" class="facilitybox_span"> 病虫草鼠害库 </view>
  126. </view>
  127. </view>
  128. </view>
  129. <view class="facilitybox_itembox">
  130. <view class="facilitybox_item facilitybox-jwjy" v-if="jurisdiction.fztf"
  131. @click="tabequipment('../prevention/index')">
  132. <image :src="$imageURL+'/bigdata_app/newImg/home/jwjy.png'" mode="" class="itemimg">
  133. </image>
  134. <view class="facilitybox_span"> 积温积雨 </view>
  135. </view>
  136. <view class="facilitybox_item facilitybox-jgqs" v-if="jurisdiction.jktf"
  137. @click="tabequipment('../monitor/index')">
  138. <image :src="$imageURL+'/bigdata_app/newImg/home/jgqs.png'" mode="" class="itemimg">
  139. </image>
  140. <view class="facilitybox_span"> 价格趋势 </view>
  141. </view>
  142. </view>
  143. </view>
  144. </view>
  145. <view class="banner-ad">
  146. <view class="ad-text">
  147. <view class="title">
  148. 松墨天牛拍照性诱智能监测
  149. </view>
  150. <view class="sub-title">
  151. AI慧眼识天牛 智守青山护松林
  152. </view>
  153. <view class="btn">
  154. 查看详情
  155. </view>
  156. </view>
  157. </view>
  158. </view>
  159. <!-- <view class="insectattack">
  160. <view class="insectattack_title" @click="worm">
  161. <view class=""> 虫情百科 </view>
  162. <view class="iconbox">
  163. <u-icon name="arrow-right"></u-icon>
  164. </view>
  165. </view>
  166. </view>
  167. <view class="insectattack">
  168. <view class="insectattack_title" @click="virus">
  169. <view class=""> 病害百科 </view>
  170. <view class="iconbox">
  171. <u-icon name="arrow-right"></u-icon>
  172. </view>
  173. </view>
  174. </view> -->
  175. </view>
  176. </template>
  177. <script>
  178. export default {
  179. // // 分享给朋友
  180. // onShareAppMessage() {
  181. // return {
  182. // title: '云飞智控', // 分享标题
  183. // path: 'pages/index/index', // 分享路径,通常包含页面参数
  184. // imageUrl: 'http://www.hnyfwlw.com:8006/data/home_logo/log1.jpg', // 分享图片,可选
  185. // success: (res) => {
  186. // // 分享成功回调
  187. // uni.showToast({
  188. // title: '分享成功',
  189. // icon: 'success'
  190. // })
  191. // },
  192. // fail: (err) => {
  193. // // 分享失败回调
  194. // console.log('分享失败', err)
  195. // }
  196. // }
  197. // },
  198. // // 分享到朋友圈(基础库2.11.3+)
  199. // onShareTimeline() {
  200. // return {
  201. // title: '云飞智控', // 分享标题
  202. // query: 'id=123', // 页面参数,不同于分享给朋友的path,这里用query
  203. // imageUrl: 'http://www.hnyfwlw.com:8006/data/home_logo/log1.jpg' // 分享图片,可选
  204. // }
  205. // },
  206. filters:{
  207. ahFilter(value){
  208. if(value>70){
  209. return"湿润"
  210. }else if(value<30){
  211. return'干燥'
  212. }else{
  213. return'正常'
  214. }
  215. }
  216. },
  217. data() {
  218. return {
  219. menuList:[],
  220. indicatorDots: true,
  221. autoplay: false,
  222. interval: 2000,
  223. duration: 500,
  224. weatherinfo: {
  225. wea: '晴',
  226. air_level: '优',
  227. at: '23',
  228. air_pm25: '3',
  229. ah: '56',
  230. alarm_content: '天气警告'
  231. },
  232. hello: '',
  233. jurisdiction: {
  234. cbtf: false,
  235. jktf: false,
  236. hjtf: false,
  237. fztf: false,
  238. sytf: false,
  239. sbtf: false,
  240. sqtf: false,
  241. zjtf: false,
  242. ggtf: false,
  243. qxz: false,
  244. sq: false,
  245. cbyj: false,
  246. },
  247. show: false,
  248. url: '',
  249. loadTF: false
  250. };
  251. },
  252. watch: {
  253. url(news) {
  254. if (news != '') {
  255. uni.pageScrollTo({
  256. scrollTop: 0,
  257. duration: 500,
  258. });
  259. }
  260. },
  261. },
  262. methods: {
  263. moveHandle() {
  264. return;
  265. },
  266. async getcity(lng, lat) {
  267. const res = await this.$myRequest({
  268. url: '/api/api_gateway?method=device.device_manage.weathers',
  269. data: {
  270. lng: lng,
  271. lat: lat,
  272. },
  273. });
  274. this.weatherinfo = res[0];
  275. },
  276. async getUserlogin() {
  277. const res = await this.$myRequest({
  278. url: '/api/api_gateway?method=user.login.user_login_info',
  279. data: {
  280. is_app: 1,
  281. }
  282. });
  283. // this.jurisdiction = {
  284. // cbtf: false,
  285. // jktf: false,
  286. // hjtf: false,
  287. // fztf: false,
  288. // sytf: false,
  289. // sbtf: false,
  290. // sqtf: false,
  291. // zjtf: false,
  292. // }
  293. const menuList = [];
  294. res.forEach(item =>{
  295. if(item.children){
  296. menuList.push(...item.children);
  297. }
  298. })
  299. // res.find(item => item.purview_name == '智慧物联');
  300. console.log(menuList,'MenuList')
  301. this.menuList = menuList || [];
  302. uni.setStorage({
  303. key: 'jurisdiction',
  304. data: JSON.stringify(res.children),
  305. });
  306. uni.setStorage({
  307. key: 'myuser_type',
  308. data: JSON.stringify(res.myuser_type),
  309. });
  310. uni.setStorage({
  311. key: 'myuid',
  312. data: JSON.stringify(res.myuid),
  313. });
  314. let QueryPermission = (id) => {
  315. let list = res.children;
  316. for (var i = 0; i < list.length; i++) {
  317. if (list[i].children) {
  318. var data = list[i].children;
  319. for (var j = 0; j < data.length; j++) {
  320. if (data[j].children) {
  321. var item = data[j].children;
  322. for (var k = 0; k < item.length; k++) {
  323. if (item[k].pur_id == id) {
  324. return true;
  325. }
  326. }
  327. }
  328. }
  329. }
  330. }
  331. return false;
  332. };
  333. this.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. qxz: QueryPermission(242),
  343. sq: QueryPermission(284),
  344. cbyj: QueryPermission(243),
  345. };
  346. console.log(res.children);
  347. for (var i = 0; i < res.children.length; i++) {
  348. switch (res.children[i].pur_id) {
  349. case 36:
  350. this.jurisdiction.cbtf = true; //"测报系统"
  351. break;
  352. case 42:
  353. this.jurisdiction.jktf = true; //"可视农业"
  354. break;
  355. case 40:
  356. this.jurisdiction.hjtf = true; //"环境监测系统"
  357. break;
  358. case 44:
  359. this.jurisdiction.fztf = true; //"防治系统"
  360. break;
  361. case 58:
  362. this.jurisdiction.sytf = true; //"溯源系统"
  363. break;
  364. case 28:
  365. this.jurisdiction.sbtf = true; //"系统管理"
  366. break;
  367. case 25:
  368. this.jurisdiction.sqtf = true; //"四情基地"
  369. break;
  370. case 124:
  371. this.jurisdiction.zjtf = true; //"专家诊断"
  372. break;
  373. // case "灌溉控制系统":
  374. // this.jurisdiction.sftf = true
  375. // break;
  376. case 202:
  377. this.jurisdiction.ggtf = true; //"灌溉控制系统"
  378. break;
  379. }
  380. }
  381. },
  382. tabfunction(index) {
  383. if (index == 0) {
  384. uni.navigateTo({
  385. url: '../fourBase/index',
  386. });
  387. } else if (index == 1) {
  388. // var that = this
  389. // this.show = true
  390. uni.navigateTo({
  391. url: '/pages/identifyPest/identifyPest',
  392. });
  393. } else if (index == 2) {
  394. uni.navigateTo({
  395. url: '../expertDiagnosis/index',
  396. });
  397. } else if (index == 3) {
  398. uni.navigateTo({
  399. url: '../afterSale/index',
  400. });
  401. } else if (index == 9) {
  402. }
  403. },
  404. tabequipment(url, type) {
  405. console.log(url);
  406. uni.navigateTo({
  407. url: `${url}${type ? `?typeId=${type}` : ''}`,
  408. });
  409. },
  410. // onok(ev) {
  411. // this.path = this.url;
  412. // console.log(ev);
  413. // this.loadTF = true;
  414. // uni.showLoading({
  415. // mask: true,
  416. // success: function () {
  417. // console.log(999);
  418. // },
  419. // });
  420. // var publiukey = `-----BEGIN PUBLIC KEY-----
  421. // MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC6m92fXUrccS4SoLg4W4jPRNua
  422. // 4BcRk4ldLcqPuQpD2Mds2+hw+Gi+0MUnshF/r/DTcCJgkt7rtoY9EB6/XJ6MFw14
  423. // whhESFie/lZUWRsk8M89Rkr8m5rwmBl+uLAd5LopyshFqKTBXeT2ytHP1JCQLPBO
  424. // 34Fy4/yEz4qEzkzBuwIDAQAB
  425. // -----END PUBLIC KEY-----`;
  426. // var time = +new Date();
  427. // var str2 = 'YuNfEi' + time + 'YuNfEi';
  428. // var pubblicData = jsencrypt.setEncrypt(publiukey, str2);
  429. // if (this.flag == 2) {
  430. // console.log('111');
  431. // // pest.pests.insect_discern 虫害
  432. // uni.uploadFile({
  433. // // url: 'http://dev.hnyfwlw.com/api/api_gateway?method=base.bases.base_photo', //仅为示例,非真实的接口地址
  434. // url: 'https://wx.hnyfwlw.com/api/api_gateway?method=pest.pests.insect_discern', //仅为示例,非真实的接口地址
  435. // filePath: ev.path,
  436. // name: 'img_file',
  437. // formData: {
  438. // user: 'test',
  439. // sign: pubblicData,
  440. // },
  441. // success: (uploadFileRes) => {
  442. // this.loadTF = false;
  443. // console.log(JSON.parse(uploadFileRes.data));
  444. // uni.navigateTo({
  445. // url:
  446. // '../disandpests/index?datas=' +
  447. // uploadFileRes.data +
  448. // '&path=' +
  449. // ev.path,
  450. // });
  451. // },
  452. // fail(res) {
  453. // console.log(res);
  454. // },
  455. // });
  456. // } else if (this.flag == 1) {
  457. // //pest.pests.insect_discern病害识别
  458. // // uni.showLoading({
  459. // // title: '加载中'
  460. // // });
  461. // uni.uploadFile({
  462. // // url: 'http://dev.hnyfwlw.com/api/api_gateway?method=base.bases.base_photo', //仅为示例,非真实的接口地址
  463. // url: 'https://wx.hnyfwlw.com/api/api_gateway?method=pest.pests.plant_discern', //仅为示例,非真实的接口地址
  464. // filePath: ev.path,
  465. // name: 'img_file',
  466. // formData: {
  467. // user: 'test',
  468. // sign: pubblicData,
  469. // },
  470. // success: (uploadFileRes) => {
  471. // this.loadTF = false;
  472. // console.log(JSON.parse(uploadFileRes.data));
  473. // uni.navigateTo({
  474. // url:
  475. // '../disandpests/index?datas=' +
  476. // uploadFileRes.data +
  477. // '&path=' +
  478. // ev.path,
  479. // });
  480. // },
  481. // });
  482. // }
  483. // this.url = '';
  484. // },
  485. // oncancle() {
  486. // // url设置为空,隐藏控件
  487. // this.url = '';
  488. // },
  489. // confirm() {
  490. // this.flag = 1;
  491. // uni.chooseImage({
  492. // count: 1, //默认9
  493. // // sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  494. // sourceType: ['camera', 'album'], //从相册选择
  495. // success: (res) => {
  496. // this.url = res.tempFilePaths[0];
  497. // },
  498. // });
  499. // console.log(1);
  500. // },
  501. // cancel() {
  502. // this.flag = 2;
  503. // uni.chooseImage({
  504. // count: 1, //默认9
  505. // // sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  506. // sourceType: ['camera', 'album'], //从相册选择
  507. // success: (res) => {
  508. // console.log(1);
  509. // this.url = res.tempFilePaths[0];
  510. // },
  511. // });
  512. // },
  513. worm() {
  514. uni.navigateTo({
  515. url: '../expertDiagnosis/wormcase?name=虫情百科',
  516. });
  517. },
  518. virus() {
  519. uni.navigateTo({
  520. url: '../expertDiagnosis/wormcase?name=病害百科',
  521. });
  522. },
  523. introduce(id, title) {
  524. uni.navigateTo({
  525. url: '../expertDiagnosis/introduce?id=' + id + '&title=' + title,
  526. });
  527. },
  528. checkLocationPermission(isTest) {
  529. let session_key = uni.getStorageSync('session_key');
  530. let _this = this;
  531. // 当用户登录之后再弹位置权限框
  532. if (session_key) {
  533. uni.getSetting({
  534. success(res) {
  535. console.log(res);
  536. if (res.authSetting['scope.userLocation']) {
  537. uni.getLocation({
  538. type: 'wgs84 ',
  539. success: (res) => {
  540. // console.log(res, 'loacation');
  541. // uni.showToast({
  542. // title: `${res.longitude}, ${res.longitude}`,
  543. // duration: 20000,
  544. // icon:'none'
  545. // });
  546. _this.getcity(res.longitude, res.latitude);
  547. },
  548. fail(e) {
  549. // uni.showModal({
  550. // title: '提示',
  551. // content: JSON.stringify(e),
  552. // success: function (res) {
  553. // if (res.confirm) {
  554. // console.log('用户点击确定');
  555. // } else if (res.cancel) {
  556. // console.log('用户点击取消');
  557. // }
  558. // }
  559. // });
  560. uni.showToast({
  561. title: '系统未开启定位或未授权微信定位',
  562. duration: 5000,
  563. icon: 'none'
  564. });
  565. }
  566. });
  567. } else {
  568. uni.authorize({
  569. scope: 'scope.userLocation',
  570. success: () => {
  571. // 用户已授权
  572. uni.getLocation({
  573. type: 'wgs84 ',
  574. success: (res) => {
  575. console.log(res, 'loacation');
  576. _this.getcity(res.longitude, res.latitude);
  577. },
  578. });
  579. },
  580. fail: () => {
  581. // 用户拒绝授权,可引导用户至设置页手动开启
  582. if (isTest) {
  583. uni.showModal({
  584. title: '需要授权',
  585. content: '天气功能需要获取您的地理位置,请在设置中打开位置权限',
  586. success: (modalRes) => {
  587. if (modalRes.confirm) {
  588. uni.openSetting()
  589. } else {
  590. uni.showToast({
  591. title: '您拒绝了授权,将无法查看天气信息',
  592. duration: 2000,
  593. icon: 'none'
  594. });
  595. }
  596. },
  597. })
  598. }
  599. },
  600. })
  601. }
  602. }
  603. })
  604. }
  605. }
  606. },
  607. onLoad() {
  608. console.log(this.$imageURL)
  609. var time = new Date();
  610. var hours = time.getHours();
  611. if (hours < 12) {
  612. this.hello = '上午好!';
  613. } else {
  614. this.hello = '下午好!';
  615. }
  616. this.getUserlogin();
  617. this.checkLocationPermission(true); // 首次加载弹框提醒
  618. },
  619. onShow() {
  620. this.loadTF = false;
  621. this.getUserlogin();
  622. this.checkLocationPermission();
  623. },
  624. };
  625. </script>
  626. <style lang="less">
  627. page {
  628. background: linear-gradient(180deg, #1FC676 11.72%, #1FC676 11.52%, #D5F9E7 29.83%, #F5F6FA 36.96%), #FFF;
  629. // background-image: url(https://s3.hnyfwlw.com/webstaticimg/bigdata_app/newindex/bg.png);
  630. // background: linear-gradient(180deg, #1FC676 8.72%, #1FC676 18.52%, #D5F9E7 21.83%, #F5F6FA 25.96%), #FFF;
  631. background-size: 100%;
  632. background-repeat: no-repeat;
  633. background-color: #f9f9f9;
  634. }
  635. .home {
  636. // background: linear-gradient(180deg, #1FC676 8.72%, #1FC676 18.52%, #D5F9E7 21.83%, #F5F6FA 25.96%), #FFF;
  637. width: 100%;
  638. height: 100%;
  639. padding-top: 94rpx;
  640. box-sizing: border-box;
  641. }
  642. .welcom {
  643. height: 64rpx;
  644. line-height: 64rpx;
  645. padding-left: 16rpx;
  646. font-size: 40rpx;
  647. color: #fff;
  648. }
  649. .weather-bg {
  650. width: 100%;
  651. height: 212rpx;
  652. background-image: url(https://s3.hnyfwlw.com/webstaticimg/bigdata_app/newImg/home/banner-bg.png);
  653. background-size: 100% 100%;
  654. background-repeat: no-repeat;
  655. }
  656. .weather-box {
  657. display: flex;
  658. margin: 24rpx 0 16rpx 0;
  659. }
  660. .weather:nth-child(1) {
  661. border-right: 1px solid rgba(255, 255, 255, 0.6);
  662. }
  663. .weather {
  664. flex: 1;
  665. display: flex;
  666. .weaimg {
  667. width: 42rpx;
  668. height: 42rpx;
  669. }
  670. .weatext {
  671. gap: 8rpx;
  672. flex: 1;
  673. display: flex;
  674. flex-direction: column;
  675. align-items: center;
  676. font-size: 24rpx;
  677. color: rgba(255, 255, 255, 0.8);
  678. }
  679. .weatext_title {
  680. font-size: 24rpx;
  681. color: #fff;
  682. }
  683. .text-span {
  684. color: #0BBC58;
  685. margin-left: 16rpx;
  686. padding: 0 2px;
  687. border-radius: 4px;
  688. background: rgba(255, 255, 255, 0.6);
  689. }
  690. .text-value {
  691. font-size: 48rpx;
  692. color: #fff;
  693. }
  694. }
  695. .weather-warning {
  696. margin: 20rpx 0;
  697. padding: 0 40rpx;
  698. color: #fff;
  699. .weather-alert{
  700. width:30rpx;
  701. height: 30rpx;
  702. margin-right: 10rpx;
  703. }
  704. }
  705. .ai-box {
  706. width: 100%;
  707. padding: 0 40rpx;
  708. box-sizing: border-box;
  709. height: 128rpx;
  710. margin-bottom: 12rpx;
  711. position: relative;
  712. top: -20rpx;
  713. .ai-content {
  714. box-sizing: border-box;
  715. height: 100%;
  716. border-radius: 8px;
  717. border: 1.5px solid #FFF;
  718. background: linear-gradient(180deg, #ffffffa3 0%, #FFF 100%);
  719. padding: 24rpx;
  720. image {
  721. width: 80rpx;
  722. height: 80rpx;
  723. float: left;
  724. margin-right: 16rpx;
  725. }
  726. .float-right {
  727. float: right;
  728. padding: 4px 12px;
  729. color: #fff;
  730. border-radius: 28px;
  731. background: #0BBC58;
  732. margin: 12rpx 0;
  733. }
  734. .ai-text {
  735. float: left;
  736. }
  737. .ai-text-title {
  738. color: #333834;
  739. line-height: 40rpx;
  740. font-size: 28rpx;
  741. font-weight: 700;
  742. }
  743. .ai-text-subtitle {
  744. color: #7b9783;
  745. line-height: 40rpx;
  746. font-size: 20rpx;
  747. font-weight: 400;
  748. }
  749. }
  750. }
  751. .functionbox {
  752. width: 100%;
  753. // height: 240rpx;
  754. padding: 0rpx 32rpx 0 32rpx;
  755. box-sizing: border-box;
  756. margin-bottom: 16rpx;
  757. .swiper {
  758. height: 208rpx;
  759. }
  760. .functionbox_title {
  761. padding-left: 20rpx;
  762. font-size: 34rpx;
  763. }
  764. .functionbox_text {
  765. display: flex;
  766. flex-wrap: wrap;
  767. // justify-content: space-around;
  768. margin-top: 30rpx;
  769. .functionbox_text_item {
  770. width:20%;
  771. text-align: center;
  772. color: #616666;
  773. font-size: 24rpx;
  774. margin-bottom: 32rpx;
  775. .itemimg {
  776. width: 80rpx;
  777. height: 80rpx;
  778. margin-bottom: 16rpx;
  779. }
  780. }
  781. }
  782. }
  783. .facilitybox {
  784. width: 100%;
  785. padding: 0 32rpx;
  786. box-sizing: border-box;
  787. background: #F5F6FA;
  788. .facilitybox-content {
  789. border-radius: 16rpx;
  790. background: #FFF;
  791. padding: 32rpx;
  792. }
  793. .facilitybox_title {
  794. font-size: 30rpx;
  795. color: #333;
  796. margin-bottom: 24rpx;
  797. // padding-left: 20rpx;
  798. }
  799. .facilitybox_itembox {
  800. display: flex;
  801. gap: 32rpx;
  802. .facilitybox_item {
  803. flex: 1;
  804. color: #616666;
  805. .facilitybox_span {
  806. padding: 16rpx 24rpx;
  807. width: 50%;
  808. color: #0B3F5D;
  809. font-weight: 500;
  810. font-size: 28rpx;
  811. .text {
  812. font-size: 20rpx;
  813. color: #4E916E;
  814. font-weight: 400;
  815. margin-top: 9rpx;
  816. }
  817. }
  818. .itemimg {
  819. width: 90rpx;
  820. height: 90rpx;
  821. float: right;
  822. margin: 7rpx 0;
  823. }
  824. }
  825. .facilitybox-zhuanjia {
  826. border-radius: 8px;
  827. background: linear-gradient(180deg, #D3FBE6 0%, #F5F7FA 100%);
  828. position: relative;
  829. .itemimg {
  830. width: 112rpx;
  831. height: 146rpx;
  832. position: absolute;
  833. bottom: 0;
  834. right: 16rpx;
  835. }
  836. text {
  837. color: #003318;
  838. font-weight: 500;
  839. font-size: 28rpx;
  840. }
  841. }
  842. .facilitybox-suishi {
  843. border-radius: 8px;
  844. background: linear-gradient(180deg, #CAECFF 0%, #F5F7FA 99.89%);
  845. padding: 9rpx 0;
  846. .facilitybox_span {
  847. color: #0B3F5D;
  848. }
  849. }
  850. .facilitybox-bchk {
  851. border-radius: 8px;
  852. background: linear-gradient(180deg, #EEE5F6 0%, #F5F7FA 95.65%);
  853. // height: 102rpx;
  854. padding: 10rpx 0;
  855. .facilitybox_span {
  856. color: #3E2B50;
  857. }
  858. .itemimg {
  859. width: 78rpx;
  860. height: 72rpx;
  861. margin-right: 10rpx;
  862. }
  863. }
  864. .facilitybox-jgqs {
  865. border-radius: 8px;
  866. background: linear-gradient(180deg, #D2E5FF 0%, #F5F7FA 95.65%);
  867. .facilitybox_span {
  868. color: #0D2E5B;
  869. }
  870. }
  871. .facilitybox-jwjy {
  872. border-radius: 8px;
  873. background: linear-gradient(180deg, #FFF4D2 0%, #F5F7FA 95.65%);
  874. .facilitybox_span {
  875. color: #3D4012;
  876. }
  877. }
  878. }
  879. }
  880. .banner-ad {
  881. margin: 32rpx 0;
  882. height: 224rpx;
  883. border-radius: 8px;
  884. background-size: 100% 100%;
  885. background-image: url(https://s3.hnyfwlw.com/webstaticimg/bigdata_app/newImg/home/ad-banner.png);
  886. .ad-text{
  887. height: 100%;
  888. display: flex;
  889. flex-direction: column;
  890. justify-content: space-around;
  891. padding: 40rpx;
  892. box-sizing: border-box;
  893. .title{
  894. color: #333333;
  895. font-size: 28rpx;
  896. font-style: normal;
  897. font-weight: 700;
  898. line-height: normal;
  899. }
  900. .sub-title{
  901. color: #666666;
  902. font-size: 20rpx;
  903. font-style: normal;
  904. font-weight: 500;
  905. line-height: normal;
  906. }
  907. .btn{
  908. text-align: center;
  909. width: 112rpx;
  910. color:#fff;
  911. padding: 4px 0px;
  912. font-size: 20rpx;
  913. border-radius: 4px;
  914. background: linear-gradient(106deg, #0BBC58 2.6%, #7CE6FB 86.51%);
  915. }
  916. }
  917. }
  918. .insectattack {
  919. width: 90%;
  920. margin: 0 auto;
  921. padding: 30rpx;
  922. .insectattack_title {
  923. font-size: 34rpx;
  924. // padding-left: 20rpx;
  925. display: flex;
  926. justify-content: space-between;
  927. .iconbox {
  928. width: 40rpx;
  929. height: 40rpx;
  930. background-color: #cfd6d6;
  931. color: #909696;
  932. border-radius: 40rpx;
  933. line-height: 40rpx;
  934. text-align: center;
  935. font-size: 20rpx;
  936. }
  937. }
  938. .insectattack_listbox {
  939. // padding: 0 20rpx;
  940. overflow-x: auto;
  941. .insectattack_list {
  942. width: 1104rpx;
  943. display: flex;
  944. margin-top: 30rpx;
  945. flex-wrap: wrap;
  946. .list_box {
  947. // background-color: #f00;
  948. background-size: 100% 100%;
  949. width: 246rpx;
  950. height: 324rpx;
  951. margin-right: 30rpx;
  952. border-radius: 20rpx;
  953. position: relative;
  954. .list_boxbg {
  955. width: 100%;
  956. height: 100%;
  957. position: absolute;
  958. top: 0;
  959. left: 0;
  960. z-index: -1;
  961. .list_boxbg_img {
  962. width: 100%;
  963. height: 100%;
  964. }
  965. }
  966. .list_box_xiang {
  967. width: 95%;
  968. margin-top: 0rpx auto;
  969. display: flex;
  970. justify-content: flex-end;
  971. padding-top: 20rpx;
  972. .list_box_xiang_click {
  973. padding: 8rpx 15rpx;
  974. background-color: rgba(0, 0, 0, 0.2);
  975. color: #fff;
  976. font-size: 20rpx;
  977. border-radius: 52rpx;
  978. }
  979. }
  980. .list_box_info {
  981. width: 90%;
  982. margin: 130rpx auto 0;
  983. height: 120rpx;
  984. border-radius: 10rpx;
  985. background-image: linear-gradient(to right,
  986. #ffffff,
  987. rgba(255, 255, 255, 0.44));
  988. padding: 10rpx;
  989. box-sizing: border-box;
  990. .list_box_info_name {
  991. font-weight: 700;
  992. }
  993. .list_box_info_text {
  994. font-size: 18rpx;
  995. overflow: hidden;
  996. text-overflow: ellipsis;
  997. display: -webkit-box;
  998. -webkit-box-orient: vertical;
  999. -webkit-line-clamp: 2;
  1000. }
  1001. }
  1002. }
  1003. // .list_box1 {
  1004. // background-image: url(../../static/images/newindex/cao.png);
  1005. // }
  1006. // .list_box2 {
  1007. // background-image: url(../../static/images/newindex/yee.jpg);
  1008. // }
  1009. // .list_box3 {
  1010. // background-image: url(../../static/images/newindex/lingc.jpg);
  1011. // }
  1012. // .list_box4 {
  1013. // background-image: url(../../static/images/newindex/ming.png);
  1014. // }
  1015. // .list_box5 {
  1016. // background-image: url(../../static/images/newindex/mai.png);
  1017. // }
  1018. // .list_box6 {
  1019. // background-image: url(../../static/images/newindex/dadou.jpg)
  1020. // }
  1021. // .list_box7 {
  1022. // background-image: url(../../static/images/newindex/yumi.png);
  1023. // }
  1024. // .list_box8 {
  1025. // background-image: url(../../static/images/newindex/dao.png);
  1026. // }
  1027. }
  1028. }
  1029. }
  1030. .loading {
  1031. position: absolute;
  1032. top: 0;
  1033. left: 0;
  1034. z-index: 100;
  1035. width: 100%;
  1036. height: 100vh;
  1037. background-color: rgba(0, 0, 0, 0.5);
  1038. display: flex;
  1039. justify-content: center;
  1040. align-items: center;
  1041. }
  1042. </style>