Browse Source

Merge branch 'md230614'

feat-230721
刘嘉炜 2 years ago
parent
commit
d145e443ab
  1. 22
      src/components/reservation_order/reservation_order.vue
  2. 36
      src/components/site/order_modal/order_modal.vue
  3. 11
      src/pages.json
  4. 176
      src/pages/site/confirm/confirm.vue
  5. 52
      src/pages/site/manage/manage.vue
  6. 2
      src/pages/turnover/turnover.vue
  7. 1
      src/store/index.js
  8. 215
      src/subpackage/common/components/card_search.vue
  9. 10
      src/subpackage/common/js/api.js
  10. 10
      src/subpackage/common/js/server.js
  11. 402
      src/subpackage/common/pages/pay_type_select.vue
  12. BIN
      src/subpackage/common/static/images/choose.png
  13. BIN
      src/subpackage/common/static/images/ic_0.png
  14. BIN
      src/subpackage/common/static/images/ic_1.png
  15. BIN
      src/subpackage/common/static/images/ic_2.png
  16. BIN
      src/subpackage/common/static/images/ic_3.png
  17. BIN
      src/subpackage/common/static/images/ic_4.png
  18. BIN
      src/subpackage/common/static/images/x_close.png
  19. 69
      src/subpackage/device/components/order/reservation_site_detail/reservation_site_detail.vue
  20. 1
      src/subpackage/retail/components/store_card_select/store_card_select.vue
  21. 6
      src/subpackage/retail/pages/confirm_order/confirm_order.vue

22
src/components/reservation_order/reservation_order.vue

