吉安感知网项目-前端
chenyao
2026-01-08 b5b1069057feebfdcb1cf491686ce4c145adbf0d
uniapps/work-wx/src/pages/page/index.vue
@@ -13,7 +13,7 @@
            <text class="grid-text">{{baseListItem.title}}</text>
        </u-grid-item>
    </u-grid>
    <u-tabs :list="list3" class="tabs">
    <u-tabs :list="tabs" class="tabs">
      <template #right>
            <view
                style="padding-left: 4px;"
@@ -23,17 +23,17 @@
            </view>
        </template>
    </u-tabs>
    <view class="card" v-for="(item,index) in list4" :key="index">
    <view class="card" v-for="(item,index) in announcementList" :key="index">
      <view class="left">
        <u-image :src="lbPng" :width="20" :height="20"></u-image>
      </view>
      <view class="right">
        <view class="c-top">{{ item.title }}</view>
        <view class="c-middle">{{ item.content }}</view>
        <view class="c-top">{{ item.airspaceName }}</view>
        <view class="c-middle">{{ item.remarks || '暂无' }}</view>
        <view class="c-bottom">
          <view>{{ item.time }}</view>
          <view>{{ item.num }}</view>
          <view>{{ item.like }}</view>
          <view>{{ item.createTime }}</view>
          <view>{{ item.num || 0 }}</view>
          <view>{{ item.like || 0 }}</view>
        </view>
      </view>
    </view>
@@ -41,13 +41,14 @@
</template>
<script setup>
  import { reactive, ref } from 'vue'
  import { onMounted, reactive, ref } from 'vue'
  import lbPng from '@/static/images/lb.png'
  import kyxxPng from '@/static/images/kyxx.svg'
  import fxsqPng from '@/static/images/fxsq.svg'
  import flfgPng from '@/static/images/flfg.svg'
  import zczdPng from '@/static/images/zczd.svg'
const lbList = reactive([]);
  import { sysNoticePageInfoApi, flightAirspacePageInfoApi } from '@/api/index'
const lbList = reactive([]);
// lbPng 轮播图 5次
for (let i = 0; i < 5; i++) {
  lbList.push({
@@ -74,35 +75,32 @@
  }
}
const baseList = ref([
    {
        src: kyxxPng,
        title: '空域信息'
    },
    {
        src: fxsqPng,
        title: '飞行申请'
    },
    {
        src: flfgPng,
        title: '法律法规'
    },
    {
        src: zczdPng,
        title: '政策制度'
const baseList = ref([
    {
        src: kyxxPng,
        title: '空域信息'
    },
]);
const list3 = reactive([
    { name: '空域信息' },
    { name: '法律法规' },
    { name: '政策制度' },
]);
const list4 = reactive([
    { title: '关于征求', content: '关于征求', time: '2025-10-23', num: '1660', like: '126' },
    { title: '解决燃气', content: '解决燃气', time: '2025-10-23', num: '126', like: '126' },
    {
        src: fxsqPng,
        title: '飞行申请'
    },
    {
        src: flfgPng,
        title: '法律法规'
    },
    {
        src: zczdPng,
        title: '政策制度'
    },
]);
const tabs = ref([
    { name: '空域信息' },
    { name: '法律法规' },
    { name: '政策制度' },
]);
const announcementList = ref([]);
function gridClick(index) {
  if (index === 0) {
    uni.navigateTo({
@@ -122,6 +120,46 @@
    })
  }
}
// 获取空域信息列表
async function getFlightAirspaceList() {
  try {
    const res = await flightAirspacePageInfoApi({
      current: 1,
      size: 10,
    })
    announcementList.value = res.data.data.records
  } catch (error) {
    uni.showToast({
      title: error.message,
      icon: 'none',
      duration: 2000,
    })
  }
}
// 获取通知公告列表
async function getSysNoticeList() {
  try {
    const res = await sysNoticePageInfoApi({
      current: 1,
      size: 10,
      noticeType: 2,
    })
    if (res.code === 200) {
      announcementList.value = res.data.records
    }
  } catch (error) {
    uni.showToast({
      title: error.message,
      icon: 'none',
      duration: 2000,
    })
  }
}
onMounted(() => {
  getFlightAirspaceList()
})
</script>
<style scoped lang="scss">