Browse Source

保姆端任务中心-是否设置接口联调

una 4 năm trước cách đây
mục cha
commit
4bec134fc5

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

@@ -61,7 +61,7 @@
       <view class="module-text">
       <view class="module-title">
       服务标准
-      <text class="no-service-prefer">未设置</text>
+      <text class="no-service-prefer"   a:if="{{noSetSerStan}}">未设置</text>
       </view>
       <view class="module-detail">标准化服务 更贴心</view>
       </view>
@@ -71,7 +71,7 @@
       <view class="module-text">
       <view class="module-title">
       服务偏好
-      <text class="no-service-standard">未设置</text>
+      <text class="no-service-standard" a:if="{{noSetSerHobby}}">未设置</text>
       </view>
       <view class="module-detail">标准化服务 更贴心</view>
       </view>

+ 99 - 2
client/pages/servant/servantCenter/servantCenter.js

@@ -11,7 +11,9 @@ Page({
     taskList:['洗衣服','做晚饭','打扫卫生'],
     noticeShow:true,//通知栏展示
       editModalShow:false,//编辑弹框
-      unSetModal:true,//未设置偏好
+      unSetModal:false,//未设置偏好
+      noSetSerHobby:false,//展示未设置服务偏好
+      noSetSerStan:false,//展示未设置服务标准
        unSetBtn: [
       { text: '现在设置', extClass: 'buttonBold' },
       { text: '暂不' },
@@ -31,6 +33,9 @@ Page({
     //  存储此次进入任务中心的关联码
     app.globalData.employRelationNo=emReNo;
     this.initCustomerInfo();
+    this.isChooseSerHobSubject();
+    this.isChooseSerStanSubject();
+    this.selectTodayTaskItem();
   },
   onShow(query){
     console.log(query);
@@ -55,6 +60,91 @@ Page({
            
         })
   },
+  // 是否设置服务偏好
+    isChooseSerHobSubject(){
+     let params={
+        "employRelationNo":app.globalData.employRelationNo
+    }
+     request.httpServiceGet(apiUrl.isChooseSerHobSubjectPath,params).then(data=>{
+        console.log(data);
+        
+
+        let noSetSerHobby=(data=='0'?true:false);
+          this.setData({
+         noSetSerHobby:noSetSerHobby,
+         unSetModal:noSetSerHobby,
+       });
+    
+          }).catch(e=>{
+           console.log(e);
+           
+        })
+  },
+
+    // 是否设置服务标准
+    isChooseSerStanSubject(){
+     let params={
+        "employRelationNo":app.globalData.employRelationNo
+    }
+     request.httpServiceGet(apiUrl.isChooseSerStanSubjectPath,params).then(data=>{
+        console.log(data);
+        
+
+        let noSetSerStan=(data=='0'?true:false);
+          this.setData({
+         noSetSerStan:noSetSerStan,
+       });
+    
+          }).catch(e=>{
+           console.log(e);
+           
+        })
+  },
+
+ // 是否每日任务,每日任务前三条
+    selectTodayTaskItem(){
+     let params={
+        "employRelationNo":app.globalData.employRelationNo
+    }
+     request.httpServiceGet(apiUrl.selectTodayTaskItemPath,params).then(data=>{
+        console.log(data);
+        // 未设置任务
+        if(!data.isSet){
+            this.setData({
+         noAddTaskShow:true,
+         noTaskShow:false,
+         taskListShow:false,
+       });
+        }else{
+            // 今天是休息日
+            if(data.servantTasks.length==0){
+                this.setData({
+         noAddTaskShow:false,
+         noTaskShow:true,
+         taskListShow:false,
+         taskList:data.servantTasks
+       });
+            }else{
+              // 今天有任务
+                this.setData({
+         noAddTaskShow:false,
+         noTaskShow:false,
+         taskListShow:true,
+         });
+            }
+        }
+
+        let noSetSerStan=(data=='0'?true:false);
+          this.setData({
+         noSetSerStan:noSetSerStan,
+       });
+    
+          }).catch(e=>{
+           console.log(e);
+           
+        })
+  },
+
 
   switchList(){
     my.navigateTo({
@@ -147,9 +237,16 @@ Page({
   },
   switchSerHobby(){
       // 跳转到服务偏好页面
-   my.navigateTo({
+      if(this.data.noSetSerHobby){
+ my.navigateTo({
       url: '../servantsettings/servantsettings'
     });
+      }else{
+         my.navigateTo({
+      url: '../servantlist/servantlist'
+    });
+      }
+  
   }
  
 });

+ 17 - 1
client/util/apiUrl.js

@@ -19,6 +19,19 @@ const relationEmployerPath=baseService+'/servantRelation/relationEmployer';
 const updateEmployerNamePath=baseService+'/servantRelation/updateEmployerName';
 //  servantRelation/getRelationInfo   获取雇佣关系详情(传雇佣关系编号)
 const getRelationInfoPath=baseService+'/servantRelation/getRelationInfo';
+// GET /servantlove/isChooseSubject  判断是否有阿姨偏好
+const isChooseSerHobSubjectPath=baseService+'/servantlove/isChooseSubject';
+
+// GET /servicestandard/isChooseSubject  判断是否有设置标准
+const isChooseSerStanSubjectPath=baseService+'/servicestandard/isChooseSubject';
+
+//GET /servantTask/selectTodayTaskItem  查询保姆当日任务前三条
+const selectTodayTaskItemPath=baseService+'/servantTask/selectTodayTaskItem';
+
+
+
+
+
 
 export default{
 registerUserPath,
@@ -28,5 +41,8 @@ findByServantIdListPath,
 createServantRelationPath,
 relationEmployerPath,
 updateEmployerNamePath,
-getRelationInfoPath
+getRelationInfoPath,
+isChooseSerHobSubjectPath,
+isChooseSerStanSubjectPath,
+selectTodayTaskItemPath
 }