订单

parent f734b380
...@@ -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