From 76a09ef4c61cae1bc2eeda87756b13b6d6d0fc63 Mon Sep 17 00:00:00 2001 From: "liujw155@outlook.com" Date: Wed, 21 Jun 2023 17:55:47 +0800 Subject: [PATCH] add common pay select --- src/components/site/order_modal/order_modal.vue | 4 +- src/pages.json | 11 + src/pages/site/confirm/confirm.vue | 102 ++++-- src/pages/site/manage/manage.vue | 7 +- src/subpackage/common/components/card_search.vue | 276 +++++++++++++++ src/subpackage/common/js/api.js | 9 + src/subpackage/common/js/server.js | 10 + src/subpackage/common/pages/pay_type_select.vue | 374 +++++++++++++++++++++ src/subpackage/common/static/images/choose.png | Bin 0 -> 392 bytes src/subpackage/common/static/images/ic_0.png | Bin 0 -> 659 bytes src/subpackage/common/static/images/ic_1.png | Bin 0 -> 627 bytes src/subpackage/common/static/images/ic_2.png | Bin 0 -> 1318 bytes src/subpackage/common/static/images/ic_3.png | Bin 0 -> 764 bytes src/subpackage/common/static/images/ic_4.png | Bin 0 -> 1312 bytes .../store_card_select/store_card_select.vue | 1 - 15 files changed, 769 insertions(+), 25 deletions(-) create mode 100644 src/subpackage/common/components/card_search.vue create mode 100644 src/subpackage/common/js/api.js create mode 100644 src/subpackage/common/js/server.js create mode 100644 src/subpackage/common/pages/pay_type_select.vue create mode 100644 src/subpackage/common/static/images/choose.png create mode 100644 src/subpackage/common/static/images/ic_0.png create mode 100644 src/subpackage/common/static/images/ic_1.png create mode 100644 src/subpackage/common/static/images/ic_2.png create mode 100644 src/subpackage/common/static/images/ic_3.png create mode 100644 src/subpackage/common/static/images/ic_4.png 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 0000000000000000000000000000000000000000..be2b30b6145364e1b243c78698fd81ac775808d5 GIT binary patch literal 392 zcmeAS@N?(olHy`uVBq!ia0vp^Dj>|k3?#4J%UA`Z`~rMJT!A#h%o2tfa8wHB7BkE$ z0il`243lz!vj6}8-}&gK(EPd!ub*13pImuj+ozx3?|*vRer|8vzU5xq=Dhj-WzF47 zZza!001f0R3GxeOIC=fY>m@TXB3u+jC9Y=$0LAZmx;TbdoSu5+F5e*q9@Yob8Vzh# z%>MuW|Ds(BZZgG90C^#)JnG^=YoCcGcN3CRT?P580k_U}(NscEiOc4A>urC;PfEDo8(IN5QP7qhci z=dS5&(`-j9~3%@+` z>{=!wS!Ubbp!QQjPWrOWhUF*k*S<2)?C5y^q`>>$b>-yu!t7rTC{0bXs@Z9<(MZTL zHR8&X?8TbDD$6D_io!_BUyR!0_V3c3&)=_}e5|rSh;gOXZD%+3jHD=)-oKZ&UWl1? zf&2G{Z6QwI=j}IYiS-PBJe#-o)#+z*s#3(-Q{LS9S8X&y^Q&b0OXKYh2Rd&q71BGS zCV6$|{wXH~;~)I1Dco=UNT+qPwI-K^m*?bN?@}dXiXMvAuJ|_jdnW7QWgC{5p8Td% zxhT|j%?(Aq6N?VNki4F%vOwVCgNd^8i(kdZf0f&K=909Y6_ cFYiBLpU(ZzS3i=q2^irFp00i_>zopr09|Am_5c6? literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..ac4640ef9349bc3beaad7bbd62ddf6b0ed779351 GIT binary patch literal 627 zcmeAS@N?(olHy`uVBq!ia0vp^W+2SL3?z5Yp7kC`6$SW&xB_X0mHz~medb^KSpbSY zih#Mi%f0|b_?H32zk(TG_?CU;UH%2E@)Q5EFFeb?@-O`al3My%5KMyEKq(*sYW&K- z9AqX)J;;#Hf*=DwDSj)u4YX9XB*-tAf%W3g{*Ut9*HoS?)T=Kx5q^2bQR2@26*>Oa zN4KQAYtCqk-x;%h+PriI2F7kr7sn8f<8PrpWW$>oe9{*sU~7QWg0#iRFIr^G_Oe3YFCoI|}vBTZ_Kzy=zqv+O6^P zgv_bf^JjN0ZSYWXzjxbU;n|qK7Z2Dy75bBNM3wKOO@!==*yh=%DptPT$DMULGpi(X z?wy&6QrT~<517~*wJqKnIc@G1>DeOe-J#AxerMOpE!wa|;r2^Cxw07nnw#C;`9GJh zi@Y8wb~R*4==6zfH>};3^&6B2R38+XZjtmu%>3mM#f8zoExt_i&}2Ah*JYABsmm#F z*5BS&8;{n?rV5{`FipKLrGqXw@Jqy p6~CHbY1ZRpkz#psrE2~^t@$kpQT0}~sZ&6y$J5o%Wt~$(69A4-9+Ln7 literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..c95d079604012de984ed54c621180ef4494d1317 GIT binary patch literal 1318 zcmV+>1=;$EP)dZ}+Hf z`Lu8Nu5bIdaFM+B0ssI2Qgl*IQvd=M4hJDsH1j*3QS9fM_ut5!|}BvXzd0e0%!(?d#^>)XT@LpK@=W9C{JS#KaO{4F;f3Ez(wgH zxD>w0Sp^zYr!8sM; zz>KnwmbZ?v&BB+f7F&gq*cS>W36K`fzMK^^1NmU}j{qHS(X-ge=1N#s>%_>VGJmF& z=Q+|AcC3fEg$KU{H^l(VX~xqDS*0NLtYI7|1vC_*#4!A@KL{7L+xY*wETnG1XsRW) zTjPaUvxj7qq>@q4$R)RBoNFNil*H#jbdVbbW8=9doYhE|wG|X`%5FdCG_jY$GbWKl zBySr=RlP9`s5GIUlPY1Kv(+Oib4P2|nR7%f!wnV~=W$A0`>e8bgmqtH7jOrp)H zfa@rEX*610(rz3l+#w2`J6;dR=rr74GWjqar;(DSVZ$_I3grf9FV zclXc-lj+saz~n6PoVj6ObNJ0PuMiO$4lpEVPosB`zf3x=Pgh7fHD`R|$sdFPNL`Qf zTP4P#uoX&Am5mTB0AXCZ7tYTdEe2ss8cxn9Vit!%YPo@TDhU>ctb}!LqsL}5` cjs63F0b15v+hIV~T>t<807*qoM6N<$g1RE8c>n+a literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..d077fec53552bbe5ee9de13c0e81c82a9be2c6cd GIT binary patch literal 764 zcmVd=;*W8M280wSWkqd>OEf2%vl$vX2j^gA}ZY8n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ntOrY0Hoy z)W5sAdw1cIkP^P1PcFINyO)FaG&(+6EeWygova%jI^5fCZSDfI^1p(G z)y;0tk*8~ObwNm5!L05_ZZ0tCve7n_@57MW3wjUT*LJk(`l<(}uI+JulK~BTHl{97 zWg+Fh6uI?b&6a1Jw5?@U3;>|p3QOv-@95HWt6?GPCc$GNc*3^6 zQcEfuXyRf?B%%&mv@IeSW%t&C2N>*%i#ka1C=$6+siS(Zn@cTMn6*f_KM_`^Beq?M zdVv~e(>i_^5&bFCViF2XVqYhncHm@CsH;OK$zFzZ*73FK=>)&5cUr%Me#vD;A=iq+ z&g>)fs`Fm{)qHd?xMvM)HWAI}1LovL6^)Vu zM|D~P#8aH>>gT|?o&|{;hFtMBmI(D%py>&6J;e08RW4eNdS+<%MO3K$oS9c=cQmFFHER0a9E=wCXP!NNbg WOP|-Luo;;E0000 import util from '../../../../utils/util.js'; - import tools from '../../js/tools.js'; import retailServer from '../../js/retail_server'; import retailApi from '../../js/retail_api';