|
@@ -2,21 +2,46 @@
|
|
|
<scroll-view scroll-y="true" class="scroll-Y">
|
|
|
<div class="worp">
|
|
|
<div class="title">纸质优惠劵减免说明</div>
|
|
|
- <div style="font-size: 28px;color:#808080;padding-top: 12px;">{{parkPaperCouponRemark}}</div>
|
|
|
+ <div style="font-size: 28px; color: #808080; padding-top: 12px">
|
|
|
+ {{ parkPaperCouponRemark }}
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<template v-if="paperCouponList.length">
|
|
|
- <div class="worp_index1" v-for="(item, index) in paperCouponList" :key="item.discountCode">
|
|
|
+ <div
|
|
|
+ class="worp_index1"
|
|
|
+ v-for="(item, index) in paperCouponList"
|
|
|
+ :key="item.discountCode"
|
|
|
+ >
|
|
|
<div class="worp_index1_index">
|
|
|
- <div class="content">劵码 {{item.discountCode}}</div>
|
|
|
+ <div class="content">劵码 {{ item.discountCode }}</div>
|
|
|
<div @click="deleteCoupon(index)"><van-icon name="delete-o" /></div>
|
|
|
</div>
|
|
|
- <div style="padding-bottom: 25px;margin-left: 20px;margin-top: 20px;font-size: 28px;">优惠劵金额 :<span
|
|
|
- style="color: #064C8A;">{{item.discountValueMoney | currency}}</span></div>
|
|
|
+ <div
|
|
|
+ style="
|
|
|
+ padding-bottom: 25px;
|
|
|
+ margin-left: 20px;
|
|
|
+ margin-top: 20px;
|
|
|
+ font-size: 28px;
|
|
|
+ "
|
|
|
+ >
|
|
|
+ 优惠劵金额 :<span style="color: #064c8a">{{
|
|
|
+ item.discountValueMoney | currency
|
|
|
+ }}</span>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
- <div :class="{'worp_button': true, 'blue_flewx_index3': custTypeId === 1, 'green_flewx_index3': custTypeId === 2}"
|
|
|
- @click="scanCode">
|
|
|
- <img :src="require('./static/images/sweep.png')" style="width: 35px;height: 35px;margin-right: 20px;" />
|
|
|
+ <div
|
|
|
+ :class="{
|
|
|
+ worp_button: true,
|
|
|
+ blue_flewx_index3: custTypeId === 1,
|
|
|
+ green_flewx_index3: custTypeId === 2,
|
|
|
+ }"
|
|
|
+ @click="scanCode"
|
|
|
+ >
|
|
|
+ <img
|
|
|
+ :src="require('./static/images/sweep.png')"
|
|
|
+ style="width: 35px; height: 35px; margin-right: 20px"
|
|
|
+ />
|
|
|
<div>扫码用劵</div>
|
|
|
</div>
|
|
|
<div class="flewx">
|
|
@@ -25,12 +50,22 @@
|
|
|
currency}}元</span>
|
|
|
</div> -->
|
|
|
<div class="flewx-content">
|
|
|
- 已选<span class="num">{{paperCouponList.length}}张</span> <span class="discountFee">优惠券可优惠{{discountFee |
|
|
|
- currency}}</span>
|
|
|
+ 已选<span class="num">{{ paperCouponList.length }}张</span>
|
|
|
+ <span class="discountFee"
|
|
|
+ >优惠券可优惠{{ discountFee | currency }}</span
|
|
|
+ >
|
|
|
</div>
|
|
|
<div
|
|
|
- :class="{'flewx_index3': true, 'blue_flewx_index3': custTypeId === 1, 'green_flewx_index3': custTypeId === 2, 'btn-disabled': !parkInfo.servicefee}"
|
|
|
- @click="confirm">确定</div>
|
|
|
+ :class="{
|
|
|
+ flewx_index3: true,
|
|
|
+ blue_flewx_index3: custTypeId === 1,
|
|
|
+ green_flewx_index3: custTypeId === 2,
|
|
|
+ 'btn-disabled': !parkInfo.servicefee,
|
|
|
+ }"
|
|
|
+ @click="confirm"
|
|
|
+ >
|
|
|
+ 确定
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<!-- 新的toast -->
|
|
|
<fui-toast ref="toast"></fui-toast>
|
|
@@ -38,15 +73,15 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import uni from '@/utils/uniHooks'
|
|
|
+import uni from '@/utils/uniHooks';
|
|
|
// const app = getApp()
|
|
|
const app = {};
|
|
|
import { mapState } from 'vuex';
|
|
|
-import fuiToast from "@/components/fui-toast/fui-toast.vue";
|
|
|
+import fuiToast from '@/components/fui-toast/fui-toast.vue';
|
|
|
|
|
|
export default {
|
|
|
components: {
|
|
|
- fuiToast
|
|
|
+ fuiToast,
|
|
|
},
|
|
|
created() {
|
|
|
this.servicefee = uni.getStorageSync('servicefee'); // 应缴金额
|
|
@@ -55,15 +90,24 @@ export default {
|
|
|
this.parkFee = JSON.parse(uni.getStorageSync('parkFee')); // discount接口返回的数据
|
|
|
this.parkMallCode = this.parkFee.parkInfoEntity.parkMallCode;
|
|
|
// 上限金额
|
|
|
- this.maxonetimediscountFee = this.parkFee.parkInfoEntity.maxonetimediscount * this.parkFee.parkInfoEntity.needmoney;
|
|
|
- this.maxonedaydiscountFee = (this.parkFee.parkInfoEntity.maxOneDayHour - this.parkFee.parkInfoEntity.ticketandMemeberGradeAndConsumeUseHour) * this.parkFee.parkInfoEntity.needmoney || 0;;
|
|
|
+ this.maxonetimediscountFee =
|
|
|
+ this.parkFee.parkInfoEntity.maxonetimediscount *
|
|
|
+ this.parkFee.parkInfoEntity.needmoney;
|
|
|
+ this.maxonedaydiscountFee =
|
|
|
+ (this.parkFee.parkInfoEntity.maxOneDayHour -
|
|
|
+ this.parkFee.parkInfoEntity.ticketandMemeberGradeAndConsumeUseHour) *
|
|
|
+ this.parkFee.parkInfoEntity.needmoney || 0;
|
|
|
if (this.maxonedaydiscountFee < 0) {
|
|
|
this.maxonedaydiscountFee = 0;
|
|
|
}
|
|
|
|
|
|
// 纸质优惠券说明
|
|
|
- if (this.parkFee.parkPaperCouponsEntities && this.parkFee.parkPaperCouponsEntities[0]) {
|
|
|
- this.parkPaperCouponRemark = this.parkFee.parkPaperCouponsEntities[0].remark;
|
|
|
+ if (
|
|
|
+ this.parkFee.parkPaperCouponsEntities &&
|
|
|
+ this.parkFee.parkPaperCouponsEntities[0]
|
|
|
+ ) {
|
|
|
+ this.parkPaperCouponRemark =
|
|
|
+ this.parkFee.parkPaperCouponsEntities[0].remark;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -76,14 +120,12 @@ export default {
|
|
|
this.paperDiscountTime = this.paperCouponInfo.paperDiscountTime;
|
|
|
this.parkDiscountTotal.feeCopy -= this.paperCouponInfo.paperDiscountFee;
|
|
|
}
|
|
|
- this.paperCouponList = [
|
|
|
- {
|
|
|
- discountCode: '123456',
|
|
|
- discountValueMoney: 10
|
|
|
- }
|
|
|
- ];
|
|
|
-
|
|
|
-
|
|
|
+ // this.paperCouponList = [
|
|
|
+ // {
|
|
|
+ // discountCode: '123456',
|
|
|
+ // discountValueMoney: 10
|
|
|
+ // }
|
|
|
+ // ];
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -98,12 +140,12 @@ export default {
|
|
|
maxonetimediscountFee: 0, // 每次优惠上限金额
|
|
|
maxonedaydiscountFee: 0, // 每天优惠上限金额
|
|
|
parkMallCode: 1, // 0静安 1浦东 2杭州 3北京 4沈阳 5深圳
|
|
|
- parkInfo: {}
|
|
|
- }
|
|
|
+ parkInfo: {},
|
|
|
+ };
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState({
|
|
|
- custTypeId: state => state.custTypeId
|
|
|
+ custTypeId: (state) => state.custTypeId,
|
|
|
}),
|
|
|
// 实际支付金额
|
|
|
actualFee() {
|
|
@@ -119,27 +161,31 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
if (this.parkMallCode === 4) {
|
|
|
- if (this.parkDiscountTotal.feeCopy - this.parkDiscountTotal.bonusfee > this.maxonedaydiscountFee) {
|
|
|
- this.parkDiscountTotal.feeCopy = this.maxonedaydiscountFee + this.parkDiscountTotal.bonusfee;
|
|
|
+ if (
|
|
|
+ this.parkDiscountTotal.feeCopy - this.parkDiscountTotal.bonusfee >
|
|
|
+ this.maxonedaydiscountFee
|
|
|
+ ) {
|
|
|
+ this.parkDiscountTotal.feeCopy =
|
|
|
+ this.maxonedaydiscountFee + this.parkDiscountTotal.bonusfee;
|
|
|
}
|
|
|
}
|
|
|
return this.parkDiscountTotal.feeCopy + this.paperDiscountFee;
|
|
|
- }
|
|
|
+ },
|
|
|
},
|
|
|
methods: {
|
|
|
showToast(text) {
|
|
|
let options = {};
|
|
|
options.text = text;
|
|
|
- this.$refs.toast.show(options)
|
|
|
+ this.$refs.toast.show(options);
|
|
|
},
|
|
|
// 扫码
|
|
|
scanCode() {
|
|
|
uni.scanCode({
|
|
|
onlyFromCamera: false,
|
|
|
scanType: ['qrCode'],
|
|
|
- success: res => {
|
|
|
- console.log('扫码', res)
|
|
|
- if (res.scanType == "QR_CODE" && res.scanType) {
|
|
|
+ success: (res) => {
|
|
|
+ console.log('扫码', res);
|
|
|
+ if (res.scanType == 'QR_CODE' && res.scanType) {
|
|
|
console.log(res.result);
|
|
|
const url = res.result;
|
|
|
if (url.indexOf('auth/') === -1) {
|
|
@@ -154,20 +200,20 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- })
|
|
|
+ },
|
|
|
+ });
|
|
|
},
|
|
|
|
|
|
// 根据卡券ID查询卡券信息
|
|
|
getPaperCouponInfo(couponCode) {
|
|
|
uni.showLoading({
|
|
|
- title: '加载中'
|
|
|
+ title: '加载中',
|
|
|
});
|
|
|
const params = {
|
|
|
groupId: app.globalData.groupId,
|
|
|
mallid: app.globalData.mallid,
|
|
|
couponcode: couponCode,
|
|
|
- orderno: uni.getStorageSync('orderno')
|
|
|
+ orderno: uni.getStorageSync('orderno'),
|
|
|
};
|
|
|
this.$md(params);
|
|
|
uni.request({
|
|
@@ -175,7 +221,7 @@ export default {
|
|
|
data: params,
|
|
|
method: 'POST',
|
|
|
header: JSON.parse(uni.getStorageSync('handleUser')),
|
|
|
- success: res => {
|
|
|
+ success: (res) => {
|
|
|
uni.hideLoading();
|
|
|
console.log(res);
|
|
|
if (res.data.code !== 0) {
|
|
@@ -191,57 +237,64 @@ export default {
|
|
|
return uni.showToast({
|
|
|
title: '该纸质优惠券未激活',
|
|
|
duration: 2000,
|
|
|
- icon: 'none'
|
|
|
- })
|
|
|
+ icon: 'none',
|
|
|
+ });
|
|
|
}
|
|
|
if (res.data.data.discountRuleId == '1') {
|
|
|
return uni.showToast({
|
|
|
title: '该纸质优惠券已领取',
|
|
|
duration: 2000,
|
|
|
- icon: 'none'
|
|
|
- })
|
|
|
+ icon: 'none',
|
|
|
+ });
|
|
|
}
|
|
|
if (res.data.data.discountRuleId == '2') {
|
|
|
return uni.showToast({
|
|
|
title: '该纸质优惠券已使用',
|
|
|
duration: 2000,
|
|
|
- icon: 'none'
|
|
|
- })
|
|
|
+ icon: 'none',
|
|
|
+ });
|
|
|
}
|
|
|
if (res.data.data.discountRuleId == '3') {
|
|
|
return uni.showToast({
|
|
|
title: '该纸质优惠券已核销',
|
|
|
duration: 2000,
|
|
|
- icon: 'none'
|
|
|
- })
|
|
|
+ icon: 'none',
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
if (this.paperCouponList.length) {
|
|
|
- const index = this.paperCouponList.findIndex(e => e.discountCode === couponCode);
|
|
|
+ const index = this.paperCouponList.findIndex(
|
|
|
+ (e) => e.discountCode === couponCode
|
|
|
+ );
|
|
|
if (index === -1) {
|
|
|
this.paperCouponList.push(res.data.data);
|
|
|
this.paperDiscountFee += Number(res.data.data.discountValueMoney);
|
|
|
- this.paperDiscountTime = this.paperDiscountFee / this.parkFee.parkInfoEntity.needmoney;
|
|
|
+ this.paperDiscountTime =
|
|
|
+ this.paperDiscountFee / this.parkFee.parkInfoEntity.needmoney;
|
|
|
}
|
|
|
} else {
|
|
|
this.paperCouponList.push(res.data.data);
|
|
|
this.paperDiscountFee += Number(res.data.data.discountValueMoney);
|
|
|
- this.paperDiscountTime = this.paperDiscountFee / this.parkFee.parkInfoEntity.needmoney;
|
|
|
+ this.paperDiscountTime =
|
|
|
+ this.paperDiscountFee / this.parkFee.parkInfoEntity.needmoney;
|
|
|
}
|
|
|
|
|
|
// this.crossMessage();
|
|
|
},
|
|
|
- fail: err => {
|
|
|
+ fail: (err) => {
|
|
|
uni.hideLoading();
|
|
|
console.log(err);
|
|
|
- }
|
|
|
+ },
|
|
|
});
|
|
|
},
|
|
|
|
|
|
// 删除
|
|
|
deleteCoupon(i) {
|
|
|
- this.paperDiscountFee -= Number(this.paperCouponList[i].discountValueMoney);
|
|
|
- this.paperDiscountTime = this.paperDiscountFee / this.parkFee.parkInfoEntity.needmoney;
|
|
|
+ this.paperDiscountFee -= Number(
|
|
|
+ this.paperCouponList[i].discountValueMoney
|
|
|
+ );
|
|
|
+ this.paperDiscountTime =
|
|
|
+ this.paperDiscountFee / this.parkFee.parkInfoEntity.needmoney;
|
|
|
this.paperCouponList.splice(i, 1);
|
|
|
},
|
|
|
|
|
@@ -290,12 +343,12 @@ export default {
|
|
|
paperDiscountFee: this.paperDiscountFee,
|
|
|
paperDiscountTime: this.paperDiscountTime,
|
|
|
paperCouponcode: paperCouponcode,
|
|
|
- paperCouponList: this.paperCouponList
|
|
|
+ paperCouponList: this.paperCouponList,
|
|
|
});
|
|
|
this.$router.back();
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style lang="less" scoped>
|
|
@@ -306,7 +359,7 @@ export default {
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
height: 100vh;
|
|
|
- background: #F4F7FF;
|
|
|
+ background: #f4f7ff;
|
|
|
}
|
|
|
|
|
|
.worp {
|
|
@@ -327,16 +380,16 @@ export default {
|
|
|
margin-top: 30px;
|
|
|
margin-left: 4%;
|
|
|
font-size: 30px;
|
|
|
- background: #FAFBFF;
|
|
|
+ background: #fafbff;
|
|
|
border-radius: 4px;
|
|
|
- border: 1px solid #D8DAE0;
|
|
|
+ border: 1px solid #d8dae0;
|
|
|
}
|
|
|
|
|
|
.worp_index1_index {
|
|
|
width: 650px;
|
|
|
height: 60px;
|
|
|
margin-left: 20px;
|
|
|
- border-bottom: 1px solid #F2F2F2;
|
|
|
+ border-bottom: 1px solid #f2f2f2;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: space-between;
|
|
@@ -359,7 +412,7 @@ export default {
|
|
|
color: #fff;
|
|
|
margin-top: 45px;
|
|
|
// background-image: linear-gradient(to right, #7e4fa1, #433c7f);
|
|
|
- background: #064C8A;
|
|
|
+ background: #064c8a;
|
|
|
margin-left: 30px;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
@@ -383,11 +436,11 @@ export default {
|
|
|
position: absolute;
|
|
|
left: 16px;
|
|
|
font-size: 28px;
|
|
|
- .num{
|
|
|
- color: #064C8A;
|
|
|
+ .num {
|
|
|
+ color: #064c8a;
|
|
|
}
|
|
|
- .discountFee{
|
|
|
- color: #EE4D3F;
|
|
|
+ .discountFee {
|
|
|
+ color: #ee4d3f;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -400,7 +453,7 @@ export default {
|
|
|
line-height: 70px;
|
|
|
color: #fff;
|
|
|
// background-image: linear-gradient(to right, #7e4fa1, #433c7f);
|
|
|
- background: #064C8A;
|
|
|
+ background: #064c8a;
|
|
|
box-shadow: 2px 3px 5px #888888;
|
|
|
position: absolute;
|
|
|
right: 16px;
|
|
@@ -408,11 +461,11 @@ export default {
|
|
|
}
|
|
|
|
|
|
.blue_flewx_index3 {
|
|
|
- .color_flewx_index3('blue')
|
|
|
+ .color_flewx_index3('blue');
|
|
|
}
|
|
|
|
|
|
.green_flewx_index3 {
|
|
|
- .color_flewx_index3('green')
|
|
|
+ .color_flewx_index3('green');
|
|
|
}
|
|
|
|
|
|
.color_flewx_index3(@value) {
|
|
@@ -421,6 +474,3 @@ export default {
|
|
|
background-color: @@color !important;
|
|
|
}
|
|
|
</style>
|
|
|
-
|
|
|
-
|
|
|
-
|