|
@@ -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;
|
|
}
|
|
}
|