|
@@ -41,17 +41,17 @@ Page({
|
|
|
yFlag: false
|
|
|
},
|
|
|
|
|
|
- getTimeDate:function(e){
|
|
|
- if(e.currentTarget.dataset.value == this.data.index){
|
|
|
+ getTimeDate: function (e) {
|
|
|
+ if (e.currentTarget.dataset.value == this.data.index) {
|
|
|
this.setData({
|
|
|
index: -1,
|
|
|
})
|
|
|
- } else{
|
|
|
+ } else {
|
|
|
this.setData({
|
|
|
index: e.currentTarget.dataset.value,
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
},
|
|
|
|
|
|
getWeek: function (e) {
|
|
@@ -90,6 +90,7 @@ Page({
|
|
|
this.setData({
|
|
|
timeScope,
|
|
|
index: -1,
|
|
|
+ schoolList: []
|
|
|
})
|
|
|
this.showSelect()
|
|
|
this.queryList()
|
|
@@ -224,20 +225,23 @@ Page({
|
|
|
this.selectCity()
|
|
|
}
|
|
|
}
|
|
|
- if(this.data.refreshFlag == 1){
|
|
|
+ if (this.data.refreshFlag == 1) {
|
|
|
this.setData({
|
|
|
schoolList: [],
|
|
|
refreshFlag: 0
|
|
|
})
|
|
|
this.queryList()
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
},
|
|
|
|
|
|
selectCity: function () {
|
|
|
wx.navigateTo({
|
|
|
url: `plugin://citySelector/index?key=${key}&referer=${referer}&hotCitys=${hotCitys}`,
|
|
|
})
|
|
|
+ this.setData({
|
|
|
+ refreshFlag: 1
|
|
|
+ })
|
|
|
},
|
|
|
|
|
|
/**
|
|
@@ -301,13 +305,12 @@ Page({
|
|
|
params['q.regionId'] = countyCode.substring(0, 4) + '00'
|
|
|
params.pageNum = this.data.pageNum
|
|
|
util.apiPost(urls.get_near_school, params).then(rs => {
|
|
|
-
|
|
|
let list = rs.list;
|
|
|
list.map(s => {
|
|
|
s.dist = this.showDist(s.distance)
|
|
|
})
|
|
|
|
|
|
- const schoolNum = "("+list.length+")"
|
|
|
+ const schoolNum = "(" + list.length + ")"
|
|
|
this.setData({
|
|
|
'hasNextPage': rs.hasNextPage,
|
|
|
'loading': rs.hasNextPage ? '上拉加载' : '没有更多数据',
|
|
@@ -339,14 +342,14 @@ Page({
|
|
|
// 'schoolIndex': index
|
|
|
// })
|
|
|
// this.queryClassesList(id)
|
|
|
- let moreFlag = 'schoolList['+index+'].moreFlag'
|
|
|
- if(this.data.schoolList[index].moreFlag){
|
|
|
+ let moreFlag = 'schoolList[' + index + '].moreFlag'
|
|
|
+ if (this.data.schoolList[index].moreFlag) {
|
|
|
this.setData({
|
|
|
- [moreFlag] : false
|
|
|
+ [moreFlag]: false
|
|
|
})
|
|
|
} else {
|
|
|
this.setData({
|
|
|
- [moreFlag] : true
|
|
|
+ [moreFlag]: true
|
|
|
})
|
|
|
}
|
|
|
|
|
@@ -382,23 +385,34 @@ Page({
|
|
|
'q.timeScope': this.data.timeScope
|
|
|
}
|
|
|
// params['q.timeScope'] = ''; 时段
|
|
|
- util.apiPost(urls.query_school_attence, params).then(rs => {
|
|
|
- for (var j in rs) {
|
|
|
- if (rs[j].studentVisitNum > 0 || rs[j].studentWaitNum > 0) {
|
|
|
+ if (i == 0) {
|
|
|
+ util.apiPost(urls.query_school_attence, params).then(rs => {
|
|
|
+ s.moreFlag = true
|
|
|
+ s.items = rs
|
|
|
+ this.setData({
|
|
|
+ schoolList: sl
|
|
|
+ })
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ util.apiPost(urls.query_school_attence, params).then(rs => {
|
|
|
+ for (var j in rs) {
|
|
|
+ if (rs[j].studentVisitNum > 0 || rs[j].studentWaitNum > 0) {
|
|
|
+ s.moreFlag = true
|
|
|
+ break
|
|
|
+ } else {
|
|
|
+ s.moreFlag = false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (s.collect == 1) {
|
|
|
s.moreFlag = true
|
|
|
- break
|
|
|
- } else {
|
|
|
- s.moreFlag = false
|
|
|
}
|
|
|
- }
|
|
|
- if(s.collect == 1){
|
|
|
- s.moreFlag = true
|
|
|
- }
|
|
|
- s.items = rs
|
|
|
- this.setData({
|
|
|
- schoolList: sl
|
|
|
+
|
|
|
+ s.items = rs
|
|
|
+ this.setData({
|
|
|
+ schoolList: sl
|
|
|
+ })
|
|
|
})
|
|
|
- })
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
doAppointment: function (e) {
|
|
@@ -425,7 +439,7 @@ Page({
|
|
|
|
|
|
const urls = urlDef.urls;
|
|
|
let w = this.data.weekList[this.data.curIndex];
|
|
|
- let sid = this.data.schoolList[this.data.schoolIndex].id
|
|
|
+ let sid = this.data.schoolList[index].id
|
|
|
util.apiPost(urls.do_appointment + '?q.studentId=' + this.data.curStu.studentId + '&q.planId=' + id + '&q.orgId=' + sid + '&q.visitDate=' + w.ds).then(rs => {
|
|
|
if (rs.success > 0) {
|
|
|
wx.showToast({
|
|
@@ -436,8 +450,9 @@ Page({
|
|
|
wx.showToast({
|
|
|
title: rs.msg,
|
|
|
icon: 'none',
|
|
|
+ duration: 3000
|
|
|
})
|
|
|
- this.queryList()
|
|
|
+ // this.queryList()
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -446,7 +461,7 @@ Page({
|
|
|
let index = e.currentTarget.dataset.index
|
|
|
let w = this.data.weekList[this.data.curIndex];
|
|
|
let sid = this.data.schoolList[index].id
|
|
|
-
|
|
|
+
|
|
|
wx.navigateTo({
|
|
|
url: '/pages/queue/queue?planId=' + id + '&orgId=' + sid + '&visitDate=' + w.ds
|
|
|
})
|