fix: 修复ETF列表数据合并逻辑并更新开发环境API地址
修复indexEtf.vue中分页加载时相同day数据的合并问题,避免重复数据 更新.env.development中的VITE_API_URL为https://cankao.cs.com.cn/apih5
This commit is contained in:
parent
e4196bdc66
commit
81c98ce3b2
|
|
@ -2,10 +2,10 @@
|
|||
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://123.60.79.143:8041/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
|
||||
|
|
@ -76,7 +76,8 @@
|
|||
:show="LoginShow"
|
||||
@handlePopupClose="handlePopupClose"
|
||||
@handlePopupSuccessCallback="handlePopupSuccessCallback"
|
||||
@handlePopupErrorCallback="handlePopupErrorCallback" />
|
||||
@handlePopupErrorCallback="handlePopupErrorCallback"
|
||||
/>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
|
@ -132,7 +133,24 @@ async function getData() {
|
|||
listData.value = [];
|
||||
listData.value = data.list;
|
||||
} else {
|
||||
listData.value = [...listData.value, ...data.list];
|
||||
// 处理可能的day字段重复,合并相同day的list数据
|
||||
const newList = [...data.list];
|
||||
const updatedList = [...listData.value];
|
||||
|
||||
newList.forEach(newItem => {
|
||||
// 检查是否存在相同day的条目
|
||||
const existingItemIndex = updatedList.findIndex(item => item.day === newItem.day);
|
||||
|
||||
if (existingItemIndex !== -1) {
|
||||
// 如果存在相同day,合并list数据
|
||||
updatedList[existingItemIndex].list = [...updatedList[existingItemIndex].list, ...newItem.list];
|
||||
} else {
|
||||
// 如果不存在相同day,直接添加
|
||||
updatedList.push(newItem);
|
||||
}
|
||||
});
|
||||
|
||||
listData.value = updatedList;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue