1
0

2 Commits 126035dec2 ... 159cfdda81

Autor SHA1 Nachricht Datum
  WFADLMOXAOK6T5N\Administrator 159cfdda81 Merge branch 'master' of http://47.102.110.240:3000/yuxiangpei/tbServantMini_cloud vor 4 Jahren
  WFADLMOXAOK6T5N\Administrator 30cbbf6d69 保姆明细 vor 4 Jahren

+ 1 - 1
client/app.js

@@ -14,6 +14,6 @@ App({
     // options.query == {number:1}
   },
   globalData:{
-    userInfo:{},
+    
   }
 });

+ 2 - 1
client/app.json

@@ -5,7 +5,8 @@
     "pages/customer/myServantList/myServantList",
     "pages/servant/servantCenter/servantCenter",
     "pages/customer/createServant/createServant",
-    "pages/customer/customerCenter/customerCenter"
+    "pages/customer/dailytasks/dailytasks",
+    "pages/servant/servantdetail/servantdetail"
   ],
   "window": {
     "defaultTitle": "保姆管家"

+ 12 - 47
client/pages/common/index/index.js

@@ -1,26 +1,13 @@
 import request from '../../../util/http'
-import apiUrl from '../../../util/apiUrl'
 import util from '../../../util/util'
 import moment from 'moment'
-var app = getApp();
+
 Page({
   onLoad(query) {
     // 页面加载
     console.log('onLoad');
     console.info(`Page onLoad with query: ${JSON.stringify(query)}`);
-    let storageRes = my.getStorageSync({ key: 'userInfo' });
-    console.log(storageRes);
-    //  this.authInit();
-    if(storageRes.data==null){
-      // 没有用户信息获取授权
-       this.authInit();
-    }else{
-     let id= storageRes.data.id;
-      // 有用户信息更新用户信息
-      let params={'id':id};
-      this.getUserInfo(params);
-    }
-      
+    this.authInit();
   },
   onReady() {
     // 页面加载完成
@@ -52,48 +39,26 @@ Page({
     };
   },
   // 授权登录
-   authInit(){
+  authInit(){
  my.authorize({
   scopes: 'scope.userInfo',
   success: (res) => {
     my.getAuthUserInfo({
-      success:  (userInfo) => {
+      success: (userInfo) => {
         console.log(userInfo);
-      //  let  data= await request.httpServicePost(apiUrl.registerUserPath);
-        request.httpServicePost(apiUrl.registerUserPath).then(data=>{
-        console.log(data);
-        let userInfo=data;
-        //  授权注册成功后将用户信息存到本地存储和globalData
-        my.setStorageSync({
-          key: 'userInfo',
-         data: userInfo
-           });
-        })
-        app.globalData.userInfo = userInfo;
-         
+        my.alert({
+      content: userInfo.nickName
+    });
+        request.httpService();
       }
     });
   },
 });
   },
-
-  // 获取用户信息
-       getUserInfo(params){
-      request.httpServiceGet(apiUrl.getUserInfoPath,params).then(data=>{
-        console.log(data);
-        //  授权用户信息后将用户信息存到本地存储和globalData
-        if(data!=undefined){
-           app.globalData.userInfo=data;
-       my.setStorageSync({
-         key:"userInfo",
-         data:data
-       });
-        }
-      
-        })
-
-      // let  res=await request.httpServiceGet(apiUrl.getUserInfoPath,params);
-      // console.log(res);
+  requestPost(){
+   
+  
+  
   }
 
 });

+ 0 - 121
client/pages/customer/customerCenter/customerCenter.acss

@@ -1,121 +0,0 @@
-page{
-  padding-top:24rpx;
-}
-.module-card{
-  height: 118rpx;
-  background: url('/image/icon-right.png') no-repeat  97% center;
-  background-size:12rpx;
-  background-color: #fff;
-  padding:0 24rpx;
-  margin:0 0 24rpx 0;
-}
-/* 任务提醒 */
-.task-module{
-  padding:24rpx;
-  margin:0 0 24rpx 0;
-}
-.task-top{
-  background: url('/image/icon-right.png') no-repeat  right 6rpx;
-  background-size:12rpx;
-  background-color: #fff;
-  margin:0 0 20rpx 0;
-}
-.no-add{
-  background: #FAFAFA;
-  height: 240rpx;
-  font-size: 36rpx;
-  color:#09AFFF;
-  display: flex;
-  align-items: center;
-  justify-content: center;
-  border-radius:12rpx;
-}
-/* 今天无任务 */
-.no-task{
-  background: #FAFAFA;
-  height: 326rpx;
-  font-size: 36rpx;
-  color:#999;
-  display: flex;
-  align-items: center;
-  justify-content: center;
-  border-radius:12rpx;
-}
-/* 任务列表 */
-.task-item{
-  background: #FAFAFA;
-  height: 100rpx;
-  line-height: 100rpx;
-  border-radius:12rpx;
-  padding-left:28rpx;
-  margin:0 0 16rpx 0;
-  color:#666;
-  font-weight: bold;
-}
-.task-item:last-child{
-  margin:0;
-}
-.task-schedule{
-  color:#FFAA00;
-  font-size: 20rpx;
-  border-radius:4rpx;
-  background: #FFF6E6;
-  padding:2rpx 8rpx;
-  margin-left:6rpx;
-  font-weight: normal;
-}
-.module-text{
-  height: 118rpx;
-  display: flex;
-  flex-direction: column;
-  justify-content: center;
-}
-.module-title{
-  font-size: 28rpx;
-  font-weight: bold;
-  display: flex;
-  align-items: center;
-}
-.module-detail{
-  color: #999;
-  font-size: 20rpx;
-  margin-top:8rpx;
-}
-.no-service-standard{
-  color:#FF5030;
-  font-size: 20rpx;
-  border-radius:4rpx;
-  background: #FFEDEA;
-  padding:2rpx 8rpx;
-  margin-left:6rpx;
-  font-weight: normal;
-}
-.report-tips{
-  color:#09AFFF;
-  font-size: 20rpx;
-  border-radius:4rpx;
-  background: #E6F7FF;
-  padding:2rpx 8rpx;
-  margin-left:6rpx;
-  font-weight: normal;
-}
-/* 敬请期待 */
-.future-module{
-  padding:24rpx 24rpx 32rpx;
-}
-.forward-title{
-  font-size:32rpx;
-  font-weight:bold;
-  margin-bottom:20rpx;
-}
-.forward-unit-wrapper{
-  height: 128rpx;
-  display: flex;
-  justify-content: space-between
-}
-.forward-unit-wrapper image{
-  width:128rpx;
-  height:128rpx;
-  border-radius: 12rpx;
-  background: #ddd;
-}

+ 0 - 60
client/pages/customer/customerCenter/customerCenter.axml

@@ -1,60 +0,0 @@
-<view class="common-page-padding">
- <!-- 信息面板 -->
- <view class="common-card"></view>
- <!-- 通知 -->
- <view class="notice-bar"></view>
- <!-- 任务提醒 -->
-  <view class="common-card task-module">
-     <view class="task-top">
-      <view class="module-title">任务提醒
-       <text class="task-schedule"  a:if="{{taskListShow}}">完成进度7/10</text>
-      </view>
-      <view class="module-detail">高效沟通 任务提醒更可靠</view>
-      </view>
-     <!-- 暂未添加 -->
-     <view class="no-add" a:if="{{noAddTaskShow}}">
-         +快速添加
-     </view>
-     <!-- 今天无任务 -->
-     <view class="no-task" a:if="{{noTaskShow}}">
-     今天保姆休息
-     </view>
-     <!-- 任务列表 -->
-     <view class="task-list" a:if="{{taskListShow}}">
-        <view class="task-item" a:for="{{taskList}}" key="{{index}}">
-        {{item}}
-        </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>
-      </view>
-   </view>
-   <!-- 月报 -->
-    <view class="common-card module-card">
-       <view class="module-text">
-      <view class="module-title">
-      保姆月报
-      <text class="report-tips">服务时间较短,暂未生成~</text>
-      </view>
-      <view class="module-detail">服务回顾 发现问题</view>
-      </view>
-    </view>
-    <!-- 敬请期待 -->
-     <view class="common-card future-module">
-        <view class="forward-title">敬请期待</view>
-        <view class="forward-unit-wrapper">
-          <image mode="scaleToFill" src=""/>
-          <image mode="scaleToFill" src=""/>
-          <image mode="scaleToFill" src=""/>
-          <image mode="scaleToFill" src=""/>
-        </view>
-     </view>
-</view>

+ 0 - 9
client/pages/customer/customerCenter/customerCenter.js

@@ -1,9 +0,0 @@
-Page({
-  data: {
-    noAddTaskShow:false,//未添加任务
-    noTaskShow:false,//今天无任务
-    taskListShow:true,//任务列表
-    taskList:['洗衣服','做晚饭','打扫卫生'],
-  },
-  onLoad() {},
-});

+ 0 - 3
client/pages/customer/customerCenter/customerCenter.json

@@ -1,3 +0,0 @@
-{
-   "defaultTitle": "保姆工作站"
-}

+ 63 - 0
client/pages/customer/dailytasks/dailytasks.acss

@@ -0,0 +1,63 @@
+.daily-servant-page{
+  padding-top:24rpx;
+  padding-bottom: 10pt;
+}
+.dailyitem{
+  padding:24rpx;
+  margin-bottom: 10pt;
+}
+.every-week{
+  color: #666;
+  font-weight:normal;
+}
+.name-content{
+  padding-right:30rpx;
+}
+.name-input{
+  text-align: right;
+  width:100%;
+}
+.daily-list{
+  margin-top:24rpx;
+  display: flex;
+  flex-wrap: wrap;
+}
+.daily-item{
+  height: 52rpx;
+  line-height: 52rpx;
+  border:1rpx solid #999;
+  color: #999;
+  margin:0 20rpx 16rpx 0;
+  border-radius:52rpx;
+  text-align: center;
+  padding-left: 10pt;
+  padding-right: 10pt;
+}
+.daily-item-selected{
+  background: #E6F7FF;
+  border-color:#09AFFF;
+  color:#09AFFF;
+}
+.picker-wrapper{
+    padding:0 24rpx;
+  height: 102rpx;
+  margin-bottom:18rpx;
+  line-height: 102rpx;
+}
+
+.row{
+  display: flex;
+  align-items: center;
+}
+.row-title{
+  font-weight:bold;
+}
+.row-extra{
+  flex:1;
+  text-align: right;
+}
+.row-arrow{
+  width:12rpx;
+  height: 22rpx;
+  margin:0 0 0 10rpx;
+}

+ 44 - 0
client/pages/customer/dailytasks/dailytasks.axml

@@ -0,0 +1,44 @@
+<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>
+  </view>
+</view>

+ 36 - 0
client/pages/customer/dailytasks/dailytasks.js

@@ -0,0 +1,36 @@
+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:[]
+  },
+  onLoad(options) {
+    console.log(options);
+  },
+  toggleWashinGandnursing(e){
+    
+    let id=e.target.dataset.id;
+    if(this.data.washingandnursinglist.indexOf(id)==-1){
+      let newArr=this.data.washingandnursinglist;
+      newArr.push(id);
+      this.setData({
+        washingandnursinglist:newArr
+      })
+    }else{
+      let newArr=this.data.washingandnursinglist;
+      newArr.splice(newArr.indexOf(id),1);
+      this.setData({
+        washingandnursinglist:newArr
+      })
+    }
+  },
+});

+ 3 - 0
client/pages/customer/dailytasks/dailytasks.json

@@ -0,0 +1,3 @@
+{
+   "defaultTitle": "每日任务"
+}

+ 1 - 1
client/pages/customer/myServantList/myServantList.axml

@@ -50,7 +50,7 @@
       <view class="mini-button-wrapper">
 <button type="primary" class="common-button" hover-class="active-button"  size="mini" onTap="addServant">现在添加</button>
       </view>
-      <view class="switch-role">角色选择错啦,去切换 >> </view>
+      <navigator open-type="reLaunch" url="/pages/common/index/index" hover-class="navigator-hover" class="switch-role">角色选择错啦,去切换 >></navigator>
 <!-- 提示暂未设置服务者 -->
 <modal
 		show="{{unSetModal}}"

+ 19 - 0
client/pages/servant/servantdetail/servantdetail.acss

@@ -0,0 +1,19 @@
+.servantdetail-servant-page{
+  padding-top:24rpx;
+  padding-bottom: 10pt;
+}
+.servantdetailitem{
+  padding:24rpx;
+  margin-bottom: 10pt;
+}
+.good-list{
+  margin-top: 5pt;
+  background-color: #FAFAFA;
+  padding: 10pt;
+  border-radius: 6pt;
+}
+.good-item-list{
+  margin-top: 10pt;
+  margin-left: 10pt;
+}
+

+ 31 - 0
client/pages/servant/servantdetail/servantdetail.axml

@@ -0,0 +1,31 @@
+<view class="common-page-padding servantdetail-servant-page">
+  <!---阿姨类型--->
+  <view class="common-card servantdetailitem">
+    <view class="cell-title">王阿姨</view>
+    <view class="servant-list">
+      
+    </view>
+  </view>
+  <!---阿姨类型--->
+  <view class="common-card servantdetailitem">
+    <view class="cell-title">做饭类</view>
+    <view class="servant-list">
+      <view class="good-list">
+        <view>1. 您擅长做的菜系?</view>
+        <view class="good-item-list">粤菜</view>
+      </view>
+    </view>
+    <view class="servant-list">
+      <view class="good-list">
+        <view>1. 您擅长做的菜系?</view>
+        <view class="good-item-list">粤菜</view>
+      </view>
+    </view>
+    <view class="servant-list">
+      <view class="good-list">
+        <view>1. 您擅长做的菜系?</view>
+        <view class="good-item-list">粤菜</view>
+      </view>
+    </view>
+  </view>
+</view>

+ 4 - 0
client/pages/servant/servantdetail/servantdetail.js

@@ -0,0 +1,4 @@
+Page({
+  data: {},
+  onLoad() {},
+});

+ 3 - 0
client/pages/servant/servantdetail/servantdetail.json

@@ -0,0 +1,3 @@
+{
+  "defaultTitle":"阿姨偏好"
+}

+ 0 - 15
client/util/apiUrl.js

@@ -1,15 +0,0 @@
-let baseService='/servantappletservice';
-// 授权后注册
-const registerUserPath=baseService+'/auth/registerUser';
-// 获取用户信息/user/getUserInfo
-const getUserInfoPath=baseService+'/user/getUserInfo';
-
-// POST /auth/chooseIdentity 身份选择
-const chooseIdentityPath=baseService+'/auth/chooseIdentity'
-
-
-export default{
-registerUserPath,
-getUserInfoPath,
-chooseIdentityPath
-}

+ 9 - 74
client/util/http.js

@@ -1,92 +1,27 @@
-// get请求
-const httpServiceGet= async (path,params)=>{
-  const {cloud} = getApp();
-  try {
-    console.log('request begin'); 
-  const result = await  cloud.application.httpRequest({
- //不需要完整域名,只需要接口访问路径即可
-  // 'path' : '/servantappletservice/auth/registerUser', 
-    'path' : path, 
-  'method':'GET',
-  'headers':{ },
-  'params':params,
-  'body':{  },
- //对于一个小程序关联多个云应用的场景,调用非默认云应用,需要指定对应的云应用Id,超时时间单位ms
-  'exts':{  "cloudAppId":"21907" ,"timeout":60000}  });
-   console.log('response');
-  console.log(result);
-//      my.alert({
-//   content: JSON.stringify(result) 
-//  }); 
-
-if(result.errno=='0'){
-  return result.data;
-}
-
-//  return new Promise((resolve,reject) => {
-//    if(result.errno=='0'){
-//         resolve(result.data);
-//    }else{
-//       my.alert({
-//     content: result.errmsg 
-//  });  
-//     reject('error')
-//    }
-       
-      // })
-    
-  } catch(e) {
-    console.log(e);
-  my.alert({
-    
-  // content: 'error'+e.message 
-    content: e.msg 
- });  
- } 
-} 
-// post请求
-const httpServicePost= async (path,params)=>{
+const httpService= async ()=>{
   const {cloud} = getApp();
   try {
     console.log('request begin');
   const result = await cloud.application.httpRequest({
  //不需要完整域名,只需要接口访问路径即可
-  // 'path' : '/servantappletservice/auth/registerUser', 
-    'path' : path, 
-  'method':'POST',
-  'headers':{ 'Content-type': 'application/json' },
-  'params':{},
-  'body':params,
+  'path' : '/servantappletservice/getKey', 
+  'method':'GET',
+  'headers':{  "mc-dd":"test",  },
+  'params':{"key":1},
+  'body':{  "xftest":"hhh",  "id":"1234",  },
  //对于一个小程序关联多个云应用的场景,调用非默认云应用,需要指定对应的云应用Id,超时时间单位ms
   'exts':{  "cloudAppId":"21907" ,"timeout":60000}  });
-   console.log(result);
    console.log('response');
-  // console.log(JSON.stringify(result));
+  console.log(JSON.stringify(result));
      my.alert({
   content: JSON.stringify(result) 
  }); 
- console.log(result);
-if(result.errno=='0'){
-  return result.data;
-}
-//   return new Promise((resolve) => {
-//         if(result.errno=='0'){
-//         resolve(result.data);
-//    }else{
-//       my.alert({
-//     content: result.errmsg 
-//  });  
-//    }
-//       })
   } catch(e) {
-    console.log(e);
   my.alert({
-     content: 'false'+JSON.stringify(e) 
-  // content: 'error'+e.msg 
+  content: 'error'+e.message 
  });  
  } 
 } 
 export default{
-  httpServiceGet,
-  httpServicePost
+  httpService
 }