Browse Source

雇主端任务提醒

gaoyognxing 4 years ago
parent
commit
c76c5102cb

+ 10 - 1
client/pages/customer/taskreminder/taskreminder.acss

@@ -112,13 +112,22 @@
   float: right;
   background-color:#fff6f4;
 }
+.tasks-item-red{
+  width: 122rpx;
+  height: 102rpx;
+  float: right;
+  border-top-right-radius: 12rpx;
+  border-bottom-right-radius: 12rpx;
+  background-color:#FAFAFA;
+  color: #FF5030
+}
 .tasks-item-yes{
   width: 122rpx;
   height: 102rpx;
   float: right;
   border-top-right-radius: 12rpx;
   border-bottom-right-radius: 12rpx;
-  background-color:#f2fbff;
+  background-color:#FAFAFA;
 }
 .tasks-list-item image{
   width: 35rpx;

+ 32 - 43
client/pages/customer/taskreminder/taskreminder.axml

@@ -36,60 +36,49 @@
         </view>
       </view>
       <!--任务列表-->
-      <view class="common-page-padding tasks-list">
-        <view class="cell-title">
-          <label>任务提醒</label>
-          <view class="tik-right">
-            <image mode="scaleToFill" src="/image/icon-edit.png"/>
-            <label>编辑每日任务</label>
+    <view class="common-page-padding tasks-list">
+      <view class="cell-title">
+        <label>任务提醒</label>
+        <!--<view class="tik-right"><image mode="scaleToFill" src="/image/icon-edit.png"/><label>编辑每日任务</label></view> -->
+      </view>
+      <!--有提醒任务-->
+      <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">
+            <text> 未完成</text>
           </view>
+          
         </view>
-        <!--有提醒任务-->
-        <view a:if="{{isreminds}}">
-          <view class="tasks-list-item">
-            <text>洗衣服</text>
-            <view class="tasks-item-yes">
-              <image mode="scaleToFill" src="/image/icon-yes.png"/>
-            </view>
-            <view class="tasks-item-no" onTap="showcancel">
-              <image mode="scaleToFill" src="/image/icon-no.png"/>
-            </view>
-          </view>
-          <view class="tasks-list-item">
-            <text>做完饭</text>
-            <view class="tasks-item-yes">
-              <image mode="scaleToFill" src="/image/icon-yes.png"/>
-            </view>
-            <view class="tasks-item-no" onTap="showcancel">
-              <image mode="scaleToFill" src="/image/icon-no.png"/>
-            </view>
-          </view>
-          <view class="tasks-list-item">
-            打扫卧室
-          </view>
-          <view class="tasks-list-item">
-            <text>打扫房间</text>
-            <label  class="nogood">任务不详细</label>
-            <view class="tasks-item-yes">
-              <image mode="scaleToFill" src="/image/icon-no.png"/>
-            </view>
+        <view class="tasks-list-item" a:if="{{item.state == 1}}">
+          <text> {{item.itemName}}</text>
+          <view class="tasks-item-yes">
+            <text> 已完成</text>
           </view>
         </view>
-        <!--没有任务-->
-        <view  a:if="{{!isreminds}}">
-          <view class="notasks">
-            <text>还没有任务</text>
+        <view class="tasks-list-item" a:if="{{item.state == 2}}">
+          <text>{{item.itemName}}</text>
+          <label class="nogood" a:if="{{item.incompleteReason == 1}}">任务太多</label>
+          <label class="nogood" a:if="{{item.incompleteReason == 2}}">我不会</label>
+          <label class="nogood" a:if="{{item.incompleteReason == 3}}">任务不详细</label>
+          <view class="tasks-item-red">
+            <text> 未完成</text>
           </view>
         </view>
       </view>
+    </view>
+    <!--没有任务-->
+    <view a:if="{{!isreminds}}">
+      <view class="notasks">
+        <text>还没有任务</text>
+      </view>
+    </view>
       <!---没有任务花销计算不显示-->
       <view a:if="{{isreminds}}" class="tast-moneybox">
         <view class="tasks-list-money">
           <view class="tasks-list-pay">今日花销合计</view>
-          <view class="tasks-list-pay-right"><input placeholder="请输入"/><text>元</text></view>
-        </view>
-         <view class="tasks-set">
-          <button type="primary"  hover-class="active-button"  onTap="createServant">提交</button>
+          <text> {{item.itemName}}</text>
+          <text> {{item.itemName}}</text>
         </view>
       </view>
     </view>

+ 33 - 0
client/pages/customer/taskreminder/taskreminder.js

@@ -1,4 +1,6 @@
 var util = require('../../../util/util.js')
+import apiUrl1 from '../../../util/apiUrl1'
+import request from '../../../util/http'
 var app = getApp();
 Page({
   data: {
@@ -12,6 +14,7 @@ Page({
     servantName: '',//保姆姓名
     weekday: '',//日前
     servantTypeValue: '',//保姆工种,
+    taskList: [],
   },
   onLoad() {
     //加载选中的时间
@@ -37,6 +40,8 @@ Page({
       servantTypeValue: app.globalData.relationInfo.servantType
     });
     //处理时间完成
+
+    this.selectDayTaskItem()
   },
   showcancel(){
     this.setData({
@@ -97,4 +102,32 @@ Page({
   handleSelect(e) {
       console.log(e[0]);
   },
+
+// 查询保姆每日任务
+  selectDayTaskItem() {
+    let params = {
+      "employRelationNo": app.globalData.employRelationNo,
+      "date": this.data.nowselectTime
+    }
+    request.httpServiceGet(apiUrl1.selectDayTaskItemPath, params).then(data => {
+      console.log("今日任务=" + data);
+      // 未设置任务
+      if (data.length == 0) {
+        this.setData({
+          isreminds: false,
+        });
+      } else {
+        // 今天有任务
+        this.setData({
+          taskList: data,
+        });
+      }
+    }
+
+    ).catch(e => {
+      console.log(e);
+
+    })
+  },
+
 });