You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

271 lines
8.4 KiB

<template>
<view class="write-off-confirm">
<view class="woc-content">
<view class="wc-info">
<view class="wi-title">{{orderInfo.stadium_name || '-'}}</view>
<view class="wi-detail">
<view class="wd-line">
<view>订单编号</view>
<view>
<view>{{orderInfo.order_no || '-'}}</view>
</view>
</view>
<view class="wd-line">
<view>用户昵称</view>
<view>
<view>{{orderInfo.nickname || '-'}}</view>
</view>
</view>
<view class="wd-line">
<view>支付时间</view>
<view>
<view>{{orderInfo.pay_time || '-'}}</view>
</view>
</view>
<view class="wd-line">
<view>预定日期</view>
<view>
<view>{{ZH_order_date((orderInfo&&orderInfo.date) || '') || '-'}}</view>
</view>
</view>
<view class="wd-line">
<view>预定场次</view>
<view>
<view v-for="e in orderInfo.sessions" :key="e.id">{{e.venue_name + ' ' }} {{ ' '+e.duration}}</view>
</view>
</view>
</view>
</view>
<view class="wi-split-line"></view>
<view class="wi-btns">
<view hover-class="hover-active" @click="confirmVerify">确认核销</view>
<view class="white" hover-class="hover-active" @click="cancelVerify">不核销</view>
</view>
</view>
<view class="woc-fail-modal" v-if="orderInfo == null">
<image mode="aspectFit" src="/static/images/icon/write_off_fail.png"></image>
<view>很抱歉!获取不到二维码订单信息</view>
<view hover-class="hover-active" @click="cancelVerify">返回</view>
</view>
</view>
</template>
<script>
import { API } from '../../../js/api'
import { servers } from '../../../js/server'
import util from '../../../utils/util'
export default {
computed: {
ZH_order_date(){
return date => {
if(!date)return '-'
let _date = date.replace(/\-/gi,'/');
return `${util.get_zh_date(_date)} ${util.get_zh_day(_date)}`;
}
},
},
data(){
return {
orderInfo: {},
}
},
onLoad(options){
console.log(options)
console.log(util.jsonPar(options.query))
this.getOrderInfo(util.jsonPar(options.query));
},
methods: {
confirmVerify: util.debounce(function(){
let { orderInfo } = this;
util.showLoad();
servers.get({
url: API.verifiedOrder,
data: {
brand_id: orderInfo.brand_id,
stadium_id: orderInfo.stadium_id,
verify_code: orderInfo.verify_code
},
isDefaultGet: false
})
.then(res=>{
util.hideLoad();
if(res.data.code == 0){
util.showNone(res.data.message || '操作成功!');
util.previousPageFunction({
fnName: 'getOrderList',
query: null,
})
setTimeout(_=>util.routeTo(),1200);
}else{
util.showNone(res.data.message || '操作失败!')
}
})
.catch(util.hideLoad)
},300,300),
cancelVerify(){
util.routeTo();
},
getOrderInfo({
brand_id = '',
stadium_id = '',
verify_code = '',
}){
util.showLoad();
servers.get({
url: API.verifiedOrderInfo,
data: {
brand_id,
stadium_id,
verify_code,
},
isDefaultGet: false
})
.then(res=>{
util.hideLoad();
if(res.data.code == 0)return this.orderInfo = res.data.data;
this.orderInfo = null
util.showNone(res.data.message || '加载失败!');
})
.catch(util.hideLoad)
}
}
}
</script>
<style lang="scss">
@import "../../../style/public.scss";
page{
background-color: $themeColor;
}
.write-off-confirm{
padding-top: 46upx;
}
.woc-content{
width: 702upx;
margin: 0 auto 46upx;
border-radius: 10upx;
background-color: #fff;
.wc-info{
padding: 20upx 40upx 66upx;
.wi-title{
height: 128upx;
line-height: 126upx;
text-align: center;
font-size: 32upx;
font-weight: 500;
color: #1a1a1a;
border-bottom: 2upx solid #D8D8D8;
}
.wi-detail{
padding-top: 34upx;
.wd-line{
display: flex;
view{
font-size: 28upx;
line-height: 60upx;
}
>view{
&:first-child{
flex-shrink: 0;
color: #9C9C9F;
}
&+view{
flex-grow: 1;
>view{
width: 100%;
color: #1A1A1A;
@include textHide(1);
}
}
}
}
}
}
.wi-split-line{
position: relative;
border-top: 2upx dashed #D8D8D8;
&::before{
content: '';
display: block;
position: absolute;
left: -10upx;
top: -11upx;
width: 20upx;
height: 20upx;
border-radius: 50%;
background-color: $themeColor;
}
&::after{
content: '';
display: block;
position: absolute;
right: -10upx;
top: -11upx;
width: 20upx;
height: 20upx;
border-radius: 50%;
background-color: $themeColor;
}
}
.wi-btns{
height: 450upx;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
>view{
height: 112upx;
width: 622upx;
line-height: 108upx;
text-align: center;
border-radius: 10upx;
border: 2upx solid $themeColor;
font-size: 32upx;
color: #fff;
background-color: $themeColor;
&:first-child{
margin-bottom: 24upx;
}
}
.white{
background-color: #fff;
color: $themeColor;
}
}
}
.woc-fail-modal{
position: fixed;
left: 0;
top: var(--window-top);
right: 0;
bottom: 0;
background-color: #fff;
padding-top: 90upx;
>image{
display: block;
margin: 0 auto 86upx;
width: 420upx;
height: 420upx;
&+view{
margin-bottom: 260upx;
text-align: center;
line-height: 40upx;
font-size: 28upx;
color: #9c9c9f;
}
}
view+view{
margin: 0 auto;
width: 280upx;
height: 92upx;
line-height: 88upx;
text-align: center;
border-radius: 46upx;
border: 2upx solid $themeColor;
font-size: 32upx;
color: $themeColor;
}
}
</style>