2 次代码提交 b6c0098393 ... 8044563565

作者 SHA1 备注 提交日期
  yangyongyong 8044563565 Merge branch 'master' of http://47.102.110.240:3000/yuxiangpei/tbServantMini_cloud into master 4 年之前
  yangyongyong e4e150c47a 保姆端任务提醒功能 4 年之前

+ 1 - 1
client/pages/customer/taskreminder/taskreminder.axml

@@ -94,7 +94,7 @@
         <text>取消原因</text>
         <radio-group class="radio-group weui-input">
           <label a:for="{{cancellist}}"  a:key={{value}}>
-            <radio value="{{item.value}}" class="radio" checked="{{item.checked}}"/>{{item.label}}
+            <radio value="{{item.value}}" class="radio" checked="{{item.checked}}" color="#09AFFF"/>{{item.label}}
           </label>
         </radio-group>
     </view>

+ 0 - 9
client/pages/servant/taskreminder/taskreminder.acss

@@ -224,15 +224,6 @@
   margin-bottom: 30rpx;
   display: inline-block;
 }
-.radio{
-  width: 24rpx;
-  height: 24rpx;
-}
-radio-checked::before {
-  width: 24rpx;
-  height: 24rpx;
-  background-color: #09AFFF;
-}
 .cancel-box radio-group{
   width: 100%;
   margin-bottom: 67rpx;

+ 2 - 2
client/pages/servant/taskreminder/taskreminder.axml

@@ -20,14 +20,14 @@
   <view class="tasks-line">
     <view class="common-page-padding tasks-tik">
       <view class="tik-title">
-        <label>今天</label>
+        <label>{{nowselectTime}}</label>
         <view class="tik-right" onTap="showtime">
           <image mode="scaleToFill" src="/image/icon-calendar.png"/>
           <label>查看其它日期</label>
         </view>
       </view>
       <view class="tik-week" a:for="{{datelist}}" key="{{index}}">
-        <view class="tik-week-item {{item.cssName}}" onTap="changeWeekTime" data-id="{{id}}">
+        <view class="tik-week-item {{item.cssName}}" onTap="changeWeekTime"  data-value="{{item.date}}" data-id="{{item.id}}">
           <view>{{item.title}}</view>
           <view>{{item.day}}
             <text a:if={{item.cssName}}>\n▪</text>

+ 47 - 22
client/pages/servant/taskreminder/taskreminder.js

@@ -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,
         });
       }
     }