Przeglądaj źródła

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

wangpeng 4 lat temu
rodzic
commit
21f329ed79

+ 10 - 10
client/pages/common/index/index.js

@@ -25,15 +25,15 @@ Page({
       // 没有用户信息获取授权
        this.authInit();
     }else{
-        
-     let id= storageRes.data.id;
-     if(id!=undefined&&id!=''){
- // 有用户信息更新用户信息
-      let params={'userId':id};
-      this.getUserInfo(params);
-     }else{
-       this.authInit();
-     }
+         this.getUserInfo();
+//      let id= storageRes.data.id;
+//      if(id!=undefined&&id!=''){
+//  // 有用户信息更新用户信息
+//       let params={'userId':id};
+//       this.getUserInfo(params);
+//      }else{
+//        this.authInit();
+//      }
      
     }
       
@@ -165,7 +165,7 @@ Page({
         console.log(data);
         //  授权用户信息后将用户信息存到本地存储和globalData
        let userInfo=data
-           app.globalData.userInfo=data;
+        app.globalData.userInfo=data;
        my.setStorageSync({
          key:"userInfo",
          data:data

+ 3 - 3
client/pages/customer/customerCenter/customerCenter.axml

@@ -23,7 +23,7 @@
               <text class="copy-btn" onTap="copyCode">复制</text>
               </view>
           </view>
-          <view class="about-right" onTap="switchSerHobby">阿姨偏好</view>
+          <view class="about-right" onTap="switchSerHobby">保姆偏好</view>
        </view>
  </view>
  <!-- 通知  月报更新 bmybgx-->
@@ -42,7 +42,7 @@
  </view>
   <!-- 通知  偏好设置phsz-->
  <view class="notice-bar" a:if="{{phszShow}}">
-     <view class="notice-main">[{{servantName}}]设置了她的偏好,<text class="link-view-text" data-noticeType="phsz"  onTap="viewSerHobby">点击查看>></text> </view>
+     <view class="notice-main">[{{servantName}}]设置了保姆偏好,<text class="link-view-text" data-noticeType="phsz"  onTap="viewSerHobby">点击查看>></text> </view>
      <view class="close-wrapper" onTap="closeNotice" data-noticeType="phsz">
       <image mode="aspectFill" src="/image/icon-close.png" class="notice-close" />
      </view>
@@ -50,7 +50,7 @@
 
  <!-- 通知  偏好更新phgx-->
  <view class="notice-bar" a:if="{{phgxShow}}">
-     <view class="notice-main">[{{servantName}}]更新了她的偏好,<text class="link-view-text"  data-noticeType="phgx"  onTap="viewSerHobby">点击查看>></text></view>
+     <view class="notice-main">[{{servantName}}]更新了保姆偏好,<text class="link-view-text"  data-noticeType="phgx"  onTap="viewSerHobby">点击查看>></text></view>
      <view class="close-wrapper" onTap="closeNotice" data-noticeType="phgx">
       <image mode="aspectFill" src="/image/icon-close.png" class="notice-close" />
      </view>

+ 35 - 7
client/pages/servant/servantCenter/servantCenter.axml

@@ -23,13 +23,41 @@
           <view class="about-right"></view>
        </view>
  </view>
- <!-- 通知 -->
- <view class="notice-bar" a:if="{{noticeShow}}">
-     <view class="notice-main">强提醒内容</view>
-     <view class="close-wrapper">
-      <image mode="aspectFill" src="/image/icon-close.png" class="notice-close" onTap="closeNotice"/>
+ <!-- 通知  月报更新 gzybgx-->
+ <view class="notice-bar" a:if="{{gzybgxShow}}">
+     <view class="notice-main">月报新鲜出炉,<text class="link-view-text" onTap="viewMonthReport" data-noticeType="gzybgx">点击查看</text>我的本月表现</view>
+     <view class="close-wrapper"  onTap="closeNotice"  data-noticeType="gzybgx">
+      <image mode="aspectFill" src="/image/icon-close.png" class="notice-close" />
+     </view>
+ </view>
+  <!-- 通知  任务设置rwsz-->
+ <view class="notice-bar" a:if="{{rwszShow}}">
+     <view class="notice-main">[{{customerName}}]设置了我的任务,<text class="link-view-text" onTap="viewTaskReminder"  data-noticeType="rwsz">点击查看>></text></view>
+     <view class="close-wrapper" onTap="closeNotice" data-noticeType="rwsz">
+      <image mode="aspectFill" src="/image/icon-close.png" class="notice-close" />
+     </view>
+ </view>
+  <!-- 通知  任务更新rwgx-->
+ <view class="notice-bar" a:if="{{rwgxShow}}">
+     <view class="notice-main">[{{customerName}}]更新了我的任务,<text class="link-view-text" onTap="viewTaskReminder"  data-noticeType="rwgx">点击查看>></text></view>
+     <view class="close-wrapper" onTap="closeNotice" data-noticeType="rwgx">
+      <image mode="aspectFill" src="/image/icon-close.png" class="notice-close" />
+     </view>
+ </view>
+  <!-- 通知  服务标准设置fwbzsz-->
+ <view class="notice-bar" a:if="{{fwbzszShow}}">
+     <view class="notice-main">[{{customerName}}]设置了服务标准,<text class="link-view-text" data-noticeType="fwbzsz"  onTap="viewSerStan">点击查看>></text> </view>
+     <view class="close-wrapper" onTap="closeNotice" data-noticeType="fwbzsz">
+      <image mode="aspectFill" src="/image/icon-close.png" class="notice-close" />
+     </view>
+ </view>
+
+ <!-- 通知  服务标准更新fwbzgx-->
+ <view class="notice-bar" a:if="{{fwbzgxShow}}">
+     <view class="notice-main">[{{customerName}}]更新了服务标准,<text class="link-view-text"  data-noticeType="fwbzgx"  onTap="viewSerStan">点击查看>></text></view>
+     <view class="close-wrapper" onTap="closeNotice" data-noticeType="fwbzgx">
+      <image mode="aspectFill" src="/image/icon-close.png" class="notice-close" />
      </view>
-     
  </view>
  <!-- 任务提醒 -->
   <view class="common-card task-module" onTap="switchTaskRemind">
@@ -45,7 +73,7 @@
      </view>
      <!-- 今天无任务 -->
      <view class="no-task" a:if="{{noTaskShow}}">
-     今日是信息日
+        今天是休息日
      </view>
      <!-- 任务列表 -->
      <view class="task-list" a:if="{{taskListShow}}">

+ 140 - 9
client/pages/servant/servantCenter/servantCenter.js

@@ -9,7 +9,11 @@ Page({
     noTaskShow:false,//今天无任务
     taskListShow:false,//任务列表
     taskList:[],
-    noticeShow:true,//通知栏展示
+    gzybgxShow:false,//通知栏展示
+    rwszShow:false,
+    rwgxShow:false,
+    fwbzszShow:false,
+    fwbzgxShow:false,
       editModalShow:false,//编辑弹框
       unSetModal:false,//未设置偏好
       noSetSerHobby:false,//展示未设置服务偏好
@@ -40,13 +44,20 @@ Page({
            });
   
 
+    // this.initCustomerInfo();
+    // this.isChooseSerHobSubject();
+    // this.isChooseSerStanSubject();
+    // this.selectTodayTaskItem();
+    //  this.getServantNotice();
+  },
+  onShow(query){
+    console.log(query);
+
     this.initCustomerInfo();
     this.isChooseSerHobSubject();
     this.isChooseSerStanSubject();
     this.selectTodayTaskItem();
-  },
-  onShow(query){
-    console.log(query);
+    this.getServantNotice();
   },
   // 获取雇佣关系详情
   initCustomerInfo(){
@@ -214,11 +225,6 @@ Page({
     });
  
   },
-  closeNotice(){
-    this.setData({
-      noticeShow:false
-    });
-  },
   switchTaskRemind(){
       // 跳转到任务提醒器页面
    my.navigateTo({
@@ -254,6 +260,131 @@ Page({
     });
       }
   
+  },
+
+  //  获取保姆通知
+  getServantNotice(){
+     let params={
+      employRelationNo:app.globalData.employRelationNo,
+      userId:app.globalData.userInfo.id
+    }
+      request.httpServicePost(apiUrl.getServantNoticePath,params).then(data=>{
+        console.log('保姆通知');
+         console.log(data);
+ 
+       let    gzybgx=(data.gzybgx.size>=1);
+       let    rwsz=(data.rwsz.size>=1);
+       let    rwgx=(data.rwgx.size>=1);
+       let    fwbzsz=(data.fwbzsz.size>=1);
+       let    fwbzgx=(data.fwbzgx.size>=1);
+       this.setData({
+    gzybgxShow:gzybgx,
+    rwszShow:rwsz,
+    rwgxShow:rwgx,
+    fwbzszShow:fwbzsz,
+    fwbzgxShow:fwbzgx,
+       });
+    
+          }).catch(e=>{
+           console.log(e);
+           
+        })
+  },
+  // 查看月报
+  async viewMonthReport(e){
+   try{
+       let  data=await this.readNotice(e);
+       if(data!=undefined){
+    // my.navigateTo({
+    //   url: '../monthReport/monthReport'
+    // });
+       }
+      }catch(e){
+         console.log(e);
+       }
+  },
+  // 查看任务
+  async viewTaskReminder(e){
+    try{
+       let  data=await this.readNotice(e);
+       if(data!=undefined){
+    my.navigateTo({
+      url: '../taskreminder/taskreminder'
+    });
+       }
+      }catch(e){
+         console.log(e);
+       }
+
+  },
+  // 查看服务标准
+  async viewSerStan(e){
+     console.log(e);
+     try{
+       let  data=await this.readNotice(e);
+       if(data!=undefined){
+    my.navigateTo({
+      url: '../servantdetail/servantdetail'
+    });
+       }
+      }catch(e){
+         console.log(e);
+       }
+  },
+  async readNotice(e){
+       let type=e.target.dataset.noticeType;
+      console.log(type);
+       let params={
+           "employRelationNo": app.globalData.employRelationNo,
+           "noticeType": type,
+          "userId": app.globalData.userInfo.id
+     
+    }
+    try{
+    let data=await request.httpServicePost(apiUrl.userReadNoticePath,params);
+    return data;
+    }catch(e){
+           console.log(e);
+   }
+    
+  },
+  async closeNotice(e){
+    console.log('关闭通知');
+      try{
+       let  data=await this.readNotice(e);
+       console.log(data);
+       if(data!=undefined){
+        //  通知不展示
+       let type=e.target.dataset.noticeType;
+       console.log(type);
+       if(type=='bmybgx'){
+            this.setData({
+          bmybgxShow:false
+    })
+       }else if(type=='rwwfwc'){
+  this.setData({
+          rwwfwcShow:false
+    })
+       }else if(type=='phsz'){
+  this.setData({
+          phszShow:false
+    })
+       }else if(type=='phgx'){
+  this.setData({
+          phgxShow:false
+    })
+       }
+        
+  
+       }
+      }catch(e){
+         console.log(e);
+       }
+
   }
+
+
+
+
  
 });