刘嘉炜
3 years ago
9 changed files with 404 additions and 522 deletions
-
5src/js/api.js
-
2src/js/once_name.js
-
24src/pages.json
-
284src/pages/write_off/confirm/confirm.vue
-
1src/pages/write_off/confirm_order/confirm_order.vue
-
187src/pages/write_off/events_order/events_order.vue
-
219src/pages/write_off/list/list.vue
-
21src/pages/write_off/operate/operate.vue
-
183src/pages/write_off/success/success.vue
@ -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> |
|
@ -0,0 +1,187 @@ |
|||||
|
<template> |
||||
|
<view class="events-order"> |
||||
|
<view class="eo-main"> |
||||
|
<view class="em-info"> |
||||
|
<view class="ei-title">{{ orderInfo.stadium_name || '-' }}</view> |
||||
|
<view class="ei-line-box"> |
||||
|
<view class="elb-line"> |
||||
|
<view class="el-name">订单编号:</view> |
||||
|
<view class="el-txt">{{ orderInfo.order_no || '-' }}</view> |
||||
|
<view class="el-tag">(赛事)</view> |
||||
|
</view> |
||||
|
<view class="elb-line"> |
||||
|
<view class="el-name">用户昵称:</view> |
||||
|
<view class="el-txt">{{ orderInfo.nickname || '-' }}</view> |
||||
|
</view> |
||||
|
<view class="elb-line"> |
||||
|
<view class="el-name">验证码:</view> |
||||
|
<view class="el-txt">{{ orderInfo.verify_code || '-' }}</view> |
||||
|
</view> |
||||
|
<view class="elb-line"> |
||||
|
<view class="el-name">赛事名称:</view> |
||||
|
<view class="el-txt">{{ orderInfo.match_name || '-' }}</view> |
||||
|
</view> |
||||
|
<view class="elb-line"> |
||||
|
<view class="el-name">赛事类型:</view> |
||||
|
<view class="el-txt">{{ orderInfo.match_type || '-' }}</view> |
||||
|
</view> |
||||
|
<view class="elb-line"> |
||||
|
<view class="el-name">进场时间:</view> |
||||
|
<view class="el-txt">{{ orderInfo.in_time || '-' }}</view> |
||||
|
</view> |
||||
|
|
||||
|
</view> |
||||
|
|
||||
|
</view> |
||||
|
<view class="em-border"></view> |
||||
|
<view class="em-btn"> |
||||
|
<view hover-class="hover-active" @click="confirmWriteOff">确认核销</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
|
||||
|
import util from '../../../utils/util'; |
||||
|
import { API } from '../../../js/api'; |
||||
|
import { servers } from '../../../js/server'; |
||||
|
import { WRITE_OFF_ORDER_INFO } from '../../../js/once_name'; |
||||
|
|
||||
|
export default { |
||||
|
data(){ |
||||
|
return { |
||||
|
orderInfo: {}, |
||||
|
type: '' // verify_code -> 5: 验证码核销(商家助手) | decrypt_text -> 6: 扫码核销(商家助手) |
||||
|
} |
||||
|
}, |
||||
|
onLoad(options){ |
||||
|
if(options.type)this.type = options.type || ''; |
||||
|
util.$_once(WRITE_OFF_ORDER_INFO, data => { |
||||
|
console.warn(data) |
||||
|
this.orderInfo = data || {}; |
||||
|
}) |
||||
|
}, |
||||
|
methods: { |
||||
|
confirmWriteOff: util.debounce(function(){ |
||||
|
let { orderInfo, type } = this; |
||||
|
servers.post({ |
||||
|
url: API.writeOff.assistantVerify, |
||||
|
data: { |
||||
|
verify_type: type == 'verify_code'? 5 : 6, |
||||
|
brand_id: orderInfo.brand_id, |
||||
|
stadium_id: orderInfo.stadium_id, |
||||
|
verify_code: orderInfo.verify_code, |
||||
|
}, |
||||
|
isDefaultGet: false, |
||||
|
}) |
||||
|
.then(res=>{ |
||||
|
if(res.data.code == 0){ |
||||
|
util.showNone(res.data.message || '操作成功!'); |
||||
|
let _query = { |
||||
|
order_no: orderInfo.order_no || '', |
||||
|
brand_id: orderInfo.brand_id || '', |
||||
|
stadium_name: orderInfo.stadium_name || '', |
||||
|
} |
||||
|
setTimeout(_=>util.routeTo(`/pages/write_off/success/success?query=${util.jsonStr(_query)}`, 'rT'), 1200); |
||||
|
// setTimeout(_=>util.routeTo(`/pages/write_off/success/success`, 'nT'), 1200); |
||||
|
}else{ |
||||
|
util.showNone(res.data.message || '操作失败!'); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
}) |
||||
|
}, 300, true) |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss"> |
||||
|
@import '~style/public.scss'; |
||||
|
page{ |
||||
|
background-color: $themeColor; |
||||
|
} |
||||
|
.events-order{ |
||||
|
padding: 46upx 24upx; |
||||
|
.eo-main{ |
||||
|
border-radius: 10upx; |
||||
|
background-color: #fff; |
||||
|
.em-info{ |
||||
|
padding: 0 40upx 46upx; |
||||
|
.ei-title{ |
||||
|
padding: 30upx 0; |
||||
|
text-align: center; |
||||
|
font-size: 32upx; |
||||
|
font-weight: 500; |
||||
|
line-height: 44upx; |
||||
|
color: #1a1a1a; |
||||
|
border-bottom: 2upx solid #D8D8D8; |
||||
|
} |
||||
|
.ei-line-box{ |
||||
|
padding-top: 20upx; |
||||
|
.elb-line{ |
||||
|
@include centerFlex(flex-start); |
||||
|
>view{ |
||||
|
font-size: 28upx; |
||||
|
line-height: 60upx; |
||||
|
} |
||||
|
.el-name{ |
||||
|
flex-shrink: 0; |
||||
|
color: #9c9c9f; |
||||
|
} |
||||
|
.el-txt{ |
||||
|
color: #1a1a1a; |
||||
|
white-space: nowrap; |
||||
|
text-overflow: ellipsis; |
||||
|
overflow: hidden; |
||||
|
} |
||||
|
.el-tag{ |
||||
|
margin-left: 10upx; |
||||
|
color: $themeColor; |
||||
|
flex-shrink: 0; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
.em-border{ |
||||
|
position: relative; |
||||
|
border-bottom: 2upx dashed #d8d8d8; |
||||
|
&::after{ |
||||
|
content: ''; |
||||
|
position: absolute; |
||||
|
left: -10upx; |
||||
|
top: -10upx; |
||||
|
display: block; |
||||
|
width: 20upx; |
||||
|
height: 20upx; |
||||
|
border-radius: 10upx; |
||||
|
background-color: $themeColor; |
||||
|
} |
||||
|
&::before{ |
||||
|
content: ''; |
||||
|
position: absolute; |
||||
|
right: -10upx; |
||||
|
top: -10upx; |
||||
|
display: block; |
||||
|
width: 20upx; |
||||
|
height: 20upx; |
||||
|
border-radius: 10upx; |
||||
|
background-color: $themeColor; |
||||
|
} |
||||
|
} |
||||
|
.em-btn{ |
||||
|
padding: 60upx 40upx; |
||||
|
>view{ |
||||
|
height: 112upx; |
||||
|
line-height: 112upx; |
||||
|
text-align: center; |
||||
|
font-size: 32upx; |
||||
|
border-radius: 10upx; |
||||
|
color: #fff; |
||||
|
background-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> |
|
@ -0,0 +1,183 @@ |
|||||
|
<template> |
||||
|
<view class="write-off-success"> |
||||
|
<view class="wos-stadium"> |
||||
|
<view class="ws-name">{{ optionsQuery.stadium_name || '-' }}</view> |
||||
|
</view> |
||||
|
<view class="wos-main"> |
||||
|
<image class="wm-icon" mode="aspectFit" src="/static/images/icon/success_tip.png"></image> |
||||
|
<view class="wm-txt">核销成功</view> |
||||
|
<view class="wm-btn" hover-class="hover-active" @click="toBack">返回继续核销</view> |
||||
|
</view> |
||||
|
<view class="wos-gate-ls" v-if="gateLs&&gateLs.length"> |
||||
|
<view class="wgl-tit">如需开门,请点击</view> |
||||
|
<view class="wgl-ls"> |
||||
|
<view class="wl-item" v-for="(e, i) in gateLs" :key="i"> |
||||
|
<view class="wi-name">{{ e.hardware_name || '-' }}</view> |
||||
|
<view class="wi-btn" hover-class="hover-active" @click="openGate(e)">开门</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
|
||||
|
import util from '../../../utils/util'; |
||||
|
import { API } from '../../../js/api'; |
||||
|
import { servers } from '../../../js/server'; |
||||
|
|
||||
|
export default { |
||||
|
data(){ |
||||
|
return { |
||||
|
gateLs: [], |
||||
|
optionsQuery: { |
||||
|
stadium_name: '', |
||||
|
brand_id: '', |
||||
|
order_no: '' |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
onLoad(options){ |
||||
|
let _query = {}; |
||||
|
try{ |
||||
|
_query = util.jsonPar(options.query); |
||||
|
console.warn('_query======》', _query) |
||||
|
this.optionsQuery = _query || {}; |
||||
|
}catch(err){ |
||||
|
console.error('json err--->', err) |
||||
|
} |
||||
|
|
||||
|
this.getGateLs({ |
||||
|
order_no: _query.order_no || '', |
||||
|
brand_id: _query.brand_id || '', |
||||
|
}); |
||||
|
}, |
||||
|
methods: { |
||||
|
openGate: util.debounce(function(e){ |
||||
|
let { optionsQuery } = this; |
||||
|
util.showLoad(); |
||||
|
servers.post({ |
||||
|
url: API.writeOff.matchOrderGateOpen, |
||||
|
data: { |
||||
|
brand_id: optionsQuery.brand_id, |
||||
|
order_no: optionsQuery.order_no, |
||||
|
gate_id: e.id, |
||||
|
}, |
||||
|
isDefaultGet: false, |
||||
|
}) |
||||
|
.then(res=>{ |
||||
|
util.hideLoad(); |
||||
|
if(res.data.code == 0){ |
||||
|
util.showNone(res.data.message || '操作成功!') |
||||
|
}else{ |
||||
|
util.showNone(res.data.message || '操作失败!'); |
||||
|
} |
||||
|
}) |
||||
|
}, 300, true), |
||||
|
getGateLs({ |
||||
|
order_no, |
||||
|
brand_id, |
||||
|
}){ |
||||
|
util.showLoad(); |
||||
|
servers.get({ |
||||
|
url: API.writeOff.matchOrderGateLs, |
||||
|
data: { |
||||
|
order_no, |
||||
|
brand_id |
||||
|
}, |
||||
|
failMsg: '加载门禁列表失败!' |
||||
|
}) |
||||
|
.then(res=>{ |
||||
|
util.hideLoad(); |
||||
|
let _ls = res.gates || []; |
||||
|
this.gateLs = _ls; |
||||
|
console.warn(res) |
||||
|
}) |
||||
|
}, |
||||
|
toBack(){ |
||||
|
util.routeTo(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss"> |
||||
|
@import '~style/public.scss'; |
||||
|
page{ |
||||
|
background-color: #fff; |
||||
|
} |
||||
|
.write-off-success{ |
||||
|
.wos-stadium{ |
||||
|
padding: 0 24upx; |
||||
|
.ws-name{ |
||||
|
padding: 40upx 0 30upx; |
||||
|
font-size: 32upx; |
||||
|
font-weight: 500; |
||||
|
color: #1a1a1a; |
||||
|
border-bottom: 2upx solid #D8D8D8; |
||||
|
@include textHide(1); |
||||
|
} |
||||
|
} |
||||
|
.wos-main{ |
||||
|
padding: 134upx 64upx 124upx; |
||||
|
.wm-icon{ |
||||
|
display: block; |
||||
|
margin: 0 auto 46upx; |
||||
|
width: 100upx; |
||||
|
height: 100upx; |
||||
|
} |
||||
|
.wm-txt{ |
||||
|
margin-bottom: 90upx; |
||||
|
text-align: center; |
||||
|
line-height: 66upx; |
||||
|
font-size: 48upx; |
||||
|
font-weight: 500; |
||||
|
color: #333; |
||||
|
|
||||
|
} |
||||
|
.wm-btn{ |
||||
|
line-height: 108upx; |
||||
|
height: 112upx; |
||||
|
text-align: center; |
||||
|
font-size: 32upx; |
||||
|
border-radius: 10upx; |
||||
|
border: 2upx solid $themeColor; |
||||
|
color: $themeColor; |
||||
|
} |
||||
|
} |
||||
|
.wos-gate-ls{ |
||||
|
padding: 0 24upx; |
||||
|
border-top: 24upx solid #f2f1f6; |
||||
|
.wgl-tit{ |
||||
|
padding: 30upx 0; |
||||
|
line-height: 40upx; |
||||
|
font-size: 28upx; |
||||
|
color: #9c9c9f; |
||||
|
border-bottom: 2upx solid #D8D8D8; |
||||
|
} |
||||
|
.wgl-ls{ |
||||
|
.wl-item{ |
||||
|
height: 126upx; |
||||
|
border-bottom: 2upx solid #D8D8D8; |
||||
|
@include centerFlex(space-between); |
||||
|
.wi-name{ |
||||
|
flex-grow: 1; |
||||
|
font-size: 28upx; |
||||
|
color: #333; |
||||
|
@include textHide(1); |
||||
|
} |
||||
|
.wi-btn{ |
||||
|
margin-left: 24upx; |
||||
|
line-height: 68upx; |
||||
|
text-align: center; |
||||
|
flex-shrink: 0; |
||||
|
width: 156upx; |
||||
|
color: #fff; |
||||
|
border-radius: 10upx; |
||||
|
background-color: $themeColor; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</style> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue