diff --git a/src/subpackage/common/components/card_search.vue b/src/subpackage/common/components/card_search.vue index 9d6c58f..8b66b63 100644 --- a/src/subpackage/common/components/card_search.vue +++ b/src/subpackage/common/components/card_search.vue @@ -1,276 +1,215 @@ + \ No newline at end of file diff --git a/src/subpackage/common/js/api.js b/src/subpackage/common/js/api.js index 2c68d23..e38485a 100644 --- a/src/subpackage/common/js/api.js +++ b/src/subpackage/common/js/api.js @@ -4,6 +4,7 @@ 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/pages/pay_type_select.vue b/src/subpackage/common/pages/pay_type_select.vue index 6936523..9be7a6d 100644 --- a/src/subpackage/common/pages/pay_type_select.vue +++ b/src/subpackage/common/pages/pay_type_select.vue @@ -6,9 +6,11 @@ {{ stadiumInfo.name || '-' }} 订场支付金额 - ¥{{ optionsQuery.amount || 0 }} + ¥{{ payAmount || 0 }} - 原价:¥99,折扣金额¥9.9 + + 原价:¥{{ optionsQuery.amount || 0 }},折扣金额¥{{ discountAmount || 0 }} + @@ -26,41 +28,43 @@ - + - 储值卡卡号:230316000 - 使用会员卡支付9折 + 储值卡卡号:{{ selectedCard.card_no || '-' }} + 使用会员卡支付{{ selectedCard.discount || '-' }}折 - 微信昵称:LLL + 微信昵称:{{ selectedCard.nickname || '-' }} - 手机号码:13711029033 + 手机号码:{{ selectedCard.mobile || '-' }} - 卡名称:1000元送200元卡 + 卡名称:{{ selectedCard.card_name || '-' }} - 卡余额:¥1050 + 卡余额:¥{{ selectedCard.amount || '0' }} - + 立即支付 - - + @@ -68,10 +72,11 @@ import server from '../js/server.js'; import API from '../js/api.js'; import util from '../../../utils/util.js'; -import storeCardSelect from '../components/card_search'; +import cardSearch from '../components/card_search'; +import numeral from 'numeral'; export default { components: { - 'storeCardSelect': storeCardSelect + 'card-search': cardSearch }, computed: { stadiumInfo(){ @@ -79,15 +84,30 @@ export default { }, 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 { - isCardSearchModalShow: false, + isCardSelectModal: false, payMethodsLs: this.getPayMethodsLs(), payMethodsID: 0, optionsQuery: {}, otherTypeRemark: '', + selectedCard: {} } }, /** @@ -107,9 +127,13 @@ export default { onLoad(option){ let optionsQuery = util.jsonPar(decodeURIComponent(option.query)); this.optionsQuery = optionsQuery; - console.warn(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(); @@ -117,7 +141,7 @@ export default { }, 300, true), payMethodsChange(e){ - if(e.id == 3)this.isCardSearchModalShow = true; + if(e.id == 3)return this.$refs.cardSearch.show(); this.payMethodsID = e.id; }, getPayMethodsLs(){ @@ -132,7 +156,7 @@ export default { // 挂账订单支付提交 takeUpBbocPay(){ - let { optionsQuery, payMethodsID, otherTypeRemark } = this; + let { optionsQuery, payMethodsID, otherTypeRemark, selectedCard } = this; let _data = { brand_id: optionsQuery.brand_id || '', amount: optionsQuery.amount || '', @@ -141,6 +165,7 @@ export default { take_up_pay_type: payMethodsID } if(payMethodsID === 4)_data['remark'] = otherTypeRemark || '其它'; + if(payMethodsID === 3&&selectedCard?.card_no)_data['card_no'] = selectedCard.card_no || ''; server.post({ url: API.takeUpBbocPay, data: _data, @@ -156,12 +181,13 @@ export default { // 1 -> 客户订场, 2-> 散客, 3-> 锁场, 提交 takeUpSubmit(){ - let { exQuery, payMethodsID, otherTypeRemark } = this; + let { exQuery, payMethodsID, otherTypeRemark, selectedCard } = this; let _data = { ...exQuery, take_up_pay_type: payMethodsID || '' } if(payMethodsID === 4)_data['remark'] = otherTypeRemark || '其它'; + if(payMethodsID === 3&&selectedCard?.card_no)_data['card_no'] = selectedCard.card_no || ''; util.showLoad(); server.post({ url: API.venueTakeUp, 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