2024-08-16 18:26:19 +08:00
|
|
|
|
<template>
|
|
|
|
|
<view class="content">
|
|
|
|
|
<view class="container">
|
|
|
|
|
<view class="my-header">
|
|
|
|
|
<view class="my-icons" @click="goback"> <uni-icons type="left" size="16"></uni-icons> </view>
|
2024-09-24 16:30:49 +08:00
|
|
|
|
<view class="my-text">我的优惠券</view>
|
2024-08-16 18:26:19 +08:00
|
|
|
|
<view class="my-icons"></view>
|
|
|
|
|
</view>
|
|
|
|
|
<!-- 顶部区域 -->
|
2024-09-24 15:10:14 +08:00
|
|
|
|
<!-- <view class="ba-box">
|
2024-08-16 18:26:19 +08:00
|
|
|
|
<u-tabs :list="list1" @click="click"></u-tabs>
|
2024-09-24 15:10:14 +08:00
|
|
|
|
</view> -->
|
2024-08-16 18:26:19 +08:00
|
|
|
|
<view class="box-bb">
|
|
|
|
|
<view class="box-ll" :class="{ 'lan' : tabindex == index }" v-for="(item,index) in tapList" :key="index"
|
|
|
|
|
@click="gettabingex(index)">
|
|
|
|
|
<view class="">{{item.name}}</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
2024-09-24 16:49:13 +08:00
|
|
|
|
<view class="card-box" v-for="(item,index) in cardsList" :key="index"
|
|
|
|
|
:style="'background: url('+item.bgImg+') no-repeat;background-size: 100% 100%; '"
|
|
|
|
|
@click="goRecharge(item.id,item.cardRecordId)">
|
|
|
|
|
<view style="width: 20%;"></view>
|
2024-08-16 18:26:19 +08:00
|
|
|
|
<view class="right-box">
|
|
|
|
|
<view class="title">{{item.couponName}}</view>
|
2024-09-24 16:49:13 +08:00
|
|
|
|
<view class="hui-size">{{item.useCondition}}</view>
|
2024-08-16 18:26:19 +08:00
|
|
|
|
<view class="dis-bt">
|
2024-09-24 16:49:13 +08:00
|
|
|
|
有效期:{{item.startTime}} ~ {{item.endTime}}
|
2024-08-16 18:26:19 +08:00
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<u-overlay :show="shows">
|
|
|
|
|
|
|
|
|
|
<view class="boxck">
|
|
|
|
|
<view class="coupbox" v-for="(item,index) in cardFavorableList" :key="index">
|
|
|
|
|
<view class="left_coup">¥{{item.discountAmount}}</view>
|
|
|
|
|
<view class="right_liu">
|
|
|
|
|
<view class="">
|
|
|
|
|
<view class="c_name">{{item.name}}</view>
|
|
|
|
|
<view class="c_time">2023/12/03</view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="_anniuprp" @click="drawDownCardFavorables()">立即领取</view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
</u-overlay>
|
|
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import request from "../../utils/request";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
idList: [],
|
|
|
|
|
cardFavorableList: [],
|
|
|
|
|
cardsList: [],
|
|
|
|
|
shows: false,
|
|
|
|
|
query: {
|
|
|
|
|
storeId: '',
|
2024-09-24 16:30:49 +08:00
|
|
|
|
status: 0,
|
|
|
|
|
page: 1,
|
2024-08-16 18:26:19 +08:00
|
|
|
|
pageSize: 10
|
|
|
|
|
},
|
|
|
|
|
title: '',
|
|
|
|
|
tabindex: 0,
|
|
|
|
|
tapList: [{
|
|
|
|
|
name: "未使用"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "已使用"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "已失效"
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
list1: [{
|
|
|
|
|
name: '全部',
|
|
|
|
|
}, {
|
|
|
|
|
name: '优惠券',
|
|
|
|
|
}, {
|
|
|
|
|
name: '兑换券'
|
|
|
|
|
}, {
|
|
|
|
|
name: '洗车券'
|
|
|
|
|
}]
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
components: {
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
onLoad() {
|
|
|
|
|
this.query.storeId = uni.getStorageSync("storeId")
|
|
|
|
|
this.getGiftRecords()
|
|
|
|
|
},
|
|
|
|
|
onShow() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
console.log(this.query);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
|
getAllCardFavorables() {
|
|
|
|
|
request({
|
|
|
|
|
url: 'business/marketingActivity/cardFavorable/appletList',
|
|
|
|
|
method: 'get',
|
|
|
|
|
params: this.query
|
|
|
|
|
}).then(res => {
|
|
|
|
|
if (res.code == 200) {
|
|
|
|
|
this.cardFavorableList = res.data.records;
|
|
|
|
|
if (this.cardFavorableList.length == 0) {
|
|
|
|
|
this.shows = false
|
|
|
|
|
}
|
|
|
|
|
// console.log("555" + this.cardFavorableList)
|
|
|
|
|
for (var i = 0; i < res.data.records.length; i++) {
|
|
|
|
|
this.idList.push(res.data.records[i].id)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* this.cardFavorableList.forEach(item => this.idList.push(item.id));
|
|
|
|
|
console.log("333" + idList) */
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
drawDownCardFavorables() {
|
|
|
|
|
request({
|
|
|
|
|
url: 'business/marketingActivity/cardFavorableRecord/drawDown',
|
|
|
|
|
method: 'post',
|
|
|
|
|
data: {
|
|
|
|
|
idList: this.idList
|
|
|
|
|
}
|
|
|
|
|
}).then(res => {
|
|
|
|
|
console.log("222" + res)
|
|
|
|
|
if (res.code == 200 && res.data == true) {
|
|
|
|
|
this.shows = false
|
|
|
|
|
this.getGiftRecords()
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: '领取成功!'
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
this.shows = false
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: '领取失败!'
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
isDrawDown() {
|
|
|
|
|
request({
|
|
|
|
|
url: 'business/marketingActivity/cardFavorableRecord/isDrawDown',
|
|
|
|
|
method: 'get',
|
|
|
|
|
params: this.query
|
|
|
|
|
}).then(res => {
|
|
|
|
|
|
|
|
|
|
if (res.code == 200 && res.data == true) {
|
|
|
|
|
this.shows = true
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
this.shows = false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
goRecharge(id, cardRecordId) {
|
|
|
|
|
uni.navigateTo({
|
|
|
|
|
url: '/pages/refuel/refuel?id=0&cardFavorableId=' + id +
|
|
|
|
|
'&cardRecordId=' +
|
|
|
|
|
cardRecordId
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
click(item) {
|
|
|
|
|
console.log('item', item);
|
|
|
|
|
|
|
|
|
|
this.cardsList = []
|
|
|
|
|
if (item.name == "全部") {
|
|
|
|
|
this.query.couponType = ''
|
|
|
|
|
this.getGiftRecords()
|
|
|
|
|
} else {
|
|
|
|
|
this.query.couponType = item.name
|
|
|
|
|
console.log(this.query.couponType);
|
|
|
|
|
this.getGiftRecords()
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
gettabingex(index) {
|
|
|
|
|
// useStatus
|
|
|
|
|
this.tabindex = index
|
|
|
|
|
console.log(index);
|
|
|
|
|
this.cardsList = []
|
|
|
|
|
this.query.useStatus = index
|
|
|
|
|
this.getGiftRecords()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
/* onCoupons() {
|
|
|
|
|
this.shows = false
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: '领取成功'
|
|
|
|
|
})
|
|
|
|
|
}, */
|
|
|
|
|
goback() {
|
|
|
|
|
uni.navigateBack()
|
|
|
|
|
},
|
|
|
|
|
getGiftRecords() {
|
|
|
|
|
request({
|
2024-09-24 16:30:49 +08:00
|
|
|
|
url: 'cardCouponUser/queryPage',
|
2024-08-16 18:26:19 +08:00
|
|
|
|
method: 'get',
|
|
|
|
|
params: this.query
|
|
|
|
|
}).then(res => {
|
|
|
|
|
if (res.code == 200) {
|
|
|
|
|
this.cardsList = res.data.records
|
|
|
|
|
}
|
2024-09-24 16:30:49 +08:00
|
|
|
|
console.log(res.data, this.cardsList, 226);
|
2024-08-16 18:26:19 +08:00
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
.content {
|
2024-09-24 15:10:14 +08:00
|
|
|
|
background: #fff;
|
2024-08-16 18:26:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.container {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100vh;
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
padding-top: 88px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.my-header {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 88px;
|
|
|
|
|
background: #ffffff;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
color: #000;
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
padding: 0px 15px;
|
|
|
|
|
padding-top: 40px;
|
|
|
|
|
|
|
|
|
|
.my-icons {
|
|
|
|
|
width: 20px;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
position: fixed;
|
|
|
|
|
top: 0px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.card-box {
|
|
|
|
|
width: 95%;
|
|
|
|
|
background: #ffffff;
|
2024-09-24 16:49:13 +08:00
|
|
|
|
height: 90px;
|
2024-08-16 18:26:19 +08:00
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
padding: 15px;
|
2024-09-24 16:49:13 +08:00
|
|
|
|
|
2024-08-16 18:26:19 +08:00
|
|
|
|
margin: 10px auto;
|
|
|
|
|
display: flex;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.right-box {
|
|
|
|
|
width: 80%;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.left-img {
|
|
|
|
|
width: 70px;
|
|
|
|
|
height: 70px;
|
|
|
|
|
background: url('http://47.95.206.185:83/hbao.png')center no-repeat;
|
|
|
|
|
background-size: 100% 100%;
|
|
|
|
|
margin-right: 10px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.dis-bt {
|
2024-09-24 16:49:13 +08:00
|
|
|
|
font-size: 12px;
|
|
|
|
|
color: #E02020;
|
2024-08-16 18:26:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.hui-size {
|
2024-09-24 16:49:13 +08:00
|
|
|
|
font-size: 12px;
|
2024-08-16 18:26:19 +08:00
|
|
|
|
color: #999999;
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
overflow: hidden;
|
2024-09-24 16:49:13 +08:00
|
|
|
|
margin: 5px 0;
|
2024-08-16 18:26:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.title {
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
color: #333333;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.anniu {
|
|
|
|
|
width: 64px;
|
|
|
|
|
height: 24px;
|
|
|
|
|
background: linear-gradient(90deg, #FC3E33 0%, #FF6B40 100%);
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
border-radius: 50px;
|
|
|
|
|
color: #ffffff;
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.huiz {
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
margin: 12px 0px;
|
|
|
|
|
text-align: center;
|
|
|
|
|
color: #8F5624;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.hui-icon {
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
|
|
|
|
image {
|
|
|
|
|
width: 34px;
|
|
|
|
|
height: 26px;
|
|
|
|
|
margin: 6px 0px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.cbai {
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
color: #ffffff;
|
|
|
|
|
text-align: center;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.ba-box {
|
|
|
|
|
background: #ffffff;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.box-bb {
|
|
|
|
|
width: 100%;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
2024-09-24 15:10:14 +08:00
|
|
|
|
justify-content: space-between;
|
2024-08-16 18:26:19 +08:00
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
background-color: #ffffff;
|
|
|
|
|
padding: 10px 15px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.box-ll {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
color: #8d8f8f;
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
padding: 4px 10px;
|
|
|
|
|
margin-right: 15px;
|
2024-09-24 15:10:14 +08:00
|
|
|
|
border-bottom: 1px solid transparent;
|
2024-08-16 18:26:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.lan {
|
2024-09-24 15:10:14 +08:00
|
|
|
|
color: #FA6400;
|
|
|
|
|
border-bottom: 1px solid #FA6400 !important;
|
2024-08-16 18:26:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.boxck {
|
|
|
|
|
width: 280px;
|
|
|
|
|
height: 350px;
|
|
|
|
|
margin: 20px auto;
|
|
|
|
|
margin-top: 200px;
|
|
|
|
|
background: url('http://47.95.206.185:83/yhqbj.png')center no-repeat;
|
|
|
|
|
background-size: 100% 100%;
|
|
|
|
|
position: relative;
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
padding: 5px 32px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
._anniuprp {
|
|
|
|
|
width: 172px;
|
|
|
|
|
height: 36px;
|
|
|
|
|
background: linear-gradient(90deg, #FFF4CB 0%, #FDDC66 100%);
|
|
|
|
|
border-radius: 18px 18px;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
position: absolute;
|
|
|
|
|
bottom: 20px;
|
|
|
|
|
left: 50%;
|
|
|
|
|
transform: translate(-50%, -50%);
|
|
|
|
|
color: #E11E27;
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.coupbox {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 60px;
|
|
|
|
|
background: url('http://47.95.206.185:83/yhtz.png')center no-repeat;
|
|
|
|
|
background-size: 100% 100%;
|
|
|
|
|
margin: 10px auto;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.left_coup {
|
|
|
|
|
width: 35%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
color: #FF4747;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.right_liu {
|
|
|
|
|
width: 65%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
text-align: center;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.c_time {
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
color: #999999;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.c_name {
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
color: #7D592C;
|
|
|
|
|
}
|
|
|
|
|
</style>
|