fix: 修复ETF列表数据合并逻辑并更新开发环境API地址

修复indexEtf.vue中分页加载时相同day数据的合并问题,避免重复数据
更新.env.development中的VITE_API_URL为https://cankao.cs.com.cn/apih5
This commit is contained in:
34701892@qq.com 2025-11-24 08:49:41 +08:00
parent e4196bdc66
commit 81c98ce3b2
2 changed files with 27 additions and 9 deletions

View File

@ -2,10 +2,10 @@
ENV = development ENV = development
# 本地环境接口地址 # 本地环境接口地址
VITE_API_URL = http://123.60.153.169:8040/apih5 # VITE_API_URL = http://123.60.153.169:8040/apih5
# VITE_API_URL = http://4155gf93ll13.vicp.fun/apih5 # VITE_API_URL = http://4155gf93ll13.vicp.fun/apih5
# VITE_API_URL = http://123.60.79.143:8041/apih5 # VITE_API_URL = http://123.60.79.143:8041/apih5
# VITE_API_URL =http://192.168.0.135:8040/apih5 # VITE_API_URL =http://192.168.0.135:8040/apih5
# VITE_API_URL = https://cankao.cs.com.cn/apih5 VITE_API_URL = https://cankao.cs.com.cn/apih5
VITE_API_DATAV_URL = https://cankao.cs.com.cn/zzck_datav VITE_API_DATAV_URL = https://cankao.cs.com.cn/zzck_datav

View File

@ -76,7 +76,8 @@
:show="LoginShow" :show="LoginShow"
@handlePopupClose="handlePopupClose" @handlePopupClose="handlePopupClose"
@handlePopupSuccessCallback="handlePopupSuccessCallback" @handlePopupSuccessCallback="handlePopupSuccessCallback"
@handlePopupErrorCallback="handlePopupErrorCallback" /> @handlePopupErrorCallback="handlePopupErrorCallback"
/>
</view> </view>
</template> </template>
@ -132,7 +133,24 @@ async function getData() {
listData.value = []; listData.value = [];
listData.value = data.list; listData.value = data.list;
} else { } else {
listData.value = [...listData.value, ...data.list]; // daydaylist
const newList = [...data.list];
const updatedList = [...listData.value];
newList.forEach(newItem => {
// day
const existingItemIndex = updatedList.findIndex(item => item.day === newItem.day);
if (existingItemIndex !== -1) {
// daylist
updatedList[existingItemIndex].list = [...updatedList[existingItemIndex].list, ...newItem.list];
} else {
// day
updatedList.push(newItem);
}
});
listData.value = updatedList;
} }
} }
} }