index.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536
  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. mapinfo().then((res) => {
  165. console.log(res)
  166. const currTitleContent = '当前气象信息: ';
  167. const currProvince = ((res.regeocode || {}).addressComponent || {}).province;
  168. const currCity = ((res.regeocode || {}).addressComponent || {}).city;
  169. const currDistrict = ((res.regeocode || {}).addressComponent || {}).district;
  170. const currDate = new Date();
  171. const currFormatDate = currDate.getFullYear() + '年' + (currDate.getMonth() + 1) + '月' + currDate.getDate() +
  172. '日' + currDate.getHours() + '时' + currDate.getMinutes() + '分' + currDate.getSeconds() + '秒';
  173. const currWeather = (res.weatherInfo || {}).weather;
  174. const currTemperature = (res.weatherInfo || {}).temperature;
  175. const currWinddirection = (res.weatherInfo || {}).winddirection;
  176. const currWindpower = (res.weatherInfo || {}).windpower;
  177. const currHumidity = (res.weatherInfo || {}).humidity;
  178. this.titleContentList = [
  179. currTitleContent + currProvince + currCity + currDistrict + currFormatDate + currWeather +
  180. currTemperature + '℃' + currWinddirection + '风' + currWindpower + '级空气湿度' + currHumidity
  181. ];
  182. });
  183. // #endif
  184. },
  185. methods: {
  186. handleWarterClick(itemData) {
  187. if (!itemData || !this.mainNavigateToObj[itemData]) {
  188. this.$msgbox('模块建设中...');
  189. return;
  190. }
  191. uni.navigateTo({
  192. url: this.mainNavigateToObj[itemData]
  193. });
  194. }
  195. }
  196. };
  197. </script>
  198. <style lang="scss"
  199. scoped>
  200. .page-content {
  201. padding: 0;
  202. &-title {
  203. width: 100%;
  204. background-color: #ffffff;
  205. .content-title {
  206. margin: 0 47rpx 0 54rpx;
  207. .title-logo {
  208. padding-top: 9rpx;
  209. height: 52rpx;
  210. width: 30rpx;
  211. float: left;
  212. }
  213. .weather-densefog {
  214. padding-top: 16rpx;
  215. float: left;
  216. width: 36rpx;
  217. height: 36rpx;
  218. }
  219. .title-text {
  220. width: calc(100% - 36rpx);
  221. }
  222. }
  223. }
  224. .main-content {
  225. padding: 36rpx 24rpx;
  226. width: 100%;
  227. .main-content-complaints {
  228. width: 702rpx;
  229. height: 240rpx;
  230. background-image: url("../../static/agrcloud-images/agrcloud-main-page-complaints-bg.png");
  231. background-size: cover;
  232. background-color: transparent;
  233. background-position: center;
  234. .complaints-container {
  235. padding-top: 26rpx;
  236. padding-left: 40rpx;
  237. &-icon {
  238. width: 84rpx;
  239. height: 84rpx;
  240. }
  241. .complaints-container-title {
  242. margin-top: 4rpx;
  243. &-text {
  244. height: 67rpx;
  245. font-size: 48rpx;
  246. font-family: PingFangSC-Medium, PingFang SC;
  247. font-weight: 500;
  248. color: #FFFFFF;
  249. line-height: 67rpx;
  250. letter-spacing: 4rpx;
  251. }
  252. }
  253. .complaints-container-subtitle {
  254. &-text {
  255. text-transform: uppercase;
  256. height: 33rpx;
  257. font-size: 24rpx;
  258. font-family: PingFangSC-Medium, PingFang SC;
  259. font-weight: 500;
  260. color: #FFFFFF;
  261. line-height: 33rpx;
  262. letter-spacing: 2rpx;
  263. }
  264. }
  265. }
  266. }
  267. .main-content-metexpregnotice {
  268. padding-top: 24rpx;
  269. .complaints-metexpregnotice {
  270. .metexpregnotice-meteregula {
  271. float: left;
  272. .meteregula-meteorological {
  273. width: 338rpx;
  274. height: 260rpx;
  275. background-image: url("../../static/agrcloud-images/agrcloud-main-page-meteorological-bg.png");
  276. background-size: cover;
  277. background-color: transparent;
  278. background-position: center;
  279. .meteorological-container {
  280. padding-top: 32rpx;
  281. padding-left: 40rpx;
  282. &-icon {
  283. width: 84rpx;
  284. height: 84rpx;
  285. }
  286. .meteorological-container-title {
  287. margin-top: 18rpx;
  288. &-text {
  289. height: 67rpx;
  290. font-size: 48rpx;
  291. font-family: PingFangSC-Medium, PingFang SC;
  292. font-weight: 500;
  293. color: #FFFFFF;
  294. line-height: 67rpx;
  295. letter-spacing: 4rpx;
  296. }
  297. }
  298. .meteorological-container-subtitle {
  299. &-text {
  300. text-transform: uppercase;
  301. height: 33rpx;
  302. font-size: 24rpx;
  303. font-family: PingFangSC-Medium, PingFang SC;
  304. font-weight: 500;
  305. color: #FFFFFF;
  306. line-height: 33rpx;
  307. letter-spacing: 2rpx;
  308. }
  309. }
  310. }
  311. }
  312. .meteregula-regulations {
  313. margin-top: 25rpx;
  314. width: 338rpx;
  315. height: 380rpx;
  316. background-image: url("../../static/agrcloud-images/agrcloud-main-page-regulations-bp.png");
  317. background-size: cover;
  318. background-color: transparent;
  319. background-position: center;
  320. .regulations-container {
  321. padding-top: 71rpx;
  322. padding-left: 40rpx;
  323. &-icon {
  324. width: 84rpx;
  325. height: 84rpx;
  326. }
  327. .regulations-container-title {
  328. margin-top: 65rpx;
  329. &-text {
  330. height: 67rpx;
  331. font-size: 48rpx;
  332. font-family: PingFangSC-Medium, PingFang SC;
  333. font-weight: 500;
  334. color: #FFFFFF;
  335. line-height: 67rpx;
  336. letter-spacing: 4rpx;
  337. }
  338. }
  339. .regulations-container-subtitle {
  340. &-text {
  341. text-transform: uppercase;
  342. height: 33rpx;
  343. font-size: 24rpx;
  344. font-family: PingFangSC-Medium, PingFang SC;
  345. font-weight: 500;
  346. color: #FFFFFF;
  347. line-height: 33rpx;
  348. letter-spacing: 2rpx;
  349. }
  350. }
  351. }
  352. }
  353. }
  354. .metexpregnotice-expertsnotice {
  355. float: left;
  356. margin-left: 25rpx;
  357. .expertsnotice-experts {
  358. width: 338rpx;
  359. height: 380rpx;
  360. background-image: url("../../static/agrcloud-images/agrcloud-main-page-experts-bg.png");
  361. background-size: cover;
  362. background-color: transparent;
  363. background-position: center;
  364. .experts-container {
  365. padding-top: 78rpx;
  366. padding-left: 40rpx;
  367. &-icon {
  368. width: 84rpx;
  369. height: 84rpx;
  370. }
  371. .experts-container-title {
  372. margin-top: 58rpx;
  373. &-text {
  374. height: 67rpx;
  375. font-size: 48rpx;
  376. font-family: PingFangSC-Medium, PingFang SC;
  377. font-weight: 500;
  378. color: #FFFFFF;
  379. line-height: 67rpx;
  380. letter-spacing: 4rpx;
  381. }
  382. }
  383. .experts-container-subtitle {
  384. &-text {
  385. text-transform: uppercase;
  386. height: 33rpx;
  387. font-size: 24rpx;
  388. font-family: PingFangSC-Medium, PingFang SC;
  389. font-weight: 500;
  390. color: #FFFFFF;
  391. line-height: 33rpx;
  392. letter-spacing: 2rpx;
  393. }
  394. }
  395. }
  396. }
  397. .expertsnotice-notice {
  398. margin-top: 25rpx;
  399. width: 338rpx;
  400. height: 260rpx;
  401. background-image: url("../../static/agrcloud-images/agrcloud-main-page-notice-bp.png");
  402. background-size: cover;
  403. background-color: transparent;
  404. background-position: center;
  405. .notice-container {
  406. padding-top: 32rpx;
  407. padding-left: 40rpx;
  408. &-icon {
  409. width: 84rpx;
  410. height: 84rpx;
  411. }
  412. .notice-container-title {
  413. margin-top: 18rpx;
  414. &-text {
  415. height: 67rpx;
  416. font-size: 48rpx;
  417. font-family: PingFangSC-Medium, PingFang SC;
  418. font-weight: 500;
  419. color: #FFFFFF;
  420. line-height: 67rpx;
  421. letter-spacing: 4rpx;
  422. }
  423. }
  424. .notice-container-subtitle {
  425. &-text {
  426. text-transform: uppercase;
  427. height: 33rpx;
  428. font-size: 24rpx;
  429. font-family: PingFangSC-Medium, PingFang SC;
  430. font-weight: 500;
  431. color: #FFFFFF;
  432. line-height: 33rpx;
  433. letter-spacing: 2rpx;
  434. }
  435. }
  436. }
  437. }
  438. }
  439. }
  440. }
  441. .main-content-monitoring {
  442. padding-top: 24rpx;
  443. .content-monitoring {
  444. width: 702rpx;
  445. height: 240rpx;
  446. background-image: url("../../static/agrcloud-images/agrcloud-main-page-monitoring-bp.png");
  447. background-size: cover;
  448. background-color: transparent;
  449. background-position: center;
  450. .monitoring-container {
  451. padding-top: 26rpx;
  452. padding-left: 40rpx;
  453. &-icon {
  454. width: 84rpx;
  455. height: 84rpx;
  456. }
  457. .monitoring-container-title {
  458. margin-top: 4rpx;
  459. &-text {
  460. height: 67rpx;
  461. font-size: 48rpx;
  462. font-family: PingFangSC-Medium, PingFang SC;
  463. font-weight: 500;
  464. color: #FFFFFF;
  465. line-height: 67rpx;
  466. letter-spacing: 4rpx;
  467. }
  468. }
  469. .monitoring-container-subtitle {
  470. &-text {
  471. text-transform: uppercase;
  472. height: 33rpx;
  473. font-size: 24rpx;
  474. font-family: PingFangSC-Medium, PingFang SC;
  475. font-weight: 500;
  476. color: #FFFFFF;
  477. line-height: 33rpx;
  478. letter-spacing: 2rpx;
  479. }
  480. }
  481. }
  482. }
  483. }
  484. }
  485. }
  486. </style>