洪海涛 8 年之前
父節點
當前提交
1752241a93

+ 6 - 4
www/vue/build/webpack.base.conf.js

@@ -3,7 +3,7 @@ var utils = require('./utils')
 var config = require('../config')
 var config = require('../config')
 var vueLoaderConfig = require('./vue-loader.conf')
 var vueLoaderConfig = require('./vue-loader.conf')
 
 
-function resolve (dir) {
+function resolve(dir) {
   return path.join(__dirname, '..', dir)
   return path.join(__dirname, '..', dir)
 }
 }
 
 
@@ -68,7 +68,9 @@ const webpackConfig = {
 const vuxLoader = require('vux-loader')
 const vuxLoader = require('vux-loader')
 module.exports = vuxLoader.merge(webpackConfig, {
 module.exports = vuxLoader.merge(webpackConfig, {
   options: {},
   options: {},
-  plugins: [{
-    name: 'vux-ui'
-  }]
+  plugins: [
+    {
+      name: 'vux-ui'
+    }
+  ]
 })
 })

文件差異過大導致無法顯示
+ 0 - 0
www/vue/dist/static/css/app.css


文件差異過大導致無法顯示
+ 0 - 0
www/vue/dist/static/js/app.js


文件差異過大導致無法顯示
+ 0 - 0
www/vue/dist/static/js/vendor.js


+ 10 - 6
www/vue/src/components/home.vue

@@ -1,15 +1,19 @@
 <template>
 <template>
   <div class="home">
   <div class="home">
     <swiper></swiper>
     <swiper></swiper>
-    <x-switch :title="('基本信息')"></x-switch>
     <div class='home-img-1'>
     <div class='home-img-1'>
       <img :src='homeImg1' alt="">
       <img :src='homeImg1' alt="">
       <div class="home-nav">
       <div class="home-nav">
-        <div class="">品牌</div>
-        <div class="">管家</div>
-        <div class="">证件</div>
-        <div class="">工具</div>
-        <div class=""><a href="http://commontest.yiguanjia.me/webapp/o2o/module/pay/">赔退</a></div>
+        <!--品牌-->
+        <div class=""></div>
+        <!--管家-->
+        <div class=""></div>
+        <!--证件-->
+        <div class=""></div>
+        <!--工具-->
+        <div class=""></div>
+        <!--赔退-->
+        <div class=""><a href="http://commontest.yiguanjia.me/webapp/o2o/module/pay/"></a></div>
       </div>
       </div>
     </div>
     </div>
     <homeList></homeList>
     <homeList></homeList>

+ 75 - 50
www/vue/src/components/placeOrder.vue

@@ -1,17 +1,12 @@
 <template>
 <template>
   <div class="place-order">
   <div class="place-order">
+    <!--selectTime-->
+    <div>{{startDate}}</div>
+    <h3></h3>
+    <h3></h3>
+    <h3></h3>
+    <h3></h3>
     <h3>placeOrder</h3>
     <h3>placeOrder</h3>
-    <toast v-model="show" text="Hello World"></toast>
-    <div v-transfer-dom>
-      <x-dialog v-model="show" class="dialog-demo">
-        <div class="img-box">
-          <img :src="assets" alt="">
-        </div>
-        <div @click="show=false">
-          <span class="vux-close"></span>
-        </div>
-      </x-dialog>
-    </div>
     <img :src="productBox.pics[0].url" alt="">
     <img :src="productBox.pics[0].url" alt="">
     <!--extra-->
     <!--extra-->
     <div class="extra">
     <div class="extra">
@@ -21,6 +16,19 @@
         </div>
         </div>
       </div>
       </div>
     </div>
     </div>
+    <!--时间选择-->
+    <!--<group :title="value + ''">-->
+      <!--<datetime-range :title="('选择')"  end-date="2017-02-02" @on-change="onChange"></datetime-range>-->
+    <!--</group>-->
+    <!--选择数量-->
+    <group>
+      <x-number title="选择数量" v-model="xNumberValue" :value="0" :min="0" @on-change="change" fillable></x-number>
+    </group>
+    <!--选择时间-->
+    <group>
+      <datetime v-model="value5" :placeholder="('请选择')" :max-year=2017 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="取消" :min-hour=9 :max-hour=18></datetime>
+    </group>
+
     <!--下单-->
     <!--下单-->
     <div class="btn">
     <div class="btn">
       <div class="btn-order" v-on:click="btnOrder">立即下单</div>
       <div class="btn-order" v-on:click="btnOrder">立即下单</div>
@@ -30,8 +38,9 @@
 
 
 <script>
 <script>
   import config from '../config/config'
   import config from '../config/config'
+  import selectTime from '../config/selectTime'
+  import { Group, DatetimeRange, TransferDom, Datetime, XNumber } from 'vux'
   import {mapState, mapActions} from 'vuex'
   import {mapState, mapActions} from 'vuex'
-  import { XDialog, XButton, Group, XSwitch, TransferDomDirective as TransferDom, Toast } from 'vux'
   export default {
   export default {
     name: 'placeOrder',
     name: 'placeOrder',
     data () {
     data () {
@@ -39,21 +48,28 @@
         productBox: config.productInfo,
         productBox: config.productInfo,
         extraB: config.productInfo.extra,
         extraB: config.productInfo.extra,
         isActive: -1,
         isActive: -1,
-        show: true,
-        assets: 'https://static.vux.li/demos/v2/static/img/01.06186f7.jpg'
+        show: false,
+        value5: '',
+        assets: 'https://static.vux.li/demos/v2/static/img/01.06186f7.jpg',
+        value: ['2017-06-24', '03', '05'],
+        startDate: selectTime.startDate,
+        xNumberValue: 0
       }
       }
     },
     },
+    // 指令
     directives: {
     directives: {
       TransferDom
       TransferDom
     },
     },
+    // 组成组件
     components: {
     components: {
-      XDialog,
-      XButton,
       Group,
       Group,
-      XSwitch,
-      Toast
+      DatetimeRange,
+      TransferDom,
+      Datetime,
+      XNumber
+    },
+    beforeCreate () {
     },
     },
-    beforeCreate () {},
     computed: {
     computed: {
       ...mapState({
       ...mapState({
         order: state => state.order,
         order: state => state.order,
@@ -64,22 +80,30 @@
       ...mapActions([
       ...mapActions([
         'PAYCHANGE'
         'PAYCHANGE'
       ]),
       ]),
+      change (val) {
+        console.log(val)
+        config.order.time = val
+      },
       btnOrder: function (cb) {
       btnOrder: function (cb) {
-        config.formData = new FormData()
-        const balance = 0
-        let productParamJson = ''
-        productParamJson = JSON.stringify([{
-          product_id: '57e3a5a49f5160c9048b457c', // 产品ID
-          count: '1' // 产品数量
-        }])
-        //  let coupons = qs.stringify({0: '5836a1979f5160a7048b5a51'})
-        //  let coupons = JSON.stringify({0: ''})
-        let extraJson = ''
-        extraJson = JSON.stringify([{type: '整间日常清洁', price: '388'}])
-        const channel = 'wx_pub'
-        const addressId = this.$store.state.user.userInfo.shop_address[0].address_id
-        const time = '2017-06-21 11:00'
-        config.orderInfo = ''
+        config.order.id = config.productInfo.id
+        console.log(config.order.id)
+        console.log(config.order.time)
+        console.log(config.order)
+//        config.formData = new FormData()
+//        const balance = 0
+//        let productParamJson = ''
+//        productParamJson = JSON.stringify([{
+//          product_id: config.productInfo.id, // 产品ID
+//          count: '1' // 产品数量
+//        }])
+//        //  let coupons = qs.stringify({0: '5836a1979f5160a7048b5a51'})
+//        //  let coupons = JSON.stringify({0: ''})
+//        let extraJson = ''
+//        extraJson = JSON.stringify([{type: '整间日常清洁', price: '388'}])
+//        const channel = 'wx_pub'
+//        const addressId = this.$store.state.user.userInfo.shop_address[0].address_id
+//        const time = '2017-06-21 11:00'
+//        config.orderInfo = ''
 //        config.formData.append('balance', balance)
 //        config.formData.append('balance', balance)
 //        config.formData.append('products', productParamJson)
 //        config.formData.append('products', productParamJson)
 //        config.formData.append('precedence', 0)
 //        config.formData.append('precedence', 0)
@@ -91,21 +115,21 @@
 //        config.formData.append('counts', '1')
 //        config.formData.append('counts', '1')
 //        config.formData.append('extra', extraJson)
 //        config.formData.append('extra', extraJson)
 //        config.formData.append('order_channel', 'wx_pub')
 //        config.formData.append('order_channel', 'wx_pub')
-        let tmp = {
-          balance: balance,
-          products: productParamJson,
-          precedence: 0,
-          booking_time: time,
-          order_channel: channel,
-          user_id: config.userId,
-          address_id: addressId,
-          station: '57db39709f5160bb048b456a',
-          //  coupons: coupons,
-          counts: 1,
-          extra: extraJson
-        }
-        config.orderInfo = tmp
-        this.PAYCHANGE()
+//        let tmp = {
+//          balance: balance,
+//          products: productParamJson,
+//          precedence: 0,
+//          booking_time: time,
+//          order_channel: channel,
+//          user_id: config.userId,
+//          address_id: addressId,
+//          station: '57db39709f5160bb048b456a',
+//          //  coupons: coupons,
+//          counts: 1,
+//          extra: extraJson
+//        }
+//        config.orderInfo = tmp
+//        this.PAYCHANGE()
       },
       },
       btnAction: function (index) {
       btnAction: function (index) {
         this.isActive = index
         this.isActive = index
@@ -164,13 +188,14 @@
     color: #ffffff;
     color: #ffffff;
     font-size: 15px;
     font-size: 15px;
   }
   }
+
   img {
   img {
     display: block;
     display: block;
     width: 100%;
     width: 100%;
   }
   }
 
 
   .dialog-demo {
   .dialog-demo {
-    .weui-dialog{
+    .weui-dialog {
       border-radius: 8px;
       border-radius: 8px;
       padding-bottom: 8px;
       padding-bottom: 8px;
     }
     }

+ 80 - 0
www/vue/src/components/selectTime.vue

@@ -0,0 +1,80 @@
+<template>
+  <div class="picker-body">
+    <!--日期-->
+    <div class="picker-day-box">
+      <div class=" picker-day">
+        <ul class="row">
+          <li class="col-md-3 day" v-for="item in dayNamesA">
+            <span>{{item}}</span><br>
+            <small>{{item}}</small>
+          </li>
+        </ul>
+      </div>
+    </div>
+    <!--时间-->
+    <div></div>
+    <button @click="dayList">时间</button>
+  </div>
+</template>
+
+<script>
+  export default {
+    name: 'selectTime',
+    data () {
+      return {
+        dayNamesA: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'],
+        dayNamesB: '今天'
+      }
+    },
+    methods: {
+      dayList: function () {
+        /* get currentMonthLenght */
+        let currentMonthLength = new Date(this.tmpYear, this.tmpMonth + 1, 0).getDate()
+        /* get currentMonth day */
+        let daylist = Array.from({length: currentMonthLength}, (value, index) => {
+          return index + 1
+        })
+        console.log(currentMonthLength)
+        console.log('currentMonthLength')
+        console.log(daylist)
+        console.log('daylist')
+      }
+    }
+  }
+</script>
+
+<style lang="less" scoped>
+  .picker-body {
+    position: relative;
+    width: 100%;
+    .picker-day-box {
+      position: relative;
+      height: 70px;
+      padding-left: 10px;
+      padding-right: 10px;
+      background: #fff;
+      .picker-day {
+        overflow-x: auto;
+        width: 100%;
+        height: 72px;
+        ul {
+          min-width: 560px;
+          transition: all .3s linear;
+          margin-right: 0;
+          margin-left: 0;
+          li.day {
+            text-align: center;
+            display: block;
+            font-size: 16px;
+            padding: 10px;
+            float: left;
+            width: 70px;
+          }
+          li.day.on {
+            color: #5689d6;
+          }
+        }
+      }
+    }
+  }
+</style>

+ 3 - 1
www/vue/src/config/config.js

@@ -6,6 +6,7 @@ let userId = ''
 let formData = ''
 let formData = ''
 let orderInfo = []
 let orderInfo = []
 let productInfo = []
 let productInfo = []
+let order = []
 
 
 if (uri.indexOf('common.yiguanjia.me') > -1) {
 if (uri.indexOf('common.yiguanjia.me') > -1) {
   test = false
   test = false
@@ -35,5 +36,6 @@ export default {
   formData: formData,
   formData: formData,
   orderInfo: orderInfo,
   orderInfo: orderInfo,
   test: test,
   test: test,
-  productInfo: productInfo
+  productInfo: productInfo,
+  order: order
 }
 }

+ 5 - 0
www/vue/src/config/order.js

@@ -0,0 +1,5 @@
+let order = ''
+
+export default {
+  order: order
+}

+ 18 - 0
www/vue/src/config/selectTime.js

@@ -0,0 +1,18 @@
+let startDate = '' // 2017-01-01
+let endDate = '' // 2017-02-02
+let value = '' // value: ['2017-06-24', '03', '05']
+
+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() // 当前 分
+startDate = currentYear + '-' + currentMonth + '-' + (currentDay + 7)
+console.log(startDate)
+
+export default {
+  startDate: startDate,
+  endDate: endDate,
+  value: value
+}

部分文件因文件數量過多而無法顯示