Browse Source

Merge branch 'test' of git.oschina.net:yiguanjia/php into test

north 7 years ago
parent
commit
f8c7f03feb

File diff suppressed because it is too large
+ 0 - 0
www/webapp/housekeeping/home/static/css/app.css


File diff suppressed because it is too large
+ 0 - 0
www/webapp/housekeeping/home/static/js/app.js


File diff suppressed because it is too large
+ 0 - 0
www/webapp/housekeeping/home/static/js/app.js.map


File diff suppressed because it is too large
+ 0 - 0
www/webapp/housekeeping/home/static/js/manifest.js.map


File diff suppressed because it is too large
+ 0 - 0
www/webapp/housekeeping/home/static/js/vendor.js


File diff suppressed because it is too large
+ 0 - 0
www/webapp/housekeeping/home/static/js/vendor.js.map


+ 10 - 0
www/webapp/housekeeping/src/components/Home.vue

@@ -61,10 +61,20 @@
       }
     },
     created() {
+      let that = this;
       init();
+      config.userInfo = []; // 初始化数据
       // 用户是否为管理员
       if (config.user_id === '57e238929f5160d6048b456d' || config.user_id === '57e38f1b9f5160ac048b457d') {
         this.$router.push({path: '/managementList'});
+      } else {
+        axios.get(config.apiPath + 'o2o/user/info&user_id=' + config.user_id).then(function (res) {
+          config.userInfo = res.data.data.user_info;
+          // 为空判断
+          if (config.userInfo.length === 0) {
+            that.$router.push({path: '/userInfo'})
+          }
+        })
       }
 
       function init() {

+ 91 - 58
www/webapp/housekeeping/src/components/management/edit.vue

@@ -7,6 +7,8 @@
         <div><span class="title">用户姓名:</span>{{order.user_name}}</div>
         <div><span class="title">用户手机:</span><a id='tel' v-bind:href='`tel:${order.mobile}`'>{{order.mobile}}</a></div>
         <div><span class="title">服务地址:</span>{{order.address}}</div>
+        <div><span class="title">门店:</span>{{storeStr}},电话:<a id='tel' v-bind:href='`tel:${storeMobile}`'>{{storeMobile}}</a>
+        </div>
         <div><span class="title">服务类型:</span>{{order.type_str}}</div>
 
 
@@ -19,8 +21,8 @@
         <div v-if='order.type - 1 == 1'><span class="title">预产期:</span>{{order.yc_time}}</div>
         <div v-if='order.type -1 == 2'><span class="title">孩子年龄:</span>{{order.age}}岁</div>
         <!--showContract  btnContract-->
-        <div v-if="!showContract"><span class="title">签约状态:</span>{{order.contract_str}}</div>
-        <div v-if="showContract"><span class="title">签约状态:</span><span @click='btnContract'>{{contractStr}}</span></div>
+        <div v-if="!btnSubmintStrShow"><span class="title">签约状态:</span>{{order.contract_str}}</div>
+        <!--<div v-if="showContract"><span class="title">签约状态:</span><span @click='btnContract'>{{contractStr}}</span></div>-->
         <!--预约日期-->
         <div v-if="!showStatus">
           <!--选择时间-->
@@ -40,8 +42,8 @@
         <div v-if='showTech'><span class="title">家政员:</span>{{order.tech}}</div>
         <div><span class="title">备注:</span>{{order.desc}}</div>
       </div>
-      <div class="m-btn">
-        <x-button type="primary" @click.native='btnSubmint'>提交</x-button>
+      <div v-if="btnSubmintStrShow" class="m-btn">
+        <x-button type="primary" @click.native='btnSubmint'>{{btnSubmintStr}}</x-button>
       </div>
     </div>
   </scroller>
@@ -66,20 +68,45 @@
         startDate: selectTime.startDate, // 限定最小日期
         endDate: '', // 限定最大日期
         tech: '',
+        storeStr: '',
+        storeMobile: '',
         showTech: false, // 家政员
         showContract: false, // 签约状态
         contractStr: '未签约',
         contractStrArr: [],
+        btnSubmintStr: '已预约',
+        btnSubmintStrShow: true,
         showStatus: false // 预约状态
       }
     },
     created() {
+      let that = this;
+      axios.post(_.apiPath + 'j/HouseKeeping/GetStore').then(res => {
+        for (let i in res.data) {
+          if (res.data[i].store_id == _.oldOrderInfo.store_id) {
+            that.storeStr = `${res.data[i].store_name}(${res.data[i].address})`
+            that.storeMobile = res.data[i].mobile
+          }
+        }
+      })
 
-//      console.log(_.oldOrderInfo)
       if (_.oldOrderInfo === undefined) {
         this.$router.push({path: '/managementList'})
       }
       this.order = _.oldOrderInfo;
+      // 状态编辑
+      // 已面试
+      if (that.order.contract === 1 && that.order.status === 2) {
+        that.btnSubmintStr = '已面试'
+      }
+      // 已签约
+      if (that.order.contract === 1 && that.order.status === 3) {
+        that.btnSubmintStr = '已签约'
+      }
+      // 已完成
+      if (that.order.contract === 2 && that.order.status === 3) {
+        that.btnSubmintStrShow = false
+      }
       console.log(this.order);
       // 转化时间格式
       /*     this.order.yc_time = _.timetrans(this.order.yc_time); // 预产期
@@ -101,7 +128,7 @@
       if (this.order.contract == 1 && this.order.status == 2) {
         this.showContract = true;
       }
-      for(let i in this.order.skill_str){
+      for (let i in this.order.skill_str) {
         this.skillStr = `${this.skillStr} ${this.order.skill_str[i]}`
       }
       // showContract
@@ -113,53 +140,25 @@
       XButton
     },
     methods: {
-      btnContract() {
-        let that = this;
-        weui.picker([
-          {
-            label: '未签约',
-            value: 0,
-            disabled: true // 不可用
-          },
-          {
-            label: '已签约',
-            value: 1
-          },
-        ], {
-          className: 'custom-classname',
-          container: 'body',
-          defaultValue: [0],
-          onChange: function (result) {
-//            console.log(result)
-          },
-          onConfirm: function (result) {
-//            console.log(result)
-            that.contractStr = result[0].label;
-            that.contractStrArr = result[0];
-          },
-          id: 'singleLinePicker'
-        });
-      },
       btnSubmint() {
         let that = this;
-        if (that.bookingTime.length == 0 && !that.showStatus) {
-          weui.alert('请选择预约日期');
-          return
-        }
-        if (that.tech.length == 0 && !that.showTech) {
-          weui.alert('请输入家政人员');
-          return
-        }
-        if (this.order.contract == 1 && this.order.status == 2) {
-          if (this.contractStr !== '已签约') {
-            weui.alert('请签约状态');
+        // 预约中
+        if (that.order.contract === 1 && that.order.status === 1) {
+          //  预约日期判断
+          if (that.bookingTime.length == 0 && !that.showStatus) {
+            weui.alert('请选择预约日期');
             return
           }
-          let stitching = `&id=${_.oldOrderInfo.id}&contract=2&status=3`;
+          // 家政人员不为空判断
+          if (that.tech.length == 0 && !that.showTech) {
+            weui.alert('请输入家政人员');
+            return
+          }
+          let stitching = `&id=${_.oldOrderInfo.id}&status=2&status_time=${ycTime(this.bookingTime)}&tech=${this.tech}`;
           axios.post(_.apiPath + 'j/HouseKeeping/Edit' + stitching).then(res => {
             if (res.data.success) {
               weui.alert('提交成功', function () {
-                that.$router.push({path: '/managementList'})
+                that.$router.push({path: '/managementList'});
               });
               return
             } else {
@@ -167,19 +166,53 @@
               return
             }
           })
-        } else {
-          let stitching = `&id=${_.oldOrderInfo.id}&status=2&status_time=${ycTime(this.bookingTime)}&tech=${this.tech}`;
-          axios.post(_.apiPath + 'j/HouseKeeping/Edit' + stitching).then(res => {
-            if (res.data.success) {
+          return;
+        }
+        // 已面试
+        if (that.order.contract === 1 && that.order.status === 2) {
+          weui.confirm('请确定,家政员是否已面试', function () {
+//            console.log('yes')
+            let stitching = `&id=${_.oldOrderInfo.id}&contract=1&status=3`;
+            axios.post(_.apiPath + 'j/HouseKeeping/Edit' + stitching).then(res => {
+              statusF(res.data.success);
+              return;
+            })
+          }, function () {/*console.log('no')*/
+          });
+        }
+        // 已签约
+        if (that.order.contract === 1 && that.order.status === 3) {
+          let $weui = weui;
+          weui.confirm('请确认,家政员是否已签约', function () {
+            let stitching = `&id=${_.oldOrderInfo.id}&contract=2`;
+            axios.post(_.apiPath + 'j/HouseKeeping/Edit' + stitching).then(res => {
+              statusF(res.data.success);
+              return;
+            })
+          }, function () {/*console.log('no')*/
+          });
+          that.btnSubmintStr = '已签约';
+          return;
+        }
+
+        // 提交返回状态
+        function statusF(s) {
+          console.log(s)
+          if (s) {
+            setTimeout(function () {
               weui.alert('提交成功', function () {
-                that.$router.push({path: '/managementList'})
+                that.$router.push({path: '/managementList'});
+                return;
               });
-              return
-            } else {
-              weui.alert('提交失败');
-              return
-            }
-          })
+            }, 200);
+          } else {
+            setTimeout(function () {
+              weui.alert('提交失败', function () {
+                that.$router.push({path: '/managementList'});
+                return;
+              });
+            }, 200);
+          }
         }
       },
       change(val) {
@@ -222,7 +255,7 @@
 
     padding-left: 15px;
     & > div {
-      font-size: 15px;
+      font-size: 13px;
       padding: 5px 0;
       border-bottom: 1px solid rgba(0, 0, 0, 0.1);
       &:last-child {

+ 3 - 2
www/webapp/housekeeping/src/components/management/list.vue

@@ -15,8 +15,8 @@
         <div class="tab-view">
           <div v-for="item in orderList" class="my-order-body" @click='btnEditOrder(item)'>
             <div><span class="title">创建日期:</span>{{item.time}}</div>
+            <div><span class="title">客户姓名:</span>{{item.user_name}}</div>
             <div><span class="title">服务类型:</span>{{item.type_str}}</div>
-            <div><span class="title">服务形式:</span>{{item.cart_str}}</div>
             <div><span class="title">服务地址:</span>{{item.address}}</div>
           </div>
         </div>
@@ -67,10 +67,11 @@
             axios.post(_.apiPath + '/j/HouseKeeping/list&store_id=' + that.storeId).then(res => {
               if (res.status === 200) {
                 that.oldOrderList = res.data.rows;
+                console.log(that.oldOrderList)
                 for (let i = 0; i < that.oldOrderList.length; i++) {
                   that.oldOrderList[i].time = _.timetrans(that.oldOrderList[i].time)
                 }
-                that.tabF(0);
+                that.tabF(0)
               }
             })
           }

+ 30 - 14
www/webapp/housekeeping/src/components/orderInfo.vue

@@ -5,6 +5,7 @@
       <div class="my-order-body">
         <div><span class="title">创建日期:</span>{{order.time}}</div>
         <div><span class="title">服务类型:</span>{{order.type_str}}</div>
+        <div><span class="title">门店:</span>{{storeStr}},电话:<a id='tel' v-bind:href='`tel:${storeMobile}`'>{{storeMobile}}</a></div>
         <div><span class="title">服务地址:</span>{{order.address}}</div>
 
 
@@ -27,6 +28,7 @@
 </template>
 <script>
   import _ from '@/config'
+  import axios from 'axios'
 
   export default {
     name: 'orderInfo',
@@ -34,28 +36,42 @@
       return {
         type: {0: '钟点工', 1: '月嫂', 2: '育婴师', 3: '护理老人', 4: '全套家务'},
         order: null,
+        storeStr:'',
+        storeMobile:'',
         skillStr: ''
       }
     },
     created() {
+      let that =this;
+      axios.post(_.apiPath + 'j/HouseKeeping/GetStore').then(res => {
+        console.log(_.oldOrderInfo.store_id)
+        console.log(res.data)
+        for (let i in res.data){
+          if(res.data[i].store_id == _.oldOrderInfo.store_id){
+            that.storeStr = `${res.data[i].store_name}(${res.data[i].address})`
+            that.storeMobile = res.data[i].mobile
+          }
+        }
+//        that.storeStr
+      })
       if (_.oldOrderInfo === undefined) {
-        this.$router.push({path: '/order'})
+        that.$router.push({path: '/order'})
       }
-      this.order = _.oldOrderInfo;
+      that.order = _.oldOrderInfo;
       // 转化时间格式
-      this.order.yc_time = _.timetrans(this.order.yc_time); // 预产期
-      this.order.yc_time = this.order.yc_time.substring(0, 10); // 预产期
-      this.order.server_start_time = _.timetrans(this.order.server_start_time);
-      this.order.server_start_time = this.order.server_start_time.substring(11, 16);
-      this.order.server_end_time = _.timetrans(this.order.server_end_time);
-      this.order.server_end_time = this.order.server_end_time.substring(11, 16);
-      if (this.order.status_time !== 0) {
-        this.order.status_time = _.timetrans(this.order.status_time);
+      that.order.yc_time = _.timetrans(that.order.yc_time); // 预产期
+      that.order.yc_time = that.order.yc_time.substring(0, 10); // 预产期
+      that.order.server_start_time = _.timetrans(that.order.server_start_time);
+      that.order.server_start_time = that.order.server_start_time.substring(11, 16);
+      that.order.server_end_time = _.timetrans(that.order.server_end_time);
+      that.order.server_end_time = that.order.server_end_time.substring(11, 16);
+      if (that.order.status_time !== 0) {
+        that.order.status_time = _.timetrans(that.order.status_time);
       } else {
-        this.order.status_time = '暂无预约日期'
+        that.order.status_time = '暂无预约日期'
       }
-      for (let i in this.order.skill_str) {
-        this.skillStr = `${this.skillStr} ${this.order.skill_str[i]}`
+      for (let i in that.order.skill_str) {
+        that.skillStr = `${that.skillStr} ${that.order.skill_str[i]}`
       }
     },
     watch: {
@@ -82,7 +98,7 @@
 
     padding-left: 15px;
     & > div {
-      font-size: 15px;
+      font-size: 13px;
       padding: 5px 0;
       border-bottom: 1px solid rgba(0, 0, 0, 0.1);
       &:last-child {

+ 67 - 60
www/webapp/housekeeping/src/components/reservation.vue

@@ -1,21 +1,22 @@
 <template>
   <div class="user-info">
     <scroller>
-      <h2 class="title">预约</h2>
+      <h2 class="title">{{type[serviceType]}}预约</h2>
       <!--输入框-->
       <div class="weui-cells weui-cells_form">
         <!--姓名-->
-        <div class="weui-cell">
+        <div class="weui-cell" v-if="iCreateCodeShow">
           <div class="weui-cell__hd"><label class="weui-label">姓名</label></div>
           <div class="weui-cell__bd"><input v-model="userName" class="weui-input" type="text" required="" maxlength="11"
+                                            disabled
                                             placeholder="输入您的姓名">
           </div>
           <div class="weui-cell__ft"><i class="weui-icon-warn"></i></div>
         </div>
         <!--手机验证-->
-        <div class="weui-cell">
+        <div class="weui-cell" v-if="iCreateCodeShow">
           <div class="weui-cell__hd"><label class="weui-label">手机</label></div>
-          <div class="weui-cell__bd"><input class="weui-input" type="tel" v-model="number" required=""
+          <div class="weui-cell__bd"><input class="weui-input" type="tel" v-model="mobile" required="" disabled
                                             pattern="^\d{11}$" maxlength="11" placeholder="输入您现在的手机号" emptytips="请输入手机号"
                                             notmatchtips="请输入正确的手机号"></div>
           <div class="weui-cell__ft"><i class="weui-icon-warn"></i></div>
@@ -37,7 +38,7 @@
           </div>
         </div>
         <!--服务地址-->
-        <div class="weui-cell" v-if="!iCodeShow">
+        <div class="weui-cell">
           <div class="weui-cell__hd"><label class="weui-label">服务地址</label></div>
           <div class="weui-cell__bd"><input v-model="userAddress" class="weui-input" type="text" required=""
                                             maxlength="11" placeholder="输入您需要上门服务的地址">
@@ -45,7 +46,7 @@
           <div class="weui-cell__ft"><i class="weui-icon-warn"></i></div>
         </div>
         <!--所属门店-->
-        <div class="weui-cell" v-if="!iCodeShow">
+        <div class="weui-cell">
           <div class="weui-cell__hd"><label class="weui-label">门店选择</label></div>
           <div class="weui-cell__bd" @click='btnStore'>
             <input class="weui-input select-time" type="button" required=""
@@ -54,7 +55,7 @@
           <div class="weui-cell__ft"><i class="weui-icon-warn"></i></div>
         </div>
         <!--服务形式-->
-        <div class="weui-cell" v-if="serviceType == 0 && !iCodeShow">
+        <div class="weui-cell" v-if="serviceType == 0">
           <div class="weui-cell__hd"><label class="weui-label">服务形式</label></div>
           <div class="weui-cell__bd" @click='btnServiceForm'>
             <input class="weui-input select-time" type="button" required=""
@@ -63,7 +64,7 @@
           <div class="weui-cell__ft"><i class="weui-icon-warn"></i></div>
         </div>
         <!--服务时间-->
-        <div class="weui-cell" v-if="serviceType == 0 && !iCodeShow">
+        <div class="weui-cell" v-if="serviceType == 0">
           <div class="weui-cell__hd"><label class="weui-label">服务时间</label></div>
           <div class="weui-cell__bd">
             <div class="service-time select-time" @click='btnServiceAM'>{{serviceTimeAM}}</div>
@@ -72,9 +73,7 @@
           <div class="weui-cell__ft"><i class="weui-icon-warn"></i></div>
         </div>
         <!--服务技能-->
-        <!--<div class="weui-cell" v-if="serviceType == 0 && !iCodeShow">-->
-        <div class="weui-cell">
-          <!--<div class="weui-cell">-->
+        <div class="weui-cell" v-if="serviceType == 0">
           <div class="weui-cell__hd"><label class="weui-label">服务技能</label></div>
           <div class="weui-cell__bd" @click="showPopup=true">
             <input class="weui-input select-time" type="button" required=""
@@ -84,7 +83,7 @@
         </div>
 
         <!--预产期-->
-        <div v-if='serviceType == 1 && !iCodeShow' class="weui-cell">
+        <div v-if='serviceType == 1' class="weui-cell">
           <div class="weui-cell__hd"><label class="weui-label">预产期</label></div>
           <div class="weui-cell__bd" @click='btn()'>
             <input class="weui-input select-time" type="button" required=""
@@ -93,7 +92,7 @@
           <div class="weui-cell__ft"><i class="weui-icon-warn"></i></div>
         </div>
         <!--孩子年龄-->
-        <div v-if="serviceType == 2 && !iCodeShow" class="weui-cell">
+        <div v-if="serviceType == 2" class="weui-cell">
           <div class="weui-cell__hd"><label class="weui-label">孩子年龄</label></div>
           <div class="weui-cell__bd"><input v-model="userAge" class="weui-input" type="text" required="" maxlength="11"
                                             placeholder="输入您孩子的年龄">
@@ -101,7 +100,7 @@
           <div class="weui-cell__ft"><i class="weui-icon-warn"></i></div>
         </div>
         <!--备注-->
-        <div class="weui-cell" v-if="!iCodeShow">
+        <div class="weui-cell">
           <div class="weui-cell__hd"><label class="weui-label">备注</label></div>
           <div class="weui-cell__bd"><input v-model="dec" class="weui-input" type="text" required="" maxlength="11"
                                             placeholder="补充您的需求">
@@ -147,8 +146,9 @@
       return {
         msg: 'this is userInfo',
         userName: '', // 客户姓名
-        number: '', // 客户手机
-        oldNumber: '', // 客户手机已验证
+        mobile: '', // 客户手机
+        type: {0: '钟点工', 1: '月嫂', 2: '育婴师', 3: '护理老人', 4: '全套家务'},
+//        oldmobile: '', // 客户手机已验证
         userAddress: '', // 服务地址
         store: '请选择门店', // 门店
         storeId: '', // 门店ID
@@ -159,10 +159,10 @@
         resTime: '', // 已选择时间戳
         createCode: '', // 验证码
         iCreateCode: '', // 用户输入的验证码
-        iCreateCodeShow: true, // show验证码
+        iCreateCodeShow: false, // show验证码
         code: '', // 短信验证码
         iCode: '', // 用户输入的短信验证码
-        iCodeShow: true, // show短信验证码
+        iCodeShow: false, // show短信验证码
         serviceType: null,
         serviceArr: [
           {label: '做一休一', value: 2},
@@ -172,7 +172,8 @@
         resServiceArr: null, // 已选服务形式集合
         serviceForm: '请选择', // 服务形式
         serviceFormText: null, // 服务形式
-        serviceTimeArr: [], // 服务时间
+        serviceTimeArrAM: [], // 开始服务时间
+        serviceTimeArrPM: [], // 结束服务时间
         serviceTimeAM: '开始时间',
         serviceTimePM: '结束时间',
         serviceSkillsArr: [
@@ -201,28 +202,28 @@
       Popup
     },
     watch: {
-      number: function (val, oldVal) {
-        if (val.length === 11) {
-          if (val !== this.oldNumber) {
-            this.iCodeShow = true;
-            this.iCreateCodeShow = true;
-          }
-        }
-      },
+      /*      mobile: function (val, oldVal) {
+              if (val.length === 11) {
+                if (val !== this.oldmobile) {
+                  this.iCodeShow = true;
+                  this.iCreateCodeShow = true;
+                }
+              }
+            },*/
       // 短信验证码
-      iCode: function (val, oldVal) {
-        if (val.length === 4) {
-          if (val == this.code) {
-            this.iCodeShow = false;
-            this.iCreateCodeShow = false;
-            this.oldNumber = this.number;
-            if (!this.iCodeShow) {
-              weui.alert('手机号码验证成功,请您填写您的需求并提交!');
-              return
-            }
-          }
-        }
-      },
+      /*      iCode: function (val, oldVal) {
+              if (val.length === 4) {
+                if (val == this.code) {
+                  this.iCodeShow = false;
+                  this.iCreateCodeShow = false;
+                  this.oldmobile = this.mobile;
+                  if (!this.iCodeShow) {
+                    weui.alert('手机号码验证成功,请您填写您的需求并提交!');
+                    return
+                  }
+                }
+              }
+            },*/
       // 验证码
 //          iCreateCode: function (val, oldVal) {
 //            if(val.length === 4 ){
@@ -247,10 +248,16 @@
       }
     },
     created() {
+      // 数据绑定
+      this.userName = config.userInfo.name;
+      this.mobile = config.userInfo.mobile;
       this.createCode = createCode();
       this.serviceType = config.serviceType;
-      for (let i = 9; i < 20; i++) {
-        this.serviceTimeArr.push(i + ':00');
+      for (let i = 6; i < 20; i++) {
+        this.serviceTimeArrAM.push(i + ':00');
+      }
+      for (let i = 7; i < 22; i++) {
+        this.serviceTimeArrPM.push(i + ':00');
       }
       axios.post(config.apiPath + 'j/HouseKeeping/GetStore').then(res => {
         this.storeArr = res.data;
@@ -289,7 +296,7 @@
         let newStoreArr = [];
         for (let i = 0; i < that.storeArr.length; i++) {
           newStoreArr.push({
-            label: that.storeArr[i].store_name,
+            label: that.storeArr[i].store_name + '(' + that.storeArr[i].address + ')',
             value: that.storeArr[i].store_id
           })
         }
@@ -310,7 +317,7 @@
       // 时间选择
       btnServiceAM() {
         let that = this;
-        weui.picker(that.serviceTimeArr, {
+        weui.picker(that.serviceTimeArrAM, {
           className: 'custom-classname',
           container: 'body',
           defaultValue: [0],
@@ -324,7 +331,7 @@
       },
       btnServicePM() {
         let that = this;
-        weui.picker(that.serviceTimeArr, {
+        weui.picker(that.serviceTimeArrPM, {
           className: 'custom-classname',
           container: 'body',
           defaultValue: [0],
@@ -378,12 +385,12 @@
       // 获取短信验证码
       getCode() {
         // 检验手机号码
-        if (!(/^1[34578]\d{9}$/.test(this.number)) || this.number === 0) {
+        if (!(/^1[34578]\d{9}$/.test(this.mobile)) || this.mobile === 0) {
           weui.alert('输入的手机号码有误,请重新输入');
           return
         }
         if (this.iCreateCode === this.createCode) {
-          axios.get(config.apiPath + '/moonclub/reserve/code&number=' + this.number).then(res => {
+          axios.get(config.apiPath + '/moonclub/reserve/code&mobile=' + this.mobile).then(res => {
             // 短信发送成功
             if (res.data.success) {
               weui.alert('短信已发送,请留意查收!');
@@ -405,19 +412,19 @@
         let that = this,
           skillsArray = [];
         // 用户名判断
-        if (!that.userName) {
-          weui.alert('请输入您的姓名');
-          return
-        }
+        /*        if (!that.userName) {
+                  weui.alert('请输入您的姓名');
+                  return
+                }*/
         // 手机验证
-        if (this.oldNumber.length !== 11) {
-          weui.alert('您的手机号码输入有误!');
-          return
-        }
+        /*        if (this.oldmobile.length !== 11) {
+                  weui.alert('您的手机号码输入有误!');
+                  return
+                }*/
 //        return;
 
         // 短信验证码判断
-//        if (Number.parseInt(that.iCode) !== that.code) {
+//        if (mobile.parseInt(that.iCode) !== that.code) {
 //          weui.alert('输入的短信验证码有误,请重新输入');
 //          return
 //        }
@@ -450,7 +457,7 @@
         }
 
         // 服务技能
-        if (that.skillsStr == '') {
+        if (that.serviceType == 0 && that.skillsStr == '') {
           weui.alert('请选择服务技能');
           return
         } else {
@@ -471,12 +478,12 @@
         if (that.serviceType === 2 && !that.userAge) {
           weui.alert('请输入您孩子的年龄!');
           return
-        } else if (that.serviceType !== 2 ){
+        } else if (that.serviceType !== 2) {
           that.userAge = 1
         }
 
         // 字符串拼接
-        let stitching = `&user_id=${config.user_id}&mobile=${that.number}&user_name=${that.userName}&type=${that.serviceType + 1}&skill=${JSON.stringify(skillsArray)}&cart=${that.resServiceArr}&age=${that.userAge}&address=${that.userAddress}&store_id=${that.storeId}&desc=${that.dec}&yc_time=${that.resTime}&server_start_time=${time(that.serviceTimeAM)}&server_end_time=${time(that.serviceTimePM)}`;
+        let stitching = `&user_id=${config.user_id}&mobile=${that.mobile}&user_name=${that.userName}&type=${that.serviceType + 1}&skill=${JSON.stringify(skillsArray)}&cart=${that.resServiceArr}&age=${that.userAge}&address=${that.userAddress}&store_id=${that.storeId}&desc=${that.dec}&yc_time=${that.resTime}&server_start_time=${time(that.serviceTimeAM)}&server_end_time=${time(that.serviceTimePM)}`;
         if (that)
           axios.post(config.apiPath + 'j/HouseKeeping/Add' + stitching).then(res => {
             console.log(res);
@@ -504,7 +511,7 @@
     }
   }
 
-  function createCode(Number) {
+  function createCode(mobile) {
     let code = '';
     let random = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; // 随机数
     for (let i = 0; i < 4; i++) { // 循环操作

+ 246 - 0
www/webapp/housekeeping/src/components/userInfo.vue

@@ -0,0 +1,246 @@
+<template>
+  <scroller>
+    <div class="user-info">
+      <h3>{{name}}</h3>
+      <!--输入框-->
+      <div class="weui-cells weui-cells_form">
+        <!--姓名-->
+        <div class="weui-cell">
+          <div class="weui-cell__hd"><label class="weui-label">姓名</label></div>
+          <div class="weui-cell__bd"><input v-model="userName" class="weui-input" type="text" required="" maxlength="11"
+                                            placeholder="输入您的姓名">
+          </div>
+          <div class="weui-cell__ft"><i class="weui-icon-warn"></i></div>
+        </div>
+        <!--手机验证-->
+        <div class="weui-cell">
+          <div class="weui-cell__hd"><label class="weui-label">手机</label></div>
+          <div class="weui-cell__bd"><input class="weui-input" type="tel" v-model="mobile" required=""
+                                            pattern="^\d{11}$" maxlength="11" placeholder="输入您现在的手机号" emptytips="请输入手机号"
+                                            notmatchtips="请输入正确的手机号"></div>
+          <div class="weui-cell__ft"><i class="weui-icon-warn"></i></div>
+        </div>
+        <div class="weui-cell weui-cell_vcode">
+          <div class="weui-cell__hd"><label class="weui-label">验证码</label></div>
+          <div class="weui-cell__bd"><input v-model="iCreateCode" class="weui-input" maxlength="4" type="text"
+                                            required="" pattern="REG_VCODE" placeholder="点击验证码更换" tips="请输入验证码"></div>
+          <div class="weui-cell__ft"><i class="weui-icon-warn"></i>
+            <input type="button" class="code checkCode checkCodeBtn" @click='getCreateCode()' :value="createCode">
+          </div>
+        </div>
+        <div class="weui-cell weui-cell_vcode">
+          <div class="weui-cell_hd"><label class="weui-label">短信验证</label></div>
+          <div class="weui-cell_hd"><input v-model="iCode" type="text" class="weui-input" maxlength="4"
+                                           placeholder="输入短信验证码"></div>
+          <div class="weui-cell__ft" style="margin-left: auto;"><i class="weui-icon-warn"></i>
+            <input @click="getCode()" type="button" class="getCreateCode" value="获取">
+          </div>
+        </div>
+        <div class="submit" @click="submit()">提交</div>
+      </div>
+
+
+    </div>
+  </scroller>
+</template>
+<script>
+  import axios from 'axios'
+  import _ from '@/config'
+  import {XInput, Group, XButton, Cell} from 'vux'
+
+  export default {
+    name: 'userInfo',
+    components: {
+      XInput,
+      XButton,
+      Group,
+      Cell
+    },
+    data() {
+      return {
+        name: '完善信息',
+        userName: '',
+        mobile: '',
+        createCode: '', // 验证码
+        iCreateCode: '', // 用户输入的验证码
+        code: '', // 短信验证码
+        iCode: '', // 用户输入的短信验证码
+      }
+    },
+    created() {
+      this.createCode = createCode();
+      axios.get(_.apiPath + 'o2o/user/info&user_id=' + _.user_id).then(function (res) {
+        console.log(res.data.data)
+      })
+    },
+    watch: {
+      // 短信验证码
+      /*      iCode: function (val, oldVal) {
+              if (val.length === 4) {
+                if (val == this.code) {
+                  this.iCodeShow = false;
+                  this.iCreateCodeShow = false;
+                  this.oldNumber = this.number;
+                  if (!this.iCodeShow) {
+                    weui.alert('手机号码验证成功,请您填写您的需求并提交!');
+                    return
+                  }
+                }
+              }
+            }*/
+    },
+    methods: {
+      submit() {
+        let that = this;
+//        console.log(this.iCode)
+////        console.log(this.userName)
+//        console.log(this.code)
+        // 用户名判断
+        if (!that.userName) {
+          weui.alert('请输入您的姓名');
+          return
+        }
+        // 检验手机号码
+        if (that.iCode !== that.code || that.iCode == '') {
+          weui.alert('您手机号码未通过验证,请重新操作!');
+          return
+        }
+        // 提交数据
+        axios.post(_.apiPath + 'j/HouseKeeping/AddUserInfo&user_id=' + _.user_id + '&mobile=' + that.mobile + '&name=' + that.userName).then(res => {
+          if(res.data.success){
+            weui.alert('注册成功', function () {
+              that.$router.push({path:'/'});
+              return
+            });
+          }
+          console.log(res);
+        });
+      },
+      // 获取短信验证码
+      getCode() {
+        // 检验手机号码
+        if (!(/^1[34578]\d{9}$/.test(this.mobile)) || this.mobile === 0) {
+          weui.alert('输入的手机号码有误,请重新输入');
+          return
+        }
+        if (this.iCreateCode === this.createCode) {
+          axios.get(_.apiPath + '/moonclub/reserve/code&number=' + this.mobile).then(res => {
+            // 短信发送成功
+            if (res.data.success) {
+              weui.alert('短信已发送,请留意查收!');
+              // 绑定短信验证码
+              this.code = res.data.data.code;
+              this.iCode = this.code // 系统调试时开启
+              this.iCreateCode = '';// 清空已输入验证码
+              this.createCode = createCode(); // 重置验证码
+            } else {
+              weui.alert('短信发送发送失败,请稍后再试!');
+            }
+          })
+        } else {
+          weui.alert('您输入验证码有误,请重新输入');
+        }
+      },
+
+    }
+  }
+
+  // 验证码
+  function createCode(Number) {
+    let code = '';
+    let random = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; // 随机数
+    for (let i = 0; i < 4; i++) { // 循环操作
+      let charIndex = Math.floor(Math.random() * random.length); // 取得随机数的索引
+      code += random[charIndex] // 根据索引取得随机数加到code上
+    }
+    return code // 把code值赋给验证码
+  }
+</script>
+
+<style scoped lang="less">
+  .user-info {
+    padding: 0 15px;
+    h3 {
+      width: 100%;
+      text-align: center;
+      margin: 5% 0;
+    }
+    /*验证码*/
+
+    .select-time {
+      text-align: left;
+      color: #848484;
+    }
+    .service-time {
+      float: left;
+      display: inline-block;
+      width: 50%;
+    }
+    input {
+      font-size: 16px;
+    }
+    .title {
+      text-align: center;
+      font-weight: 500;
+    }
+    .checkCodeBtn {
+      font-family: Arial;
+      font-style: italic;
+      font-weight: bold;
+      border: 0;
+      height: 35px;
+      letter-spacing: 3px;
+      color: blue;
+      padding: 0px 10px;
+      margin-top: 5px;
+      text-align: center;
+    }
+    .getCreateCode {
+      border: 0;
+      height: 35px;
+      padding: 0 18px;
+      margin-top: 5px;
+    }
+    /*服务形式*/
+    .service-form {
+      transition: all .1s;
+      cursor: pointer;
+      color: #000;
+      text-align: left;
+      padding-left: 0;
+      &:after {
+        width: 0;
+        height: 0;
+      }
+      &:active {
+        background-color: #dddddd;
+      }
+    }
+    .submit {
+      background: #61904a;
+      color: rgb(255, 255, 255);
+      border: 0;
+      padding: 10px 0;
+      font-size: 22px;
+      line-height: 30px;
+      height: 30px;
+      width: calc(100% - 15px);
+      margin: 15px auto;
+      display: block;
+      text-align: center;
+      transition: all .1s;
+      &:active {
+        font-size: 20px;
+        background: rgba(97, 144, 74, 0.8);
+      }
+    }
+
+    .verification-code {
+      width: 100px;
+      height: 44px;
+      color: black;
+    }
+
+  }
+
+</style>

+ 5 - 0
www/webapp/housekeeping/src/config/index.js

@@ -2,6 +2,8 @@ let locationHref = location.href;
 let test = true;
 let apiPath = '';
 let userId = '';
+let userInfo = [];
+let storeList = [];
 let serviceType = null; // 服务类型
 if (locationHref.indexOf('common.yiguanjia.me') > -1) {
   test = false
@@ -28,6 +30,7 @@ if (locationHref.indexOf('http://localhost:8080/') > -1) {
   // userId = '582405cea84ea02e3e8b4611' // 养老院
   // userId = '57e238929f5160d6048b456d'; // 管理员
   userId = '57fd74be9f5160c7048b4a52' // 顾客
+  // userId = '58c21af0fb48a7ba308b45af' // 顾客
 } else if (locationHref.indexOf('admin.yiguanjiadev.me') > -1) {
   apiPath = 'http://admin.yiguanjiadev.me/index.php?r=';
   // userId = '57fe2dc59f5160a1048b4591'; // 享月会
@@ -123,6 +126,8 @@ let isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/) && !!app.match(/\(i[^;]+;
 
 export default {
   user_id: userId,
+  userInfo: userInfo,
+  storeList: storeList,
   apiPath: apiPath,
   timetrans: timetrans,
   checkID: checkID,

+ 5 - 0
www/webapp/housekeeping/src/router/index.js

@@ -5,6 +5,7 @@ import reservation from '@/components/reservation'
 import order from '@/components/order'
 import orderInfo from '@/components/orderInfo'
 import userId from '@/components/userId'
+import userInfo from '@/components/userInfo'
 import managementList from '@/components/management/list'
 import managementEdit from '@/components/management/edit'
 
@@ -32,6 +33,10 @@ export default new Router({
       path: '/userId',
       name: 'userId',
       component: userId
+    }, {
+      path: '/userInfo',
+      name: 'userInfo',
+      component: userInfo
     }, {
       path: '/managementList',
       name: 'managementList',

Some files were not shown because too many files changed in this diff