Browse Source

add write off success

organize
刘嘉炜 3 years ago
parent
commit
4b01d5c874
  1. 3
      src/js/api.js
  2. 2
      src/js/once_name.js
  3. 6
      src/pages.json
  4. 52
      src/pages/write_off/events_order/events_order.vue
  5. 15
      src/pages/write_off/operate/operate.vue
  6. 25
      src/pages/write_off/success/success.vue

3
src/js/api.js

@ -109,6 +109,9 @@ API['writeOff'] = {
timingNumber: `${ORIGIN}/stadium/person/timing/number`, // 现场人数
setStadiumPresentNumber: `${ORIGIN}/admin/stadium/setStadiumPresentNumber`, // 商家助手散客人数校正
// 20220222 新增赛事核销
matchOrderVerify: `${ORIGIN}/admin/assistant/matchOrder/verify`, // 赛事订单确认核销
}

2
src/js/once_name.js

@ -2,7 +2,7 @@
// 避免命名冲突,误触监听器
export const WRITE_OFF_STORE_INFO = 'stadium_list';
export const WRITE_OFF_ORDER_INFO = 'order_info';
export const WRITE_OFF_ORDER_INFO = 'order_info'; // 场地核销确认页/ 年月卡核销确认页/ 赛事核销确认页
export const WRITE_OFF_YM_ORDER_INFO = 'ym_order_info'; // 年月卡订单核销
export const WRITE_OFF_MALL_ORDER_INFO = 'mall_order_info'; // 商城订单核销
export const WRITE_OFF_MALL_ORDER_SUCCESS = 'mall_order_success'; // 商城订单核销成功!

6
src/pages.json

@ -134,6 +134,12 @@
}
},
{
"path": "pages/write_off/success/success",
"style": {
"navigationBarTitleText": "核销订单"
}
},
{
"path": "pages/write_off/events_order/events_order",
"style": {
"navigationBarTitleText": "核销订单"

52
src/pages/write_off/events_order/events_order.vue

@ -2,32 +2,32 @@
<view class="events-order">
<view class="eo-main">
<view class="em-info">
<view class="ei-title">欧轩智能羽毛球馆(永泰店)</view>
<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">20195175645666</view>
<view class="el-txt">{{ orderInfo.verify_code || '-' }}</view>
<view class="el-tag">(赛事)</view>
</view>
<view class="elb-line">
<view class="el-name">用户昵称</view>
<view class="el-txt">周大强</view>
<view class="el-txt">{{ orderInfo.nickname || '-' }}</view>
</view>
<view class="elb-line">
<view class="el-name">验证码</view>
<view class="el-txt">200525458978</view>
<view class="el-txt">{{ orderInfo.verify_code || '-' }}</view>
</view>
<view class="elb-line">
<view class="el-name">赛事名称</view>
<view class="el-txt">篮球比赛</view>
<view class="el-txt">{{ orderInfo.match_name || '-' }}</view>
</view>
<view class="elb-line">
<view class="el-name">赛事类型</view>
<view class="el-txt">个人赛</view>
<view class="el-txt">{{ orderInfo.match_type || '-' }}</view>
</view>
<view class="elb-line">
<view class="el-name">进场时间</view>
<view class="el-txt">2019-05-18 11:00-12:00</view>
<view class="el-txt">{{ orderInfo.in_time || '-' }}</view>
</view>
</view>
@ -35,15 +35,49 @@
</view>
<view class="em-border"></view>
<view class="em-btn">
<view hover-class="hover-active">确认核销</view>
<view hover-class="hover-active" @click="confirmWriteOff">确认核销</view>
</view>
</view>
</view>
</template>
<script>
export default {
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(){
servers.post({
url: API.writeOff.matchOrderVerify,
data: {},
isDefaultGet: false,
})
.then(res=>{
if(res.data.code == 0){
}else{
util.showNone(res.data.message || '操作失败!');
}
})
}, 300, true)
}
}
</script>

15
src/pages/write_off/operate/operate.vue

@ -134,9 +134,11 @@ export default {
writeOffType == 'site'&&(_query['decrypt_text'] = decrypt_text);
writeOffType == 'mall'&&(_query['vcode'] = decrypt_text);
}
if(writeOffType == 'site')return this.siteGet({ query: _query, vType: _vType, });
if(writeOffType == 'mall')return this.mallGet({ query: _query, vType: _vType, });
},
//
mallGet({ query = {}, vType = '', }){
util.showLoad();
@ -163,7 +165,10 @@ export default {
})
.catch(util.hideLoad)
},
// /
// / /
// @vType verify_code()/ decrypt_text()
siteGet({ query = {}, vType = '', }){
util.showLoad();
servers.get({
@ -176,12 +181,20 @@ export default {
if(res.data.code == 0){
let _data = res.data.data || {}
//
if(_data.extension&&_data.extension.verify_order_type === 'monthly_card'){
util.$_emit(WRITE_OFF_ORDER_INFO, {..._data});
util.routeTo(`/pages/write_off/ym_confirm/ym_confirm?type=${vType}`, 'nT');
return
}
//
if(_data.extension&&_data.extension.verify_order_type === 'match_order'){
util.$_emit(WRITE_OFF_ORDER_INFO, {..._data});
util.routeTo(`/pages/write_off/events_order/events_order?type=${vType}`, 'nT');
return
}
util.$_emit(WRITE_OFF_ORDER_INFO, {..._data});
util.routeTo(`/pages/write_off/confirm_order/confirm_order?type=${vType}`, 'nT');
}else{

25
src/pages/write_off/success/success.vue

@ -0,0 +1,25 @@
<template>
<view class="write-off-success">
<view class="wos-stadium">
</view>
</view>
</template>
<script>
export default {
}
</script>
<style lang="scss">
@import '~style/public.scss';
page{
background-color: #fff;
}
.write-off-success{
.wos-stadium{
}
}
</style>
Loading…
Cancel
Save