Kaynağa Gözat

🎨 修改细节问题

快乐的梦鱼 2 ay önce
ebeveyn
işleme
9c1729996f

+ 5 - 7
src/pages/inhert/village/list.vue

@@ -33,7 +33,10 @@ async function loadData(
   tabSelect: number,
 ) {
 
-  const list = page == 1 ? await VillageApi.getVallageList(tabSelect) : [];
+  const res = await CommonContent.getCategoryList(151);
+  const it2 = res.find(p => p.title == '省级');
+  if (it2) it2.title = '传统村落';
+  const list = page == 1 ? await VillageApi.getVallageList(it2?.id) : [];
   list.filter((p) => !searchText || p.title.includes(searchText)).forEach((p) => {
     p.desc = p.desc;
     p.badge = p.district;
@@ -54,12 +57,7 @@ function goDetails(item: any) {
 const tabs = ref<{id: number, text: string}[]>();
 
 onMounted(async () => {
-  const res = await CommonContent.getCategoryList(151);
-  const it1 = res.find(p => p.title == '特色村舍');
-  const it2 = res.find(p => p.title == '省级');
-  if (it1) it1.title = '美丽村舍';
-  if (it2) it2.title = '传统村落';
-  tabs.value = res.slice(1).map((p) => ({ id: p.id, text: p.title }));
+  //tabs.value = res.slice(1).map((p) => ({ id: p.id, text: p.title }));
   await waitTimeOut(400);
   list.value.load();
 })

+ 2 - 2
src/pages/travel/scenic-spot/list.vue

@@ -21,10 +21,10 @@
 </template>
 
 <script setup lang="ts">
-import CommonContent, { GetContentListParams } from '@/api/CommonContent';
+import { onMounted, ref } from 'vue';
+import { GetContentListParams } from '@/api/CommonContent';
 import ScenicSpotContent from '@/api/fusion/ScenicSpotContent';
 import CommonListPage, { type DropDownNames } from '@/pages/article/common/CommonListPage.vue';
-import { onMounted, ref } from 'vue';
 
 const dropdownNames = ref<DropDownNames[]>([]);