增加新版我的优惠券

This commit is contained in:
gyq 2025-09-22 10:38:16 +08:00
parent c7e4e5e26b
commit 7a071eb9f7
3 changed files with 1056 additions and 459 deletions

View File

@ -1,492 +1,341 @@
<template>
<view class="container">
<view class="towcontent">
<view class="towcontentlistxitem flex-start">
<view class="towcontentlistxitembox flex-colum" v-for="(item,index) in tabList" :key="index"
@click="towcontentclick(item)"
:class="fromInfo.tabIndex == item.status?'towcontentlistxitemboxopacity':''">
<text class="title">{{item.name}}</text>
<image v-if="fromInfo.tabIndex == item.status"
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/today/dg.png" mode="widthFix">
</image>
<view class="header-wrap">
<view class="search-wrap">
<view class="input-wrap">
<view class="icon left">
<u-icon name="search" size="26"></u-icon>
</view>
<input v-model="querForm.searchValue" class="ipt left" type="text" placeholder="搜索" />
</view>
<view class="input-wrap" @click="show = true">
<view class="icon right">
<u-icon name="arrow-right" size="16"></u-icon>
</view>
<input v-model="querForm.shopId" class="ipt right" type="text" placeholder="请选择" disabled />
</view>
</view>
<view class="status-wrap">
<view
class="item"
:class="{ active: querForm.statusActiveIndex == index }"
v-for="(item, index) in statusList"
:key="item.value"
@click="querForm.statusActiveIndex = index"
>
<text class="t">{{ item.label }}</text>
</view>
<view class="icon-wrap" :style="{ width: `${100 / statusList.length}%`, left: `${(100 / statusList.length) * querForm.statusActiveIndex}%` }">
<image
class="active-icon"
src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAMCAYAAAB4MH11AAACKUlEQVR4AaRTS2sTURT+MpkxUzNtRpuYpBsrqbgQH6BYRHGllloQN+5cuNeV6MKfoj9BwYUgIsXHRqE+SluliFLbBqmENJNMMpMm87qecw1NglJse+HMPeee833nce8oIgpFq7wsGt/fCb9eFrtdfmNd1L+9Jc4Vog6E4jcqqM0/R+3zNOwv09jtshdfSx7mDJwKqAMfIvAAEaFVWkLgWjvOEbVdtNa+Epf4wxmFUNTkfqiDGUkqogDu8icKiKS9nQ9jnR8fqM5AwuJJE/G9JhRF05E8dAqIKeDlrsyiWVxg9f+Fum+uzsFZmtnEGIVxKHsGIFn1bAF6ZlQ6I28D9uIrmYSrkodbfETgw6GubZo9Yzk0kR4Fc7IuE8QUFebJKSTSB/kM4UYd1scnKL18QInm4Vk/6W6qiNoOwpZDuoX2elFWXHrzELW5Z+RzJVbPHca+09doIKq0ZQLW+C44iWbm2ZQSNMqozj5F5f1jWCSVGd4fwerstYUXCOplGcsfxponJqHS7Nlm2UyAWAza0AFkzt1A6uhFqEYaoHsR9BLCpg2vukZVr5IU4dV+yU7oRikkTrHDMI9PIHPhJrhQ9Kxugs6hkkhi8Mh5DI9flyCep6ImOt7uxnF6dgypYxMy1hg7S0/yH3FdSL+mpbIw6CVwVSNX7yM/eQfZS7eQu3wb+St3MTJ1D2nq1iicgZbK9YN7rL866PH1qfGBIWj0v/Do4rrR59vK+A0AAP//GfTndQAAAAZJREFUAwCu+SjIaSGpLwAAAABJRU5ErkJggg=="
></image>
</view>
</view>
</view>
<view class="containertop">
<view class="containertopbox">
<view class="containertopboxitem flex-start" v-for="(item,index) in fromInfo.list" :key="index">
<view class="containertopboxitemleft flex-colum"
:class="{'containertopboxitemleft_vip': item.type == 2,'containertopboxitemlefts': fromInfo.status == 0}">
<view class="containertopboxitemleft_one"
:class="fromInfo.status != 0?'':'containertopboxitemleft_ones'">
<block v-if="item.type == 2">
<text>1</text>
<text style="font-size: 28rpx;margin-left: 6rpx;"></text>
</block>
<block v-else>
<text style="font-size: 28rpx;margin-right: 6rpx;"></text>
<text>{{item.discountAmount || 0}}</text>
</block>
<view class="list-wrap">
<view class="item" v-for="item in list.data" :key="item.id">
<view class="top">
<view class="icon"></view>
<view class="info">
<view class="view name">
<text class="t">{{ item.title }}</text>
</view>
<view class="containertopboxitemleft_tow" :class="{
'containertopboxitemleft_tows': fromInfo.status == 0,
'containertopboxitemleft_nameVip': item.type == 2,
}">
{{ item.type == 2 ? item.name : '优惠券(元)'}}
<view class="view time">
<text class="t">有效期至{{ item.startTime }}-{{ item.endTime }}</text>
</view>
</view>
<view class="containertopboxitemright">
<view class="containertopboxitemright_one">
<view class="flex-start">
<image class="icon"
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/user/coupon_icon.png"
mode="aspectFill"></image>
<text class="title">{{ item.shopName }}</text>
</view>
<text>无门槛使用</text>
</view>
<view class="containertopboxitemright_tow">
<view> {{ item.type == 2 ? '会员商品券' : item.name}}</view>
<view @click="navigatorGo(item)"
:class="fromInfo.status == 0?'containertopboxitemright_four containertopboxitemright_btn':'containertopboxitemright_fours containertopboxitemright_btn'">
{{fromInfo.status == 0 ? '去使用':'已使用'}}
</view>
</view>
<view class="containertopboxitemright_there" v-if="item.type == 1 ">
有效期至{{$u.timeFormat(item.endTime, 'yyyy/mm/dd') || '0'}}
</view>
<view class="btn">
<text class="t">去使用</text>
</view>
</view>
<view v-if="fromInfo.list.length <= 0" style="text-align: center;">
<image style="width: 402rpx;height: 442rpx;margin:240rpx auto 32rpx;"
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/nomore.png" mode="aspectFill"></image>
<view class="btm">
<view class="left">
<text class="t">{{ item.remark }}</text>
</view>
<view class="right">
<text class="t">查看详情</text>
</view>
</view>
<up-loadmore :status="form.status" fontSize="14" color="#999" iconSize="14" />
</view>
</view>
<u-loadmore :status="list.status"></u-loadmore>
<u-popup :show="show" round="20" closeable @close="show = false">
<view class="shoplist-popup">
<view class="title">
<text class="t">店铺列表</text>
</view>
<scroll-view class="popup-list" direction="vertical">
<view class="item">
<text class="t">我是店铺1111</text>
</view>
<view class="item">
<text class="t">我是店铺2222</text>
</view>
<view class="item">
<text class="t">我是店铺3333</text>
</view>
<view class="item">
<text class="t">我是店铺4444</text>
</view>
<u-loadmore status="nomore"></u-loadmore>
</scroll-view>
</view>
</u-popup>
</view>
</template>
<script setup>
import {
ref,
reactive,
onMounted,
} from 'vue';
import {
onLoad,
onReady,
onShow,
onPageScroll,
onReachBottom
} from '@dcloudio/uni-app'
import {
APIcouponfindByUserId,
APIfindCoupon
} from '@/common/api/member.js'
import { ref, reactive, onMounted } from 'vue';
import { onLoad, onReady, onShow, onPageScroll, onReachBottom } from '@dcloudio/uni-app';
import { APIcouponfindByUserId, APIfindCoupon } from '@/common/api/member.js';
const tabList = [{
name: '未使用',
status: '0'
},
const show = ref(false);
const querForm = ref({
searchValue: '',
shopId: '',
statusActiveIndex: 0
});
//
const statusList = ref([
{
value: 1,
label: '未使用',
bg: '#333333',
color: '#ffffff'
},
{
value: 2,
label: '已使用',
bg: '#F8F8F8',
color: '#999999'
},
{
value: 3,
label: '已失效',
bg: '#F8F8F8',
color: '#999999'
}
]);
const list = reactive({
page: 1,
size: 10,
status: 'nomore',
data: [
{
name: '已使用',
status: '1'
},
{
name: '已过期',
status: '2'
id: 1,
type: 2,
fullAmount: 200,
discountAmount: 15,
title: '超值满减券',
startTime: '2002.1.22',
endTime: '2022.1.22',
remark: '1、可适用门店全部门店2、可适用商品部分商品3、可使用类型堂食4、可用时间段全时段可用5、限量规则每人限领3张每日可最多使用3张6、同享规则与限时折扣同享、与会员价同享7、其它说明这里是后台配置内容'
}
]
const fromInfo = reactive({
tabIndex: 0,
list: [],
status: 0,
shopId: null,
orderId: null,
couopnInfo: null,
shoppingCart: [],
productList: [],
})
const form = reactive({
page: 1,
size: 10,
status: 'loadmore',
})
//
const Orderinfo = reactive({
typeOrder: '',
shopUserId: "",
payAmount: "",
shoppingCart: [],
show: false
})
//
const init_fn = () => {
fromInfo.list = []
form.page = 1
form.size = 10
form.status = 'loadmore'
// navtabindex.value == '1' ? getorderList() : userorderList()
getCouponList()
}
const towcontentclick = (item) => {
fromInfo.tabIndex = item.status;
fromInfo.status = item.status;
fromInfo.list = [];
getCouponList()
}
// 使
const navigatorGo = (item) => {
uni.pro.switchTab('index/index')
}
const getCouponList = async () => {
let res = await APIcouponfindByUserId({
userId: uni.cache.get('userInfo').id,
status: fromInfo.status,
shopId: fromInfo.shopId ? fromInfo.shopId : uni.cache.get('shopId'),
page: form.page,
size: form.size,
})
if (!res) {
form.status = 'nomore'
fromInfo.list = []
return false
}
if (res.totalPage == 0 || res.totalPage == 1 && res.totalRow <= 10) {
form.status = 'nomore'
fromInfo.list = res.records
if (form.page == 1 && res.records.length == 0) {
fromInfo.list = []
}
return false;
} else {
form.status = 'loading';
if (form.page == 1) {
fromInfo.list = res.records
} else {
fromInfo.list = [...fromInfo.list, ...res.records];
}
form.page = ++form.page;
if (form.page > res.totalPage) {
form.status = 'nomore';
} else {
form.status = 'loading';
}
}
}
const cancelCoupon = () => {
uni.navigateBack();
}
onReachBottom(() => {
if (form.status != 'nomore') {
getCouponList()
}
})
onMounted(async () => {
//
const pages = getCurrentPages();
//
const currentPage = pages[pages.length - 1];
//
const options = currentPage.options;
if (options.shopId) {
fromInfo.shopId = options.shopId
}
// if (options.orderId) {
// fromInfo.orderId = options.orderId
// }
// if (options.couopnInfo) {
// this.couopnInfo = JSON.parse(decodeURIComponent(options.couopnInfo))
// }
// if (options.shoppingCart) {
// this.shoppingCart = JSON.parse(decodeURIComponent(options.shoppingCart))
// }
// if (options.productList) {
// this.productList = JSON.parse(decodeURIComponent(options.productList))
// }
init_fn()
})
});
</script>
<style lang="scss">
page {
background: #fff;
}
.container {
.towcontent {
padding: 0 28rpx;
border-top: 16rpx solid #f7f7f7;
.towcontentlistxitem {
<style>
page {
background-color: #f7f7f7;
}
</style>
<style scoped lang="scss">
.container {
padding: 238upx 28upx 28upx;
}
.header-wrap {
width: 100%;
background-color: #fff;
position: fixed;
top: 0;
left: 0;
z-index: 99;
padding: 28upx;
.search-wrap {
display: flex;
gap: 28upx;
.input-wrap {
flex: 1;
height: 70upx;
border: 1px solid #ececec;
border-radius: 8upx;
position: relative;
&:first-child {
flex: 1.5;
}
.icon {
position: absolute;
top: 50%;
transform: translateY(-50%);
&.left {
left: 14upx;
}
&.right {
right: 14upx;
}
}
.ipt {
width: 100%;
margin-top: 32rpx;
.towcontentlistxitembox {
width: 33.33%;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
font-size: 28rpx;
color: #333333;
justify-content: flex-start;
height: 50rpx;
image {
margin-top: 6rpx;
width: 38.83rpx;
height: 8.62rpx;
}
height: 100%;
&.left {
padding-left: 68upx;
}
.towcontentlistxitemboxopacity {
font-weight: bold;
text {
color: #E3AD7F;
}
image {
margin-top: 6rpx;
width: 38.83rpx;
height: 8.62rpx;
}
&.right {
padding: 0 56upx 0 28upx;
}
}
}
.containertop {
padding: 40rpx 32rpx;
.containertopbox {
margin-top: 8rpx;
.containertopboxitem::after {
position: absolute;
bottom: 14rpx;
left: 14rpx;
content: '';
display: inline-block;
background: url(https://czg-qr-order.oss-cn-beijing.aliyuncs.com/coupontop.png) no-repeat;
width: 72.83rpx;
height: 77.14rpx;
background-size: cover;
}
.containertopboxitem {
margin-bottom: 32rpx;
width: 100%;
position: relative;
border-radius: 18rpx;
box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(0, 0, 0, 0.16);
overflow: hidden;
.containertopboxitemleft {
position: relative;
width: 182rpx;
height: 192rpx;
background: #E3AD7F;
border-radius: 18rpx 0rpx 0rpx 18rpx;
padding: 0 20rpx;
// ::before {
// content: '';
// position: absolute;
// bottom: 0rpx;
// left: 166rpx;
// background: #fff;
// display: inline-block;
// width: 32rpx;
// height: 16rpx;
// line-height: 32rpx;
// border-radius: 32rpx 32rpx 0 0;
// box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(255, 255, 255, 0.16);
// z-index: 999;
// }
.containertopboxitemleft_one {
text {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 60rpx;
color: #FFFFFF;
}
}
.containertopboxitemleft_ones {
text {
color: #999999;
}
}
.containertopboxitemleft_tow {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 24rpx;
color: #FFFFFF;
}
.containertopboxitemleft_nameVip {
color: #967152;
}
.containertopboxitemleft_tows {
color: #999999;
}
}
.containertopboxitemleft::after {
content: '';
position: absolute;
top: -20rpx;
left: 166rpx;
background: #fff;
display: inline-block;
width: 40rpx;
height: 40rpx;
border-radius: 50%;
box-shadow: inset 0rpx 1rpx 9rpx 21rpx rgba(0, 0, 0, 0.04);
z-index: 999;
}
.containertopboxitemleft::before {
content: '';
position: absolute;
bottom: -20rpx;
left: 166rpx;
background: #fff;
display: inline-block;
width: 40rpx;
height: 40rpx;
border-radius: 50%;
box-shadow: inset 0rpx 0rpx 15rpx 1rpx rgba(0, 0, 0, 0.1);
z-index: 999;
}
.containertopboxitemleft_vip {
background-color: #E1D4B2;
}
.containertopboxitemlefts {
background: #F7F7F7;
}
.containertopboxitemright {
position: relative;
padding: 0 32rpx;
flex: auto;
height: 192rpx;
background: #FFFFFF;
border-radius: 0rpx 18rpx 18rpx 0rpx;
.containertopboxitemright_one {
font-family: Source Han Sans CN, Source Han Sans CN;
padding: 16rpx 0 20rpx 0;
border-bottom: 1rpx dashed #707070;
display: flex;
justify-content: space-between;
align-items: center;
.icon {
width: 26rpx;
height: 26rpx;
margin-right: 14rpx;
}
text {
font-weight: bold;
font-size: 24rpx;
color: #666666;
}
.title {
color: #333;
}
}
.containertopboxitemright_tow {
margin-top: 24rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: bold;
font-size: 32rpx;
color: #333333;
display: flex;
justify-content: space-between;
align-items: center;
}
.containertopboxitemright_there {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 24rpx;
color: #999999;
}
.containertopboxitemright_btn {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 24rpx;
padding: 8rpx 24rpx;
border-radius: 24rpx 24rpx 24rpx 24rpx;
}
.containertopboxitemright_four {
color: #FFFFFF;
background: #967152;
}
.containertopboxitemright_fours {
color: #999999;
background: #F7F7F7;
}
}
}
}
}
.select {
padding-bottom: 180rpx;
}
.btnBox {
width: 100%;
position: fixed;
}
.status-wrap {
display: flex;
padding-top: 28upx;
position: relative;
.icon-wrap {
height: 12upx;
position: absolute;
bottom: 0;
left: 0;
z-index: 999;
background-color: #fff;
padding: 30rpx 30rpx 50rpx 30rpx;
.btn {
width: 100%;
height: 90rpx;
line-height: 90rpx;
text-align: center;
font-weight: bold;
font-size: 36rpx;
color: #FFFFFF;
border-radius: 12rpx;
background: #E3AD7F;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.3s ease-in-out;
.active-icon {
width: 24upx;
height: 12upx;
z-index: 9;
}
}
.item {
flex: 1;
height: 80upx;
display: flex;
align-items: center;
justify-content: center;
.t {
font-size: 32upx;
color: #666666;
transition: all 0.3s ease-in-out 0.1s;
}
&.active {
.t {
color: #e3ad7f;
}
}
}
}
</style>
}
.list-wrap {
padding-top: 28upx;
.item {
border-radius: 18upx;
background-color: #fff;
padding: 28upx;
.top {
display: flex;
align-items: center;
padding-bottom: 28upx;
.icon {
$size: 120upx;
width: $size;
height: $size;
background-color: #f7f7f7;
border-radius: 12upx;
}
.info {
flex: 1;
display: flex;
flex-direction: column;
gap: 8upx;
padding-left: 28upx;
.view {
flex: 1;
&.name {
font-size: 32upx;
color: #333;
}
&.time {
.t {
font-size: 24upx;
color: #999;
}
}
}
}
.btn {
width: 120upx;
height: 48upx;
border-radius: 48upx;
display: flex;
align-items: center;
justify-content: center;
background-color: #333;
.t {
font-size: 24upx;
color: #fff;
}
}
}
.btm {
display: flex;
align-items: center;
padding: 28upx 0 14upx;
border-top: 1upx solid #f7f7f7;
.left {
flex: 1;
height: 40upx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
.t {
font-size: 24upx;
color: #999;
}
}
.right {
display: flex;
align-items: center;
padding-left: 28upx;
.t {
font-size: 24upx;
color: #333;
}
}
}
}
}
.shoplist-popup {
padding: 0 28upx 28upx;
.title {
padding: 28upx 0;
display: flex;
align-items: center;
justify-content: center;
.t {
font-size: 32upx;
font-weight: bold;
color: #333;
}
}
.popup-list {
height: 50vh;
.item {
height: 100upx;
border-radius: 12upx;
background-color: #f7f7f7;
margin-bottom: 28upx;
display: flex;
align-items: center;
padding: 28upx;
.t {
font-size: 28upx;
color: #555;
}
}
}
}
</style>

492
pages/user/coupon_back.vue Normal file
View File

@ -0,0 +1,492 @@
<template>
<view class="container">
<view class="towcontent">
<view class="towcontentlistxitem flex-start">
<view class="towcontentlistxitembox flex-colum" v-for="(item,index) in tabList" :key="index"
@click="towcontentclick(item)"
:class="fromInfo.tabIndex == item.status?'towcontentlistxitemboxopacity':''">
<text class="title">{{item.name}}</text>
<image v-if="fromInfo.tabIndex == item.status"
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/today/dg.png" mode="widthFix">
</image>
</view>
</view>
</view>
<view class="containertop">
<view class="containertopbox">
<view class="containertopboxitem flex-start" v-for="(item,index) in fromInfo.list" :key="index">
<view class="containertopboxitemleft flex-colum"
:class="{'containertopboxitemleft_vip': item.type == 2,'containertopboxitemlefts': fromInfo.status == 0}">
<view class="containertopboxitemleft_one"
:class="fromInfo.status != 0?'':'containertopboxitemleft_ones'">
<block v-if="item.type == 2">
<text>1</text>
<text style="font-size: 28rpx;margin-left: 6rpx;"></text>
</block>
<block v-else>
<text style="font-size: 28rpx;margin-right: 6rpx;"></text>
<text>{{item.discountAmount || 0}}</text>
</block>
</view>
<view class="containertopboxitemleft_tow" :class="{
'containertopboxitemleft_tows': fromInfo.status == 0,
'containertopboxitemleft_nameVip': item.type == 2,
}">
{{ item.type == 2 ? item.name : '优惠券(元)'}}
</view>
</view>
<view class="containertopboxitemright">
<view class="containertopboxitemright_one">
<view class="flex-start">
<image class="icon"
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/user/coupon_icon.png"
mode="aspectFill"></image>
<text class="title">{{ item.shopName }}</text>
</view>
<text>无门槛使用</text>
</view>
<view class="containertopboxitemright_tow">
<view> {{ item.type == 2 ? '会员商品券' : item.name}}</view>
<view @click="navigatorGo(item)"
:class="fromInfo.status == 0?'containertopboxitemright_four containertopboxitemright_btn':'containertopboxitemright_fours containertopboxitemright_btn'">
{{fromInfo.status == 0 ? '去使用':'已使用'}}
</view>
</view>
<view class="containertopboxitemright_there" v-if="item.type == 1 ">
有效期至{{$u.timeFormat(item.endTime, 'yyyy/mm/dd') || '0'}}
</view>
</view>
</view>
<view v-if="fromInfo.list.length <= 0" style="text-align: center;">
<image style="width: 402rpx;height: 442rpx;margin:240rpx auto 32rpx;"
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/nomore.png" mode="aspectFill"></image>
</view>
<up-loadmore :status="form.status" fontSize="14" color="#999" iconSize="14" />
</view>
</view>
</view>
</template>
<script setup>
import {
ref,
reactive,
onMounted,
} from 'vue';
import {
onLoad,
onReady,
onShow,
onPageScroll,
onReachBottom
} from '@dcloudio/uni-app'
import {
APIcouponfindByUserId,
APIfindCoupon
} from '@/common/api/member.js'
const tabList = [{
name: '未使用',
status: '0'
},
{
name: '已使用',
status: '1'
},
{
name: '已过期',
status: '2'
}
]
const fromInfo = reactive({
tabIndex: 0,
list: [],
status: 0,
shopId: null,
orderId: null,
couopnInfo: null,
shoppingCart: [],
productList: [],
})
const form = reactive({
page: 1,
size: 10,
status: 'loadmore',
})
//
const Orderinfo = reactive({
typeOrder: '',
shopUserId: "",
payAmount: "",
shoppingCart: [],
show: false
})
//
const init_fn = () => {
fromInfo.list = []
form.page = 1
form.size = 10
form.status = 'loadmore'
// navtabindex.value == '1' ? getorderList() : userorderList()
getCouponList()
}
const towcontentclick = (item) => {
fromInfo.tabIndex = item.status;
fromInfo.status = item.status;
fromInfo.list = [];
getCouponList()
}
// 使
const navigatorGo = (item) => {
uni.pro.switchTab('index/index')
}
const getCouponList = async () => {
let res = await APIcouponfindByUserId({
userId: uni.cache.get('userInfo').id,
status: fromInfo.status,
shopId: fromInfo.shopId ? fromInfo.shopId : uni.cache.get('shopId'),
page: form.page,
size: form.size,
})
if (!res) {
form.status = 'nomore'
fromInfo.list = []
return false
}
if (res.totalPage == 0 || res.totalPage == 1 && res.totalRow <= 10) {
form.status = 'nomore'
fromInfo.list = res.records
if (form.page == 1 && res.records.length == 0) {
fromInfo.list = []
}
return false;
} else {
form.status = 'loading';
if (form.page == 1) {
fromInfo.list = res.records
} else {
fromInfo.list = [...fromInfo.list, ...res.records];
}
form.page = ++form.page;
if (form.page > res.totalPage) {
form.status = 'nomore';
} else {
form.status = 'loading';
}
}
}
const cancelCoupon = () => {
uni.navigateBack();
}
onReachBottom(() => {
if (form.status != 'nomore') {
getCouponList()
}
})
onMounted(async () => {
//
const pages = getCurrentPages();
//
const currentPage = pages[pages.length - 1];
//
const options = currentPage.options;
if (options.shopId) {
fromInfo.shopId = options.shopId
}
// if (options.orderId) {
// fromInfo.orderId = options.orderId
// }
// if (options.couopnInfo) {
// this.couopnInfo = JSON.parse(decodeURIComponent(options.couopnInfo))
// }
// if (options.shoppingCart) {
// this.shoppingCart = JSON.parse(decodeURIComponent(options.shoppingCart))
// }
// if (options.productList) {
// this.productList = JSON.parse(decodeURIComponent(options.productList))
// }
init_fn()
})
</script>
<style lang="scss">
page {
background: #fff;
}
.container {
.towcontent {
padding: 0 28rpx;
border-top: 16rpx solid #f7f7f7;
.towcontentlistxitem {
width: 100%;
margin-top: 32rpx;
.towcontentlistxitembox {
width: 33.33%;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
font-size: 28rpx;
color: #333333;
justify-content: flex-start;
height: 50rpx;
image {
margin-top: 6rpx;
width: 38.83rpx;
height: 8.62rpx;
}
}
.towcontentlistxitemboxopacity {
font-weight: bold;
text {
color: #E3AD7F;
}
image {
margin-top: 6rpx;
width: 38.83rpx;
height: 8.62rpx;
}
}
}
}
.containertop {
padding: 40rpx 32rpx;
.containertopbox {
margin-top: 8rpx;
.containertopboxitem::after {
position: absolute;
bottom: 14rpx;
left: 14rpx;
content: '';
display: inline-block;
background: url(https://czg-qr-order.oss-cn-beijing.aliyuncs.com/coupontop.png) no-repeat;
width: 72.83rpx;
height: 77.14rpx;
background-size: cover;
}
.containertopboxitem {
margin-bottom: 32rpx;
width: 100%;
position: relative;
border-radius: 18rpx;
box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(0, 0, 0, 0.16);
overflow: hidden;
.containertopboxitemleft {
position: relative;
width: 182rpx;
height: 192rpx;
background: #E3AD7F;
border-radius: 18rpx 0rpx 0rpx 18rpx;
padding: 0 20rpx;
// ::before {
// content: '';
// position: absolute;
// bottom: 0rpx;
// left: 166rpx;
// background: #fff;
// display: inline-block;
// width: 32rpx;
// height: 16rpx;
// line-height: 32rpx;
// border-radius: 32rpx 32rpx 0 0;
// box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(255, 255, 255, 0.16);
// z-index: 999;
// }
.containertopboxitemleft_one {
text {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 60rpx;
color: #FFFFFF;
}
}
.containertopboxitemleft_ones {
text {
color: #999999;
}
}
.containertopboxitemleft_tow {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 24rpx;
color: #FFFFFF;
}
.containertopboxitemleft_nameVip {
color: #967152;
}
.containertopboxitemleft_tows {
color: #999999;
}
}
.containertopboxitemleft::after {
content: '';
position: absolute;
top: -20rpx;
left: 166rpx;
background: #fff;
display: inline-block;
width: 40rpx;
height: 40rpx;
border-radius: 50%;
box-shadow: inset 0rpx 1rpx 9rpx 21rpx rgba(0, 0, 0, 0.04);
z-index: 999;
}
.containertopboxitemleft::before {
content: '';
position: absolute;
bottom: -20rpx;
left: 166rpx;
background: #fff;
display: inline-block;
width: 40rpx;
height: 40rpx;
border-radius: 50%;
box-shadow: inset 0rpx 0rpx 15rpx 1rpx rgba(0, 0, 0, 0.1);
z-index: 999;
}
.containertopboxitemleft_vip {
background-color: #E1D4B2;
}
.containertopboxitemlefts {
background: #F7F7F7;
}
.containertopboxitemright {
position: relative;
padding: 0 32rpx;
flex: auto;
height: 192rpx;
background: #FFFFFF;
border-radius: 0rpx 18rpx 18rpx 0rpx;
.containertopboxitemright_one {
font-family: Source Han Sans CN, Source Han Sans CN;
padding: 16rpx 0 20rpx 0;
border-bottom: 1rpx dashed #707070;
display: flex;
justify-content: space-between;
align-items: center;
.icon {
width: 26rpx;
height: 26rpx;
margin-right: 14rpx;
}
text {
font-weight: bold;
font-size: 24rpx;
color: #666666;
}
.title {
color: #333;
}
}
.containertopboxitemright_tow {
margin-top: 24rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: bold;
font-size: 32rpx;
color: #333333;
display: flex;
justify-content: space-between;
align-items: center;
}
.containertopboxitemright_there {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 24rpx;
color: #999999;
}
.containertopboxitemright_btn {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 24rpx;
padding: 8rpx 24rpx;
border-radius: 24rpx 24rpx 24rpx 24rpx;
}
.containertopboxitemright_four {
color: #FFFFFF;
background: #967152;
}
.containertopboxitemright_fours {
color: #999999;
background: #F7F7F7;
}
}
}
}
}
.select {
padding-bottom: 180rpx;
}
.btnBox {
width: 100%;
position: fixed;
bottom: 0;
left: 0;
z-index: 999;
background-color: #fff;
padding: 30rpx 30rpx 50rpx 30rpx;
.btn {
width: 100%;
height: 90rpx;
line-height: 90rpx;
text-align: center;
font-weight: bold;
font-size: 36rpx;
color: #FFFFFF;
border-radius: 12rpx;
background: #E3AD7F;
}
}
}
</style>

256
pnpm-lock.yaml Normal file
View File

@ -0,0 +1,256 @@
lockfileVersion: '6.0'
settings:
autoInstallPeers: true
excludeLinksFromLockfile: false
dependencies:
'@dcloudio/uni-app':
specifier: ^2.0.2-4040520250103001
version: 2.0.2-4070620250821001(@dcloudio/types@3.4.21)(@vue/composition-api@1.7.2)
dayjs:
specifier: ^1.11.13
version: 1.11.18
jsbarcode:
specifier: ^3.11.6
version: 3.12.1
pinia:
specifier: ^2.3.1
version: 2.3.1(@vue/composition-api@1.7.2)(vue@3.5.21)
pinia-plugin-unistorage:
specifier: ^0.1.2
version: 0.1.2
packages:
/@babel/helper-string-parser@7.27.1:
resolution: {integrity: sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==}
engines: {node: '>=6.9.0'}
dev: false
/@babel/helper-validator-identifier@7.27.1:
resolution: {integrity: sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==}
engines: {node: '>=6.9.0'}
dev: false
/@babel/parser@7.28.4:
resolution: {integrity: sha512-yZbBqeM6TkpP9du/I2pUZnJsRMGGvOuIrhjzC1AwHwW+6he4mni6Bp/m8ijn0iOuZuPI2BfkCoSRunpyjnrQKg==}
engines: {node: '>=6.0.0'}
hasBin: true
dependencies:
'@babel/types': 7.28.4
dev: false
/@babel/types@7.28.4:
resolution: {integrity: sha512-bkFqkLhh3pMBUQQkpVgWDWq/lqzc2678eUyDlTBhRqhCHFguYYGM0Efga7tYk4TogG/3x0EEl66/OQ+WGbWB/Q==}
engines: {node: '>=6.9.0'}
dependencies:
'@babel/helper-string-parser': 7.27.1
'@babel/helper-validator-identifier': 7.27.1
dev: false
/@dcloudio/types@3.4.21:
resolution: {integrity: sha512-rsv3XfAaD/dtuVboPeYh+vPcULnWyozGaGKHWyN0dYRm7L1uypFUM30qNYMj9iNmbAENuBjV177S1gNEBIvdDA==}
dev: false
/@dcloudio/uni-app@2.0.2-4070620250821001(@dcloudio/types@3.4.21)(@vue/composition-api@1.7.2):
resolution: {integrity: sha512-kZBLLRmFsF3HvqfgTKHh1NDb1G7L5jJXZ3rncrGnaIirc6mE4jpBoSeqQY5jFxgQXFdJVXsHvLezBi13XiqazA==}
peerDependencies:
'@dcloudio/types': ^3.0.15
'@vue/composition-api': ^1.7.0
dependencies:
'@dcloudio/types': 3.4.21
'@vue/composition-api': 1.7.2(vue@3.5.21)
dev: false
/@jridgewell/sourcemap-codec@1.5.5:
resolution: {integrity: sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==}
dev: false
/@vue/compiler-core@3.5.21:
resolution: {integrity: sha512-8i+LZ0vf6ZgII5Z9XmUvrCyEzocvWT+TeR2VBUVlzIH6Tyv57E20mPZ1bCS+tbejgUgmjrEh7q/0F0bibskAmw==}
dependencies:
'@babel/parser': 7.28.4
'@vue/shared': 3.5.21
entities: 4.5.0
estree-walker: 2.0.2
source-map-js: 1.2.1
dev: false
/@vue/compiler-dom@3.5.21:
resolution: {integrity: sha512-jNtbu/u97wiyEBJlJ9kmdw7tAr5Vy0Aj5CgQmo+6pxWNQhXZDPsRr1UWPN4v3Zf82s2H3kF51IbzZ4jMWAgPlQ==}
dependencies:
'@vue/compiler-core': 3.5.21
'@vue/shared': 3.5.21
dev: false
/@vue/compiler-sfc@3.5.21:
resolution: {integrity: sha512-SXlyk6I5eUGBd2v8Ie7tF6ADHE9kCR6mBEuPyH1nUZ0h6Xx6nZI29i12sJKQmzbDyr2tUHMhhTt51Z6blbkTTQ==}
dependencies:
'@babel/parser': 7.28.4
'@vue/compiler-core': 3.5.21
'@vue/compiler-dom': 3.5.21
'@vue/compiler-ssr': 3.5.21
'@vue/shared': 3.5.21
estree-walker: 2.0.2
magic-string: 0.30.19
postcss: 8.5.6
source-map-js: 1.2.1
dev: false
/@vue/compiler-ssr@3.5.21:
resolution: {integrity: sha512-vKQ5olH5edFZdf5ZrlEgSO1j1DMA4u23TVK5XR1uMhvwnYvVdDF0nHXJUblL/GvzlShQbjhZZ2uvYmDlAbgo9w==}
dependencies:
'@vue/compiler-dom': 3.5.21
'@vue/shared': 3.5.21
dev: false
/@vue/composition-api@1.7.2(vue@3.5.21):
resolution: {integrity: sha512-M8jm9J/laYrYT02665HkZ5l2fWTK4dcVg3BsDHm/pfz+MjDYwX+9FUaZyGwEyXEDonQYRCo0H7aLgdklcIELjw==}
peerDependencies:
vue: '>= 2.5 < 2.7'
dependencies:
vue: 3.5.21
dev: false
/@vue/devtools-api@6.6.4:
resolution: {integrity: sha512-sGhTPMuXqZ1rVOk32RylztWkfXTRhuS7vgAKv0zjqk8gbsHkJ7xfFf+jbySxt7tWObEJwyKaHMikV/WGDiQm8g==}
dev: false
/@vue/reactivity@3.5.21:
resolution: {integrity: sha512-3ah7sa+Cwr9iiYEERt9JfZKPw4A2UlbY8RbbnH2mGCE8NwHkhmlZt2VsH0oDA3P08X3jJd29ohBDtX+TbD9AsA==}
dependencies:
'@vue/shared': 3.5.21
dev: false
/@vue/runtime-core@3.5.21:
resolution: {integrity: sha512-+DplQlRS4MXfIf9gfD1BOJpk5RSyGgGXD/R+cumhe8jdjUcq/qlxDawQlSI8hCKupBlvM+3eS1se5xW+SuNAwA==}
dependencies:
'@vue/reactivity': 3.5.21
'@vue/shared': 3.5.21
dev: false
/@vue/runtime-dom@3.5.21:
resolution: {integrity: sha512-3M2DZsOFwM5qI15wrMmNF5RJe1+ARijt2HM3TbzBbPSuBHOQpoidE+Pa+XEaVN+czbHf81ETRoG1ltztP2em8w==}
dependencies:
'@vue/reactivity': 3.5.21
'@vue/runtime-core': 3.5.21
'@vue/shared': 3.5.21
csstype: 3.1.3
dev: false
/@vue/server-renderer@3.5.21(vue@3.5.21):
resolution: {integrity: sha512-qr8AqgD3DJPJcGvLcJKQo2tAc8OnXRcfxhOJCPF+fcfn5bBGz7VCcO7t+qETOPxpWK1mgysXvVT/j+xWaHeMWA==}
peerDependencies:
vue: 3.5.21
dependencies:
'@vue/compiler-ssr': 3.5.21
'@vue/shared': 3.5.21
vue: 3.5.21
dev: false
/@vue/shared@3.5.21:
resolution: {integrity: sha512-+2k1EQpnYuVuu3N7atWyG3/xoFWIVJZq4Mz8XNOdScFI0etES75fbny/oU4lKWk/577P1zmg0ioYvpGEDZ3DLw==}
dev: false
/csstype@3.1.3:
resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==}
dev: false
/dayjs@1.11.18:
resolution: {integrity: sha512-zFBQ7WFRvVRhKcWoUh+ZA1g2HVgUbsZm9sbddh8EC5iv93sui8DVVz1Npvz+r6meo9VKfa8NyLWBsQK1VvIKPA==}
dev: false
/entities@4.5.0:
resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==}
engines: {node: '>=0.12'}
dev: false
/estree-walker@2.0.2:
resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==}
dev: false
/jsbarcode@3.12.1:
resolution: {integrity: sha512-QZQSqIknC2Rr/YOUyOkCBqsoiBAOTYK+7yNN3JsqfoUtJtkazxNw1dmPpxuv7VVvqW13kA3/mKiLq+s/e3o9hQ==}
dev: false
/magic-string@0.30.19:
resolution: {integrity: sha512-2N21sPY9Ws53PZvsEpVtNuSW+ScYbQdp4b9qUaL+9QkHUrGFKo56Lg9Emg5s9V/qrtNBmiR01sYhUOwu3H+VOw==}
dependencies:
'@jridgewell/sourcemap-codec': 1.5.5
dev: false
/nanoid@3.3.11:
resolution: {integrity: sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==}
engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}
hasBin: true
dev: false
/picocolors@1.1.1:
resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==}
dev: false
/pinia-plugin-unistorage@0.1.2:
resolution: {integrity: sha512-WXit2cGnm5rG6CDTcLSLehNWhyJS/Yq7WEeeXAapZbCnqoPJxlszqg7rT8S+OP47az0h5nlajGo+LuyMxUQ2uw==}
dev: false
/pinia@2.3.1(@vue/composition-api@1.7.2)(vue@3.5.21):
resolution: {integrity: sha512-khUlZSwt9xXCaTbbxFYBKDc/bWAGWJjOgvxETwkTN7KRm66EeT1ZdZj6i2ceh9sP2Pzqsbc704r2yngBrxBVug==}
peerDependencies:
typescript: '>=4.4.4'
vue: ^2.7.0 || ^3.5.11
peerDependenciesMeta:
typescript:
optional: true
dependencies:
'@vue/devtools-api': 6.6.4
vue: 3.5.21
vue-demi: 0.14.10(@vue/composition-api@1.7.2)(vue@3.5.21)
transitivePeerDependencies:
- '@vue/composition-api'
dev: false
/postcss@8.5.6:
resolution: {integrity: sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==}
engines: {node: ^10 || ^12 || >=14}
dependencies:
nanoid: 3.3.11
picocolors: 1.1.1
source-map-js: 1.2.1
dev: false
/source-map-js@1.2.1:
resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==}
engines: {node: '>=0.10.0'}
dev: false
/vue-demi@0.14.10(@vue/composition-api@1.7.2)(vue@3.5.21):
resolution: {integrity: sha512-nMZBOwuzabUO0nLgIcc6rycZEebF6eeUfaiQx9+WSk8e29IbLvPU9feI6tqW4kTo3hvoYAJkMh8n8D0fuISphg==}
engines: {node: '>=12'}
hasBin: true
requiresBuild: true
peerDependencies:
'@vue/composition-api': ^1.0.0-rc.1
vue: ^3.0.0-0 || ^2.6.0
peerDependenciesMeta:
'@vue/composition-api':
optional: true
dependencies:
'@vue/composition-api': 1.7.2(vue@3.5.21)
vue: 3.5.21
dev: false
/vue@3.5.21:
resolution: {integrity: sha512-xxf9rum9KtOdwdRkiApWL+9hZEMWE90FHh8yS1+KJAiWYh+iGWV1FquPjoO9VUHQ+VIhsCXNNyZ5Sf4++RVZBA==}
peerDependencies:
typescript: '*'
peerDependenciesMeta:
typescript:
optional: true
dependencies:
'@vue/compiler-dom': 3.5.21
'@vue/compiler-sfc': 3.5.21
'@vue/runtime-dom': 3.5.21
'@vue/server-renderer': 3.5.21(vue@3.5.21)
'@vue/shared': 3.5.21
dev: false