![]()
@@ -90,14 +90,27 @@ const MesList = ref([]);
const newsListtyp = ref([]);
const page = ref(1);
const total = ref(0);
-const cateid = ref(null);
+const cateid = ref(0);
const detailId = ref(null);
// 信息公开
onMounted(() => {
// getMesList();
- // getNewstypeList();
+ getNewstypeList();
})
+const hmScroll = () => {
+ let home = document.getElementById('msgid');
+ if (home.scrollTop + home.clientHeight >= home.scrollHeight) {
+ setTimeout(function () {
+ emit('toSwpe', 7);
+ }, 500);
+ }
+ if (home.scrollTop == 0) {
+ setTimeout(function () {
+ emit('toSwpe', 5);
+ }, 500);
+ }
+}
const emit = defineEmits(['toSwpe'])
//跳转详情
@@ -125,15 +138,14 @@ const toSearch = () => {
}
const getPageList = async () => {
page.value = page.value;
- getMesList();
+ getMesList(cateid.value);
}
-const getMesList = async (id: number, pagecru: number) => {
- cateid.value = id ? id : cateid.value;
- page.value = pagecru ? pagecru : page.value;
- const res = await $api.post('/api/home.news/index',
+const getMesList = async (id: number) => {
+ cateid.value = id;
+ const res = await $api.post('/api/home.information/index',
{
cate_id: cateid.value,
- limit: 9,
+ limit: 7,
page: page.value,
isnews: 1
}
@@ -142,8 +154,9 @@ const getMesList = async (id: number, pagecru: number) => {
MesList.value = res.data.data.list;
}
const getNewstypeList = async () => {
- const res = await $api.get('/api/home.news/cate?isnews=1')
+ const res = await $api.get('/api/home.information/cate')
newsListtyp.value = res.data.data.list;
+ getMesList(res.data.data.list[0].id);
}
diff --git a/components/AppNews.vue b/components/AppNews.vue
index b0a58f2..38b6507 100644
--- a/components/AppNews.vue
+++ b/components/AppNews.vue
@@ -5,7 +5,7 @@
-
+
![]()
@@ -101,7 +101,19 @@ onMounted(() => {
getNewstypeList();
})
const emit = defineEmits(['toSwpe'])
-
+const hmScroll = () => {
+ let home = document.getElementById('newsid');
+ if (home.scrollTop + home.clientHeight >= home.scrollHeight) {
+ setTimeout(function () {
+ emit('toSwpe', 4);
+ }, 500);
+ }
+ if (home.scrollTop == 0) {
+ setTimeout(function () {
+ emit('toSwpe', 2);
+ }, 500);
+ }
+}
//跳转详情
const openUrl = (id: number) => {
window.open(`/info/${id}?type=1`)
diff --git a/components/AppRegiment.vue b/components/AppRegiment.vue
index dc1a36e..25aa448 100644
--- a/components/AppRegiment.vue
+++ b/components/AppRegiment.vue
@@ -3,7 +3,7 @@
-
+
![]()
@@ -146,6 +146,19 @@ onMounted(() => {
getYwList();
//getNewstypeList();
})
+const hmScroll = () => {
+ let home = document.getElementById('regid');
+ if (home.scrollTop + home.clientHeight >= home.scrollHeight) {
+ setTimeout(function () {
+ emit('toSwpe',6);
+ }, 500);
+ }
+ if (home.scrollTop == 0) {
+ setTimeout(function () {
+ emit('toSwpe', 4);
+ }, 500);
+ }
+}
const fwImg = ref([]);
//服务青年轮播图
const getFwImg = async () => {
diff --git a/pages/index.vue b/pages/index.vue
index 838dec9..a27f8c4 100644
--- a/pages/index.vue
+++ b/pages/index.vue
@@ -53,8 +53,8 @@
-->
-
-
+
+