接口联调
This commit is contained in:
@@ -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){
|
||||
|
||||
Reference in New Issue
Block a user