|
@@ -1,26 +1,29 @@
|
|
|
<template>
|
|
|
<div class="coupon">
|
|
|
- <div class="list">
|
|
|
- <div class="item" v-for="(v,i) in couponList" :key="i">
|
|
|
- <div class="top-content">
|
|
|
- <div class="money" v-if="v.type === 1">
|
|
|
- <span class="samll-size">¥</span>
|
|
|
- <span class="big-size">{{v.money}}</span>
|
|
|
+ <div class="recharge_coupon_bottom">
|
|
|
+ <div class="recharge_coupon_bottom_item" v-for="(item,index) in couponList" :key="index">
|
|
|
+ <div class="recharge_coupon_bottom_left">
|
|
|
+ <div class="recharge_coupon_bottom_left_num">
|
|
|
+ <span v-if="item.type == 1 || item.type == 3">¥</span>
|
|
|
+ <span class="num" v-if="item.type == 1 || item.type == 3">{{item.money}}</span>
|
|
|
+ <span class="num" v-if="item.type == 2">{{item.discount}}</span>
|
|
|
+ <span v-if="item.type == 2">折</span>
|
|
|
</div>
|
|
|
- <div class="money" v-if="v.type === 2">
|
|
|
- <span class="big-size">{{v.discount}}</span>
|
|
|
- <span class="samll-size">折</span>
|
|
|
+ <div class="recharge_coupon_bottom_sub">
|
|
|
+ <span v-if="item.type == 2">最高减{{ item.maxDiscount }}元</span>
|
|
|
+ <span v-if="item.type == 1">满{{ item.limitFee }}元可用</span>
|
|
|
</div>
|
|
|
- <div class="man-jian" v-if="v.type === 2">最高可减{{v.maxDiscount}}元</div>
|
|
|
- <div class="man-jian" v-if="v.type === 1">{{v.name}}</div>
|
|
|
- <div class="time">{{v.validStartTime}} - {{v.validEndTime}}</div>
|
|
|
</div>
|
|
|
- <div class="bottom">
|
|
|
- <div class="lei-xing">
|
|
|
- 类型:<span>{{v.type === 1 ? '满减劵' : '折扣券'}}</span>
|
|
|
+ <div class="recharge_coupon_bottom_middle">
|
|
|
+ <div></div>
|
|
|
+ </div>
|
|
|
+ <div class="recharge_coupon_bottom_right">
|
|
|
+ <div class="recharge_coupon_bottom_date">
|
|
|
+ <div>{{item.name}}</div>
|
|
|
+ <div>有效期:{{item.validStartTime}} - {{item.validEndTime}}</div>
|
|
|
</div>
|
|
|
- <div class="lei-xing">
|
|
|
- 数量:<span>{{Number(v.num)}}张</span>
|
|
|
+ <div class="recharge_coupon_bottom_number">
|
|
|
+ <span>x{{item.num}}张</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -34,7 +37,7 @@
|
|
|
|
|
|
<script>
|
|
|
import { getCouponList, getCouponExplain } from "../../api/amount.js";
|
|
|
-import tool from '../../api/tool.js'
|
|
|
+import tool from "../../api/tool.js";
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
@@ -50,6 +53,24 @@ export default {
|
|
|
this.getCouponList();
|
|
|
},
|
|
|
methods: {
|
|
|
+ showType(type) {
|
|
|
+ let name = "";
|
|
|
+ // v.type === 1 ? '满减劵' : '折扣券'
|
|
|
+ switch (type) {
|
|
|
+ case 1:
|
|
|
+ name = "满减劵";
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ name = "折扣券";
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ name = "立减劵";
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ return name;
|
|
|
+ },
|
|
|
handleSizeChange(val) {
|
|
|
this.params.pageNum = 1;
|
|
|
this.params.pageSize = val;
|
|
@@ -64,10 +85,16 @@ export default {
|
|
|
getCouponList() {
|
|
|
getCouponList({ status: 0, isNew: 1 }).then((res) => {
|
|
|
if (res.code === 200) {
|
|
|
- this.couponList = res.data.data.map(v=>{
|
|
|
- v.validStartTime = tool.getFormatDate(new Date(v.validStartTime),'yyyy.MM.dd')
|
|
|
- v.validEndTime = tool.getFormatDate(new Date(v.validEndTime),'yyyy.MM.dd')
|
|
|
- return v
|
|
|
+ this.couponList = res.data.data.map((v) => {
|
|
|
+ v.validStartTime = tool.getFormatDate(
|
|
|
+ new Date(v.validStartTime),
|
|
|
+ "yyyy.MM.dd"
|
|
|
+ );
|
|
|
+ v.validEndTime = tool.getFormatDate(
|
|
|
+ new Date(v.validEndTime),
|
|
|
+ "yyyy.MM.dd"
|
|
|
+ );
|
|
|
+ return v;
|
|
|
});
|
|
|
this.total = res.data.totalNums || 0;
|
|
|
} else {
|
|
@@ -86,54 +113,109 @@ export default {
|
|
|
.coupon {
|
|
|
height: calc(100vh - 274px);
|
|
|
background-color: #fff;
|
|
|
- .list {
|
|
|
+ .recharge_coupon_bottom {
|
|
|
+ margin: 15px 17px;
|
|
|
display: flex;
|
|
|
flex-wrap: wrap;
|
|
|
- .item {
|
|
|
- margin-right: 20px;
|
|
|
- .top-content {
|
|
|
- width: 244px;
|
|
|
- height: 166px;
|
|
|
- background: url(../../../static/image/coupon-bg.png) no-repeat;
|
|
|
- background-size: cover;
|
|
|
+ .recharge_coupon_bottom_item {
|
|
|
+ width: 410px;
|
|
|
+ height: 72px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: flex-start;
|
|
|
+ margin-bottom: 10px;
|
|
|
+ margin-right: 24px;
|
|
|
+ .recharge_coupon_bottom_left {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ width: 110px;
|
|
|
+ margin-top: 10px auto;
|
|
|
text-align: center;
|
|
|
- box-sizing: border-box;
|
|
|
- padding: 30px;
|
|
|
- .money {
|
|
|
- font-family: PingFang SC;
|
|
|
- font-weight: 600;
|
|
|
- color: #ffffff;
|
|
|
- .samll-size {
|
|
|
- font-size: 22px;
|
|
|
+ border-radius: 8px;
|
|
|
+ background-color: #fff;
|
|
|
+ padding: 10px 0;
|
|
|
+ box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
|
|
|
+ .recharge_coupon_bottom_left_num {
|
|
|
+ span {
|
|
|
+ font-size: 14px;
|
|
|
+ font-family: PingFang SC;
|
|
|
+ font-weight: 400;
|
|
|
+ line-height: 20px;
|
|
|
+ margin-left: 2px;
|
|
|
+ color: #ec1414;
|
|
|
}
|
|
|
- .big-size {
|
|
|
- font-size: 40px;
|
|
|
+ .num {
|
|
|
+ font-size: 26px;
|
|
|
+ font-family: PingFang SC;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #ec1414;
|
|
|
}
|
|
|
}
|
|
|
- .man-jian {
|
|
|
+
|
|
|
+ .recharge_coupon_bottom_sub {
|
|
|
font-size: 14px;
|
|
|
font-family: PingFang SC;
|
|
|
font-weight: 400;
|
|
|
- color: #ffffff;
|
|
|
+ line-height: 20px;
|
|
|
+ color: #666666;
|
|
|
}
|
|
|
- .time {
|
|
|
- font-size: 12px;
|
|
|
- font-family: PingFang SC;
|
|
|
- font-weight: 400;
|
|
|
- color: #28888a;
|
|
|
- margin-top: 30px;
|
|
|
+ }
|
|
|
+ .recharge_coupon_bottom_middle {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ div {
|
|
|
+ height: 100%;
|
|
|
+ padding: 10px 0;
|
|
|
+ height: 55px;
|
|
|
+ border-right: 1px dashed #ec1414;
|
|
|
+ box-sizing: border-box;
|
|
|
}
|
|
|
}
|
|
|
- .bottom {
|
|
|
+ .recharge_coupon_bottom_right {
|
|
|
+ border-radius: 8px;
|
|
|
+ background-color: #fff;
|
|
|
+ flex: 1;
|
|
|
+ position: relative;
|
|
|
padding: 10px;
|
|
|
- .lei-xing {
|
|
|
- font-size: 12px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
|
|
|
+ .recharge_coupon_bottom_date {
|
|
|
+ font-size: 18px;
|
|
|
font-family: PingFang SC;
|
|
|
- font-weight: 400;
|
|
|
- color: #666666;
|
|
|
- margin-bottom: 4px;
|
|
|
+ font-weight: bold;
|
|
|
+ line-height: 25px;
|
|
|
+ color: #333333;
|
|
|
+ div:last-child {
|
|
|
+ height: 20px;
|
|
|
+ font-size: 12px;
|
|
|
+ font-family: PingFang SC;
|
|
|
+ font-weight: 400;
|
|
|
+ line-height: 20px;
|
|
|
+ color: #999999;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .recharge_coupon_bottom_number {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
span {
|
|
|
- color: #999;
|
|
|
+ width: 63px;
|
|
|
+ height: 22px;
|
|
|
+ line-height: 22px;
|
|
|
+ border: 1px solid #ec1414;
|
|
|
+ border-radius: 18px;
|
|
|
+ text-align: center;
|
|
|
+ font-size: 12px;
|
|
|
+ font-family: PingFang SC;
|
|
|
+ font-weight: 500;
|
|
|
+ color: #ec1414;
|
|
|
+ cursor: pointer;
|
|
|
+ &:hover {
|
|
|
+ background-color: #ec1414;
|
|
|
+ color: #ffffff;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|