Commit 19ea2576 authored by youjie's avatar youjie

no message

parent 0c7a3bb1
...@@ -248,33 +248,39 @@ ...@@ -248,33 +248,39 @@
data.loading = true data.loading = true
} }
}, },
async getData() { getData() {
uni.showLoading() uni.showLoading()
let res = await GetStudentPageList(data.msg); GetStudentPageList(data.msg).then(res => {
if (res) { if(res.Code==1){
uni.hideLoading() uni.hideLoading()
let datas = res.Data.PageData let datas = res.Data.PageData
let addList = function (arr) { let addList = function (arr) {
arr.forEach(item => { arr.forEach(item => {
item.checked = false item.checked = false
}); });
}; };
addList(datas); addList(datas);
if (data.timer) data.timer = null; console.log(datas,'---')
// data.dataList = res.Data&&res.Data.PageData; if (data.timer) data.timer = null;
// return // data.dataList = res.Data&&res.Data.PageData;
if (data.msg.pageIndex === 1) { // return
data.dataList = res.Data.PageData; if (data.msg.pageIndex === 1) {
} else { data.dataList = res.Data.PageData;
data.dataList = [...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.pageCount = res.Data.PageCount
data.pageState = "none"; if (data.msg.pageIndex >= res.Data.PageCount) {
} else { data.pageState = "none";
data.pageState = "more"; } else {
} data.pageState = "more";
} }
}else{
uni.hideLoading()
}
}).catch(e => {
uni.hideLoading()
})
}, },
}; };
let that = methods; let that = methods;
......
...@@ -254,13 +254,16 @@ ...@@ -254,13 +254,16 @@
let msg = { let msg = {
Id: item.Id Id: item.Id
} }
let res = RemoveMyChild(msg); RemoveMyChild(msg).then(r => {
if (res.Code==1) { if(r.Code==1){
uni.hideLoading()
methods.getData();
}else{
uni.hideLoading()
}
}).catch(e => {
uni.hideLoading() uni.hideLoading()
that.getData() })
}else{
uni.hideLoading()
}
} else if (res.cancel) { } else if (res.cancel) {
uni.showToast({ uni.showToast({
...@@ -278,24 +281,29 @@ ...@@ -278,24 +281,29 @@
url: url, url: url,
}); });
}, },
async getData() { getData() {
uni.showLoading() uni.showLoading()
let res = await MyChildList(data.msg); MyChildList(data.msg).then(res => {
if (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() 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; 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