Browse Source

Merge branch 'master' of http://47.102.110.240:3000/yuxiangpei/tbServantMini_cloud

una 4 years ago
parent
commit
9980ca8886

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

@@ -3,116 +3,6 @@ import apiUrl from '../../../util/apiUrl'
 var app = getApp();
 Page({
   data: {
-    /**
-     * [
-      {
-        "categoryName": "洗护类",
-        "TaskItems": [
-          {
-            "id": 1,
-            "itemName": "洗衣服",
-            "categoryId": 1,
-            "disabled": true,
-            "createTime": "2020-09-28 11:38:26",
-            "updateTime": "2020-09-28 11:38:26"
-          },
-          {
-            "id": 2,
-            "itemName": "熨烫衣服",
-            "categoryId": 1,
-            "disabled": true,
-            "createTime": "2020-09-28 11:38:44",
-            "updateTime": "2020-09-28 11:38:44"
-          },
-          {
-            "id": 3,
-            "itemName": "晾晒收衣",
-            "categoryId": 1,
-            "disabled": true,
-            "createTime": "2020-09-28 11:39:06",
-            "updateTime": "2020-09-28 11:39:06"
-          },
-          {
-            "id": 4,
-            "itemName": "做早餐",
-            "categoryId": 2,
-            "disabled": true,
-            "createTime": "2020-09-28 11:39:43",
-            "updateTime": "2020-09-28 11:39:43"
-          },
-          {
-            "id": 5,
-            "itemName": "做午餐",
-            "categoryId": 2,
-            "disabled": true,
-            "createTime": "2020-09-28 11:39:58",
-            "updateTime": "2020-09-28 11:39:58"
-          },
-          {
-            "id": 6,
-            "itemName": "做晚餐",
-            "categoryId": 2,
-            "disabled": true,
-            "createTime": "2020-09-28 11:40:18",
-            "updateTime": "2020-09-28 11:40:18"
-          }
-        ]
-      },
-      {
-        "categoryName": "做饭类",
-        "TaskItems": [
-          {
-            "id": 1,
-            "itemName": "洗衣服",
-            "categoryId": 1,
-            "disabled": true,
-            "createTime": "2020-09-28 11:38:26",
-            "updateTime": "2020-09-28 11:38:26"
-          },
-          {
-            "id": 2,
-            "itemName": "熨烫衣服",
-            "categoryId": 1,
-            "disabled": true,
-            "createTime": "2020-09-28 11:38:44",
-            "updateTime": "2020-09-28 11:38:44"
-          },
-          {
-            "id": 3,
-            "itemName": "晾晒收衣",
-            "categoryId": 1,
-            "disabled": true,
-            "createTime": "2020-09-28 11:39:06",
-            "updateTime": "2020-09-28 11:39:06"
-          },
-          {
-            "id": 4,
-            "itemName": "做早餐",
-            "categoryId": 2,
-            "disabled": true,
-            "createTime": "2020-09-28 11:39:43",
-            "updateTime": "2020-09-28 11:39:43"
-          },
-          {
-            "id": 5,
-            "itemName": "做午餐",
-            "categoryId": 2,
-            "disabled": true,
-            "createTime": "2020-09-28 11:39:58",
-            "updateTime": "2020-09-28 11:39:58"
-          },
-          {
-            "id": 6,
-            "itemName": "做晚餐",
-            "categoryId": 2,
-            "disabled": true,
-            "createTime": "2020-09-28 11:40:18",
-            "updateTime": "2020-09-28 11:40:18"
-          }
-        ]
-      }
-    ]
-     */
     allList: []
   },
   onLoad(options) {
@@ -152,39 +42,39 @@ Page({
     let currentIndex= e.target.dataset.index;
     console.log('index=' + currentIndex);
     // console.log(id.currentIndex);
-    // let id=e.target.dataset.id;
-    // let isNew=this.data.allList[currentIndex].every(item=>{return id!=item.id});
-    // if(isNew){
-    //    let newArr=this.data.allList[currentIndex];
-    //    let obj={
-    //      index:id,
-    //    }
-    //   newArr.push(obj);
-    //    let newArrClass=this.data.allList[currentIndex];
-    //   newArrClass.push(id);
-    //   this.setData({
-    //     workSelectedList:newArr,
-    //     workSelectedClassList:newArrClass
-    //   })
-    // }else{
-    //   let spliceIndex='';
-    //    this.data.workSelectedList.forEach((item,index)=> {
-    //      if(item.index==id){
-    //        console.log(item,index);
-    //        spliceIndex=index;
-    //        return;
+     let id=e.target.dataset.id;
+     let isNew=this.data.allList[currentIndex].every(item=>{return id!=item.id});
+     if(isNew){
+        let newArr=this.data.allList[currentIndex];
+        let obj={
+          index:id,
+        }
+       newArr.push(obj);
+        let newArrClass=this.data.allList[currentIndex];
+      newArrClass.push(id);
+       this.setData({
+         workSelectedList:newArr,
+         workSelectedClassList:newArrClass
+      })
+     }else{
+       let spliceIndex='';
+        this.data.workSelectedList.forEach((item,index)=> {
+          if(item.index==id){
+            console.log(item,index);
+            spliceIndex=index;
+            return;
 
-    //      }
-    //    })
-    //   let newArr=this.data.workSelectedList;
-    //    let newArrClass=this.data.workSelectedClassList;
-    //    newArr.splice(spliceIndex,1);
-    //   newArrClass.splice(newArrClass.indexOf(id),1);
-    //   this.setData({
-    //      workSelectedList:newArr,
-    //     workSelectedClassList:newArrClass
-    //   })
-    // }
+          }
+        })
+       let newArr=this.data.workSelectedList;
+      let newArrClass=this.data.workSelectedClassList;
+        newArr.splice(spliceIndex,1);
+       newArrClass.splice(newArrClass.indexOf(id),1);
+       this.setData({
+          workSelectedList:newArr,
+        workSelectedClassList:newArrClass
+       })
+     }
   },
   dailytasksdeit() {
     /**

+ 1 - 1
client/pages/servant/servantsettings/servantsettings.axml

@@ -14,7 +14,7 @@
       <view  a:if="{{subjectitem.isChoose}}">
         <text class="item-title">{{subjectitem.subject}}</text>
         <view class="item-body" a:for="{{subjectitem.answer}}" a:for-item="answeritem" key="{{answerindex}}">
-          <checkbox value="{{answeritem.value}}" checked="true" class="item-body-checkbox"/><text>{{answeritem.key}}</text>
+          <checkbox value="{{answeritem.answer}}" checked="{{answeritem.isChoose}}" class="item-body-checkbox"/><text>{{answeritem.answer}}</text>
         </view>
       </view>
       <view class="item-body">

+ 8 - 0
client/pages/servant/servantsettings/servantsettings.js

@@ -19,4 +19,12 @@ Page({
         });
       });
   },
+  dailytasksdeit(){
+      request.httpServicePost(apiUrl.insertNewservantappletservicePath,{servantlist:this.servantlist}).then(data=>{
+        console.log(data);
+        this.setData({
+          servantlist: data
+        });
+      });
+  },
 });

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

@@ -18,7 +18,7 @@
         <label>周日</label>
       </view>
         <view class="cell-type">
-          保工种:<label>钟点工</label>
+          保工种:<label>钟点工</label>
         </view>
       </view>
       <!---一周任务查看器-->

+ 4 - 2
client/util/apiUrl1.js

@@ -1,8 +1,10 @@
 let baseService='/servantappletservice';
-// 授权后注册
+// 新设置题目时获取题目
 const servantappletservicePath = baseService+'/servantlove/getSubjectWhenFirst';
-
+//新设置服务标准
+const insertNewservantappletservicePath = baseService+'/servicestandard/insertNewServiceStandards';
 
 export default{
 servantappletservicePath,
+insertNewservantappletservicePath,
 }

+ 6 - 3
mini.project.json

@@ -1,5 +1,8 @@
 {
-  "cloud": {
-    "type": "CLOUDAPP"
-  }
+    "cloud": {
+        "type": "CLOUDAPP"
+    },
+    "exclude": [
+        "server/**"
+    ]
 }