Browse Source

预约修改

master
nige 3 years ago
parent
commit
5764db5d84
  1. 2
      app.js
  2. 1
      pages/info/museumInfo/index.js
  3. 1
      pages/info/sceneProductInfo/index.js
  4. 12
      pages/order/scene/index.js
  5. 4
      pages/order/scene/index.wxml

2
app.js

@ -21,7 +21,7 @@ App({
unique_key: "wechatxcx" unique_key: "wechatxcx"
}).then(res => { }).then(res => {
let data = JSON.parse(res.data); let data = JSON.parse(res.data);
data.isTest = data.isTest67? true : false; data.isTest = data.isTest68? true : false;
this.globalData.configJson = data this.globalData.configJson = data
}).then(() => { }).then(() => {
// 获取ui配置文件 // 获取ui配置文件

1
pages/info/museumInfo/index.js

@ -451,6 +451,7 @@ Page({
isGroup: this.data.isGroup, isGroup: this.data.isGroup,
isTeam: this.data.info.team_order && this.data.isGroup?1:0 isTeam: this.data.info.team_order && this.data.isGroup?1:0
} }
app.globalData.index = 0
wx.navigateTo({ wx.navigateTo({
url: '/pages/order/scene/index?type=museum' url: '/pages/order/scene/index?type=museum'
}) })

1
pages/info/sceneProductInfo/index.js

@ -352,6 +352,7 @@ Page({
...sku, ...sku,
...product ...product
} }
app.globalData.index = 0
wx.navigateTo({ wx.navigateTo({
url: '/pages/order/scene/index', url: '/pages/order/scene/index',
}) })

12
pages/order/scene/index.js

@ -8,7 +8,7 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
product: app.globalData.product, product:null,
productNum: 1, productNum: 1,
linkmanList: [], linkmanList: [],
date: "", date: "",
@ -35,12 +35,16 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
console.log(app.globalData.product);
console.log(this.data.date);
this.setData({ this.setData({
product: app.globalData.product,
type: options.type, type: options.type,
kjId: app.globalData.kjId, kjId: app.globalData.kjId,
gp_id: app.globalData.gp_id || app.globalData.team_id, gp_id: app.globalData.gp_id || app.globalData.team_id,
prizeId: wx.getStorageSync('prizeId'), prizeId: wx.getStorageSync('prizeId'),
flag:options.flag, flag:options.flag,
date:null,
ticket_type:app.globalData.product.sku.ticket_type || 1 ticket_type:app.globalData.product.sku.ticket_type || 1
}) })
if (!app.globalData.product) { if (!app.globalData.product) {
@ -60,6 +64,7 @@ Page({
product: app.globalData.product, product: app.globalData.product,
singlePrice: this.data.gp_id ? app.globalData.product.sku.event_price : app.globalData.product.sku.price singlePrice: this.data.gp_id ? app.globalData.product.sku.event_price : app.globalData.product.sku.price
}) })
console.log(this.data.product);
if (!this.data.kjId && !this.data.gp_id && this.data.product.isGroup != 1) { if (!this.data.kjId && !this.data.gp_id && this.data.product.isGroup != 1) {
this.couponCom = this.selectAllComponents("#coupon")[0]; this.couponCom = this.selectAllComponents("#coupon")[0];
} }
@ -269,7 +274,7 @@ Page({
} }
app.globalData.ticketPrice += (this.data.singlePrice * this.data.productNum - (this.data.coupon?this.data.coupon.activity.money:0))/100; app.globalData.ticketPrice += (this.data.singlePrice * this.data.productNum - (this.data.coupon?this.data.coupon.activity.money:0))/100;
console.log(app.globalData); console.log(app.globalData);
if(app.globalData.list && app.globalData.list.length > app.globalData.index + 1){ if(app.globalData.list && app.globalData.list.length > app.globalData.index + 1 &&this.data.type!='museum'){
if(app.globalData.createDate){ if(app.globalData.createDate){
app.globalData.createDate.product_list.push(data.product_list[0]) app.globalData.createDate.product_list.push(data.product_list[0])
}else{ }else{
@ -364,8 +369,7 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
if(app.globalData.list && app.globalData.list.length != 0 && this.data.type!='museum'){
if(app.globalData.list && app.globalData.list.length != 0){
app.globalData.product = app.globalData.list[app.globalData.index] app.globalData.product = app.globalData.list[app.globalData.index]
} }
if (!this.data.isLogin) { if (!this.data.isLogin) {

4
pages/order/scene/index.wxml

@ -1,11 +1,11 @@
<!--pages/order/scene/index.wxml--> <!--pages/order/scene/index.wxml-->
<view class="{{product && product.isGroup==1?'group-order':''}}"> <view class="{{product && product.isGroup==1?'group-order':''}}">
<title title="订单填写"></title> <title title="订单填写"></title>
<view class="product-info" wx:if="{{product}}"> <view class="product-info" wx:if="{{product}}">
<view class="product-title">{{product.product.title + product.isGroup==1?'(团体预约)':product.sku.sku_name}}</view> <view class="product-title">{{product.product.title + product.isGroup==1?'(团体预约)':product.sku.sku_name}}</view>
<view class="product-price" wx:if="{{type=='museum' || type=='activity'}}">免费</view> <view class="product-price" wx:if="{{type=='museum' || type=='activity'}}">免费</view>
</view> </view>
<date wx:if="{{isLogin && type!='activity' && ticket_type == 1}}" bind:onChangeDate="changeDate" bind:onChangeTime="changeTime" <date wx:if="{{isLogin && type!='activity' && ticket_type == 1}}" bind:onChangeDate="changeDate" bind:onChangeTime="changeTime"
product="{{product}}"></date> product="{{product}}"></date>
<view class="box" wx:if="{{product && product.isGroup==1}}"> <view class="box" wx:if="{{product && product.isGroup==1}}">
<view class="box-title"> <view class="box-title">

Loading…
Cancel
Save