订单

parent f734b380
......@@ -5,18 +5,9 @@
<!-- 使用状态 -->
<view class="status">
<view class="status-box">
<wd-icon
name="check-outline"
size="26px"
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>
<wd-icon name="check-outline" size="26px" 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>
<view class="detail" v-if="orderDetail.status == 3">
......@@ -64,13 +55,10 @@
<text class="title1" v-if="orderDetail.status != 2 || orderDetail.status != 3">
券码信息
</text>
<text
:class="
orderDetail.status == 5 || orderDetail.status == 6 || orderDetail.status == 7
? 'linethrough'
: 'phone'
"
>
<text :class="orderDetail.status == 5 || orderDetail.status == 6 || orderDetail.status == 7
? 'linethrough'
: 'phone'
">
{{ orderDetail.orderNumber.slice(6) }}
</text>
</view>
......@@ -259,14 +247,13 @@ onLoad((options) => {
const orderDetail = ref();
const getDetail = async () => {
const res = await getOrderDetail({ orderNumber: orderNumber.value });
if (res.code === 0) {
orderDetail.value = res.data;
if (orderDetail.value.status === '2' || orderDetail.value.status === '3') {
codeDetail(orderDetail.value.orderNumber);
}
getProductDetail(orderDetail.value.orderItems[0].prodId);
getShopMailDetail(orderDetail.value.shopId);
orderDetail.value = res.data;
if (orderDetail.value.status === '2' || orderDetail.value.status === '3') {
codeDetail(orderDetail.value.orderNumber);
}
getProductDetail(orderDetail.value.orderItems[0].prodId);
getShopMailDetail(orderDetail.value.shopId);
};
/**
......@@ -290,9 +277,7 @@ const codeDetail = (item) => {
const prodDetail = ref();
const getProductDetail = async (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) => {
const shopDetail = ref();
const getShopMailDetail = async (id) => {
const res = await getShopDetail({ shopId: id });
if (res.code === 0) {
shopDetail.value = res.data.shop;
}
shopDetail.value = res.data.shop;
};
const maskPhoneNumber = (phone) => {
......@@ -374,6 +357,7 @@ page {
.container {
width: 375 * 2rpx;
margin: 0 auto;
.content {
padding-top: 44px;
display: flex;
......
......@@ -161,20 +161,15 @@ const getList = async () => {
catalog.current++;
state.value = 'loading';
const res = await getOrderList(catalog);
if (res.code === 0) {
if (res.data.records.length > 0) {
res.data.records.forEach((item) => {
if (item.status === '1') {
item.countDown = calculateCountdown(item.createTime);
}
});
dataList.value.push(...res.data.records);
total.value = res.data.total;
} else {
state.value = 'finished';
}
} else {
state.value = 'error';
if (res.data.records.length > 0) {
res.data.records.forEach((item) => {
// 待付款倒计时计算
if (item.status === '1') {
item.countDown = calculateCountdown(item.createTime);
}
});
dataList.value.push(...res.data.records);
total.value = res.data.total;
}
state.value = 'finished';
};
......@@ -222,18 +217,11 @@ const handleDelete = (orderNumber) => {
success: async (res) => {
if (res.confirm) {
const res = await deleteOrderApi(orderNumber);
if (res.code === 0) {
uni.showToast({
title: '删除成功',
icon: 'success',
});
initDataList();
} else {
uni.showToast({
title: '删除失败',
icon: 'error',
});
}
uni.showToast({
title: '删除成功',
icon: 'success',
});
initDataList();
}
},
});
......@@ -250,18 +238,11 @@ const handleCancel = (orderNumber) => {
success: async (res) => {
if (res.confirm) {
const res = await cancelOrderApi({ orderNumber });
if (res.code === 0) {
uni.showToast({
title: '取消成功',
icon: 'success',
});
initDataList();
} else {
uni.showToast({
title: '取消失败',
icon: 'error',
});
}
uni.showToast({
title: '取消成功',
icon: 'success',
});
initDataList();
}
},
});
......
<template>
<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>
</template>
......@@ -16,5 +31,12 @@ page {
.container {
width: 375 * 2rpx;
margin: 0 auto;
.content {
padding-top: 44px;
display: flex;
flex-direction: column;
gap: 20rpx;
}
}
</style>
......@@ -177,18 +177,10 @@ const handleChangeDetail = (idx) => {
*/
const getCoupon = async (item) => {
const res = await receiveCoupon([item.couponYzfId]);
if (res.code === 0) {
item.numState = 1;
xma.showToast({
title: '领取成功',
icon: 'success',
duration: 2000,
});
return;
}
item.numState = 1;
xma.showToast({
title: '领取失败',
icon: 'error',
title: '领取成功',
icon: 'success',
duration: 2000,
});
};
......@@ -212,20 +204,12 @@ const getCouponAll = async () => {
return;
}
const res = await receiveCoupon(ids);
if (res.code === 0) {
couponData.value.forEach((item) => {
item.numState = 1;
});
xma.showToast({
title: '领取成功',
icon: 'success',
duration: 2000,
});
return;
}
couponData.value.forEach((item) => {
item.numState = 1;
});
xma.showToast({
title: '领取失败',
icon: 'error',
title: '领取成功',
icon: 'success',
duration: 2000,
});
};
......
......@@ -2,12 +2,8 @@
<view class="container">
<Header title="我的券"></Header>
<view class="tab">
<view
:class="currentTab == index ? 'tab-select' : 'tab-item'"
@click="changeTab(index)"
v-for="(item, index) in tabList"
:key="index"
>
<view :class="currentTab == index ? 'tab-select' : 'tab-item'" @click="changeTab(index)"
v-for="(item, index) in tabList" :key="index">
{{ item }}
</view>
</view>
......@@ -19,12 +15,8 @@
<!-- 优惠券状态 -->
<view class="status">
<view
:class="currenStatus == index ? 'status-select' : 'status-item'"
@click="changeStatus(index)"
v-for="(item, index) in statusList"
:key="index"
>
<view :class="currenStatus == index ? 'status-select' : 'status-item'" @click="changeStatus(index)"
v-for="(item, index) in statusList" :key="index">
{{ item }}
</view>
</view>
......@@ -47,11 +39,7 @@
</view>
<view class="ticket-right">
<image
class="img"
:src="iconUrl[item.status]"
v-if="item.status == 0 || item.status == 2"
></image>
<image class="img" :src="iconUrl[item.status]" v-if="item.status == 0 || item.status == 2"></image>
<view class="head">
<text class="title">{{ item.couponName }}</text>
<view class="headbox">
......@@ -67,11 +55,8 @@
<view class="line"></view>
<view class="footbox" @click="handleChangeDetail(index)">
<text class="desc">详细信息</text>
<wd-icon
:name="item.showDetail ? 'chevron-down' : 'chevron-right'"
size="15px"
color="#9d9d9d"
></wd-icon>
<wd-icon :name="item.showDetail ? 'chevron-down' : 'chevron-right'" size="15px"
color="#9d9d9d"></wd-icon>
</view>
</view>
</view>
......@@ -176,19 +161,14 @@ const getCouponList = async () => {
catalog.statuMain = currentTab.value;
catalog.statuSon = currenStatus.value;
const res = await myCouponListApi(catalog);
if (res.code === 0) {
if (res.data.records.length > 0) {
res.data.records.forEach((item) => {
item.showDetail = false;
});
couponData.value.push(...res.data.records);
total.value = res.data.total;
} else {
state.value = 'finished';
}
} else {
state.value = 'error';
}
if (res.data.records.length > 0) {
res.data.records.forEach((item) => {
item.showDetail = false;
});
couponData.value.push(...res.data.records);
total.value = res.data.total;
}
state.value = 'finished';
};
getCouponList();
......@@ -227,6 +207,7 @@ const toShop = (idx) => {
page {
background: #f3f3f3;
}
.container {
width: 375 * 2rpx;
margin: 0 auto;
......@@ -545,7 +526,8 @@ page {
}
.desc {
white-space: pre-line; /* 将空格和换行符保留在文本中 */
white-space: pre-line;
/* 将空格和换行符保留在文本中 */
font-family: PingFang SC Regular;
font-size: 24rpx;
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