接口联调

This commit is contained in:
xuli3099
2025-08-14 14:01:54 +08:00
parent 28f24a90fd
commit a9141dfb6b
5 changed files with 92 additions and 16 deletions

View File

@@ -72,20 +72,24 @@ onMounted(() => {
// 查询列表
let list = ref([]);
let count = ref(0);
let bizIds = ref([]);//常用服务列表
let getList = async()=>{
let arrNew = [];
bizIds.value = [];
let res = await businessList({});//查询所有业务
let arr = res || [];
let res2 = await getUserFavorite({});//查询当前用户的常用服务
let bizIdListStr = res2.bizIdList || '';
let arr2 = bizIdListStr.split(",");
let arr2 = res2 || [];
count.value = arr2.length;
arr2.forEach(item=>{
bizIds.value.push(item.bizId)
});
arr.forEach(item=>{
item.isDaily=false;
arr2.forEach(item2=>{
if(item2==item.bizId){
if(item2.bizId==item.bizId){
item.isDaily=true;
}
})
@@ -97,7 +101,7 @@ let getList = async()=>{
item.expandFlag = false;
});
list.value = bizList;
console.log("list=>",list.value)
// console.log("list=>",list.value)
}
// 下拉刷新
@@ -127,7 +131,7 @@ const downCallback = async (mescroll) => {
}
}
let bizIds = ref([]);
// 选择常用
const handleCheck=(item)=>{
item.isDaily = !item.isDaily;
@@ -136,13 +140,13 @@ const handleCheck=(item)=>{
bizIds.value.push(item.bizId);
}else{
count.value--;
const index = bizIds.value.findIndex(item2 => item2.bizId === item.bizId);
const index = bizIds.value.findIndex(item2 => item2 == item.bizId);
if (index !== -1) {
bizIds.value.splice(index, 1);
}
}
console.log("bizIds=>",bizIds.value)
// console.log("handleCheck=>bizIds=>",bizIds.value)
}
// 提交
@@ -168,6 +172,7 @@ const handleSubmit= async()=>{
width: 690rpx;
margin-bottom:0;
border-radius: 8px 8px 0 0;
min-height: calc(100vh - 100px);
}
:deep(.mescroll-upwarp){