diff --git a/epmet-apartment-front/index.html b/epmet-apartment-front/index.html index 47bc769..001e3b0 100644 --- a/epmet-apartment-front/index.html +++ b/epmet-apartment-front/index.html @@ -7,8 +7,8 @@ 青岛市免租金住房保障平台 - - + +
diff --git a/src/api/policy.ts b/src/api/policy.ts index 0709989..cc4f916 100644 --- a/src/api/policy.ts +++ b/src/api/policy.ts @@ -17,3 +17,12 @@ export const gePolicytList = (params: object) => { export const getPolicyInfo = (id: number) => { return request.get(`/asdh5/mzPolicy/${id}`) } + +/** + * 获取政策类型 + * @returns + */ +export const getPolicyType = () => { + return request.get('/system/dict/data/list?dictType=policy_type') +} + diff --git a/src/views/Home.vue b/src/views/Home.vue index 266aca6..37759ae 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -46,7 +46,7 @@ import homeLogo from '@/assets/images/home/logo.png' import text1 from '@/assets/images/home/text1.png' import text2 from '@/assets/images/home/text2.png' import { getStaticInfoByApartmen } from '@/api/index' -import { gePolicytList } from '@/api/policy' +import { gePolicytList, getPolicyType } from '@/api/policy' import navBg from "@/assets/images/home/navBg.png"; import nav1 from "@/assets/images/home/nav1.png"; import nav2 from "@/assets/images/home/nav2.png"; @@ -90,24 +90,13 @@ const navList = [ }, ]; // tabList -const tabList = reactive([ - { - dictLabel: "最新", - dictValue: "0", - }, - { - dictLabel: "住房政策", - dictValue: "1", - }, - { - dictLabel: "人才政策", - dictValue: "2", - }, - { - dictLabel: "就业政策", - dictValue: "3", - }, +const tabList = ref([ ]); +const getPolicyTypeList = async () => { + const res = (await getPolicyType()) as unknown as ApiResponse<{rows: any[]}>; + tabList.value = [{dictLabel: '最新', dictValue: '0'}, ...(res.rows || [])]; + console.log(tabList.value); +} const active = ref('0') const top3 = ref([]) @@ -147,6 +136,7 @@ const handleClickTab = (item) => { } // 初始化 +getPolicyTypeList() getPolicyList() getList() diff --git a/src/views/policy/index.vue b/src/views/policy/index.vue index 112ac35..9f9b975 100644 --- a/src/views/policy/index.vue +++ b/src/views/policy/index.vue @@ -86,25 +86,9 @@