Browse Source

任务提醒修改bug

yangyongyong 3 years ago
parent
commit
1740c16f38

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

@@ -6,7 +6,7 @@
         <label>{{servantName}}</label>
         <view class="cell-right" onTap="changeotherhome" a:if="{{homecssname}}">
           <image mode="scaleToFill" src="/image/switch-blue.png"/>
-          <label class="homecssname">切换到其他家庭</label>
+          <label class="homecssname">切换到其他保姆</label>
         </view>
         <view class="cell-right" onTap="changeotherhome" a:if="{{!homecssname}}">
           <image mode="scaleToFill" src="/image/switch-grey.png"/>
@@ -50,7 +50,7 @@
       <view a:if="{{isreminds}}" a:for="{{taskList}}" key="{{index}}">
         <view class="tasks-list-item" a:if="{{item.state == 0}}">
           <text> {{item.itemName}}</text>
-          <view class="tasks-item-red">
+          <view class="tasks-item-red" a:if="{{tomorrowtasksState}}">
             <text> 未完成</text>
           </view>
           
@@ -75,13 +75,13 @@
     <!--没有任务-->
     <view a:if="{{!isreminds}}">
       <view class="notasks">
-        <text>还没有任务</text>
+        <text>今天无任务</text>
       </view>
     </view>
     <!--今天市休息日-->
     <view a:if="{{!workDay}}">
       <view class="notasks">
-        <text>今天市休息日</text>
+        <text>今日是休息日</text>
       </view>
     </view>
     <!---没有任务花销计算不显示-->

+ 16 - 1
client/pages/customer/taskreminder/taskreminder.js

@@ -16,7 +16,8 @@ Page({
     weekday: '',//日前
     servantTypeValue: '',//保姆工种,
     taskList: [],
-    selectDailyCost:0 //今日花销
+    selectDailyCost:0, //今日花销
+    tomorrowtasksState:true,//明天任务状态
   },
   onLoad() {
     //加载选中的时间
@@ -117,6 +118,13 @@ Page({
     });
     this.selectDayTaskItem();
     this.selectDayTaskCost();
+    //如果是选中的时间大于当天,任务不显示
+    let nowdate=util.formatDate(new Date());
+    if(nowdate < this.data.nowselectTime){
+      this.setData({
+          tomorrowtasksState: false
+        });
+    }
   },
   
   showtime(){
@@ -135,6 +143,13 @@ Page({
       this.setnowweek();
       this.selectDayTaskItem();
       this.selectDayTaskCost();
+      //如果是选中的时间大于当天,任务不显示
+      let nowdate=util.formatDate(new Date());
+      if(nowdate < this.data.nowselectTime){
+        this.setData({
+            tomorrowtasksState: false
+          });
+      }
   },
 
 // 查询保姆每日任务