3 changed files with 0 additions and 515 deletions
@ -1,284 +0,0 @@ |
|||||
<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 || orderInfo.pay_status !=1"> |
|
||||
<image mode="aspectFit" src="/static/images/icon/write_off_fail.png"></image> |
|
||||
<view>{{errorTip}}</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)}`; |
|
||||
} |
|
||||
}, |
|
||||
errorTip(){ |
|
||||
// 2已使用3已失效4已退款 |
|
||||
// 已使用: 该订单已核销使用 |
|
||||
// 已退款: 该订单已退款 |
|
||||
// 已失效: 该订单已失效 |
|
||||
// 其它二维码或网络异常: 很抱歉,获取不到二维码订单信息 |
|
||||
let { orderInfo } = this; |
|
||||
if(orderInfo&&orderInfo.pay_status == 2)return '该订单已核销使用'; |
|
||||
if(orderInfo&&orderInfo.pay_status == 3)return '该订单已失效'; |
|
||||
if(orderInfo&&orderInfo.pay_status == 4)return '该订单已退款'; |
|
||||
return '很抱歉,获取不到二维码订单信息'; |
|
||||
}, |
|
||||
}, |
|
||||
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> |
|
@ -1,219 +0,0 @@ |
|||||
<template> |
|
||||
<view class="write-off-list"> |
|
||||
<view class="wol-btn" hover-class="hover-active" @click="scanCode"> |
|
||||
<image mode="aspectFit" src="/static/images/icon/scan_code_btn.png"></image> |
|
||||
</view> |
|
||||
<view class="wol-bar">今日核销订单({{orderList.length || 0}})</view> |
|
||||
<view class="wol-list"> |
|
||||
<view class="wl-item" v-for="e in orderList" :key="e.id"> |
|
||||
<view class="wi-header"> |
|
||||
<view>{{e.stadium_name || '-'}}</view> |
|
||||
<view>{{ZH_status(e.pay_type || '')}}</view> |
|
||||
</view> |
|
||||
<view class="wi-info"> |
|
||||
<view class="wi-line"> |
|
||||
<view>订单编号:</view> |
|
||||
<view> |
|
||||
<view>{{e.order_no || '-'}}</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
<view class="wi-line"> |
|
||||
<view>用户昵称:</view> |
|
||||
<view> |
|
||||
<view>{{e.nickname || '-'}} </view> |
|
||||
</view> |
|
||||
</view> |
|
||||
<view class="wi-line"> |
|
||||
<view>支付时间:</view> |
|
||||
<view> |
|
||||
<view>{{e.pay_time || '-'}}</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
<view class="wi-line"> |
|
||||
<view> 预定日期:</view> |
|
||||
<view> |
|
||||
<view>{{ZH_order_date(e.date || '') || '-'}}</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
<view class="wi-line"> |
|
||||
<view>预定场次:</view> |
|
||||
<view> |
|
||||
<view v-for="k in e.sessions" :key="k.id">{{k.venue_name+' '}}{{' '+k.duration}} </view> |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
<view class="wi-total"> |
|
||||
<view>核销时间:{{e.verify_time || '-'}}</view> |
|
||||
<view>共{{e.sessions.length || 0}}场次</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
</template> |
|
||||
|
|
||||
<script> |
|
||||
import { API } from '../../../js/api'; |
|
||||
import { servers } from '../../../js/server'; |
|
||||
import util from '../../../utils/util' |
|
||||
export default { |
|
||||
computed: { |
|
||||
ZH_status(){ |
|
||||
return status=> (['未支付','待使用','已使用','已失效','已退款'][status] || '-') // 订单状态[-1已作废0未支付1已支付待使用2已使用3已失效4已退款] |
|
||||
}, |
|
||||
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 { |
|
||||
orderList: [] |
|
||||
} |
|
||||
}, |
|
||||
onLoad(){ |
|
||||
this.getOrderList(true); |
|
||||
}, |
|
||||
methods: { |
|
||||
scanCode(){ |
|
||||
uni.scanCode({ |
|
||||
success: res=>{ |
|
||||
let { result } = res; |
|
||||
|
|
||||
if( |
|
||||
res.scanType !== 'QR_CODE' || |
|
||||
result.indexOf('brand_id') == -1 || |
|
||||
result.indexOf('stadium_id') == -1 || |
|
||||
result.indexOf('verify_code') == -1 |
|
||||
){ |
|
||||
return util.showNone('无法识别!'); |
|
||||
} |
|
||||
|
|
||||
util.routeTo(`/pages/write_off/confirm/confirm?query=${res.result}`,'nT'); |
|
||||
}, |
|
||||
fail: err=>{ |
|
||||
if(err.errMsg&&err.errMsg.indexOf('cancel')!=-1)return; |
|
||||
console.log(err) |
|
||||
util.showNone('扫码失败!') |
|
||||
} |
|
||||
}) |
|
||||
|
|
||||
}, |
|
||||
// confirm 页刷新列表 |
|
||||
getOrderList(isLoad){ |
|
||||
if(isLoad)util.showLoad(); |
|
||||
servers.get({ |
|
||||
url: API.verifiedOrderList, |
|
||||
data: { |
|
||||
status: 1, // 只获取待使用订单 |
|
||||
}, |
|
||||
failMsg: '获取订单列表失败!' |
|
||||
}) |
|
||||
.then(res=>{ |
|
||||
if(isLoad)util.hideLoad(); |
|
||||
let _list = res.list || []; |
|
||||
this.orderList = _list; |
|
||||
}) |
|
||||
.catch(util.hideLoad) |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
</script> |
|
||||
|
|
||||
<style lang="scss" scoped> |
|
||||
@import "../../../style/public.scss"; |
|
||||
.write-off-list{ |
|
||||
padding-top: 24upx; |
|
||||
.wol-btn{ |
|
||||
margin: 0 auto 24upx; |
|
||||
height: 360upx; |
|
||||
width: 702upx; |
|
||||
border-radius: 10upx; |
|
||||
background-color: #fff; |
|
||||
@include centerFlex(center); |
|
||||
>image{ |
|
||||
width: 172upx; |
|
||||
height: 172upx; |
|
||||
} |
|
||||
} |
|
||||
.wol-bar{ |
|
||||
margin: 0 auto 24upx; |
|
||||
height: 112upx; |
|
||||
width: 702upx; |
|
||||
border-radius: 10upx; |
|
||||
line-height: 112upx; |
|
||||
text-align: center; |
|
||||
font-size: 32upx; |
|
||||
font-weight: 500; |
|
||||
color: #1a1a1a; |
|
||||
background-color: #fff; |
|
||||
} |
|
||||
.wol-list{ |
|
||||
padding: 0 24upx; |
|
||||
.wl-item{ |
|
||||
margin-bottom: 24upx; |
|
||||
>view{ |
|
||||
padding: 0 20upx; |
|
||||
background-color: #fff; |
|
||||
} |
|
||||
.wi-header{ |
|
||||
height: 96upx; |
|
||||
border-bottom: 2upx solid #D8D8D8; |
|
||||
border-radius: 10upx 10upx 0 0; |
|
||||
@include centerFlex(space-between); |
|
||||
>view{ |
|
||||
&:first-child{ |
|
||||
flex-grow: 1; |
|
||||
line-height: 40upx; |
|
||||
font-size: 28upx; |
|
||||
color: #1a1a1a; |
|
||||
@include textHide(1); |
|
||||
} |
|
||||
&+view{ |
|
||||
flex-shrink: 0; |
|
||||
margin-left: 20upx; |
|
||||
line-height: 40upx; |
|
||||
font-size: 28upx; |
|
||||
color: #9c9c9f; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
.wi-info{ |
|
||||
padding: 20upx; |
|
||||
border-bottom: 2upx solid #D8D8D8; |
|
||||
.wi-line{ |
|
||||
display: flex; |
|
||||
view{ |
|
||||
margin-bottom: 6upx; |
|
||||
line-height: 34upx; |
|
||||
font-size: 24upx; |
|
||||
color: #9c9c9f; |
|
||||
&:first-child{ |
|
||||
flex-shrink: 0; |
|
||||
} |
|
||||
&+view{ |
|
||||
flex-grow: 1; |
|
||||
>view{ |
|
||||
@include textHide(1); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
.wi-total{ |
|
||||
height: 90upx; |
|
||||
border-radius: 0 0 10upx 10upx; |
|
||||
@include centerFlex(space-between); |
|
||||
>view{ |
|
||||
font-size: 24upx; |
|
||||
color: #1a1a1a; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
</style> |
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue