index.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538
  1. <template>
  2. <view>
  3. <uni-page-head class="cust-uni-page-head">
  4. <view class="cust-agrcloud-uni-page-head uni-page-head">
  5. <view class="uni-page-head-hd cust-agrcloud-uni-page-head-hd"
  6. @click="handleRedirectMainPageClick">
  7. <view class="uni-page-head-btn">
  8. <image class="uni-btn-icon cust-head-icon"
  9. src="@/static/agrcloud-images/agrcloud-head-dir-img.png"></image>
  10. </view>
  11. </view>
  12. <view class="uni-page-head-bd">
  13. <view class="uni-page-head__title"
  14. style="font-size: 16px; opacity: 1;">修文农业云公共服务系统
  15. </view>
  16. </view>
  17. <view class="uni-page-head-hd cust-agrcloud-uni-page-head-hd">
  18. <view class="uni-page-head-btn">
  19. <image class="uni-btn-icon cust-head-notice-icon"
  20. src="@/static/agrcloud-images/agrcloud-head-notice-icon.png"></image>
  21. </view>
  22. </view>
  23. </view>
  24. </uni-page-head>
  25. <view class="page-content">
  26. <view class="page-content-title">
  27. <view class="content-title">
  28. <image class="weather-densefog"
  29. src="@/static/agrcloud-images/agrcloud-weather-densefog-img.png"></image>
  30. <u-notice-bar class="title-text"
  31. mode="horizontal"
  32. type="none"
  33. :volume-icon="true"
  34. :more-icon="true"
  35. :is-circular="true"
  36. :list="titleContentList"></u-notice-bar>
  37. </view>
  38. </view>
  39. <view class="main-content">
  40. <!-- 质量安全投诉 -->
  41. <view class="main-content-complaints">
  42. <view class="complaints-container"
  43. @click="handleWarterClick('complaints')">
  44. <image class="complaints-container-icon"
  45. src="@/static/agrcloud-images/agrcloud-main-page-complaints-icon.png">
  46. </image>
  47. <view class="complaints-container-title">
  48. <text class="complaints-container-title-text">质量安全投诉</text>
  49. </view>
  50. <view class="complaints-container-subtitle">
  51. <text class="complaints-container-subtitle-text">Complaints</text>
  52. </view>
  53. </view>
  54. </view>
  55. <!-- 气象服务 农技专家 政策法规 通知公告 -->
  56. <view class="main-content-metexpregnotice">
  57. <view class="complaints-metexpregnotice">
  58. <view class="metexpregnotice-meteregula">
  59. <!-- 气象服务 -->
  60. <view class="meteregula-meteorological">
  61. <view class="meteorological-container"
  62. @click="handleWarterClick('meteorological')">
  63. <image class="meteorological-container-icon"
  64. src="@/static/agrcloud-images/agrcloud-main-page-meteorological-icon.png">
  65. </image>
  66. <view class="meteorological-container-title">
  67. <text class="meteorological-container-title-text">气象服务</text>
  68. </view>
  69. <view class="meteorological-container-subtitle">
  70. <text class="meteorological-container-subtitle-text">Meteorological</text>
  71. </view>
  72. </view>
  73. </view>
  74. <!-- 政策法规 -->
  75. <view class="meteregula-regulations">
  76. <view class="regulations-container"
  77. @click="handleWarterClick('regulations')">
  78. <image class="regulations-container-icon"
  79. src="@/static/agrcloud-images/agrcloud-main-page-regulations-icon.png">
  80. </image>
  81. <view class="regulations-container-title">
  82. <text class="regulations-container-title-text">政策法规</text>
  83. </view>
  84. <view class="regulations-container-subtitle">
  85. <text class="regulations-container-subtitle-text">Regulations</text>
  86. </view>
  87. </view>
  88. </view>
  89. </view>
  90. <!-- 农技专家 -->
  91. <view class="metexpregnotice-expertsnotice">
  92. <view class="expertsnotice-experts">
  93. <view class="experts-container"
  94. @click="handleWarterClick('experts')">
  95. <image class="experts-container-icon"
  96. src="@/static/agrcloud-images/agrcloud-main-page-experts-icon.png">
  97. </image>
  98. <view class="experts-container-title">
  99. <text class="experts-container-title-text">农技专家</text>
  100. </view>
  101. <view class="experts-container-subtitle">
  102. <text class="experts-container-subtitle-text">Experts</text>
  103. </view>
  104. </view>
  105. </view>
  106. <!-- 通知公告 -->
  107. <view class="expertsnotice-notice">
  108. <view class="notice-container"
  109. @click="handleWarterClick('notice')">
  110. <image class="notice-container-icon"
  111. src="@/static/agrcloud-images/agrcloud-main-page-notice-icon.png">
  112. </image>
  113. <view class="notice-container-title">
  114. <text class="notice-container-title-text">通知公告</text>
  115. </view>
  116. <view class="notice-container-subtitle">
  117. <text class="notice-container-subtitle-text">Notice</text>
  118. </view>
  119. </view>
  120. </view>
  121. </view>
  122. </view>
  123. </view>
  124. <view style="clear: both;"></view>
  125. <!-- 监测信息 -->
  126. <view class="main-content-monitoring">
  127. <view class="content-monitoring">
  128. <view class="monitoring-container"
  129. @click="handleWarterClick('monitoring')">
  130. <image class="monitoring-container-icon"
  131. src="@/static/agrcloud-images/agrcloud-main-page-monitoring-icon.png">
  132. </image>
  133. <view class="monitoring-container-title">
  134. <text class="monitoring-container-title-text">监测信息</text>
  135. </view>
  136. <view class="monitoring-container-subtitle">
  137. <text class="monitoring-container-subtitle-text">Monitoring</text>
  138. </view>
  139. </view>
  140. </view>
  141. </view>
  142. </view>
  143. </view>
  144. </view>
  145. </template>
  146. <script>
  147. import mapinfo from '@/agrcloud-utils/mapinfo';
  148. export default {
  149. data() {
  150. return {
  151. titleContentList: ['气象预警:修文县气象台2021年1月20日10时30分发布晴朗天气'],
  152. mainNavigateToObj: {
  153. complaints: '/pages/complaints/index',
  154. // meteorological: '/pages/meteorological/index',
  155. regulations: '/pages/regulations/index',
  156. experts: '/pages/experts/index',
  157. notice: '/pages/notice/index',
  158. monitoring: '/pages/monitoring/index'
  159. }
  160. };
  161. },
  162. onLoad() {
  163. // #ifdef H5
  164. // this.initMapinfo();
  165. // #endif
  166. },
  167. methods: {
  168. handleWarterClick(itemData) {
  169. if (!itemData || !this.mainNavigateToObj[itemData]) {
  170. this.$msgbox('模块建设中...');
  171. return;
  172. }
  173. uni.navigateTo({
  174. url: this.mainNavigateToObj[itemData]
  175. });
  176. },
  177. initMapinfo() {
  178. mapinfo().then((res) => {
  179. const currTitleContent = '当前气象信息: ';
  180. const currProvince = ((res.regeocode || {}).addressComponent || {}).province;
  181. const currCity = ((res.regeocode || {}).addressComponent || {}).city;
  182. const currDistrict = ((res.regeocode || {}).addressComponent || {}).district;
  183. const currDate = new Date();
  184. const currFormatDate = currDate.getFullYear() + '年' + (currDate.getMonth() + 1) + '月' + currDate.getDate() +
  185. '日' + currDate.getHours() + '时' + currDate.getMinutes() + '分' + currDate.getSeconds() + '秒';
  186. const currWeather = (res.weatherInfo || {}).weather;
  187. const currTemperature = (res.weatherInfo || {}).temperature;
  188. const currWinddirection = (res.weatherInfo || {}).winddirection;
  189. const currWindpower = (res.weatherInfo || {}).windpower;
  190. const currHumidity = (res.weatherInfo || {}).humidity;
  191. this.titleContentList = [
  192. currTitleContent + currProvince + currCity + currDistrict + currFormatDate + currWeather +
  193. currTemperature + '℃' + currWinddirection + '风' + currWindpower + '级空气湿度' + currHumidity
  194. ];
  195. });
  196. }
  197. }
  198. };
  199. </script>
  200. <style lang="scss"
  201. scoped>
  202. .page-content {
  203. padding: 0;
  204. &-title {
  205. width: 100%;
  206. background-color: #ffffff;
  207. .content-title {
  208. margin: 0 47rpx 0 54rpx;
  209. .title-logo {
  210. padding-top: 9rpx;
  211. height: 52rpx;
  212. width: 30rpx;
  213. float: left;
  214. }
  215. .weather-densefog {
  216. padding-top: 16rpx;
  217. float: left;
  218. width: 36rpx;
  219. height: 36rpx;
  220. }
  221. .title-text {
  222. width: calc(100% - 36rpx);
  223. }
  224. }
  225. }
  226. .main-content {
  227. padding: 36rpx 24rpx;
  228. width: 100%;
  229. .main-content-complaints {
  230. width: 702rpx;
  231. height: 240rpx;
  232. background-image: url("../../static/agrcloud-images/agrcloud-main-page-complaints-bg.png");
  233. background-size: cover;
  234. background-color: transparent;
  235. background-position: center;
  236. .complaints-container {
  237. padding-top: 26rpx;
  238. padding-left: 40rpx;
  239. &-icon {
  240. width: 84rpx;
  241. height: 84rpx;
  242. }
  243. .complaints-container-title {
  244. margin-top: 4rpx;
  245. &-text {
  246. height: 67rpx;
  247. font-size: 48rpx;
  248. font-family: PingFangSC-Medium, PingFang SC;
  249. font-weight: 500;
  250. color: #FFFFFF;
  251. line-height: 67rpx;
  252. letter-spacing: 4rpx;
  253. }
  254. }
  255. .complaints-container-subtitle {
  256. &-text {
  257. text-transform: uppercase;
  258. height: 33rpx;
  259. font-size: 24rpx;
  260. font-family: PingFangSC-Medium, PingFang SC;
  261. font-weight: 500;
  262. color: #FFFFFF;
  263. line-height: 33rpx;
  264. letter-spacing: 2rpx;
  265. }
  266. }
  267. }
  268. }
  269. .main-content-metexpregnotice {
  270. padding-top: 24rpx;
  271. .complaints-metexpregnotice {
  272. .metexpregnotice-meteregula {
  273. float: left;
  274. .meteregula-meteorological {
  275. width: 338rpx;
  276. height: 260rpx;
  277. background-image: url("../../static/agrcloud-images/agrcloud-main-page-meteorological-bg.png");
  278. background-size: cover;
  279. background-color: transparent;
  280. background-position: center;
  281. .meteorological-container {
  282. padding-top: 32rpx;
  283. padding-left: 40rpx;
  284. &-icon {
  285. width: 84rpx;
  286. height: 84rpx;
  287. }
  288. .meteorological-container-title {
  289. margin-top: 18rpx;
  290. &-text {
  291. height: 67rpx;
  292. font-size: 48rpx;
  293. font-family: PingFangSC-Medium, PingFang SC;
  294. font-weight: 500;
  295. color: #FFFFFF;
  296. line-height: 67rpx;
  297. letter-spacing: 4rpx;
  298. }
  299. }
  300. .meteorological-container-subtitle {
  301. &-text {
  302. text-transform: uppercase;
  303. height: 33rpx;
  304. font-size: 24rpx;
  305. font-family: PingFangSC-Medium, PingFang SC;
  306. font-weight: 500;
  307. color: #FFFFFF;
  308. line-height: 33rpx;
  309. letter-spacing: 2rpx;
  310. }
  311. }
  312. }
  313. }
  314. .meteregula-regulations {
  315. margin-top: 25rpx;
  316. width: 338rpx;
  317. height: 380rpx;
  318. background-image: url("../../static/agrcloud-images/agrcloud-main-page-regulations-bp.png");
  319. background-size: cover;
  320. background-color: transparent;
  321. background-position: center;
  322. .regulations-container {
  323. padding-top: 71rpx;
  324. padding-left: 40rpx;
  325. &-icon {
  326. width: 84rpx;
  327. height: 84rpx;
  328. }
  329. .regulations-container-title {
  330. margin-top: 65rpx;
  331. &-text {
  332. height: 67rpx;
  333. font-size: 48rpx;
  334. font-family: PingFangSC-Medium, PingFang SC;
  335. font-weight: 500;
  336. color: #FFFFFF;
  337. line-height: 67rpx;
  338. letter-spacing: 4rpx;
  339. }
  340. }
  341. .regulations-container-subtitle {
  342. &-text {
  343. text-transform: uppercase;
  344. height: 33rpx;
  345. font-size: 24rpx;
  346. font-family: PingFangSC-Medium, PingFang SC;
  347. font-weight: 500;
  348. color: #FFFFFF;
  349. line-height: 33rpx;
  350. letter-spacing: 2rpx;
  351. }
  352. }
  353. }
  354. }
  355. }
  356. .metexpregnotice-expertsnotice {
  357. float: left;
  358. margin-left: 25rpx;
  359. .expertsnotice-experts {
  360. width: 338rpx;
  361. height: 380rpx;
  362. background-image: url("../../static/agrcloud-images/agrcloud-main-page-experts-bg.png");
  363. background-size: cover;
  364. background-color: transparent;
  365. background-position: center;
  366. .experts-container {
  367. padding-top: 78rpx;
  368. padding-left: 40rpx;
  369. &-icon {
  370. width: 84rpx;
  371. height: 84rpx;
  372. }
  373. .experts-container-title {
  374. margin-top: 58rpx;
  375. &-text {
  376. height: 67rpx;
  377. font-size: 48rpx;
  378. font-family: PingFangSC-Medium, PingFang SC;
  379. font-weight: 500;
  380. color: #FFFFFF;
  381. line-height: 67rpx;
  382. letter-spacing: 4rpx;
  383. }
  384. }
  385. .experts-container-subtitle {
  386. &-text {
  387. text-transform: uppercase;
  388. height: 33rpx;
  389. font-size: 24rpx;
  390. font-family: PingFangSC-Medium, PingFang SC;
  391. font-weight: 500;
  392. color: #FFFFFF;
  393. line-height: 33rpx;
  394. letter-spacing: 2rpx;
  395. }
  396. }
  397. }
  398. }
  399. .expertsnotice-notice {
  400. margin-top: 25rpx;
  401. width: 338rpx;
  402. height: 260rpx;
  403. background-image: url("../../static/agrcloud-images/agrcloud-main-page-notice-bp.png");
  404. background-size: cover;
  405. background-color: transparent;
  406. background-position: center;
  407. .notice-container {
  408. padding-top: 32rpx;
  409. padding-left: 40rpx;
  410. &-icon {
  411. width: 84rpx;
  412. height: 84rpx;
  413. }
  414. .notice-container-title {
  415. margin-top: 18rpx;
  416. &-text {
  417. height: 67rpx;
  418. font-size: 48rpx;
  419. font-family: PingFangSC-Medium, PingFang SC;
  420. font-weight: 500;
  421. color: #FFFFFF;
  422. line-height: 67rpx;
  423. letter-spacing: 4rpx;
  424. }
  425. }
  426. .notice-container-subtitle {
  427. &-text {
  428. text-transform: uppercase;
  429. height: 33rpx;
  430. font-size: 24rpx;
  431. font-family: PingFangSC-Medium, PingFang SC;
  432. font-weight: 500;
  433. color: #FFFFFF;
  434. line-height: 33rpx;
  435. letter-spacing: 2rpx;
  436. }
  437. }
  438. }
  439. }
  440. }
  441. }
  442. }
  443. .main-content-monitoring {
  444. padding-top: 24rpx;
  445. .content-monitoring {
  446. width: 702rpx;
  447. height: 240rpx;
  448. background-image: url("../../static/agrcloud-images/agrcloud-main-page-monitoring-bp.png");
  449. background-size: cover;
  450. background-color: transparent;
  451. background-position: center;
  452. .monitoring-container {
  453. padding-top: 26rpx;
  454. padding-left: 40rpx;
  455. &-icon {
  456. width: 84rpx;
  457. height: 84rpx;
  458. }
  459. .monitoring-container-title {
  460. margin-top: 4rpx;
  461. &-text {
  462. height: 67rpx;
  463. font-size: 48rpx;
  464. font-family: PingFangSC-Medium, PingFang SC;
  465. font-weight: 500;
  466. color: #FFFFFF;
  467. line-height: 67rpx;
  468. letter-spacing: 4rpx;
  469. }
  470. }
  471. .monitoring-container-subtitle {
  472. &-text {
  473. text-transform: uppercase;
  474. height: 33rpx;
  475. font-size: 24rpx;
  476. font-family: PingFangSC-Medium, PingFang SC;
  477. font-weight: 500;
  478. color: #FFFFFF;
  479. line-height: 33rpx;
  480. letter-spacing: 2rpx;
  481. }
  482. }
  483. }
  484. }
  485. }
  486. }
  487. }
  488. </style>