Commit a130d499 authored by 潘永坪's avatar 潘永坪

联票电子门票开发

parent eb6d986e
......@@ -23,7 +23,6 @@ export default {
{name:'云端之眼.高空观景台',phone:'023-60339688'},
{name:'两江夜游',phone:'13883372702'},
{name:'礼嘉时光缆车(渝北区)',phone:'023-67687141'},
{name:'清明上河图',phone:'17783002411'},
{name:'重庆湖广会馆',phone:'023-63914697'},
{name:'重庆抗战遗址博物馆',phone:'023-62462447'},
{name:'重庆杜莎夫人蜡像馆',phone:'023-63492828'},
......
......@@ -188,29 +188,89 @@
</view>
<view class="rufundRule">
<view class="rule-title">
退改规则
</view>
<view class="rule-type">
<text>有条件退</text>
<!-- 等于3退票规则以子订单为准 -->
<view v-for="(item,index) in orderInfo.childs" :key="index" v-if="orderInfo.isRefund==3">
<view class="rule-title">
退改规则
</view>
<view class="rule-type">
<text v-if="item.isRefund==0">不可退</text>
<text v-if="item.isRefund==1">有条件退</text>
<text v-if="item.isRefund==2">随时可退</text>
</view>
<view class="rule-list">
<view v-for="(item2,a) in item.orderRefundRuleList" :key="a" v-if="item.isRefund==1" style="margin-top: 20rpx;">
<!--已配置文字内容 -->
<text v-if="item2.refundShowMessage">
{{item2.refundShowMessage}}
</text>
<!-- 未配置文字内容 -->
<template v-else>
<!-- 使用日期前 -->
<text v-if="item2.refundTimeRule==1">
<text v-if="item2.refundDay==0">
使用日期当天{{item2.refundTime}}之前可退
</text>
<text v-else>
使用日期前{{item2.refundDay}}{{item2.refundTime}}之前可退
</text>
</text>
<!-- 过期 -->
<text v-if="item2.refundTimeRule==2">
<text v-if="item2.refundDay==0">
过期当天{{item2.refundTime}}之前可退
</text>
<text v-else>
过期后{{item2.refundDay}}{{item2.refundTime}}之前可退
</text>
</text>
</template>
</view>
</view>
</view>
<view class="rule-table">
<uni-table border>
<uni-tr>
<uni-td>取消时间</uni-td>
<uni-td>损失费用</uni-td>
</uni-tr>
<uni-tr>
<uni-td>2024/06/22 16:00:00前</uni-td>
<uni-td>0</uni-td>
</uni-tr>
<uni-tr>
<uni-td>2024/06/22 16:00:00后</uni-td>
<uni-td>全部支付金额</uni-td>
</uni-tr>
</uni-table>
<!-- 不等于3退票规则以主订单为准 -->
<view v-else>
<view class="rule-title">
退改规则
</view>
<view class="rule-type">
<text v-if="orderInfo.isRefund==0">不可退</text>
<text v-if="orderInfo.isRefund==1">有条件退</text>
<text v-if="orderInfo.isRefund==2">随时可退</text>
</view>
<view class="rule-list">
<view v-for="(item,index) in orderInfo.orderRefundRuleList" :key="index" v-if="orderInfo.isRefund==1" style="margin-top: 20rpx;">
<!--已配置文字内容 -->
<text v-if="item.refundShowMessage">
{{item.refundShowMessage}}
</text>
<!-- 未配置文字内容 -->
<template v-else>
<!-- 使用日期前 -->
<text v-if="item.refundTimeRule==1">
<text v-if="item.refundDay==0">
使用日期当天{{item.refundTime}}之前可退
</text>
<text v-else>
使用日期前{{item.refundDay}}{{item.refundTime}}之前可退
</text>
</text>
<!-- 过期 -->
<text v-if="item.refundTimeRule==2">
<text v-if="item.refundDay==0">
过期当天{{item.refundTime}}之前可退
</text>
<text v-else>
过期后{{item.refundDay}}{{item.refundTime}}之前可退
</text>
</text>
</template>
</view>
</view>
</view>
<view class="rule-service">
<view class="rule-service" @click="makePhone('4000720368')">
<u-icon name='kefu-ermai'></u-icon>
联系客服
</view>
......@@ -248,7 +308,10 @@
</view>
<view class="bottom">
<text>申请退票</text>
<!-- 等于3退票以子订单为准 -->
<text v-if="orderInfo.isRefund==3" @click="ticketRefund()">申请退票</text>
<!-- 不等于3退票以主订单为准 -->
<text v-else @click="ticketRefund()">申请退票</text>
<text>再次预订</text>
</view>
<!-- 是否重新排号 -->
......@@ -304,6 +367,7 @@ export default {
numberTimer:null,//获取排号信息时间函数
codeFlag:null,//动态二维码函数
countFlag:null,//倒计时时间函数
numberFlag:null,////获取排号信息时间函数2
Brightness:'',//屏幕亮度
openid:uni.getStorageSync('openid')||'',//openid
companyId:'',//公司Id
......@@ -318,7 +382,7 @@ export default {
}
},
onLoad(option) {
this.orderId = 'z00171979954017393759272c9f00409'// option.orderId
this.orderId = 'z001719974044044b044d613e9af6f19'// option.orderId
},
onShow() {
this.getDetail()
......@@ -335,11 +399,46 @@ export default {
})
},
onHide() {
//切换后台周期函数
//由于该页面用户需要频繁的查看排号和电子门票信息,为性能考虑,在onHide生命周期函数里面也进行计时器清理
//timer结尾是用的setTimeout,Flag结尾是用的setInterval
//清除详情函数
if(this.detailTimer) {
clearTimeout(this.detailTimer)
this.detailTimer = null
}
//清除动态二维码函数
if(this.codeTimer) {
clearTimeout(this.codeTimer)
this.codeTimer = null
}
//清除排号信息函数
if(this.numberTimer) {
clearTimeout(this.numberTimer)
this.numberTimer = null
}
//清除排号信息函数2
if(this.numberFlag) {
clearInterval(this.numberFlag)
this.numberFlag = null
}
//清除倒计时函数
if(this.countFlag) {
clearInterval(this.countFlag)
this.countFlag = null
}
//清除动态二维码函数
if(this.codeFlag) {
clearInterval(this.codeFlag)
this.codeFlag = null
}
uni.setScreenBrightness({// 恢复之前屏幕亮度
value: this.Brightness
})
},
onUnload() {
//页面切换周期函数
//timer结尾是用的setTimeout,Flag结尾是用的setInterval
//清除详情函数
if(this.detailTimer) {
clearTimeout(this.detailTimer)
......@@ -355,14 +454,19 @@ export default {
clearTimeout(this.numberTimer)
this.numberTimer = null
}
//清除排号信息函数2
if(this.numberFlag) {
clearInterval(this.numberFlag)
this.numberFlag = null
}
//清除倒计时函数
if(this.countFlag) {
clearTimeout(this.countFlag)
clearInterval(this.countFlag)
this.countFlag = null
}
//清除倒计时函数
//清除动态二维码函数
if(this.codeFlag) {
clearTimeout(this.codeFlag)
clearInterval(this.codeFlag)
this.codeFlag = null
}
uni.setScreenBrightness({// 恢复之前屏幕亮度
......@@ -379,29 +483,109 @@ export default {
this.$request('order/userOrder/findOrderDetail',data).then((res)=>{
if(res.code=='00'){
this.orderInfo=res.data
let arr=this.orderInfo.childs||[]
let orderInfo=res.data
let arr=orderInfo.childs||[]
arr.forEach(item=>{
//默认不显示使用须知
item.showUseknow=false
if(item.isFetch=='1'){
//获取排号信息
this.getSortInfo(item)
//每两分钟刷新一次
this.numberFlag=setInterval(()=>{
this.getSortInfo(item)
},120*1000)
}
//subOrderType 子订单类型(0-胖丁分销,1-扫码购,2-自助机,3-组合,4-扫码牌,5-预订,6-反扫,7-收银机,8-码同步,9-押金,94-公众号,96-胖丁分销,99-酒店自营)
//exchangeMode 验证方式:1胖丁二维码,2第三方二维码,3短信,4身份证
if(item.subOrderType!=4&&item.subOrderType!=5){
// if(item.playDate.substr(0,10)==this.$commonjs.today()){
if(item.exchangeMode==4||item.exchangeMode==5){
//多个二维码
this.getCodeList(item)
if(item.playDate.substr(0,10)==this.$commonjs.today()){
//游玩时间等于今天才进行动态二维码渲染
if(item.exchangeMode==4||item.exchangeMode==5){
//多个二维码
this.getCodeList(item)
}
}
// }
if(item.exchangeMode==1){
//一个二维码
this.getCode(item)
}
}
})
if(orderInfo.isRefund==3){
// 退票规则以子订单为准
}else{
// 退票规则以主订单为准
if(orderInfo.orderStatus==2||orderInfo.orderStatus==7){
//等于2出票成功,7部分退货退款
if(orderInfo.isRefund==1){
//1为条件退
orderInfo.orderRefundRuleList.forEach(item=>{
//refundVisitorApply游客是否能自己申请退(0不能1可以)
if(item.refundVisitorApply==1){
//当前时间戳
let nowTimeNumber=new Date().getTime()
//退票时间戳
let refundTime=''
//1使用日期前
if(item.refundTimeRule==1){
if(item.refundDay){
let playDate = this.getNewDate(orderInfo.playDate,-item.refundDay)
refundTime = playDate+' '+item.refundTime
}else{
refundTime = orderInfo.playDate+' '+item.refundTime
}
}
refundTimeNumber=new Date(refundTime.replace(/-/g, '/')).getTime()
//退款时间0之前1之后2至(用于区间)
if(item.refundTimeRule==0){
if(nowTimeNumber<refundTimeNumber){
this.showxxx=true
}else{
this.showxxx=false
}
}
if(item.refundTimeRule==1){
if(nowTimeNumber>refundTimeNumber){
this.showxxx=true
}else{
this.showxxx=false
}
}
if(item.refundTimeRule==2){
let refundEndTime=''
if(item.refundDay){
let playDate = this.getNewDate(orderInfo.playDate,-item.refundDay)
refundEndTime = playDate+' '+item.refundEndTime
}else{
refundEndTime = orderInfo.playDate+' '+item.refundEndTime
}
if(refundTime<nowTime<refundEndTime){
this.showxxx=true
}else{
this.showxxx=false
}
}
// let nowTime=new Date().getTime()//当前时间
// if(item.refundDay){
// var itemDay = -item.refundDay//将天数改为负数
// var orderEndPlayDate = this.getNextDate(this.orderInfo.playDate,itemDay)//最迟退票天数
// playdateTimer = orderEndPlayDate+' '+item.refundTime
// }else{
// playdateTimer = orderInfo.playDate+' '+item.refundTime
// }
}
})
}
//随时可退
if(orderInfo.isRefund==2){
//按钮显示
this.showxxx=true
}
}
}
}else{
uni.showToast({
title: res.message,
......@@ -414,6 +598,15 @@ export default {
}, 2000)
})
},
//---当前时间加上天数获取新的日期
getNewDate:function(date,day) {
var dd = new Date(date)
dd.setDate(dd.getDate() + day)
var y = dd.getFullYear()
var m = dd.getMonth() + 1 < 10 ? '0' + (dd.getMonth() + 1) : dd.getMonth() + 1
var d = dd.getDate() < 10 ? '0' + dd.getDate() : dd.getDate()
return y + '-' + m + '-' + d
},
//---二维码刷新
dynamicCodeRefresh(item){
let codeList=item.codeList
......@@ -518,9 +711,6 @@ export default {
item.companyIdCopy = dataObj.pays[0].companyId
}
item.sorts=dataObj.sorts||[]
item.sorts.forEach((item2)=>{
item2.sortFair=4
})
if(item.sorts[0].sortFair==4||item.sorts[0].sortFair==5){
//时间判断,用于返程或第一次取号时,是否可以显示取号按钮
let presentTime = new Date().getTime()
......@@ -602,7 +792,16 @@ export default {
}
})
},
//---拨打电话
makePhone(phoneNumber) {
uni.makePhoneCall({
phoneNumber
})
},
//---点击申请退票
ticketRefund(){
}
},
}
......@@ -783,8 +982,8 @@ export default {
padding: 4rpx 12rpx;
}
}
.rule-table{
margin: 20rpx 0 36rpx 0;
.rule-list{
margin: 30rpx 0;
}
.rule-service{
display: flex;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment