index.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856
  1. <template>
  2. <view class="warning-center">
  3. <!-- 顶部导航栏 -->
  4. <custom-card>
  5. <block slot="backText">预警中心</block>
  6. <block slot="right">
  7. <view class="header-right">
  8. <view class="notification-icon">
  9. <u-icon name="bell" size="32rpx" color="#333" />
  10. <view class="badge"></view>
  11. </view>
  12. <view class="settings-icon">
  13. <u-icon name="settings" size="32rpx" color="#333" />
  14. </view>
  15. </view>
  16. </block>
  17. </custom-card>
  18. <!-- 主要内容 -->
  19. <view class="content">
  20. <!-- 宣传语区域 -->
  21. <view class="banner">
  22. <view class="banner-text">
  23. <text class="banner-title">天灾虫害,预警在先</text>
  24. <text class="banner-subtitle">全天候监测,风险早知晓</text>
  25. </view>
  26. <view class="warning-icon">
  27. <view class="icon-triangle">
  28. <image :src="exclamation" class="icon-image" />
  29. </view>
  30. </view>
  31. </view>
  32. <!-- 日期选择器 -->
  33. <view class="date-picker">
  34. <view class="date-inputs" @click="showDatePickerHandle()">
  35. <text class="date-label">{{ startTime }}</text>
  36. <text class="date-separator">-</text>
  37. <text class="date-label">{{ endTime }}</text>
  38. <u-icon name="calendar" size="28rpx" color="#999" />
  39. </view>
  40. <view class="date-icons">
  41. <image :src="warning" class="icon-image" />
  42. </view>
  43. </view>
  44. <!-- 标签导航 -->
  45. <view class="tab-nav">
  46. <view
  47. v-for="(tab, index) in tabs"
  48. :key="index"
  49. class="tab-item"
  50. :class="{ active: activeTab === index }"
  51. @click="activeTabHandler(index)"
  52. >
  53. {{ tab }}
  54. </view>
  55. </view>
  56. <!-- 预警列表 -->
  57. <scroll-view
  58. v-if="activeTab == 0"
  59. class="warning-list"
  60. scroll-y
  61. :scroll-top="listScrollTop"
  62. scroll-with-animation
  63. @scrolltolower="loadMore"
  64. @scrolltoupper="refresh"
  65. >
  66. <view
  67. v-for="(warning, index) in warningList"
  68. :key="index"
  69. class="warning-item"
  70. @click="popupShowHandler(warning)"
  71. >
  72. <view class="warning-header">
  73. <view class="warning-type">
  74. <view class="type-icon" :class="warning.status == '0' ? 'type-blue' : 'type-gray'">
  75. <image :src="weather" class="icon-image" />
  76. </view>
  77. <text class="type-text">{{ warning.warning_title }}</text>
  78. <text class="device-type">{{ warning.device_type }}</text>
  79. </view>
  80. <view class="warning-level" :class="warning.level == '0' ? 'level-normal' :warning.level == '1'? 'level-important':'level-urgent'">
  81. </view>
  82. </view>
  83. <view class="warning-content">
  84. {{ warning.warning_content }}
  85. </view>
  86. <view class="warning-footer">
  87. <text class="warning-time">{{ formatTime(warning.upl_time) }}</text>
  88. <view class="warning-location">
  89. <u-icon name="location" size="20rpx" color="#999" />
  90. </view>
  91. </view>
  92. <view class="location-text">
  93. <u-icon name="map" size="28"></u-icon>
  94. <text style="margin-left: 10rpx">{{ warning.address || '-' }}</text>
  95. </view>
  96. </view>
  97. <!-- 加载更多提示 -->
  98. <view class="loading-more">
  99. <text v-if="loading">加载中...</text>
  100. <text v-else-if="finished">没有更多数据了</text>
  101. <text v-else>上拉加载更多</text>
  102. </view>
  103. </scroll-view>
  104. <scroll-view
  105. v-if="activeTab == 1"
  106. class="warning-list"
  107. scroll-y
  108. :scroll-top="listScrollTop"
  109. scroll-with-animation
  110. @scrolltolower="loadMore"
  111. @scrolltoupper="refresh"
  112. >
  113. <view
  114. v-for="(warning, index) in manualWarningList"
  115. :key="index"
  116. class="warning-item"
  117. @click="popupManualShowHandler(warning)"
  118. >
  119. <view class="warning-content">
  120. {{ warning.conf }}
  121. </view>
  122. <view class="warning-footer">
  123. <text class="warning-time">{{ formatTime(warning.create_time) }}</text>
  124. <view class="warning-location">
  125. <u-icon name="location" size="20rpx" color="#999" />
  126. </view>
  127. </view>
  128. </view>
  129. <!-- 加载更多提示 -->
  130. <view class="loading-more">
  131. <text v-if="loading">加载中...</text>
  132. <text v-else-if="finished">没有更多数据了</text>
  133. <text v-else>上拉加载更多</text>
  134. </view>
  135. </scroll-view>
  136. <!-- 回到顶部 -->
  137. <view class="back-to-top" @click="scrollToTop">
  138. <u-icon name="arrow-up" size="28rpx" color="#999" />
  139. </view>
  140. </view>
  141. <u-calendar v-model="showDatePicker" :mode="mode" @change="changeCalendar"></u-calendar>
  142. <u-popup v-model="popupShow" mode="bottom" height="80%" border-radius="20">
  143. <view class="popup-container">
  144. <view class="popup-icon" :class="current.level == '0' ? 'popup-level-normal' :current.level == '1'? 'popup-level-important':'popup-level-urgent'">
  145. </view>
  146. <view class="popup-header">{{ current.warning_title }}</view>
  147. <view class="popup-type">
  148. <text class="type-text">{{ current.device_type }}</text>
  149. </view>
  150. <view class="popup-content">{{ current.warning_content }}</view>
  151. <view class="popup-time">{{ formatTime(current.upl_time) }}</view>
  152. <view class="popup-text">
  153. <u-icon name="map" size="28"></u-icon>
  154. <text style="margin-left: 10rpx">{{ warning.address || '-' }}</text>
  155. </view>
  156. </view>
  157. </u-popup>
  158. <u-popup v-model="popupManualShow" mode="bottom" height="80%" border-radius="20">
  159. <view class="popup-container" style="margin-top:40rpx">
  160. <view class="popup-content">{{ currentManual.conf }}</view>
  161. <view class="popup-time">{{ formatTime(currentManual.create_time) }}</view>
  162. </view>
  163. </u-popup>
  164. </view>
  165. </template>
  166. <script>
  167. import exclamation from './assets/exclamation.png';
  168. import warning from './assets/warning.png';
  169. import pest from './assets/pest.png';
  170. import weather from './assets/weather.png';
  171. import offline from './assets/offline.png';
  172. export default {
  173. data() {
  174. return {
  175. current:{},
  176. currentManual:{},
  177. popupShow: false,
  178. popupManualShow: false,
  179. exclamation,
  180. warning,
  181. pest,
  182. weather,
  183. offline,
  184. showDatePicker: false,
  185. mode: 'range',
  186. activeTab: 0,
  187. listScrollTop: 0,
  188. tabs: ['环境监测','手动预警'],
  189. warningList: [],
  190. manualWarningList: [],
  191. page_size: 10,
  192. page: 1,
  193. // 获取7天前的日期
  194. startTime: this.getSevenDaysAgo() || '开始日期',
  195. endTime: this.getCurrentDate() || '结束日期',
  196. deviceId: '',
  197. device_type_id:'',
  198. total: 0,
  199. loading: false,
  200. finished: false,
  201. refreshing: false,
  202. };
  203. },
  204. onLoad() {
  205. this.getWarningList();
  206. },
  207. methods: {
  208. activeTabHandler(index){
  209. this.activeTab = index;
  210. if(index == 0){
  211. this.getWarningList();
  212. }else if(index == 1){
  213. this.getWarningManualList();
  214. }
  215. },
  216. popupManualShowHandler(warning){
  217. this.currentManual = warning;
  218. this.popupManualShow = true;
  219. },
  220. popupShowHandler(warning){
  221. this.current = warning;
  222. const params = {
  223. record_ids: warning.id,
  224. };
  225. this.readHandler(params)
  226. this.popupShow = true;
  227. },
  228. changeCalendar(e){
  229. this.startTime = e.startDate;
  230. this.endTime = e.endDate;
  231. // 重置分页参数
  232. this.page = 1;
  233. this.loading = false;
  234. this.finished = false;
  235. if(this.activeTab == 0){
  236. this.getWarningList();
  237. }else if(this.activeTab == 1){
  238. this.getWarningManualList();
  239. }
  240. },
  241. // 加载更多
  242. loadMore() {
  243. if (this.finished) return;
  244. if(this.activeTab == 0){
  245. this.getWarningList();
  246. }else if(this.activeTab == 1){
  247. this.getWarningManualList();
  248. }
  249. },
  250. // 下拉刷新
  251. refresh() {
  252. if (this.loading) return;
  253. // 重置分页参数
  254. this.page = 1;
  255. this.loading = false;
  256. this.finished = false;
  257. this.refreshing = true;
  258. if(this.activeTab == 0){
  259. this.getWarningList();
  260. }else if(this.activeTab == 1){
  261. this.getWarningManualList();
  262. }
  263. },
  264. // 已读
  265. async readHandler(params){
  266. await this.$myRequest({
  267. url:'/api/api_gateway?method=device.env_sec_alert.update_env_sec_alert_record',
  268. method:'POST',
  269. data: params,
  270. })
  271. this.page = 1;
  272. if(this.activeTab == 0){
  273. this.getWarningList();
  274. }
  275. },
  276. formatTime(time){
  277. if(!time){
  278. return '';
  279. }
  280. const date = new Date(time * 1000);
  281. const year = date.getFullYear();
  282. const month = String(date.getMonth() + 1).padStart(2, '0');
  283. const day = String(date.getDate()).padStart(2, '0');
  284. const hour = String(date.getHours()).padStart(2, '0');
  285. const minute = String(date.getMinutes()).padStart(2, '0');
  286. const second = String(date.getSeconds()).padStart(2, '0');
  287. return `${year}-${month}-${day} ${hour}:${minute}:${second}`;
  288. },
  289. // 获取7天前的日期
  290. getSevenDaysAgo() {
  291. const today = new Date();
  292. const sevenDaysAgo = new Date(today);
  293. sevenDaysAgo.setDate(today.getDate() - 7);
  294. const year = sevenDaysAgo.getFullYear();
  295. const month = String(sevenDaysAgo.getMonth() + 1).padStart(2, '0');
  296. const day = String(sevenDaysAgo.getDate()).padStart(2, '0');
  297. return `${year}-${month}-${day}`;
  298. },
  299. // 获取当前日期
  300. getCurrentDate() {
  301. const today = new Date();
  302. const year = today.getFullYear();
  303. const month = String(today.getMonth() + 1).padStart(2, '0');
  304. const day = String(today.getDate()).padStart(2, '0');
  305. return `${year}-${month}-${day}`;
  306. },
  307. showDatePickerHandle(){
  308. this.showDatePicker = true;
  309. },
  310. // 把日期转成秒数
  311. dateToTimestamp(date) {
  312. return Math.floor(new Date(date).getTime() / 1000);
  313. },
  314. async getWarningManualList(){
  315. if (this.loading) return;
  316. this.loading = true;
  317. const start = this.dateToTimestamp(this.startTime + ' 00:00:00');
  318. const end = this.dateToTimestamp(this.endTime + ' 23:59:59');
  319. const params = {
  320. start,
  321. end,
  322. page: this.page,
  323. page_size: this.page_size,
  324. device_id: this.deviceId,
  325. device_type_id: this.device_type_id
  326. }
  327. try {
  328. const res = await this.$myRequest({
  329. url:'/api/api_gateway?method=device.env_sec_alert.get_manual_env_sec_alert_record',
  330. method:'POST',
  331. data: params,
  332. })
  333. const resData = res?.data || [];
  334. const list = resData || [];
  335. if (this.page === 1) {
  336. this.manualWarningList = list;
  337. } else {
  338. this.manualWarningList = [...this.manualWarningList, ...list];
  339. }
  340. this.total = res?.total || 0;
  341. this.loading = false;
  342. // 计算是否还有更多数据
  343. if (this.manualWarningList.length >= this.total) {
  344. this.finished = true;
  345. } else {
  346. this.page++;
  347. }
  348. // 结束刷新状态
  349. if (this.refreshing) {
  350. this.refreshing = false;
  351. }
  352. } catch (error) {
  353. console.error('获取预警列表失败:', error);
  354. this.loading = false;
  355. if (this.refreshing) {
  356. this.refreshing = false;
  357. }
  358. }
  359. },
  360. async getWarningList(){
  361. if (this.loading) return;
  362. this.loading = true;
  363. const start = this.dateToTimestamp(this.startTime + ' 00:00:00');
  364. const end = this.dateToTimestamp(this.endTime + ' 23:59:59');
  365. const params = {
  366. start,
  367. end,
  368. page: this.page,
  369. page_size: this.page_size,
  370. device_id: this.deviceId,
  371. device_type_id: this.device_type_id
  372. }
  373. try {
  374. const res = await this.$myRequest({
  375. url:'/api/api_gateway?method=device.env_sec_alert.get_env_sec_alert',
  376. method:'POST',
  377. data: params,
  378. })
  379. const resData = res?.data || [];
  380. const list = resData || [];
  381. if (this.page === 1) {
  382. this.warningList = list;
  383. } else {
  384. this.warningList = [...this.warningList, ...list];
  385. }
  386. this.total = res?.total_num || 0;
  387. this.loading = false;
  388. // 计算是否还有更多数据
  389. if (this.warningList.length >= this.total) {
  390. this.finished = true;
  391. } else {
  392. this.page++;
  393. }
  394. // 结束刷新状态
  395. if (this.refreshing) {
  396. this.refreshing = false;
  397. }
  398. } catch (error) {
  399. console.error('获取预警列表失败:', error);
  400. this.loading = false;
  401. if (this.refreshing) {
  402. this.refreshing = false;
  403. }
  404. }
  405. },
  406. // 回到顶部
  407. scrollToTop() {
  408. this.listScrollTop = 0;
  409. }
  410. }
  411. };
  412. </script>
  413. <style scoped lang="scss">
  414. .warning-center {
  415. min-height: 100vh;
  416. font-family: 'Source Han Sans CN';
  417. background: linear-gradient(0deg, #F5F6FA 79.64%, #FFEEEC 99.35%);
  418. }
  419. ::v-deep .u-calendar__action{
  420. display:flex;
  421. }
  422. ::v-deep .u-calendar__action__icon{
  423. width: 40rpx;
  424. }
  425. ::v-deep .u-calendar__action__text{
  426. width: calc(100% - 160rpx);
  427. text-align: center;
  428. }
  429. .content {
  430. padding: 0 32rpx;
  431. }
  432. /* 宣传语区域 */
  433. .banner {
  434. display: flex;
  435. align-items: center;
  436. justify-content: space-between;
  437. margin: 32rpx 0;
  438. margin-bottom: 0rpx;
  439. padding: 24rpx;
  440. .banner-text {
  441. flex: 1;
  442. .banner-title {
  443. font-style: italic;
  444. display: block;
  445. color: #303133;
  446. font-family: "Source Han Sans CN VF";
  447. font-size: 40rpx;
  448. font-weight: 700;
  449. margin-bottom: 8rpx;
  450. }
  451. .banner-subtitle {
  452. display: block;
  453. font-size: 24rpx;
  454. color: #666666;
  455. }
  456. }
  457. .warning-icon {
  458. .icon-triangle {
  459. width: 130rpx;
  460. height: 130rpx;
  461. position: relative;
  462. .icon-image{
  463. width: 100%;
  464. height: 100%;
  465. }
  466. }
  467. }
  468. }
  469. .popup-container{
  470. position:relative;
  471. .popup-icon {
  472. position: absolute;
  473. top:0;
  474. right:0;
  475. margin-left: 12rpx;
  476. width: 112rpx;
  477. height: 48rpx;
  478. background: url('./assets/normal-gray.png');
  479. background-repeat: no-repeat;
  480. background-size: 100%;
  481. &.popup-level-normal {
  482. background: url('./assets/normal.png');
  483. background-repeat: no-repeat;
  484. background-size: 100%;
  485. }
  486. &.popup-level-important {
  487. background: url('./assets/important.png');
  488. background-repeat: no-repeat;
  489. background-size: 100%;
  490. }
  491. &.popup-level-urgent {
  492. background: url('./assets/urgent.png');
  493. background-repeat: no-repeat;
  494. background-size: 100%;
  495. }
  496. }
  497. }
  498. .popup-header{
  499. padding: 20rpx 32rpx;
  500. width: 100%;
  501. text-align: left;
  502. color: #303133;
  503. font-family: "Source Han Sans CN VF";
  504. font-size: 32rx;
  505. font-weight: 700;
  506. }
  507. .popup-type{
  508. border-radius:32rpx;
  509. margin-left: 32rpx;
  510. display:inline-block;
  511. border: 2rpx solid #E4E7ED;
  512. padding: 2rpx 12rpx;
  513. color: #666666;
  514. font-family: "Source Han Sans CN VF";
  515. font-size: 24rpx;
  516. font-weight: 400;
  517. margin-bottom: 24rpx;
  518. }
  519. .popup-content{
  520. padding: 0 32rpx;
  521. line-height: 50rpx;
  522. }
  523. .popup-time{
  524. padding:0 32rpx;
  525. margin-top: 36rpx;
  526. color:#999999;
  527. font-size: 24rpx;
  528. text-align: left;
  529. color: #bdbdbd;
  530. font-family: "Source Han Sans CN VF";
  531. font-style: normal;
  532. font-weight: 400;
  533. }
  534. .popup-location{
  535. font-size: 24rpx;
  536. margin-top: 16rpx;
  537. padding-top: 16rpx;
  538. font-family: "Source Han Sans CN VF";
  539. color: #999999;
  540. display:flex;
  541. align-items: center;
  542. }
  543. .popup-text {
  544. padding: 0 32rpx;
  545. font-size: 24rpx;
  546. margin-top: 16rpx;
  547. padding-top: 16rpx;
  548. font-family: "Source Han Sans CN VF";
  549. color: #999999;
  550. display:flex;
  551. align-items: center;
  552. }
  553. /* 日期选择器 */
  554. .date-picker {
  555. display: flex;
  556. align-items: center;
  557. justify-content: space-between;
  558. margin-bottom: 32rpx;
  559. .date-inputs {
  560. display: flex;
  561. align-items: center;
  562. background: #ffffff;
  563. border-radius: 48rpx;
  564. padding: 14rpx;
  565. box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
  566. .date-label {
  567. width:250rpx;
  568. font-size: 26rpx;
  569. color: #999999;
  570. text-align: center;
  571. }
  572. .date-separator {
  573. margin: 0 24rpx;
  574. font-size: 26rpx;
  575. color: #999999;
  576. }
  577. }
  578. .date-icons {
  579. display: flex;
  580. align-items: center;
  581. justify-content: center;
  582. width: 60rpx ;
  583. height: 60rpx;
  584. border-radius: 50%;
  585. background:#ffffff;
  586. .icon-image{
  587. width: 32rpx;
  588. height: 32rpx;
  589. }
  590. }
  591. }
  592. /* 标签导航 */
  593. .tab-nav {
  594. display: flex;
  595. margin-bottom: 24rpx;
  596. border-bottom: 1rpx solid #e5e5e5;
  597. .tab-item {
  598. padding: 20rpx 0;
  599. font-size: 28rpx;
  600. color: #666666;
  601. position: relative;
  602. margin-right: 30rpx;
  603. &.active {
  604. color: #333333;
  605. font-weight: 500;
  606. &::after {
  607. content: '';
  608. position: absolute;
  609. bottom: 0;
  610. left: 50%;
  611. transform: translateX(-50%);
  612. width: 100%;
  613. height: 4rpx;
  614. background: #515153;
  615. border-radius: 2rpx;
  616. }
  617. }
  618. }
  619. }
  620. /* 预警列表 */
  621. .warning-list {
  622. margin-bottom: 100rpx;
  623. height: calc(100vh - 600rpx);
  624. overflow-y: auto;
  625. .warning-item {
  626. position: relative;
  627. padding: 28rpx 24rpx;
  628. margin-bottom: 24rpx;
  629. background: #ffffff;
  630. border-radius: 16rpx;
  631. box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.06);
  632. .warning-header {
  633. display: flex;
  634. align-items: center;
  635. justify-content: space-between;
  636. margin-bottom: 16rpx;
  637. .warning-type {
  638. display: flex;
  639. align-items: center;
  640. flex: 1;
  641. min-width: 0;
  642. .type-icon {
  643. width: 48rpx;
  644. height: 48rpx;
  645. border-radius: 50%;
  646. margin-right: 12rpx;
  647. flex-shrink: 0;
  648. display:flex;
  649. align-items: center;
  650. justify-content: center;
  651. &.type-red {
  652. background: linear-gradient(180deg, #FFA9A5 0%, #FF716A 100%);
  653. }
  654. &.type-blue {
  655. background: linear-gradient(180deg, #83D2FF 0%, #09A5FC 100%);
  656. }
  657. &.type-yellow {
  658. background: linear-gradient(180deg, #FED057 0%, #FFAF40 100%);
  659. }
  660. &.type-gray {
  661. background: #DDDFE6;
  662. }
  663. .icon-image{
  664. width: 28rpx;
  665. height: 28rpx;
  666. }
  667. }
  668. .type-text {
  669. font-size: 26rpx;
  670. font-weight: 500;
  671. color: #333333;
  672. margin-right: 12rpx;
  673. flex-shrink: 0;
  674. }
  675. .device-type {
  676. font-size: 22rpx;
  677. color: #515153;
  678. font-family: "Source Han Sans CN VF";
  679. font-style: normal;
  680. font-weight: 400;
  681. border: 2rpx solid #E4E7ED;
  682. padding: 2rpx 12rpx;
  683. border-radius: 32rpx;
  684. margin-left: 8rpx;
  685. flex-shrink: 0;
  686. }
  687. }
  688. .warning-level {
  689. position: absolute;
  690. top:0;
  691. right:0;
  692. margin-left: 12rpx;
  693. width: 112rpx;
  694. height: 48rpx;
  695. background: url('./assets/normal-gray.png');
  696. background-repeat: no-repeat;
  697. background-size: 100%;
  698. &.level-normal {
  699. background: url('./assets/normal.png');
  700. background-repeat: no-repeat;
  701. background-size: 100%;
  702. }
  703. &.level-important {
  704. background: url('./assets/important.png');
  705. background-repeat: no-repeat;
  706. background-size: 100%;
  707. }
  708. &.level-urgent {
  709. background: url('./assets/urgent.png');
  710. background-repeat: no-repeat;
  711. background-size: 100%;
  712. }
  713. }
  714. }
  715. .warning-content {
  716. font-size: 28rpx;
  717. color: #333333;
  718. line-height: 40rpx;
  719. margin-bottom: 20rpx;
  720. //最多显示2行
  721. overflow: hidden;
  722. text-overflow: ellipsis;
  723. display: -webkit-box;
  724. -webkit-line-clamp: 2;
  725. -webkit-box-orient: vertical;
  726. }
  727. .warning-footer {
  728. display: flex;
  729. align-items: center;
  730. justify-content: space-between;
  731. .warning-time {
  732. font-size: 24rpx;
  733. color: #999999;
  734. }
  735. .warning-location {
  736. display: flex;
  737. align-items: center;
  738. }
  739. }
  740. .location-text {
  741. font-size: 24rpx;
  742. margin-top: 16rpx;
  743. padding-top: 16rpx;
  744. border-top: 1rpx solid #f0f0f0;
  745. font-family: "Source Han Sans CN VF";
  746. color: #999999;
  747. display:flex;
  748. align-items: center;
  749. }
  750. }
  751. }
  752. /* 加载更多提示 */
  753. .loading-more {
  754. text-align: center;
  755. padding: 32rpx 0;
  756. font-size: 24rpx;
  757. color: #999999;
  758. }
  759. /* 回到顶部 */
  760. .back-to-top {
  761. position: fixed;
  762. bottom: 80rpx;
  763. right: 32rpx;
  764. width: 64rpx;
  765. height: 64rpx;
  766. background: #ffffff;
  767. border-radius: 50%;
  768. display: flex;
  769. align-items: center;
  770. justify-content: center;
  771. box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.1);
  772. z-index: 99;
  773. }
  774. /* 顶部导航栏右侧图标 */
  775. .header-right {
  776. display: flex;
  777. align-items: center;
  778. .notification-icon {
  779. position: relative;
  780. margin-right: 32rpx;
  781. .badge {
  782. position: absolute;
  783. top: -4rpx;
  784. right: -4rpx;
  785. width: 12rpx;
  786. height: 12rpx;
  787. background: #ff6b6b;
  788. border-radius: 50%;
  789. }
  790. }
  791. }
  792. </style>