feat: 处理重复请求
This commit is contained in:
@@ -65,6 +65,7 @@ const appStore = useAppStore();
|
|||||||
const locationStore = useLocationStore();
|
const locationStore = useLocationStore();
|
||||||
/// 从个渠道获取如二维码
|
/// 从个渠道获取如二维码
|
||||||
const sceneId = appStore.sceneId || "";
|
const sceneId = appStore.sceneId || "";
|
||||||
|
const currentTabsId = ref("");
|
||||||
|
|
||||||
const activeIndex = ref(0);
|
const activeIndex = ref(0);
|
||||||
const discoveryTabs = ref([]);
|
const discoveryTabs = ref([]);
|
||||||
@@ -90,6 +91,7 @@ const handleContentScroll = (e) => {
|
|||||||
/// 点击主景区
|
/// 点击主景区
|
||||||
const handleMainPanoramaClick = () => {
|
const handleMainPanoramaClick = () => {
|
||||||
isMainPanoramaGuide.value = true;
|
isMainPanoramaGuide.value = true;
|
||||||
|
currentTabsId.value = "";
|
||||||
discoveryTabs.value = [];
|
discoveryTabs.value = [];
|
||||||
discoveryCards.value = [];
|
discoveryCards.value = [];
|
||||||
exploreCards.value = [];
|
exploreCards.value = [];
|
||||||
@@ -138,8 +140,10 @@ const handlePanoramicHomeSelect = (item) => {
|
|||||||
/// 根据id查询tab并设置activeIndex
|
/// 根据id查询tab并设置activeIndex
|
||||||
const findTabByIdWithActiveTabIndex = (tabsId) => {
|
const findTabByIdWithActiveTabIndex = (tabsId) => {
|
||||||
const resolvedTab = resolveDiscoveryTab(discoveryTabs.value, tabsId);
|
const resolvedTab = resolveDiscoveryTab(discoveryTabs.value, tabsId);
|
||||||
if (!resolvedTab.tab) return;
|
if (!resolvedTab.tab?.id) return;
|
||||||
|
|
||||||
|
if (currentTabsId.value === resolvedTab.tab.id) return;
|
||||||
|
currentTabsId.value = resolvedTab.tab.id;
|
||||||
activeIndex.value = resolvedTab.activeIndex;
|
activeIndex.value = resolvedTab.activeIndex;
|
||||||
queryDiscoveryData(resolvedTab.tab);
|
queryDiscoveryData(resolvedTab.tab);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user