Browse Source

add occupy

course
刘嘉炜 4 years ago
parent
commit
2599c98b0d
  1. 124
      src/components/site/order_modal/order_modal.vue
  2. 7
      src/js/api.js
  3. 7
      src/pages/site/confirm/confirm.vue
  4. 15
      src/pages/site/manage/manage.vue
  5. 37
      src/pages/site/occupy_share/occupy_share.vue
  6. 47
      src/pages/site/occupy_success/occupy_success.vue

124
src/components/site/order_modal/order_modal.vue

@ -1,7 +1,7 @@
<template> <template>
<view class="fixed-mask" @click="modalClose"> <view class="fixed-mask" @click="modalClose">
<view class="order-modal" @click.stop="_=>false"> <view class="order-modal" @click.stop="_=>false">
<view class="om-title">{{ queryInfo.venueInfo.zh_text || '-' }}</view>
<view class="om-title">{{ getTitle(queryInfo.venueInfo.type) }}</view>
<image class="om-close" @click="modalClose" mode="aspectFit" src="/static/images/icon/x_close.png"></image> <image class="om-close" @click="modalClose" mode="aspectFit" src="/static/images/icon/x_close.png"></image>
<view class="om-name-line"> <view class="om-name-line">
<view class="onl-view">{{ orderInfo.stadium_name || '-' }}</view> <view class="onl-view">{{ orderInfo.stadium_name || '-' }}</view>
@ -13,25 +13,53 @@
<view class="ov-view">{{ orderInfo.order_no || '-' }}</view> <view class="ov-view">{{ orderInfo.order_no || '-' }}</view>
</view> </view>
</view> </view>
<view class="om-info-line">
<view class="om-info-line" v-if="orderInfo.type != 'take_up_venue'">
<view class="oil-view">创建时间</view> <view class="oil-view">创建时间</view>
<view class="oil-view"> <view class="oil-view">
<view class="ov-view">{{ orderInfo.create_at || '-' }}</view>
<view class="ov-view">{{ orderInfo.created_at || '-' }}</view>
</view> </view>
</view> </view>
<view class="om-info-line">
<view class="oil-view">手机号</view>
<view class="om-info-line" v-if="orderInfo.type != 'take_up_venue'">
<view class="oil-view">验证</view>
<view class="oil-view"> <view class="oil-view">
<view class="ov-view">{{ orderInfo.phone || '-' }}</view>
<view class="ov-view">{{ orderInfo.verifyt_code || '-' }}</view>
</view> </view>
</view> </view>
<view class="om-info-line">
<view class="oil-view">验证</view>
<view class="om-info-line" v-if="orderInfo.type == 'mini_program'">
<view class="oil-view">手机号</view>
<view class="oil-view"> <view class="oil-view">
<view class="ov-view">{{ orderInfo.verify_code || '-' }}</view>
<view class="ov-view">{{ orderInfo.mobile || '-' }}</view>
</view> </view>
</view> </view>
<block v-if="orderInfo.type == 'take_up_venue'" >
<view class="om-info-line">
<view class="oil-view">是否联动开灯</view>
<view class="oil-view">
<view class="ov-view">{{ orderInfo.light_up?'是':'否'}}</view>
</view>
</view>
<view class="om-info-line">
<view class="oil-view">收取金额</view>
<view class="oil-view">
<view class="ov-view">{{ orderInfo.amount || '0' }}</view>
</view>
</view>
<view class="om-info-line">
<view class="oil-view">占用原因</view>
<view class="oil-view">
<view class="ov-view">{{ orderInfo.reason || '-' }}</view>
</view>
</view>
<view class="om-info-line">
<view class="oil-view">操作人</view>
<view class="oil-view">
<view class="ov-view">{{ orderInfo.operator || '-' }}</view>
</view>
</view>
</block>
<view class="om-border"></view> <view class="om-border"></view>
<view class="om-name-line"> <view class="om-name-line">
@ -57,10 +85,26 @@
</view> </view>
</view> </view>
</view> </view>
<view class="om-total">实付款 {{ orderInfo.amount || '0' }}</view>
<view class="om-btns" v-if="false">
<view class="om-total" v-if="orderInfo.type != 'take_up_venue'" >实付款 {{ orderInfo.amount || '0' }}</view>
<!-- 管理员占用 -->
<view class="om-btns" v-if="orderInfo.type == 'take_up_venue'">
<view class="ob-view">分享给朋友</view> <view class="ob-view">分享给朋友</view>
<view class="ob-view">取消占用</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>
<!-- 课程预定 -->
<view class="om-btns" v-if="orderInfo.type == 'course_venue'">
<view class="ob-view">约课详情</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> </view>
</view> </view>
</view> </view>
@ -88,14 +132,61 @@ export default {
this.getOrderInfo(); this.getOrderInfo();
}, },
methods: { methods: {
getTitle(type){
switch(type){
case 'no_price_venue':
return '无法订场'
case 'empty_venue':
return '-'
case 'mini_program':
return '小程序订场'
case 'take_up_venue':
return '管理员占用'
case 'course_venue':
return '课程预定'
case 'pay_venue':
return '约玩占用'
case 'fixed_venue':
return '固定场锁定'
default: return '-'
}
},
cancelOccupy: util.debounce(function(){
let { orderInfo, queryInfo } = this;
servers.get({
url: API.venue.takeUpCancel,
data: {
brand_id: queryInfo.brand_id,
order_no: orderInfo.order_no,
},
isDefaultGet: false,
})
.then(res=>{
if(res.data.code == 0){
this.$emit('refresh');
util.showNone(res.data.message || '操作成功!');
}else{
util.showNone(res.data.message || '操作失败!');
}
})
}, 300, true),
modalClose(){ modalClose(){
this.$emit('close'); this.$emit('close');
}, },
getOrderInfo(){ getOrderInfo(){
util.showLoad(); util.showLoad();
servers.get({
let { queryInfo } = this;
servers.post({
url: API.venue.dashboardInfo, url: API.venue.dashboardInfo,
data: this.queryInfo,
data: {
brand_id: queryInfo.brand_id,
stadium_id: queryInfo.stadium_id,
venue_id: queryInfo.venue_id,
date: queryInfo.date,
duration: queryInfo.duration,
},
isDefaultGet: false, isDefaultGet: false,
}) })
.then(res=>{ .then(res=>{
@ -212,6 +303,7 @@ export default {
color: #1a1a1a; color: #1a1a1a;
} }
.om-btns{ .om-btns{
margin-top: 40upx;
margin-bottom: 10upx; margin-bottom: 10upx;
@include centerFlex(flex-end); @include centerFlex(flex-end);
.ob-view{ .ob-view{
@ -225,6 +317,10 @@ export default {
font-size: 32upx; font-size: 32upx;
font-weight: 500; font-weight: 500;
color: $themeColor; color: $themeColor;
&.red{
border-color: #EA5061;
color: #EA5061;
}
} }
} }
} }

7
src/js/api.js

@ -62,13 +62,16 @@ API['venue'] = {
venueTypes: `${ORIGIN}/stadium/venue/types`, // 场馆类型 venueTypes: `${ORIGIN}/stadium/venue/types`, // 场馆类型
// venueList: `${ORIGIN}/stadium/book/list`, // 场地列表 // venueList: `${ORIGIN}/stadium/book/list`, // 场地列表
venueTakeUp: `${ORIGIN}/admin/assistant/venue/takeUp`, // 商家助手-占用场地提交
venueTakeUp: `${ORIGIN}/admin/stadium/venue/takeUp`, // 商家助手-占用场地提交
takeUpList: `${ORIGIN}/admin/timeSelect/list/4`, // 商家助手-占用场地列表 takeUpList: `${ORIGIN}/admin/timeSelect/list/4`, // 商家助手-占用场地列表
setStatus: `${ORIGIN}/admin/timeSelect/setStatus`, // 商家助手-占用场地列表 setStatus: `${ORIGIN}/admin/timeSelect/setStatus`, // 商家助手-占用场地列表
// 20210726 新增 // 20210726 新增
venueList: `${ORIGIN}/admin/stadium/venue/dashboard/list`, // 场地列表 20210726 看板新增修改 venueList: `${ORIGIN}/admin/stadium/venue/dashboard/list`, // 场地列表 20210726 看板新增修改
dashboardInfo: `${ORIGIN}/admin/stadium/venue/dashboard/detail`, // 商家助手-占用场地列表
dashboardInfo: `${ORIGIN}/admin/stadium/venue/dashboard/detail`, // 看板详情
takeUpVerifyQr: `${ORIGIN}/admin/stadium/venue/takeUpVerifyQr`, // 商家助手 - 占用核销码
takeUpShareQr: `${ORIGIN}/admin/stadium/venue/takeUpShareQr`, // 商家助手 - 占用分享码
takeUpCancel: `${ORIGIN}/admin/stadium/venue/takeUpCancel`, // 商家助手-取消占用场地
} }

7
src/pages/site/confirm/confirm.vue

@ -78,6 +78,7 @@ export default {
servers.post({ servers.post({
url: API.venue.venueTakeUp, url: API.venue.venueTakeUp,
data: { data: {
brand_id: storeInfo.brand_id,
reason: ocReaon, reason: ocReaon,
amount: +ocPrice, amount: +ocPrice,
group: storeInfo.id, group: storeInfo.id,
@ -86,7 +87,7 @@ export default {
return { return {
venue_id: el.parentObj.venue_id, venue_id: el.parentObj.venue_id,
venue_name: el.parentObj.venue_name, venue_name: el.parentObj.venue_name,
duration: el.duration,
duration: el.durations,
price: el.price price: el.price
} }
}) })
@ -97,7 +98,9 @@ export default {
if(res.data.code == 0){ if(res.data.code == 0){
util.showNone(res.data.message || '操作成功!'); util.showNone(res.data.message || '操作成功!');
util.routeTo(`/pages/site/occupy_success/occupy_success`, 'rT');
let _res = res.data.data || {};
let _qrStr = `?brand_id=${_res.brand_id}&order_no=${_res.order_no}`
util.routeTo(`/pages/site/occupy_success/occupy_success${_qrStr}`, 'rT');
// setTimeout(_=>{ // setTimeout(_=>{
// util.routeTo(); // util.routeTo();
// util.previousPageFunction({ // // util.previousPageFunction({ //

15
src/pages/site/manage/manage.vue

@ -114,7 +114,7 @@
<view class="sm-fixed-tip" v-if="occupyTip!==''"> <view class="sm-fixed-tip" v-if="occupyTip!==''">
<text>{{occupyTip || '-'}}</text> <text>{{occupyTip || '-'}}</text>
</view> </view>
<order-modal @close="boardInfo=null" v-if="boardInfo!=null" :query-info="boardInfo"></order-modal>
<order-modal @close="boardInfo=null" @refresh='refreshVenues' v-if="boardInfo!=null" :query-info="boardInfo"></order-modal>
</view> </view>
</template> </template>
@ -203,19 +203,19 @@ export default {
getVenueStatusnInfo(info){ getVenueStatusnInfo(info){
switch(info.type){ switch(info.type){
case 'no_price_venue': case 'no_price_venue':
return { zh_text: '无法订场', type: info.type, className: 'grey', }
return { zh_text: info.message || '无法订场', type: info.type, className: 'grey', }
case 'empty_venue': case 'empty_venue':
return { zh_text: info.message, type: info.type, className: '', } return { zh_text: info.message, type: info.type, className: '', }
case 'mini_program': case 'mini_program':
return { zh_text: '小程序订场', type: info.type, className: 'green', }
return { zh_text: info.message || '小程序订场', type: info.type, className: 'green', }
case 'take_up_venue': case 'take_up_venue':
return { zh_text: '管理员占用', type: info.type, className: 'black', }
return { zh_text: info.message || '管理员占用', type: info.type, className: 'black', }
case 'course_venue': case 'course_venue':
return { zh_text: '课程预定', type: info.type, className: 'pistac', }
return { zh_text: info.message || '课程预定', type: info.type, className: 'pistac', }
case 'pay_venue': case 'pay_venue':
return { zh_text: '约玩占用', type: info.type, className: 'black', }
return { zh_text: info.message || '约玩占用', type: info.type, className: 'black', }
case 'fixed_venue': case 'fixed_venue':
return { zh_text: '固定场', type: info.type, className: 'blue', }
return { zh_text: info.message || '固定场锁定', type: info.type, className: 'blue', }
default: return {} default: return {}
@ -263,6 +263,7 @@ export default {
try{ try{
util.showLoad(); util.showLoad();
this.venueList = []; this.venueList = [];
this.boardInfo = null;
let _res = await this.getVenueList({ let _res = await this.getVenueList({
type_key: curTypeInfo.key || '', type_key: curTypeInfo.key || '',
stadium_id: curStoreInfo.id || '', stadium_id: curStoreInfo.id || '',

37
src/pages/site/occupy_share/occupy_share.vue

@ -2,12 +2,12 @@
<view class="occupy-share"> <view class="occupy-share">
<view class="os-address"> <view class="os-address">
<view class="oa-name"> <view class="oa-name">
<image></image>
<view>欧轩智能场馆(羽毛球馆永泰店)</view>
<image mode="aspectFit" :src="shareInfo.stadium_logo"></image>
<view>{{ shareInfo.stadium_name || '-' }}</view>
</view> </view>
<view class="oa-info"> <view class="oa-info">
<view>地址</view> <view>地址</view>
<view>广州市白云区永平街道学山塘街世联空间D2座5楼</view>
<view>{{ shareInfo.stadium_address || '-' }}</view>
</view> </view>
</view> </view>
<view class="os-section"> <view class="os-section">
@ -17,15 +17,40 @@
<view> 接收微信消息<text>领取入场码</text></view> <view> 接收微信消息<text>领取入场码</text></view>
<view> 领取成功后<text>仅限本人使用</text></view> <view> 领取成功后<text>仅限本人使用</text></view>
</view> </view>
<image class="os-code-img"></image>
<image class="os-code-img" mode="aspectFit" :src="shareInfo.share_qrcode"></image>
<view class="os-tip">此码非入场码</view> <view class="os-tip">此码非入场码</view>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import { API } from '../../../js/api'
import { servers } from '../../../js/server'
export default { export default {
data(){
return {
shareInfo: {},
}
},
onLoad(options){
this.getShareCode({
brand_id: options.brand_id,
order_no: options.order_no,
})
},
methods: {
getShareCode({ brand_id, order_no }){
servers.get({
url: API.venue.takeUpShareQr,
data: { brand_id, order_no, },
failMsg: '加载失败!'
})
.then(res=> {
console.warn('shareInfo', res)
this.shareInfo = res || {};
})
}
}
} }
</script> </script>
@ -50,7 +75,6 @@ export default {
margin-right: 10upx; margin-right: 10upx;
width: 34upx; width: 34upx;
height: 34upx; height: 34upx;
background-color: skyblue;
} }
>view{ >view{
line-height: 40upx; line-height: 40upx;
@ -101,7 +125,6 @@ export default {
margin-bottom: 12upx; margin-bottom: 12upx;
width: 300upx; width: 300upx;
height: 300upx; height: 300upx;
background-color: skyblue;
} }
} }
.os-tip{ .os-tip{

47
src/pages/site/occupy_success/occupy_success.vue

@ -1,9 +1,9 @@
<template> <template>
<view class="occupy-success"> <view class="occupy-success">
<view class="os-address">欧轩智能场馆(羽毛球馆永泰店)</view>
<image class="os-code"></image>
<view class="os-num">验证码12235 51234</view>
<view class="os-btn">
<view class="os-address">{{ qrInfo.stadium_name || '-' }}</view>
<image class="os-code" mode="aspectFit" :src="qrInfo.verify_qrcode"></image>
<view class="os-num">验证码{{ qrInfo.verify_code || '-' }}</view>
<view class="os-btn" @click="toShare">
<view>分享给朋友</view> <view>分享给朋友</view>
<image mode="aspectFit" src="/static/images/icon/share_arrow_cff.png"></image> <image mode="aspectFit" src="/static/images/icon/share_arrow_cff.png"></image>
</view> </view>
@ -12,15 +12,52 @@
</template> </template>
<script> <script>
import { API } from '../../../js/api';
import { servers } from '../../../js/server';
import util from '../../../utils/util'; import util from '../../../utils/util';
export default { export default {
data(){
return {
qrInfo: {},
optionsQuery: {},
}
},
onLoad(options){
this.optionsQuery = options || {};
this.getPageInfo({
brand_id: options.brand_id,
order_no: options.order_no,
})
},
methods: { methods: {
toShare(){
let { optionsQuery } = this;
let _qrStr = `?brand_id=${optionsQuery.brand_id}&order_no=${optionsQuery.order_no}`
util.routeTo(`/pages/site/occupy_share/occupy_share${_qrStr}`, 'nT')
},
backBtn(){ backBtn(){
util.routeTo(); util.routeTo();
util.previousPageFunction({ // util.previousPageFunction({ //
fnName: 'refreshList', fnName: 'refreshList',
query: null query: null
}) })
},
getPageInfo({
brand_id,
order_no,
}){
servers.get({
url: API.venue.takeUpVerifyQr,
data: {
brand_id,
order_no,
},
failMsg: '加载失败!'
})
.then(res=>{
console.warn('res--->' , res);
this.qrInfo = res || {};
})
} }
} }
@ -45,13 +82,13 @@ export default {
display: block; display: block;
width: 400upx; width: 400upx;
height: 400upx; height: 400upx;
background-color: skyblue;
} }
.os-num{ .os-num{
margin-bottom: 128upx; margin-bottom: 128upx;
text-align: center; text-align: center;
font-size: 32upx; font-size: 32upx;
color: #333; color: #333;
@include textHide(1);
} }
.os-btn{ .os-btn{
margin: 0 auto 92upx; margin: 0 auto 92upx;

Loading…
Cancel
Save