feat:我的订单部分页面

This commit is contained in:
赵毅 2025-07-16 18:17:59 +08:00
parent dcde470cc5
commit 1852c98463
7 changed files with 693 additions and 84 deletions

View File

@ -49,6 +49,7 @@ page {
.order-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20rpx;
font-size: 24rpx;
color: #a3a3a3;
@ -60,6 +61,26 @@ page {
font-weight: bold;
}
.status2 {
color: #333;
font-weight: bold;
border: 1rpx solid #f83d19;
display: flex;
padding: 10rpx;
border-radius: 10rpx;
}
.status2 img {
width: 30rpx;
height: 30rpx;
margin-right: 10rpx;
}
.status3 {
color: #949494;
font-weight: bold;
}
.goods-list {
display: flex;
flex-wrap: wrap;
@ -90,7 +111,7 @@ page {
justify-content: flex-end;
}
.order-footer-text text{
.order-footer-text text {
color: #ff3710;
margin-left: 10rpx;
font-weight: bold;
@ -110,6 +131,17 @@ page {
border: 1rpx solid #ddd;
border-radius: 30rpx;
font-size: 24rpx;
margin: 0;
}
.yfd-btn {
width: 160rpx;
height: 60rpx;
background: #ffebcb;
color: #802002;
border: none;
border-radius: 30rpx;
font-size: 24rpx;
margin: 0 20rpx;
}

View File

@ -15,15 +15,26 @@
<view v-for="(category, catIndex) in categoryList" :key="catIndex">
<view v-if="selectedTab === catIndex">
<view v-for="(item, index) in orderData" :key="index">
<view class="contentList" @click="toDetails">
<view class="contentList">
<!-- 订单头部信息 -->
<view class="order-header">
<view class="order-header" @click="toDetails(item.status)">
<text>提交订单{{ item.createTime }}</text>
<text class="status">{{ item.status }}</text>
<view
v-if="item.status == '已取消' || item.status == '已完成'"
class="status3"
>{{ item.status }}</view
>
<view v-else-if="item.status == '退款中'" class="status2">
<img
src="http://localhost:8080/refund.png"
/>
{{ item.status }}
</view>
<view v-else class="status">{{ item.status }}</view>
</view>
<!-- 商品列表 -->
<view class="goods-list">
<view class="goods-list" @click="toDetails(item.status)">
<view
v-for="(goods, goodsIndex) in item.goodsList"
:key="goodsIndex"
@ -35,16 +46,51 @@
<!-- 订单底部信息 -->
<view class="order-footer">
<view class="order-footer-text"
<view class="order-footer-text" @click="toDetails(item.status)"
>{{ item.totalCount }}件商品共计
<text> {{ item.totalPrice }}</text>
</view>
<view class="btn-group">
<view>
<view class="btn-group" v-if="item.status === '待付款'">
<button class="cancel-btn" @click="cancelOrder">
取消订单
</button>
<button class="yfd-btn" @click="cancelOrder">运费单</button>
<button class="pay-btn" @click="goToPay">立即支付</button>
</view>
<view class="btn-group" v-if="item.status === '待发货'">
<button class="yfd-btn" @click="cancelOrder">运费单</button>
</view>
<view class="btn-group" v-if="item.status === '已取消'">
<button class="yfd-btn" @click="cancelOrder">运费单</button>
<button class="pay-btn" @click="cancelOrder">
再来一单
</button>
</view>
<view class="btn-group" v-if="item.status === '配送中'">
<button class="cancel-btn" @click="checkLogistics">
查看物流
</button>
<button class="yfd-btn" @click="cancelOrder">运费单</button>
<button class="pay-btn" @click="cancelOrder">
再来一单
</button>
</view>
<view class="btn-group" v-if="item.status === '已完成'">
<button class="cancel-btn" @click="cancelOrder">
服务评价
</button>
<button class="yfd-btn" @click="cancelOrder">运费单</button>
<button class="pay-btn" @click="cancelOrder">
再来一单
</button>
</view>
<view class="btn-group" v-if="item.status === '退款中'">
<button class="pay-btn" @click="cancelOrder">
再来一单
</button>
</view>
</view>
</view>
</view>
</view>
@ -54,7 +100,7 @@
</view>
</template>
<script>
import { picUrl, NavgateTo } from '../../../utils';
import { picUrl, NavgateTo } from "../../../utils";
export default {
data() {
@ -107,6 +153,45 @@ export default {
totalCount: 3,
totalPrice: "¥4704.00",
},
{
createTime: "2025-07-15 23:23:23",
status: "配送中",
goodsList: [
{ image: "http://localhost:8080/order_index1.png" },
{ image: "http://localhost:8080/order_index2.png" },
{ image: "http://localhost:8080/order_index3.png" },
{ image: "http://localhost:8080/order_index4.png" },
{ image: "http://localhost:8080/order_index5.png" },
],
totalCount: 2,
totalPrice: "¥4704.00",
},
{
createTime: "2025-07-15 23:23:23",
status: "已完成",
goodsList: [
{ image: "http://localhost:8080/order_index1.png" },
{ image: "http://localhost:8080/order_index2.png" },
{ image: "http://localhost:8080/order_index3.png" },
{ image: "http://localhost:8080/order_index4.png" },
{ image: "http://localhost:8080/order_index5.png" },
],
totalCount: 3,
totalPrice: "¥4704.00",
},
{
createTime: "2025-07-15 23:23:23",
status: "退款中",
goodsList: [
{ image: "http://localhost:8080/order_index1.png" },
{ image: "http://localhost:8080/order_index2.png" },
{ image: "http://localhost:8080/order_index3.png" },
{ image: "http://localhost:8080/order_index4.png" },
{ image: "http://localhost:8080/order_index5.png" },
],
totalCount: 3,
totalPrice: "¥4704.00",
},
],
};
},
@ -129,8 +214,12 @@ export default {
goToPay() {
console.log("🚀 ~ goToPay ~ goToPay:", "去支付...");
},
toDetails() {
NavgateTo("/packages/myOrders/orderDetails/index");
toDetails(status) {
NavgateTo(`/packages/myOrders/orderDetails/index?status=${status}`);
},
checkLogistics() {
NavgateTo(`/packages/myOrders/logistics/index`);
},
},
};

View File

@ -0,0 +1,215 @@
/* 全局样式 */
page {
background-color: #f5f7fa;
font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
padding-bottom: 10rpx;
}
.container {
padding: 0 10rpx 40rpx;
}
/* 地图容器 */
.map-container {
height: 110vh;
border-radius: 16rpx;
overflow: hidden;
margin: 30rpx 20rpx;
position: relative;
box-shadow: 0 8rpx 20rpx rgba(0, 0, 0, 0.08);
}
/* 卡片通用样式 */
.address-card,
.info-card {
background: white;
border-radius: 16rpx;
padding: 30rpx;
margin: 0 20rpx 30rpx;
box-shadow: 0 8rpx 20rpx rgba(0, 0, 0, 0.05);
position: absolute;
top: 500rpx;
left: 30rpx;
right: 30rpx;
}
/* 信息卡片 */
.info-row {
display: flex;
align-items: center;
padding: 20rpx 0;
border-bottom: 1rpx solid #f0f0f0;
justify-content: space-between;
}
.info-row:last-child {
border-bottom: none;
}
.info-icon {
width: 36rpx;
height: 36rpx;
margin-right: 15rpx;
}
.info-label {
font-size: 28rpx;
color: #333;
min-width: 120rpx;
font-weight: 700;
}
.info-value {
font-size: 28rpx;
color: #333;
font-weight: 500;
/* flex: 1; */
}
.info-value text{
font-size: 28rpx;
color: #f25233;
font-weight: 500;
margin-left: 15rpx;
}
.copy-btn {
width: 35rpx;
height: 35rpx;
float: right;
margin-left: 20rpx;
}
/* 时间轴样式 */
.timeline {
position: relative;
background: white;
border-radius: 16rpx;
padding: 30rpx;
margin: 0 20rpx;
box-shadow: 0 8rpx 20rpx rgba(0, 0, 0, 0.05);
position: absolute;
top: 820rpx;
left: 30rpx;
right: 30rpx;
}
.timeline-title {
font-size: 34rpx;
font-weight: bold;
color: #333;
margin-bottom: 30rpx;
padding-left: 20rpx;
position: relative;
}
.timeline-title::before {
content: '';
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
width: 8rpx;
height: 36rpx;
background: #f25233;
border-radius: 8rpx;
}
.timeline-item {
position: relative;
padding-left: 60rpx;
margin-bottom: 40rpx;
}
.timeline-item:last-child {
margin-bottom: 0;
}
.timeline-dot {
position: absolute;
left: 20rpx;
top: 8rpx;
width: 20rpx;
height: 20rpx;
border-radius: 50%;
background: #f25233;
z-index: 2;
}
.timeline-item.active .timeline-dot {
background: #ffffff;
width: 15rpx;
height: 15rpx;
left: 22rpx;
top: 6rpx;
box-shadow: 0 0 0 6rpx #f25233;
}
.timeline-line {
position: absolute;
left: 29rpx;
top: 28rpx;
bottom: -40rpx;
width: 2rpx;
background: #f25233;
z-index: 1;
}
.timeline-item:last-child .timeline-line {
display: none;
}
.timeline-status {
font-size: 32rpx;
font-weight: bold;
margin-bottom: 8rpx;
color: #333;
}
.timeline-item.active .timeline-status {
color: #333;
}
.timeline-desc {
font-size: 28rpx;
color: #a3a3a3;
margin-bottom: 10rpx;
line-height: 1.5;
}
.driver-details {
background: #f9f9f9;
border-radius: 10rpx;
padding: 15rpx;
margin: 15rpx 0;
}
.detail-item {
display: flex;
align-items: center;
font-size: 26rpx;
color: #555;
margin-bottom: 10rpx;
}
.detail-item-phone {
font-size: 28rpx;
color: #f25233;
margin-bottom: 10rpx;
margin-left: 20rpx;
}
.detail-item:last-child {
margin-bottom: 0;
}
.detail-icon {
width: 28rpx;
height: 28rpx;
margin-right: 10rpx;
}
.timeline-time {
font-size: 26rpx;
color: #999;
}

View File

@ -0,0 +1,169 @@
<template>
<view class="container">
<!-- 地图区域 -->
<view class="map-container">
<map
id="deliveryMap"
:latitude="latitude"
:longitude="longitude"
:markers="markers"
:polyline="polyline"
:include-points="points"
style="width: 100%; height: 110%"
>
</map>
</view>
<!-- 物流信息 -->
<view class="info-card">
<view class="info-row">
<text class="info-label">运单号</text>
<view>
<text class="info-value">YD999999</text>
<img
class="copy-btn"
@click="copyNumber"
src="http://localhost:8080/copy.png"
alt="复制"
/>
</view>
</view>
<view class="info-row">
<text class="info-label">收件人</text>
<text class="info-value">
小王
<text>1388888888</text>
</text>
</view>
<view class="info-row">
<text class="info-label">车牌号</text>
<text class="info-value">京ALN233</text>
</view>
</view>
<!-- 物流时间轴 -->
<view class="timeline">
<!-- 已签收 -->
<view class="timeline-item active">
<view class="timeline-dot"></view>
<view class="timeline-line"></view>
<view class="timeline-content">
<view class="timeline-status">已签收</view>
<view class="timeline-desc">您的订单已被签收感谢您的支持</view>
<view class="timeline-time">2021-04-16 20:30:24</view>
</view>
</view>
<!-- 派送中 -->
<view class="timeline-item">
<view class="timeline-dot"></view>
<view class="timeline-line"></view>
<view class="timeline-content">
<view class="timeline-status">派送中</view>
<view class="timeline-desc">您的订单正在派送中</view>
<view class="timeline-desc">
<view
>配送司机小王
<text class="detail-item-phone">1388888888</text>
</view>
</view>
<view class="timeline-desc">
<text>车牌号京ALN233</text>
</view>
<view class="timeline-time">2021-04-16 20:06:24</view>
</view>
</view>
<!-- 仓库处理 -->
<view class="timeline-item">
<view class="timeline-dot"></view>
<view class="timeline-line"></view>
<view class="timeline-content">
<view class="timeline-status">仓库处理中</view>
<view class="timeline-desc">拣货完成</view>
<view class="timeline-time">2021-04-16 20:30:24</view>
</view>
</view>
<!-- 已下单 -->
<view class="timeline-item">
<view class="timeline-dot"></view>
<view class="timeline-line"></view>
<view class="timeline-content">
<view class="timeline-status">已下单</view>
<view class="timeline-desc">您提交了订单预计2020-04-29送达</view>
<view class="timeline-time">2021-04-16 20:30:24</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
//
latitude: 39.90469,
longitude: 116.40717,
//
markers: [
{
id: 1,
latitude: 39.90469,
longitude: 116.40717,
title: "目的地",
iconPath: "/static/destination.png",
width: 36,
height: 36,
},
{
id: 2,
latitude: 39.915,
longitude: 116.42,
title: "当前位置",
iconPath: "/static/current.png",
width: 40,
height: 40,
},
],
// 线
polyline: [
{
points: [
{ latitude: 39.915, longitude: 116.42 },
{ latitude: 39.91, longitude: 116.415 },
{ latitude: 39.907, longitude: 116.41 },
{ latitude: 39.90469, longitude: 116.40717 },
],
color: "#07C160",
width: 6,
dottedLine: false,
},
],
//
points: [
{ latitude: 39.915, longitude: 116.42 },
{ latitude: 39.90469, longitude: 116.40717 },
],
};
},
methods: {
copyNumber() {
uni.setClipboardData({
data: "YD999999",
success: () => {
uni.showToast({ title: "运单号已复制", icon: "success" });
},
});
},
},
};
</script>
<style>
@import url("./index.css");
</style>

View File

@ -25,6 +25,14 @@ page {
.tips {
font-size: 24rpx;
opacity: 0.9;
display: flex;
align-items: center;
}
.phone {
width: 30rpx;
height: 30rpx;
margin-left: 5rpx;
}
/* 订单金额 */
@ -67,11 +75,27 @@ page {
}
.goods-item {
/* display: flex;
margin-bottom: 20rpx;
margin-top: 20rpx; */
}
.goods-content {
display: flex;
margin-bottom: 20rpx;
margin-top: 20rpx;
}
.goods-info-tk{
width: 150rpx;
height: 35rpx;
position: relative;
left: 550rpx;
font-size: 26rpx;
font-weight: bold;
color: #fe380c;
}
.goods-img {
width: 120rpx;
height: 120rpx;
@ -159,7 +183,7 @@ page {
font-size: 26rpx;
}
.info-value text{
.info-value text {
color: #f64927;
font-size: 26rpx;
margin-left: 10rpx;
@ -188,7 +212,17 @@ page {
height: 80rpx;
background: #d9d9d9;
color: #333;
border: 1rpx solid #ddd;
border-radius: 8rpx;
margin-right: 20rpx;
font-size: 30rpx;
border-radius: 50rpx;
}
.yfd-btn {
flex: 1;
height: 80rpx;
background: #ffebcb;
color: #802002;
border-radius: 8rpx;
margin-right: 20rpx;
font-size: 30rpx;

View File

@ -1,25 +1,56 @@
<template>
<view class="container">
<!-- 顶部状态栏 -->
<view class="status-bar">
<view class="status-bar" v-if="status === '待付款'">
<view class="status">待付款</view>
<view class="countdown">剩余支付时间: {{ countdown }}</view>
<view class="tips">10分钟内未支付订单自动取消</view>
</view>
<view class="status-bar" v-if="status === '待发货'">
<view class="status">待发货</view>
<view class="countdown">预计到货时间: 2025-09-09 9:59:59</view>
<view class="tips">商家正在加急打包中了请耐心等候</view>
</view>
<view class="status-bar" v-if="status === '配送中'">
<view class="status">待配送</view>
<view class="countdown">预计到货时间: 2025-09-09 9:59:59</view>
<view class="tips">
配送司机15901518415
<img class="phone" src="http://localhost:8080/phone.png" />
</view>
</view>
<view class="status-bar" v-if="status === '已完成' || status === '退款中'">
<view class="status">已完成</view>
<view class="countdown">预计到货时间: 2025-09-09 9:59:59</view>
<view class="tips">感谢对我们的信任期待下次光临</view>
</view>
<view class="status-bar" v-if="status === '已取消'">
<view class="status">已取消</view>
<view class="countdown">订单已取消</view>
<view class="tips">您的订单已取消再来一单吧</view>
</view>
<!-- <view class="status-bar" v-if="status === '退款中'">
<view class="status">已完成</view>
<view class="countdown">预计到货时间: 2025-09-09 9:59:59</view>
<view class="tips">感谢对我们的信任期待下次光临</view>
</view> -->
<view class="content">
<!-- 订单金额 -->
<view class="amount-section">
<view v-if="status !== '退款中'">
<view class="total-amount">¥{{ orderInfo.totalAmount }}</view>
<view class="original-price"
>商品下单应付
<text> ¥{{ orderInfo.originalPrice }}</text>
</view>
</view>
<view
class="goods-item"
v-for="(item, index) in orderInfo.goodsList"
:key="index"
>
<view class="goods-content">
<image :src="item.image" class="goods-img"></image>
<view class="goods-info">
<view>
@ -32,6 +63,8 @@
</view>
</view>
</view>
<view v-if="status === '退款中'" class="goods-info-tk">退款已完成</view>
</view>
<view class="hr"></view>
<view class="info-item">
<view class="info-label1"
@ -49,6 +82,7 @@
</view>
</view>
<view v-if="status !== '退款中'">
<!-- 配送信息 -->
<view class="delivery-info">
<view class="section-title">配送信息</view>
@ -100,18 +134,43 @@
</view>
<!-- 底部操作按钮 -->
<view class="bottom-buttons">
<view class="bottom-buttons" v-if="status === '待付款'">
<button class="cancel-btn" @click="cancelOrder">取消订单</button>
<button class="yfd-btn" @click="cancelOrder">运费单</button>
<button class="pay-btn" @click="gotoPayment">立即支付</button>
</view>
<view class="bottom-buttons" v-if="status === '待发货'">
<button class="yfd-btn" @click="cancelOrder">运费单</button>
<button class="cancel-btn" @click="cancelOrder">取消订单</button>
<!-- <button class="pay-btn" @click="gotoPayment">立即支付</button> -->
</view>
<view class="bottom-buttons" v-if="status === '配送中'">
<button class="cancel-btn" @click="checkLogistics">查看物流</button>
<button class="yfd-btn" @click="cancelOrder">运费单</button>
<button class="pay-btn" @click="gotoPayment">立即支付</button>
</view>
<view class="bottom-buttons" v-if="status === '已完成'">
<button class="cancel-btn" @click="cancelOrder">服务评价</button>
<button class="yfd-btn" @click="cancelOrder">运费单</button>
<button class="pay-btn" @click="gotoPayment">立即支付</button>
</view>
<view class="bottom-buttons" v-if="status === '已取消'">
<button class="yfd-btn" @click="cancelOrder">运费单</button>
<!-- <button class="cancel-btn" @click="cancelOrder">服务评价</button> -->
<button class="pay-btn" @click="gotoPayment">再来一单</button>
</view>
</view>
</view>
</view>
</template>
<script>
import { picUrl, NavgateTo } from "../../../utils";
export default {
data() {
return {
status: "",
countdown: "9:59:59",
orderInfo: {
totalAmount: "4704.00",
@ -155,9 +214,10 @@ export default {
},
};
},
onLoad() {
onLoad(options) {
//
this.startCountdown();
options?.status === "待付款" ? this.startCountdown() : "";
this.status = options?.status;
},
methods: {
startCountdown() {
@ -194,10 +254,14 @@ export default {
});
},
gotoPayment() {
console.log("🚀 ~ gotoPayment ~ 去支付:");
//
uni.navigateTo({
url: "/kitchen/pay/index",
});
// uni.navigateTo({
// url: "/kitchen/pay/index",
// });
},
checkLogistics() {
NavgateTo(`/packages/myOrders/logistics/index`);
},
},
};

View File

@ -755,6 +755,12 @@
"style": {
"navigationBarTitleText": "我的订单"
}
},
{
"path": "logistics/index",
"style": {
"navigationBarTitleText": "物流跟踪"
}
}
]
}