Преглед изворни кода

🐛 修改首页数据跳转问题

imengyu пре 4 недеља
родитељ
комит
53f08bec48

+ 9 - 10
src/pages/article/common/CommonListPage.vue

@@ -325,8 +325,9 @@ watch(() => props.startTabIndex, () => {
     tabCurrentIndex.value = props.startTabIndex;
   }
 });
-watch(() => props.dropDownNames, () => {
+watch(() => props.dropDownNames.length, () => {
   loadDropDownValues();
+  listLoader.loadData(undefined, true);
 });
 
 defineExpose({
@@ -336,15 +337,13 @@ defineExpose({
 })
 
 onMounted(() => {
-  setTimeout(() => {  
-    if (props.startTabIndex)
-      tabCurrentIndex.value = props.startTabIndex;
-    if (props.title)
-      uni.setNavigationBarTitle({ title: props.title, })
-    loadDropDownValues();
-    if (props.loadMounted)
-      listLoader.loadData(undefined, true);
-  }, 300);
+  if (props.startTabIndex)
+    tabCurrentIndex.value = props.startTabIndex;
+  if (props.title)
+    uni.setNavigationBarTitle({ title: props.title, })
+  loadDropDownValues();
+  if (props.loadMounted)
+    listLoader.loadData(undefined, true);
 });
 </script>
 

+ 4 - 2
src/pages/inhert/inheritor/list.vue

@@ -61,9 +61,11 @@ onLoad(async (querys) => {
       name: item.title,
     }))),
     activeTab: [0],
-    defaultSelectedValue: querys?.level ? (levels.find(p => p.id == querys.level)?.id ?? 0) : 0,
+    defaultSelectedValue: querys?.level ?? 0,
   });
-  dropdownNames.value.push({ 
+  console.log('level', querys?.level);
+  
+  dropdownNames.value.push({  
     options: [{
       id: 0, 
       name: '全部区域'

+ 1 - 1
src/pages/inhert/intangible/list.vue

@@ -95,7 +95,7 @@ onLoad(async (querys) => {
       name: item.title,
     }))),
     activeTab: [0,3],
-    defaultSelectedValue: querys?.level ? (levels.find(p => p.id == querys.level)?.id ?? 0) : 0,
+    defaultSelectedValue: querys?.level ?? 0,
   });
   dropdownNames.value.push({ 
     options: [{