|
@@ -3,25 +3,25 @@
|
|
|
<el-dialog center title="支付订单" :visible.sync="show" width="680px" :before-close="handleClose">
|
|
<el-dialog center title="支付订单" :visible.sync="show" width="680px" :before-close="handleClose">
|
|
|
<div class="border"></div>
|
|
<div class="border"></div>
|
|
|
<div class="page" v-loading="loading">
|
|
<div class="page" v-loading="loading">
|
|
|
- <div v-if="list2">
|
|
|
|
|
- <div class="title1">选择兑换券</div>
|
|
|
|
|
- <div class="coupon" @click="choose(list2)">
|
|
|
|
|
|
|
+ <div v-if="list[0]">
|
|
|
|
|
+ <div class="title1">兑换券</div>
|
|
|
|
|
+ <div class="coupon" @click="choose(list[0])">
|
|
|
<div class="box">
|
|
<div class="box">
|
|
|
<img class="img" src="../assets/icon_youhuiquan_01@3x.png" alt="" />
|
|
<img class="img" src="../assets/icon_youhuiquan_01@3x.png" alt="" />
|
|
|
<div class="coupon-top">
|
|
<div class="coupon-top">
|
|
|
- <div class="text1">{{ list2.name }}</div>
|
|
|
|
|
- <div class="text2" v-if="!list2.limited">仅限规定商品可用</div>
|
|
|
|
|
|
|
+ <div class="text1">{{ list[0].name }}</div>
|
|
|
|
|
+ <div class="text2" v-if="list[0].limited">仅限规定商品可用</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="box1">
|
|
<div class="box1">
|
|
|
<div>
|
|
<div>
|
|
|
<span class="text3"
|
|
<span class="text3"
|
|
|
- >兑换券编码<span class="text4"> {{ list2.id }}</span></span
|
|
|
|
|
|
|
+ >兑换券编码<span class="text4"> {{ list[0].id }}</span></span
|
|
|
>
|
|
>
|
|
|
- <div class="text5">有效期至:{{ list2.expiration }}</div>
|
|
|
|
|
|
|
+ <div class="text5">有效期至:{{ list[0].expiration }}</div>
|
|
|
</div>
|
|
</div>
|
|
|
<img
|
|
<img
|
|
|
- v-if="chooseId === list2.id"
|
|
|
|
|
|
|
+ v-if="chooseId === list[0].id"
|
|
|
class="icon"
|
|
class="icon"
|
|
|
src="../assets/icon_gouxuan_pre.png"
|
|
src="../assets/icon_gouxuan_pre.png"
|
|
|
alt=""
|
|
alt=""
|
|
@@ -29,8 +29,8 @@
|
|
|
<img v-else class="icon" src="../assets/icon_gouxuan_huise.png" alt="" />
|
|
<img v-else class="icon" src="../assets/icon_gouxuan_huise.png" alt="" />
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="all" @click="all">查看更多</div>
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <div v-if="listAll.length !== 0" class="all" @click="all">查看更多</div>
|
|
|
<div class="border"></div>
|
|
<div class="border"></div>
|
|
|
<div class="info">
|
|
<div class="info">
|
|
|
<div class="price">
|
|
<div class="price">
|
|
@@ -89,14 +89,15 @@
|
|
|
</span>
|
|
</span>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
<el-dialog center title="兑换券" :visible.sync="show2" width="680px">
|
|
<el-dialog center title="兑换券" :visible.sync="show2" width="680px">
|
|
|
- <div class="page">
|
|
|
|
|
- <div v-for="(item, index) in list3" :key="index" @click="IdFn(item)">
|
|
|
|
|
- <div class="coupon" @click="choose">
|
|
|
|
|
|
|
+ <div class="border"></div>
|
|
|
|
|
+ <div style="padding: 30px 0 20px 0" class="page">
|
|
|
|
|
+ <div v-for="(item, index) in listAll" :key="index" @click="IdFn(item)">
|
|
|
|
|
+ <div class="coupon" @click="choose(item)">
|
|
|
<div class="box">
|
|
<div class="box">
|
|
|
<img class="img" src="../assets/icon_youhuiquan_01@3x.png" alt="" />
|
|
<img class="img" src="../assets/icon_youhuiquan_01@3x.png" alt="" />
|
|
|
<div class="coupon-top">
|
|
<div class="coupon-top">
|
|
|
<div class="text1">{{ item.name }}</div>
|
|
<div class="text1">{{ item.name }}</div>
|
|
|
- <div class="text2" v-if="!item.limited">仅限规定商品可用</div>
|
|
|
|
|
|
|
+ <div class="text2" v-if="item.limited">仅限规定商品可用</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="box1">
|
|
<div class="box1">
|
|
@@ -107,21 +108,23 @@
|
|
|
<div class="text5">有效期至:{{ item.expiration }}</div>
|
|
<div class="text5">有效期至:{{ item.expiration }}</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <el-empty v-if="empty" description="暂无兑换券哦~" />
|
|
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <!-- <el-empty v-if="empty" description="暂无兑换券哦~" /> -->
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
import vueQrcode from '@chenfengyuan/vue-qrcode';
|
|
import vueQrcode from '@chenfengyuan/vue-qrcode';
|
|
|
|
|
+import coupon from '../mixins/coupon';
|
|
|
import resolveUrl from 'resolve-url';
|
|
import resolveUrl from 'resolve-url';
|
|
|
// import pageableTable from '../mixins/pageableTable';
|
|
// import pageableTable from '../mixins/pageableTable';
|
|
|
import { mapState } from 'vuex';
|
|
import { mapState } from 'vuex';
|
|
|
import { add } from 'mathjs';
|
|
import { add } from 'mathjs';
|
|
|
export default {
|
|
export default {
|
|
|
|
|
+ mixins: [coupon],
|
|
|
props: {
|
|
props: {
|
|
|
statusAll: {
|
|
statusAll: {
|
|
|
type: Object
|
|
type: Object
|
|
@@ -142,8 +145,8 @@ export default {
|
|
|
seconds: 0,
|
|
seconds: 0,
|
|
|
allTime: 5 * 60 - 1,
|
|
allTime: 5 * 60 - 1,
|
|
|
closeTime: '',
|
|
closeTime: '',
|
|
|
- list2: [],
|
|
|
|
|
- list3: [],
|
|
|
|
|
|
|
+ list: [],
|
|
|
|
|
+ listAll: [],
|
|
|
payList: [
|
|
payList: [
|
|
|
{
|
|
{
|
|
|
icon: require('../assets/weixin.png'),
|
|
icon: require('../assets/weixin.png'),
|
|
@@ -251,8 +254,7 @@ export default {
|
|
|
'/userCoupon/all',
|
|
'/userCoupon/all',
|
|
|
{
|
|
{
|
|
|
query: {
|
|
query: {
|
|
|
- userId: this.userInfo.id,
|
|
|
|
|
- used: false
|
|
|
|
|
|
|
+ userId: this.userInfo.id
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
@@ -260,23 +262,27 @@ export default {
|
|
|
}
|
|
}
|
|
|
)
|
|
)
|
|
|
.then(res => {
|
|
.then(res => {
|
|
|
- this.list2 = res.content[0];
|
|
|
|
|
- this.list3 = res.content;
|
|
|
|
|
|
|
+ this.list = res.content.filter(item => {
|
|
|
|
|
+ return !item.used && this.checkTime(item) && this.checkUse(item, this.$route.query.id);
|
|
|
|
|
+ });
|
|
|
|
|
+ this.listAll = res.content.filter(item => {
|
|
|
|
|
+ return !item.used && this.checkTime(item) && this.checkUse(item, this.$route.query.id);
|
|
|
|
|
+ });
|
|
|
|
|
+ console.log(this.listAll);
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
IdFn(e) {
|
|
IdFn(e) {
|
|
|
- this.list2 = e;
|
|
|
|
|
|
|
+ this.list[0] = e;
|
|
|
this.show2 = false;
|
|
this.show2 = false;
|
|
|
},
|
|
},
|
|
|
all() {
|
|
all() {
|
|
|
this.show2 = true;
|
|
this.show2 = true;
|
|
|
|
|
+ // if (this.listAll.length === 0) {
|
|
|
|
|
+ // this.empty = true;
|
|
|
|
|
+ // }
|
|
|
},
|
|
},
|
|
|
- // CoupFn(){
|
|
|
|
|
-
|
|
|
|
|
- // },
|
|
|
|
|
choose(info) {
|
|
choose(info) {
|
|
|
console.log(info);
|
|
console.log(info);
|
|
|
-
|
|
|
|
|
this.chooseId = info.id;
|
|
this.chooseId = info.id;
|
|
|
this.$store.commit('setCouponInfo', info);
|
|
this.$store.commit('setCouponInfo', info);
|
|
|
},
|
|
},
|
|
@@ -293,7 +299,6 @@ export default {
|
|
|
console.log(res);
|
|
console.log(res);
|
|
|
if (res.status === 'FINISH') {
|
|
if (res.status === 'FINISH') {
|
|
|
clearInterval(this.payTimeout);
|
|
clearInterval(this.payTimeout);
|
|
|
- // this.status = res.status;
|
|
|
|
|
this.show = false;
|
|
this.show = false;
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
this.init2();
|
|
this.init2();
|
|
@@ -322,7 +327,6 @@ export default {
|
|
|
this.$http
|
|
this.$http
|
|
|
.post(url)
|
|
.post(url)
|
|
|
.then(res => {
|
|
.then(res => {
|
|
|
- // console.log(res)
|
|
|
|
|
if (this.money) {
|
|
if (this.money) {
|
|
|
// 没有代金券
|
|
// 没有代金券
|
|
|
this.initTime(res.id, res.createdAt);
|
|
this.initTime(res.id, res.createdAt);
|
|
@@ -401,10 +405,15 @@ export default {
|
|
|
}
|
|
}
|
|
|
.border {
|
|
.border {
|
|
|
height: 1px;
|
|
height: 1px;
|
|
|
-
|
|
|
|
|
background: #f2f3f5;
|
|
background: #f2f3f5;
|
|
|
border-radius: 1px;
|
|
border-radius: 1px;
|
|
|
}
|
|
}
|
|
|
|
|
+/deep/ .el-empty {
|
|
|
|
|
+ width: 100px;
|
|
|
|
|
+ height: 100px;
|
|
|
|
|
+ margin: 0 auto;
|
|
|
|
|
+ padding: 50px 0 100px 0px;
|
|
|
|
|
+}
|
|
|
.title1 {
|
|
.title1 {
|
|
|
font-size: 16px;
|
|
font-size: 16px;
|
|
|
font-weight: 400;
|
|
font-weight: 400;
|