diff --git a/app.json b/app.json
index 8bba4f0..3fa2a3a 100644
--- a/app.json
+++ b/app.json
@@ -185,6 +185,8 @@
"pages/user/personalInfo/index",
"pages/info/luggageInfo/index",
"pages/order/WineSceneOrder/index",
+ "pages/order/showOrderNew/index",
+ "pages/user/order/showOrderInfo/index",
"pages/user/suggest/suggest"
],
"subpackages": [
diff --git a/pages/component/calendarTheatre/index.js b/pages/component/calendarTheatre/index.js
new file mode 100644
index 0000000..a08d93e
--- /dev/null
+++ b/pages/component/calendarTheatre/index.js
@@ -0,0 +1,154 @@
+// pages/component/myCalendar/index.js
+import util from "../../../utils/util"
+let app = getApp()
+Component({
+ /**
+ * 组件的属性列表
+ */
+ options: {
+ styleIsolation: 'apply-shared',
+ addGlobalClass: true
+ },
+ properties: {
+ datelist:{
+ type:Array,
+ value:[]
+ },
+ activeDay:{
+ type:String,
+ value:''
+ }
+ },
+
+ /**
+ * 组件的初始数据
+ */
+ data: {
+ year: 0,
+ month: 0,
+ date: ['日', '一', '二', '三', '四', '五', '六'],
+ dateArr: [],
+ isToday: 0,
+ isTodayWeek: false,
+ todayIndex: 0,
+ isKj:null,
+ isGp:null
+ },
+ lifetimes: {
+ attached: function() {
+ let now = new Date();
+ let year = now.getFullYear();
+ let month = now.getMonth() + 1;
+ this.dateInit();
+ this.setData({
+ year: year,
+ month: month,
+ isToday: '' + year + month + now.getDate(),
+ isKj:app.globalData.kjId,
+ isGp:app.globalData.gp_id || app.globalData.team_id
+ })
+ let dates={}
+ this.properties.datelist.map(item=>{
+ dates[item.date] = item
+ })
+ console.log(dates)
+ this.setData({
+ dates:dates
+ })
+ }
+ },
+ /**
+ * 组件的方法列表
+ */
+ methods: {
+ dateInit: function (setYear, setMonth) {
+ //全部时间的月份都是按0~11基准,显示月份才+1
+ let dateArr = []; //需要遍历的日历数组数据
+ let arrLen = 0; //dateArr的数组长度
+ let now = setYear ? new Date(setYear, setMonth) : new Date();
+ let year = setYear || now.getFullYear();
+ let nextYear = 0;
+ let month = setMonth || now.getMonth(); //没有+1方便后面计算当月总天数
+ let nextMonth = (month + 1) > 11 ? 1 : (month + 1);
+ let startWeek = new Date(year + '/' + (month + 1) + '/' + 1).getDay(); //目标月1号对应的星期
+ let dayNums = new Date(year, nextMonth, 0).getDate(); //获取目标月有多少天
+ let obj = {};
+ let num = 0;
+
+ if (month + 1 > 11) {
+ nextYear = year + 1;
+ dayNums = new Date(nextYear, nextMonth, 0).getDate();
+ }
+ arrLen = startWeek + dayNums;
+ for (let i = 0; i < arrLen; i++) {
+ if (i >= startWeek) {
+ num = i - startWeek + 1;
+ let date =util.formatDate(new Date(year +'/' + (month + 1) +'/' + num));
+ obj = {
+ isToday: '' + year + (month + 1) + num,
+ dateNum: num,
+ weight: 5,
+ date:date
+ }
+ } else {
+ obj = {};
+ }
+ dateArr[i] = obj;
+ }
+ // dateArr.map(monthDate=>{
+ // console.log(monthDate)
+ // })
+ this.setData({
+ dateArr: dateArr
+ })
+
+ let nowDate = new Date();
+ let nowYear = nowDate.getFullYear();
+ let nowMonth = nowDate.getMonth() + 1;
+ let nowWeek = nowDate.getDay();
+ let getYear = setYear || nowYear;
+ let getMonth = setMonth >= 0 ? (setMonth + 1) : nowMonth;
+
+ if (nowYear == getYear && nowMonth == getMonth) {
+ this.setData({
+ isTodayWeek: true,
+ todayIndex: nowWeek
+ })
+ } else {
+ this.setData({
+ isTodayWeek: false,
+ todayIndex: -1
+ })
+ }
+ },
+ lastMonth: function () {
+ //全部时间的月份都是按0~11基准,显示月份才+1
+ let year = this.data.month - 2 < 0 ? this.data.year - 1 : this.data.year;
+ let month = this.data.month - 2 < 0 ? 11 : this.data.month - 2;
+ this.setData({
+ year: year,
+ month: (month + 1)
+ })
+ this.dateInit(year, month);
+ },
+ nextMonth: function () {
+ //全部时间的月份都是按0~11基准,显示月份才+1
+ let year = this.data.month > 11 ? this.data.year + 1 : this.data.year;
+ let month = this.data.month > 11 ? 0 : this.data.month;
+ this.setData({
+ year: year,
+ month: (month + 1)
+ })
+ this.dateInit(year, month);
+ },
+ onTapDay:function(e){
+ let date = e.currentTarget.dataset.date;
+ console.log(date)
+
+ if (date) {
+ console.log('trigger')
+ this.triggerEvent("onTapDay",date)
+ }
+ },
+ }
+})
diff --git a/pages/component/calendarTheatre/index.json b/pages/component/calendarTheatre/index.json
new file mode 100644
index 0000000..e8cfaaf
--- /dev/null
+++ b/pages/component/calendarTheatre/index.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/component/calendarTheatre/index.wxml b/pages/component/calendarTheatre/index.wxml
new file mode 100644
index 0000000..0c84684
--- /dev/null
+++ b/pages/component/calendarTheatre/index.wxml
@@ -0,0 +1,20 @@
+
+
+
+
+
+ {{year}}年{{month}}月
+
+
+
+
+
+
+
+ {{item.dateNum}}
+
+
+
+
\ No newline at end of file
diff --git a/pages/component/calendarTheatre/index.wxss b/pages/component/calendarTheatre/index.wxss
new file mode 100644
index 0000000..a3d0095
--- /dev/null
+++ b/pages/component/calendarTheatre/index.wxss
@@ -0,0 +1,116 @@
+.date-show{
+ position: relative;
+ width: 250rpx;
+ font-family: PingFang-SC-Regular;
+ font-size: 40rpx;
+ color: #282828;
+ text-align: center;
+ margin: 30rpx auto;
+}
+.lt-arrow,.rt-arrow{
+ position: absolute;
+ top: 1rpx;
+ width: 60rpx;
+ line-height: 60rpx;
+padding-right: 0.6rem;
+}
+.lt-arrow image,.rt-arrow image{
+ width: 40rpx;
+ height: 40rpx;
+}
+.lt-arrow{
+ left: -110rpx;
+ /* transform: rotate(180deg); */
+}
+.rt-arrow{
+ right: -100rpx;
+}
+.header{
+ font-size: 0;
+ padding: 0 24rpx;
+}
+.header>view{
+ display: inline-block;
+ width: 14.285%;
+ color: #333;
+ font-size: 30rpx;
+ text-align: center;
+ border-bottom: 1px solid #D0D0D0;
+ padding: 39rpx 0;
+}
+.weekMark{
+ position: relative;
+}
+.weekMark view{
+ position: absolute;
+ bottom: 0;
+ left: 0;
+ width: 100%;
+ /* border-bottom: 1px solid #22A7F6; */
+}
+.date-box{
+ font-size: 0;
+ padding: 10rpx 0;
+}
+.date-box>view{
+ position: relative;
+ width: 14.285%;
+ color: #020202;
+ font-size: 40rpx;
+ text-align: center;
+ vertical-align: middle;
+ height: 90rpx;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+}
+.date-head{
+ /* height: 60rpx; */
+ /* line-height: 60rpx; */
+ font-size: 26rpx;
+}
+.date-head.disable {
+ color: #999;
+}
+.date-tip {
+ font-size: 24rpx;
+ line-height: 26rpx;
+ color: #D62828;
+}
+.date-tip.disable {
+ color: #999;
+}
+.nowDay .date-head{
+ width: 60rpx;
+ line-height: 60rpx;
+ border-radius: 50%;
+ text-align: center;
+ color: #fff;
+ background-color: #0B898E;
+ margin: 0 auto;
+}
+.date-weight{
+ font-size: 22rpx;
+ padding: 15rpx 0;
+}
+.nowDay .date-weight{
+ color: #0B898E;
+}
+.one{
+ position: absolute;
+ bottom: 0;
+ right: 5rpx;
+ width: 20rpx;
+ height: 20rpx;
+ border-radius: 50%;
+ background-color: red;
+}
+.two{
+ position: absolute;
+ bottom: 30rpx;
+ right: 5rpx;
+ width: 20rpx;
+ height: 20rpx;
+ border-radius: 50%;
+ background-color: blue;
+}
\ No newline at end of file
diff --git a/pages/index/index.js b/pages/index/index.js
index bb5c43c..64f346e 100644
--- a/pages/index/index.js
+++ b/pages/index/index.js
@@ -67,6 +67,8 @@ Page({
videoPlay: false,
},
onLoad: function(options) {
+ wx.getLocation({type: 'gcj02'})
+
console.log('options',options)
// 相城小程序跳转获取用户信息
if(options && options.szxcCode) {
diff --git a/pages/info/showInfo/index.js b/pages/info/showInfo/index.js
index 50f66d4..f4ae96b 100644
--- a/pages/info/showInfo/index.js
+++ b/pages/info/showInfo/index.js
@@ -37,7 +37,10 @@ Page({
showQrCode: false,
wxqrcode: null,
- showDetail: false
+ showDetail: false,
+ lat:120,
+ lng:31,
+ distance: 0
},
/**
@@ -54,12 +57,12 @@ Page({
id: options.id
})
// 获取购物车按钮的位置
- wx.createSelectorQuery().select('#cart').boundingClientRect(function (res) {
- console.log(res)
- that.setData({
- cartTop: res.top
- })
- }).exec()
+ // wx.createSelectorQuery().select('#cart').boundingClientRect(function (res) {
+ // console.log(res)
+ // that.setData({
+ // cartTop: res.top
+ // })
+ // }).exec()
if (options.retailId) {
this.setData({
@@ -75,6 +78,16 @@ Page({
res.data.sku = [sku];
}
res.data.flag = res.data.sku.find(item => item.flag == 'on') ? res.data.flag : 0
+ // 解析 service_desc service_images
+ try {
+ let service_desc = JSON.parse(res.data.service_desc)
+ let service_images = (res.data.service_images ? res.data.service_images.split(",") : [])
+ service_desc.forEach((v,index)=>{
+ v.image = 'https://static.ticket.sz-trip.com'+service_images[index]
+ })
+ res.data.serviceData = service_desc
+ } catch(e) {}
+
let resData = res.data
this.setData({
info: resData,
@@ -82,26 +95,53 @@ Page({
iShop: res.data.supplier_id ? true : false
})
+ this.getDistance()
this.BroswerRecord()
})
// 推荐
commonApi._post("search/product_recommend", {
offset: 0,
- limit: 6,
+ limit: 3,
rand: true,
- type: 'post',
+ type: 'show',
product_ids:options.id,
}).then(res => {
try {
this.setData({
- tjList: res.data.list
+ tjList: res.data.list.slice(0,3)
})
} catch (error) {
console.log(error);
}
})
},
+
+ // 获取距离
+ getDistance () {
+ let that = this
+ wx.getLocation({
+ type: 'gcj02',
+ success: function (res) {
+ that.setData({lat: res.latitude,lon: res.longitude})
+ commonApi.user_post("scene/calculate_distance", {
+ lat1: res.latitude,
+ lng1:res.longitude,
+ lat2:that.data.info.scene_lat,
+ lng2:that.data.info.scene_lon
+ }).then(res => {
+ console.log(res)
+ if (res&&res.data && res.data.distance) {
+ that.setData({
+ distance: res.data.distance
+ })
+ }
+ })
+ }
+ })
+
+ },
+
changeAllowance: function () {
this.setData({
showAllowance: !this.data.showAllowance
@@ -259,9 +299,9 @@ Page({
// })
// return;
// }
- app.globalData.couponInfo = null;
- app.globalData.product = this.data.info;
- app.globalData.retailId = this.data.retailId;
+ // app.globalData.couponInfo = null;
+ // app.globalData.productShow = this.data.info;
+ // app.globalData.retailId = this.data.retailId;
wx.navigateTo({
url: '/pages/order/show/index?id='+this.data.id,
diff --git a/pages/info/showInfo/index.wxml b/pages/info/showInfo/index.wxml
index 2a0d0f9..fa6565c 100644
--- a/pages/info/showInfo/index.wxml
+++ b/pages/info/showInfo/index.wxml
@@ -13,7 +13,7 @@
{{item}}
- 演出时间:{{item}}
+ 演出时间:{{info.subtitle}}
@@ -33,16 +33,16 @@
- 25.5km
+ {{distance}}km
-
- 不支持退款
- 不支持退款
-
- 不支持退款
+
+
+
+ {{item.info}}
+
@@ -64,11 +64,11 @@
演出详情
- 123
+
- 展开全部
- 收起
+ 展开全部
+ 收起
@@ -77,7 +77,7 @@
观看提示
-
+
@@ -133,10 +133,10 @@
-
+
diff --git a/pages/info/showInfo/index.wxss b/pages/info/showInfo/index.wxss
index 284b0b5..441ab09 100644
--- a/pages/info/showInfo/index.wxss
+++ b/pages/info/showInfo/index.wxss
@@ -129,13 +129,12 @@ justify-content: space-between;
margin-top: 27rpx;
width: 100%;
box-sizing: border-box;
- height: 80rpx;
background: #E6F3F3;
border-radius: 13rpx;
- padding: 0 26rpx;
+ padding: 24rpx 5rpx;
display: flex;
align-items: center;
- justify-content: space-between;
+ /* justify-content: space-between; */
font-weight: 500;
@@ -146,7 +145,8 @@ justify-content: space-between;
.show-tip image{
width: 26rpx;
height: 26rpx;
- margin-right: 12rpx;
+ margin:0 12rpx 0 20rpx;
+ flex-shrink: 0;
}
.scroll-all-box {
@@ -231,7 +231,6 @@ justify-content: space-between;
display: flex;
align-items: center;
justify-content: flex-end;
- padding-right: 70rpx;
}
.show-btn view{
width: 158rpx;
diff --git a/pages/list/theatre/index.js b/pages/list/theatre/index.js
index 6deda18..668cd36 100644
--- a/pages/list/theatre/index.js
+++ b/pages/list/theatre/index.js
@@ -9,7 +9,7 @@ Page({
*/
data: {
list:[],
- tagList: [], // 父标签6
+ tagList: [], // 父标签278
total:1,
type:278,
sort:["","weight","distance","weight","price"],
@@ -28,7 +28,7 @@ Page({
withShareTicket: true,
menus: ['shareAppMessage', 'shareTimeline']
})
- // this.getTags()
+ this.getTags()
this.getList();
},
search:function(e){
@@ -106,10 +106,10 @@ Page({
// 获取子标签
getTags () {
- commonApi._post("",{
- tag_id:"278",
+ commonApi._post("product/tag_list",{
+ pid:"278",
}).then(res=>{
- let resData = res.data.list || []
+ let resData = res.data || []
this.setData({
tagList:resData
})
diff --git a/pages/list/theatre/index.wxml b/pages/list/theatre/index.wxml
index 03bdcf0..ff6ce3e 100644
--- a/pages/list/theatre/index.wxml
+++ b/pages/list/theatre/index.wxml
@@ -5,12 +5,10 @@
- 全部
- 距离最近
- 销量最高
- 价格最低
- 销量最高
- 价格最低
+ 全部
+ {{item.name}}
+
@@ -21,8 +19,8 @@
{{item.title}}
- {{"开放时间"}}
- {{"地址"}}
+ {{item.subtitle}}
+ {{item.address}}
¥{{item.price?item.price/100:0}}起
diff --git a/pages/list/theatre/index.wxss b/pages/list/theatre/index.wxss
index e663263..5fded7d 100644
--- a/pages/list/theatre/index.wxss
+++ b/pages/list/theatre/index.wxss
@@ -1,6 +1,7 @@
/* pages/list/theatre/index.wxss */
page{
background: white;
+ padding-bottom: 20rpx;
}
.my-header-search{
diff --git a/pages/order/components/contact/index.wxss b/pages/order/components/contact/index.wxss
index e57dbe5..8ac2731 100644
--- a/pages/order/components/contact/index.wxss
+++ b/pages/order/components/contact/index.wxss
@@ -41,7 +41,7 @@
margin-bottom: 20rpx;
}
.contact-item .contact-other text {
- margin-right: 57rpx;
+ margin-right: 20rpx;
}
.contact-item .icon-bianji1 {
color: #666666;
diff --git a/pages/order/show/index.js b/pages/order/show/index.js
index 412bc6d..eba7e5b 100644
--- a/pages/order/show/index.js
+++ b/pages/order/show/index.js
@@ -8,125 +8,270 @@ Page({
* 页面的初始数据
*/
data: {
- dateArr: [
- {date: '2024-11-19', price: 7000},
- {date: '2024-11-20', price: 7000},
- {date: '2024-11-21', price: 7000},
- ],
- times:[
- {sale_date: "2024-11-19", stock_number: 0, start_time: "07:30", end_time: "08:30"},
- {sale_date: "2024-11-19", stock_number: 2, start_time: "07:30", end_time: "08:30"},
- {sale_date: "2024-11-19", stock_number: 2, start_time: "07:30", end_time: "08:30"},
- {sale_date: "2024-11-19", stock_number: 2, start_time: "07:30", end_time: "08:30"},
- {sale_date: "2024-11-19", stock_number: 2, start_time: "07:30", end_time: "08:30"},
- {sale_date: "2024-11-19", stock_number: 2, start_time: "07:30", end_time: "08:30"},
-
- ],
+ productId: null,
+ dateArr: [],
+ times:[],
+ skuArr: [],
product:null,
dateindex:-1,
timeindex:-1,
- sku_id: null,
- producNum: 1,
+ skuindex: -1,
+
+ selectSku: {price:0},
+
+ activeDate: {date: ''},
+ noStock: false,
cartTop: 0,
cartImgInfo: null,
cartCount: 0,
+
+ // 日历
+ showMoreDateFlag: false,
},
/**
* 生命周期函数--监听页面加载
*/
- onLoad: function (options) {
- let that = this
- let product = app.globalData.product,start_date = util.formatDate(new Date());
- this.setData({
- product:product
- })
- let end_date = util.formatDate(new Date(new Date(start_date.replace(/-/g,'/')).getTime() + 30 * 24 * 60 * 60 * 1000));
- commonApi.user_post("product/product_date_price",{
- sku_id:1208,
- start_date:start_date,
- end_date:end_date
- }).then(res=>{
-
- // this.setData({
- // times:res.data,
- // dateindex:dateindex,
- // timeindex:timeindex
- // })
- console.log(res)
-
- // 获取购物车按钮的位置
- wx.createSelectorQuery().select('#cart').boundingClientRect(function (res) {
- console.log(res)
- that.setData({
- cartTop: res.top
+ onLoad: function (options) {
+ let that = this
+ let id = options.id
+ this.setData({
+ productId: id
+ })
+ // let product = app.globalData.product
+ // console.log(product)
+ // this.setData({
+ // product:product,
+ // })
+
+ this.getProductDetail()
+
+ },
+
+ // 获取商品详情
+ getProductDetail () {
+ commonApi._post("product/get_product_detail", {
+ id: this.data.productId
+ }).then(res => {
+ res.data.flag = res.data.sku.find(item => item.flag == 'on') ? res.data.flag : 0
+ let resData = res.data
+ this.setData({
+ product: resData,
})
- }).exec()
- })
- this.initDate()
- },
+ this.initDate()
+ })
+ },
- getDay: function (date) {
- let d = new Date(date.replace(/-/g, '/')).getDay();
- let days = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"];
- return days[d];
- },
- // 初始化日期
- initDate () {
- let date = this.data.dateArr
- date.forEach(v=>{
- v.short_date = v.date.split("-").splice(1, 2).join("-")
- })
- this.setData({dateArr: date})
-
- this.initTime()
- },
+ getDay: function (date) {
+ let d = new Date(date.replace(/-/g, '/')).getDay();
+ let days = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"];
+ return days[d];
+ },
- // 时间处理
- initTime () {
- let times = this.data.times
- times.forEach(v=>{
- v.week = this.getDay(v.sale_date)
- })
- this.setData({times: times})
- },
+ showMoreDate: function () {
+ this.setData({
+ showMoreDateFlag: true
+ })
+ },
+ hideCalendar: function () {
+ this.setData({
+ showMoreDateFlag: false
+ })
+ },
- // 选择日期
- changeDate:function(e){
- let dateindex = e.currentTarget.dataset.date
- // todo获取时间
- this.setData({
- dateindex: dateindex
- })
+ // 修改日期
+ onTapDay: function (e) {
+ console.log(e.detail)
+ let date = e.detail.date
+ let index = this.data.dateArr.findIndex(v=>v.date==date)
- },
+ let param = {currentTarget: {dataset: {date: index}}}
+ if (index>=0) {
+ this.changeDate(param)
+ this.hideCalendar()
+ }
+ },
+ // 初始化日期
+ initDate () {
+ // 设置90天日期
+ let dateArr = []
+ let now = new Date().getTime()
+ for(let i=0 ;i<=90;i++) {
+ let date = now+i*24*60*60*1000
+ dateArr.push({date: util.formatDate(new Date(date))})
+ }
- selectTime:function(e){
- let dateindex = e.currentTarget.dataset.dateindex,times = this.data.times,timeindex=e.currentTarget.dataset.timeindex;
- if(times[dateindex].screen[timeindex].is_ticket==1){
- this.setData({
- timeindex:timeindex,
- dateindex:dateindex
- })
- }
- },
+ dateArr.forEach(v=>{
+ v.short_date = v.date.split("-").splice(1, 2).join("-")
+ })
+ this.setData({dateArr: dateArr})
+ // 默认选中第一天
+ let param = {currentTarget: {dataset: {date: 0}}}
+ this.changeDate(param)
+ },
+
+ // 选择日期
+ changeDate:function(e){
+ let _this = this
+ let dateindex = e.currentTarget.dataset.date
+ let date = this.data.dateArr[dateindex]
+ let activeDate = {date: date.date}
+ // 获取时间
+ commonApi.user_post("product/get_time_slots", {
+ product_id: _this.data.product.id,
+ date: date.date
+ }).then(res => {
+ console.log(res)
+ let week = _this.getDay(res.data.date)
+ let times = res.data.time_slots
+ times.forEach(v=>{
+ v.sale_date = res.data.date
+ v.week = week
+ })
+ console.log(times)
+
+ let timeindex = times.findIndex(v=>v.total_stock>0 && v.skus.some(x=>x.stock_number>0))
+
+ this.setData({
+ dateindex: dateindex,
+ activeDate:activeDate,
+ times: times,
+ timeindex: -1,
+ skuindex: -1,
+ selectSku: {price:0}
+ })
+
+ if (timeindex>=0) {
+ let param = {currentTarget: {dataset: {date: timeindex}}}
+ this.changeTime(param)
+ }
+ this.judgeNoStock()
+
+ })
- minus: function () {
- if (this.data.producNum == 1) return;
+
+ },
+
+ // 选择时间
+ changeTime:function(e){
+ console.log(e.currentTarget.dataset)
+ let dateindex = e.currentTarget.dataset.date;
+ let time = this.data.times[dateindex]
+ let skuArr = time.skus || []
+ console.log(time)
+ if (time.total_stock<=0) { return}
+
+ //给sku设置余票
this.setData({
- producNum: this.data.producNum - 1
+ timeindex: dateindex,
+ skuArr: skuArr,
+ skuindex: -1,
+ selectSku: {price:0}
})
+ let trueSkuIndex = skuArr.findIndex(v=>v.stock_number>0)
+ if (trueSkuIndex>=0) {
+ let param = {currentTarget: {dataset: {date: trueSkuIndex}}}
+ this.changeSku(param)
+ }
},
- add: function () {
+
+ // 选择sku
+ changeSku:function(e){
+ console.log(e.currentTarget.dataset)
+ let dateindex = e.currentTarget.dataset.date;
+ let sku = this.data.skuArr[dateindex]
+ if (sku.stock_number<=0) { return }
this.setData({
- producNum: this.data.producNum + 1
+ skuindex: dateindex,
+ selectSku: sku
})
},
- next:function(){
-
- },
+
+ judgeNoStock () {
+ let times = this.data.times
+ let data = times.length<=0 || times.every(v=>v.total_stock<=0)
+ this.setData({
+ noStock: data
+ })
+ },
+
+ showOrder:function(){
+ let date = this.data.dateArr[this.data.dateindex]
+ if (!date) {
+ wx.showToast({title: '请选择日期',icon: "none"});
+ return
+ }
+ date.week = this.getDay(date.date)
+
+ let time = this.data.times[this.data.timeindex]
+ if (!time) {
+ wx.showToast({title: '请选择场次',icon: "none"});
+ return
+ }
+
+ if (this.data.skuindex<0) {
+ wx.showToast({title: '请选择票档',icon: "none"});
+ return
+ }
+
+ let product = this.data.product
+ console.log(product)
+ let skuSelect = this.data.skuArr[this.data.skuindex]
+ let sku = this.data.product.sku.find(v=>v.id == skuSelect.id)
+ sku = JSON.parse(JSON.stringify(sku))
+ sku.display_tags = sku.display_tags?sku.display_tags.split(","):[];
+
+
+
+ // commonApi.user_post("/product/checkStock", {
+ // sku_id: sku.id
+ // }).then(res => {
+ // if (res && res.code != 1) {
+ // wx.showModal({
+ // title: "温馨提示",
+ // content: '商品已经被抢光啦~要不要瞧瞧别的~',
+ // showCancel: false
+ // })
+ // return;
+ // } else {
+ app.globalData.postProduct = []
+ app.globalData.list = []
+ app.globalData.listName = null
+
+ if (product.flag==0 || sku.flag=='off') return;
+ // if (e.currentTarget.dataset.disable === 1) return;
+ // util.pagePoint({
+ // event: 'scene_order',
+ // param: {
+ // type: this.data.info.type,
+ // id: this.data.info.id
+ // }
+ // }, 1)
+ // wx.setStorageSync('login_from', 'scene_order_login')
+ // wx.setStorageSync('order_from', 'scene_order_submit')
+ app.globalData.couponInfo = null;
+ // app.globalData.retailId = this.data.retailId;
+
+ app.globalData.product = {
+ product: product,
+ sku: sku
+ }
+ date.price = skuSelect.price
+ app.globalData.product.date = date
+ app.globalData.product.time = time
+ app.globalData.product.price = skuSelect.price
+ app.globalData.product.productNum = 1
+ console.log(app.globalData.product)
+ app.globalData.index = 0
+ wx.navigateTo({
+ url: '/pages/order/showOrderNew/index',
+ })
+ // }
+
+ // })
+ },
/**
* 生命周期函数--监听页面初次渲染完成
*/
@@ -138,7 +283,7 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
- this.getCartNum()
+ // this.getCartNum()
},
// 获取购物车数量
diff --git a/pages/order/show/index.json b/pages/order/show/index.json
index 35cf02f..cb8bb39 100644
--- a/pages/order/show/index.json
+++ b/pages/order/show/index.json
@@ -1,5 +1,6 @@
{
"usingComponents": {
- "title":"/pages/component/TitleHeader"
+ "title":"/pages/component/TitleHeader",
+ "calendar":"/pages/component/calendarTheatre/index"
}
}
\ No newline at end of file
diff --git a/pages/order/show/index.wxml b/pages/order/show/index.wxml
index 95a9109..c8dba60 100644
--- a/pages/order/show/index.wxml
+++ b/pages/order/show/index.wxml
@@ -1,4 +1,5 @@
+
{{product.title}}
@@ -10,53 +11,71 @@
今天 {{dateArr[0].short_date}}
明天 {{dateArr[1].short_date}}
后天 {{dateArr[2].short_date}}
- 更多
+ {{dateindex>2?dateArr[dateindex].short_date:'更多'}}
-
+
场次
-
-
+
+
+
+
+ 暂无场次
+
+
+
+
{{item.sale_date}} {{item.week}} {{item.start_time}}
-
+
票档
-
- {{item.sale_date}} {{item.week}} {{item.start_time}}
+
+ {{item.sku_name}} ¥{{item.price/100}}
-
+
- 总价:¥560.00
+ 单价:¥{{selectSku.price/100}}
- 加入购物车
+
立即购买
-
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/order/show/index.wxss b/pages/order/show/index.wxss
index 53c245f..71a92e9 100644
--- a/pages/order/show/index.wxss
+++ b/pages/order/show/index.wxss
@@ -10,6 +10,7 @@ page {
font-weight: bold;
font-size: 32rpx;
color: #111111;
+ box-sizing: border-box;
}
.box {
@@ -46,11 +47,9 @@ page {
width: fit-content;
}
.tag{
- padding: 0rpx 19rpx;
+ padding: 15rpx 19rpx;
border: 1px solid #999999;
- height: 67rpx;
- line-height: 67rpx;
- text-align: center;
+ text-align: left;
border-radius: 13rpx;
font-family: PingFang SC;
font-weight: bold;
@@ -180,18 +179,20 @@ page {
height: 73rpx;
line-height: 73rpx;
background: #D62828;
+ border-radius: 39rpx;
+ color: white;
}
- .btns .btn:nth-child(1) {
+ /* .btns .btn:nth-child(1) {
border-radius: 39rpx 0 0 39rpx;
background: white;
- }
+ } */
- .btns .btn:nth-child(2) {
+ /* .btns .btn:nth-child(2) {
border-radius: 0 39rpx 39rpx 0;
color: white;
- }
+ } */
.btns .btn.disable {
background: #ccc;
@@ -200,4 +201,25 @@ page {
.bottom-price{
color: #D62828;
font-size: 36rpx;
+ }
+
+ .calendar-content {
+ background: white;
+ position: absolute;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ padding-bottom: 50rpx;
+ }
+ .short-date {
+ font-weight: 500;
+ font-size: 27rpx;
+ color: #000000;
+ }
+
+ .no-data{
+ width: 353.33rpx;
+ height: 129.33rpx;
+ display: block;
+ margin: 198rpx auto 0;
}
\ No newline at end of file
diff --git a/pages/order/showOrderNew/index.js b/pages/order/showOrderNew/index.js
new file mode 100644
index 0000000..393e269
--- /dev/null
+++ b/pages/order/showOrderNew/index.js
@@ -0,0 +1,708 @@
+// pages/order/scene/index.js
+let app = getApp()
+import util from "../../../utils/util"
+import commonApi from "../../../utils/https/common"
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ product:null,
+ productNum: 1,
+ linkmanList: [],
+ date: "",
+ time: "",
+ remark: "",
+ singlePrice: 0,
+ type: null,
+ coupon:null,
+ isLogin: false,
+ kjId: null,
+ gp_id: null,
+ groupName: "",
+ prizeId: null,
+ select_allowance: false,
+ showAllowance: false,
+ allowance_data: null,
+ allowance_price: 0,
+ pIndex: 0,
+ flag:null,
+ ticket_type:1,
+ isCar:'single',
+ showMask: false,
+ price:0,
+ is_need_idcard:1,
+ is_authentication:1, // 是否实名,0否1是,默认实名
+ phone:'', //不实名时传的手机号
+ is_real_name:1, // 是否是一证一票,0否1是,
+ status:false,
+ date: "",
+ time: "",
+ ydxz:false, //预定须知弹框
+ bookingInfo: null,
+ bookingInfoTitle: "",
+ showDate:false,
+ showDate2:false,
+ showYhq:null,
+ couponFlag:false,
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ this.setData({
+ product: app.globalData.product,
+ type: options.type,
+ kjId: app.globalData.kjId,
+ gp_id: app.globalData.gp_id || app.globalData.team_id,
+ prizeId: wx.getStorageSync('prizeId'),
+ flag:options.flag,
+ date:null,
+ ticket_type:app.globalData.product.sku.ticket_type || 1,
+ isCar:options.isCar,
+ is_need_idcard:app.globalData.product.sku.sku_model.is_need_idcard,
+ is_authentication:app.globalData.product.sku.sku_model.is_authentication,
+ is_real_name:app.globalData.product.sku.sku_model.is_real_name,
+ date: app.globalData.product.date,
+ time: app.globalData.product.time || {},
+ showYhq:app.globalData.listName?false:true
+ })
+ console.log('-------',this.data.product.sku.sku_model);
+ // // debugger
+ console.log('-------',app.globalData.product.sku.sku_model.is_need_idcard);
+ console.log('---是否实名----',app.globalData.product.sku.sku_model.is_authentication);
+ console.log('---一证一票----',app.globalData.product.sku.sku_model.is_real_name);
+ // console.log(app.globalData.list, app.globalData.index,'list---index')
+ if (!app.globalData.product) {
+ util.back();
+ return;
+ }
+ if (!app.globalData.product.time) {
+ app.globalData.product.time = {}
+ }
+ if (app.globalData.product.productNum) {
+ this.setData({
+ productNum: app.globalData.product.productNum < 1 ? 1 : app.globalData.product.productNum
+ })
+ }else{
+ this.setData({
+ productNum: app.globalData.product.num == null ? 1 : app.globalData.product.num
+ })
+ }
+ this.setData({
+ product: app.globalData.product,
+ singlePrice: app.globalData.product.date?app.globalData.product.date.price :(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.singlePrice);
+ this.getNewCoupon()
+ // this.showAllPrice()
+ // console.log('********',this.data.product);
+ if (!this.data.kjId && !this.data.gp_id && this.data.product.isGroup != 1 && this.data.type!='museum') {
+ this.couponCom = this.selectAllComponents("#coupon")[0];
+ }
+ },
+ // next: function () {
+ // this.setData({
+ // showMask:true
+ // })
+ // },
+ // changeDate() {
+ // this.setData({
+ // showDate: true,
+ // })
+ // },
+ hideDate: function () {
+ this.setData({
+ showDate: false
+ })
+ },
+ showBookingInfo: function (e) {
+ this.setData({
+ bookingInfo: this.data.product.sku.sku_model,
+ bookingInfoTitle: this.data.product.sku.sku_name
+ })
+ util.pagePoint({
+ event: "scene_notice",
+ param: {
+ type: this.data.product.type,
+ id: this.data.product.id
+ }
+ }, 1)
+ },
+ closeMask: function () {
+ this.setData({
+ bookingInfo: null
+ })
+ },
+ showAllPrice:function () {
+ // console.log('detail',app.globalData.product);
+ // console.log('singlePrice',this.data.singlePrice);
+ // console.log('productNum',this.data.productNum);
+ console.log('couponInfo',app.globalData.couponInfo);
+ if (this.data.ticket_type != 1) {
+ // this.setData({
+ // singlePrice:app.globalData.product.product.price
+ // })
+ let price
+ if (this.data.coupon) {
+ console.log(app.globalData.couponInfo,this.data.coupon);
+ if (this.data.coupon.activity.discount_type == 'pricebreak') {
+ price = this.data.singlePrice * this.data.productNum - this.data.coupon.activity.money
+ } else {
+ price =(this.data.singlePrice * this.data.productNum * this.data.coupon.activity.fold)/ 10
+ }
+ } else {
+ price = this.data.singlePrice * this.data.productNum
+ }
+
+ if (price >0) {
+ this.setData({
+ price:price/100
+ })
+ }else {
+ this.setData({
+ price:0
+ })
+ }
+ // console.log(this.data.singlePrice);
+ }else {
+ let price
+ if (this.data.coupon) {
+ if (this.data.coupon.activity.discount_type == 'pricebreak') {
+ price = this.data.singlePrice * this.data.productNum - this.data.coupon.activity.money
+ } else {
+ price =(this.data.singlePrice * this.data.productNum * this.data.coupon.activity.fold)/ 10
+ }
+ } else {
+ price = this.data.singlePrice * this.data.productNum
+ }
+ if (price >0) {
+ this.setData({
+ price:price/100
+ })
+ }else {
+ this.setData({
+ price:0
+ })
+ }
+ }
+
+ },
+ cancel: function () {
+ this.setData({
+ showMask:false
+ })
+ },
+ changeGroupName: function (e) {
+ this.setData({
+ groupName: e.detail.value
+ })
+ },
+ setLinkman: function (e) {
+ if (e.detail.phone || e.detail.phone=='') {
+ this.setData({
+ phone:e.detail.phone
+ })
+ }else {
+ console.log(e);
+ let linkmanList = e.detail;
+ if (this.data.productNum != linkmanList.length && this.data.coupon) {
+ wx.showToast({
+ title: '订单价格发生变化,请重新选择优惠券',
+ icon: 'none'
+ })
+
+ }
+ this.setData({
+ // productNum: productNum,
+ linkmanList: linkmanList
+ })
+ console.log(this.data.linkmanList);
+ // this.changePrice()
+ this.totalPrice(this.data.singlePrice)
+ }
+ },
+ add: function () {
+ if (this.data.productNum==undefined) {
+ wx.showToast({
+ title: '请先添加出行人',
+ icon: 'none'
+ })
+ return
+ }
+ if (this.data.product.sku.sku_model.traveller_limit_num != 0 && this.data.productNum == this.data.product.sku.sku_model.traveller_limit_num) {
+ wx.showToast({
+ title: '本产品单笔限购' + this.data.product.sku.sku_model.traveller_limit_num + "份",
+ icon: 'none'
+ })
+ return;
+ }
+ this.setData({
+ productNum: this.data.productNum + 1
+ })
+ this.data.product.num = this.data.productNum
+ // this.changePrice()
+ // this.showAllPrice()
+ this.totalPrice(this.data.singlePrice)
+ },
+ minus: function () {
+ if (this.data.productNum==undefined) {
+ wx.showToast({
+ title: '请先添加出行人',
+ icon: 'none'
+ })
+ return
+ }
+ if (this.data.productNum == 1) return;
+ if (this.data.coupon) {
+ wx.showToast({
+ title: '订单价格发生变化,请重新选择优惠券',
+ icon: 'none'
+ })
+ }
+ if (!this.data.kjId && !this.data.gp_id && this.data.product.isGroup != 1 && !this.data.flag && this.data.type!='museum') {
+ // this.couponCom.setNullCoupon()
+
+ }
+ app.globalData.couponInfo = null;
+ console.log(this.data.couponFlag);
+ this.setData({
+ productNum: (this.data.productNum - 1),
+ coupon: null,
+ couponFlag:true
+ })
+ this.data.product.num = this.data.productNum
+ // this.changePrice()
+ // this.showAllPrice()
+ this.totalPrice(this.data.singlePrice)
+ },
+ totalPrice(price) {
+ let allPrice
+ if (this.data.coupon) {
+ if (this.data.coupon.activity.discount_type == 'pricebreak') {
+ allPrice = this.data.singlePrice * this.data.productNum - this.data.coupon.activity.money
+ } else {
+ allPrice =(this.data.singlePrice * this.data.productNum * this.data.coupon.activity.fold)/ 10
+ }
+ } else {
+ allPrice = this.data.singlePrice * this.data.productNum
+ }
+
+ // allPrice = price * this.data.productNum - (this.data.coupon?this.data.coupon.activity.money:0)
+ if (allPrice >0) {
+ this.setData({
+ price:allPrice/100,
+ singlePrice:price
+ })
+ }else {
+ this.setData({
+ price:0,
+ singlePrice:price
+ })
+ }
+ console.log('singlePrice',this.data.singlePrice);
+ },
+ changeDate: function (e) {
+ console.log('打印',e);
+ this.setData({
+ showDate:true
+ })
+ // debugger
+ // this.showAllPrice()
+ this.totalPrice(e.detail.price)
+ if (e.detail.price != this.data.singlePrice && this.data.coupon) {
+ wx.showToast({
+ title: '订单价格发生变化,请重新选择优惠券',
+ icon: 'none'
+ })
+ this.setData({
+ coupon: null,
+ singlePrice:e.detail.price
+ })
+ if (!this.data.kjId && !this.data.gp_id && this.data.product.isGroup != 1 && this.data.type!='museum') {
+ this.couponCom.setNullCoupon()
+ }
+ app.globalData.couponInfo = null;
+ }
+ app.globalData.product.changeFlag = true
+ this.setData({
+ date: e.detail,
+ singlePrice: this.data.gp_id ? this.data.product.sku.event_price : e.detail.price,
+ showDate2:true
+ })
+ // this.changePrice()
+ },
+ changeTime: function (e) {
+ this.setData({
+ time: e.detail
+ })
+ },
+ changeAllowance: function () {
+ this.setData({
+ showAllowance: !this.data.showAllowance
+ })
+ },
+ phoneInput:function(e){
+ this.setData({
+ phone: e.detail.value
+ })
+ },
+ /**
+ * 补贴价
+ */
+ changePrice: function () {
+ let product = this.data.product, price = product.sku.price;
+ if (this.data.allowance_data && this.data.select_allowance && this.data.allowance_price) {
+ let spread_price = Number(this.data.allowance_data.discount_limit_price - this.data.allowance_data.user_used_price);
+ price -= this.data.allowance_price < spread_price ? this.data.allowance_price : spread_price
+ }
+ this.setData({
+ singlePrice: app.globalData.kjId ? 0 : price
+ })
+
+ },
+ changed() {
+ app.globalData.product.date = this.data.date
+ app.globalData.product.time = this.data.time
+ app.globalData.product.changeFlag = true
+ this.hideDate()
+ },
+ order:function() {
+ 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==0 && this.data.is_authentication == 1) {
+ wx.showToast({
+ title: '请选择出行人',
+ icon: 'none'
+ })
+ return
+ }
+ if (this.data.is_authentication == 1) {
+ linkmanList.map(item => {
+ linkmanIds.push(item.id)
+ })
+ }
+ if (this.data.is_authentication == 0) { //是否实名:0否1是
+ if (this.data.phone == '') {
+ wx.showToast({
+ title: '请填写手机号',
+ icon: 'none'
+ })
+ return
+ }
+ }
+ // 判断时间日期
+ if (!date && this.data.ticket_type == 1) {
+ wx.showToast({
+ title: '请选择使用日期',
+ icon: 'none'
+ })
+ return
+ }
+ if (!time && date && date.is_time_stock == true) {
+ wx.showToast({
+ title: '请选择使用时间',
+ icon: 'none'
+ })
+ return
+ }
+
+ 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 && date.sku_id) ? date.sku_id : product.sku.id,
+ start_time: time.start_time,
+ end_time: time.end_time,
+ use_date: date ? date.date : '',
+ visitors: linkmanIds.join(","),
+ remark: remark,
+ product_num: app.globalData.product.isGroup == 1 ? 1 : productNum,
+ phone:this.data.phone,// 不实名的时候传的手机号参数
+ }],
+ originate_order_id: this.data.kjId,
+ gp_id: app.globalData.gp_id,
+ team_id: app.globalData.team_id,
+ linkmanList:this.data.is_authentication == 1?this.data.linkmanList:[]
+ }
+ if (app.globalData.from) {
+ data.system_name = app.globalData.from;
+ }
+ if (app.globalData.retailId) {
+ data.commission_code = app.globalData.retailId;
+ app.globalData.retailId = null;
+ }
+ if (app.globalData.category_id) {
+ data.category_id = app.globalData.category_id;
+ }
+ if (this.data.prizeId) {
+ data.lottery_id = this.data.prizeId
+ }
+ console.log(data)
+ let service = 'order/create', postData = {
+ data: JSON.stringify(data)
+ }
+ if (app.globalData.product.isGroup == 1) {
+ service = "team_order/appoint"
+ postData.member_num = this.data.productNum
+ postData.team_name = this.data.groupName
+ postData.type = 1;
+ }
+ if(app.globalData.list){
+ app.globalData.list[app.globalData.index] = this.data.product
+ // app.globalData.list[app.globalData.index].linkmanList = this.data.linkmanList
+ if (app.globalData.list[app.globalData.index].sku.sku_model.is_authentication == 0) {
+ app.globalData.list[app.globalData.index].phone = this.data.phone
+ app.globalData.list[app.globalData.index].linkmanList = []
+ }else {
+ app.globalData.list[app.globalData.index].linkmanList = this.data.linkmanList
+ }
+ }
+ // app.globalData.linkmanList = this.data.linkmanList
+ app.globalData.ticketPrice += (this.data.singlePrice * this.data.productNum - (this.data.coupon?this.data.coupon.activity.money:0))/100;
+ console.log(app.globalData);
+ if(app.globalData.list && app.globalData.list.length > app.globalData.index + 1 &&this.data.type!='museum'){
+ if(app.globalData.createDate){
+ app.globalData.createDate.product_list.push(data.product_list[0])
+ }else{
+ app.globalData.createDate = data
+ }
+ console.log(app.globalData.createDate);
+ app.globalData.index = app.globalData.index + 1
+ app.globalData.product = app.globalData.list[app.globalData.index]
+ wx.redirectTo({
+ url: '/pages/order/scene/index?flag='+ this.data.flag+'&isCar='+this.data.isCar,
+ })
+ return
+ }else{
+ if(app.globalData.list && app.globalData.list.length > 1 || app.globalData.postProduct.length>0){
+ if(app.globalData.createDate){
+ app.globalData.createDate.product_list.push(data.product_list[0])
+ }
+ wx.redirectTo({
+ url: '/pages/order/orderList/index?flag='+ this.data.flag
+ })
+ }else{
+ commonApi.user_post(service, postData).then(res => {
+ if (app.globalData.kjId) {
+ this.setData({
+ kjId: null
+ });
+ app.globalData.kjId = null;
+ }
+ if (app.globalData.gp_id) {
+ this.setData({
+ gp_id: null
+ });
+ app.globalData.gp_id = null;
+ }
+ if (res.code == 1 && app.globalData.product.isGroup == 1) {
+ // 团购跳转到团购详情
+ wx.navigateTo({
+ url: '/pages/info/groupOrderInfo/index?id=' + res.data.order_id + '&from=order'
+ })
+ }
+ })
+ }
+ }
+ },
+ next: 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 (!date && this.data.ticket_type == 1) {
+ wx.showToast({
+ title: '请选择使用日期',
+ icon: 'none'
+ })
+ return
+ }
+ if (linkmanList.length!=productNum && this.data.is_authentication == 1 && this.data.is_real_name == 1) {
+ wx.showToast({
+ title: '购票数量要和出行人数量一致',
+ icon: 'none'
+ })
+ return
+ }
+ if (!util.isTel(this.data.phone) &&this.data.is_authentication == 0) {
+ wx.showToast({
+ title: '请输入正确的手机号',
+ icon: 'none'
+ })
+ return
+ }
+ if (!time && date && date.is_time_stock == true) {
+ wx.showToast({
+ title: '请选择使用时间',
+ icon: 'none'
+ })
+ return
+ }
+ if (app.globalData.product.isGroup == 1 && !this.data.groupName) {
+ wx.showToast({
+ title: '请输入团队主体名称',
+ icon: 'none'
+ })
+ return;
+ }
+
+ this.setData({
+ showMask:true
+ })
+
+ },
+ // 活动预约
+ activityOrder: function () {
+ if (this.data.linkmanList && this.data.linkmanList.length > 0) {
+ commonApi.user_post("pbservice/Culture/booking", {
+ id: this.data.product.product.id,
+ name: this.data.linkmanList[0].name,
+ card_number: this.data.linkmanList[0].id_number,
+ tel: this.data.linkmanList[0].tel
+ }).then(res => {
+ if (res.code == 1) {
+ wx.showToast({
+ title: '预约成功',
+ icon: 'success'
+ })
+ setTimeout(() => {
+ wx.navigateBack()
+ }, 1000)
+ return;
+ }
+ })
+ }
+ else {
+ wx.showToast({
+ title: '请选择出行人',
+ icon: 'none'
+ })
+ return;
+ }
+
+ },
+ /**
+ * 选择补贴
+ */
+ selectAllowance: function () {
+ this.setData({
+ select_allowance: !this.data.select_allowance
+ })
+ this.changePrice()
+ },
+ //获取最高优惠券
+ getNewCoupon(e){
+
+ this.setData({
+ coupon:e.detail
+ })
+
+ this.showAllPrice()
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+ // this.setData({
+ // productNum:1
+ // })
+ // app.globalData.productNum =1
+ if(app.globalData.list && app.globalData.list.length != 0 && this.data.type!='museum'){
+ app.globalData.product = app.globalData.list[app.globalData.index]
+ }
+ if (!this.data.isLogin) {
+ commonApi.user_post("token/check").then(res => {
+ if (res.code == 1) {
+ this.setData({
+ isLogin: true
+ })
+ }
+ })
+ }
+ // this.setData({
+ // coupon: app.globalData.couponInfo
+ // })
+ // 获取补贴
+ // if (this.data.product) {
+ // commonApi.user_post("product/getProductAllowancePrice", {
+ // product_code: this.data.product.product.product_code
+ // }).then(resTwo => {
+ // if (resTwo && resTwo.code == 1) {
+ // this.setData({
+ // allowance_data: resTwo.data
+ // })
+ // let spread_price = Number(this.data.allowance_data.discount_limit_price - this.data.allowance_data.user_used_price)
+ // let sInfo = this.data.product.sku
+ // if (spread_price > 0) {
+ // if (spread_price < this.data.allowance_data.discount_rate / 100 * sInfo.price) {
+ // this.setData({
+ // allowance_price: spread_price
+ // })
+ // } else {
+ // this.setData({
+ // allowance_price: this.data.allowance_data.discount_rate / 100 * sInfo.price
+ // })
+ // }
+ // this.changePrice()
+ // } else {
+ // this.setData({
+ // allowance_price: 0
+ // })
+ // }
+ // }
+ // })
+ // }
+ // console.log('-----',app.globalData.product.sku.price);
+ // app.globalData.product = delete(app.globalData.product.detail)
+ // this.showAllPrice()
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+ this.setData({
+ couponFlag:false
+ })
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+ this.setData({
+ kjId: null,
+ gp_id: null
+ });
+ app.globalData.kjId = null;
+ app.globalData.gp_id = null;
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ }
+})
\ No newline at end of file
diff --git a/pages/order/showOrderNew/index.json b/pages/order/showOrderNew/index.json
new file mode 100644
index 0000000..17ea59b
--- /dev/null
+++ b/pages/order/showOrderNew/index.json
@@ -0,0 +1,10 @@
+{
+ "usingComponents": {
+ "title":"/pages/component/TitleHeader",
+ "date1":"../components/date/index",
+ "contact":"../components/contact/index",
+ "coupon":"../components/coupon/index",
+ "notice":"/pages/component/notice/notice",
+ "date":"/pages/order/components/date"
+ }
+}
\ No newline at end of file
diff --git a/pages/order/showOrderNew/index.wxml b/pages/order/showOrderNew/index.wxml
new file mode 100644
index 0000000..9891d53
--- /dev/null
+++ b/pages/order/showOrderNew/index.wxml
@@ -0,0 +1,116 @@
+
+
+
+
+
+
+
+ {{product.product.title}}
+
+
+ 场次: {{date.date}} {{date.week}} {{time.start_time}}
+
+
+
+
+
+
+
+ {{product && product.isGroup!=1?product.sku.sku_name:'预约人数'}}
+
+
+ {{product.sku.price/100}}
+
+
+
+ {{productNum}}
+
+
+
+
+
+ {{item}}|
+
+ 预订须知 >
+
+
+
+
+
+
+
+
+
+
+
+
+ 合计:¥0
+ 合计:
+ ¥{{price}}
+
+ 去支付
+
+
+
+
+
+
+ {{product.product.title}}-{{product.sku.sku_name}}
+ 出行人信息
+
+
+
+ 姓名:
+ {{item.name}}
+
+
+ 证件号:
+ {{item.id_number}}
+
+
+ 手机号:
+ {{item.tel}}
+
+
+
+
+
+ 手机号:
+ {{phone}}
+
+
+
+
+ 取消
+ 无问题,下一步
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 合计: {{price}}
+
+
+
+ 确定
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/order/showOrderNew/index.wxss b/pages/order/showOrderNew/index.wxss
new file mode 100644
index 0000000..3780f39
--- /dev/null
+++ b/pages/order/showOrderNew/index.wxss
@@ -0,0 +1,457 @@
+/* pages/.wxss */
+page {
+ background: #f6f6f6;
+}
+
+.group-order {
+ background: #fff;
+}
+
+.product-info {
+ padding: 20rpx 47rpx;
+ border-bottom: 1rpx solid #ccc;
+}
+
+.product-title {
+ font-size: 33rpx;
+ color: #000;
+ font-weight: 500;
+}
+
+.product-price {
+ color: #D62828;
+ font-size: 27rpx;
+}
+
+.group-order .box-title {
+ margin: 0;
+}
+
+.group-order .box,
+.group-order .date-box {
+ border-bottom: 1rpx solid #D8D8D8;
+ border-radius: 0;
+ margin: 0 25rpx;
+}
+
+.group-order .dates-boxes {
+ border-top: none;
+ padding-top: 0;
+}
+
+.group-order .date-time.disable {
+ background: #CCCCCC;
+ color: #fff;
+}
+
+.box {
+ margin: 30rpx 25rpx;
+ background: white;
+ border-radius: 9rpx;
+}
+
+.box-title {
+ height:108rpx;
+ margin: 0 20rpx;
+ font-size: 31rpx;
+ color: #000;
+ font-weight: 500;
+ display: flex;
+ align-items: center;
+}
+
+.dates-boxes {
+ display: flex;
+ align-items: center;
+ padding: 31rpx 21rpx;
+ /* border-top: 1rpx solid #ccc; */
+}
+
+.date-item {
+ width: 120rpx;
+ height: 133rpx;
+ border-radius: 10rpx;
+ /* border: 1rpx solid #333; */
+ text-align: center;
+ font-size: 27rpx;
+ color: #000;
+ margin-right: 20rpx;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ flex-direction: column;
+ background: #F5F5F5;
+ flex-shrink: 0;
+}
+
+.date-item.active {
+ border-color: #0B898E;
+ color: #fff;
+ background: #0B898E;
+}
+
+.date-item.disable {
+ border-color: #CCCCCC;
+ color: #999;
+}
+
+.date-item .price {
+ font-size: 25rpx;
+ color: #D62828;
+}
+
+.date-item.active .price {
+ color: #fff;
+}
+.date-item.active view {
+ color: #fff;
+}
+
+.date-item.disable .price {
+ color: #999;
+}
+.date-item.disable .short-date {
+ color: #999;
+}
+
+.more-item {
+ /* width: 99rpx;
+ margin-right: 0; */
+ position: absolute;
+ right: 0;
+ text-align: center;
+ padding: 0 26rpx 0 24rpx;
+ display: flex;
+ font-weight: 400;
+ font-size: 27rpx;
+ color: #0B898E;
+ align-items: center;
+}
+
+.date-times {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ margin: 0 21rpx;
+ padding-top: 34rpx;
+ padding-bottom: 10rpx;
+ /* border-top: 1rpx dashed #ccc; */
+ flex-wrap: wrap;
+}
+
+.date-time {
+ width: 315rpx;
+ line-height: 58rpx;
+ /* border: 1px solid #333; */
+ border-radius: 10rpx;
+ text-align: center;
+ font-size: 25rpx;
+ flex-shrink: 0;
+ margin-bottom: 24rpx;
+ color: #000;
+ background-color: #F5F5F5;
+}
+
+.date-time.disable {
+ /* border-color: #ccc;
+ color: #666666; */
+ background: #F5F5F5;
+ font-weight: 400;
+ font-size: 25rpx;
+ color: #999999;
+}
+.short-date {
+ font-weight: 500;
+ font-size: 27rpx;
+ color: #000000;
+}
+
+.date-time.active {
+ border-color: #0B898E;
+ background: #0B898E;
+ color: #fff;
+}
+
+.box-title .iconfont {
+ font-size: 28rpx;
+ flex-shrink: 0;
+}
+
+.number-box {
+ font-size: 29rpx;
+ font-weight: 500;
+ color: #000;
+ flex-shrink: 0;
+ /* width: 67rpx; */
+ line-height: 49rpx;
+ /* background: #F0F0F0; */
+ border-radius: 7rpx;
+ text-align: center;
+ margin: 0 20rpx;
+}
+
+.fixed-bottom {
+ position: fixed;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ height: 113rpx;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ background: white;
+ z-index: 1;
+ box-shadow: 0px 0px 16rpx 0px rgba(6, 0, 1, 0.1);
+}
+
+.yuyue-box {
+ height: 138rpx;
+ justify-content: center;
+}
+
+.fixed-btn {
+ line-height: 80rpx;
+ width: 250rpx;
+height: 80rpx;
+background: #D62828;
+border-radius: 40rpx;
+margin-right: 50rpx;
+font-family: PingFang SC;
+font-weight: bold;
+font-size: 32rpx;
+color: #FFFFFF;
+text-align: center;
+}
+
+.fixed-price-box {
+ margin-left: 25rpx;
+ flex-shrink: 0;
+ font-size: 29rpx;
+ color: #333;
+ font-weight: 500;
+}
+
+.fixed-price-box .price {
+ color: #D62828;
+ font-size: 36rpx;
+ margin-left: 10rpx;
+}
+
+.allowance {
+ justify-content: space-between;
+}
+
+.allowance>view:nth-child(2) {
+ display: flex;
+ align-items: center;
+}
+
+.allowance image {
+ width: 40rpx;
+ height: 40rpx;
+ margin-left: 10rpx;
+}
+
+.allowance .border {
+ width: 30rpx;
+ height: 30rpx;
+ border-radius: 50%;
+ border: 4rpx solid #0B98BE;
+ margin-left: 10rpx;
+}
+
+.coupon-btn {
+ width: 138rpx;
+ line-height: 56rpx;
+ border: 1px solid #333333;
+ border-radius: 29rpx;
+ text-align: center;
+ font-size: 28rpx;
+ color: #000;
+}
+
+.box-title input {
+ flex: 1;
+ display: block;
+ font-size: 32rpx;
+ color: #000;
+ margin-left: 42rpx;
+ font-weight: 500;
+ text-align: left;
+}
+
+.yuyue-btn {
+ width: 657rpx;
+ line-height: 78rpx;
+ border-radius: 39rpx;
+}
+
+.group-order .yuyue-box {
+ height: 100rpx;
+}
+
+.group-order .yuyue-btn {
+ width: 100%;
+ /* height: 100%; */
+ line-height: 100rpx;
+ border-radius: 0;
+}
+
+.mask-allowance .mask-content {
+ margin: auto;
+ top: initial;
+ bottom: initial;
+ padding: 20rpx;
+}
+
+.mask-allowance .mask-content .rule-title {
+ text-align: center;
+ margin-bottom: 20rpx;
+}
+
+.dialog-top {
+ color: #999;
+ font-weight: 500;
+ padding: 40rpx 33.33rpx 0;
+}
+
+.scene-title {
+ font-size: 35rpx;
+ font-weight: bold;
+ color: #333;
+ margin-bottom: 32.67rpx;
+}
+
+.people-message {
+ margin-bottom: 26.67rpx;
+ /* padding-bottom: 26.67rpx; */
+ /* border-bottom: 1px solid #F0F0F0; */
+ font-weight: bold;
+ font-size: 32rpx;
+}
+
+.people {
+ border-top: 1rpx solid #F0F0F0;
+ padding: 26.67rpx 0 24rpx;
+}
+
+.flex {
+ display: flex;
+}
+
+.bottom-btn {
+ display: flex;
+ border-top: 1rpx solid #F0F0F0;
+ height: 96rpx;
+ /* padding: 32.67rpx 0; */
+}
+
+.cancle {
+ width: 50%;
+ color: #999;
+ text-align: center;
+ line-height: 96rpx;
+}
+
+.confirm {
+ width: 50%;
+ text-align: center;
+ color: #D62828;
+ line-height: 96rpx;
+ border-left: 1rpx solid #F0F0F0;
+}
+
+.mask-content1 {
+ max-height: 710rpx;
+ position: relative;
+ z-index: 1;
+ width: 80%;
+ background: white;
+ border-radius: 12rpx;
+ /* margin-bottom: 45%; */
+ overflow-y: auto;
+ margin: auto;
+}
+.change-date {
+ font-weight: 500;
+ font-size: 27rpx;
+ color: #0B898E;
+}
+.text1 {
+ margin-left: 21rpx;
+ font-weight: 400;
+ font-size: 23rpx;
+ color: #0B898E;
+ margin-bottom: 21rpx;
+ display: flex;
+ align-items: flex-end;
+ padding-bottom: 40rpx;
+}
+.text2 {
+ margin-left: 22rpx;
+ font-weight: 400;
+ font-size: 23rpx;
+ color: #666666;
+ padding-bottom: 41rpx;
+}
+.mask-content2 {
+ position: absolute;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ width: 100%;
+ background: white;
+ border-radius: 12rpx;
+ overflow-y: auto;
+ height: 1100rpx;
+}
+.bottom-box {
+ height: 133rpx;
+ background: #FFFFFF;
+ box-shadow: 0rpx -3rpx 8rpx 0rpx rgba(71,71,71,0.1);
+ padding: 0 50rpx;
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ position: absolute;
+ left: 0;
+ right: 0;
+ bottom: 0;
+}
+.totalPrice {
+ font-family: PingFang SC;
+ font-weight: 500;
+ font-size: 48rpx;
+ color: #D62828;
+}
+.totalPrice::before {
+ content: "¥";
+ font-size: 24rpx;
+}
+.next {
+ width: 250rpx;
+ height: 80rpx;
+ background: #D62828;
+ border-radius: 40rpx;
+ font-family: PingFang;
+ font-weight: bold;
+ font-size: 32rpx;
+ color: #FFFFFF;
+ text-align: center;
+ line-height: 80rpx;
+}
+.icon-close {
+ position: absolute;
+ top: 30rpx;
+ right: 30rpx;
+}
+.s-price {
+ font-weight: 500;
+ font-size: 36rpx;
+ color: #D62828;
+ margin-right: 17rpx;
+}
+.s-price::before {
+ content: "¥";
+ font-size: 24rpx;
+}
\ No newline at end of file
diff --git a/pages/user/order/showOrderInfo/index.js b/pages/user/order/showOrderInfo/index.js
new file mode 100644
index 0000000..f290e3a
--- /dev/null
+++ b/pages/user/order/showOrderInfo/index.js
@@ -0,0 +1,381 @@
+// pages/user/order/sceneOrderInfo/index.js
+import commonApi from "../../../../utils/https/common"
+import userApi from "../../../../utils/https/user"
+import QRCode from '../../../../utils/weapp-qrcode.js'
+import util from '../../../../utils/util'
+let app = getApp(),timer
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ id:null,
+ info:null,
+ orderState:app.globalData.orderState,
+ productState:app.globalData.productState,
+ product_model:null,
+ isRefund:false,
+ feeInfoFlag:false,
+ codeIndex:0,
+ codeImgs:[],
+ minute:0,
+ second:0,
+ cardTypes:{},
+ cxr1:false,
+ cxr1Text:'更多',
+ sysm:false,
+ sysmText:'更多',
+ sysm2:false,
+ sysm2Text:'更多',
+ imgLen:[],
+ ids:[]
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ this.setData({
+ id:options.id
+ })
+ userApi.user_post("user/getCardTypeList").then(res=>{
+ let cardTypes = {};
+ res.data.map(item=>{
+ cardTypes[item.type]=item.title;
+ })
+ this.setData({
+ cardTypes:cardTypes
+ })
+ })
+ },
+ copy:function(){
+ wx.setClipboardData({
+ data: this.data.codeImgs[this.data.codeIndex].code,
+ success: function (res) {
+ wx.showToast({
+ title: '复制成功',
+ icon:'success'
+ })
+ }
+ })
+ },
+ getCodeImg:function(){
+ let that = this,sys =wx.getSystemInfoSync(),radio = sys.screenWidth / 750,qrcode=this.data.info.order_product_list[0].qrcode,codeImgs=[],codeId=0,arr = [];
+ this.data.info.order_product_list.forEach(qrcode=>{
+ qrcode.qrcode.map((item,index)=>{
+ console.log(qrcode.is_force_display_code);
+ item.is_force_display_code = qrcode.is_force_display_code
+ console.log(item.is_force_display_code);
+ arr.push(index)
+ this.setData({
+ imgLen:arr
+ })
+ if(item.use_url&&item.use_code){
+ codeImgs.push({img:item.use_url,code:item.use_code,text:item.use_code_display_text,state:item.stateText,is_force_display_code:item.is_force_display_code,flag:item.state});
+ // if(codeImgs.length==qrcode.qrcode.length){
+ // that.setData({
+ // codeImgs:codeImgs
+ // })
+ // }
+ that.setData({
+ codeImgs:codeImgs
+ })
+ }
+ else {
+ console.log(item);
+ new QRCode('damocode'+codeId,{
+ text: item.use_code,
+ width: 300 * radio,
+ height: 300 * radio,
+ padding:10, // 生成二维码四周自动留边宽度,不传入默认为0
+ correctLevel: QRCode.CorrectLevel.H, // 二维码可辨识度
+ callback: (res) => {
+ console.log(res);
+ codeImgs.push({img:res.path,code:item.use_code,text:item.use_code_display_text,state:item.stateText,is_force_display_code:item.is_force_display_code,flag:item.state});
+ that.setData({
+ codeImgs:codeImgs
+ })
+ }
+ })
+ console.log(this.data.codeImgs);
+ codeId = codeId + 1
+ }
+ })
+ })
+ console.log(this.data.imgLen);
+ console.log(this.data.codeImgs);
+ },
+ prevCodeImg:function(){
+ let qrcode=this.data.info.order_product_list[0].qrcode,codeIndex = this.data.codeIndex;
+ if(codeIndex==0){
+ this.setData({
+ codeIndex:qrcode.length-1
+ })
+ }
+ else {
+ this.setData({
+ codeIndex:codeIndex-1
+ })
+ }
+ },
+ nextCodeImg:function(){
+ console.log(this.data.codeImgs);
+ let qrcode=this.data.codeImgs,codeIndex = this.data.codeIndex;
+ codeIndex = codeIndex + 1;
+ if(codeIndex==qrcode.length){
+ codeIndex = 0;
+ }
+ this.setData({
+ codeIndex:codeIndex
+
+ })
+ },
+ showFeeInfo:function(){
+ this.setData({
+ feeInfoFlag:!this.data.feeInfoFlag
+ })
+ },
+ close:function(){
+ let _this = this,info = _this.data.info;
+ wx.showModal({
+ title:'提示',
+ content:"确定取消吗",
+ success:function(res){
+ if(res.confirm){
+ commonApi.user_post("order/close",{
+ order_id:info.order_id
+ }).then(res=>{
+ if(res.code==1){
+ wx.showToast({
+ title: '取消成功',
+ icon:'success'
+ })
+ info.state = "CLOSED";
+ info.order_product_list.map(item=>{
+ item.state='CLOSED'
+ })
+ _this.setData({
+ info:info
+ })
+ }
+ })
+ }
+ }
+ })
+ },
+ refund:function(){
+ let _this = this,info = _this.data.info;
+ wx.showModal({
+ title:'提示',
+ content:"确定取消吗",
+ success:function(res){
+ if(res.confirm){
+ commonApi.user_post("order/refund",{
+ order_id:info.order_id
+ }).then(res=>{
+ if(res.code==1){
+ wx.showToast({
+ title: '取消成功',
+ icon:'success'
+ })
+ info.state = "WAIT_REFUND";
+ info.order_product_list.map(item=>{
+ item.state='WAIT_REFUND'
+ })
+ _this.setData({
+ info:info
+ })
+ }
+ })
+ }
+ }
+ })
+ },
+ daojishi:function(time){
+ let now = new Date().getTime();
+ if(now>time){
+ clearTimeout(timer);
+ timer = null;
+ util.back();
+ return;
+ }
+ let times = time - now,minute = Math.floor(times / (60 * 1000)),second = Math.round((times - minute * 60 * 1000) / 1000);
+ this.setData({
+ minute:util.formatNumber(minute),
+ second:util.formatNumber(second)
+ })
+ timer = setTimeout(()=>{
+ this.daojishi(time);
+ },1000)
+ },
+ // 查看苏康码
+ gotoSku:function(){
+ commonApi.user_post("pbservice/Ztfw/sukangCode").then(res=>{
+ console.log(res)
+ app.globalData.weburl = res.data.url;
+ wx.navigateTo({
+ url: '/pages/pbService/web/index'
+ })
+ return;
+ })
+ },
+ goDetail(e){
+ console.log(e.currentTarget.dataset);
+ let item = e.currentTarget.dataset.set
+ if (item.is_package) {
+ wx.navigateTo({
+ url:"/pages/info/postProductInfo/index?id="+item.product_id
+ })
+ return
+ }
+
+ if (item.product_model=='ticket') {
+ wx.navigateTo({
+ url:"/pages/info/sceneProductInfo/index?id="+item.scene_id
+ })
+ }else if (item.product_model=='post') {
+ wx.navigateTo({
+ url:"/pages/info/postProductInfo/index?id="+item.product_id
+ })
+ } else if (item.product_model == 'show') {
+ wx.navigateTo({
+ url:"/pages/info/showInfo/index?id="+item.product_id
+ })
+ }
+ },
+ showMsg(e){
+ console.log(e.currentTarget.dataset);
+ let msg = e.currentTarget.dataset.msg
+ switch (msg) {
+ case 'cxr1':
+ this.setData({
+ cxr1:!this.data.cxr1,
+ cxr1Text:this.data.cxr1?'更多':'收起',
+
+ })
+ break;
+ case 'sysm1':
+ this.setData({
+ sysm:!this.data.sysm,
+ sysmText:this.data.sysm?'更多':'收起',
+ })
+ break;
+ case 'sysm2':
+ this.setData({
+ sysm2:!this.data.sysm2,
+ sysm2Text:this.data.sysm2?'更多':'收起',
+ })
+ break;
+ default:
+ break;
+ }
+ },
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+ commonApi.user_post("order/query",{
+ order_id:this.data.id
+ }).then(res=>{
+ if(res.data.create_time && res.data.auto_close_time && res.data.state=='UNPAID'){
+ let time = (new Date(res.data.create_time.replace(/-/g,'/')).getTime() + Number(res.data.auto_close_time) * 1000);
+ this.daojishi(time);
+ }
+ let proId = []
+ res.data.order_product_list.forEach(item => {
+ proId.push(item.product_id)
+ })
+ let state = ""
+ res.data.order_product_list.map(order=>{
+ order.qrcode.map(item=>{
+ item.stateText = app.globalData.codeState[item.state];
+ })
+ order.contacts_info = order.contacts_info?JSON.parse(order.contacts_info):[];
+ state = state + order.state;
+ })
+ this.setData({
+ isRefund:state.indexOf("REFUND")!=-1,
+ info:res.data,
+ product_model:"ticket"||res.data.order_product_list[0].product_model,
+ ids: proId.join(",")
+ })
+ console.log(res.data);
+ // debugger
+ console.log('ids',this.data.ids);
+ this.getCodeImg()
+ // 获取行程规划
+ let that = this;
+ wx.getLocation({
+ type: 'gcj02',
+ success: function (r) {
+ let ajaxes=[];
+ res.data.order_product_list.map(item=>{
+ ajaxes.push(commonApi.user_post("order/tripplan",{
+ point_type:"gd",
+ child_order_id:item.child_order_id,
+ lon:r.longitude,
+ lat:r.latitude
+ }))
+ })
+ Promise.all(ajaxes).then(r=>{
+ console.log(r)
+ let orderInfo = that.data.info;
+ r.map((item,index)=>{
+ if(item && item.data && item.data.url){
+ orderInfo.order_product_list[index].btnUrl = item.data.url;
+ }
+ })
+ that.setData({
+ info:orderInfo
+ })
+ })
+ }
+ })
+ })
+ },
+ // 行程规划
+ leadRoad:function(e){
+ let url = e.currentTarget.dataset.url;
+ app.globalData.weburl = url;
+ wx.navigateTo({
+ url: '/pages/pbService/web/index'
+ })
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+ clearTimeout(timer)
+ timer = null
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ }
+})
\ No newline at end of file
diff --git a/pages/user/order/showOrderInfo/index.json b/pages/user/order/showOrderInfo/index.json
new file mode 100644
index 0000000..807fd96
--- /dev/null
+++ b/pages/user/order/showOrderInfo/index.json
@@ -0,0 +1,7 @@
+{
+ "usingComponents": {
+ "title":"/pages/component/TitleHeader",
+ "sptj":"/pages/component/proRec/proRec",
+ "advBox":"/pages/component/orderAdv/orderAdv"
+ }
+}
\ No newline at end of file
diff --git a/pages/user/order/showOrderInfo/index.wxml b/pages/user/order/showOrderInfo/index.wxml
new file mode 100644
index 0000000..bd534d9
--- /dev/null
+++ b/pages/user/order/showOrderInfo/index.wxml
@@ -0,0 +1,144 @@
+
+
+
+
+
+{{info.state_text}}
+
+
+
+
+
+
+
+
+ {{item.state}}
+
+
+
+
+ {{codeImgs[codeIndex].text}}:{{codeImgs[codeIndex].code}} 复制
+ {{codeImgs[codeIndex].state}} {{codeIndex+1}}/{{codeImgs.length}}
+
+
+
+
+
+
+
+
+
+
+
+
+ 库存有限,请尽快完成付款
+ 您的订单已取消,您可以通过苏州文旅总入口再次预订
+ 预定已成功,祝您出游愉快
+ 订单号:{{info.order_id}}
+ 下单时间:{{info.create_time}}
+
+
+
+ ¥{{info.paid_money/100}}
+ 费用明细
+
+
+
+ 剩余时间:00:{{minute}}:{{second}}
+
+ 再次购买
+
+ 再次购买
+
+
+
+ 退款详情
+ 取消预订
+ 取消预订
+ 去评价
+ 立即支付
+
+
+
+
+
+
+
+ {{item.product_title}}
+
+
+
+ {{item.sku_name}}
+ x{{item.product_num}}
+
+
+ {{ item.state_text }}
+
+
+ 场次:
+ {{item.use_date}} {{ item.start_time }}-{{ item.end_time }}
+
+
+
+ 使用日期:
+ {{ item.order_advance.start_time }}-{{ item.order_advance.end_time }}
+
+
+
+ 出行人信息
+ {{cxr1Text}}
+
+
+
+ 手机号: {{item.phone}}
+
+
+
+
+
+
+ 姓名: {{item.name}}
+
+
+
+ {{cardTypes[item.idcard_type]}}:{{item.id_number}}
+
+
+
+ 手机号: {{item.tel}}
+
+
+
+
+
+
+
+ 使用说明
+ {{sysmText}}
+
+
+
+
+
+ 使用说明
+ {{sysm2Text}}
+
+
+
+
+
+
+
+
+ 联系客服
+
+
+
+
+ 费用明细
+
+ 商品总价¥{{info.total_money/100}}
+ 优惠券抵扣-¥{{info.preference_money/100}}
+ 订单实付¥{{info.paid_money/100}}
+
+
\ No newline at end of file
diff --git a/pages/user/order/showOrderInfo/index.wxss b/pages/user/order/showOrderInfo/index.wxss
new file mode 100644
index 0000000..a7621ab
--- /dev/null
+++ b/pages/user/order/showOrderInfo/index.wxss
@@ -0,0 +1,354 @@
+/* pages/user/order/sceneOrderInfo/index.wxss */
+.top-bg {
+ position: absolute;
+ left: 0;
+ right: 0;
+ height: 280rpx;
+ background: linear-gradient(180deg, #0B898E, #0B898E, rgba(237, 237, 237, 0));
+ z-index: -1;
+}
+page {
+ background: #f6f6f6;
+}
+.state-text {
+ margin: 20rpx 30rpx;
+ line-height: 100rpx;
+ color: #fff;
+ font-size: 48rpx;
+}
+.box {
+ padding: 20rpx;
+ background: white;
+ border-radius: 20rpx;
+ margin: 20rpx 30rpx;
+}
+.product-info {
+ display: flex;
+ justify-content: space-between;
+ color: #333;
+ font-size: 24rpx;
+ padding-bottom: 20rpx;
+ border-bottom: 1rpx solid #d8d8d8;
+ margin-bottom: 10rpx;
+}
+.product-info image {
+ width: 140rpx;
+ height: 140rpx;
+ border-radius: 10rpx;
+ flex-shrink: 0;
+}
+.title-box {
+ flex: 1;
+ margin: 0 20rpx;
+}
+.title-box .title {
+ font-size: 30rpx;
+ width: 100%;
+ margin-bottom: 10rpx;
+}
+.title-box .subtitle {
+ color: #888888;
+ font-size: 26rpx;
+}
+.price-box-tip {
+ text-align: right;
+}
+.detail-item {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ min-height: 45rpx;
+ color: #000;
+ font-size: 30rpx;
+ padding-bottom:30rpx ;
+}
+.all-total-item {
+ font-weight: bold;
+ height: 70rpx;
+ border-bottom: 1rpx solid #d8d8d8;
+}
+.all-total-item .price {
+ color: #D62828;
+ font-size: 36rpx;
+}
+.all-total-item .price::before {
+ content: "¥";
+ font-size: 26rpx;
+}
+.btns {
+ display: flex;
+ justify-content: flex-end;
+ align-items: center;
+ height: 103rpx;
+ font-size: 26rpx;
+}
+.btn {
+ width: 160rpx;
+ line-height: 60rpx;
+ background: #fff;
+ text-align: center;
+ box-sizing: border-box;
+ border: 1rpx solid #d8d8d8;
+ border-radius: 30rpx;
+ text-align: center;
+ margin-left: 20rpx;
+}
+.btn.active {
+ color: #fff;
+ background: #FC9132;
+ border-color: #FC9132;
+}
+.box-title {
+ font-size: 30rpx;
+ font-weight: bold;
+ margin-bottom: 10rpx;
+ display: flex;
+ text-align: center;
+ justify-content: space-between;
+}
+.box-title.tflex{
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+.title-content{
+ overflow-x: hidden;
+ overflow-y: inherit;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+.scene-box {
+ display: flex;
+ justify-content: space-between;
+}
+.scene-box-left {
+ width: 400rpx;
+ font-size: 26rpx;
+ color: #333;
+}
+.scene-box-right {
+ flex-shrink: 0;
+ font-size: 24rpx;
+ color: #999;
+ text-align: right;
+}
+.scene-box-right .price {
+ color: #D62828;
+ font-size: 36rpx;
+ font-weight: bold;
+}
+.scene-btns {
+ display: flex;
+ justify-content: flex-end;
+ align-items: center;
+ font-size: 26rpx;
+ color: #333;
+ text-align: center;
+ margin-top: 50rpx;
+}
+.scene-btn {
+ width: 160rpx;
+ line-height: 60rpx;
+ box-sizing: border-box;
+ border: 1rpx solid #d8d8d8;
+ border-radius: 30rpx;
+ margin-left: 20rpx;
+ flex-shrink: 0;
+}
+.scene-rest-time {
+ flex: 1;
+ text-align: left;
+ font-size: 26rpx;
+ font-weight: bold;
+}
+.scene-btn.active {
+ color: #fff;
+ background: #FC9132;
+ border-color: #FC9132;
+}
+.scene-btn.active1 {
+ background: #0B898E;
+ border-color: #0B898E;
+ color: #fff;
+}
+.bottom-btn {
+ display: flex;
+ width: 360rpx;
+ height: 80rpx;
+ background: #FFFFFF;
+ border-radius: 40rpx;
+ justify-content: center;
+ align-items: center;
+ font-size: 30rpx;
+ color: #333;
+ font-weight: 500;
+ margin: 20rpx auto;
+}
+.bottom-btn image {
+ width: 40rpx;
+ margin-right: 10rpx;
+}
+.line {
+ margin: 10rpx 0;
+ height: 1rpx;
+ background: #d8d8d8;
+}
+.mask-title {
+ text-align: center;
+ padding-top: 30rpx;
+ margin-bottom: 60rpx;
+ font-weight: 500;
+}
+.mask-item {
+ margin: 0 40rpx;
+ margin-bottom: 60rpx;
+ display: flex;
+ justify-content: space-between;
+ font-size: 30rpx;
+ color: #333;
+}
+.icon-close {
+ position: absolute;
+ right: 20rpx;
+ top: 30rpx;
+}
+.code-box {
+ text-align: center;
+ height: 440rpx;
+ position: relative;
+}
+.code-box .iconfont {
+ position: absolute;
+ color: #0B898E;
+ font-size: 30rpx;
+ line-height: 50rpx;
+ width: 50rpx;
+ left: 40rpx;
+ text-align: center;
+ margin-top: 125rpx;
+}
+.code-box .iconfont.icon-you {
+ left: auto;
+ right: 40rpx;
+ top: 20rpx;
+}
+.code-img {
+ width: 300rpx;
+ height: 300rpx;
+ display: block;
+ margin: 0 auto;
+ position: absolute;
+ left: -1000rpx;
+ top: -400rpx;
+}
+.code-state {
+ font-size: 26rpx;
+ color: #333;
+ margin-bottom: 30rpx;
+}
+.code-text {
+ color: #0B898E;
+ font-size: 30rpx;
+ font-weight: 500;
+ margin: 25rpx;
+ display: flex;
+ justify-content: center;
+}
+.code-btn {
+ width: 220rpx;
+ line-height: 60rpx;
+ background: #FFFFFF;
+ border: 1rpx solid #D8D8D8;
+ border-radius: 30rpx;
+ box-sizing: border-box;
+ font-size: 26rpx;
+ color: #333;
+ margin: 0 auto;
+}
+.hotel-tel-box {
+ line-height: 80rpx;
+ border-top: 1rpx solid #D8D8D8;
+ color: #0B898E;
+ font-size: 26rpx;
+ margin-top: 20rpx;
+}
+.hotel-tel-box .iconfont {
+ margin-right: 20rpx;
+ font-size: 34rpx;
+}
+.hotel-tips {
+ display: flex;
+ align-items: center;
+ font-size: 24rpx;
+ color: #999;
+}
+.hotel-tips .hotel-days-num {
+ width: 70rpx;
+ font-size: 20rpx;
+ line-height: 30rpx;
+ border: 1rpx solid #0B898E;
+ border-radius: 15rpx;
+ text-align: center;
+ color: #0B898E;
+ margin: 0 20rpx;
+ text-align: center;
+ box-sizing: border-box;
+}
+.hotel-tips .hotel-date {
+ font-size: 26rpx;
+ color: #333;
+ margin-right: 6rpx;
+}
+.hotel-tip {
+ font-size: 24rpx;
+ color: #999;
+ margin-top: 30rpx;
+}
+.row{
+ display: flex;
+ align-items: center;
+ justify-content:space-between;
+ padding-bottom: 30rpx;
+}
+.showmsg{
+ display: none;
+}
+.btn{
+ float: right;
+}
+.text-shadow {
+ position: absolute;
+ left: 0;
+ right: 0;
+ top: 0;
+ bottom: 0;
+ margin: auto;
+ text-align: center;
+ background: rgba(0, 0, 0, .3);
+ width: 300rpx;
+ height: 300rpx;
+ /*border-radius: .3rem;*/
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ z-index: 10;
+}
+.text-shadow-state {
+ width: 200rpx;
+ height: 200rpx;
+ line-height: 200rpx;
+ background: #FFFFFF;
+ border-radius: 50%;
+ color: #0B898E;
+}
+.copy-box {
+ width: 73rpx;
+ line-height: 35rpx;
+ border-radius: 7rpx;
+ border: 1rpx solid #09898C;
+ margin-left: 15rpx;
+ text-align: center;
+ font-weight: 500;
+ font-size: 23rpx;
+ color: #0E8790;
+}
\ No newline at end of file
diff --git a/project.private.config.json b/project.private.config.json
index 08edf69..3284060 100644
--- a/project.private.config.json
+++ b/project.private.config.json
@@ -7,15 +7,15 @@
"miniprogram": {
"list": [
{
- "name": "pages/user/bindtel/index",
- "pathName": "pages/user/bindtel/index",
- "query": "regToken=123456",
+ "name": "pages/info/showInfo/index",
+ "pathName": "pages/info/showInfo/index",
+ "query": "id=13170",
"launchMode": "default",
"scene": null
},
{
- "name": "subPackages/index/index",
- "pathName": "subPackages/index/index",
+ "name": "pages/order/showOrderNew/index",
+ "pathName": "pages/order/showOrderNew/index",
"query": "",
"launchMode": "default",
"scene": null
@@ -27,25 +27,12 @@
"launchMode": "default",
"scene": null
},
- {
- "name": "pages/info/postProductInfo/index",
- "pathName": "subPackages/index/index",
- "query": "",
- "launchMode": "default",
- "scene": null
- },
{
"name": "景点购物车5447",
"pathName": "pages/info/sceneProductInfoNew/index",
"query": "id=5447",
"scene": null
},
- {
- "name": "测试支付",
- "pathName": "pages/order/pay/index",
- "query": "id=35532207011748334675",
- "scene": null
- },
{
"name": "pages/group/info/index",
"pathName": "pages/group/info/index",
@@ -58,38 +45,12 @@
"query": "",
"scene": null
},
- {
- "name": "测试美团酒店详情",
- "pathName": "pages/info/hotelProductInfo/index",
- "query": "id=5974",
- "scene": null
- },
{
"name": "pages/order/joinOrder/index",
"pathName": "pages/order/joinOrder/index",
"query": "oid=59532109231539023692&id=336&uid=24",
"scene": null
},
- {
- "name": "pages/order/orderList/index",
- "pathName": "pages/order/orderList/index",
- "query": "",
- "launchMode": "default",
- "scene": null
- },
- {
- "name": "团体预约场馆",
- "pathName": "pages/pbService/group/index",
- "query": "",
- "scene": null
- },
- {
- "name": "",
- "pathName": "pages/supplier/index",
- "query": "",
- "launchMode": "default",
- "scene": null
- },
{
"name": "",
"pathName": "pages/order/payresult/index",
@@ -103,13 +64,6 @@
"query": "id=82342309051435565877",
"launchMode": "default",
"scene": null
- },
- {
- "name": "",
- "pathName": "pages/user/order/activityOrderInfo/index",
- "query": "",
- "launchMode": "default",
- "scene": null
}
]
}
diff --git a/utils/util.js b/utils/util.js
index 49c0b5b..b31d739 100644
--- a/utils/util.js
+++ b/utils/util.js
@@ -392,12 +392,18 @@ const gotoOrder = function(item){
})
return;
}
- if(item.order_product_list[0].product_model=='movie' || item.order_product_list[0].product_model=='show'){
+ if(item.order_product_list[0].product_model=='movie'){
wx.navigateTo({
url: '/pages/user/order/movieOrderInfo/index?id='+item.order_id,
})
return;
}
+ if (item.order_product_list[0].product_model=='show') {
+ wx.navigateTo({
+ url: '/pages/user/order/showOrderInfo/index?id='+item.order_id,
+ })
+ return;
+ }
if(item.order_product_list[0].product_model=='post'){
wx.navigateTo({
url: '/pages/user/order/postOrderInfo/index?id='+item.order_id,