2024-06-26 17:29:23 +08:00
|
|
|
<template>
|
2024-06-27 20:04:31 +08:00
|
|
|
<view class="page-content">
|
2024-06-26 17:29:23 +08:00
|
|
|
<!-- <view class="flex align-center justify-between you-nav">
|
|
|
|
<view v-for="(item,index) in tab" :key="index" class="text-center box"
|
|
|
|
:class="tabIndex == index?'tanColor':''" @click="bindTab(item.state)">
|
|
|
|
<view style="z-index: 9;">{{item.name}}</view>
|
|
|
|
<view class="" :class="tabIndex == index?'line':''"></view>
|
|
|
|
</view>
|
2024-06-28 17:43:02 +08:00
|
|
|
</view>
|
|
|
|
<view @tap="queding()" class="ticket-button">确定</view>-->
|
2024-06-26 17:29:23 +08:00
|
|
|
<checkbox-group @change="checkboxChange">
|
2024-06-27 21:51:20 +08:00
|
|
|
<view class="youhui-weiyong youhui-list" v-if="priceDd>=item.minMoney" v-for="(item,index) in hongbao" :key="index">
|
2024-06-26 17:29:23 +08:00
|
|
|
<view class="youhui-view-left">
|
|
|
|
<view class="youhui-view-left-yuan">
|
|
|
|
<span class="youhui-view-left-num">{{item.money}}</span>
|
|
|
|
<span class="youhui-view-left-text">元</span>
|
|
|
|
</view>
|
|
|
|
<view class="youhui-view-left-bottom">
|
|
|
|
满{{item.minMoney}}元可用
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="youhui-view-right">
|
|
|
|
<view class="youhui-view-right-top">
|
|
|
|
<view class="youhui-view-right-title">{{item.couponName}}</view>
|
2024-06-27 20:04:31 +08:00
|
|
|
<view class="time-money" style="margin-top: 10px;">
|
|
|
|
<view class="youhui-view-right-time">{{item.createTime.substring(0,10)}} ~ </view>
|
|
|
|
<view class="youhui-view-right-time" style="margin-left: 3px;"> {{item.expirationTime.substring(0,10)}}</view>
|
|
|
|
</view>
|
2024-06-26 17:29:23 +08:00
|
|
|
</view>
|
|
|
|
<label class="tui-radio">
|
2024-06-27 20:02:52 +08:00
|
|
|
<checkbox activeBackgroundColor="#029d88" color="#029d88" :value="item.id.toString()" :checked="checkbox"/>
|
2024-06-26 17:29:23 +08:00
|
|
|
</label>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</checkbox-group>
|
2024-06-27 20:04:31 +08:00
|
|
|
<view @tap="queding()" class="queding">
|
|
|
|
<span class="que-btn">确定</span>
|
|
|
|
</view>
|
2024-06-26 17:29:23 +08:00
|
|
|
<empty v-if="hongbao.length==0"></empty>
|
|
|
|
</view>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import empty from '@/components/empty.vue'
|
|
|
|
export default {
|
|
|
|
components:{
|
|
|
|
empty
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
checkbox:false,
|
|
|
|
tab: [{
|
|
|
|
name: '可使用',
|
|
|
|
state: 0
|
|
|
|
}, {
|
|
|
|
name: '已使用',
|
|
|
|
state: 1
|
|
|
|
}, {
|
|
|
|
name: '已失效',
|
|
|
|
state: 2
|
|
|
|
}],
|
|
|
|
tabIndex: 0,
|
|
|
|
hongbao: [],
|
|
|
|
page: 1,
|
|
|
|
size: 10,
|
|
|
|
loadingType: 0,
|
|
|
|
scrollTop: false,
|
|
|
|
contentText: {
|
|
|
|
contentdown: '上拉显示更多',
|
|
|
|
contentrefresh: '正在加载...',
|
|
|
|
contentnomore: '没有更多数据了'
|
|
|
|
},
|
2024-06-27 20:04:31 +08:00
|
|
|
couponId:'',
|
2024-06-27 21:51:20 +08:00
|
|
|
content:'',
|
2024-06-30 09:49:59 +08:00
|
|
|
priceDd:'',
|
2024-06-26 17:29:23 +08:00
|
|
|
}
|
|
|
|
},
|
2024-06-27 20:04:31 +08:00
|
|
|
onLoad(e) {
|
|
|
|
if(e){
|
2024-06-27 21:51:20 +08:00
|
|
|
this.priceDd=e.price
|
2024-06-27 20:04:31 +08:00
|
|
|
this.content=e.text
|
|
|
|
}
|
2024-06-26 17:29:23 +08:00
|
|
|
this.getMyList();
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
queding(){
|
|
|
|
this.$queue.setData('youhui',this.couponId);
|
2024-06-30 09:49:59 +08:00
|
|
|
if(this.content=='套餐'){//返回推荐套餐订单
|
2024-06-27 20:04:31 +08:00
|
|
|
uni.navigateTo({
|
|
|
|
url:'/my/order/payModifyTc'
|
|
|
|
})
|
2024-06-30 09:49:59 +08:00
|
|
|
}else if(this.content=='支付'){
|
2024-06-27 20:04:31 +08:00
|
|
|
uni.navigateTo({//返回项目订单
|
|
|
|
url:'/my/order/payModify'
|
|
|
|
})
|
2024-06-30 09:49:59 +08:00
|
|
|
}else if(this.content=='修改'){
|
|
|
|
uni.navigateTo({//返回项目订单
|
|
|
|
url:'/my/order/payModifyDzhifu'
|
|
|
|
})
|
2024-06-27 20:04:31 +08:00
|
|
|
}
|
|
|
|
|
2024-06-26 17:29:23 +08:00
|
|
|
},
|
|
|
|
checkboxChange(e){
|
|
|
|
this.couponId=e.detail.value.join(",")
|
|
|
|
},
|
|
|
|
shiYong(){
|
|
|
|
uni.switchTab({
|
|
|
|
url:'/pages/index/index'
|
|
|
|
})
|
|
|
|
},
|
|
|
|
getMyList() {
|
|
|
|
this.loadingType = 1;
|
|
|
|
uni.showLoading({
|
|
|
|
title: '加载中...'
|
|
|
|
});
|
2024-06-27 20:04:31 +08:00
|
|
|
var data={
|
|
|
|
page:this.page,
|
|
|
|
limit:this.size,
|
|
|
|
status:this.tabIndex,
|
|
|
|
minMoney:this.$queue.getData('minMoney')
|
|
|
|
}
|
|
|
|
this.$Request.getT('/app/coupon/selectUserCouponList',data).then(res => {
|
2024-06-26 17:29:23 +08:00
|
|
|
if (res.code == 0) {
|
|
|
|
if (this.page == 1) {
|
|
|
|
this.hongbao = [];
|
|
|
|
}
|
2024-06-27 20:04:31 +08:00
|
|
|
this.hongbao=res.data.list
|
2024-06-26 17:29:23 +08:00
|
|
|
if (res.data.list.length === this.size) {
|
|
|
|
this.loadingType = 0;
|
|
|
|
} else {
|
|
|
|
this.loadingType = 3;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
this.loadingType = 2;
|
|
|
|
}
|
|
|
|
uni.hideLoading();
|
|
|
|
});
|
|
|
|
},
|
|
|
|
bindTab(index) {
|
|
|
|
this.tabIndex = index
|
|
|
|
this.hongbao = [];
|
|
|
|
this.page = 1;
|
|
|
|
this.getMyList();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
onPageScroll: function(e) {
|
|
|
|
this.scrollTop = e.scrollTop > 200;
|
|
|
|
},
|
|
|
|
onReachBottom: function() {
|
|
|
|
this.page = this.page + 1;
|
|
|
|
this.getMyList('');
|
|
|
|
},
|
|
|
|
onPullDownRefresh: function() {
|
|
|
|
this.page = 1;
|
|
|
|
this.getMyList('Refresh');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
2024-06-27 20:04:31 +08:00
|
|
|
/deep/.page-box{
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
.page-content{
|
|
|
|
width:100%;
|
|
|
|
position: relative;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
align-items: center;
|
|
|
|
}
|
|
|
|
.que-btn{
|
|
|
|
display: inline-block;
|
|
|
|
width: 90%;
|
|
|
|
text-align: center;
|
|
|
|
background: linear-gradient(90deg, #019C88, #28BA92, #35C495);
|
2024-06-28 17:43:02 +08:00
|
|
|
height: 80rpx;
|
2024-06-27 20:04:31 +08:00
|
|
|
border-radius: 28px;
|
|
|
|
color: #ffffff;
|
2024-06-28 17:43:02 +08:00
|
|
|
line-height: 80rpx;
|
|
|
|
margin-top: 10rpx;
|
2024-06-27 20:04:31 +08:00
|
|
|
}
|
|
|
|
.queding{
|
2024-06-28 17:43:02 +08:00
|
|
|
width: 100%;
|
|
|
|
height:100rpx;
|
2024-06-27 20:04:31 +08:00
|
|
|
background-color: #fff;
|
|
|
|
position: fixed;
|
|
|
|
bottom: 0px;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
align-items: center;
|
2024-06-28 17:43:02 +08:00
|
|
|
}
|
2024-06-27 20:04:31 +08:00
|
|
|
.time-money{
|
|
|
|
width: 100%;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
align-items: center;
|
|
|
|
}
|
2024-06-26 17:29:23 +08:00
|
|
|
/deep/uni-checkbox .uni-checkbox-input{
|
|
|
|
border-radius: 50%;
|
|
|
|
}
|
2024-06-27 20:02:52 +08:00
|
|
|
.ticket-button{
|
|
|
|
display: flex;
|
|
|
|
width: 130rpx;
|
|
|
|
grid-gap:8rpx;
|
|
|
|
gap:8px;
|
|
|
|
align-items: center;
|
|
|
|
justify-content:center;
|
|
|
|
background: #029d88;
|
|
|
|
color: #fff;
|
|
|
|
height:60rpx;
|
|
|
|
border-radius: 30rpx;
|
|
|
|
margin: 15rpx;
|
|
|
|
}
|
2024-06-26 17:29:23 +08:00
|
|
|
.checkbox-data{
|
|
|
|
padding: 0px 11px;
|
|
|
|
margin: 15px 0px;
|
|
|
|
}
|
|
|
|
.youhui-img{
|
|
|
|
width: 111.81rpx;
|
|
|
|
height: 111.81rpx;
|
|
|
|
}
|
|
|
|
.youhui-view-right-btn{
|
|
|
|
width: 158rpx;
|
|
|
|
height: 64rpx;
|
|
|
|
background: linear-gradient(-90deg, #019C88, #2DC48E);
|
|
|
|
border-radius: 32rpx;
|
|
|
|
text-align: center;
|
|
|
|
line-height: 64rpx;
|
|
|
|
font-weight: 400;
|
|
|
|
font-size: 28rpx;
|
|
|
|
color: #FFFFFF;
|
|
|
|
text-shadow: 0rpx 2rpx 4rpx rgba(0,119,104,0.44);
|
|
|
|
margin-left: 10px;
|
|
|
|
}
|
|
|
|
.youhui-view-right-time{
|
|
|
|
font-weight: 400;
|
|
|
|
font-size: 22rpx;
|
|
|
|
color: #999999;
|
|
|
|
}
|
|
|
|
.youhui-view-right-title{
|
|
|
|
font-weight: 400;
|
|
|
|
font-size: 32rpx;
|
|
|
|
color: #333333;
|
|
|
|
}
|
|
|
|
.youhui-view-right-top{
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
align-items: center;
|
|
|
|
}
|
|
|
|
.youhui-view-right{
|
|
|
|
width: 502.08rpx;
|
|
|
|
height: 100%;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: space-around;
|
|
|
|
}
|
|
|
|
.youhui-view-left-bottom{
|
|
|
|
font-weight: 400;
|
|
|
|
font-size: 22rpx;
|
|
|
|
color: #FFFFFF;
|
|
|
|
}
|
|
|
|
.youhui-view-left-yuan{
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
align-items: baseline;
|
|
|
|
color: #FFFFFF;
|
|
|
|
}
|
|
|
|
.youhui-view-left-num{
|
|
|
|
font-weight: bold;
|
|
|
|
font-size: 89rpx;
|
|
|
|
}
|
|
|
|
.youhui-view-left-text{
|
|
|
|
font-weight: bold;
|
|
|
|
font-size:24.31rpx;
|
|
|
|
}
|
|
|
|
.youhui-view-left{
|
|
|
|
width: 199rpx;
|
|
|
|
height: 242rpx;
|
|
|
|
display: flex;
|
|
|
|
flex-direction:column;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
}
|
|
|
|
.youhui-yiyong{
|
|
|
|
background-image: url('../../static/youhuijuan/coupons7.png');
|
|
|
|
}
|
|
|
|
.youhui-weiyong{
|
|
|
|
background-image: url('../../static/youhuijuan/coupons1.png');
|
|
|
|
}
|
|
|
|
.youhui-list{
|
|
|
|
width: 95%;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
height: 242rpx;
|
|
|
|
border-radius: 21rpx;
|
|
|
|
background-size: 100%;
|
2024-06-27 20:02:52 +08:00
|
|
|
margin: 6px auto;
|
2024-06-26 17:29:23 +08:00
|
|
|
justify-content: space-between;
|
|
|
|
}
|
|
|
|
.you-nav{
|
|
|
|
background: #FFFFFF;
|
|
|
|
padding: 14px 25px 0px 25px;
|
|
|
|
}
|
|
|
|
page {
|
|
|
|
background: #F5F5F5;
|
|
|
|
}
|
|
|
|
|
|
|
|
.bg {
|
|
|
|
background: #FFFFFF;
|
|
|
|
}
|
|
|
|
|
|
|
|
.box {
|
|
|
|
width: 128upx;
|
|
|
|
height: 60upx;
|
|
|
|
color: #666;
|
|
|
|
text-align: center;
|
|
|
|
font-weight: bold;
|
|
|
|
font-size: 34rpx;
|
|
|
|
z-index: 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
.line {
|
|
|
|
width: 48px;
|
|
|
|
height: 14rpx;
|
|
|
|
background: linear-gradient(-48deg, #019C88, #2DC48E);
|
|
|
|
border-radius: 7rpx;
|
|
|
|
opacity: 0.35;
|
|
|
|
position: relative;
|
|
|
|
top: -7px;
|
|
|
|
z-index: -1;
|
|
|
|
left: 50%;
|
|
|
|
transform: translateX(-50%);
|
|
|
|
}
|
|
|
|
|
|
|
|
.tanColor {
|
|
|
|
color: #019C88;
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
|
|
|
|
.btn {
|
|
|
|
width: 140upx;
|
|
|
|
height: 55upx;
|
|
|
|
border: 2upx solid #FF130A;
|
|
|
|
border-radius: 30upx;
|
|
|
|
text-align: center;
|
|
|
|
line-height: 55upx;
|
|
|
|
color: #FF130A;
|
|
|
|
font-size: 24upx;
|
|
|
|
}
|
|
|
|
</style>
|