洪海涛 7 سال پیش
والد
کامیت
bf6fd7700d

+ 10 - 6
www/webapp/housekeeping/build/webpack.base.conf.js

@@ -1,14 +1,10 @@
 'use strict'
 const path = require('path')
 const utils = require('./utils')
+const vuxLoader = require('vux-loader')
 const config = require('../config')
 const vueLoaderConfig = require('./vue-loader.conf')
-
-function resolve (dir) {
-  return path.join(__dirname, '..', dir)
-}
-
-module.exports = {
+const webpackConfig = {
   entry: {
     app: './src/main.js'
   },
@@ -65,3 +61,11 @@ module.exports = {
     ]
   }
 }
+
+function resolve(dir) {
+  return path.join(__dirname, '..', dir)
+}
+
+module.exports = vuxLoader.merge(webpackConfig, {
+  plugins: ['vux-ui']
+})

+ 8 - 7
www/webapp/housekeeping/home/index.html

@@ -1,7 +1,8 @@
-<!DOCTYPE html><html><head><meta charset=utf-8><title>家政</title><meta charset=UTF-8><meta name=viewport content="width=device-width,user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1"><meta http-equiv=X-UA-Compatible content="ie=edge"><link rel=stylesheet href=https://res.wx.qq.com/open/libs/weui/1.1.2/weui.min.css><script type=text/javascript src=https://res.wx.qq.com/open/libs/weuijs/1.1.2/weui.min.js></script><link href=/static/css/app.css rel=stylesheet></head><style>html{
-      font-size: 120%;
-    }
-    *{
-      padding: 0;
-      margin: 0;
-    }</style><body><div id=app></div><script type=text/javascript src=/static/js/manifest.js></script><script type=text/javascript src=/static/js/vendor.js></script><script type=text/javascript src=/static/js/app.js></script></body></html>
+<!DOCTYPE html><html><head><meta charset=utf-8><title>家政</title><meta charset=UTF-8><meta name=viewport content="width=device-width,user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1"><meta http-equiv=X-UA-Compatible content="ie=edge"><link rel=stylesheet href=https://res.wx.qq.com/open/libs/weui/1.1.2/weui.min.css><script type=text/javascript src=https://res.wx.qq.com/open/libs/weuijs/1.1.2/weui.min.js></script><link href=/static/css/app.css rel=stylesheet></head><style>html {
+    font-size: 120%;
+  }
+
+  * {
+    padding: 0;
+    margin: 0;
+  }</style><body><div id=app></div><script type=text/javascript src=/static/js/manifest.js></script><script type=text/javascript src=/static/js/vendor.js></script><script type=text/javascript src=/static/js/app.js></script></body></html>

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
www/webapp/housekeeping/home/static/css/app.css


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
www/webapp/housekeeping/home/static/js/app.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
www/webapp/housekeeping/home/static/js/app.js.map


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
www/webapp/housekeeping/home/static/js/manifest.js.map


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
www/webapp/housekeeping/home/static/js/vendor.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
www/webapp/housekeeping/home/static/js/vendor.js.map


+ 24 - 23
www/webapp/housekeeping/index.html

@@ -1,26 +1,27 @@
 <!DOCTYPE html>
 <html>
-  <head>
-    <meta charset="utf-8">
-    <title>家政</title>
-    <meta charset="UTF-8">
-    <meta name="viewport"
-          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
-    <meta http-equiv="X-UA-Compatible" content="ie=edge">
-    <link rel="stylesheet" href="https://res.wx.qq.com/open/libs/weui/1.1.2/weui.min.css">
-    <script type="text/javascript" src="https://res.wx.qq.com/open/libs/weuijs/1.1.2/weui.min.js"></script>
-  </head>
-  <style>
-    html{
-      font-size: 120%;
-    }
-    *{
-      padding: 0;
-      margin: 0;
-    }
-  </style>
-  <body>
-    <div id="app"></div>
-    <!-- built files will be auto injected -->
-  </body>
+<head>
+  <meta charset="utf-8">
+  <title>家政</title>
+  <meta charset="UTF-8">
+  <meta name="viewport"
+        content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
+  <meta http-equiv="X-UA-Compatible" content="ie=edge">
+  <link rel="stylesheet" href="https://res.wx.qq.com/open/libs/weui/1.1.2/weui.min.css">
+  <script type="text/javascript" src="https://res.wx.qq.com/open/libs/weuijs/1.1.2/weui.min.js"></script>
+</head>
+<style>
+  html {
+    font-size: 120%;
+  }
+
+  * {
+    padding: 0;
+    margin: 0;
+  }
+</style>
+<body>
+<div id="app"></div>
+<!-- built files will be auto injected -->
+</body>
 </html>

+ 3 - 1
www/webapp/housekeeping/package.json

@@ -16,7 +16,9 @@
     "style-loader": "^0.19.0",
     "vue": "^2.4.2",
     "vue-router": "^2.7.0",
