Commit 19ea2576 authored by youjie's avatar youjie

no message

parent 0c7a3bb1
......@@ -248,33 +248,39 @@
data.loading = true
}
},
async getData() {
getData() {
uni.showLoading()
let res = await GetStudentPageList(data.msg);
if (res) {
uni.hideLoading()
let datas = res.Data.PageData
let addList = function (arr) {
arr.forEach(item => {
item.checked = false
});
};
addList(datas);
if (data.timer) data.timer = null;
// data.dataList = res.Data&&res.Data.PageData;
// return
if (data.msg.pageIndex === 1) {
data.dataList = res.Data.PageData;
} else {
data.dataList = [...data.dataList, ...res.Data.PageData];
}
data.pageCount = res.Data.PageCount
if (data.msg.pageIndex >= res.Data.PageCount) {
data.pageState = "none";
} else {
data.pageState = "more";
}
}
GetStudentPageList(data.msg).then(res => {
if(res.Code==1){
uni.hideLoading()
let datas = res.Data.PageData
let addList = function (arr) {
arr.forEach(item => {
item.checked = false
});
};
addList(datas);
console.log(datas,'---')
if (data.timer) data.timer = null;
// data.dataList = res.Data&&res.Data.PageData;
// return
if (data.msg.pageIndex === 1) {
data.dataList = res.Data.PageData;
} else {
data.dataList = [...data.dataList, ...res.Data.PageData];
}
data.pageCount = res.Data.PageCount
if (data.msg.pageIndex >= res.Data.PageCount) {
data.pageState = "none";
} else {
data.pageState = "more";
}
}else{
uni.hideLoading()
}
}).catch(e => {
uni.hideLoading()
})
},
};
let that = methods;
......
......@@ -254,13 +254,16 @@
let msg = {
Id: item.Id
}
let res = RemoveMyChild(msg);
if (res.Code==1) {
RemoveMyChild(msg).then(r => {
if(r.Code==1){
uni.hideLoading()
methods.getData();
}else{
uni.hideLoading()
}
}).catch(e => {
uni.hideLoading()
that.getData()
}else{
uni.hideLoading()
}
})
} else if (res.cancel) {
uni.showToast({
......@@ -278,24 +281,29 @@
url: url,
});
},
async getData() {
getData() {
uni.showLoading()
let res = await MyChildList(data.msg);
if (res) {
MyChildList(data.msg).then(res => {
if(res.Code==1){
uni.hideLoading()
if (data.timer) data.timer = null;
if (data.msg.pageIndex === 1) {
data.dataList = res.Data.PageData;
} else {
data.dataList = [...data.dataList, ...res.Data.PageData];
}
data.pageCount = res.Data.PageCount
if (data.msg.pageIndex >= res.Data.PageCount) {
data.pageState = "none";
} else {
data.pageState = "more";
}
}else{
uni.hideLoading()
}
}).catch(e => {
uni.hideLoading()
if (data.timer) data.timer = null;
if (data.msg.pageIndex === 1) {
data.dataList = res.Data.PageData;
} else {
data.dataList = [...data.dataList, ...res.Data.PageData];
}
data.pageCount = res.Data.PageCount
if (data.msg.pageIndex >= res.Data.PageCount) {
data.pageState = "none";
} else {
data.pageState = "more";
}
}
})
},
};
let that = methods;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment