diff --git a/src/components/site/order_modal/order_modal.vue b/src/components/site/order_modal/order_modal.vue index 239eddc..8377c60 100644 --- a/src/components/site/order_modal/order_modal.vue +++ b/src/components/site/order_modal/order_modal.vue @@ -126,9 +126,9 @@ - 分享给朋友 + 分享给朋友 取消占用 - 收款 + 收款 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 8b4a543..d8ce167 100644 --- a/src/pages/site/confirm/confirm.vue +++ b/src/pages/site/confirm/confirm.vue @@ -38,7 +38,8 @@ *是否联动开灯 @@ -47,14 +48,14 @@ * 收取金额 - + * 占用用途 - + {{ e.name || "-" }} @@ -66,13 +67,17 @@ 占用原因 - + - 确定 + {{ nextBtnTxt || '-' }} @@ -95,6 +100,11 @@ export default { } }, computed: { + nextBtnTxt(){ + let { ocUsage, isOrder } = this; + if(ocUsage == 4&&!isOrder)return '确认'; + return '下一步'; + }, isOrder(){ return !!this?.occupyInfo?.orderInfo?.order_no; }, @@ -110,34 +120,88 @@ export default { } }, onLoad(){ - console.log(this.occupyInfo) + console.log(this.occupyInfo); + this.initOrderPage(); }, methods: { 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(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, - 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}` diff --git a/src/pages/site/manage/manage.vue b/src/pages/site/manage/manage.vue index 39302c0..4169b8a 100644 --- a/src/pages/site/manage/manage.vue +++ b/src/pages/site/manage/manage.vue @@ -558,9 +558,10 @@ export default { this.toOrderConfirm({ venueList: orderInfo.sessions || [], orderInfo, - }); + }, 'nT'); + this.$nextTick(_=>this.boardInfo = null); }, - toOrderConfirm(extraObj){ + toOrderConfirm(extraObj, type = 'rT'){ let { curStoreInfo, curTypeInfo, curDateInfo } = this; this.$store.commit('setOccupyInfo', { storeInfo: curStoreInfo, @@ -568,7 +569,7 @@ export default { typeInfo: curTypeInfo, ...extraObj, }) - util.routeTo(`/pages/site/confirm/confirm`, 'rT'); + util.routeTo(`/pages/site/confirm/confirm`, type); }, // 场馆列表 getVenueList({ type_key, stadium_id, date }){ diff --git a/src/subpackage/common/components/card_search.vue b/src/subpackage/common/components/card_search.vue new file mode 100644 index 0000000..9d6c58f --- /dev/null +++ b/src/subpackage/common/components/card_search.vue @@ -0,0 +1,276 @@ + + + + + diff --git a/src/subpackage/common/js/api.js b/src/subpackage/common/js/api.js new file mode 100644 index 0000000..2c68d23 --- /dev/null +++ b/src/subpackage/common/js/api.js @@ -0,0 +1,9 @@ +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`, // 商家助手-占用场地提交 +} + +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..6936523 --- /dev/null +++ b/src/subpackage/common/pages/pay_type_select.vue @@ -0,0 +1,374 @@ + + + + + \ 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/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 @@