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
|
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
|
||||||
|
|
@ -76,7 +76,8 @@
|
||||||
:show="LoginShow"
|
:show="LoginShow"
|
||||||
@handlePopupClose="handlePopupClose"
|
@handlePopupClose="handlePopupClose"
|
||||||
@handlePopupSuccessCallback="handlePopupSuccessCallback"
|
@handlePopupSuccessCallback="handlePopupSuccessCallback"
|
||||||
@handlePopupErrorCallback="handlePopupErrorCallback" />
|
@handlePopupErrorCallback="handlePopupErrorCallback"
|
||||||
|
/>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -128,13 +129,30 @@ async function getData() {
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
|
|
||||||
if (code == 200) {
|
if (code == 200) {
|
||||||
if (form.value.page == 1) {
|
if (form.value.page == 1) {
|
||||||
listData.value = [];
|
listData.value = [];
|
||||||
listData.value = data.list;
|
listData.value = data.list;
|
||||||
} else {
|
} 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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const LoginShow = ref(false);
|
const LoginShow = ref(false);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue