Commit 6d615a40 authored by 石建新(贵阳日报)'s avatar 石建新(贵阳日报)
parents 1124d5ce d660770b
...@@ -92,6 +92,13 @@ ...@@ -92,6 +92,13 @@
"navigationBarTitleText": "申请退款" "navigationBarTitleText": "申请退款"
} }
} }
,
{
"path": "pages/index/coupon",
"style": {
"navigationBarTitleText": "优惠券详情"
}
}
], ],
"globalStyle": { "globalStyle": {
"navigationStyle": "custom" "navigationStyle": "custom"
......
<template>
<view class="container">
<scroll-view class="tabs" scroll-x="true" @scroll="scroll">
<text class="tab" v-for="(item, index) in tabs" :key="index">{{ item }}</text>
</scroll-view>
<view class="itemBox">
<view class="item"></view>
</view>
</view>
</template>
<script setup>
import {} from 'vue';
const tabs = ref(['推荐', '附近美食', '果蔬生鲜', '数码商城', '小吃快餐', '数码商城', '餐饮券']);
</script>
<style lang="scss" scoped>
page {
background: #f3f3f3;
}
.container {
.tabs {
white-space: nowrap;
padding: 0 30rpx;
box-sizing: border-box;
height: 100rpx;
line-height: 100rpx;
font-size: 32rpx;
color: #333333;
font-weight: bold;
background: white;
.tab {
display: inline-block;
margin-right: 40rpx;
}
}
.itemBox {
padding: 0 23rpx;
border-radius: 16rpx 16rpx 16rpx 16rpx;
margin-top: 20rpx;
.item {
width: 341rpx;
height: 674rpx;
background: #ffffff;
}
}
}
</style>
...@@ -44,7 +44,12 @@ ...@@ -44,7 +44,12 @@
<view v-else class="textF" @tap="toUse">去使用</view> <view v-else class="textF" @tap="toUse">去使用</view>
</view> </view>
</scroll-view> </scroll-view>
<image class="discount" src="../../static/index/discount.png" mode="widthFix" /> <image
@tap="toCoupon"
class="discount"
src="../../static/index/discount.png"
mode="widthFix"
/>
</view> </view>
<!-- 贵阳老味道 --> <!-- 贵阳老味道 -->
<!-- <view class="guiyang"></view> --> <!-- <view class="guiyang"></view> -->
...@@ -223,6 +228,12 @@ const receive = (data) => { ...@@ -223,6 +228,12 @@ const receive = (data) => {
}); });
} }
}; };
// TO优惠券详情
const toCoupon = () => {
xma.navigateTo({
url: '/pages/index/coupon',
});
};
// 获取分类 // 获取分类
const getClassification = () => { const getClassification = () => {
groupBuyList().then((res) => { groupBuyList().then((res) => {
......
...@@ -5,18 +5,9 @@ ...@@ -5,18 +5,9 @@
<!-- 使用状态 --> <!-- 使用状态 -->
<view class="status"> <view class="status">
<view class="status-box"> <view class="status-box">
<wd-icon <wd-icon name="check-outline" size="26px" color="#333"
name="check-outline" v-if="orderDetail.status == 5 || orderDetail.status == 7"></wd-icon>
size="26px" <wd-icon name="close-outline" size="26px" color="#333" v-if="orderDetail.status == 6"></wd-icon>
color="#333"
v-if="orderDetail.status == 5 || orderDetail.status == 7"
></wd-icon>
<wd-icon
name="close-outline"
size="26px"
color="#333"
v-if="orderDetail.status == 6"
></wd-icon>
<view class="status-text">{{ statusList[orderDetail.status] }}</view> <view class="status-text">{{ statusList[orderDetail.status] }}</view>
</view> </view>
<view class="detail" v-if="orderDetail.status == 3"> <view class="detail" v-if="orderDetail.status == 3">
...@@ -64,13 +55,10 @@ ...@@ -64,13 +55,10 @@
<text class="title1" v-if="orderDetail.status != 2 || orderDetail.status != 3"> <text class="title1" v-if="orderDetail.status != 2 || orderDetail.status != 3">
券码信息 券码信息
</text> </text>
<text <text :class="orderDetail.status == 5 || orderDetail.status == 6 || orderDetail.status == 7
:class="
orderDetail.status == 5 || orderDetail.status == 6 || orderDetail.status == 7
? 'linethrough' ? 'linethrough'
: 'phone' : 'phone'
" ">
>
{{ orderDetail.orderNumber.slice(6) }} {{ orderDetail.orderNumber.slice(6) }}
</text> </text>
</view> </view>
...@@ -259,14 +247,13 @@ onLoad((options) => { ...@@ -259,14 +247,13 @@ onLoad((options) => {
const orderDetail = ref(); const orderDetail = ref();
const getDetail = async () => { const getDetail = async () => {
const res = await getOrderDetail({ orderNumber: orderNumber.value }); const res = await getOrderDetail({ orderNumber: orderNumber.value });
if (res.code === 0) {
orderDetail.value = res.data; orderDetail.value = res.data;
if (orderDetail.value.status === '2' || orderDetail.value.status === '3') { if (orderDetail.value.status === '2' || orderDetail.value.status === '3') {
codeDetail(orderDetail.value.orderNumber); codeDetail(orderDetail.value.orderNumber);
} }
getProductDetail(orderDetail.value.orderItems[0].prodId); getProductDetail(orderDetail.value.orderItems[0].prodId);
getShopMailDetail(orderDetail.value.shopId); getShopMailDetail(orderDetail.value.shopId);
}
}; };
/** /**
...@@ -290,9 +277,7 @@ const codeDetail = (item) => { ...@@ -290,9 +277,7 @@ const codeDetail = (item) => {
const prodDetail = ref(); const prodDetail = ref();
const getProductDetail = async (id) => { const getProductDetail = async (id) => {
const res = await getProdDetail({ prodId: id }); const res = await getProdDetail({ prodId: id });
if (res.code === 0) {
prodDetail.value = res.data.data; prodDetail.value = res.data.data;
}
}; };
/** /**
...@@ -301,9 +286,7 @@ const getProductDetail = async (id) => { ...@@ -301,9 +286,7 @@ const getProductDetail = async (id) => {
const shopDetail = ref(); const shopDetail = ref();
const getShopMailDetail = async (id) => { const getShopMailDetail = async (id) => {
const res = await getShopDetail({ shopId: id }); const res = await getShopDetail({ shopId: id });
if (res.code === 0) {
shopDetail.value = res.data.shop; shopDetail.value = res.data.shop;
}
}; };
const maskPhoneNumber = (phone) => { const maskPhoneNumber = (phone) => {
...@@ -374,6 +357,7 @@ page { ...@@ -374,6 +357,7 @@ page {
.container { .container {
width: 375 * 2rpx; width: 375 * 2rpx;
margin: 0 auto; margin: 0 auto;
.content { .content {
padding-top: 44px; padding-top: 44px;
display: flex; display: flex;
......
...@@ -161,20 +161,15 @@ const getList = async () => { ...@@ -161,20 +161,15 @@ const getList = async () => {
catalog.current++; catalog.current++;
state.value = 'loading'; state.value = 'loading';
const res = await getOrderList(catalog); const res = await getOrderList(catalog);
if (res.code === 0) {
if (res.data.records.length > 0) { if (res.data.records.length > 0) {
res.data.records.forEach((item) => { res.data.records.forEach((item) => {
// 待付款倒计时计算
if (item.status === '1') { if (item.status === '1') {
item.countDown = calculateCountdown(item.createTime); item.countDown = calculateCountdown(item.createTime);
} }
}); });
dataList.value.push(...res.data.records); dataList.value.push(...res.data.records);
total.value = res.data.total; total.value = res.data.total;
} else {
state.value = 'finished';
}
} else {
state.value = 'error';
} }
state.value = 'finished'; state.value = 'finished';
}; };
...@@ -222,18 +217,11 @@ const handleDelete = (orderNumber) => { ...@@ -222,18 +217,11 @@ const handleDelete = (orderNumber) => {
success: async (res) => { success: async (res) => {
if (res.confirm) { if (res.confirm) {
const res = await deleteOrderApi(orderNumber); const res = await deleteOrderApi(orderNumber);
if (res.code === 0) {
uni.showToast({ uni.showToast({
title: '删除成功', title: '删除成功',
icon: 'success', icon: 'success',
}); });
initDataList(); initDataList();
} else {
uni.showToast({
title: '删除失败',
icon: 'error',
});
}
} }
}, },
}); });
...@@ -250,18 +238,11 @@ const handleCancel = (orderNumber) => { ...@@ -250,18 +238,11 @@ const handleCancel = (orderNumber) => {
success: async (res) => { success: async (res) => {
if (res.confirm) { if (res.confirm) {
const res = await cancelOrderApi({ orderNumber }); const res = await cancelOrderApi({ orderNumber });
if (res.code === 0) {
uni.showToast({ uni.showToast({
title: '取消成功', title: '取消成功',
icon: 'success', icon: 'success',
}); });
initDataList(); initDataList();
} else {
uni.showToast({
title: '取消失败',
icon: 'error',
});
}
} }
}, },
}); });
......
<template> <template>
<view class="container"> <view class="container">
<Header title="申请退款"></Header> <Header title="售后/退款"></Header>
<view class="content">
<view class="content-box">
<view class="content-item">
<text class="title">单号:1111111111</text>
</view>
<view class="content-item">
<view class="item-left">
<image class="item-img" mode="aspectFill" src="@/static/images/ticket/logo.png"></image>
<view class="item-info">
<text>血糯米</text>
</view>
</view>
</view>
</view>
</view>
</view> </view>
</template> </template>
...@@ -16,5 +31,12 @@ page { ...@@ -16,5 +31,12 @@ page {
.container { .container {
width: 375 * 2rpx; width: 375 * 2rpx;
margin: 0 auto; margin: 0 auto;
.content {
padding-top: 44px;
display: flex;
flex-direction: column;
gap: 20rpx;
}
} }
</style> </style>
...@@ -177,20 +177,12 @@ const handleChangeDetail = (idx) => { ...@@ -177,20 +177,12 @@ const handleChangeDetail = (idx) => {
*/ */
const getCoupon = async (item) => { const getCoupon = async (item) => {
const res = await receiveCoupon([item.couponYzfId]); const res = await receiveCoupon([item.couponYzfId]);
if (res.code === 0) {
item.numState = 1; item.numState = 1;
xma.showToast({ xma.showToast({
title: '领取成功', title: '领取成功',
icon: 'success', icon: 'success',
duration: 2000, duration: 2000,
}); });
return;
}
xma.showToast({
title: '领取失败',
icon: 'error',
duration: 2000,
});
}; };
/** /**
...@@ -212,7 +204,6 @@ const getCouponAll = async () => { ...@@ -212,7 +204,6 @@ const getCouponAll = async () => {
return; return;
} }
const res = await receiveCoupon(ids); const res = await receiveCoupon(ids);
if (res.code === 0) {
couponData.value.forEach((item) => { couponData.value.forEach((item) => {
item.numState = 1; item.numState = 1;
}); });
...@@ -221,13 +212,6 @@ const getCouponAll = async () => { ...@@ -221,13 +212,6 @@ const getCouponAll = async () => {
icon: 'success', icon: 'success',
duration: 2000, duration: 2000,
}); });
return;
}
xma.showToast({
title: '领取失败',
icon: 'error',
duration: 2000,
});
}; };
/** /**
......
...@@ -2,12 +2,8 @@ ...@@ -2,12 +2,8 @@
<view class="container"> <view class="container">
<Header title="我的券"></Header> <Header title="我的券"></Header>
<view class="tab"> <view class="tab">
<view <view :class="currentTab == index ? 'tab-select' : 'tab-item'" @click="changeTab(index)"
:class="currentTab == index ? 'tab-select' : 'tab-item'" v-for="(item, index) in tabList" :key="index">
@click="changeTab(index)"
v-for="(item, index) in tabList"
:key="index"
>
{{ item }} {{ item }}
</view> </view>
</view> </view>
...@@ -19,12 +15,8 @@ ...@@ -19,12 +15,8 @@
<!-- 优惠券状态 --> <!-- 优惠券状态 -->
<view class="status"> <view class="status">
<view <view :class="currenStatus == index ? 'status-select' : 'status-item'" @click="changeStatus(index)"
:class="currenStatus == index ? 'status-select' : 'status-item'" v-for="(item, index) in statusList" :key="index">
@click="changeStatus(index)"
v-for="(item, index) in statusList"
:key="index"
>
{{ item }} {{ item }}
</view> </view>
</view> </view>
...@@ -47,11 +39,7 @@ ...@@ -47,11 +39,7 @@
</view> </view>
<view class="ticket-right"> <view class="ticket-right">
<image <image class="img" :src="iconUrl[item.status]" v-if="item.status == 0 || item.status == 2"></image>
class="img"
:src="iconUrl[item.status]"
v-if="item.status == 0 || item.status == 2"
></image>
<view class="head"> <view class="head">
<text class="title">{{ item.couponName }}</text> <text class="title">{{ item.couponName }}</text>
<view class="headbox"> <view class="headbox">
...@@ -67,11 +55,8 @@ ...@@ -67,11 +55,8 @@
<view class="line"></view> <view class="line"></view>
<view class="footbox" @click="handleChangeDetail(index)"> <view class="footbox" @click="handleChangeDetail(index)">
<text class="desc">详细信息</text> <text class="desc">详细信息</text>
<wd-icon <wd-icon :name="item.showDetail ? 'chevron-down' : 'chevron-right'" size="15px"
:name="item.showDetail ? 'chevron-down' : 'chevron-right'" color="#9d9d9d"></wd-icon>
size="15px"
color="#9d9d9d"
></wd-icon>
</view> </view>
</view> </view>
</view> </view>
...@@ -176,18 +161,13 @@ const getCouponList = async () => { ...@@ -176,18 +161,13 @@ const getCouponList = async () => {
catalog.statuMain = currentTab.value; catalog.statuMain = currentTab.value;
catalog.statuSon = currenStatus.value; catalog.statuSon = currenStatus.value;
const res = await myCouponListApi(catalog); const res = await myCouponListApi(catalog);
if (res.code === 0) {
if (res.data.records.length > 0) { if (res.data.records.length > 0) {
res.data.records.forEach((item) => { res.data.records.forEach((item) => {
item.showDetail = false; item.showDetail = false;
}); });
couponData.value.push(...res.data.records); couponData.value.push(...res.data.records);
total.value = res.data.total; total.value = res.data.total;
} else {
state.value = 'finished';
}
} else {
state.value = 'error';
} }
state.value = 'finished'; state.value = 'finished';
}; };
...@@ -227,6 +207,7 @@ const toShop = (idx) => { ...@@ -227,6 +207,7 @@ const toShop = (idx) => {
page { page {
background: #f3f3f3; background: #f3f3f3;
} }
.container { .container {
width: 375 * 2rpx; width: 375 * 2rpx;
margin: 0 auto; margin: 0 auto;
...@@ -545,7 +526,8 @@ page { ...@@ -545,7 +526,8 @@ page {
} }
.desc { .desc {
white-space: pre-line; /* 将空格和换行符保留在文本中 */ white-space: pre-line;
/* 将空格和换行符保留在文本中 */
font-family: PingFang SC Regular; font-family: PingFang SC Regular;
font-size: 24rpx; font-size: 24rpx;
color: #333333; color: #333333;
......
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