Browse Source

add all

course
刘嘉炜 4 years ago
parent
commit
d95af2e541
  1. 87
      src/components/site/order_modal/order_modal.vue
  2. 2
      src/js/api.js
  3. 15
      src/pages/site/confirm/confirm.vue
  4. 4
      src/pages/site/manage/manage.vue

87
src/components/site/order_modal/order_modal.vue

@ -5,7 +5,8 @@
<image class="om-close" @click="modalClose" mode="aspectFit" src="/static/images/icon/x_close.png"></image>
<view class="om-name-line">
<view class="onl-view">{{ orderInfo.stadium_name || '-' }}</view>
<!-- <view class="onl-view">待使用</view> -->
<!-- 0128 -->
<view class="onl-view" v-if="isShowStatus">{{ getStatusTxt(orderInfo.pay_status) }}</view>
</view>
<view class="om-info-line">
<view class="oil-view">订单编号</view>
@ -85,26 +86,26 @@
</view>
</view>
</view>
<view class="om-total" v-if="orderInfo.type != 'take_up_venue'" >实付款 {{ orderInfo.amount || '0' }}</view>
<view class="om-total" v-if="isShowTotalAmoutn" >实付款 {{ orderInfo.amount || '0' }}</view>
<!-- 管理员占用 -->
<view class="om-btns" v-if="orderInfo.type == 'take_up_venue'">
<view class="ob-view">分享给朋友</view>
<view class="ob-view" @click="toShare">分享给朋友</view>
<view class="ob-view red" @click="cancelOccupy">取消占用</view>
</view>
<!-- 小程序预定 -->
<view class="om-btns" v-if="orderInfo.type == 'mini_program'">
<view class="ob-view">订单详情</view>
<view class="ob-view red">退款</view>
<view class="ob-view" @click="toOrderInfo">订单详情</view>
<view class="ob-view red" @click="refundBtn">退款</view>
</view>
<!-- 课程预定 -->
<view class="om-btns" v-if="orderInfo.type == 'course_venue'">
<view class="ob-view">约课详情</view>
<view class="ob-view" @click="toCouseInfo">约课详情</view>
</view>
<!-- 固定场 -->
<view class="om-btns" v-if="orderInfo.type == 'fixed_venue'">
<view class="ob-view red">取消订场</view>
<view class="ob-view">订单详情</view>
<view class="ob-view red">退款</view>
<view class="ob-view" @click="toOrderInfo">订单详情</view>
<view class="ob-view red" @click="cancelOccupy">取消订场</view>
<!-- <view class="ob-view red">退款</view> -->
</view>
</view>
</view>
@ -116,6 +117,19 @@ import { API } from '../../../js/api'
import { servers } from '../../../js/server'
import util from '../../../utils/util'
export default {
computed: {
// 使
isShowStatus(){
let { orderInfo } = this;
return orderInfo.type == 'mini_program' || orderInfo.type == 'fixed_venue'
},
isShowTotalAmoutn(){
let { orderInfo } = this;
return orderInfo.type == 'mini_program' || orderInfo.type == 'course_venue' || orderInfo.type == 'fixed_venue'
}
},
props: {
queryInfo: {
type: Object,
@ -132,6 +146,55 @@ export default {
this.getOrderInfo();
},
methods: {
toCouseInfo(){
util.showNone('待开放')
},
refundBtn: util.debounce(function(){
let { orderInfo, queryInfo } = this;
servers.post({
url: API.venue.orderRefund,
data: {
brand_id: queryInfo.brand_id,
order_no: orderInfo.order_no,
},
isDefaultGet: false,
})
.then(res=>{
if(res.data.code == 0){
util.showNone(res.data.message || '操作成功!');
setTimeout(_=>this.$emit('refresh'), 1200);
}else{
util.showNone(res.data.message || '操作失败!');
}
})
}, 300, true),
toOrderInfo(){
let { orderInfo, queryInfo } = this;
let _query = {}
_query["stadium_id"] = queryInfo.stadium_id
_query["order_no"] = orderInfo.order_no
_query["order_type"] = 3
util.routeTo(`/subpackage/device/pages/order_details/order_details?query=${util.jsonStr(_query)}`,'nT');
},
toShare(){
let { orderInfo, queryInfo } = this;
let _qyStr = `?brand_id=${queryInfo.brand_id}&order_no=${orderInfo.order_no}`
util.routeTo(`/pages/site/occupy_share/occupy_share${_qyStr}`, 'nT');
},
getStatusTxt(status){
switch(status){
case 0:
return '待扣款'
case 1:
return '使用中'
case 2:
return '已完成'
case 8:
return '使用中'
default: return '-'
}
},
getTitle(type){
switch(type){
case 'no_price_venue':
@ -144,13 +207,11 @@ export default {
return '管理员占用'
case 'course_venue':
return '课程预定'
case 'pay_venue':
case 'play_venue':
return '约玩占用'
case 'fixed_venue':
return '固定场锁定'
default: return '-'
}
},
cancelOccupy: util.debounce(function(){
@ -165,7 +226,7 @@ export default {
})
.then(res=>{
if(res.data.code == 0){
this.$emit('refresh');
setTimeout(_=>this.$emit('refresh'), 1200);
util.showNone(res.data.message || '操作成功!');
}else{
util.showNone(res.data.message || '操作失败!');

2
src/js/api.js

@ -72,7 +72,7 @@ API['venue'] = {
takeUpVerifyQr: `${ORIGIN}/admin/stadium/venue/takeUpVerifyQr`, // 商家助手 - 占用核销码
takeUpShareQr: `${ORIGIN}/admin/stadium/venue/takeUpShareQr`, // 商家助手 - 占用分享码
takeUpCancel: `${ORIGIN}/admin/stadium/venue/takeUpCancel`, // 商家助手-取消占用场地
orderRefund: `${ORIGIN}/admin/stadium/order/cancel`, // 商家助手 - 退款
}

15
src/pages/site/confirm/confirm.vue

@ -30,7 +30,7 @@
</view>
</view>
<view class="sc-switch">
<view><view><text>*</text>是否联动开灯</view><switch color="#009874"></switch></view>
<view><view><text>*</text>是否联动开灯</view><switch @change="switchChange" color="#009874"></switch></view>
<view>联动开灯开启后会根据占用时间自动开灯</view>
</view>
<view class="sc-ipt">
@ -61,7 +61,8 @@ export default {
data(){
return {
ocPrice: '',
ocReaon: ''
ocReaon: '',
light_up: false,
}
},
computed: {
@ -71,9 +72,12 @@ export default {
console.log(this.occupyInfo)
},
methods: {
switchChange(e){
this.light_up = e.detail.value
},
confirmOccupy: util.debounce(function(){
let { storeInfo, dateInfo, venueList, typeInfo } = this.occupyInfo;
let { ocPrice, ocReaon } = this;
let { ocPrice, ocReaon, light_up } = this;
servers.post({
url: API.venue.venueTakeUp,
@ -90,7 +94,8 @@ export default {
duration: el.durations,
price: el.price
}
})
}),
light_up,
},
isDefaultGet: false
})
@ -113,7 +118,7 @@ export default {
}
})
}),
}, 300, true),
},
}
</script>

4
src/pages/site/manage/manage.vue

@ -212,7 +212,7 @@ export default {
return { zh_text: info.message || '管理员占用', type: info.type, className: 'black', }
case 'course_venue':
return { zh_text: info.message || '课程预定', type: info.type, className: 'pistac', }
case 'pay_venue':
case 'play_venue':
return { zh_text: info.message || '约玩占用', type: info.type, className: 'black', }
case 'fixed_venue':
return { zh_text: info.message || '固定场锁定', type: info.type, className: 'blue', }
@ -311,7 +311,7 @@ export default {
let { curStoreInfo } = this;
let _venueInfo = { ..._venueList[i] };
return this.boardInfo = {
brand_id: curStoreInfo.curStoreInfo,
brand_id: curStoreInfo.brand_id,
stadium_id: curStoreInfo.id,
venue_id: _venueInfo.venue_id,
date: _venueInfo.date,

Loading…
Cancel
Save