2 Коммиты eb98c2b28d ... 0b4a93e23f

Автор SHA1 Сообщение Дата
  gaoyognxing 0b4a93e23f 提交 4 лет назад
  gaoyognxing 50a3c73b9f 提交每日任务 4 лет назад

+ 6 - 40
client/pages/customer/dailytasks/dailytasks.axml

@@ -1,44 +1,10 @@
 <view class="common-page-padding daily-servant-page">
-<!---洗护类--->
-  <view class="common-card dailyitem">
-    <view class="cell-title">洗护类</view>
-    <view class="daily-list">
-      <view a:for="{{washingandnursing}}" class="daily-item {{washingandnursinglist.indexOf(item.id)!=-1 ?'daily-item-selected':''}}" key="{{index}}" data-id="{{item.id}}"  onTap="toggleWashinGandnursing">{{item.text}}</view>
-    </view>
-  </view>
-<!---做饭类--->
-  <view class="common-card dailyitem">
-    <view class="cell-title">做饭类</view>
-    <view class="daily-list">
-      <view a:for="{{cooking}}" class="daily-item {{cookinglist.indexOf(item.id)!=-1 ?'daily-item-selected':''}}" key="{{index}}" data-id="{{item.id}}">{{item.text}}</view>
-    </view>
-  </view>
-<!---打扫类--->
-  <view class="common-card dailyitem">
-    <view class="cell-title">打扫类</view>
-    <view class="daily-list">
-      <view a:for="{{cleaningclass}}" class="daily-item {{cleaningclasslist.indexOf(item.id)!=-1 ?'daily-item-selected':''}}" key="{{index}}" data-id="{{item.id}}">{{item.text}}</view>
-    </view>
-  </view>
-<!---照顾老人--->
-  <view class="common-card dailyitem">
-    <view class="cell-title">照顾老人</view>
-    <view class="daily-list">
-      <view a:for="{{careolder}}" class="daily-item {{careolderlist.indexOf(item.id)!=-1 ?'daily-item-selected':''}}" key="{{index}}" data-id="{{item.id}}">{{item.text}}</view>
-    </view>
-  </view>
-<!---孩子--->
-  <view class="common-card dailyitem">
-    <view class="cell-title">孩子</view>
-    <view class="daily-list">
-      <view a:for="{{children}}" class="daily-item {{childrenlist.indexOf(item.id)!=-1 ?'daily-item-selected':''}}" key="{{index}}" data-id="{{item.id}}">{{item.text}}</view>
-    </view>
-  </view>
-<!--宠物--->
-  <view class="common-card dailyitem">
-    <view class="cell-title">宠物</view>
-    <view class="daily-list">
-      <view a:for="{{pets}}" class="daily-item {{petslist.indexOf(item.id)!=-1 ?'daily-item-selected':''}}" key="{{index}}" data-id="{{item.id}}">{{item.text}}</view>
+  <view a:for="{{allList}}" key="{{index}}"
+    <view class="common-card dailyitem">
+      <view class="cell-title">{{item.categoryName}}</view>
+      <view class="daily-list">
+        <view a:for="{{item.TaskItems}}" class="daily-item {{item.TaskItems.indexOf(item.id)!=-1 ?'daily-item-selected':''}}" key="{{index}}" data-id="{{item.id}}"  onTap="toggleWashinGandnursing">{{item.itemName}}</view>
+      </view>
     </view>
   </view>
   <view class="dailyitem-buttom"></view>

+ 32 - 12
client/pages/customer/dailytasks/dailytasks.js

@@ -1,21 +1,41 @@
+import request from '../../../util/http'
+import apiUrl from '../../../util/apiUrl'
+var app = getApp();
 Page({
   data: {
-    washingandnursing: [{text:'洗衣服',id:'1',},{text:'熨烫衣服',id:'2',},{text:'晾晒收衣',id:'3',}],
-    cooking: [{text:'做早餐',id:'1'},{text:'做午餐',id:'2'},{text:'做晚餐',id:'3'}],
-    cleaningclass: [{text:'打扫全屋',id:'1'},{text:'打扫客厅',id:'2'},{text:'打扫卧室',id:'3'},{text:'打扫书房',id:'4'},{text:'打扫厨房',id:'5'},{text:'打扫卫生间',id:'6'},{text:'打扫院子',id:'7'}],
-    careolder:[{text:'照顾老人',id:'1'},{text:'为老人做饭',id:'2'},{text:'为老人做擦洗服务',id:'3'}],
-    children:[{text:'打扫全屋',id:'1'},{text:'打扫客厅',id:'2'},{text:'打扫卧室',id:'3'},{text:'打扫书房',id:'4'},{text:'打扫厨房',id:'5'},{text:'打扫卫生间',id:'6'},{text:'打扫院子',id:'7'}],
-    pets:[{text:'打扫全屋',id:'1'},{text:'打扫客厅',id:'2'},{text:'打扫卧室',id:'3'},{text:'打扫书房',id:'4'},{text:'打扫厨房',id:'5'},{text:'打扫卫生间',id:'6'},{text:'打扫院子',id:'7'}],
-    washingandnursinglist:[],
-    cookinglist:[],
-    cleaningclasslist:[],
-    careolderlist:[],
-    childrenlist:[],
-    petslist:[]
+    allList:[]
   },
   onLoad(options) {
     console.log(options);
   },
+  onShow(){
+    this.initDailyTaskList();
+  },
+  initDailyTaskList(){
+    let params={
+    }
+     request.httpServiceGet(apiUrl.getDailyTaskList,params).then(data=>{
+        console.log(data);
+        if(data.length>0){
+            this.setData({
+              allList:data
+            });
+        }else{
+          this.setData({
+              allList:[]
+            });
+    //           my.alert({
+    //    content:JSON.stringify(data.dataList)
+    //  });  
+        }
+
+
+          }).catch(e=>{
+           console.log(e);
+           
+        })
+
+  },
   toggleWashinGandnursing(e){
     
     let id=e.target.dataset.id;

+ 6 - 0
client/util/apiUrl.js

@@ -27,6 +27,10 @@ const isChooseSerStanSubjectPath=baseService+'/servicestandard/isChooseSubject';
 
 //GET /servantTask/selectTodayTaskItem  查询保姆当日任务前三条
 const selectTodayTaskItemPath=baseService+'/servantTask/selectTodayTaskItem';
+//查询每日任务
+const getDailyTaskList = baseService + "/taskItem/selectDayTaskItem";
+//完成编辑任务
+const completeEditDailyTask = baseService + "/taskItem/createDayTaskItem";
 
 //GET  /notice/isSetServiceAndTask  雇主端通知:是否设置服务标准--->是否设置任务提醒
 const isSetServiceAndTaskPath=baseService+'/notice/isSetServiceAndTask';
@@ -47,6 +51,8 @@ getRelationInfoPath,
 isChooseSerHobSubjectPath,
 isChooseSerStanSubjectPath,
 selectTodayTaskItemPath,
+getDailyTaskList,
+completeEditDailyTask,
 isSetServiceAndTaskPath,
 updateEmploySetStatePath
 }