Browse Source

events order

organize
刘嘉炜 3 years ago
parent
commit
20a132e1bb
  1. 2
      src/js/api.js
  2. 21
      src/pages/write_off/events_order/events_order.vue
  3. 87
      src/pages/write_off/success/success.vue

2
src/js/api.js

@ -111,6 +111,8 @@ API['writeOff'] = {
// 20220222 新增赛事核销 // 20220222 新增赛事核销
// matchOrderVerify: `${ORIGIN}/admin/assistant/matchOrder/verify`, // 赛事订单确认核销 /用回之前的核销 // matchOrderVerify: `${ORIGIN}/admin/assistant/matchOrder/verify`, // 赛事订单确认核销 /用回之前的核销
matchOrderGateLs: `${ORIGIN}/admin/assistant/matchOrderGate/list`, // 商家助手-赛事订单核销后获取门
matchOrderGateOpen: `${ORIGIN}/admin/assistant/matchOrderGate/open`, // 商家助手-赛事订单核销后-开门
} }

21
src/pages/write_off/events_order/events_order.vue

@ -6,7 +6,7 @@
<view class="ei-line-box"> <view class="ei-line-box">
<view class="elb-line"> <view class="elb-line">
<view class="el-name">订单编号</view> <view class="el-name">订单编号</view>
<view class="el-txt">{{ orderInfo.verify_code || '-' }}</view>
<view class="el-txt">{{ orderInfo.order_no || '-' }}</view>
<view class="el-tag">(赛事)</view> <view class="el-tag">(赛事)</view>
</view> </view>
<view class="elb-line"> <view class="elb-line">
@ -64,17 +64,32 @@ export default {
}, },
methods: { methods: {
confirmWriteOff: util.debounce(function(){ confirmWriteOff: util.debounce(function(){
let { orderInfo, type } = this;
servers.post({ servers.post({
url: API.writeOff.assistantVerify, url: API.writeOff.assistantVerify,
data: {},
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, isDefaultGet: false,
}) })
.then(res=>{ .then(res=>{
if(res.data.code == 0){ 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{ }else{
util.showNone(res.data.message || '操作失败!'); util.showNone(res.data.message || '操作失败!');
} }
}) })
}, 300, true) }, 300, true)
} }

87
src/pages/write_off/success/success.vue

@ -1,19 +1,19 @@
<template> <template>
<view class="write-off-success"> <view class="write-off-success">
<view class="wos-stadium"> <view class="wos-stadium">
<view class="ws-name">欧轩智能羽毛球馆(永泰店)</view>
<view class="ws-name">{{ optionsQuery.stadium_name || '-' }}</view>
</view> </view>
<view class="wos-main"> <view class="wos-main">
<image class="wm-icon" mode="aspectFit" src="/static/images/icon/success_tip.png"></image> <image class="wm-icon" mode="aspectFit" src="/static/images/icon/success_tip.png"></image>
<view class="wm-txt">核销成功</view> <view class="wm-txt">核销成功</view>
<view class="wm-btn" hover-class="hover-active">返回继续核销</view>
<view class="wm-btn" hover-class="hover-active" @click="toBack">返回继续核销</view>
</view> </view>
<view class="wos-gate-ls">
<view class="wos-gate-ls" v-if="gateLs&&gateLs.length">
<view class="wgl-tit">如需开门请点击</view> <view class="wgl-tit">如需开门请点击</view>
<view class="wgl-ls"> <view class="wgl-ls">
<view class="wl-item" v-for="i in 3" :key="i">
<view class="wi-name">欧轩门禁</view>
<view class="wi-btn" hover-class="hover-active">开门</view>
<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>
</view> </view>
@ -21,8 +21,83 @@
</template> </template>
<script> <script>
import util from '../../../utils/util';
import { API } from '../../../js/api';
import { servers } from '../../../js/server';
export default { 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> </script>

Loading…
Cancel
Save