-    "vue-scroller": "^2.2.4"
+    "vue-scroller": "^2.2.4",
+    "vux": "^2.7.7",
+    "vux-loader": "^1.1.30"
   },
   "devDependencies": {
     "autoprefixer": "^7.1.2",

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

@@ -62,6 +62,18 @@
     created() {
 //      console.log(config)
       init();
+
+      function init() {
+        setTimeout(function () {
+          let hBox = document.querySelector('.h-box').clientHeight;
+          let footer = document.querySelector('.footer');
+          let clientHeight = document.documentElement.clientHeight;
+          if (clientHeight - hBox < footer.clientHeight) {
+            footer.style.position = 'static';
+          }
+        }, 200)
+      }
+
       console.log(config.user_id);
       // 用户是否为管理员
       if (config.user_id == '582405cea84ea02e3e8b4611') {
@@ -70,16 +82,6 @@
     }
   }
 
-  function init() {
-    setTimeout(function () {
-      let hBox = document.querySelector('.h-box').clientHeight;
-      let footer = document.querySelector('.footer');
-      let clientHeight = document.documentElement.clientHeight;
-      if (clientHeight - hBox < footer.clientHeight) {
-        footer.style.position = 'static';
-      }
-    }, 200)
-  }
 </script>
 
 <!-- Add "scoped" attribute to limit CSS to this component only -->

+ 39 - 60
www/webapp/housekeeping/src/components/management/edit.vue

@@ -19,9 +19,15 @@
         <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>
         <div><span class="title">预约状态:</span>{{order.contract_str}}</div>
-        <div><span class="title">预约日期:</span><span class="appointment-date" @click='appointmentDate'>{{order.status_time}}</span>
+        <div>
+          <!--选择时间-->
+          <datetime v-model="bookingTime"  format="YYYY-MM-DD HH:00"
+                    @on-change="change" :title="('预约日期')" year-row="{value}年" month-row="{value}月" day-row="{value}日"
+                    hour-row="{value}点" minute-row="{value}分" confirm-text="完成" cancel-text="取消"
+                    :start-date='startDate'
+                    placeholder="请选择日期"
+                    :end-date='endDate' :min-hour=9 :max-hour=18></datetime>
         </div>
-        <div><span class="title">预约日期:</span>{{order.status_time}}</div>
         <div><span class="title">家政员:</span><span v-if="order.tech == ''">暂未分配家政员</span>{{order.tech}}</div>
         <div><span class="title">备注:</span>{{order.desc}}</div>
 
@@ -31,17 +37,25 @@
 </template>
 <script>
   import _ from '@/config'
+  import selectTime from '@/config/selectTime'
+  import {Group, DatetimeRange, TransferDom, Datetime} from 'vux'
 
   export default {
     name: 'orderInfo',
     data() {
       return {
         type: {0: '钟点工', 1: '月嫂', 2: '育婴师', 3: '护理老人', 4: '全套家务'},
-        order: null,
-        eAppointmentDate: false
+        order: {},
+        eAppointmentDate: false,
+        monthArr: {},
+        bookingTime: '', // 服务时间
+        value: ['2017-06-24', '03', '05'], // 设定日期格式
+        startDate: selectTime.startDate, // 限定最小日期
+        endDate: '', // 限定最大日期
       }
     },
     created() {
+      console.log(selectTime.endDate)
       if (_.oldOrderInfo === undefined) {
         this.$router.push({path: '/managementList'})
       }
@@ -58,62 +72,18 @@
         this.eAppointmentDate = true
       }
     },
+    components: {
+      Group,
+      DatetimeRange,
+      TransferDom,
+      Datetime,
+    },
     methods: {
       appointmentDate() {
-        if (this.eAppointmentDate) {
-          let that = this;
-          let currentDate = new Date() // Sat Jun 24 2017 10:09:18 GMT+0800 (中国标准时间)
-          let currentYear = currentDate.getFullYear()  // 当前年 2017
-          let currentMonth = currentDate.getMonth() + 1 // 当前月 6
-          let currentDay = currentDate.getDate() // 当前日 24
-          let now = new Date().getHours() // 当前时 10
-          let min = new Date().getMinutes() // 当前 分
-          // 往后 6个月
-          let monthArr = [];
-          for (let i = 1; i < 7; i++) {
-            monthArr.push({
-              label: m(i),
-              value: i - 1
-            })
-          }
-
-          function m(i) {
-            let d = new Date();
-            // 因为getMonth()获取的月份的值只能在0~11之间所以我们在进行setMonth()之前先给其减一
-            d.setMonth((d.getMonth() - 1) + i);
-            let m = d.getMonth() + 1;
-            return m
-          }
-
-          console.log(monthArr);
-
-          weui.picker([currentYear], [monthArr], {
-            onChange: function (result) {
-              console.log(result);
-            },
-            onConfirm: function (result) {
-              console.log(result);
-            },
-            id: 'multiPickerBtn'
-          });
-
-          weui.datePicker({
-            start: new Date(), // 从今天开始
-            end: currentYear + 20,
-            defaultValue: [currentYear, currentMonth, currentDay, now, min],
-            onChange: function (result) {
-              //            console.log(result);
-            },
-            onConfirm: function (result) {
-              that.time = result[0].label + result[1].label + result[2].label
-              that.resTime = ycTime(`${result[0].value}-${result[1].value}-${result[2].value}`);
-            },
-            id: 'datePicker'
-          });
-
-
-        }
-      }
+      },
+      change(val) {
+        console.log(val)
+      },
     },
     watch: {
       order: function (val, oldVal) {
@@ -126,6 +96,10 @@
 
 </script>
 <style scoped lang="less">
+  .weui-cell {
+    padding: 0 15px 0 0 !important;
+  }
+
   title {
     display: block;
     padding: 15px 0;
@@ -147,10 +121,15 @@
         border-bottom: 0;
       }
       & > span:nth-child(1) {
-        width: 20%;
+        width: 25%;
         display: inline-block;
         margin-right: 20px;
       }
     }
   }
