index.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535
  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. :is-circular="true"
  35. :list="titleContentList"></u-notice-bar>
  36. </view>
  37. </view>
  38. <view class="main-content">
  39. <!-- 质量安全投诉 -->
  40. <view class="main-content-complaints">
  41. <view class="complaints-container"
  42. @click="handleWarterClick('complaints')">
  43. <image class="complaints-container-icon"
  44. src="@/static/agrcloud-images/agrcloud-main-page-complaints-icon.png">
  45. </image>
  46. <view class="complaints-container-title">
  47. <text class="complaints-container-title-text">质量安全投诉</text>
  48. </view>
  49. <view class="complaints-container-subtitle">
  50. <text class="complaints-container-subtitle-text">Complaints</text>
  51. </view>
  52. </view>
  53. </view>
  54. <!-- 气象服务 农技专家 政策法规 通知公告 -->
  55. <view class="main-content-metexpregnotice">
  56. <view class="complaints-metexpregnotice">
  57. <view class="metexpregnotice-meteregula">
  58. <!-- 气象服务 -->
  59. <view class="meteregula-meteorological">
  60. <view class="meteorological-container"
  61. @click="handleWarterClick('meteorological')">
  62. <image class="meteorological-container-icon"
  63. src="@/static/agrcloud-images/agrcloud-main-page-meteorological-icon.png">
  64. </image>
  65. <view class="meteorological-container-title">
  66. <text class="meteorological-container-title-text">气象服务</text>
  67. </view>
  68. <view class="meteorological-container-subtitle">
  69. <text class="meteorological-container-subtitle-text">Meteorological</text>
  70. </view>
  71. </view>
  72. </view>
  73. <!-- 政策法规 -->
  74. <view class="meteregula-regulations">
  75. <view class="regulations-container"
  76. @click="handleWarterClick('regulations')">
  77. <image class="regulations-container-icon"
  78. src="@/static/agrcloud-images/agrcloud-main-page-regulations-icon.png">
  79. </image>
  80. <view class="regulations-container-title">
  81. <text class="regulations-container-title-text">政策法规</text>
  82. </view>
  83. <view class="regulations-container-subtitle">
  84. <text class="regulations-container-subtitle-text">Regulations</text>
  85. </view>
  86. </view>
  87. </view>
  88. </view>
  89. <!-- 农技专家 -->
  90. <view class="metexpregnotice-expertsnotice">
  91. <view class="expertsnotice-experts">
  92. <view class="experts-container"
  93. @click="handleWarterClick('experts')">
  94. <image class="experts-container-icon"
  95. src="@/static/agrcloud-images/agrcloud-main-page-experts-icon.png">
  96. </image>
  97. <view class="experts-container-title">
  98. <text class="experts-container-title-text">农技专家</text>
  99. </view>
  100. <view class="experts-container-subtitle">
  101. <text class="experts-container-subtitle-text">Experts</text>
  102. </view>
  103. </view>
  104. </view>
  105. <!-- 通知公告 -->
  106. <view class="expertsnotice-notice">
  107. <view class="notice-container"
  108. @click="handleWarterClick('notice')">
  109. <image class="notice-container-icon"
  110. src="@/static/agrcloud-images/agrcloud-main-page-notice-icon.png">
  111. </image>
  112. <view class="notice-container-title">
  113. <text class="notice-container-title-text">通知公告</text>
  114. </view>
  115. <view class="notice-container-subtitle">
  116. <text class="notice-container-subtitle-text">Notice</text>
  117. </view>
  118. </view>
  119. </view>
  120. </view>
  121. </view>
  122. </view>
  123. <view style="clear: both;"></view>
  124. <!-- 监测信息 -->
  125. <view class="main-content-monitoring">
  126. <view class="content-monitoring">
  127. <view class="monitoring-container"
  128. @click="handleWarterClick('monitoring')">
  129. <image class="monitoring-container-icon"
  130. src="@/static/agrcloud-images/agrcloud-main-page-monitoring-icon.png">
  131. </image>
  132. <view class="monitoring-container-title">
  133. <text class="monitoring-container-title-text">监测信息</text>
  134. </view>
  135. <view class="monitoring-container-subtitle">
  136. <text class="monitoring-container-subtitle-text">Monitoring</text>
  137. </view>
  138. </view>
  139. </view>
  140. </view>
  141. </view>
  142. </view>
  143. </view>
  144. </template>
  145. <script>
  146. import {
  147. meteorologicalRollData
  148. } from '@/agrcloud-api/meteorological';
  149. export default {
  150. name: 'homePage',
  151. data() {
  152. return {
  153. titleContentList: ['暂无数据!'],
  154. mainNavigateToObj: {
  155. complaints: '/pages/complaints/index',
  156. meteorological: '/pages/meteorological/index',
  157. regulations: '/pages/regulations/index',
  158. experts: '/pages/experts/index',
  159. notice: '/pages/notice/index',
  160. monitoring: '/pages/monitoring/index'
  161. }
  162. };
  163. },
  164. onLoad() {
  165. // #ifdef H5
  166. this.getMeteorologicalRollData();
  167. // #endif
  168. },
  169. methods: {
  170. handleWarterClick(itemData) {
  171. if (!itemData || !this.mainNavigateToObj[itemData]) {
  172. this.$msgbox('模块建设中...');
  173. return;
  174. }
  175. uni.navigateTo({
  176. url: this.mainNavigateToObj[itemData]
  177. });
  178. },
  179. getMeteorologicalRollData() {
  180. meteorologicalRollData().then(res => {
  181. const rollDataList = res.data || [];
  182. let temprollDataList = (rollDataList.length > 0) ? rollDataList : ['暂无数据!'];
  183. this.titleContentList =JSON.parse(JSON.stringify(temprollDataList).toString().replace(/<\/?.+?>/g,"").replace(/[\r\n]/g, ""));
  184. }).catch(err => {
  185. this.titleContentList = ['暂无数据!'];
  186. });
  187. }
  188. }
  189. };
  190. </script>
  191. <style lang="scss"
  192. scoped>
  193. .page-content {
  194. width: 100%;
  195. padding: 0;
  196. &-title {
  197. width: 100%;
  198. background-color: #ffffff;
  199. .content-title {
  200. margin: 0 47rpx 0 54rpx;
  201. .title-logo {
  202. padding-top: 9rpx;
  203. height: 52rpx;
  204. width: 30rpx;
  205. float: left;
  206. }
  207. .weather-densefog {
  208. padding-top: 16rpx;
  209. float: left;
  210. width: 36rpx;
  211. height: 36rpx;
  212. }
  213. .title-text {
  214. float: left;
  215. width: calc(100% - 36rpx);
  216. }
  217. }
  218. }
  219. .main-content {
  220. padding: 36rpx 24rpx;
  221. width: 100%;
  222. display: flex;
  223. flex-wrap: wrap;
  224. align-items: center;
  225. justify-content: center;
  226. .main-content-complaints {
  227. width: 100%;
  228. height: 240rpx;
  229. background-image: url("../../static/agrcloud-images/agrcloud-main-page-complaints-bg.png");
  230. background-size: cover;
  231. background-color: transparent;
  232. background-position: center;
  233. .complaints-container {
  234. padding: 26rpx 40rpx;
  235. &-icon {
  236. width: 84rpx;
  237. height: 84rpx;
  238. }
  239. .complaints-container-title {
  240. margin-top: 4rpx;
  241. &-text {
  242. height: 67rpx;
  243. font-size: 48rpx;
  244. font-family: PingFangSC-Medium, PingFang SC;
  245. font-weight: 500;
  246. color: #FFFFFF;
  247. line-height: 67rpx;
  248. letter-spacing: 4rpx;
  249. }
  250. }
  251. .complaints-container-subtitle {
  252. &-text {
  253. text-transform: uppercase;
  254. height: 33rpx;
  255. font-size: 24rpx;
  256. font-family: PingFangSC-Medium, PingFang SC;
  257. font-weight: 500;
  258. color: #FFFFFF;
  259. line-height: 33rpx;
  260. letter-spacing: 2rpx;
  261. }
  262. }
  263. }
  264. }
  265. .main-content-metexpregnotice {
  266. width: 100%;
  267. padding-top: 24rpx;
  268. .complaints-metexpregnotice {
  269. width: 100%;
  270. display: flex;
  271. .metexpregnotice-meteregula {
  272. flex: 1;
  273. .meteregula-meteorological {
  274. width: 100%;
  275. height: 260rpx;
  276. background-image: url("../../static/agrcloud-images/agrcloud-main-page-meteorological-bg.png");
  277. background-size: cover;
  278. background-color: transparent;
  279. background-position: center;
  280. .meteorological-container {
  281. padding: 32rpx 40rpx 26rpx;
  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: 24rpx;
  314. width: 100%;
  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: 71rpx 40rpx 60rpx;
  322. &-icon {
  323. width: 84rpx;
  324. height: 84rpx;
  325. }
  326. .regulations-container-title {
  327. margin-top: 65rpx;
  328. &-text {
  329. height: 67rpx;
  330. font-size: 48rpx;
  331. font-family: PingFangSC-Medium, PingFang SC;
  332. font-weight: 500;
  333. color: #FFFFFF;
  334. line-height: 67rpx;
  335. letter-spacing: 4rpx;
  336. }
  337. }
  338. .regulations-container-subtitle {
  339. &-text {
  340. text-transform: uppercase;
  341. height: 33rpx;
  342. font-size: 24rpx;
  343. font-family: PingFangSC-Medium, PingFang SC;
  344. font-weight: 500;
  345. color: #FFFFFF;
  346. line-height: 33rpx;
  347. letter-spacing: 2rpx;
  348. }
  349. }
  350. }
  351. }
  352. }
  353. .metexpregnotice-expertsnotice {
  354. margin-left: 24rpx;
  355. flex: 1;
  356. .expertsnotice-experts {
  357. width: 100%;
  358. height: 380rpx;
  359. background-image: url("../../static/agrcloud-images/agrcloud-main-page-experts-bg.png");
  360. background-size: cover;
  361. background-color: transparent;
  362. background-position: center;
  363. .experts-container {
  364. padding: 78rpx 40rpx 60rpx;
  365. &-icon {
  366. width: 84rpx;
  367. height: 84rpx;
  368. }
  369. .experts-container-title {
  370. margin-top: 58rpx;
  371. &-text {
  372. height: 67rpx;
  373. font-size: 48rpx;
  374. font-family: PingFangSC-Medium, PingFang SC;
  375. font-weight: 500;
  376. color: #FFFFFF;
  377. line-height: 67rpx;
  378. letter-spacing: 4rpx;
  379. }
  380. }
  381. .experts-container-subtitle {
  382. &-text {
  383. text-transform: uppercase;
  384. height: 33rpx;
  385. font-size: 24rpx;
  386. font-family: PingFangSC-Medium, PingFang SC;
  387. font-weight: 500;
  388. color: #FFFFFF;
  389. line-height: 33rpx;
  390. letter-spacing: 2rpx;
  391. }
  392. }
  393. }
  394. }
  395. .expertsnotice-notice {
  396. margin-top: 24rpx;
  397. width: 100%;
  398. height: 260rpx;
  399. background-image: url("../../static/agrcloud-images/agrcloud-main-page-notice-bp.png");
  400. background-size: cover;
  401. background-color: transparent;
  402. background-position: center;
  403. .notice-container {
  404. padding: 32rpx 40rpx 26rpx;
  405. &-icon {
  406. width: 84rpx;
  407. height: 84rpx;
  408. }
  409. .notice-container-title {
  410. margin-top: 18rpx;
  411. &-text {
  412. height: 67rpx;
  413. font-size: 48rpx;
  414. font-family: PingFangSC-Medium, PingFang SC;
  415. font-weight: 500;
  416. color: #FFFFFF;
  417. line-height: 67rpx;
  418. letter-spacing: 4rpx;
  419. }
  420. }
  421. .notice-container-subtitle {
  422. &-text {
  423. text-transform: uppercase;
  424. height: 33rpx;
  425. font-size: 24rpx;
  426. font-family: PingFangSC-Medium, PingFang SC;
  427. font-weight: 500;
  428. color: #FFFFFF;
  429. line-height: 33rpx;
  430. letter-spacing: 2rpx;
  431. }
  432. }
  433. }
  434. }
  435. }
  436. }
  437. }
  438. .main-content-monitoring {
  439. padding-top: 24rpx;
  440. width: 100%;
  441. .content-monitoring {
  442. width: 100%;
  443. height: 240rpx;
  444. background-image: url("../../static/agrcloud-images/agrcloud-main-page-monitoring-bp.png");
  445. background-size: cover;
  446. background-color: transparent;
  447. background-position: center;
  448. .monitoring-container {
  449. padding: 26rpx 40rpx;
  450. &-icon {
  451. width: 84rpx;
  452. height: 84rpx;
  453. }
  454. .monitoring-container-title {
  455. margin-top: 4rpx;
  456. &-text {
  457. height: 67rpx;
  458. font-size: 48rpx;
  459. font-family: PingFangSC-Medium, PingFang SC;
  460. font-weight: 500;
  461. color: #FFFFFF;
  462. line-height: 67rpx;
  463. letter-spacing: 4rpx;
  464. }
  465. }
  466. .monitoring-container-subtitle {
  467. &-text {
  468. text-transform: uppercase;
  469. height: 33rpx;
  470. font-size: 24rpx;
  471. font-family: PingFangSC-Medium, PingFang SC;
  472. font-weight: 500;
  473. color: #FFFFFF;
  474. line-height: 33rpx;
  475. letter-spacing: 2rpx;
  476. }
  477. }
  478. }
  479. }
  480. }
  481. }
  482. }
  483. </style>