This commit is contained in:
GaoHao 2024-10-31 09:31:44 +08:00
commit fef46aa24f
1 changed files with 87 additions and 78 deletions

View File

@ -1,83 +1,86 @@
<template>
<!-- 顶部菜单 -->
<view class="tagClass">
<view class="tag-item" @tap="tagClick(item)" :class="{active:item.type===pageData.query.type}"
v-for="(item,index) in pageData.status.list" :key="index">
{{item.name}}
</view>
</view>
<!-- 搜搜 -->
<!-- <view class="search">
<up-input
placeholder="搜索优惠券名称"
prefixIcon="search"
shape="circle"
border="none"
fontSize="14px"
prefixIconStyle="font-size: 28px;color: #999;"
:customStyle="{backgroundColor:'#F9F9F9',padding: '10rpx 18rpx'}"
></up-input>
<view class="searchBtn">
搜索
</view>
</view> -->
<!-- 内容 -->
<view class="couponContentList">
<view class="couponContent" v-for="(item,index) in pageData.couponList" :key="index">
<view class="container">
<!-- 顶部菜单 -->
<view class="tagClass">
<view class="tag-item" @tap="tagClick(item)" :class="{active:item.type===pageData.query.type}"
v-for="(item,index) in pageData.status.list" :key="index">
{{item.name}}
</view>
</view>
<!-- 搜搜 -->
<!-- <view class="search">
<up-input
placeholder="搜索优惠券名称"
prefixIcon="search"
shape="circle"
border="none"
fontSize="14px"
prefixIconStyle="font-size: 28px;color: #999;"
:customStyle="{backgroundColor:'#F9F9F9',padding: '10rpx 18rpx'}"
></up-input>
<view class="searchBtn">
搜索
</view>
</view> -->
<!-- 内容 -->
<view class="couponContentList">
<view class="couponContent" v-for="(item,index) in pageData.couponList" :key="index">
<view class="couponContentListTop">
<view class="title"> {{ item.title }} </view>
<view> ID:{{item.id}} </view>
</view>
<view class="couponContentListcontent">
<view>
<view> 使用门槛 </view>
<view v-if="item.type == 1"> {{ item.fullAmount }} 元减 {{ item.discountAmount }} </view>
<view v-if="item.type == 2"> {{ item.fullAmount }} 元可用 </view>
</view>
<view>
<view> 领取方式 </view>
<view> 用户不可自行领取 </view>
</view>
<view v-if="item.type == 1">
<view> 有效期 </view>
<view> 领券后{{ item.validDays }}天过期 </view>
</view>
<view class="JQclass">
<image :src="'/static/coupon/qrcode.svg'" mode="scaleToFill" />
</view>
</view>
<view class="couponContentListcontent2">
<view class="">
<view class="num"> {{ item.number }} </view>
<view class="lable"> 发放数量 </view>
</view>
<view class="">
<view class="num"> {{ item.number-item.leftNumber }} </view>
<view class="lable"> 已领取 </view>
</view>
<view class="">
<view class="num"> {{ item.leftNumber }} </view>
<view class="lable"> 剩余 </view>
</view>
<view class="">
<view class="num"> {{ item.useNumber }} </view>
<view class="lable"> 已使用 </view>
</view>
</view>
<view class="couponContentListbottom">
<button @tap="editCoupon(item)">编辑</button>
<button @tap="delCoupon(item)">删除</button>
</view>
</view>
<template v-if="pageData.couponList.length">
<my-pagination :page="pageData.query.page" :totalElements="pageData.totalElements" :size="pageData.query.size"
@change="pageChange"></my-pagination>
</template>
</view>
<view class="couponContentListTop">
<view class="title"> {{ item.title }} </view>
<view> ID:{{item.id}} </view>
<view class="bottomPop">
<button @click="addCoupon">+添加{{pageData.status.tagName}}</button>
</view>
<view class="couponContentListcontent">
<view>
<view> 使用门槛 </view>
<view> {{ item.fullAmount }} 元减 {{ item.discountAmount }} </view>
</view>
<view>
<view> 领取方式 </view>
<view> 用户不可自行领取 </view>
</view>
<view>
<view> 有效期 </view>
<view> 领券后{{ item.validDays }}天过期 </view>
</view>
<view class="JQclass">
<image :src="'/static/coupon/qrcode.svg'" mode="scaleToFill" />
</view>
</view>
<view class="couponContentListcontent2">
<view class="">
<view class="num"> {{ item.number }} </view>
<view class="lable"> 发放数量 </view>
</view>
<view class="">
<view class="num"> {{ item.number-item.leftNumber }} </view>
<view class="lable"> 已领取 </view>
</view>
<view class="">
<view class="num"> {{ item.leftNumber }} </view>
<view class="lable"> 剩余 </view>
</view>
<view class="">
<view class="num"> {{ item.useNumber }} </view>
<view class="lable"> 已使用 </view>
</view>
</view>
<view class="couponContentListbottom">
<button @tap="editCoupon(item)">编辑</button>
<button @tap="delCoupon(item)">删除</button>
</view>
</view>
<template v-if="pageData.couponList.length">
<my-pagination :page="pageData.query.page" :totalElements="pageData.totalElements" :size="pageData.query.size"
@change="pageChange"></my-pagination>
</template>
</view>
<view class="bottomPop">
<button @click="addCoupon">+添加{{pageData.status.tagName}}</button>
</view>
</template>
@ -182,6 +185,9 @@
body{
background-color: #f9f9f9;
}
.container{
position: relative;
}
.tagClass {
width: 100%;
white-space: nowrap;
@ -190,6 +196,9 @@
padding-top: 44rpx;
padding: 32rpx 28rpx;
background-color: #fff;
position: fixed;
top: 79rpx;
z-index: 999;
.tag-item {
display: inline-block;
padding: 10rpx 24rpx;
@ -244,7 +253,7 @@
/* height: 544rpx; */
margin: 32rpx auto 0;
margin-bottom: 32rpx;
padding: 0 28rpx 182rpx 28rpx;
padding: 122rpx 28rpx 182rpx 28rpx;
}
.couponContent {
/* background-color: #f9f9f9; */