From 340171e744dce4f464602c50bc74d52923d33fc2 Mon Sep 17 00:00:00 2001 From: From-wh Date: Tue, 13 Oct 2026 10:51:43 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=A7=BB=E5=8A=A8=E7=AB=AF):=20=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E8=BF=9B=E5=BA=A6=E6=9D=A1=E8=BF=9E=E7=BA=BF=E6=8C=89?= =?UTF-8?q?=E8=8A=82=E7=82=B9=E6=95=B0=E5=8A=A8=E6=80=81=E5=AE=9A=E4=BD=8D?= =?UTF-8?q?=EF=BC=8C=E9=80=82=E9=85=8D=E9=9D=9E5=E8=8A=82=E7=82=B9?= =?UTF-8?q?=E8=AE=A2=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/order/detail/ProgressBar.vue | 28 +++++++++++-------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/frontend/uni-app/src/dynamic-pages/components/order/detail/ProgressBar.vue b/frontend/uni-app/src/dynamic-pages/components/order/detail/ProgressBar.vue index 21f08018a..de8922c19 100644 --- a/frontend/uni-app/src/dynamic-pages/components/order/detail/ProgressBar.vue +++ b/frontend/uni-app/src/dynamic-pages/components/order/detail/ProgressBar.vue @@ -27,6 +27,7 @@ v-if="idx < nodes.length - 1" class="line" :class="nodes[idx + 1].completed ? 'bg-color' : ''" + :style="lineStyle(idx)" > @@ -61,6 +62,19 @@ const p = computed(() => (props.section && props.section.props) || {}); const ctx = computed(() => (props.section && props.section._ctx) || {}); /** 进度节点数组,每项含 {title, key, completed, active, time} */ const nodes = computed(() => p.value.nodes || []); +/** + * 连线定位:N 个节点 flex:1 均分,第 i 个点中心在 (i+0.5)×100/N%, + * 第 idx 段连线连接相邻两点中心,两端各留 2% 间隙(内联样式按节点数动态计算, + * 兼容实物 5 节点、自提/卡密 4 节点、网盘 3 节点及插件自定义节点数) + * @param {number} idx 连线段索引(连接第 idx 与 idx+1 个节点) + * @return {object} left/width 内联样式 + */ +function lineStyle(idx) { + const n = nodes.value.length; + if (n < 2) return {}; + const seg = 100 / n; + return { left: ((idx + 0.5) * seg + 2) + '%', width: (seg - 4) + '%' }; +}