缴费页面加入购物券

This commit is contained in:
wuxw 2022-11-26 13:49:03 +08:00
parent cb77ae3fba
commit ccc127d839
6 changed files with 107 additions and 6 deletions

View File

@ -270,6 +270,28 @@ export function generatorCouponQrcode(_objData) {
}); });
}) })
} }
export function computePayFeeCoupon(_objData) {
return new Promise((resolve, reject) => {
request({
url: url.computePayFeeCoupon,
method: "GET",
data: _objData, //动态数据
success: function(res) {
if (res.statusCode == 200) {
//成功情况下跳转
resolve(res.data);
return;
}
reject();
},
fail: function(e) {
reject();
}
});
})
}
export function receiveParkingCoupon(_objData) { export function receiveParkingCoupon(_objData) {

View File

@ -0,0 +1,65 @@
<template>
<view>
<view v-if="coupons && coupons.length > 0">
<view class="block__title">赠送优惠券</view>
<checkbox-group @change="checkboxChange">
<view class="cu-list menu" v-for="(coupon, idx) in coupons" :key="idx" :data-item="coupon"
@click="_viewcouponDetail(coupon)">
<view class="cu-item ">
<view class="content padding-tb-sm">
<view>
<view class="text-cut" style="width:220px">{{coupon.couponName}}({{coupon.toTypeName}})</view>
</view>
</view>
<view class="action">
<text class="text-grey text-sm">{{coupon.quantity}}</text>
</view>
</view>
</view>
</checkbox-group>
</view>
</view>
</template>
<script>
import {
computePayFeeCoupon
} from '@/api/fee/feeApi.js'
export default {
name:"giftCoupon",
data() {
return {
coupons: []
};
},
methods: {
listGiftCoupon: function(_feeId, _communityId, _feeMonth) {
let _that = this;
computePayFeeCoupon({
page: 1,
row: 30,
feeId: _feeId,
communityId: _communityId,
cycles:_feeMonth
}).then((data) => {
if(!data){
_that.coupons = [];
return;
}
_that.coupons = data.data;
})
},
}
};
</script>
<style>
.block__title {
margin: 0;
font-weight: 400;
font-size: 14px;
color: rgba(69,90,100,.6);
padding: 40rpx 30rpx 20rpx;
}
</style>

View File

@ -171,8 +171,7 @@ export default {
listInspectionTaskDetails:baseUrl +"app/inspectionTaskDetail.listInspectionTaskDetails", listInspectionTaskDetails:baseUrl +"app/inspectionTaskDetail.listInspectionTaskDetails",
// 优惠券核销二维码生成 // 优惠券核销二维码生成
generatorCouponQrcode:baseUrl +"app/couponProperty.generatorCouponQrcode", generatorCouponQrcode:baseUrl +"app/couponProperty.generatorCouponQrcode",
computePayFeeCoupon:baseUrl +"app/coupon.computePayFeeCoupon",
NEED_NOT_LOGIN_PAGE: [ NEED_NOT_LOGIN_PAGE: [
'pages/login/login', 'pages/login/login',

View File

@ -82,6 +82,7 @@
<text class="text-grey text-sm">{{endTime }}</text> <text class="text-grey text-sm">{{endTime }}</text>
</view> </view>
</view> </view>
<gift-coupon ref="giftCoupon" ></gift-coupon>
<vcDiscount ref="vcDiscountRef" @computeFeeDiscount="computeFeeDiscount" payerObjType="3333" :payerObjId="contractId" :endTime="formatEndTime" :feeId="feeId" :cycles="feeMonth" :communityId="communityId"></vcDiscount> <vcDiscount ref="vcDiscountRef" @computeFeeDiscount="computeFeeDiscount" payerObjType="3333" :payerObjId="contractId" :endTime="formatEndTime" :feeId="feeId" :cycles="feeMonth" :communityId="communityId"></vcDiscount>
</view> </view>
@ -108,6 +109,7 @@
// pages/fee/payParkingFee.js // pages/fee/payParkingFee.js
import context from '../../lib/java110/Java110Context.js'; import context from '../../lib/java110/Java110Context.js';
const constant = context.constant; const constant = context.constant;
import giftCoupon from '@/components/coupon/gift-coupon.vue'
import vcDiscount from '@/components/vc-discount/vc-discount.vue' import vcDiscount from '@/components/vc-discount/vc-discount.vue'
@ -127,7 +129,8 @@
import {getCurContract} from '../../api/contract/contractApi.js' import {getCurContract} from '../../api/contract/contractApi.js'
export default { export default {
components:{ components:{
vcDiscount vcDiscount,
giftCoupon
}, },
data() { data() {
return { return {
@ -216,6 +219,7 @@
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.vcDiscountRef._loadFeeDiscount(this.feeId,this.communityId,this.feeMonth); this.$refs.vcDiscountRef._loadFeeDiscount(this.feeId,this.communityId,this.feeMonth);
this.$refs.giftCoupon.listGiftCoupon(this.feeId, this.communityId, this.feeMonth);
}) })
}, },
methods: { methods: {
@ -237,6 +241,7 @@
this.feeMonth = _feeMonth; this.feeMonth = _feeMonth;
this.endTime = formatDate(_newDate); this.endTime = formatDate(_newDate);
this.$refs.vcDiscountRef._loadFeeDiscount(this.feeId,this.communityId,this.feeMonth); this.$refs.vcDiscountRef._loadFeeDiscount(this.feeId,this.communityId,this.feeMonth);
this.$refs.giftCoupon.listGiftCoupon(this.feeId, this.communityId, this.feeMonth);
}, },
onFeeMonthChange: function(e) { onFeeMonthChange: function(e) {
console.log(e); console.log(e);

View File

@ -83,6 +83,7 @@
<text class="text-grey text-sm">{{endTime }}</text> <text class="text-grey text-sm">{{endTime }}</text>
</view> </view>
</view> </view>
<gift-coupon ref="giftCoupon" ></gift-coupon>
<vcUserAccount ref="vcUserAccountRef" @getUserAmount="getUserAmount"></vcUserAccount> <vcUserAccount ref="vcUserAccountRef" @getUserAmount="getUserAmount"></vcUserAccount>
<vc-discount ref="vcDiscountRef" @computeFeeDiscount="computeFeeDiscount" :endTime="formatEndTime" :feeId="feeId" :cycles="feeMonth" <vc-discount ref="vcDiscountRef" @computeFeeDiscount="computeFeeDiscount" :endTime="formatEndTime" :feeId="feeId" :cycles="feeMonth"
:communityId="communityId"></vc-discount> :communityId="communityId"></vc-discount>
@ -113,7 +114,8 @@
import context from '../../lib/java110/Java110Context.js'; import context from '../../lib/java110/Java110Context.js';
const constant = context.constant; const constant = context.constant;
import vcDiscount from '@/components/vc-discount/vc-discount.vue' import vcDiscount from '@/components/vc-discount/vc-discount.vue';
import giftCoupon from '@/components/coupon/gift-coupon.vue'
import vcUserAccount from '@/components/vc-user-account/vc-user-account.vue' import vcUserAccount from '@/components/vc-user-account/vc-user-account.vue'
import { import {
addMonth, addMonth,
@ -133,7 +135,8 @@
export default { export default {
components: { components: {
vcDiscount, vcDiscount,
vcUserAccount vcUserAccount,
giftCoupon
}, },
data() { data() {
return { return {
@ -221,6 +224,7 @@
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.vcDiscountRef._loadFeeDiscount(this.feeId, this.communityId, this.feeMonth); this.$refs.vcDiscountRef._loadFeeDiscount(this.feeId, this.communityId, this.feeMonth);
this.$refs.vcUserAccountRef._listOwnerAccount(this.feeId, this.communityId); this.$refs.vcUserAccountRef._listOwnerAccount(this.feeId, this.communityId);
this.$refs.giftCoupon.listGiftCoupon(this.feeId, this.communityId, this.feeMonth);
}); });
this.payOnline = _fee.payOnline; this.payOnline = _fee.payOnline;
}, },
@ -269,6 +273,7 @@
this.endTime = formatDate(_newDate); this.endTime = formatDate(_newDate);
this.receivableAmount = _feeMonth * this.feePrice; this.receivableAmount = _feeMonth * this.feePrice;
this.$refs.vcDiscountRef._loadFeeDiscount(this.feeId, this.communityId, this.feeMonth); this.$refs.vcDiscountRef._loadFeeDiscount(this.feeId, this.communityId, this.feeMonth);
this.$refs.giftCoupon.listGiftCoupon(this.feeId, this.communityId, this.feeMonth);
}, },
onFeeMonthCancel: function(e) { onFeeMonthCancel: function(e) {
this.showFeeMonth = false; this.showFeeMonth = false;

View File

@ -125,6 +125,7 @@
<view>{{couponAmount}}</view> <view>{{couponAmount}}</view>
</view> </view>
</view> </view>
<gift-coupon ref="giftCoupon" ></gift-coupon>
<vcDiscount ref="vcDiscountRef" @computeFeeDiscount="computeFeeDiscount" payerObjType="3333" <vcDiscount ref="vcDiscountRef" @computeFeeDiscount="computeFeeDiscount" payerObjType="3333"
:payerObjId="roomId" :endTime="formatEndTime" :feeId="feeId" :cycles="feeMonth" :payerObjId="roomId" :endTime="formatEndTime" :feeId="feeId" :cycles="feeMonth"
:communityId="communityId"></vcDiscount> :communityId="communityId"></vcDiscount>
@ -157,6 +158,7 @@
const constant = context.constant; const constant = context.constant;
import vcDiscount from '@/components/vc-discount/vc-discount.vue'; import vcDiscount from '@/components/vc-discount/vc-discount.vue';
import giftCoupon from '@/components/coupon/gift-coupon.vue'
import vcUserAccount from '@/components/vc-user-account/vc-user-account.vue'; import vcUserAccount from '@/components/vc-user-account/vc-user-account.vue';
import { import {
@ -171,7 +173,8 @@
export default { export default {
components: { components: {
vcDiscount, vcDiscount,
vcUserAccount vcUserAccount,
giftCoupon
}, },
data() { data() {
return { return {
@ -290,6 +293,7 @@
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.vcDiscountRef._loadFeeDiscount(this.feeId, this.communityId, this.feeMonth); this.$refs.vcDiscountRef._loadFeeDiscount(this.feeId, this.communityId, this.feeMonth);
this.$refs.vcUserAccountRef._listOwnerAccount(this.feeId, this.communityId); this.$refs.vcUserAccountRef._listOwnerAccount(this.feeId, this.communityId);
this.$refs.giftCoupon.listGiftCoupon(this.feeId, this.communityId, this.feeMonth);
}) })
}, },
onShow() { onShow() {
@ -369,6 +373,7 @@
this.endTime = formatDate(_newDate); this.endTime = formatDate(_newDate);
this.receivableAmount = this.getReceivableAmount(); this.receivableAmount = this.getReceivableAmount();
this.$refs.vcDiscountRef._loadFeeDiscount(this.feeId, this.communityId, this.feeMonth); this.$refs.vcDiscountRef._loadFeeDiscount(this.feeId, this.communityId, this.feeMonth);
this.$refs.giftCoupon.listGiftCoupon(this.feeId, this.communityId, this.feeMonth);
}, },
onFeeMonthChange: function(e) { onFeeMonthChange: function(e) {