-</style>
+
+  p {
+    color: #2c3e50!important;
+    font-size: 15px!important;
+  }
+</style>

+ 0 - 33
www/webapp/housekeeping/src/config/format.js

@@ -1,33 +0,0 @@
-module.exports = function format(date, fmt = 'YYYY-MM-DD HH:mm:ss') {
-  var o = {
-    'M+': date.getMonth() + 1,
-    'D+': date.getDate(),
-    'h+': date.getHours() % 12 === 0 ? 12 : date.getHours() % 12,
-    'H+': date.getHours(),
-    'm+': date.getMinutes(),
-    's+': date.getSeconds(),
-    'q+': Math.floor((date.getMonth() + 3) / 3),
-    'S': date.getMilliseconds()
-  }
-  var week = {
-    '0': '\u65e5',
-    '1': '\u4e00',
-    '2': '\u4e8c',
-    '3': '\u4e09',
-    '4': '\u56db',
-    '5': '\u4e94',
-    '6': '\u516d'
-  }
-  if (/(Y+)/.test(fmt)) {
-    fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length))
-  }
-  if (/(E+)/.test(fmt)) {
-    fmt = fmt.replace(RegExp.$1, ((RegExp.$1.length > 1) ? (RegExp.$1.length > 2 ? '\u661f\u671f' : '\u5468') : '') + week[date.getDay() + ''])
-  }
-  for (var k in o) {
-    if (new RegExp('(' + k + ')').test(fmt)) {
-      fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
-    }
-  }
-  return fmt
-}

+ 33 - 0
www/webapp/housekeeping/src/config/selectTime.js

@@ -0,0 +1,33 @@
+let startDate = '' // 2017-01-01
+let endDate = '' // 2017-02-02
+let value = '' // value: ['2017-06-24', '03', '05']
+let serviceHours = ''  // 服务时间
+let currentDate = new Date() // Sat Jun 24 2017 10:09:18 GMT+0800 (中国标准时间)
+let currentYear = currentDate.getFullYear()  // 当前年 2017
+let currentMonth = currentDate.getMonth() + 1 // 当前月 6
+let newCurrentMonth =currentMonth
+if( newCurrentMonth< 10){
+  newCurrentMonth = `0${newCurrentMonth}`
+}
+let currentDay = currentDate.getDate() // 当前日 24
+// let now = new Date().getHours() // 当前时 10
+// let min = new Date().getMinutes() // 当前 分
+
+let startArr = startDate.split('-')
+let endArr = startDate.split('-')
+let startDateNewdt = new Date(Number(startArr[0]), Number(startArr[1]) - 1, Number(startArr[2]) + 2) // 设置最新预约时间
+// startDate
+startDate = `${currentYear}-${newCurrentMonth}-${currentDay}`;
+// startDate = startDateNewdt.getFullYear() + '-' + (startDateNewdt.getMonth() + 1) + '-' + startDateNewdt.getDate()
+// endDate
+let endDateNewdt = new Date(Number(endArr[0]), Number(endArr[1]) - 1, Number(endArr[2]) + 32) // 设置最晚预约时间
+endDate = endDateNewdt.getFullYear() + '-' + (endDateNewdt.getMonth() + 1) + '-' + endDateNewdt.getDate()
+serviceHours = startDate + ' 9:00'
+export default {
+  startDate: startDate,
+  endDate: endDate,
+  value: value,
+  serviceHours: serviceHours,
+  currentYear: currentYear,
+  currentMonth: currentMonth
+}

+ 1 - 0
www/webapp/housekeeping/src/main.js

@@ -4,6 +4,7 @@ import Vue from 'vue'
 import App from './App'
 import router from './router'
 import VueScroller from 'vue-scroller'
+
 Vue.use(VueScroller)
 Vue.config.productionTip = false
 /* eslint-disable no-new */

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است