|
|
|
@ -21,22 +21,19 @@ Page({ |
|
|
|
* 生命周期函数--监听页面加载 |
|
|
|
*/ |
|
|
|
onLoad: function (options) { |
|
|
|
let key = options.key; |
|
|
|
if(!key){ |
|
|
|
util.back() |
|
|
|
return; |
|
|
|
} |
|
|
|
console.log(options.selectSeatInfo); |
|
|
|
this.setData({ |
|
|
|
prizeId:wx.getStorageSync('prizeId') |
|
|
|
}) |
|
|
|
let product = app.globalData.product,price=0; |
|
|
|
product.info.selectSeatInfo.map(item=>{ |
|
|
|
price = Number(item.price) + Number(price) |
|
|
|
product.info.selectSeatInfo = JSON.parse(options.selectSeatInfo) |
|
|
|
product.info.selectSeatInfo.seatPriceInfo.map(item=>{ |
|
|
|
price =price + Number(item.split('-')[1]) |
|
|
|
}) |
|
|
|
console.log(price); |
|
|
|
this.setData({ |
|
|
|
product:product, |
|
|
|
key:key, |
|
|
|
price:price |
|
|
|
price:price*100 |
|
|
|
}) |
|
|
|
userApi.user_post("user/getMyInfo").then(res=>{ |
|
|
|
this.setData({ |
|
|
|
@ -63,30 +60,30 @@ Page({ |
|
|
|
}) |
|
|
|
return; |
|
|
|
} |
|
|
|
let product = this.data.product,seats_list=[],seats_ids=[]; |
|
|
|
product.info.selectSeatInfo.map(item=>{ |
|
|
|
seats_list.push(item.name); |
|
|
|
seats_ids.push({ |
|
|
|
ext_id:item.ext_id, |
|
|
|
area:item.area || "", |
|
|
|
flag:Number(item.flag) |
|
|
|
}) |
|
|
|
}) |
|
|
|
let product = this.data.product |
|
|
|
// product.info.selectSeatInfo.map(item=>{
|
|
|
|
// seats_list.push(item.name);
|
|
|
|
// seats_ids.push({
|
|
|
|
// ext_id:item.ext_id,
|
|
|
|
// area:item.area || "",
|
|
|
|
// flag:Number(item.flag)
|
|
|
|
// })
|
|
|
|
// })
|
|
|
|
let product_list = [{ |
|
|
|
"type" : "movie",//电影,必填
|
|
|
|
"product_id": product.product.id, |
|
|
|
"sku_id": product.product.sku_info.id, |
|
|
|
"product_num": product.info.selectSeatInfo.length,//也就是锁定的座位数,必填
|
|
|
|
"product_num": product.info.selectSeatInfo.seatInfo.length,//也就是锁定的座位数,必填
|
|
|
|
"reserve_mobile": this.data.tel, |
|
|
|
"use_date": product.info.show_date,//使用日期,Y-m-d日期格式字符串,必填
|
|
|
|
"use_time": product.info.start_end_time,//场次时间,直接传字符串,必填
|
|
|
|
"show_version": product.info.show_version,//场次版本,必填
|
|
|
|
"scene_id": product.product.scene_id,//场景id,我方系统的场景id,必填
|
|
|
|
"schedules_name": product.info.hallName,//放映厅名称,必填
|
|
|
|
"seats_list": seats_list.join(","),//座位中文名称,多个座位逗号分隔,必填
|
|
|
|
"key": this.data.key,//锁座返回的key,必填
|
|
|
|
"seats_list": product.info.selectSeatInfo.seatInfo.join(","),//座位中文名称,多个座位逗号分隔,必填
|
|
|
|
// "key": this.data.key,//锁座返回的key,必填
|
|
|
|
"schedules_id": product.info.schedule_id,//淘票票场次id,必填
|
|
|
|
"seats_ids": seats_ids |
|
|
|
"seats_ids": product.info.selectSeatInfo.seatPriceInfo |
|
|
|
}]; |
|
|
|
let data = { |
|
|
|
product_list:product_list, |
|
|
|
@ -110,6 +107,7 @@ Page({ |
|
|
|
data:JSON.stringify(data) |
|
|
|
}).then(res=>{ |
|
|
|
console.log(res) |
|
|
|
|
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
@ -120,13 +118,14 @@ Page({ |
|
|
|
this.setData({ |
|
|
|
coupon:app.globalData.couponInfo |
|
|
|
}) |
|
|
|
console.log(this.coupon); |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 生命周期函数--监听页面隐藏 |
|
|
|
*/ |
|
|
|
onHide: function () { |
|
|
|
|
|
|
|
app.globalData.couponInfo = null |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
|