diff --git a/app.js b/app.js index a60eb32..6adc98f 100644 --- a/app.js +++ b/app.js @@ -21,7 +21,7 @@ App({ unique_key: "wechatxcx" }).then(res => { let data = JSON.parse(res.data); - data.isTest = data.isTest68? true : false; + data.isTest = data.isTest76? true : false; this.globalData.configJson = data }).then(() => { // 获取ui配置文件 diff --git a/pages/order/scene/index.js b/pages/order/scene/index.js index 2e38932..f159d0f 100644 --- a/pages/order/scene/index.js +++ b/pages/order/scene/index.js @@ -196,6 +196,7 @@ Page({ }, order: function () { + console.log(this.data) let linkmanList = this.data.linkmanList, productNum = this.data.productNum, date = this.data.date, time = this.data.time, remark = this.data.remark, product = this.data.product; let linkmanIds = []; // if (linkmanList.length < productNum && app.globalData.product.isGroup != 1) { @@ -212,7 +213,7 @@ Page({ }) return } - if (!time && date.is_time_stock == true) { + if (!time && date && date.is_time_stock == true) { wx.showToast({ title: '请选择使用时间', icon: 'none' @@ -229,16 +230,17 @@ Page({ linkmanList.map(item => { linkmanIds.push(item.id) }) + console.log(date) let data = { coupon_id: this.data.coupon ? this.data.coupon.id : null, source: "WECHATXCX", product_list: [{ type: product.product.type, product_id: product.product.id, - sku_id: date.sku_id ? date.sku_id : product.sku.id, + sku_id: (date && date.sku_id) ? date.sku_id : product.sku.id, start_time: time.start_time, end_time: time.end_time, - use_date: date.date, + use_date: date ? date.date : '', visitors: linkmanIds.join(","), remark: remark, product_num: app.globalData.product.isGroup == 1 ? 1 : productNum