优惠券

parent b75c85a3
import { request } from '../utils/request';
// 订单列表接口
export function getOrderList(data) {
return request({
url: '/sgyrdd/sgyOrder/groupBuy/page',
method: 'GET',
data,
});
}
...@@ -60,6 +60,12 @@ ...@@ -60,6 +60,12 @@
"style": { "style": {
"navigationBarTitleText": "我的券" "navigationBarTitleText": "我的券"
} }
},
{
"path": "pages/ticket/detail",
"style": {
"navigationBarTitleText": "优惠券详情"
}
} }
], ],
"globalStyle": { "globalStyle": {
......
...@@ -31,7 +31,7 @@ const handleBack = () => { ...@@ -31,7 +31,7 @@ const handleBack = () => {
background-color: #ffffff; background-color: #ffffff;
position: fixed; position: fixed;
z-index: 999; z-index: 999;
width: 100%; width: 375 * 2rpx;
.headbox { .headbox {
position: relative; position: relative;
......
...@@ -28,10 +28,39 @@ ...@@ -28,10 +28,39 @@
<view class="btn-error">再来一单</view> <view class="btn-error">再来一单</view>
</view> </view>
</view> </view>
<wd-loadmore :state="state" @reload="loadmore" />
</view> </view>
</template> </template>
<script></script> <script setup>
import { getOrderList } from '@/api/order';
const state = ref('loading');
const page = reactive({
pageNum: 0,
pageSize: 10,
});
const num = ref(0);
const max = ref(60);
onReachBottom(() => {
if (num.value === 45) {
state.value = 'error';
} else if (num.value < max.value) {
getList();
} else if (num.value === max.value) {
state.value = 'finished';
}
});
const getList = async () => {
const res = await getOrderList();
state.value = 'loading';
console.log(res);
};
getList();
</script>
<style lang="scss" scoped> <style lang="scss" scoped>
.content { .content {
...@@ -59,7 +88,8 @@ ...@@ -59,7 +88,8 @@
.left { .left {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 20rpx; gap: 6rpx;
font-weight: bold;
image { image {
height: 38rpx; height: 38rpx;
......
...@@ -206,6 +206,8 @@ page { ...@@ -206,6 +206,8 @@ page {
} }
.container { .container {
width: 375 * 2rpx;
margin: 0 auto;
.content { .content {
padding-top: 44px; padding-top: 44px;
display: flex; display: flex;
......
...@@ -26,6 +26,8 @@ page { ...@@ -26,6 +26,8 @@ page {
background: #f3f3f3; background: #f3f3f3;
} }
.container { .container {
width: 375 * 2rpx;
margin: 0 auto;
.tabs { .tabs {
padding-top: 44px; padding-top: 44px;
......
...@@ -37,6 +37,8 @@ page { ...@@ -37,6 +37,8 @@ page {
} }
.container { .container {
width: 375 * 2rpx;
margin: 0 auto;
.content { .content {
padding-top: 44px; padding-top: 44px;
display: flex; display: flex;
......
<template>
<!-- 优惠券列表 -->
<view class="ticket-list">
<view class="ticket-item">
<view class="ticket-box">
<view class="normal ticket-left">
<view class="ticket-box">
<view class="ticket-price">
<text class="price"></text>
<text class="num">20</text>
</view>
<view class="ticket-desc">
<text class="desc">满50元可用</text>
<text class="desc">数量:10</text>
</view>
</view>
</view>
<view class="ticket-right">
<view class="head">
<text class="title">超市优惠券</text>
<view class="headbox">
<text class="time">使用时间:2023.02.4-2023.02.10</text>
<view class="btn">使用</view>
</view>
</view>
<view class="foot">
<view class="line"></view>
<view class="footbox" @click="changeShowDetail()">
<text class="desc">详细信息</text>
<wd-icon
:name="showDetail ? 'chevron-down' : 'chevron-right'"
size="15px"
color="#9d9d9d"
></wd-icon>
</view>
</view>
</view>
</view>
<view class="detail" v-if="showDetail">
<view class="line"></view>
<view class="detail-box">
<view class="rowbox">
<text>使用时间</text>
<text class="desc">2023.02.04-2023.04.20</text>
</view>
<view class="rowbox">
<text>使用条件</text>
<text class="desc">满50元可用</text>
</view>
<view class="rowbox">
<text>使用说明</text>
<text class="desc">
活动期间,使用说明内容使用说明内容 使用说明内容使用说明内容使用说明内 容使用说明内容。
</text>
</view>
</view>
</view>
</view>
<view class="ticket-item">
<view class="ticket-box">
<view class="past ticket-left">
<view class="ticket-box">
<view class="ticket-price">
<text class="price"></text>
<text class="num">20</text>
</view>
<view class="ticket-desc">
<text class="desc">满50元可用</text>
<text class="desc">数量:10</text>
</view>
</view>
</view>
<view class="ticket-right">
<image src="@/static/ticket/past-icon.png" class="img"></image>
<view class="head">
<text class="title">超市优惠券</text>
<view class="headbox">
<text class="time">使用时间:2023.02.4-2023.02.10</text>
<!-- <view class="btn">使用</view> -->
</view>
</view>
<view class="foot">
<view class="line"></view>
<view class="footbox">
<text class="desc">详细信息</text>
<wd-icon name="chevron-right" size="15px" color="#9d9d9d"></wd-icon>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script setup>
const showDetail = ref(false);
const changeShowDetail = () => {
console.log('showDetail', showDetail.value);
showDetail.value = !showDetail.value;
};
</script>
<style lang="scss" scoped>
.ticket-list {
display: flex;
flex-direction: column;
gap: 36rpx;
.ticket-item {
width: 100%;
background-color: #fff;
border-radius: 16rpx;
display: flex;
flex-direction: column;
.ticket-box {
display: flex;
.normal {
background: url('../../static/ticket/ticket-normal.png') no-repeat;
background-size: 100% 100%;
}
.past {
background: url('../../static/ticket/ticket-past.png') no-repeat;
background-size: 100% 100%;
}
.ticket-left {
width: 200rpx;
height: 200rpx;
.ticket-box {
width: 94%;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 30rpx;
.ticket-price {
display: flex;
align-items: last baseline;
text {
font-size: 24rpx;
line-height: 24rpx;
font-family: PingFang SC;
color: #fff;
}
.num {
font-size: 52rpx;
}
}
.ticket-desc {
display: flex;
flex-direction: column;
align-items: center;
gap: 24rpx;
.desc {
font-size: 24rpx;
line-height: 24rpx;
font-family: PingFang SC;
color: #fff;
}
}
}
}
.ticket-right {
display: flex;
flex-direction: column;
width: 504rpx;
position: relative;
.img {
width: 126rpx;
height: 94rpx;
position: absolute;
right: 28rpx;
top: 26rpx;
}
.head {
display: flex;
flex-direction: column;
padding: 30rpx 22rpx 26rpx 32rpx;
gap: 4rpx;
.title {
font-family: PingFang SC Heavy-Regular;
font-size: 32rpx;
color: #333333;
line-height: 32rpx;
}
.headbox {
display: flex;
justify-content: space-between;
align-items: end;
height: 50rpx;
.time {
font-family: PingFang SC Heavy-Regular;
font-size: 20rpx;
color: #999999;
line-height: 20rpx;
}
.btn {
width: 100rpx;
height: 50rpx;
border-radius: 26rpx;
display: flex;
align-items: center;
justify-content: center;
background: linear-gradient(90deg, #ff7051 0%, #ff382e 100%);
color: #fff;
font-size: 24rpx;
line-height: 24rpx;
}
}
}
.foot {
display: flex;
flex-direction: column;
padding: 0 22rpx 14rpx 32rpx;
gap: 14rpx;
.line {
border-top: 2rpx solid #f2f2f2;
}
.footbox {
display: flex;
align-items: center;
justify-content: space-between;
.desc {
font-family: PingFang SC Heavy-Regular;
font-size: 20rpx;
color: #999999;
line-height: 20rpx;
}
}
}
}
}
.detail {
display: flex;
flex-direction: column;
padding: 24rpx 0rpx 56rpx 0rpx;
gap: 30rpx;
.line {
border-top: 2rpx solid #e7e7e7;
}
.detail-box {
display: flex;
flex-direction: column;
gap: 40rpx;
padding: 0 40rpx 0 22rpx;
.rowbox {
display: flex;
flex-direction: row;
gap: 48rpx;
text {
font-family: PingFang SC Regular;
font-size: 28rpx;
color: #666666;
line-height: 28rpx;
}
.desc {
width: 476rpx;
}
}
}
}
}
}
</style>
<template>
<view class="container">
<Header title="合力超市"></Header>
<view class="content">
<view class="shop">
<image src="@/static/ticket/logo.png" class="logo"></image>
<view class="info">
<view class="top">
<view class="left">
<text class="title">合力超市花果园R1区店</text>
<view class="ratebox">
<wd-rate v-model="value" size="13px" space="1px" active-color="#f12929" />
<text class="rate">4.9</text>
</view>
<view class="ratebox">
<text>营业时间:</text>
<text class="time">6:00-22:00</text>
</view>
</view>
<view class="btn">
<image src="@/static/ticket/shopmail.png"></image>
<text>进店</text>
</view>
</view>
<view class="bottom">
<image class="address" src="@/static/ticket/address.png"></image>
<view class="infobox">
<text class="addr">贵阳市南明区花果园R1区1209</text>
<text>距您400米 步行5分钟</text>
</view>
<view class="iconbox">
<image class="img" src="@/static/ticket/map.png"></image>
<text>导航到店</text>
</view>
<view class="iconbox">
<image class="img" src="@/static/ticket/phone.png"></image>
<text>电话</text>
</view>
</view>
</view>
</view>
<!-- 优惠券列表 -->
<TicketList></TicketList>
</view>
</view>
</template>
<script setup>
import Header from '@/pages/order/components/Header/index.vue';
import TicketList from '@/pages/ticket/components/TicketList/index.vue';
const value = ref(4);
</script>
<style scoped lang="scss">
page {
background: #f3f3f3;
}
.container {
width: 375 * 2rpx;
margin: 0 auto;
.content {
display: flex;
flex-direction: column;
padding: 100rpx 26rpx 26rpx;
gap: 26rpx;
.shop {
display: flex;
gap: 20rpx;
background-color: #fff;
border-radius: 16rpx;
padding: 24rpx 22rpx 30rpx;
.logo {
height: 116rpx;
width: 116rpx;
border-radius: 16rpx;
}
.info {
display: flex;
flex-direction: column;
gap: 34rpx;
.top {
display: flex;
justify-content: space-between;
width: 514rpx;
.left {
display: flex;
flex-direction: column;
gap: 10rpx;
.title {
font-family: PingFang SC Bold;
font-size: 32rpx;
color: #333333;
line-height: 32rpx;
}
.ratebox {
display: flex;
align-items: center;
gap: 8rpx;
text {
font-family: PingFang SC Regular;
font-size: 24rpx;
color: #666;
}
.rate {
font-size: 22rpx;
color: #f12a2a;
}
.time {
color: #333;
}
}
}
.btn {
width: 127rpx;
height: 53rpx;
border-radius: 27rpx;
border: 2rpx solid #f12a2a;
display: flex;
align-items: center;
justify-content: center;
font-family: PingFang SC Regular;
font-size: 24rpx;
color: #f12a2a;
gap: 6rpx;
image {
width: 30rpx;
height: 30rpx;
}
}
}
.bottom {
display: flex;
justify-content: space-around;
.address {
width: 30rpx;
height: 30rpx;
}
.infobox {
display: flex;
flex-direction: column;
gap: 6rpx;
text {
font-family: PingFang SC Regular;
font-size: 22rpx;
color: #999999;
}
.addr {
width: 324rpx;
font-size: 24rpx;
color: #333;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
}
.iconbox {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 8rpx;
font-family: PingFang SC Regular;
font-size: 20rpx;
color: #666666;
.img {
width: 42rpx;
height: 42rpx;
}
}
}
}
}
}
}
</style>
<template> <template>
<Header title="我的码"></Header> <view class="container">
<view class="tab"> <Header title="我的码"></Header>
<view <view class="tab">
:class="currentTab == index ? 'tab-select' : 'tab-item'"
@click="changeTab(index)"
v-for="(item, index) in tabList"
:key="index"
>
{{ item }}
</view>
</view>
<view class="content">
<view class="card">
<text class="text">已领取优惠金额(元)</text>
<text class="price">0.00</text>
</view>
<!-- 优惠券状态 -->
<view class="status">
<view <view
:class="currenStatus == index ? 'status-select' : 'status-item'" :class="currentTab == index ? 'tab-select' : 'tab-item'"
@click="changeStatus(index)" @click="changeTab(index)"
v-for="(item, index) in statusList" v-for="(item, index) in tabList"
:key="index" :key="index"
> >
{{ item }} {{ item }}
</view> </view>
</view> </view>
<view class="content">
<view class="card">
<text class="text">已领取优惠金额(元)</text>
<text class="price">0.00</text>
</view>
<!-- 优惠券列表 --> <!-- 优惠券状态 -->
<view class="ticket-list"> <view class="status">
<view class="ticket-item"> <view
<view class="normal ticket-left"> :class="currenStatus == index ? 'status-select' : 'status-item'"
<view class="ticket-price"> @click="changeStatus(index)"
<text class="price"></text> v-for="(item, index) in statusList"
<text class="num">20</text> :key="index"
</view> >
<view class="ticket-desc"> {{ item }}
<text class="desc">满50元可用</text>
<text class="desc">数量:10</text>
</view>
</view> </view>
</view> </view>
<!-- 优惠券列表 -->
<TicketList></TicketList>
</view> </view>
</view> </view>
</template> </template>
<script setup> <script setup>
import Header from '../order/components/Header/index.vue'; import Header from '@/pages/order/components/Header/index.vue';
import TicketList from '@/pages/ticket/components/TicketList/index.vue';
const tabList = ['有效优惠券', '无效优惠券']; const tabList = ['有效优惠券', '无效优惠券'];
const currentTab = ref(0); const currentTab = ref(0);
...@@ -68,173 +58,112 @@ const changeStatus = (index) => { ...@@ -68,173 +58,112 @@ const changeStatus = (index) => {
page { page {
background: #f3f3f3; background: #f3f3f3;
} }
.container {
width: 375 * 2rpx;
margin: 0 auto;
// 标签栏 // 标签栏
.tab { .tab {
display: flex;
align-items: center;
justify-content: space-around;
height: 88rpx;
background: #fff;
width: 100%;
position: fixed;
top: 88rpx;
.tab-item {
font-family: PingFang SC;
font-weight: bold;
font-size: 32rpx;
color: #999;
}
.tab-select {
font-family: PingFang SC;
font-weight: bold;
font-size: 32rpx;
color: #333;
position: relative;
&::after {
content: '';
width: 36rpx;
height: 16rpx;
background: url('../../static/ticket/tab.png') no-repeat;
background-size: 100% 100%;
position: absolute;
bottom: -16rpx;
left: 50%;
transform: translate(-50%);
}
}
}
.content {
display: flex;
flex-direction: column;
padding: 202rpx 26rpx 26rpx;
gap: 36rpx;
.card {
display: flex; display: flex;
flex-direction: column;
align-items: center; align-items: center;
gap: 38rpx; justify-content: space-around;
height: 88rpx;
background: #fff;
width: 100%; width: 100%;
height: 216rpx; position: fixed;
border-radius: 16rpx; top: 88rpx;
background: linear-gradient(270deg, #fc7859 0%, #f22424 100%);
.text {
padding-top: 26rpx;
font-family: PingFang SC;
font-size: 24rpx;
color: #ffffff;
}
.price { .tab-item {
font-family: PingFang SC; font-family: PingFang SC;
font-weight: bold; font-weight: bold;
font-size: 36rpx; font-size: 32rpx;
color: #ffffff; color: #999;
} }
}
.status { .tab-select {
display: flex;
flex-direction: row;
align-items: center;
gap: 18rpx;
.status-item {
width: 132rpx;
height: 56rpx;
background-color: #fff;
border-radius: 28rpx;
display: flex;
align-items: center;
justify-content: center;
font-family: PingFang SC; font-family: PingFang SC;
font-weight: bold; font-weight: bold;
font-size: 24rpx; font-size: 32rpx;
color: #666; color: #333;
} position: relative;
.status-select { &::after {
width: 132rpx; content: '';
height: 56rpx; width: 36rpx;
background-color: #fff; height: 16rpx;
border-radius: 28rpx; background: url('../../static/ticket/tab.png') no-repeat;
display: flex; background-size: 100% 100%;
align-items: center; position: absolute;
justify-content: center; bottom: -16rpx;
font-family: PingFang SC; left: 50%;
font-weight: bold; transform: translate(-50%);
font-size: 24rpx; }
color: #f12a2a;
} }
} }
.ticket-list { .content {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
padding: 202rpx 26rpx 26rpx;
gap: 36rpx; gap: 36rpx;
.ticket-item { .card {
display: flex;
flex-direction: column;
align-items: center;
gap: 38rpx;
width: 100%; width: 100%;
background-color: #fff; height: 216rpx;
border-radius: 16rpx; border-radius: 16rpx;
display: flex; background: linear-gradient(270deg, #fc7859 0%, #f22424 100%);
.normal { .text {
background: url('../../static/ticket/ticket-normal.png') no-repeat; padding-top: 26rpx;
background-size: 100% 100%; font-family: PingFang SC;
font-size: 24rpx;
color: #ffffff;
} }
.past { .price {
background: url('../../static/ticket/ticket-past.png') no-repeat; font-family: PingFang SC;
background-size: 100% 100%; font-weight: bold;
font-size: 36rpx;
color: #ffffff;
}
}
.status {
display: flex;
flex-direction: row;
align-items: center;
gap: 18rpx;
.status-item {
width: 132rpx;
height: 56rpx;
background-color: #fff;
border-radius: 28rpx;
display: flex;
align-items: center;
justify-content: center;
font-family: PingFang SC;
font-weight: bold;
font-size: 24rpx;
color: #666;
} }
.ticket-left { .status-select {
width: 196rpx; width: 132rpx;
height: 200rpx; height: 56rpx;
background-color: #fff;
border-radius: 28rpx;
display: flex; display: flex;
flex-direction: column;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
gap: 30rpx; font-family: PingFang SC;
font-weight: bold;
.ticket-price { font-size: 24rpx;
display: flex; color: #f12a2a;
align-items: last baseline;
.price {
font-size: 24rpx;
line-height: 24rpx;
font-family: PingFang SC;
color: #fff;
}
.num {
font-size: 52rpx;
line-height: 24rpx;
font-family: PingFang SC;
color: #fff;
}
}
.ticket-desc {
display: flex;
flex-direction: column;
gap: 24rpx;
.desc {
font-size: 24rpx;
line-height: 24rpx;
font-family: PingFang SC;
color: #fff;
}
}
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment