diff --git a/src/components/reservation_order/reservation_order.vue b/src/components/reservation_order/reservation_order.vue index ae59b04..78bc787 100644 --- a/src/components/reservation_order/reservation_order.vue +++ b/src/components/reservation_order/reservation_order.vue @@ -3,7 +3,7 @@ {{orderInfo.stadium_name || '-'}} {{zh_order_status(orderInfo)}} @@ -96,17 +96,6 @@ export default { return _obj[`${status}`] || '-' } }, - zh_pay_type(){ - // 支付类型 0微信支付1支付宝支付2储值卡支付 - return status =>{ - const _obj = { - '0': '微信支付', - '1': '支付宝支付', - '2': '储值卡支付', - } - return _obj[`${status}`] || '-' - } - }, zh_type_name(){ // 预订项目 0场次 1人次 let { orderInfo } = this @@ -130,6 +119,15 @@ export default { // 订单状态 -1已作废0未支付1已支付待使用2已使用3已失效4已退款 let _status = orderInfo.pay_status || ''; if(_status == 3&&orderInfo.is_active_release)return '已失效*'; // 20220929 新增状态 '已失效*' + // 20230705 新增状态 已取消 + // end:如果金额为0而且是已退款的话就显示已取消, 或者是share_pid大于0但是已退款的 + // 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': '未支付', diff --git a/src/components/site/order_modal/order_modal.vue b/src/components/site/order_modal/order_modal.vue index aca5f50..af290dd 100644 --- a/src/components/site/order_modal/order_modal.vue +++ b/src/components/site/order_modal/order_modal.vue @@ -39,7 +39,7 @@ - + 是否联动开灯: @@ -61,7 +61,7 @@ 操作人: - {{ orderInfo.operator || ' ' }} + {{ orderInfo.operator || '-' }} @@ -124,6 +124,16 @@ 取消订场 + + + + 分享给朋友 + 取消占用 + + + 收款 + 已收款 + @@ -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; + } } } } diff --git a/src/pages.json b/src/pages.json index c1e0f13..ba403fa 100644 --- a/src/pages.json +++ b/src/pages.json @@ -694,6 +694,17 @@ } } ] + }, + { + "root": "subpackage/common", + "pages": [ + { + "path": "pages/pay_type_select", + "style" : { + "navigationBarTitleText": "支付订单" + } + } + ] } ], "globalStyle": { diff --git a/src/pages/site/confirm/confirm.vue b/src/pages/site/confirm/confirm.vue index d842700..9203127 100644 --- a/src/pages/site/confirm/confirm.vue +++ b/src/pages/site/confirm/confirm.vue @@ -24,7 +24,7 @@ 预定场次: - {{e.parentObj.venue_name || '-'}} {{e.durations || '-'}} (¥{{e.price || '-'}}) + {{e.venue_name || '-'}} {{e.duration || '-'}} (¥{{e.price || '-'}}) @@ -34,36 +34,40 @@ - *是否联动开灯 + + *是否联动开灯 + + 联动开灯开启后,会根据占用时间自动开灯 - * 收取金额 - + 收取金额 + - * 占用用途 + * 占用用途 - - 客户订场 - - - - 散客 - - - - 锁场 - - + + + {{ e.name || "-" }} + + + 注:占用用途如选择“散客”,用户端次卡列表将会显示该占用场次为散客时间 - 占用原因 + + * 占用原因必填,占用原因将显示在看板对应占用的场地 + @@ -71,7 +75,11 @@ - 确定 + {{ nextBtnTxt || '-' }} @@ -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; diff --git a/src/pages/site/manage/manage.vue b/src/pages/site/manage/manage.vue index deee003..4169b8a 100644 --- a/src/pages/site/manage/manage.vue +++ b/src/pages/site/manage/manage.vue @@ -125,7 +125,7 @@ ¥{{totalPrice || '0.00'}} - + {{selectedVenueList.length?'提交订单':'请选择场地'}} @@ -133,7 +133,13 @@ {{occupyTip || '-'}} - + @@ -166,6 +172,7 @@ export default { { n: '课程预定', c: 'pistac' }, { n: '固定场锁定', c: 'blue' }, { n: '已占用', c: 'black' }, + { n: '挂账', c: 'red' }, ], // 订场看板信息 boardInfo: null, // { brand_id,stadium_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; + } } } diff --git a/src/pages/turnover/turnover.vue b/src/pages/turnover/turnover.vue index 1cf2f12..a72be13 100644 --- a/src/pages/turnover/turnover.vue +++ b/src/pages/turnover/turnover.vue @@ -4,7 +4,7 @@ 品牌统计 门店统计 - + diff --git a/src/store/index.js b/src/store/index.js index 885237a..cdc5dcc 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -50,6 +50,7 @@ export default new Vuex.Store({ dateInfo: {}, // 时间信息 typeInfo: {}, // 球场类型 venueList: [], // 选择场地列表 + orderInfo: {}, // 订单信息 // 20230620 新增挂账需求,用于回显确认订单 } }, mutations, diff --git a/src/subpackage/common/components/card_search.vue b/src/subpackage/common/components/card_search.vue new file mode 100644 index 0000000..e77c733 --- /dev/null +++ b/src/subpackage/common/components/card_search.vue @@ -0,0 +1,215 @@ + + + + + \ No newline at end of file diff --git a/src/subpackage/common/js/api.js b/src/subpackage/common/js/api.js new file mode 100644 index 0000000..e38485a --- /dev/null +++ b/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; \ No newline at end of file diff --git a/src/subpackage/common/js/server.js b/src/subpackage/common/js/server.js new file mode 100644 index 0000000..005716d --- /dev/null +++ b/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(); \ No newline at end of file diff --git a/src/subpackage/common/pages/pay_type_select.vue b/src/subpackage/common/pages/pay_type_select.vue new file mode 100644 index 0000000..95ec467 --- /dev/null +++ b/src/subpackage/common/pages/pay_type_select.vue @@ -0,0 +1,402 @@ + + + + + \ No newline at end of file diff --git a/src/subpackage/common/static/images/choose.png b/src/subpackage/common/static/images/choose.png new file mode 100644 index 0000000..be2b30b Binary files /dev/null and b/src/subpackage/common/static/images/choose.png differ diff --git a/src/subpackage/common/static/images/ic_0.png b/src/subpackage/common/static/images/ic_0.png new file mode 100644 index 0000000..2d297ad Binary files /dev/null and b/src/subpackage/common/static/images/ic_0.png differ diff --git a/src/subpackage/common/static/images/ic_1.png b/src/subpackage/common/static/images/ic_1.png new file mode 100644 index 0000000..ac4640e Binary files /dev/null and b/src/subpackage/common/static/images/ic_1.png differ diff --git a/src/subpackage/common/static/images/ic_2.png b/src/subpackage/common/static/images/ic_2.png new file mode 100644 index 0000000..c95d079 Binary files /dev/null and b/src/subpackage/common/static/images/ic_2.png differ diff --git a/src/subpackage/common/static/images/ic_3.png b/src/subpackage/common/static/images/ic_3.png new file mode 100644 index 0000000..d077fec Binary files /dev/null and b/src/subpackage/common/static/images/ic_3.png differ diff --git a/src/subpackage/common/static/images/ic_4.png b/src/subpackage/common/static/images/ic_4.png new file mode 100644 index 0000000..1e5fcea Binary files /dev/null and b/src/subpackage/common/static/images/ic_4.png differ diff --git a/src/subpackage/common/static/images/x_close.png b/src/subpackage/common/static/images/x_close.png new file mode 100644 index 0000000..d8cc22a Binary files /dev/null and b/src/subpackage/common/static/images/x_close.png differ diff --git a/src/subpackage/device/components/order/reservation_site_detail/reservation_site_detail.vue b/src/subpackage/device/components/order/reservation_site_detail/reservation_site_detail.vue index 2e04b30..604b630 100644 --- a/src/subpackage/device/components/order/reservation_site_detail/reservation_site_detail.vue +++ b/src/subpackage/device/components/order/reservation_site_detail/reservation_site_detail.vue @@ -23,14 +23,21 @@ 订单来源:{{ orderInfo.order_source_text || '-' }} - 订单备注:{{ getMarkTxt || '-' }} + 订单备注:{{ take_up_details.remark || take_up_details.reason || '-' }} 验证信息 验证码: - {{orderInfo.verify_code || '-'}}({{zh_pay_status(orderInfo)}}) + {{orderInfo.verify_code || '-'}}({{zh_pay_status(orderInfo)}}) @@ -100,18 +107,18 @@ 支付信息 支付方式: - {{zh_pay_type(orderInfo.pay_type)}} + {{ getPayTypeText || '-' }} 支付时间: {{orderInfo.pay_time || '-'}} - 微信交易号: - {{orderInfo.trade_no || ''}} + 交易号: + {{orderInfo.trade_no || '-'}} - + 退款时间: {{orderInfo.refund_time || '-'}} @@ -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(){ - // 支付类型 0微信支付1支付宝支付2储值卡支付 - 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 { // 订单状态 -1已作废0未支付1已支付待使用2已使用3已失效4已退款 let _status = orderInfo.pay_status || ''; if(_status == 3&&orderInfo.is_active_release)return '已失效*'; // 20220929 新增状态 '已失效*' + // 20230705 新增状态 已取消 + // end:如果金额为0而且是已退款的话就显示已取消, 或者是share_pid大于0但是已退款的 + // 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': '未支付', diff --git a/src/subpackage/retail/components/store_card_select/store_card_select.vue b/src/subpackage/retail/components/store_card_select/store_card_select.vue index ccabf2f..1caf69c 100644 --- a/src/subpackage/retail/components/store_card_select/store_card_select.vue +++ b/src/subpackage/retail/components/store_card_select/store_card_select.vue @@ -31,7 +31,6 @@