Browse Source

购物车优惠券 影院购票

master
nige 3 years ago
parent
commit
c1692094c1
  1. 2
      app.js
  2. 2
      pages/list/activitynew/index.js
  3. 2
      pages/list/activitynew/index.wxml
  4. 16
      pages/list/movieticket/list/cinema/index.js
  5. 2
      pages/list/movieticket/list/cinema/index.wxml
  6. 2
      pages/list/movieticket/list/info/index.wxml
  7. 46
      pages/list/movieticket/list/ticket/index.js
  8. 6
      pages/list/movieticket/list/ticket/index.wxml
  9. 11
      pages/order/movie/index.js
  10. 7
      pages/order/movie/index.wxml
  11. 1
      pages/order/movie/index.wxss
  12. 2
      pages/order/orderList/index.wxml
  13. 12
      pages/order/scene/index.js
  14. 4
      pages/order/scene/index.wxml
  15. 17
      pages/user/cartlist/list.js

2
app.js

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

2
pages/list/activitynew/index.js

@ -14,7 +14,7 @@ Page({
types: [null, 'show', 'exhibition', 'scene', 'movie', 'lecture', 'other'],
weeks: [],
pageNo: 1,
sort: "",
sort: "distance",
list: [],
date: null,
total: 1,

2
pages/list/activitynew/index.wxml

@ -102,7 +102,7 @@
<view class="textOver2" wx:if="{{item.leading_role}}">主演:{{item.leading_role}}</view>
</view>
<view class="btn">
查看
{{movieType==1?'购买':'查看'}}
</view>
</view>
</view>

16
pages/list/movieticket/list/cinema/index.js

@ -113,8 +113,8 @@ Page({
}
let show_id = info.show_id
let cinema_id = info.cinema_id
// let schedule_id = info.schedule_id
// let schedule_id = info.schedule_id
console.log(info);
commonApi._post('Cinema/getProductAndSku',{
show_id,
cinema_id,
@ -125,22 +125,22 @@ Page({
app.globalData.product ={
product:this.data.productInfo,
info:{
hallName:this.data.name,
hallName:info.hall_name,
cinemaName:this.data.name,
show_date:info.show_date,
start_end_time:info.show_time,
show_time:info.show_time,
close_time:info.close_time,
movieName:this.data.movie[this.data.currentNum].title,
show_version:info.show_version,
selectSeatInfo:null,
schedule_id:info.schedule_id
schedule_id:info.schedule_id,
start_end_time:info.show_time
}
}
wx.navigateTo({
url:"/pages/list/movieticket/list/web/index?planData="+ JSON.stringify(planData),
})
})
// wx.navigateTo({
// url: '/pages/list/movieticket/list/seats/index?show_id='+show_id+'&cinema_id='+cinema_id+'&schedule_id='+schedule_id+'&planData='+JSON.stringify(planData),
// })
},
onChange:function(e){
console.log(e)

2
pages/list/movieticket/list/cinema/index.wxml

@ -25,7 +25,7 @@
<view class="type">{{item.show_version}}</view>
<view>{{item.hall_name}}</view>
</view>
<view class="price"><text>¥</text>{{item.price}}</view>
<view class="price"><text>¥</text>{{item.price}}<text style="font-size: 20rpx; color:#999 ;"> 起</text></view>
<view class="btn">
购票
</view>

2
pages/list/movieticket/list/info/index.wxml

@ -25,5 +25,5 @@
</view>
<view style="height:104rpx" wx:if="{{showFlag}}"></view>
<navigator wx:if="{{info && showFlag}}" url="../ticket/index?id={{info.third_id}}&title={{info.title}}" class="fixed-bottom">
<!-- <view class="order-btn">立即购票</view> -->
<view class="order-btn">立即购票</view>
</navigator>

46
pages/list/movieticket/list/ticket/index.js

@ -1,4 +1,5 @@
// pages/list/movieticket/list/ticket/index.js
let app = getApp()
import commonApi from "../../../../../utils/https/common"
import util from "../../../../../utils/util"
Page({
@ -159,7 +160,50 @@ Page({
console.log(res)
})
},
selectMovieSeat(e){
let info = e.currentTarget.dataset.info
let index = e.currentTarget.dataset.index
console.log(index);
console.log(info.schedules);
const areaInfo = JSON.parse(info.schedules[index].schedule_area).map(item => ({...item, price:item.areaPrice,areaId:item.seatAreaId}));
let planData = {
areaInfo,
fee:info.schedules[index].service_fee,
movieName: this.data.title,
planId : info.schedules[index].schedule_id,
planTime : info.schedules[index].show_time,
type:'WECHATXCX',
remake : ''
}
let show_id = info.schedules[index].show_id
let cinema_id = info.schedules[index].cinema_id
// let schedule_id = info.schedule_id
console.log(info);
commonApi._post('Cinema/getProductAndSku',{
show_id,
cinema_id,
}).then(res=>{
app.globalData.product ={
product:res.data,
info:{
hallName:info.schedules[index].hall_name,
cinemaName:info.title,
show_date:info.schedules[index].show_date,
show_time:info.schedules[index].show_time,
close_time:info.schedules[index].close_time,
movieName:this.data.title,
start_end_time:info.schedules[index].show_time,
show_version:info.schedules[index].show_version,
selectSeatInfo:null,
schedule_id:info.schedules[index].schedule_id
}
}
console.log(planData);
wx.navigateTo({
url:"/pages/list/movieticket/list/web/index?planData="+ JSON.stringify(planData),
})
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/

6
pages/list/movieticket/list/ticket/index.wxml

@ -32,11 +32,11 @@
<view class="ciname-distance" wx:if="{{item.distance}}">{{item.distanceText}}</view>
</view>
<view class="tickets-list">
<navigator url="../seats/index?schedule_id={{schedule.schedule_id}}&show_id={{schedule.show_id}}&cinema_id={{schedule.cinema_id}}" class="ticket-item" catchtap="pagePoint" data-event="movie_detail_click" wx:for="{{item.schedules}}" wx:for-item="schedule">
<view data-info="{{item}}" data-index="{{indexY}}" wx:for-index="indexY" class="ticket-item" data-event="movie_detail_click" wx:for="{{item.schedules}}" wx:for-item="schedule" bindtap="selectMovieSeat">
<view style="color:#000;font-size:33rpx">{{schedule.show_time}}</view>
<view style="margin:10rpx 0">{{schedule.show_version}}</view>
<view style="color:#D62828">¥{{schedule.price/100}}</view>
</navigator>
<view style="color:#D62828">¥{{schedule.price}}</view>
</view>
</view>
</view>
<view wx:if="{{list.length==0}}" class="common-empty" style="z-index:-1">

11
pages/order/movie/index.js

@ -14,14 +14,14 @@ Page({
product:null,
price:0,
coupon:null,
prizeId:null
prizeId:null,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log(options.selectSeatInfo);
onLoad: function (options) {
console.log(options);
this.setData({
prizeId:wx.getStorageSync('prizeId')
})
@ -29,7 +29,8 @@ Page({
product.info.selectSeatInfo = JSON.parse(options.selectSeatInfo)
product.info.selectSeatInfo.seatPriceInfo.map(item=>{
price =price +Math.ceil(Number(item.split('-')[1])*1.006 * 100) / 100
})
})
console.log(product);
console.log(price);
this.setData({
product:product,
@ -76,7 +77,7 @@ Page({
"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,//场次时间,直接传字符串,必填
"use_time": product.info.show_time+'-'+product.info.close_time,//场次时间,直接传字符串,必填
"show_version": product.info.show_version,//场次版本,必填
"scene_id": product.product.scene_id,//场景id,我方系统的场景id,必填
"schedules_name": product.info.hallName,//放映厅名称,必填

7
pages/order/movie/index.wxml

@ -5,9 +5,10 @@
<image src="{{product.product.headimg}}" mode="aspectFill"></image>
<view class="info">
<view class="title">{{product.info.movieName}}</view>
<view>{{product.info.show_date}} {{product.info.start_end_time}}{{product.info.show_version}}</view>
<view>{{product.info.cinema_title}}</view>
<view>{{product.info.hallName}} <text wx:for="{{product.info.selectSeatInfo}}">{{item.name}}</text></view>
<view>{{product.info.show_date}} {{product.info.show_time}}-{{product.info.close_time}} {{'('+product.info.show_version+')'}}</view>
<!-- <view>{{product.info.cinema_title}}</view> -->
<view>{{product.info.cinemaName}}</view>
<view>{{product.info.hallName}} <text wx:if="{{product.info.selectSeatInfo}}">{{product.info.selectSeatInfo.seatInfo}}</text></view>
</view>
</view>
<view class="tel-box">

1
pages/order/movie/index.wxss

@ -34,7 +34,6 @@ page {
font-size: 35rpx;
color: #000;
font-weight: 500;
margin-bottom: 20rpx;
}
.tel-box {
display: flex;

2
pages/order/orderList/index.wxml

@ -52,7 +52,7 @@
<view style="flex-shrink:0">订单备注:</view>
<input type="text" bindinput="inputRemark" data-index="{{index}}" placeholder="选填"></input>
</view>
<coupon id="coupon" wx:if="{{!kjId && !gp_id && flag!='mix'}}" money="{{showPrice + postFee}}" sku="{{sku_id}}"></coupon>
<coupon id="coupon" wx:if="{{!kjId && !gp_id}}" money="{{showPrice + postFee}}" sku="{{sku_id}}"></coupon>
<view class="fixed-bottom">
<view class="fixed-price-box">

12
pages/order/scene/index.js

@ -28,15 +28,16 @@ Page({
allowance_price: 0,
pIndex: 0,
flag:null,
ticket_type:1
ticket_type:1,
isCar:'single'
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log(app.globalData.product);
console.log(this.data.date);
console.log(app.globalData.product);
console.log(options.isCar);
this.setData({
product: app.globalData.product,
type: options.type,
@ -45,8 +46,9 @@ Page({
prizeId: wx.getStorageSync('prizeId'),
flag:options.flag,
date:null,
ticket_type:app.globalData.product.sku.ticket_type || 1
})
ticket_type:app.globalData.product.sku.ticket_type || 1,
isCar:options.isCar
})
if (!app.globalData.product) {
util.back();
return;

4
pages/order/scene/index.wxml

@ -34,8 +34,10 @@
</view>
</view>
</view>
<coupon wx:if="{{!kjId && !gp_id && type!='activity' && product && product.isGroup!=1 && flag!='mix'}}" id="coupon"
<coupon wx:if="{{!kjId && !gp_id && type!='activity' && product && product.isGroup!=1 && isCar=='single'}}" id="coupon"
money="{{singlePrice * productNum}}" sku="{{product.sku.id}}"></coupon>
<view class="box" wx:if="{{type!='activity' && product && product.isGroup!=1}}">
<view class="box-title" wx:if="{{flag!='mix'}}">
<view style="flex-shrink:0">订单备注</view>

17
pages/user/cartlist/list.js

@ -20,7 +20,8 @@ Page({
allPrice: 0,
productType: '',
manageFlag: false,
flag: false, //判断订单是否同时有商品和票
flag: false, //判断订单是否同时有商品和票
isCar:'single',//判断是否购物车
},
/**
@ -177,7 +178,17 @@ Page({
this.setData({
flag: 'mix'
})
}
}
if ( product1.length > 1) {
this.setData({
isCar:'multiple'
})
}else{
this.setData({
isCar:'single'
})
}
console.log(product1);
app.globalData.postProduct = product;
if (app.globalData.list) {
app.globalData.product = app.globalData.list[app.globalData.index]
@ -189,7 +200,7 @@ Page({
})
} else {
wx.navigateTo({
url: '/pages/order/scene/index',
url: '/pages/order/scene/index?isCar=' + this.data.isCar,
})
}
},

Loading…
Cancel
Save