seam il y a 7 ans
Parent
commit
5805aad9ef

+ 60 - 64
www/webapp/housekeeping/src/components/order.vue

@@ -13,12 +13,11 @@
           暂无订单数据
         </div>
         <div class="tab-view">
-          <div v-for="item in oldOrderList" class="my-order-body" @click='btnEditOrder(item)'>
-            <div><span class="title">日期:</span>{{item.order_time}}</div>
-            <div><span class="title">服务地址:</span>{{item.address.floor}}号楼{{item.address.room}}号房</div>
-            <div><span class="title">服务标准:</span>{{serviceStandards[Number.parseInt(item.service_standards)]}}</div>
-            <div v-show="isActive !== 0"><span class="title">进房时间:</span>{{item.in_room_time}}</div>
-            <div v-show="isActive === 2"><span class="title">出房时间:</span>{{item.out_room_time}}</div>
+          <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>{{type[item.type]}}</div>
+            <div><span class="title">服务类型:</span>{{item.cart_str}}</div>
+            <div><span class="title">服务类型:</span>{{item.address}}</div>
           </div>
         </div>
       </scroller>
@@ -33,76 +32,63 @@
     name: 'order',
     data() {
       return {
-        isActive: 1,
+        isActive: 0,
         showOldOrderInfo: false,
         oldId: null, // 养老院的雇员专属id
-        oldOrderList: null,//养老院订单数据集合
-        serviceStandards: ['大清洁', '小清洁', '深度清洁', '空房清洁']
+        oldOrderList: null,// 订单数据集合oldOrderList
+        orderList: [],// 订单数据集合oldOrderList
+        type: {0: '钟点工', 1: '月嫂', 2: '育婴师', 3: '护理老人', 4: '全套家务'},
+        serviceSkillsArr: [
+          {label: '烧饭', value: 0,},
+          {label: '保洁', value: 1},
+          {label: '育婴', value: 3},
+          {label: '护理', value: 4,},
+          {label: '全套家务', value: 5,}
+        ], // 服务技能
+
+        serviceType: null,
+        serviceArr: [
+          {label: '做一休一', value: 1},
+          {label: '做五休二', value: 3},
+          {label: '做六休一', value: 4,}
+        ]
       }
     },
     created() {
-      alert(_.user_id);
       // 清理数据
       _.oldOrderInfo = null;
       let that = this;
       _.auth = null;
-
-//      axios.post(_.apiPath + '/moonclub/employe/GetAuthinfo').then(res => {
-//        console.log(res.data.data)
-//      })
-      // 检验用户是否以及注册过
-      /*axios.post(_.apiPath + '/moonclub/employe/QueryPersonalInfoByUserId&user_id=' + _.user_id).then(res => {
-        if (res.data.message === '已经注册过') {
-          _.auth = res.data.data.auth
-          that.oldId = res.data.data._id.$id
-          if (_.auth === 6) {
-            document.title = '养老院'
-            that.tabF(0)
-          } else if (_.auth >= 0 && _.auth < 6) {
-            // 用户为享月会的雇员时,跳转到 相关组件中
-            document.title = '享月会'
-            that.$router.push({path: '/moonClubEmployeeOrder'})
+      axios.post(_.apiPath + '/j/HouseKeeping/list&user_id=' + _.user_id).then(res => {
+        if (res.status === 200) {
+          that.oldOrderList = res.data.rows;
+          for (let i = 0; i < that.oldOrderList.length; i++) {
+            that.oldOrderList[i].time = _.timetrans(that.oldOrderList[i].time)
           }
-        } else { // 用户还为注册,引导去注册组件
-          that.$router.push({path: '/employe'})
+          this.tabF(0);
         }
-      })*/
+      })
     },
     methods: {
       tabF(index) {
-        axios.post(_.apiPath + '/j/HouseKeeping/list&id=' + _.user_id).then(res => {
-          console.log(res);
-        })
-/*        let loading = weui.loading('加载中...', {
+
+        var loading = weui.loading('loading', {
           className: 'custom-classname'
         });
+
         this.isActive = index;
-        axios.post(_.apiPath + '/moonclub/employe/pOrderListByEmployerId&id=' + this.oldId + '&status=' + index).then(oldRes => {
-          this.oldOrderList = oldRes.data.data;
-          this.showOldOrderInfo = (this.oldOrderList.length === 0) ? true : false
-          // 处理订单上的各种时间
-          for (let i in this.oldOrderList) {
-            // orderTime
-            if (parseInt(this.oldOrderList[i].order_time) > 0) {
-              this.oldOrderList[i].order_time = _.timetrans(parseInt(this.oldOrderList[i].order_time))
-            } else {
-              this.oldOrderList[i].order_time = '暂无服务时间'
-            }
-            // in room time
-            if (parseInt(this.oldOrderList[i].in_room_time) > 0) {
-              // listArr[i].in_room_time = in_room_time
-            } else {
-              this.oldOrderList[i].in_room_time = '暂无服务时间'
-            }
-            // out room time
-            if (parseInt(this.oldOrderList[i].out_room_time) > 0) {
-              // listArr[i].out_room_time = out_room_time
-            } else {
-              this.oldOrderList[i].out_room_time = '暂无服务时间'
-            }
-          }
-          loading.hide();
-        })*/
+        this.orderList = [];
+        for (let i = 0; i < this.oldOrderList.length; i++) {
+//          console.log(this.oldOrderList[i].status - 1 == index);
+          if (this.oldOrderList[i].status - 1 == index) {
+            this.orderList.push(this.oldOrderList[i]);
+          };
+        };
+        setTimeout(function () {
+          loading.hide(function() {
+            console.log('`loading` has been hidden');
+          });
+        }, 200);
       },
       btnEditOrder(item) {
         _.oldOrderInfo = item;
@@ -168,14 +154,24 @@
       /*background-color: #0ac8ff;*/
       .my-order-body {
         font-size: 15px;
-        border: 1px solid black;
+        border-top: 1px solid rgba(0, 0, 0, 0.2);
+        border-bottom: 1px solid rgba(0, 0, 0, 0.2);
         margin: 10px 0;
-        padding: 15px;
-        color: white;
-        text-shadow: 1px 1px 10px white;
-        background-color: #570044;
+        padding: 0 15px;
+        color: black;
+        /*text-shadow: 1px 1px 10px white;*/
+        /*background-color: #570044;*/
         width: 100%;
         /*font-size: 15px;*/
+        & > div {
+          line-height: 40px;
+          font-size: 14px;
+          /*border: 1px solid rgba(0,0,0,0.1);*/
+          border-bottom: 1px solid rgba(0, 0, 0, 0.1);
+        }
+        & > div:last-child {
+          border-bottom: 0;
+        }
         span.title {
           width: 30%;
           display: inline-block;

+ 0 - 0
www/webapp/housekeeping/src/components/orderInfo.vue


+ 4 - 0
www/webapp/housekeeping/src/components/reservation.vue

@@ -343,6 +343,8 @@
         if (that.serviceSkills === '请选择服务技能') {
           weui.alert('请选择服务技能');
           return
+        } else {
+          that.serviceSkills = 1
         }
         // 预产期
         if (that.serviceType === 1 && that.time === '选择您的预产期') {
@@ -353,6 +355,8 @@
         if (that.serviceType === 2 && !that.userAge) {
           weui.alert('请输入您孩子的年龄!');
           return
+        } else {
+          that.userAge = 1
         }
         // 字符串拼接
         let stitching = `&user_id=${config.user_id}&mobile=${that.number}&user_name=${that.userName}&type=${that.serviceType}&skill=${that.serviceSkills}&age=${that.userAge}&address=${that.userAddress}&desc=${that.dec}&yc_time=${that.resTime}&server_start_time=${time(that.serviceTimeAM)}&server_end_time=${time(that.serviceTimePM)}`;

+ 1 - 2
www/webapp/housekeeping/src/config/index.js

@@ -9,8 +9,7 @@ if (locationHref.indexOf('common.yiguanjia.me') > -1) {
 // 正式开发判断test还是pro
 if (test) {
   apiPath = 'http://commontest.yiguanjia.me/index.php?r='
-  // userId = '57e38f1b9f5160ac048b457d'
-  userId = localStorage.getItem('wxUserID')
+  userId = '57e38f1b9f5160ac048b457d'
 } else {
   apiPath = 'http://common.yiguanjia.me/index.php?r='
   userId = localStorage.getItem('wxUserID')

+ 6 - 1
www/webapp/housekeeping/src/router/index.js

@@ -3,8 +3,9 @@ import Router from 'vue-router'
 import Home from '@/components/Home'
 import reservation from '@/components/reservation'
 import order from '@/components/order'
+import orderInfo from '@/components/orderInfo'
 
-Vue.use(Router)
+Vue.use(Router);
 
 export default new Router({
   routes: [
@@ -20,6 +21,10 @@ export default new Router({
       path: '/order',
       name: 'order',
       component: order
+    }, {
+      path: '/orderInfo',
+      name: 'orderInfo',
+      component: orderInfo
     }
   ]
 })