Browse Source

add api

privacy
刘嘉炜 2 years ago
parent
commit
a2ebb1b342
  1. 11
      src/components/site/order_modal/order_modal.vue
  2. 53
      src/pages/site/confirm/confirm.vue
  3. 37
      src/pages/site/manage/manage.vue
  4. 1
      src/store/index.js

11
src/components/site/order_modal/order_modal.vue

@ -124,11 +124,11 @@
<view class="ob-view red" @click="fixedCancelOccupy" v-if="orderInfo.pay_status==0&&orderInfo.overdue != true">取消订场</view>
<!-- <view class="ob-view red">退款</view> -->
</view>
<!-- 固定场 -->
<view class="om-btns" v-if="false">
<!-- 挂账 -->
<view class="om-btns" v-if="orderInfo.type == 'take_up_venue_bboc'">
<view class="ob-view" @click="toShare">分享给朋友</view>
<view class="ob-view red" @click="cancelOccupy">取消占用</view>
<view class="ob-view red2">收款</view>
<view class="ob-view red2" @click="toCollections">收款</view>
</view>
</view>
</view>
@ -168,6 +168,9 @@ export default {
this.getOrderInfo();
},
methods: {
toCollections(){
this.$emit('btn:toCollections', this.orderInfo);
},
releaseBtn(){
util.showModal({
title: '是否确认释放场地',
@ -300,6 +303,8 @@ export default {
return '约玩占用'
case 'fixed_venue':
return '固定场锁定'
case 'take_up_venue_bboc':
return '挂账占用'
default: return '-'
}
},

53
src/pages/site/confirm/confirm.vue

@ -24,7 +24,7 @@
<view>预定场次</view>
<view>
<block v-for="(e, i) in occupyInfo.venueList" :key="i">
<view>{{e.parentObj.venue_name || '-'}} {{e.durations || '-'}} (¥{{e.price || '-'}})</view>
<view>{{e.venue_name || '-'}} {{e.duration || '-'}} (¥{{e.price || '-'}})</view>
</block>
</view>
</view>
@ -34,13 +34,20 @@
</view>
</view>
<view class="sc-switch">
<view><view><text>*</text>是否联动开灯</view><switch @change="switchChange" color="#009874"></switch></view>
<view>
<view><text>*</text>是否联动开灯</view>
<switch
:disabled="isOrder"
v-model="light_up"
color="#009874"
></switch>
</view>
<view>联动开灯开启后会根据占用时间自动开灯</view>
</view>
<view class="sc-ipt">
<view class="si-price">
<view class="si-tit"><text>* </text>收取金额</view>
<view class="sp-frame"><text></text><input v-model="ocPrice" type="digit" /></view>
<view class="sp-frame"><text></text><input :disabled="isOrder" v-model="ocPrice" type="digit" /></view>
</view>
<view class="si-usage">
<view class="su-line">
@ -52,19 +59,6 @@
<image v-if="e.type == ocUsage" mode="aspectFit" src='/static/images/icon/selected_tag.png'></image>
</view>
</block>
<!-- <view :class="[ocUsage == 1 ? 'active' : '']" @click="ocUsage = 1">
<text>客户订场</text>
<image v-if="ocUsage == 1" mode="aspectFit" src='/static/images/icon/selected_tag.png'></image>
</view>
<view :class="[ocUsage == 2 ? 'active' : '']" @click="ocUsage = 2">
<text>散客</text>
<image v-if="ocUsage == 2" mode="aspectFit" src='/static/images/icon/selected_tag.png'></image>
</view>
<view :class="[ocUsage == 3 ? 'active' : '']" @click="ocUsage = 3">
<text>锁场</text>
<image v-if="ocUsage == 3" mode="aspectFit" src='/static/images/icon/selected_tag.png'></image>
</view> -->
</view>
</view>
<view class="su-tip">占用用途如选择散客用户端次卡列表将会显示该占用场次为散客时间</view>
@ -72,7 +66,7 @@
<view class="si-reason">
<view class="si-tit">占用原因</view>
<view class="sr-frame">
<textarea placeholder="多行输入…" v-model="ocReaon"></textarea>
<textarea :disabled="isOrder" placeholder="多行输入…" v-model="ocReaon"></textarea>
</view>
</view>
</view>
@ -101,14 +95,17 @@ export default {
}
},
computed: {
isOrder(){
return !!this?.occupyInfo?.orderInfo?.order_no;
},
...mapState([ 'occupyInfo' ]),
totalPrice(){
let { occupyInfo } = this;
if(occupyInfo?.orderInfo?.amount)return occupyInfo.orderInfo.amount;
let _list = occupyInfo.venueList || [];
if(!_list.length)return 0;
let _price = 0;
_list.forEach(e=>_price += +e.price);
console.warn(_price)
return _price.toFixed(2);
}
},
@ -116,8 +113,8 @@ export default {
console.log(this.occupyInfo)
},
methods: {
switchChange(e){
this.light_up = e.detail.value
initOrderPage(){
let { occupyInfo, isOrder }= this;
},
confirmOccupy: util.debounce(function(){
let { storeInfo, dateInfo, venueList, typeInfo} = this.occupyInfo;
@ -132,14 +129,7 @@ export default {
group: storeInfo.id,
date: dateInfo.dateStr,
take_up_use: ocUsage,
items: venueList.map(el=>{
return {
venue_id: el.parentObj.venue_id,
venue_name: el.parentObj.venue_name,
duration: el.durations,
price: el.price,
}
}),
items: venueList,
light_up,
},
isDefaultGet: false
@ -152,13 +142,6 @@ export default {
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(_=>{
// util.routeTo();
// util.previousPageFunction({ //
// fnName: 'refreshList',
// query: null
// })
// }, 1200)
}else{
util.showNone(res.data.message || '操作失败!');
}

37
src/pages/site/manage/manage.vue

@ -125,7 +125,7 @@
</view>
<view class="sfb-btn-bar" v-if="selectedVenueList.length">
<view class="sbb-price"><text>¥</text>{{totalPrice || '0.00'}}</view>
<view class="sbb-btn" hover-class="hover-active" @click="toOrderConfirm">
<view class="sbb-btn" hover-class="hover-active" @click="subOrder">
{{selectedVenueList.length?'提交订单':'请选择场地'}}
</view>
</view>
@ -133,7 +133,13 @@
<view class="sm-fixed-tip" v-if="occupyTip!==''">
<text>{{occupyTip || '-'}}</text>
</view>
<order-modal @close="boardInfo=null" @refresh='refreshVenues' v-if="boardInfo!==null" :query-info="boardInfo"></order-modal>
<order-modal
@close="boardInfo=null"
@refresh='refreshVenues'
@btn:toCollections="toConfirmPage"
v-if="boardInfo!==null"
:query-info="boardInfo"
></order-modal>
</view>
</template>
@ -244,6 +250,8 @@ export default {
return { zh_text: info.message || '约玩占用', type: info.type, className: 'black', }
case 'fixed_venue':
return { zh_text: info.message || '固定场锁定', type: info.type, className: 'blue', }
case 'take_up_venue_bboc':
return { zh_text: info.message || '挂账占用', type: info.type, className: 'red', }
default: return {}
@ -534,17 +542,32 @@ export default {
this.curTypeInfo = typeList[e.detail.value];
this.$nextTick(_=>this.refreshVenues());
},
toOrderConfirm(){
let { curStoreInfo, curTypeInfo, curDateInfo, selectedVenueList } = this;
subOrder(){
let { selectedVenueList } = this;
if(!selectedVenueList.length)return;
this.toOrderConfirm({
venueList: selectedVenueList.map(el =>({
venue_id: el.parentObj.venue_id,
venue_name: el.parentObj.venue_name,
duration: el.durations,
price: el.price,
})),
});
},
toConfirmPage(orderInfo){
this.toOrderConfirm({
venueList: orderInfo.sessions || [],
orderInfo,
});
},
toOrderConfirm(extraObj){
let { curStoreInfo, curTypeInfo, curDateInfo } = this;
this.$store.commit('setOccupyInfo', {
storeInfo: curStoreInfo,
dateInfo: curDateInfo,
typeInfo: curTypeInfo,
venueList: selectedVenueList,
...extraObj,
})
util.routeTo(`/pages/site/confirm/confirm`, 'rT');
},
//

1
src/store/index.js

@ -50,6 +50,7 @@ export default new Vuex.Store({
dateInfo: {}, // 时间信息
typeInfo: {}, // 球场类型
venueList: [], // 选择场地列表
orderInfo: {}, // 订单信息 // 20230620 新增挂账需求,用于回显确认订单
}
},
mutations,

Loading…
Cancel
Save