<template>
|
<view class="page">
|
<u-swiper
|
:list="lbList"
|
:keyName="'image'"
|
:height="200"
|
:indicator="true"
|
></u-swiper>
|
<u-grid :col="4" :border="false" class="grid" @click="gridClick">
|
<u-grid-item v-for="(baseListItem,baseListIndex) in baseList" :key="baseListIndex">
|
<u-image :src="baseListItem.src" :width="26" :height="26"></u-image>
|
<text class="grid-text">{{baseListItem.title}}</text>
|
</u-grid-item>
|
</u-grid>
|
<view class="content">
|
<view>
|
<view class="title">空域信息</view>
|
<view class="card" v-for="(item,index) in announcementList" :key="index">
|
<view class="left">
|
<u-image :src="docSvg" :width="30" :height="36"></u-image>
|
</view>
|
<view class="right" @click.stop="airspaceClick(item)">
|
<view class="r-top">{{ item.title }}</view>
|
<view class="r-middle">{{ item.description || '暂无' }}</view>
|
<view class="r-bottom">
|
<view>{{ item.time }}</view>
|
<!-- <view>{{ item.num || 0 }}</view>
|
<view>{{ item.like || 0 }}</view> -->
|
</view>
|
</view>
|
</view>
|
</view>
|
<view>
|
<view class="title">法律法规</view>
|
<view class="card" v-for="(item,index) in regulationsList" :key="index">
|
<view class="left">
|
<u-image :src="docSvg" :width="30" :height="36"></u-image>
|
</view>
|
<view class="right" @click.stop="toRegulationsDetail(item)">
|
<view class="r-top">{{ item.title }}</view>
|
<view class="r-middle">{{ item.description || '暂无' }}</view>
|
<view class="r-bottom">
|
<view>{{ item.time }}</view>
|
<!-- <view>{{ item.num || 0 }}</view>
|
<view>{{ item.like || 0 }}</view> -->
|
</view>
|
</view>
|
</view>
|
</view>
|
<view>
|
<view class="title">政策制度</view>
|
<view class="card" v-for="(item,index) in policyList" :key="index">
|
<view class="left">
|
<u-image :src="docSvg" :width="30" :height="36"></u-image>
|
</view>
|
<view class="right" @click.stop="policiesClick(item)">
|
<view class="r-top">{{ item.title }}</view>
|
<view class="r-middle">{{ item.description || '暂无' }}</view>
|
<view class="r-bottom">
|
<view>{{ item.time }}</view>
|
<!-- <view>{{ item.num || 0 }}</view>
|
<view>{{ item.like || 0 }}</view> -->
|
</view>
|
</view>
|
</view>
|
</view>
|
</view>
|
</view>
|
</template>
|
|
<script setup>
|
import { onMounted, reactive, ref } from 'vue'
|
import lbPng from '@/static/images/lb.png'
|
import kyxxPng from '@/static/images/kyxx.png'
|
import fxsqPng from '@/static/images/fxsq.png'
|
import flfgPng from '@/static/images/flfg.png'
|
import zczdPng from '@/static/images/zczd.png'
|
import docSvg from '@/static/images/doc.png'
|
import { sysNoticePageInfoApi, flightAirspacePageInfoApi } from '@/api/index'
|
const lbList = reactive([]);
|
// lbPng 轮播图 5次
|
for (let i = 0; i < 5; i++) {
|
lbList.push({
|
image: lbPng,
|
title: '法律政策',
|
link: '/pages/legalPolicy/index',
|
})
|
}
|
|
// const change = (index) => {
|
// console.log('轮播图切换到第', index + 1, '张');
|
// }
|
|
const baseList = ref([
|
{
|
src: kyxxPng,
|
title: '空域信息'
|
},
|
{
|
src: fxsqPng,
|
title: '飞行申请'
|
},
|
{
|
src: flfgPng,
|
title: '法律法规'
|
},
|
{
|
src: zczdPng,
|
title: '政策制度'
|
},
|
]);
|
|
|
const announcementList = ref([]);
|
function gridClick(index) {
|
if (index === 0) {
|
uni.navigateTo({
|
url: '/subPackages/airspaceInformation/index',
|
})
|
} else if (index === 1) {
|
uni.navigateTo({
|
url: '/subPackages/flightApplication/index',
|
})
|
} else if (index === 2) {
|
uni.switchTab({
|
url: '/pages/legalPolicy/index',
|
})
|
} else if (index === 3) {
|
uni.switchTab({
|
url: '/pages/legalPolicy/index',
|
})
|
}
|
}
|
// 获取空域信息列表
|
async function getFlightAirspaceList() {
|
try {
|
const res = await flightAirspacePageInfoApi({
|
current: 1,
|
size: 10,
|
})
|
announcementList.value = res.data.data.records.slice(0, 3).map(item => ({
|
...item,
|
title: item.airspaceName,
|
description: item.remark,
|
time: item.createTime,
|
num: item.num,
|
like: item.like,
|
}))
|
} catch (error) {
|
uni.showToast({
|
title: error.message,
|
icon: 'none',
|
duration: 2000,
|
})
|
}
|
}
|
|
// 获取通知公告列表
|
const policyList = ref([]); // 政策制度
|
const regulationsList = ref([]); // 法律法规
|
async function getSysNoticeList(val) {
|
try {
|
const res = await sysNoticePageInfoApi({
|
current: 1,
|
size: 10,
|
noticeType: val,
|
})
|
// 只需要取前3条 公告
|
if (val === 1) {
|
regulationsList.value = res.data.data.records.slice(0, 3).map(item => ({
|
...item,
|
title: item.noticeTitle,
|
description: item.remark,
|
time: item.pubDate,
|
num: item.num,
|
like: item.like,
|
}))
|
} else if (val === 2) {
|
policyList.value = res.data.data.records.slice(0, 3).map(item => ({
|
...item,
|
title: item.noticeTitle,
|
description: item.remark,
|
time: item.pubDate,
|
num: item.num,
|
like: item.like,
|
}))
|
}
|
} catch (error) {
|
uni.showToast({
|
title: error.message,
|
icon: 'none',
|
duration: 2000,
|
})
|
}
|
}
|
// 跳转到空域信息详情页
|
function airspaceClick(item) {
|
uni.navigateTo({
|
url: '/subPackages/regulationsDetail/details?id=' + item.id,
|
})
|
}
|
// 跳转到法律政策详情页
|
function toRegulationsDetail(item) {
|
uni.navigateTo({
|
url: '/subPackages/regulationsDetail/details?id=' + item.noticeId,
|
})
|
}
|
// 跳转到政策制度详情页
|
function policiesClick(item) {
|
uni.navigateTo({
|
url: '/subPackages/regulationsDetail/details?id=' + item.noticeId,
|
})
|
}
|
|
onMounted(() => {
|
getFlightAirspaceList()
|
getSysNoticeList(2)
|
getSysNoticeList(1)
|
})
|
</script>
|
|
<style scoped lang="scss">
|
.page {
|
width: 100%;
|
height: 100%;
|
display: flex;
|
flex-direction: column;
|
:deep(.u-grid) {
|
margin-top: 40rpx;
|
.grid-text {
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
font-weight: 500;
|
font-size: 14px;
|
color: #222324;
|
margin-top: 10px;
|
}
|
}
|
.tabs-container {
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
font-weight: 400;
|
font-size: 14px;
|
color: #4E5969;
|
background: #FFFFFF;
|
border-radius: 12px 12px 6px 6px;
|
padding: 0 20rpx;
|
margin-top: 10px;
|
}
|
.content {
|
margin-top: 10px;
|
width: 100%;
|
height: 0;
|
flex-grow: 1;
|
display: flex;
|
flex-direction: column;
|
background: #FFFFFF;
|
padding: 0 40rpx 40rpx 40rpx;
|
border-radius: 12px 12px 6px 6px;
|
overflow-y: auto;
|
box-sizing: border-box;
|
.title {
|
padding: 40rpx 40rpx 0rpx 20rpx;
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
font-weight: 500;
|
font-size: 14px;
|
color: #222324;
|
}
|
}
|
.card {
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
display: flex;
|
justify-content: space-between;
|
border-bottom: 1px solid #EBEEF3;
|
padding: 40rpx 0 30rpx 0;
|
width: 100%;
|
box-sizing: border-box;
|
.left {
|
.u-image {
|
width: 60rpx;
|
height: 72rpx;
|
}
|
}
|
.right {
|
width: calc(100% - 80rpx);
|
overflow: hidden;
|
text-overflow: ellipsis;
|
white-space: nowrap;
|
.r-top {
|
font-weight: 500;
|
font-size: 14px;
|
color: #1D2129;
|
}
|
.r-middle {
|
font-weight: 400;
|
font-size: 13px;
|
color: #86909C;
|
}
|
.r-bottom {
|
display: flex;
|
justify-content: space-between;
|
font-weight: 400;
|
font-size: 13px;
|
color: #86909C;
|
margin-top: 10rpx;
|
}
|
}
|
}
|
}
|
</style>
|