From 7618492df515fb640482261ff03b5d945c5b2ddb Mon Sep 17 00:00:00 2001 From: cjl520cy <8149487+cy250cy-520@user.noreply.gitee.com> Date: Wed, 29 Apr 2026 16:41:21 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/shop/buy-order.vue | 2 +- pages/shop/components/orderCard.vue | 82 ++++++++++++++++++----------- pages/shop/manHour/saleList.vue | 8 +-- pages/shop/userorder-detail.vue | 5 +- 4 files changed, 58 insertions(+), 39 deletions(-) diff --git a/pages/shop/buy-order.vue b/pages/shop/buy-order.vue index 1cdab7f..8d6fa7d 100644 --- a/pages/shop/buy-order.vue +++ b/pages/shop/buy-order.vue @@ -15,7 +15,7 @@ - 订单编号:{{order.number}} + 服务时段:{{order.number}} - {{ stateText }} - + }" v-if="showState"> + {{ stateText }} + - - + @@ -30,12 +29,13 @@ - 下单时间: {{ dataItem.add_time }} + 下单时间: + {{ dataItem.add_time }} - + {{`团购价: `}}¥{{ dataItem.order_money }} - {{ dataItem.line_money }} + {{ dataItem.line_money }} @@ -83,49 +83,49 @@ useTime() { const start = this.dataItem.reservation_time; const server_time = this.dataItem.server_time || 0; - + // 格式化时间范围:输出 2025年05月29 12:30-13:30 格式 function formatTimeRange(startTimeStr, serviceMinutes) { // 1. 空值兜底:避免无开始时间时报错 if (!startTimeStr) return ""; - + // 2. 兼容低版本iOS:iOS不识别 "-" 分隔的日期,必须替换为 "/" const iosSafeTimeStr = startTimeStr.replace(/-/g, "/"); const startTime = new Date(iosSafeTimeStr); - + // 校验时间有效性 if (isNaN(startTime.getTime())) { console.error("无效的开始时间格式:", startTimeStr); return ""; } - + // 3. 计算结束时间(开始时间 + 服务分钟数) const endTime = new Date(startTime.getTime() + serviceMinutes * 60 * 1000); - + // 格式化年份:YYYY年 const formatYear = (date) => { return date.getFullYear() + '年'; }; - + // 格式化月份和日期:MM月DD(补零) const formatMonthDay = (date) => { const month = String(date.getMonth() + 1).padStart(2, "0"); const day = String(date.getDate()).padStart(2, "0"); return `${month}月${day}`; }; - + // 格式化时间部分:HH:MM(补零) const formatTimePart = (date) => { const hours = String(date.getHours()).padStart(2, "0"); const minutes = String(date.getMinutes()).padStart(2, "0"); return `${hours}:${minutes}`; }; - + // 4. 判断是否同一天 const isSameDay = startTime.getFullYear() === endTime.getFullYear() && - startTime.getMonth() === endTime.getMonth() && - startTime.getDate() === endTime.getDate(); - + startTime.getMonth() === endTime.getMonth() && + startTime.getDate() === endTime.getDate(); + // 5. 拼接最终格式 if (isSameDay) { // 同一天:2025年05月29 12:30-13:30 @@ -135,7 +135,7 @@ return `${formatYear(startTime)}${formatMonthDay(startTime)} ${formatTimePart(startTime)}-${formatYear(endTime)}${formatMonthDay(endTime)} ${formatTimePart(endTime)}`; } } - + // 兜底:如果start为空,返回空字符串避免报错 return start ? formatTimeRange(start, server_time) : ""; }, @@ -233,12 +233,13 @@ align-items: center; justify-content: center; } - - .stateText2{ + + .stateText2 { background-image: url("/static/images/icons/tabBj2.png"); color: #333; } - .stateText3{ + + .stateText3 { background-image: url("/static/images/icons/tabBj2.png"); color: #999999 !important; } @@ -256,8 +257,8 @@ padding-bottom: 24rpx; border-bottom: 1px solid #f6f5f5; } - - .noFotter{ + + .noFotter { border-bottom: none; padding-bottom: 0rpx; } @@ -286,6 +287,7 @@ line-height: 34rpx; text-align: left; font-style: normal; + .service-price-line { font-weight: 400; font-size: 24rpx; @@ -351,13 +353,15 @@ margin-top: 28rpx; display: flex; align-items: center; - .time-info-img{ + + .time-info-img { width: 40rpx; height: 40rpx; margin-right: 10rpx; border-radius: 50%; } - .time-info-name{ + + .time-info-name { font-weight: 400; font-size: 26rpx; color: #333333; @@ -365,8 +369,22 @@ text-align: left; font-style: normal; margin-right: 20rpx; + max-width: 110rpx; + overflow: hidden; + word-break: break-all; + /* break-all(允许在单词内换行。) */ + text-overflow: ellipsis; + /* 超出部分省略号 */ + display: -webkit-box; + /** 对象作为伸缩盒子模型显示 **/ + -webkit-box-orient: vertical; + /** 设置或检索伸缩盒对象的子元素的排列方式 **/ + -webkit-line-clamp: 1; + /** 显示的行数 **/ + } - .time-info-text1{ + + .time-info-text1 { font-weight: 400; font-size: 26rpx; color: #999999; @@ -374,8 +392,10 @@ text-align: left; font-style: normal; // margin-right: 20rpx; + white-space: nowrap; } - .time-info-text2{ + + .time-info-text2 { font-weight: 400; font-size: 26rpx; color: #333333; diff --git a/pages/shop/manHour/saleList.vue b/pages/shop/manHour/saleList.vue index 1a6741a..09ba921 100644 --- a/pages/shop/manHour/saleList.vue +++ b/pages/shop/manHour/saleList.vue @@ -57,10 +57,10 @@ export default { text: "全部", }, - // { - // id: 1, - // text: "待支付", - // }, + { + id: 1, + text: "待支付", + }, { id: 2, text: "待接单", diff --git a/pages/shop/userorder-detail.vue b/pages/shop/userorder-detail.vue index 9d9aaa4..4331ac0 100644 --- a/pages/shop/userorder-detail.vue +++ b/pages/shop/userorder-detail.vue @@ -15,12 +15,11 @@ }} - - + - + {{ `${orderInfo.order_username} ${orderInfo.phone_user}` }}