@ -3,7 +3,7 @@
<view class="ro-header">
<view class="rh-view">{{orderInfo.stadium_name || '-'}}</view>
<text
:class="[ 'rh-text', orderInfo.pay_status == 1?'rh-active':'', orderInfo.pay_status == 4?'rh-red':'' ]"
:class="[ 'rh-text', orderInfo.pay_status == 1?'rh-active':'', zh_order_status(orderInfo) == '已退款'?'rh-red':'' ]"
>{{zh_order_status(orderInfo)}}</text>
</view>
<view class="ro-section">
@ -96,17 +96,6 @@ export default {
return _obj[`${status}`] || '-'
}
},
zh_pay_type(){
// 012
return status =>{
const _obj = {
'0': '微信支付',
'1': '支付宝支付',
'2': '储值卡支付',
}
return _obj[`${status}`] || '-'
}
},
zh_type_name(){
// 0 1
let { orderInfo } = this
@ -130,6 +119,15 @@ export default {
// -101使2使34退
let _status = orderInfo.pay_status || '';
if(_status == 3&&orderInfo.is_active_release)return '已失效*'; // 20220929 '*'
// 20230705
// end0退 share_pid0退
// extension.take_up_bboc && !extension.take_up_bboc_pay
if(
orderInfo.pay_status == 4&&
(orderInfo.share_pid > 0 ||
orderInfo.pay_amount == 0 ||
(orderInfo?.extension?.take_up_bboc && !orderInfo?.extension?.take_up_bboc_pay))
)return '已取消';
const _obj = {
'-1': '已作废',
'0': '未支付',

36
src/components/site/order_modal/order_modal.vue

@ -39,7 +39,7 @@
</view>
</view>
<block v-if="orderInfo.type == 'take_up_venue'" >
<block v-if="orderInfo.type == 'take_up_venue' || orderInfo.type == 'take_up_venue_bboc'" >
<view class="om-info-line">
<view class="oil-view">是否联动开灯</view>
<view class="oil-view">
@ -61,7 +61,7 @@
<view class="om-info-line">
<view class="oil-view">操作人</view>
<view class="oil-view">
<view class="ov-view">{{ orderInfo.operator || ' ' }}</view>
<view class="ov-view">{{ orderInfo.operator || '-' }}</view>
</view>
</view>
</block>
@ -124,6 +124,16 @@
<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="orderInfo.type == 'take_up_venue_bboc'">
<block v-if="!isOverTime">
<view class="ob-view" @click="toShare" v-if="orderInfo.is_take_up_can_share">分享给朋友</view>
<view class="ob-view red" @click="cancelOccupy">取消占用</view>
</block>
<view class="ob-view red2" v-if="!orderInfo.take_up_use_bboc_pay" @click="toCollections">收款</view>
<view class="ob-view gray" v-else>已收款</view>
</view>
</view>
</view>
</template>
@ -145,6 +155,14 @@ export default {
let { orderInfo } = this;
return orderInfo.type == 'mini_program' || orderInfo.type == 'course_venue' || orderInfo.type == 'fixed_venue'
},
isOverTime(){
let { orderInfo } = this;
let endTime = orderInfo?.stadium_order?.end_time || new Date().getTime();
let nowTimeStamp = new Date().getTime();
let endTimeStamp = new Date(endTime.toString().replace(/\-/g, '/')).getTime();
return nowTimeStamp > endTimeStamp;
}
},
props: {
@ -162,6 +180,9 @@ export default {
this.getOrderInfo();
},
methods: {
toCollections(){
this.$emit('btn:toCollections', this.orderInfo);
},
releaseBtn(){
util.showModal({
title: '是否确认释放场地',
@ -294,6 +315,8 @@ export default {
return '约玩占用'
case 'fixed_venue':
return '固定场锁定'
case 'take_up_venue_bboc':
return '挂账占用'
default: return '-'
}
},
@ -471,6 +494,15 @@ export default {
border-color: #EA5061;
color: #EA5061;
}
&.red2{
background-color: #EA5061;
border-color: #EA5061;
color: #fff;
}
&.gray{
border-color: #D8D8D8;
color: #D8D8D8;
}
}
}
}

11
src/pages.json

@ -694,6 +694,17 @@
}
}
]
},
{
"root": "subpackage/common",
"pages": [
{
"path": "pages/pay_type_select",
"style" : {
"navigationBarTitleText": "支付订单"
}
}
]
}
],
"globalStyle": {

176
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,36 +34,40 @@
</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"
:checked="light_up"
@change="lightChange"
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="si-tit">收取金额</view>
<view class="sp-frame"><text></text><input v-model="ocPrice" type="digit" placeholder="0" /></view>
</view>
<view class="si-usage">
<view class="su-line">
<view class="si-tit"><text>* </text>占用用途</view>
<view class="si-tit"><text class="red">* </text>占用用途</view>
<view class="su-ls">
<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>
<block v-for="(e, i) in usageLs" :key="i">
<view :class="[e.type == ocUsage ? 'active' : '']" @click="usageChange(e.type)">
<text>{{ e.name || "-" }}</text>
<image v-if="e.type == ocUsage" mode="aspectFit" src='/static/images/icon/selected_tag.png'></image>
</view>
</block>
</view>
</view>
<view class="su-tip">占用用途如选择散客用户端次卡列表将会显示该占用场次为散客时间</view>
</view>
<view class="si-reason">
<view class="si-tit">占用原因</view>
<view class="si-tit">
<text class="red">* </text>占用原因<text class="tip">必填占用原因将显示在看板对应占用的场地</text>
</view>
<view class="sr-frame">
<textarea placeholder="多行输入…" v-model="ocReaon"></textarea>
</view>
@ -71,7 +75,11 @@
</view>
</view>
<cover-view class="sc-fixed-bot">
<cover-view class="sfb-view" hover-class="hover-active" @click="confirmOccupy">确定</cover-view>
<cover-view
class="sfb-view"
hover-class="hover-active"
@click="confirmOccupy"
>{{ nextBtnTxt || '-' }}</cover-view>
</cover-view>
</view>
</template>
@ -85,69 +93,123 @@ export default {
return {
ocPrice: '',
ocReaon: '',
ocUsage: 1, // 1 -> 2-> 3->
ocUsage: 1, // 1 -> 2-> 3-> , 4 ->
light_up: false,
usageLs: [
{ name: '客户订场', type: 1 }, { name: '散客', type: 2 },
{ name: '锁场', type: 3 }, { name: '挂账', type: 4 },
]
}
},
computed: {
nextBtnTxt(){
let { ocUsage, isOrder } = this;
if(ocUsage == 4&&!isOrder)return '确认';
return '下一步';
},
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);
}
},
onLoad(){
console.log(this.occupyInfo)
console.log(this.occupyInfo);
this.initOrderPage();
},
methods: {
switchChange(e){
this.light_up = e.detail.value
initOrderPage(){
let { occupyInfo, isOrder }= this;
if(!occupyInfo|| !isOrder)return;
let _orderInfo = occupyInfo?.orderInfo || {};
this.ocReaon = _orderInfo.reason || '';
this.ocPrice = _orderInfo.amount || '';
this.ocUsage = this.sereverTypeToUsage(_orderInfo.type) || 1;
this.light_up = _orderInfo.light_up || false;
},
sereverTypeToUsage(type){
let _obj = {
'take_up_venue_bboc': 4,
'fixed_venue': 3,
}
return _obj[type] || 1;
},
lightChange(e){
this.light_up = e.detail.value;
},
usageChange(type){
let { isOrder } = this;
if(isOrder)return;
this.ocUsage = type;
},
toOccupyPaySelect(occupyData){
},
toOrderPaySelect(additionalData){
let { storeInfo } = this.occupyInfo;
let { ocPrice, ocUsage } = this;
let _query ={
type: ocUsage,
brand_id: storeInfo?.brand_id,
amount: ocPrice,
stadiumInfo: {
id: storeInfo?.id,
name: storeInfo?.name,
logo: storeInfo?.logo,
},
...additionalData
}
util.routeTo(`/subpackage/common/pages/pay_type_select?query=${util.jsonStr(_query)}`, 'rT')
},
confirmOccupy: util.debounce(function(){
let { storeInfo, dateInfo, venueList, typeInfo} = this.occupyInfo;
let { ocPrice, ocReaon, light_up, ocUsage } = this;
let { storeInfo, dateInfo, venueList, typeInfo, orderInfo} = this.occupyInfo;
let { ocPrice, ocReaon, light_up, ocUsage, isOrder } = this;
let occupyData = {
brand_id: storeInfo.brand_id,
group: storeInfo.id,
amount: +ocPrice,
date: dateInfo.dateStr,
take_up_use: ocUsage,
items: venueList,
light_up,
reason: ocReaon,
}
if(ocReaon === '')return util.showNone('请填写占用原因!');
if(isOrder&&ocUsage == 4)return this.toOrderPaySelect({
exQuery: {
order_no: orderInfo?.order_no,
reason: ocReaon,
}
});
if(ocUsage !== 4)return this.toOrderPaySelect({
exQuery: occupyData,
});
util.showLoad();
servers.post({
url: API.venue.venueTakeUp,
data: {
brand_id: storeInfo.brand_id,
reason: ocReaon,
amount: +ocPrice,
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,
}
}),
light_up,
},
data: occupyData,
isDefaultGet: false
})
.then(res=>{
util.hideLoad();
if(res.data.code == 0){
util.showNone(res.data.message || '操作成功!');
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 || '操作失败!');
}
@ -276,9 +338,14 @@ export default {
line-height: 40upx;
font-size: 28upx;
color: #333;
>text{
>.red{
color: #EA5061;
}
.tip{
margin-left: 16upx;
font-size: 24upx;
color: #9A9A9D;
}
}
.si-price{
margin-bottom: 12upx;
@ -310,12 +377,13 @@ export default {
.si-usage{
padding: 24upx 0;
.su-line{
@include centerFlex(flex-start);
display: flex;
.su-ls{
flex-wrap: wrap;
margin-bottom: 20upx;
@include centerFlex(flex-start);
>view{
margin-bottom: 20upx;
padding: 0 10upx;
width: 152upx;
height: 72upx;

52
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>
@ -166,6 +172,7 @@ export default {
{ n: '课程预定', c: 'pistac' },
{ n: '固定场锁定', c: 'blue' },
{ n: '已占用', c: 'black' },
{ n: '挂账', c: 'red' },
],
//
boardInfo: null, // { brand_idstadium_id, venue_id, date, duration }
@ -243,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 {}
@ -533,18 +542,34 @@ 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,
}, 'nT');
this.$nextTick(_=>this.boardInfo = null);
},
toOrderConfirm(extraObj, type = 'rT'){
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');
util.routeTo(`/pages/site/confirm/confirm`, type);
},
//
getVenueList({ type_key, stadium_id, date }){
@ -957,6 +982,11 @@ export default {
border-color: #9A9A9D;
color: #9A9A9D;
}
&.red{
color: #fff;
background-color: #EA5061;
border-color: #EA5061;
}
}
}
}
@ -1055,7 +1085,7 @@ export default {
&:nth-child(2){
line-height: 34upx;
text-align: center;
font-size: 28upx;
font-size: 24upx;
color: #9a9a9d;
}
&.green{
@ -1073,6 +1103,10 @@ export default {
background-color: #333333;
border-color: #333333;
}
&.red{
background-color: #EA5061;
border-color: #EA5061;
}
}
}

2
src/pages/turnover/turnover.vue

@ -4,7 +4,7 @@
<view :class="[tabID == 4?'active':'']" @click="tabChange(4)">品牌统计</view>
<view :class="[tabID == 3?'active':'']" @click="tabChange(3)">门店统计</view>
</view>
<view class="tc-total-section">
<view class="tc-total-section" v-if="false">
<!-- 品牌 -->
<view class="tts-address" v-if="tabID == 4&&storeList.length > 1">
<image class="ta-logo" :src="totalData.logo" mode="aspectFit"></image>

1
src/store/index.js

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

215
src/subpackage/common/components/card_search.vue

@ -0,0 +1,215 @@
<template>
<view class="card-search-modal" v-show="isShow">
<view class="csm-container">
<view class="cc-tit">请选择储值卡</view>
<image
class="cc-close"
mode="aspectFit"
src="/subpackage/common/static/images/x_close.png"
@click="hide"
></image>
<view class="cc-search">
<input
type="text"
class="cs-input"
placeholder="请输入微信昵称/手机号码/储值卡号搜索"
confirm-type="search"
v-model="searchKey"
@confirm="getCanUseValueCardList"
/>
</view>
<scroll-view class="cc-list" scroll-y>
<view class="cl-item" v-for="(e, i) in cardLs" :key="i" @click="selectedCard = e">
<view class="ci-content">
<view class="cc-line"><text class="cc-txt">储值卡卡号</text>NO.{{ e.card_no || '-' }}</view>
<view class="cc-line green"><text class="cc-txt">微信昵称</text>{{ e.nickname || '-' }}</view>
<view class="cc-line"><text class="cc-txt">手机号码</text>{{ e.mobile || '-' }}</view>
<view class="cc-line"><text class="cc-txt">卡名称</text>{{ e.card_name || '-' }}</view>
<view class="cc-line"><text class="cc-txt">卡余额</text>{{ e.balance || '0' }}</view>
</view>
<view class="ci-icon" :class="[selectedCard.card_no==e.card_no?'active':'']">
<image class="ci-img" mode="aspectFit" src="/subpackage/common/static/images/choose.png"></image>
</view>
</view>
</scroll-view>
<view class="cc-btn" hover-class="hover-active" @click="confirmBtn">确定</view>
</view>
</view>
</template>
<script>
import util from '../../../utils/util.js';
import server from '../js/server.js';
import API from '../js/api.js';
export default {
props: {
sid: {
type: String,
default: ''
},
amount: {
type: String,
default: ''
},
},
data(){
return {
isShow: false,
searchKey: '',
cardLs: [],
selectedCard: {},
}
},
methods: {
//
hide(){
this.isShow = false;
this.$emit('hide');
},
show(){
this.isShow = true;
this.$emit('show');
},
confirmBtn(){
let { selectedCard } = this;
if(!selectedCard?.card_no)return util.showNone('请选择储值卡');
this.hide();
this.$emit('confirm', selectedCard);
},
getCanUseValueCardList(){
let { sid, amount, searchKey } = this;
this.cardLs = [];
this.selectedCard = {};
util.showLoad();
server.get({
url: API.canUseValueCardList,
data: {
stadium_id: sid,
amount: amount,
key: searchKey,
},
isDefaultGet: false,
})
.then(res => {
util.hideLoad();
if(res.data.code == 0){
let _ls = res?.data?.data?.list || [];
if(!_ls.length)return util.showNone('暂无可用储值卡');
this.cardLs = _ls;
}else{
util.showNone(res.data.message || '获取储值卡列表失败');
}
console.log(res);
})
.catch(util.hideLoad);
},
},
}
</script>
<style lang="scss">
@import "~style/public.scss";
.card-search-modal{
width: 100%;
height: 100%;
background: rgba(0,0,0,0.5);
position: fixed;
top: 0;
left: 0;
z-index: 999;
}
.csm-container{
position: absolute;
left: 0;
bottom: 0;
padding: 46upx 24upx 0upx;
padding-bottom: calc( 0upx + constant(safe-area-inset-bottom)); /* 兼容 iOS < 11.2 */
padding-bottom: calc( 0upx + env(safe-area-inset-bottom)); /* 兼容 iOS >= 11.2 */
width: 100%;
background-color: #fff;
.cc-tit{
line-height: 44upx;
text-align: center;
font-size: 32upx;
font-weight: 500;
}
.cc-close{
position: absolute;
right: 30upx;
top: 30upx;
width: 34upx;
height: 34upx;
}
.cc-search{
margin-top: 54upx;
padding: 0 20upx;
height: 92upx;
border-radius: 10upx;
background-color: #F2F2F7;
.cs-input{
width: 100%;
height: 100%;
font-size: 32upx;
color: #333;
}
}
.cc-list{
height: 548upx;
width: 100%;
margin-top: 30upx;
.cl-item{
padding: 20upx;
border: 2upx solid #979797;
border-radius: 10upx;
@include centerFlex(space-between);
&:not(:first-child){
margin-top: 24upx;
}
.ci-content{
flex-grow: 1;
.cc-line{
line-height: 40upx;
font-size: 28upx;
color: #333;
@include textHide(1);
.cc-txt{
color: #9C9C9F;
}
&.green{
color: $themeColor;
}
}
}
.ci-icon{
flex-grow: 0;
margin-left: 10upx;
width: 36upx;
height: 36upx;
overflow: hidden;
border-radius: 50%;
border: 2upx solid #979797;
&.active{
border-color: transparent;
.ci-img{
visibility: visible;
}
}
.ci-img{
visibility: hidden;
width: 100%;
height: 100%;
}
}
}
}
.cc-btn{
margin-top: 14upx;
line-height: 112upx;
text-align: center;
font-size: 32upx;
border-radius: 10upx;
background-color: $themeColor;
color: #fff;
}
}
</style>

10
src/subpackage/common/js/api.js

@ -0,0 +1,10 @@
import { ORIGIN } from '../../../js/api';
export const COMMON_API = {
assistantGetValueCardList:`${ORIGIN}/admin/assistant/getValueCardList`, // 搜索储蓄卡
takeUpBbocPay:`${ORIGIN}/admin/stadium/venue/takeUpBbocPay`, // 挂账收款的接口
venueTakeUp: `${ORIGIN}/admin/stadium/venue/takeUp`, // 商家助手-占用场地提交
canUseValueCardList: `${ORIGIN}/admin/stadium/canUseValueCard/list`, // 商家助手-占用场地可用储值卡列表
}
export default COMMON_API;

10
src/subpackage/common/js/server.js

@ -0,0 +1,10 @@
import { Server } from '../../../js/server';
class CommonServer extends Server {
constructor(props){
super(props)
}
}
export default new CommonServer();

402
src/subpackage/common/pages/pay_type_select.vue

@ -0,0 +1,402 @@
<template>
<view class="pay-type-select">
<view class="pts-header">
<view class="ph-stadium-info">
<image mode="aspectFill" :src="stadiumInfo.logo"></image>
<view>{{ stadiumInfo.name || '-' }}</view>
</view>
<view class="ph-type-text">订场支付金额</view>
<view class="ph-price"><text>¥</text>{{ payAmount || 0 }}</view>
<view class="ph-discount-tip">
<block v-if="payMethodsID == 3&&selectedCard&&selectedCard.discount&&selectedCard.discount<10">
<text>原价¥{{ optionsQuery.amount || 0 }}</text>折扣金额¥{{ discountAmount || 0 }}
</block>
</view>
</view>
<view class="pts-container">
<view class="pc-tit-bar">支付方式</view>
<view class="pc-ls">
<view class="pl-item" v-for="(e, i) in payMethodsLs" :key="i">
<image mode="aspectFit" :src="'/subpackage/common/static/images/ic_'+e.id+'.png'"></image>
<view class="pi-right" @click="payMethodsChange(e)">
<view class="pr-top">
<view class="pr-txt">{{ e.name || '-' }}</view>
<view class="pr-ipt" v-if="e.id == 4">
<input v-model="otherTypeRemark" />
</view>
<view :class="['pr-icon', e.id == payMethodsID? 'active': '']">
<image mode="aspectFit" src="/subpackage/common/static/images/choose.png"></image>
</view>
</view>
<view class="pr-content" v-if="e.id == 3&&selectedCard&&selectedCard.card_no">
<view class="pc-line">
<view class="pl-txt">储值卡卡号{{ selectedCard.card_no || '-' }}</view>
<view class="pl-tag" v-if="selectedCard.discount&&selectedCard.discount<10">使用会员卡支付{{ selectedCard.discount || '-' }}</view>
</view>
<view class="pc-line">
<view class="pl-txt">微信昵称{{ selectedCard.nickname || '-' }}</view>
</view>
<view class="pc-line">
<view class="pl-txt">手机号码{{ selectedCard.mobile || '-' }}</view>
</view>
<view class="pc-line">
<view class="pl-txt">卡名称{{ selectedCard.card_name || '-' }}</view>
</view>
<view class="pc-line">
<view class="pl-txt">卡余额{{ selectedCard.balance || '0' }}</view>
</view>
</view>
</view>
</view>
</view>
</view>
<cover-view class="sc-fixed-bot" v-if="!isCardSelectModal">
<cover-view
class="sfb-view"
hover-class="hover-active"
@click="submitBtn"
>立即支付</cover-view>
</cover-view>
<card-search
ref="cardSearch"
:sid="stadiumInfo.id"
:amount="optionsQuery.amount"
@confirm="cardSelectConfirm"
@hide="isCardSelectModal = false"
@show="isCardSelectModal = true"
> </card-search>
</view>
</template>
<script>
import server from '../js/server.js';
import API from '../js/api.js';
import util from '../../../utils/util.js';
import cardSearch from '../components/card_search';
export default {
components: {
'card-search': cardSearch
},
computed: {
stadiumInfo(){
return this?.optionsQuery?.stadiumInfo || {};
},
exQuery(){
return this?.optionsQuery?.exQuery || {};
},
discountAmount(){
let { selectedCard, optionsQuery, payAmount, payMethodsID } = this;
if(selectedCard?.discount && payMethodsID == 3){
return Math.floor((optionsQuery?.amount * 100) - (payAmount * 100))/100;
}
return 0;
},
payAmount(){
let { selectedCard, optionsQuery, payMethodsID } = this;
if(selectedCard?.discount && payMethodsID == 3){
return Math.floor((optionsQuery?.amount * 100) * (selectedCard?.discount / 10))/100;
}
return optionsQuery?.amount;
}
},
data() {
return {
isCardSelectModal: false,
payMethodsLs: this.getPayMethodsLs(),
payMethodsID: 0,
optionsQuery: {},
otherTypeRemark: '',
selectedCard: {}
}
},
/**
* @param {Object} _options = JSON.parse(decodeURIComponent(option.query))
* @param {String} _options.type 1 -> 客户订场 2-> 散客 3-> 锁场, 4 -> 挂账
* @param {String} _options.brand_id
* @param {String} _options.amount
* @param {Object} _options.stadiumInfo
* @param {String} _options.stadiumInfo.id
* @param {String} _options.stadiumInfo.name
* @param {String} _options.stadiumInfo.logo
*
* @param {Object} _options.exQuery //
*
*
*/
onLoad(option){
let optionsQuery = util.jsonPar(decodeURIComponent(option.query));
this.optionsQuery = optionsQuery;
},
methods: {
cardSelectConfirm(e){
if(!e?.card_no)return this.payMethodsID = 0;
this.selectedCard = e;
this.payMethodsID = 3;
},
submitBtn: util.debounce(function(){
let _type = this.optionsQuery?.type;
if(+_type === 4)return this.takeUpBbocPay();
if(_type !== 4)return this.takeUpSubmit();
}, 300, true),
payMethodsChange(e){
if(e.id == 3)return this.$refs.cardSearch.show();
this.payMethodsID = e.id;
},
getPayMethodsLs(){
return [
{ name: '微信支付', id: 0 },
{ name: '支付宝支付', id: 1 },
{ name: '现金支付', id: 2 },
{ name: '储值卡支付', id: 3 },
{ name: '其它', id: 4 },
]
},
//
takeUpBbocPay(){
let { optionsQuery, payMethodsID, otherTypeRemark, selectedCard } = this;
let _data = {
brand_id: optionsQuery.brand_id || '',
amount: +optionsQuery.amount || '',
reason: optionsQuery?.exQuery?.reason || '',
order_no: optionsQuery?.exQuery?.order_no || '',
take_up_pay_type: this.getPayMethodsName(payMethodsID)
}
if(payMethodsID === 4)_data['take_up_pay_type'] = otherTypeRemark || '其它';
if(payMethodsID === 3&&selectedCard?.card_no)_data['card_no'] = selectedCard.card_no || '';
server.post({
url: API.takeUpBbocPay,
data: _data,
failMsg: '操作失败!'
})
.then(res=>{
util.showNone('操作成功!');
setTimeout(_=>{
util.routeTo();
}, 1200);
})
},
// 1 -> 2-> 3-> ,
takeUpSubmit(){
let { exQuery, payMethodsID, otherTypeRemark, selectedCard } = this;
let _data = {
...exQuery,
take_up_pay_type: this.getPayMethodsName(payMethodsID) || ''
}
if(payMethodsID === 4)_data['take_up_pay_type'] = otherTypeRemark || '其它';
if(payMethodsID === 3&&selectedCard?.card_no)_data['card_no'] = selectedCard.card_no || '';
util.showLoad();
server.post({
url: API.venueTakeUp,
data: _data,
isDefaultGet: false
})
.then(res=>{
util.hideLoad();
if(res.data.code == 0){
util.showNone(res.data.message || '操作成功!');
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');
}else{
util.showNone(res.data.message || '操作失败!');
}
})
.catch(util.hideLoad)
},
getPayMethodsName(payMethodsID){
return this.getPayMethodsLs().find(item=>item.id == payMethodsID)?.name || '';
}
}
}
</script>
<style lang="scss" scoped>
@import '~style/public.scss';
.pay-type-select{
padding-bottom: 120rpx;
padding-bottom: calc( 120rpx + constant(safe-area-inset-bottom)); /* 兼容 iOS < 11.2 */
padding-bottom: calc( 120rpx + env(safe-area-inset-bottom)); /* 兼容 iOS >= 11.2 */
}
.pts-header{
margin-bottom: 24upx;
padding: 26upx 36upx 110upx;
background-color: #fff;
.ph-stadium-info{
padding-bottom: 34upx;
border-bottom: 1px solid #D8D8D8;
@include centerFlex(flex-start);
>image{
flex-shrink: 0;
margin-right: 10upx;
width: 30upx;
height: 30upx;
}
>view{
font-size: 32upx;
font-weight: 500;
color: #333333;
@include textHide(1);
}
}
.ph-type-text{
margin-top: 76upx;
text-align: center;
font-size: 28upx;
font-weight: 500;
color: #333333;
@include textHide(1);
}
.ph-price{
margin-top: 84upx;
text-align: center;
font-size: 80upx;
font-weight: 500;
color: #333333;
@include textHide(1);
>text{
font-size: 60upx;
}
}
.ph-discount-tip{
margin-top: 16upx;
text-align: center;
line-height: 44upx;
min-height: 44upx;
font-size: 28upx;
color: #FF873D;
@include textHide(1);
>text{
color: #181818;
}
}
}
.pts-container{
background-color: #fff;
.pc-tit-bar{
padding-left: 24upx;
line-height: 72upx;
font-size: 28upx;
color: #9A9A9D;
}
.pc-ls{
padding: 16upx 30upx 0;
.pl-item{
display: flex;
&:not(:last-child){
.pi-right{
border-bottom: 1px solid #D8D8D8;
}
}
>image{
flex-shrink: 0;
margin-right: 16upx;
width: 54upx;
height: 54upx;
transform: translateY(24upx);
}
.pi-right{
flex-grow: 1;
.pr-top{
width: 100%;
height: 102upx;
@include centerFlex(space-between);
.pr-txt{
flex-shrink: 0;
font-size: 28upx;
color: #181818;
}
.pr-ipt{
margin-left: 40upx;
margin-right: auto;
padding: 0 16upx;
width: 340upx;
height: 64upx;
border: 2upx solid #D8D8D8;
border-radius: 10upx;
>input{
width: 100%;
height: 100%;
font-size: 28upx;
color: #181818;
}
}
.pr-icon{
flex-shrink: 0;
width: 36upx;
height: 36upx;
border-radius: 50%;
border: 2upx solid #aaaaaa;
overflow: hidden;
@include centerFlex(center);
&.active{
border-color: transparent;
>image{
visibility: visible;
}
}
>image{
visibility: hidden;
display: block;
border: none;
width: 100%;
height: 100%;
}
}
}
.pr-content{
padding-top: 4upx;
padding-bottom: 30upx;
.pc-line{
@include centerFlex(flex-start);
.pl-txt{
line-height: 44upx;
font-size: 24upx;
color: #181818;
@include textHide(1);
}
.pl-tag{
flex-shrink: 0;
margin-left: 10upx;
padding: 0 6upx;
line-height: 28upx;
font-size: 24upx;
color: #FF873D;
border: 1px solid #FF873D;
border-radius: 4upx;
}
}
}
}
}
}
}
.sc-fixed-bot{
position: fixed;
left: 0;
bottom: 0;
width: 100%;
padding-top: 10upx;
padding-bottom: 10upx;
padding-bottom: calc( 10upx + constant(safe-area-inset-bottom)); /* 兼容 iOS < 11.2 */
padding-bottom: calc( 10upx + env(safe-area-inset-bottom)); /* 兼容 iOS >= 11.2 */
background-color: #fff;
.sfb-view{
margin: 0 auto;
width: 702upx;
height: 88upx;
line-height: 88upx;
text-align: center;
font-size: 32upx;
background-color: #FF873D;
color: #fff;
border-radius: 44upx;
}
}
</style>

BIN
src/subpackage/common/static/images/choose.png

After

Width: 36  |  Height: 36  |  Size: 392 B

BIN
src/subpackage/common/static/images/ic_0.png

After

Width: 54  |  Height: 54  |  Size: 659 B

BIN
src/subpackage/common/static/images/ic_1.png

After

Width: 54  |  Height: 54  |  Size: 627 B

BIN
src/subpackage/common/static/images/ic_2.png

After

Width: 52  |  Height: 52  |  Size: 1.3 KiB

BIN
src/subpackage/common/static/images/ic_3.png

After

Width: 52  |  Height: 52  |  Size: 764 B

BIN
src/subpackage/common/static/images/ic_4.png

After

Width: 54  |  Height: 54  |  Size: 1.3 KiB

BIN
src/subpackage/common/static/images/x_close.png

After

Width: 34  |  Height: 34  |  Size: 233 B

69
src/subpackage/device/components/order/reservation_site_detail/reservation_site_detail.vue

@ -23,14 +23,21 @@
<view>订单来源<text>{{ orderInfo.order_source_text || '-' }}</text></view>
</view>
<view class="rh-line">
<view>订单备注<text>{{ getMarkTxt || '-' }}</text></view>
<view>订单备注<text>{{ take_up_details.remark || take_up_details.reason || '-' }}</text></view>
</view>
</view>
<view class="rs-box">
<view class="rb-title">验证信息</view>
<view class="rb-line">
<view class="rl-view">验证码</view>
<view :class="['rl-code1', orderInfo.pay_status==2?'rl-code2':'', orderInfo.pay_status==3?'rl-code3':'', orderInfo.pay_status==4?'rl-code4':'']" >{{orderInfo.verify_code || '-'}}<text>({{zh_pay_status(orderInfo)}})</text></view>
<view
:class="[
'rl-code1',
orderInfo.pay_status==2?'rl-code2':'',
orderInfo.pay_status==3?'rl-code3':'',
zh_pay_status(orderInfo) == '已取消'?'rl-code3':'',
zh_pay_status(orderInfo) == '已退款'?'rl-code4':'']"
>{{orderInfo.verify_code || '-'}}<text>({{zh_pay_status(orderInfo)}})</text></view>
</view>
<!-- 已使用 -->
<block v-if="orderInfo.pay_status==2 || orderInfo.pay_status==8">
@ -100,18 +107,18 @@
<view class="rb-title">支付信息</view>
<view class="rb-line">
<view class="rl-view">支付方式</view>
<text class="rl-text">{{zh_pay_type(orderInfo.pay_type)}}</text>
<text class="rl-text">{{ getPayTypeText || '-' }}</text>
</view>
<view class="rb-line">
<view class="rl-view">支付时间</view>
<text class="rl-text">{{orderInfo.pay_time || '-'}}</text>
</view>
<view class="rb-line">
<view class="rl-view">微信交易号</view>
<text class="rl-text">{{orderInfo.trade_no || ''}}</text>
<view class="rl-view">交易号</view>
<text class="rl-text">{{orderInfo.trade_no || '-'}}</text>
</view>
<!-- 已退款 -->
<block v-if="orderInfo.pay_status == 4">
<block v-if="zh_pay_status(orderInfo) == '已退款'">
<view class="rb-line">
<view class="rl-view">退款时间</view>
<text class="rl-text">{{orderInfo.refund_time || '-'}}</text>
@ -143,41 +150,15 @@ export default {
}
},
computed: {
zh_verify_type(){
/**
* 20210527 新增核销方式
* verify_type: 核销方式
* 1: 验证码核销(pad)2: 人脸验证(pad)3: 扫码验证(pad)4: 扫码器验证(pad)
* 5: 验证码核销(商家助手)6: 扫码核销(商家助手) 7: 扫码器核销(门闸)
*/
return status =>{
return [
'扫码器核销(门闸)',
'验证码核销(pad)',
'人脸验证(pad)',
'扫码验证(pad)',
'扫码器验证(pad)',
'验证码核销(商家助手)',
'扫码核销(商家助手)',
][status] || '-';
}
},
zh_pay_type(){
// 012
return status =>{
const _obj = {
'0': '微信支付',
'1': '支付宝支付',
'2': '储值卡支付',
}
return _obj[`${status}`] || '-'
}
},
getMarkTxt(){
take_up_details(){
let { orderInfo } = this;
return orderInfo?.extension?.take_up_details?.reason || ''
return orderInfo?.extension?.take_up_details || {}
},
// '-'
getPayTypeText(){
let { orderInfo } = this;
return orderInfo?.extension?.pay_type_text || '-'
}
},
data() {
return {
@ -188,6 +169,16 @@ export default {
// -101使2使34退
let _status = orderInfo.pay_status || '';
if(_status == 3&&orderInfo.is_active_release)return '已失效*'; // 20220929 '*'
// 20230705
// end0退 share_pid0退
// extension.take_up_bboc && !extension.take_up_bboc_pay
if(
orderInfo.pay_status == 4&&
(orderInfo.share_pid > 0 ||
orderInfo.pay_amount == 0 ||
(orderInfo?.extension?.take_up_bboc &&
!orderInfo?.extension?.take_up_bboc_pay))
)return '已取消';
const _obj = {
'-1': '已作废',
'0': '未支付',

1
src/subpackage/retail/components/store_card_select/store_card_select.vue

@ -31,7 +31,6 @@
<script>
import util from '../../../../utils/util.js';
import tools from '../../js/tools.js';
import retailServer from '../../js/retail_server';
import retailApi from '../../js/retail_api';

6
src/subpackage/retail/pages/confirm_order/confirm_order.vue

@ -288,9 +288,9 @@
flex-direction: column;
width: 100vw;
height: 100vh;
padding-bottom: 0rpx;
padding-bottom: calc( 0rpx + constant(safe-area-inset-bottom)); /* 兼容 iOS < 11.2 */
padding-bottom: calc( 0rpx + env(safe-area-inset-bottom)); /* 兼容 iOS >= 11.2 */
padding-bottom: 112rpx;
padding-bottom: calc( 112rpx + constant(safe-area-inset-bottom)); /* 兼容 iOS < 11.2 */
padding-bottom: calc( 112rpx + env(safe-area-inset-bottom)); /* 兼容 iOS >= 11.2 */
.final-cart-list {
display: flex;

Loading…
Cancel
Save