|
@@ -107,6 +107,9 @@
|
|
|
}
|
|
|
},
|
|
|
created () {
|
|
|
+ if (config.station === '') {
|
|
|
+ config.station = '57db39709f5160bb048b456a'
|
|
|
+ }
|
|
|
if (config.orderPrice === '') {
|
|
|
config.orderPrice = 0
|
|
|
}
|
|
@@ -159,6 +162,7 @@
|
|
|
config.order.time = val
|
|
|
},
|
|
|
btnOrder: function () {
|
|
|
+ console.log(config.order.extra)
|
|
|
// 判断服务是否选择
|
|
|
if (localStorage.getItem('extra') === null && config.productInfo.extra.length !== 0) {
|
|
|
// config.order.extra = ''
|
|
@@ -171,14 +175,14 @@
|
|
|
config.order.userId = config.userId
|
|
|
config.order.memo = this.remarks
|
|
|
config.order.id = config.productInfo.id
|
|
|
- config.order.products = JSON.stringify([{
|
|
|
+ config.order.products = JSON.stringify({
|
|
|
product_id: config.productInfo.id, // 产品ID
|
|
|
count: this.xNumberValue // 产品数量
|
|
|
- }])
|
|
|
+ })
|
|
|
console.log(this.$store.state.user.userInfo.balance)
|
|
|
|
|
|
// 获得余额支付的金额
|
|
|
-
|
|
|
+ console.log(config.xNumberValue)
|
|
|
// 判断用户余额大于等于订单金额,满足条件走余额支付
|
|
|
if (this.$store.state.user.userInfo.balance >= this.orderPrice) {
|
|
|
config.order.balance = this.orderPrice
|
|
@@ -188,10 +192,12 @@
|
|
|
config.order.balance = this.$store.state.user.userInfo.balance
|
|
|
this.orderPrice = this.orderPrice - config.order.balance
|
|
|
}
|
|
|
- let productParamJson = [{'product_id': config.productInfo.id, 'count': JSON.stringify(config.xNumberValue)}]
|
|
|
+ let productParamJson = [{'product_id': config.productInfo.id, 'count': config.xNumberValue}]
|
|
|
+ productParamJson = JSON.stringify(productParamJson)
|
|
|
+ console.log(config.order.extra)
|
|
|
let tmp = {
|
|
|
balance: config.order.balance,
|
|
|
- products: JSON.stringify(productParamJson),
|
|
|
+ products: productParamJson,
|
|
|
memo: config.order.memo,
|
|
|
precedence: config.productInfo.order,
|
|
|
booking_time: this.bookingTime,
|
|
@@ -206,6 +212,7 @@
|
|
|
user_id: config.userId
|
|
|
}
|
|
|
config.orderInfo = tmp
|
|
|
+ console.log(config.orderInfo)
|
|
|
api.addOrder()
|
|
|
},
|
|
|
btnAction: function (index, event) {
|