|
@@ -19,9 +19,13 @@ Page({
|
|
|
},
|
|
|
onLoad() {
|
|
|
//加载选中的时间
|
|
|
- console.log(this.data.nowselectTime);
|
|
|
let that=this;
|
|
|
- that.getWeekStartDate(this.data.nowselectTime);
|
|
|
+ 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){
|
|
@@ -32,6 +36,7 @@ Page({
|
|
|
else{
|
|
|
data[i].date=this.data.weekdate[i];
|
|
|
data[i].day=this.data.weekdateday[i];
|
|
|
+ data[i].cssName=''
|
|
|
}
|
|
|
}
|
|
|
this.setData({
|
|
@@ -40,10 +45,6 @@ Page({
|
|
|
weekday: app.globalData.relationInfo.servantTaskPeriod.workDay,
|
|
|
servantTypeValue: app.globalData.relationInfo.servantType
|
|
|
});
|
|
|
- //处理时间完成
|
|
|
-
|
|
|
- this.selectDayTaskItem()
|
|
|
- this.selectDayTaskCost()
|
|
|
},
|
|
|
showcancel(){
|
|
|
this.setData({
|
|
@@ -97,8 +98,22 @@ 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();
|
|
|
},
|
|
|
|
|
|
showtime(){
|
|
@@ -108,7 +123,14 @@ Page({
|
|
|
},
|
|
|
//日历选中
|
|
|
handleSelect(e) {
|
|
|
- console.log(e[0]);
|
|
|
+ this.setData({
|
|
|
+ nowselectTime:util.formatDate(e[0]),
|
|
|
+ showchangetime:false,
|
|
|
+ nowDay:new Date(util.formatDate(e[0])).getDay()
|
|
|
+ });
|
|
|
+ this.selectDayTaskItem();
|
|
|
+ this.getWeekStartDate(util.formatDate(e[0]));
|
|
|
+ this.setnowweek();
|
|
|
},
|
|
|
|
|
|
// 查询保姆每日任务
|
|
@@ -118,7 +140,6 @@ Page({
|
|
|
"date": this.data.nowselectTime
|
|
|
}
|
|
|
request.httpServiceGet(apiUrl1.selectDayTaskItemPath, params).then(data => {
|
|
|
- console.log("今日任务=" + data);
|
|
|
// 未设置任务
|
|
|
if (data.length == 0) {
|
|
|
this.setData({
|
|
@@ -128,6 +149,7 @@ Page({
|
|
|
// 今天有任务
|
|
|
this.setData({
|
|
|
taskList: data,
|
|
|
+ isreminds: true
|
|
|
});
|
|
|
}
|
|
|
}
|
|
@@ -144,18 +166,7 @@ Page({
|
|
|
"date": this.data.nowselectTime
|
|
|
}
|
|
|
request.httpServiceGet(apiUrl.getEmployerCost, params).then(data => {
|
|
|
- console.log("今日任务花费=" + data);
|
|
|
- // 未设置任务
|
|
|
- if (data.length == 0) {
|
|
|
- this.setData({
|
|
|
- isreminds: false,
|
|
|
- });
|
|
|
- } else {
|
|
|
- // 今天有任务
|
|
|
- this.setData({
|
|
|
- taskList: data,
|
|
|
- });
|
|
|
- }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
).catch(e => {
|