Prechádzať zdrojové kódy

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

WFADLMOXAOK6T5N\Administrator 4 rokov pred
rodič
commit
cb4ea2108a

+ 4 - 2
client/pages/customer/customerCenter/customerCenter.acss

@@ -178,10 +178,12 @@ padding:16rpx;
   font-weight: normal;
 }
 .report-tips{
-  color:#09AFFF;
+  /* color:#09AFFF;
+  background: #E6F7FF; */
+  color:#FF5030;
+  background: #FFEDEA;
   font-size: 20rpx;
   border-radius:4rpx;
-  background: #E6F7FF;
   padding:2rpx 8rpx;
   margin-left:6rpx;
   font-weight: normal;

+ 3 - 13
client/pages/customer/myServantList/myServantList.axml

@@ -3,10 +3,10 @@
   <view a:if="{{listShow}}"> 
   
    <view class="customer-list">
-     <view class="customer-item common-card" a:for="{{customerList}}" key="{{index}}">
+     <view class="customer-item common-card" a:for="{{servantList}}" key="{{index}}">
         <view class="main-info">
         <text class="customer-name">{{item.name}}</text>
-        <text class="link-text" data-id="{{index}}" onTap="editCustomer" >编辑信息</text>
+        <text class="link-text" data-id="{{index}}" onTap="editServant" >编辑信息</text>
         </view>
         <view class="work-day"> 
           {{item.workDay}}
@@ -27,16 +27,6 @@
   <view class="common-button-wrapper">
      <button type="primary" class="common-button" hover-class="active-button" onTap="addServant">添加保姆</button>
   </view>
- <modal
-		show="{{editModalShow}}"
-    showClose="{{false}}"
-    onButtonClick="onModalClose"
-    buttons="{{buttonFooter}}"
-	>
-		<view slot="header">编辑客户姓名</view>
-		 <input class="input" maxlength="10" placeholder="请输入客户姓名" onInput="bindKeyInput" />
-   
-	</modal>
 
   </view>
 
@@ -60,7 +50,7 @@
     buttons="{{unSetBtn}}"
 	>
 		<view slot="header">您尚未设置服务者</view>
-		先设置服务者吧
+		先设置服务者吧
 	</modal>
 
 

+ 9 - 28
client/pages/customer/myServantList/myServantList.js

@@ -1,26 +1,24 @@
 Page({
   data: {
-    listShow:false,
-    editModalShow:false,//编辑弹框
+    listShow:true,
     unSetModal:true,//未设置服务者提醒
       unSetBtn: [
       { text: '设置', extClass: 'buttonBold' },
       { text: '暂不' },
     ],
-    customerName:'',//客户姓名输入
     buttonFooter:[
       { text: '取消' },
       { text: '确定', extClass: 'buttonBold' },
     ],
-    customerList:[
+    servantList:[
       {
-        name:'王客户',
+        name:'王阿姨',
         workDay:'周一、周二、周三、周四、周五、周六',
         serviceModel:'钟点工',
         bindDate:'2020-09-19'
     },
    {
-        name:'张客户',
+        name:'张阿姨',
         workDay:'周一、周二、周三、周四、周五、周六',
         serviceModel:'钟点工',
         bindDate:'2020-09-25'
@@ -30,34 +28,17 @@ Page({
   onLoad() {
 
   },
-  editCustomer(event){
+  editServant(event){
     console.log(event);
-    this.setData({
-      editModalShow:true,
-    });
-  },
-  onModalClose(e){
-    console.log(e.target);
-    if(e.target.dataset.index==0){
-     this.setData({
-      editModalShow: false,
-    });
-    }else{
-      // 保存客户姓名
-    }
-     
-  },
-   bindKeyInput(e) {
-    this.setData({
-      customerName: e.detail.value,
-    });
-  console.log(this.data.customerName);
+     my.navigateTo({ url: '../editServant/editServant' });
   },
+  
+  
  addServant(){
     my.navigateTo({ url: '../createServant/createServant' });
  },
   enterServantCenter(){
-    //  my.navigateTo({ url: '../servantCenter/servantCenter' });
+     my.navigateTo({ url: '../customerCenter/customerCenter' });
   },
   // 点击设置按钮
   onSetButtonClick(e){

+ 34 - 0
client/pages/servant/myCustomerList/myCustomerList.acss

@@ -28,4 +28,38 @@
   flex-direction: row;
   justify-content: space-between;
   align-items: center;
+}
+/* 暂无内容 */
+.no-content-wrapper{
+  padding:290rpx 0 18rpx;
+  text-align: center;
+}
+.no-content-wrapper image{
+ width:360rpx;
+ height: 310rpx;
+}
+.no-add{
+  font-weight: bold;
+  font-size: 32rpx;
+  text-align: center;
+  margin-bottom: 24rpx;
+}
+.no-add-tips{
+  font-size: 24rpx;
+  color:#999;
+  margin-bottom:74rpx;
+  text-align: center;
+}
+.switch-role{
+  margin-top:30rpx;
+  color:#09AFFF;
+  text-align: center;
+}
+.bind-input-wrapper{
+  display: flex;
+  flex-direction: column;
+  align-items: flex-start;
+}
+.bind-input-wrapper .input{
+  text-align: left;
 }

+ 32 - 4
client/pages/servant/myCustomerList/myCustomerList.axml

@@ -32,8 +32,8 @@
     onButtonClick="onModalClose"
     buttons="{{buttonFooter}}"
 	>
-		<view slot="header">编辑客户姓名</view>
-		 <input class="input" maxlength="10" placeholder="请输入客户姓名" onInput="bindKeyInput" />
+		<view slot="header">编辑雇主信息</view>
+		 <input class="input" maxlength="10" placeholder="请输入雇主称呼" onInput="bindKeyInput"  value="{{customerName}}"/>
    
 	</modal>
  
@@ -47,9 +47,37 @@
       <view class="no-add">您还未关联客户</view>
       <view class="no-add-tips">关联客户,沟通更轻松</view>
       <view class="mini-button-wrapper">
-<button type="primary" class="common-button" hover-class="active-button"  size="mini">现在关联</button>
+<button type="primary" class="common-button" hover-class="active-button"  size="mini" onTap="bindNow">现在关联</button>
       </view>
-      <view class="switch-role">角色选择错啦,去切换 >> </view>
+      <view class="switch-role"  onTap="switchRole">角色选择错啦,去切换 >> </view>
+<modal
+		show="{{unSetModal}}"
+    showClose="{{false}}"
+    onButtonClick="onSetButtonClick"
+    buttonsLayout="vertical"
+    buttons="{{unSetBtn}}"
+	>
+		<view slot="header">您尚未关联雇主</view>
+		请先向雇主索要关联码哦
+	</modal>
+
+<!-- 关联雇主 -->
+   <modal
+		show="{{bindModalShow}}"
+    showClose="{{false}}"
+    onButtonClick="onBindModalClose"
+    buttons="{{buttonFooter}}"
+	>
+		<view slot="header">关联雇主</view>
+    <view class="bind-input-wrapper">
+      <input class="input" maxlength="9" placeholder="请输入关联码" onInput="bindCodeInput" value="{{bindCode}}" type="number"/>
+     <input class="input" maxlength="10" placeholder="请输入雇主称呼" onInput="bindNameInput"  value="{{bindName}}" />
+   
+    </view>
+		
+	</modal>
+
+
 
   </view>
 </view>

+ 56 - 2
client/pages/servant/myCustomerList/myCustomerList.js

@@ -1,12 +1,20 @@
 Page({
   data: {
-     listShow:true,
+     listShow:false,//是否有多个客户
+      unSetModal:true,//未设置服务者提醒
+      unSetBtn: [
+      { text: '现在关联', extClass: 'buttonBold' },
+      { text: '暂不' },
+    ],
     editModalShow:false,//编辑弹框
-    customerName:'',//客户姓名输入
+    customerName:'',//编辑客户姓名输入
     buttonFooter:[
       { text: '取消' },
       { text: '确定', extClass: 'buttonBold' },
     ],
+    bindModalShow:false,//关联雇主弹框
+    bindCode:'',
+    bindName:'',
     customerList:[
       {
         name:'王客户',
@@ -48,7 +56,53 @@ Page({
     });
   console.log(this.data.customerName);
   },
+   bindCodeInput(e) {
+    this.setData({
+      bindCode: e.detail.value,
+    });
+  console.log(this.data.bindCode);
+  },
+   bindNameInput(e) {
+    this.setData({
+      bindName: e.detail.value,
+    });
+  },
+   onBindModalClose(e){
+    console.log(e.target);
+    if(e.target.dataset.index==0){
+     this.setData({
+      bindModalShow: false,
+    });
+    }else{
+      // 关联雇主
+    }
+     
+  },
+  bindNow(){
+this.setData({
+      bindModalShow: true,
+    });
+  },
   enterServantCenter(){
      my.navigateTo({ url: '../servantCenter/servantCenter' });
+  },
+   // 点击设置按钮
+  onSetButtonClick(e){
+    console.log(e.target);
+    if(e.target.dataset.index==0){
+       this.setData({
+      unSetModal: false,
+      bindModalShow:true,
+    });
+  
+    }else{
+      this.setData({
+      unSetModal: false,
+    });
+    }
+  },
+   // 切换角色
+  switchRole(){
+     my.navigateTo({ url: '../../common/selectRole/selectRole' });
   }
 });

+ 13 - 2
client/pages/servant/servantCenter/servantCenter.acss

@@ -168,6 +168,15 @@ padding:16rpx;
   font-size: 20rpx;
   margin-top:8rpx;
 }
+.no-service-prefer{
+   color:#fff;
+   background: #ccc;
+  font-size: 20rpx;
+  border-radius:4rpx;
+  padding:2rpx 8rpx;
+  margin-left:6rpx;
+  font-weight: normal;
+}
 .no-service-standard{
   color:#FF5030;
   font-size: 20rpx;
@@ -178,10 +187,12 @@ padding:16rpx;
   font-weight: normal;
 }
 .report-tips{
-  color:#09AFFF;
+  /* color:#09AFFF;
+  background: #E6F7FF; */
+   color:#FF5030;
+   background: #FFEDEA;
   font-size: 20rpx;
   border-radius:4rpx;
-  background: #E6F7FF;
   padding:2rpx 8rpx;
   margin-left:6rpx;
   font-weight: normal;

+ 23 - 0
client/pages/servant/servantCenter/servantCenter.axml

@@ -60,6 +60,16 @@
       <view class="module-text">
       <view class="module-title">
       服务标准
+      <text class="no-service-prefer">未设置</text>
+      </view>
+      <view class="module-detail">标准化服务 更贴心</view>
+      </view>
+   </view>
+     <!-- 服务偏好 -->
+   <view class="common-card module-card">
+      <view class="module-text">
+      <view class="module-title">
+      服务偏好
       <text class="no-service-standard">未设置</text>
       </view>
       <view class="module-detail">标准化服务 更贴心</view>
@@ -86,5 +96,18 @@
 		 <input class="input" maxlength="10" placeholder="请输入客户姓名" onInput="bindKeyInput" />
    
 	</modal>
+
+  <modal
+		show="{{unSetModal}}"
+    showClose="{{false}}"
+    onButtonClick="onSetButtonClick"
+    buttonsLayout="vertical"
+    buttons="{{unSetBtn}}"
+	>
+		<view slot="header">您尚未设置偏好</view>
+		设置偏好,您的诉求同样重要
+	</modal>
+
+
    
 </view>

+ 21 - 14
client/pages/servant/servantCenter/servantCenter.js

@@ -1,3 +1,4 @@
+import moment from 'moment';
 Page({
   data: {
     isOnlyOne:false,//切换列表是否只有一个
@@ -7,6 +8,11 @@ Page({
     taskList:['洗衣服','做晚饭','打扫卫生'],
     noticeShow:true,//通知栏展示
       editModalShow:false,//编辑弹框
+      unSetModal:true,//未设置偏好
+       unSetBtn: [
+      { text: '现在设置', extClass: 'buttonBold' },
+      { text: '暂不' },
+    ],
     buttonFooter:[
       { text: '取消' },
       { text: '确定', extClass: 'buttonBold' },
@@ -46,19 +52,20 @@ Page({
       noticeShow:false
     });
   },
-  copyCode(){
-  my.setClipboard({
-      text: this.data.bindCode,
-      success:()=>{
-        my.showToast({
-  content: '复制成功',
-      });
-    },
-    fail:()=>{
-       my.showToast({
-  content: '复制失败',
-      });
-    }
+    // 点击设置按钮
+  onSetButtonClick(e){
+    console.log(e.target);
+    if(e.target.dataset.index==0){
+       this.setData({
+      unSetModal: false,
     });
-  }
+    // 跳转到服务偏好页面
+  
+    }else{
+      this.setData({
+      unSetModal: false,
+    });
+    }
+  },
+ 
 });

+ 3 - 1
client/pages/servant/servantCenter/servantCenter.json

@@ -1,6 +1,8 @@
 {
    "defaultTitle": "任务中心",
     "usingComponents": {
-    "modal": "mini-ali-ui/es/modal/index"
+    "modal": "mini-ali-ui/es/modal/index",
+   "calendar": "mini-antui/es/calendar/index"
+  
   }
 }