|
@@ -20,19 +20,24 @@ Page({
|
|
|
},
|
|
|
onLoad() {
|
|
|
//加载选中的时间
|
|
|
- console.log(this.data.nowselectTime);
|
|
|
- let that = this;
|
|
|
- that.getWeekStartDate(this.data.nowselectTime);
|
|
|
+ let that=this;
|
|
|
+ that.getWeekStartDate(this.data.nowselectTime);
|
|
|
+ that.setnowweek();
|
|
|
+ this.selectDayTaskItem();
|
|
|
+ //this.selectDayTaskCost();
|
|
|
+ },
|
|
|
+ setnowweek(){
|
|
|
let data = this.data.datelist;
|
|
|
- for (let i = 0; i < 7; i++) {
|
|
|
- if (this.data.weekdateday[i] == this.data.nowDay) {
|
|
|
- data[i].date = this.data.weekdate[i];
|
|
|
- data[i].day = this.data.weekdateday[i];
|
|
|
- data[i].cssName = 'tik-week-item-select'
|
|
|
+ for(let i=0;i<7;i++){
|
|
|
+ if(this.data.weekdateday[i]==this.data.nowDay){
|
|
|
+ data[i].date=this.data.weekdate[i];
|
|
|
+ data[i].day=this.data.weekdateday[i];
|
|
|
+ data[i].cssName='tik-week-item-select'
|
|
|
}
|
|
|
- else {
|
|
|
- data[i].date = this.data.weekdate[i];
|
|
|
- data[i].day = this.data.weekdateday[i];
|
|
|
+ else{
|
|
|
+ data[i].date=this.data.weekdate[i];
|
|
|
+ data[i].day=this.data.weekdateday[i];
|
|
|
+ data[i].cssName=''
|
|
|
}
|
|
|
}
|
|
|
this.setData({
|
|
@@ -41,10 +46,6 @@ Page({
|
|
|
weekday: app.globalData.servantInfo.servantTaskPeriod.workDay,
|
|
|
servantTypeValue: app.globalData.servantInfo.servantType
|
|
|
});
|
|
|
-
|
|
|
-
|
|
|
- //处理时间完成
|
|
|
- this.selectDayTaskItem();
|
|
|
},
|
|
|
showcancel(e) {
|
|
|
this.setData({
|
|
@@ -110,19 +111,43 @@ Page({
|
|
|
|
|
|
},
|
|
|
changeWeekTime(e) {
|
|
|
- console.log(e.target.id);
|
|
|
- let changetime = e.target;
|
|
|
+ //切换选中的样式
|
|
|
+ let weeklist=this.data.datelist;
|
|
|
+ let selectedtabid=e.target.dataset.id;
|
|
|
+ for(let i=0;i<weeklist.length;i++){
|
|
|
+ if(weeklist[i].id==selectedtabid){
|
|
|
+ weeklist[i].cssName="tik-week-item-select";
|
|
|
+ }else{
|
|
|
+ weeklist[i].cssName="";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //设置当前选中的时间
|
|
|
+ this.setData({
|
|
|
+ nowselectTime:e.target.dataset.value,
|
|
|
+ datelist:weeklist
|
|
|
+ });
|
|
|
+ this.selectDayTaskItem();
|
|
|
+ //this.selectDayTaskCost();
|
|
|
},
|
|
|
-
|
|
|
- showtime() {
|
|
|
+
|
|
|
+ showtime(){
|
|
|
this.setData({
|
|
|
showchangetime: true,
|
|
|
});
|
|
|
},
|
|
|
+ //日历选中
|
|
|
handleSelect(e) {
|
|
|
- let selectday=util.formatDate(e[0]);
|
|
|
- console.log(selectday);
|
|
|
+ this.setData({
|
|
|
+ nowselectTime:util.formatDate(e[0]),
|
|
|
+ showchangetime:false,
|
|
|
+ nowDay:new Date(util.formatDate(e[0])).getDay()
|
|
|
+ });
|
|
|
+ this.getWeekStartDate(util.formatDate(e[0]));
|
|
|
+ this.setnowweek();
|
|
|
+ this.selectDayTaskItem();
|
|
|
+ //this.selectDayTaskCost();
|
|
|
},
|
|
|
+
|
|
|
// 查询保姆每日任务
|
|
|
selectDayTaskItem() {
|
|
|
let params = {
|
|
@@ -130,7 +155,6 @@ Page({
|
|
|
"date": this.data.nowselectTime
|
|
|
}
|
|
|
request.httpServiceGet(apiUrl1.selectDayTaskItemPath, params).then(data => {
|
|
|
- console.log(data);
|
|
|
// 未设置任务
|
|
|
if (data.length == 0) {
|
|
|
this.setData({
|
|
@@ -140,6 +164,7 @@ Page({
|
|
|
// 今天有任务
|
|
|
this.setData({
|
|
|
taskList: data,
|
|
|
+ isreminds: true,
|
|
|
});
|
|
|
}
|
|
|
}
|