Commit 8cdd7a0f authored by 王炽's avatar 王炽

Merge branch 'feihesanqi_20251014' of...

Merge branch 'feihesanqi_20251014' of http://gitlab2.dui88.com/fh/20250528_FHQ1 into feihesanqi_20251014
parents 1a78f809 240c2de4
......@@ -88,9 +88,14 @@
padding: 15rpx 8rpx;
position: relative;
cursor: pointer;
transition: all 0.3s ease;
color: #503404;
box-sizing: border-box;
// 防止tab切换时出现阴影闪现的关键样式
-webkit-tap-highlight-color: transparent; // 移除移动端点击高亮
-webkit-touch-callout: none; // 禁用长按菜单
outline: none; // 移除焦点轮廓
-webkit-appearance: none; // 移除默认外观
appearance: none; // 标准属性
&.active {
color: #1C1C1C;
......
......@@ -87,7 +87,8 @@
<view v-for="(good, goodIndex) in creditsSaleData.sessions[currentSessionIndex]?.goods || []"
:key="goodIndex" class="credits_sale_good_item">
<!-- 商品图片 -->
<view class="good_image_placeholder">
<view class="good_image_placeholder"
@click="!getGoodButtonInfo(good, creditsSaleData.sessions[currentSessionIndex]).disabled && handleCreditsSaleClickThrottled(good)">
<image v-if="good.image" :src="good.image" mode="aspectFill" class="good_image" />
</view>
<!-- 商品信息容器 -->
......
......@@ -4,24 +4,35 @@
<view class="logistics-header">
<view class="logistics-info">
<view class="company-info">
<text class="company-name">{{ logisticsData.logisticsCompanyName || '快递公司' }}</text>
<text class="express-code">{{ logisticsData.expressCode || '暂无运单号' }}</text>
<text class="company-name">{{ currentLogistics.logisticsCompanyName || '快递公司' }}</text>
<text class="express-code">{{ currentLogistics.expressCode || '暂无运单号' }}</text>
</view>
<view class="status-info" v-if="logisticsData.statusDesc">
<text class="status-desc">{{ logisticsData.statusDesc }}</text>
<view class="status-info">
<text class="status-desc">{{ currentLogistics.parcelStatusDesc || currentLogistics.statusDesc || '暂无状态' }}</text>
</view>
</view>
</view>
<!-- 多个包裹切换(如果有多个) -->
<view class="parcel-tabs" v-if="logisticsList.length > 1">
<view class="tab-item"
v-for="(item, index) in logisticsList"
:key="index"
:class="{ 'active': activeParcelIndex === index }"
@tap="switchParcel(index)">
{{ item.logisticsCompanyName }} - {{ item.expressCode }}
</view>
</view>
<!-- 物流时间轴 -->
<view class="logistics-timeline" v-if="logisticsData.processDetailList && logisticsData.processDetailList.length > 0">
<view class="timeline-item" v-for="(item, index) in logisticsData.processDetailList" :key="index">
<view class="logistics-timeline" v-if="currentLogistics.processDetailList && currentLogistics.processDetailList.length > 0">
<view class="timeline-item" v-for="(item, index) in currentLogistics.processDetailList" :key="index">
<!-- 时间轴点和线 -->
<view class="timeline-line">
<view class="timeline-dot" :class="{ 'active': index === 0 }">
<view class="dot-inner" v-if="index === 0"></view>
</view>
<view class="timeline-line-vertical" v-if="index < logisticsData.processDetailList.length - 1"></view>
<view class="timeline-line-vertical" v-if="index < currentLogistics.processDetailList.length - 1"></view>
</view>
<!-- 物流信息内容 -->
......@@ -51,8 +62,18 @@
export default {
data() {
return {
// 物流数据
logisticsData: {
// 物流数据列表(支持多个包裹)
logisticsList: [],
// 当前激活的包裹索引
activeParcelIndex: 0,
// 加载状态
loading: true
}
},
computed: {
// 当前显示的物流信息
currentLogistics() {
return this.logisticsList[this.activeParcelIndex] || {
logisticsCompanyName: '',
logisticsCompanyCode: '',
expressCode: '',
......@@ -60,9 +81,7 @@
parcelStatusDesc: '',
lastUpdateTime: '',
processDetailList: []
},
// 加载状态
loading: true
};
}
},
onLoad(options) {
......@@ -80,23 +99,38 @@
order_no: this.orderId
});
if (res && res.data) {
// 假设接口返回的数据结构为 { ok, data: { processDetailList, ... } }
// 调整为页面需要的数据结构
this.logisticsData = {
if (res && res.ok && res.data) {
// 支持多个物流包裹的情况
if (Array.isArray(res.data)) {
// 确保每个包裹的数据结构完整
this.logisticsList = res.data.map(item => ({
logisticsCompanyName: item.logisticsCompanyName || '',
logisticsCompanyCode: item.logisticsCompanyCode || '',
expressCode: item.expressCode || '',
statusDesc: item.statusDesc || '',
parcelStatusDesc: item.parcelStatusDesc || '',
lastUpdateTime: item.lastUpdateTime || '',
processDetailList: item.processDetailList || []
}));
} else {
// 单个包裹的情况,转为数组格式
this.logisticsList = [{
logisticsCompanyName: res.data.logisticsCompanyName || '',
logisticsCompanyCode: res.data.logisticsCompanyCode || '',
expressCode: res.data.expressCode || '',
statusDesc: res.data.statusDesc || res.data.parcelStatusDesc || '',
statusDesc: res.data.statusDesc || '',
parcelStatusDesc: res.data.parcelStatusDesc || '',
lastUpdateTime: res.data.lastUpdateTime || '',
processDetailList: res.data.processDetailList || []
};
}];
}
} else {
console.error('物流数据获取失败');
this.logisticsList = [];
}
} catch (error) {
console.error('获取物流信息异常:', error);
this.logisticsList = [];
} finally {
this.loading = false;
}
......@@ -105,9 +139,8 @@
formatTime(timeStr) {
if (!timeStr) return '';
// 假设时间格式为 yyyy-MM-dd HH:mm:ss
// 需要转换为 MM.dd HH:mm 格式
const date = new Date(timeStr);
// 支持时间戳格式
const date = typeof timeStr === 'number' ? new Date(timeStr) : new Date(timeStr);
if (isNaN(date.getTime())) return timeStr;
const month = (date.getMonth() + 1).toString().padStart(2, '0');
......@@ -116,6 +149,12 @@
const minutes = date.getMinutes().toString().padStart(2, '0');
return `${month}.${day} ${hours}:${minutes}`;
},
// 切换包裹
switchParcel(index) {
if (index >= 0 && index < this.logisticsList.length) {
this.activeParcelIndex = index;
}
}
}
}
......@@ -165,6 +204,37 @@
color: #666666;
}
/* 包裹切换标签样式 */
.parcel-tabs {
background-color: #ffffff;
margin-top: 20rpx;
padding: 20rpx 30rpx;
display: flex;
overflow-x: auto;
white-space: nowrap;
border-bottom: 1rpx solid #e5e5e5;
}
.parcel-tabs::-webkit-scrollbar {
display: none;
}
.tab-item {
padding: 10rpx 20rpx;
margin-right: 20rpx;
border-radius: 16rpx;
background-color: #f5f5f5;
font-size: 26rpx;
color: #666666;
flex-shrink: 0;
}
.tab-item.active {
background-color: #fff0e6;
color: #ff6600;
font-weight: 500;
}
/* 物流时间轴样式 */
.logistics-timeline {
margin-top: 20rpx;
......@@ -265,4 +335,4 @@
.bottom-space {
height: 40rpx;
}
</style>
</style>
......@@ -511,7 +511,8 @@ export default {
// 设置物流信息(仅实物商品)
if (this.orderData.productType === 'physical' && this.orderData.express && Object.keys(this.orderData.express).length > 0) {
this.orderData.logisticsCompany = this.orderData.express.company || '';
this.orderData.trackingNumber = this.orderData.express.trackingNumber || '';
// 优先从trackingNumber获取,如果不存在则尝试从order_no获取
this.orderData.trackingNumber = this.orderData.express.trackingNumber || this.orderData.express.order_no || '';
}
// 设置有效期和使用说明(非实物商品)
......
......@@ -556,13 +556,13 @@ const handleCreditsSaleClick = (params) => {
console.log('点击抢购商品:', good, '活动ID:', activityId, '场次Key:', sessionKey);
// 检查库存
if (good.stock <= 0) {
uni.showToast({
title: '商品已售罄',
icon: 'none'
});
return;
}
// if (good.stock <= 0) {
// uni.showToast({
// title: '商品已售罄',
// icon: 'none'
// });
// return;
// }
// 检查用户是否登录
// if (!islogin.value) {
......@@ -574,10 +574,10 @@ const handleCreditsSaleClick = (params) => {
// }
// 这里可以添加跳转到商品详情页或购买页面的逻辑
uni.showToast({
title: '抢购商品:' + good.name,
icon: 'none'
});
// uni.showToast({
// title: '抢购商品:' + good.name,
// icon: 'none'
// });
// 构建跳转URL,添加activityId和sessionKey参数
const url = `/v3/goodDetail/goodDetail?gid=${good.id}&activityId=${activityId}&sessionKey=${sessionKey}`;
......
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