张田田 před 1 měsícem
rodič
revize
2a49c7233f

+ 5 - 0
.idea/workspace.xml

@@ -7,6 +7,11 @@
     <list default="true" id="ade0a8c5-0639-4f05-956a-aae1181b5d18" name="更改" comment="">
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/miniprogram/module/order/pages/logistics-detail/logistics-detail.scss" beforeDir="false" afterPath="$PROJECT_DIR$/miniprogram/module/order/pages/logistics-detail/logistics-detail.scss" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/miniprogram/module/order/pages/logistics-detail/logistics-detail.ts" beforeDir="false" afterPath="$PROJECT_DIR$/miniprogram/module/order/pages/logistics-detail/logistics-detail.ts" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/miniprogram/module/order/pages/logistics-detail/logistics-detail.wxml" beforeDir="false" afterPath="$PROJECT_DIR$/miniprogram/module/order/pages/logistics-detail/logistics-detail.wxml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/miniprogram/module/order/pages/other-detail/other-detail.ts" beforeDir="false" afterPath="$PROJECT_DIR$/miniprogram/module/order/pages/other-detail/other-detail.ts" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/miniprogram/module/order/pages/other-detail/other-detail.wxml" beforeDir="false" afterPath="$PROJECT_DIR$/miniprogram/module/order/pages/other-detail/other-detail.wxml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/miniprogram/module/order/request.ts" beforeDir="false" afterPath="$PROJECT_DIR$/miniprogram/module/order/request.ts" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />

+ 30 - 22
miniprogram/module/order/pages/logistics-detail/logistics-detail.scss

@@ -7,9 +7,9 @@
   flex: 0 1 auto;
   height: var(--page-container-safeHeight, 100vh);
   background: #f5f5f5;
-  padding-bottom: calc(24rpx + env(safe-area-inset-bottom));
+  // padding-bottom: calc(24rpx + env(safe-area-inset-bottom));
   box-sizing: border-box;
-  padding-top: 10px;
+  // padding-top: 10px;
 }
 
 .logistics-page {
@@ -21,6 +21,28 @@
   background: linear-gradient(180deg, #dde6f0 0%, #e8edf4 45%, #f0f2f5 100%);
   position: relative;
   overflow: hidden;
+  display: flex;
+  flex-direction: column;
+}
+
+.map-header__map {
+  width: 100%;
+  flex: 1;
+  min-height: 264rpx;
+}
+
+.map-header__fallback {
+  flex: 1;
+  min-height: 0;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  padding: 0 32rpx;
+}
+
+.map-header__fallback-text {
+  font-size: 28rpx;
+  color: rgba(0, 0, 0, 0.45);
 }
 
 .map-header__inner {
@@ -30,6 +52,7 @@
   align-items: center;
   justify-content: center;
   opacity: 0.85;
+  pointer-events: none;
 }
 
 .map-header__inner::before {
@@ -61,10 +84,8 @@
 }
 
 .logistics-card {
-  margin: -48rpx 24rpx 0;
   padding: 32rpx 28rpx 28rpx;
   background: #fff;
-  border-radius: 16rpx;
   box-shadow: 0 8rpx 32rpx rgba(0, 0, 0, 0.06);
   position: relative;
   z-index: 1;
@@ -133,7 +154,6 @@
   margin: 0 4rpx;
 }
 
-/* 物流时间线:左侧虚线轴 */
 .trace-list {
   position: relative;
 }
@@ -159,7 +179,6 @@
 
 .trace-item--expand {
   padding-bottom: 0;
-  // padding-top: 8rpx;
 }
 
 .trace-item__dot {
@@ -219,7 +238,6 @@
 .trace-item__time {
   font-size: 24rpx;
   color: #999;
-  margin-left: 8px;
 }
 
 .trace-item__time--accent {
@@ -241,7 +259,6 @@
 .trace-expand__text {
   font-size: 26rpx;
   color: #999;
-  // flex: 1;
 }
 
 .logistics-divider {
@@ -292,7 +309,6 @@
 .address-name {
   font-weight: 500;
   line-height: 1.4;
-  // margin-right: 10rpx;
 }
 
 .address-phone {
@@ -301,9 +317,9 @@
 }
 
 .addr-block__tag {
-  // margin: 0 0rpx 0 10rpx !important;
-  font-size: 22rpx!important;
-  color: #888!important;
+  font-size: 18rpx !important;
+  color: #888 !important;
+  padding: 0rpx 2rpx !important;
 }
 
 .addr-block__tag--orange {
@@ -311,22 +327,15 @@
   border-color: rgba(255, 107, 0, 0.45) !important;
 }
 
-.addr-block__virtual {
-  display: flex;
-  align-items: center;
-  gap: 2rpx;
-  font-size: 22rpx;
-}
 
 .addr-block__virtual-arrow {
   margin-left: -4rpx;
 }
 
 .goods-section {
-  margin: 24rpx 24rpx 0;
+  margin: 24rpx 0rpx 0;
   padding: 8rpx 24rpx 24rpx;
   background: #fff;
-  border-radius: 16rpx;
 }
 
 .goods-item {
@@ -356,7 +365,6 @@
 .goods-item__title {
   font-size: 28rpx;
   color: #333;
-  line-height: 1.4;
   margin-bottom: 10px;
 }
 
@@ -384,4 +392,4 @@
 .goods-item__qty {
   font-size: 24rpx;
   color: #999;
-}
+}

+ 150 - 101
miniprogram/module/order/pages/logistics-detail/logistics-detail.ts

@@ -1,90 +1,181 @@
 import PageContainerBehavior from "../../../../core/behavior/page-container.behavior";
 import DictionariesBehavior from "../../../../core/behavior/dictionaries.behavior";
 import tickleBehavior from "../../../../core/behavior/tickle.behavior";
-
+import { getLogisticsMethod } from "../../request"
 interface TraceItem {
   status: string;
   time: string;
   desc: string;
+  timeKey?: string;
+}
+
+interface LogisticsTrack {
+  time?: string;
+  context?: string;
+  areaName?: string;
+  status?: string;
+  location?: string;
+  areaCode?: string | null;
+  areaCenter?: any;
+  areaPinYin?: string | null;
+  statusCode?: any;
 }
 
-interface GoodsRow {
-  id: string;
-  image: string;
-  title: string;
-  spec: string;
-  price: string;
-  quantity: number;
+interface MapPoint {
+  latitude: number;
+  longitude: number;
 }
 
 Page({
   behaviors: [PageContainerBehavior, DictionariesBehavior, tickleBehavior],
+  async onLoad(options: any) {
+    const id = options?.id;
+    if (id) {
+      try {
+        const res = await getLogisticsMethod(id as any);
+        const tracks: LogisticsTrack[] = res?.data?.tracks ?? [];
+        const [latestTrack, ...historyTracks] = tracks;
+        this.setData({
+          showAllTrace: false,
+          latestTrace: latestTrack ? this.trackToTraceItem(latestTrack) : ({ status: "", time: "", desc: "" } as TraceItem),
+          traceHistory: historyTracks.map((t) => this.trackToTraceItem(t)),
+        });
+        console.log(tracks, "tracks")
+        // 顶部地图背景:只使用 tracks.areaCenter 画轨迹
+        this.applyMapFromLogistics(tracks);
+      } catch (e: any) {
+        this.setData({
+          showAllTrace: false,
+          latestTrace: { status: "", time: "", desc: "" } as TraceItem,
+          traceHistory: [],
+        });
+      }
+    }
+    if (options.goods) {
+      const goosInfo = JSON.parse(options.goods);
+      const expressType = goosInfo.expressType
+      this.setData({
+        deliveryAddress: goosInfo.address,
+        recipientName: goosInfo.liaison,
+        recipientPhone: goosInfo.phone,
+        expressType,
+        carrierName: goosInfo.expressType,
+        trackingNo: goosInfo.expressNo,
+        goosInfo
+      });
+    }
+  },
   data: {
+    // 物流start
+    hasMapPosition: false,
+    latitude: 0,
+    longitude: 0,
+    mapScale: 14,
+    markers: [] as any[],
+    polyline: [] as any[],
+    includePoints: [] as MapPoint[],
+    // end
     carrierName: "",
-    carrierIcon: "",
-    expressType: "3",
-    trackingNo: "78969033222603",
-    courierPhone: "95311",
+    expressType: "",
+    trackingNo: "",
+    courierPhone: "",
     showAllTrace: false,
     latestTrace: {
-      status: "已签收",
-      time: "12-26 18:33",
-      desc: "您已在杭州金成花园15幢4号店完成取件,感谢使用菜鸟驿站,期待再次为您服务。",
+      status: "",
+      time: "",
+      desc: "",
     } as TraceItem,
     traceHistory: [
-      {
-        status: "待取件",
-        time: "12-26 09:12",
-        desc: "包裹已到达杭州金成花园菜鸟驿站,请凭取件码及时取件。",
-      },
-      {
-        status: "运输中",
-        time: "12-25 14:20",
-        desc: "快件已离开【杭州转运中心】,正在发往下一站。",
-      },
-      {
-        status: "已揽收",
-        time: "12-24 16:05",
-        desc: "快递员已揽收,揽收员:张师傅 138****0000。",
-      },
     ] as TraceItem[],
-    deliveryAddress: "送至 西湖区金成花园13幢一单元602",
-    recipientName: "何美丹",
-    recipientPhone: "86-158****5026",
-    goodsList: [
-      {
-        id: "1",
-        image: "https://ts1.tc.mm.bing.net/th/id/OIP-C.nfcgbmtZSRsCdHKQPysKegHaE7?w=255&h=211&c=8&rs=1&qlt=90&o=6&pid=3.1&rm=2",
-        title: "元气茶",
-        spec: "10包",
-        price: "32",
-        quantity: 3,
-      },
-      {
-        id: "2",
-        image: "https://ts1.tc.mm.bing.net/th/id/OIP-C.nfcgbmtZSRsCdHKQPysKegHaE7?w=255&h=211&c=8&rs=1&qlt=90&o=6&pid=3.1&rm=2",
-        title: "芡实米仁燕麦粥",
-        spec: "1袋",
-        price: "1.5",
-        quantity: 21,
-      },
-    ] as GoodsRow[],
+    deliveryAddress: "",
+    recipientName: "",
+    recipientPhone: "",
+    goosInfo: {}
+  },
+  // --start
+  buildRoutePointsFromTracks(tracks: LogisticsTrack[]): MapPoint[] {
+    if (!Array.isArray(tracks) || tracks.length === 0) return [];
+    const pts: MapPoint[] = [];
+    for (const t of [...tracks].reverse()) {
+      if (!t?.areaCenter) continue;
+      const [lng, lat] = t.areaCenter.split(",").map((s: string) => Number(s.trim()));
+      if (!Number.isNaN(lng) && !Number.isNaN(lat)) {
+        pts.push({ latitude: lat, longitude: lng });
+      }
+    }
+    return pts;
   },
 
-  onLoad(options: Record<string, string>) {
-    const expressType = options.expressType || this.data.expressType;
+  applyMapFromLogistics(tracks: LogisticsTrack[]) {
+    // 把每个点转为经纬度
+    const routePoints = this.buildRoutePointsFromTracks(tracks || []);
+    // 多点的情况
+    if (routePoints.length >= 2) {
+      // 第一个点的经纬度
+      const first = routePoints[0];
+      // 最后一个点的经纬度
+      const last = routePoints[routePoints.length - 1];
+      this.setData({
+        // 设置地图的显示状态
+        hasMapPosition: true,
+        // 设置地图的经纬度
+        latitude: (first.latitude + last.latitude) / 2,
+        longitude: (first.longitude + last.longitude) / 2,
+        // 设置地图的缩放级别
+        mapScale: 11,
+        // 设置轨迹点
+        markers: [
+          { id: 1, latitude: first.latitude, longitude: first.longitude, width: 26, height: 26 },
+          { id: 2, latitude: last.latitude, longitude: last.longitude, width: 26, height: 26 },
+        ],
+        // 设置轨迹线
+        polyline: [
+          {
+            points: routePoints,
+            color: "#FF6B00AA",
+            width: 4,
+          },
+        ],
+        // 设置轨迹点
+        includePoints: routePoints,
+      });
+      return;
+    }
+    // 单点的情况
+    if (routePoints.length === 1) {
+      const only = routePoints[0];
+      this.setData({
+        hasMapPosition: true,
+        latitude: only.latitude,
+        longitude: only.longitude,
+        mapScale: 14,
+        markers: [{ id: 1, latitude: only.latitude, longitude: only.longitude, width: 28, height: 28 }],
+        polyline: [],
+        includePoints: [only],
+      });
+      return;
+    }
+    // 无轨迹点的情况
     this.setData({
-      expressType,
-      carrierName: this.getExpressTypeName(expressType),
-      carrierIcon: this.getExpressTypeIcon(expressType),
-      trackingNo: this.data.trackingNo,
+      hasMapPosition: false,
+      markers: [],
+      polyline: [],
+      includePoints: [],
     });
   },
-
+  // end
+  trackToTraceItem(track: LogisticsTrack): TraceItem {
+    const time = String(track?.time ?? "");
+    return {
+      status: String(track?.status ?? ""),
+      time,
+      desc: String(track?.context ?? ""),
+      timeKey: time,
+    };
+  },
   toggleTraceExpand() {
     this.setData({ showAllTrace: !this.data.showAllTrace });
   },
-
   onCopyTracking() {
     const no = this.data.trackingNo;
     wx.setClipboardData({
@@ -94,46 +185,4 @@ Page({
       },
     });
   },
-
-  onCallCourier() {
-    const phone = this.data.courierPhone;
-    wx.makePhoneCall({ phoneNumber: phone });
-  },
-
-  onVirtualNumberTip() {
-    wx.showToast({
-      title: "取件时可向驿站出示虚拟号",
-      icon: "none",
-    });
-  },
-
-  // 与快递公司名称
-  getExpressTypeName(expressType?: string | number): string {
-    const expressTypeMap: Record<string, string> = {
-      "0": "邮政速递",
-      "1": "顺丰速运",
-      "2": "京东快递",
-      "3": "中通快递",
-      "4": "圆通速递",
-      "5": "申通快递",
-      "6": "韵达快递",
-      "7": "极兔速递",
-    };
-    return expressTypeMap[String(expressType || "")] || "";
-  },
-
-  // 获取快递图标
-  getExpressTypeIcon(expressType?: string | number): string {
-    const expressIconMap: Record<string, string> = {
-      "0": "icon-youzhengkuaidi",
-      "1": "icon-shunfengkuaidi",
-      "2": "icon-jingdong",
-      "3": "icon-zhongtong",
-      "4": "icon-yuantongkuaidi",
-      "5": "icon-shentong",
-      "6": "icon-yunda",
-      "7": "icon-jitukuaidi",
-    };
-    return expressIconMap[String(expressType || "")] || "";
-  },
 });

+ 20 - 15
miniprogram/module/order/pages/logistics-detail/logistics-detail.wxml

@@ -2,23 +2,28 @@
 <t-navbar title="物流详情" left-arrow />
 <scroll-view class="page-scroll__container" type="list" scroll-y style="{{containerStyle}}">
   <view class="logistics-page">
-    <!-- <view class="map-header">
-      <view class="map-header__inner">
-        <text class="map-header__city">北京</text>
-      </view>
-    </view> -->
+    <view class="map-header">
+      <block wx:if="{{hasMapPosition}}">
+        <map class="map-header__map" latitude="{{latitude}}" longitude="{{longitude}}" scale="{{mapScale}}" markers="{{markers}}" polyline="{{polyline}}" include-points="{{includePoints}}" enable-scroll="{{true}}" enable-zoom="{{true}}" />
+      </block>
+      <block wx:else>
+        <view class="map-header__inner">
+          <text class="map-header__city">暂无物流轨迹地图</text>
+        </view>
+      </block>
+    </view>
 
     <view class="logistics-card">
       <view class="carrier-row">
-        <i class="iconfont icon-zhongtong" style="font-size:15px"></i>
+        <!-- <i class="iconfont {{carrierIcon || 'icon-zhongtong'}}" style="font-size:15px"></i> -->
         <view class="carrier-row__info">
           <text class="carrier-row__name">{{carrierName}}</text>
           <text class="carrier-row__no">{{trackingNo}}</text>
         </view>
         <view class="carrier-row__actions">
           <text class="carrier-row__action" bindtap="onCopyTracking">复制</text>
-          <view class="carrier-row__divider" />
-          <text class="carrier-row__action" bindtap="onCallCourier">打电话</text>
+          <!-- <view class="carrier-row__divider" />
+          <text class="carrier-row__action" bindtap="onCallCourier">打电话</text> -->
         </view>
       </view>
 
@@ -37,7 +42,7 @@
         </view>
 
         <block wx:if="{{showAllTrace}}">
-          <view class="trace-item" wx:for="{{traceHistory}}" wx:key="time">
+          <view class="trace-item" wx:for="{{traceHistory}}" wx:key="timeKey">
             <view class="trace-item__dot trace-item__dot--grey" />
             <view class="trace-item__body">
               <view class="trace-item__title-row">
@@ -79,15 +84,15 @@
     </view>
 
     <view class="goods-section">
-      <view class="goods-item" wx:for="{{goodsList}}" wx:key="id">
-        <t-image src="{{item.image}}" width="144rpx" height="144rpx" shape="round" mode="aspectFill" class="goods-item__img" />
+      <view class="goods-item">
+        <t-image src="{{goosInfo.image}}" width="144rpx" height="144rpx" shape="round" mode="aspectFill" class="goods-item__img" />
         <view class="goods-item__main">
-          <text class="goods-item__title">{{item.title}}</text>
-          <text class="goods-item__spec">{{item.spec}}</text>
+          <text class="goods-item__title">{{goosInfo.name}}</text>
+          <text class="goods-item__spec">{{goosInfo.description}}</text>
         </view>
         <view class="goods-item__price-col">
-          <text class="goods-item__price">¥{{item.price}}</text>
-          <text class="goods-item__qty">x{{item.quantity}}</text>
+          <text class="goods-item__price">¥{{goosInfo.price}}</text>
+          <text class="goods-item__qty">x{{goosInfo.quantity}}</text>
         </view>
       </view>
     </view>

+ 9 - 33
miniprogram/module/order/pages/offline-evaluate/offline-evaluate.wxml

@@ -2,7 +2,7 @@
 <t-navbar wx:if="{{!videoFullscreen}}" title="评价" left-arrow />
 <scroll-view class="page-scroll__container" type="list" scroll-y style="{{containerStyle}}">
   <view class="evaluate-container">
-    <!-- 服务信息卡片:缩略图 + 服务名|日期 时间 + 操作人 + 机构,右上角关闭 -->
+    <!-- 服务信息卡片 -->
     <view class="service-card">
       <image class="service-img" src="{{service.image}}" mode="aspectFill" />
       <view class="service-info">
@@ -20,13 +20,7 @@
     <view class="rate-row">
       <text class="rate-label">服务质量</text>
       <view class="rate-wrap">
-        <t-rate
-          value="{{scoreServiceQuality}}"
-          count="{{5}}"
-          color="{{rateColor}}"
-          placement=""
-          bind:change="onScoreServiceQuality"
-        />
+        <t-rate value="{{scoreServiceQuality}}" count="{{5}}" color="{{rateColor}}" placement="" bind:change="onScoreServiceQuality" />
         <text class="rate-score">{{scoreServiceQuality || '0'}}分</text>
       </view>
     </view>
@@ -35,13 +29,7 @@
     <view class="rate-row">
       <text class="rate-label">服务态度</text>
       <view class="rate-wrap">
-        <t-rate
-          value="{{scoreAttitude}}"
-          count="{{5}}"
-          color="{{rateColor}}"
-          placement=""
-          bind:change="onScoreAttitude"
-        />
+        <t-rate value="{{scoreAttitude}}" count="{{5}}" color="{{rateColor}}" placement="" bind:change="onScoreAttitude" />
         <text class="rate-score">{{scoreAttitude || '0'}}分</text>
       </view>
     </view>
@@ -50,28 +38,14 @@
     <view class="rate-row">
       <text class="rate-label">环 境</text>
       <view class="rate-wrap">
-        <t-rate
-          value="{{scoreEnvironment}}"
-          count="{{5}}"
-          color="{{rateColor}}"
-          placement=""
-          bind:change="onScoreEnvironment"
-        />
+        <t-rate value="{{scoreEnvironment}}" count="{{5}}" color="{{rateColor}}" placement="" bind:change="onScoreEnvironment" />
         <text class="rate-score">{{scoreEnvironment || '0'}}分</text>
       </view>
     </view>
 
     <!-- 评价输入 -->
     <view class="comment-section">
-      <textarea
-        class="comment-input"
-        placeholder="展开说说对商品的想法吧"
-        placeholder-class="comment-placeholder"
-        value="{{content}}"
-        bindinput="onContentInput"
-        maxlength="{{200}}"
-        show-confirm-bar="{{false}}"
-      />
+      <textarea class="comment-input" placeholder="展开说说对商品的想法吧" placeholder-class="comment-placeholder" value="{{content}}" bindinput="onContentInput" maxlength="{{200}}" show-confirm-bar="{{false}}" />
       <view class="comment-count" wx:if="{{content.length > 0}}">{{content.length}}/200</view>
     </view>
 
@@ -82,7 +56,9 @@
           <image wx:if="{{item.type === 'image'}}" class="media-thumb" src="{{item.path}}" mode="aspectFill" bindtap="onPreviewMedia" data-index="{{index}}" />
           <view wx:else class="media-item-video" bindtap="onPreviewMedia" data-index="{{index}}">
             <video id="offline-video-{{index}}" class="media-thumb" src="{{item.path}}" show-center-play-btn="{{true}}" object-fit="cover" controls="{{true}}" bindfullscreenchange="onVideoFullscreenChange" />
-            <view class="media-item-play"><t-icon name="play-circle-filled" size="56rpx" color="rgba(255,255,255,0.95)" /></view>
+            <view class="media-item-play">
+              <t-icon name="play-circle-filled" size="56rpx" color="rgba(255,255,255,0.95)" />
+            </view>
           </view>
           <view class="media-delete" catchtap="onRemoveMedia" data-index="{{index}}">
             <t-icon name="close" size="32rpx" color="#fff" />
@@ -100,4 +76,4 @@
 <!-- 发布按钮(视频全屏时隐藏,避免遮挡进度条) -->
 <view class="publish-footer" wx:if="{{!videoFullscreen}}" style="padding-bottom: {{container.safeBottomOffset}}px;">
   <view class="publish-btn {{canPublish ? '' : 'disabled'}}" bindtap="onPublish">发布</view>
-</view>
+</view>

+ 12 - 28
miniprogram/module/order/pages/offline-evaluateDetail/offline-evaluateDetail.wxml

@@ -2,7 +2,7 @@
 <t-navbar wx:if="{{!videoFullscreen}}" title="评价" left-arrow />
 <scroll-view class="page-scroll__container" type="list" scroll-y style="{{containerStyle}}">
   <view class="evaluate-container evaluate-container--readonly">
-    <!-- 商品信息:仅展示 -->
+    <!-- 商品信息 -->
     <view class="service-card">
       <image class="service-img" src="{{service.image}}" mode="aspectFill" />
       <view class="service-info">
@@ -16,47 +16,29 @@
       </view>
     </view>
 
- <!-- 服务质量 评分(只读) -->
+    <!-- 服务质量 评分-->
     <view class="rate-row">
       <text class="rate-label">服务质量</text>
       <view class="rate-wrap">
-        <t-rate
-          value="{{scoreServiceQuality}}"
-          count="{{5}}"
-          color="{{rateColor}}"
-          placement=""
-          disabled="{{true}}"
-        />
+        <t-rate value="{{scoreServiceQuality}}" count="{{5}}" color="{{rateColor}}" placement="" disabled="{{true}}" />
         <text class="rate-score">{{scoreServiceQuality || '0'}}分</text>
       </view>
     </view>
 
-    <!-- 服务态度 评分(只读) -->
+    <!-- 服务态度 评分 -->
     <view class="rate-row">
       <text class="rate-label">服务态度</text>
       <view class="rate-wrap">
-        <t-rate
-          value="{{scoreAttitude}}"
-          count="{{5}}"
-          color="{{rateColor}}"
-          placement=""
-          disabled="{{true}}"
-        />
+        <t-rate value="{{scoreAttitude}}" count="{{5}}" color="{{rateColor}}" placement="" disabled="{{true}}" />
         <text class="rate-score">{{scoreAttitude || '0'}}分</text>
       </view>
     </view>
 
-    <!-- 环境 评分(只读) -->
+    <!-- 环境 评分 -->
     <view class="rate-row">
-      <text class="rate-label">环   境</text>
+      <text class="rate-label">环 境</text>
       <view class="rate-wrap">
-        <t-rate
-          value="{{scoreEnvironment}}"
-          count="{{5}}"
-          color="{{rateColor}}"
-          placement=""
-          disabled="{{true}}"
-        />
+        <t-rate value="{{scoreEnvironment}}" count="{{5}}" color="{{rateColor}}" placement="" disabled="{{true}}" />
         <text class="rate-score">{{scoreEnvironment || '0'}}分</text>
       </view>
     </view>
@@ -73,7 +55,9 @@
           <image wx:if="{{item.type === 'image'}}" class="media-thumb" src="{{item.path}}" mode="aspectFill" bindtap="onPreviewMedia" data-index="{{index}}" />
           <view wx:else class="media-item-video" bindtap="onPreviewMedia" data-index="{{index}}">
             <video id="offline-detail-video-{{index}}" class="media-thumb" src="{{item.path}}" show-center-play-btn="{{true}}" object-fit="cover" controls="{{true}}" bindfullscreenchange="onVideoFullscreenChange" />
-            <view class="media-item-play"><t-icon name="play-circle-filled" size="56rpx" color="rgba(255,255,255,0.95)" /></view>
+            <view class="media-item-play">
+              <t-icon name="play-circle-filled" size="56rpx" color="rgba(255,255,255,0.95)" />
+            </view>
           </view>
         </view>
       </view>
@@ -84,4 +68,4 @@
 <!-- 底部返回(视频全屏时隐藏,避免遮挡) -->
 <view class="publish-footer" wx:if="{{!videoFullscreen}}" style="padding-bottom: {{container.safeBottomOffset}}px;">
   <view class="publish-btn" bindtap="onBack">返回</view>
-</view>
+</view>

+ 1 - 1
miniprogram/module/order/pages/order-detail/order-detail.wxml

@@ -1,4 +1,4 @@
-<!--module/order/pages/select-goods/select-goods.wxml-->
+<!--module/order/pages/order-detail/order-detail.wxml-->
 <t-navbar title="{{title}}" left-arrow />
 <scroll-view class="page-scroll__container {{orderStatus==='pending'?'':'bottom'}}" type="list" scroll-y style="{{containerStyle}}">
   <view class="info-box {{ showDetail ? 'show-bttom' : '' }}">

+ 39 - 77
miniprogram/module/order/pages/other-detail/other-detail.ts

@@ -78,10 +78,23 @@ Page({
     }
   },
   // 查看物流详情
-  goLogistics() {
-    wx.navigateTo({
-      url: `/module/order/pages/logistics-detail/logistics-detail`,
-    });
+  goLogistics(e: any) {
+    const { id } = e.currentTarget.dataset.goods;
+    const { liaison, phone, provinceName, cityName, areaName, detailAddress } = this.data.orderDetail;
+    let address = `${provinceName}${cityName ? `${cityName}` : ""
+      }${areaName ? `${areaName}` : ""}${detailAddress ? `${detailAddress}` : ""
+      }`;
+    const goods = JSON.stringify({ ...e.currentTarget.dataset.goods, liaison, phone, address });
+    if (id) {
+      wx.navigateTo({
+        url: `/module/order/pages/logistics-detail/logistics-detail?id=${id}&goods=${goods}`,
+      });
+    } else {
+      wx.showToast({
+        title: "无参数id",
+        icon: "none",
+      })
+    }
   },
   // 订单详情
   async load(id: string) {
@@ -145,15 +158,15 @@ Page({
               receiptType: item?.receiptType || '', //收货类型 0-快递 1-线下取货
               expressType: item?.expressType || '', //快递类型 0-邮政速递 1-顺丰速运 2-京东快递 3-中通快递 4-圆通速递 5-申通快递 6-韵达快递 7-极兔速递
               expressNo: item?.expressNo || '', //快递单号
-              expressTypeName: this.getExpressTypeName(item?.expressType), //快递公司名称
-              expressTypeIcon: this.getExpressTypeIcon(item?.expressType), //快递公司图标
+              expressTypeName: item?.expressType, //快递公司名称
+              // expressTypeIcon: this.getExpressTypeIcon(item?.expressType), //快递公司图标
               //end实体商品所用到的字段
               progress: item?.progress || '', //进度 0-进行中 1-已完成 2-未开始 3-已取消 这个字段用于线下服务商品以及线上权益商品的进度状态
               image: item.conditioningProgramPhoto || '',
               price: item?.unitPrice || 0,
               quantity: item?.totalMeasure || 0,
-              statusClass: this.getStatusClass(item?.sellType, item?.progress, item?.receiptStatus),
-              statusText: this.getGoodsStatusText(item?.sellType, item?.progress, item?.receiptStatus),
+              statusClass: this.getStatusClass(item?.sellType, item?.progress, item?.receiptStatus, item.expressStatus),
+              statusText: this.getGoodsStatusText(item?.sellType, item?.progress, item?.receiptStatus, item.expressStatus),
               isCanEvaluate: item?.isCanEvaluate, //是否可以评价 false-否 true-是
               evaluateTime: item?.evaluateTime, //有评价时间就是已评价,是空就是未评价
             }
@@ -221,13 +234,9 @@ Page({
         }, (error: any) => {
           this.setData({ isPaymentLoading: false });
           if (error?.errMsg === 'requestPayment:fail cancel') {
-           // 支付取消跳到支付订单页面
+            // 支付取消跳到支付订单页面
             wx.navigateBack({ delta: 1 });
           }
-          // wx.showToast({
-          //   title: error.errMsg,
-          //   icon: "none",
-          // });
         });
       } else {
         wx.showToast({
@@ -261,27 +270,13 @@ Page({
     });
   },
 
-  preventTap() {
-    // 仅用于 catchtap 阻止冒泡,避免触发父级 goAppointment
-  },
+  preventTap() {},
   onApplyAfterSale(_e: any) {
     wx.showToast({ title: "申请售后", icon: "none" });
   },
   onReview(e: WechatMiniprogram.TouchEvent) {
-    // const orderId = this.data.id || "";
     console.log(e.currentTarget.dataset);
     const { evaluateTime } = e.currentTarget.dataset.goods;
-    // const { name = "", image = "", description = ''} = (e.currentTarget.dataset.goods || {}) as {
-    //   name?: string;
-    //   image?: string;
-    //   description?: string;
-    // };
-    // const parts: string[] = [];
-    // if (orderId) parts.push(`orderId=${encodeURIComponent(orderId)}`);
-    // if (name) parts.push(`name=${encodeURIComponent(name)}`);
-    // if (image) parts.push(`image=${encodeURIComponent(image)}`);
-    // if (description != null) parts.push(`description=${encodeURIComponent(description.toString())}`);
-    // const query = parts.length ? "?" + parts.join("&") : "";
     if (evaluateTime) {
       // 单商品评价详情
       wx.navigateTo({
@@ -293,14 +288,6 @@ Page({
       wx.navigateTo({
         url: `/module/order/pages/goods-evaluate/goods-evaluate?goodsInfo=${encodeURIComponent(JSON.stringify(e.currentTarget.dataset.goods))}`,
       });
-      // 线下服务评价
-      // wx.navigateTo({
-      //   url: `/module/order/pages/offline-evaluate/offline-evaluate?goodsInfo=${encodeURIComponent(JSON.stringify(e.currentTarget.dataset.goods))}`,
-      // });
-      // 线下服务评价详情
-      // wx.navigateTo({
-      //   url: `/module/order/pages/offline-evaluateDetail/offline-evaluateDetail?goodsInfo=${encodeURIComponent(JSON.stringify(e.currentTarget.dataset.goods))}`,
-      // });
     }
   },
   // 复制订单号
@@ -325,9 +312,9 @@ Page({
   // sellType: 商品类型 1-实体商品 2-线下服务 3-线上权益
   // progress: 进度状态(用于线下服务和线上权益):0-进行中 1-已完成 2-未开始
   // receiptStatus: 收货状态(用于实体商品):0-待发货 1-已发货 2-已收货
-  getStatusClass(sellType?: string | number, progress?: string | number, receiptStatus?: string | number): string {
+  getStatusClass(sellType?: string | number, progress?: string | number, receiptStatus?: string | number, expressStatus?: string): string {
     const type = String(sellType || '');
-    // 实体商品 (sellType === 1) 使用 receiptStatus(三种状态)
+    // 实体商品 (sellType === 1) 使用 receiptStatus(三种状态)实体商品增加运输中
     if (type === "1") {
       const status = String(receiptStatus || '');
       if (status === "0") {
@@ -336,6 +323,8 @@ Page({
         return "status-received"; // 已发货
       } else if (status === "2") {
         return "status-completed"; // 已收货
+      } else {
+        return "status-received"
       }
     }
     // 线下服务 (sellType === 2) 和线上权益 (sellType === 3) 使用 progress(三种状态)
@@ -353,17 +342,21 @@ Page({
   },
 
   // 获取商品状态文本
-  getGoodsStatusText(sellType?: string | number, progress?: string | number, receiptStatus?: string | number): string {
+  getGoodsStatusText(sellType?: string | number, progress?: string | number, receiptStatus?: string | number, expressStatus?: string): string {
     const type = String(sellType || '');
-    // 实体商品 (sellType === 1) 使用 receiptStatus(三种状态)
+    // 实体商品 (sellType === 1) 使用 receiptStatus(三种状态)新增expressStatus运输状态
     if (type === "1") {
       const status = String(receiptStatus || '');
-      if (status === "0") {
-        return "待发货";
-      } else if (status === "1") {
-        return "已发货";
-      } else if (status === "2") {
-        return "已收货";
+      if (expressStatus) {
+        return expressStatus
+      } else {
+        if (status === "0") {
+          return "待发货";
+        } else if (status === "1") {
+          return "已发货";
+        } else if (status === "2") {
+          return "已收货";
+        }
       }
     }
     // 线下服务 (sellType === 2) 和线上权益 (sellType === 3) 使用 progress(三种状态)
@@ -379,37 +372,6 @@ Page({
     }
     return "";
   },
-
-  // 获取快递公司名称
-  getExpressTypeName(expressType?: string | number): string {
-    const expressTypeMap: Record<string, string> = {
-      "0": "邮政速递",
-      "1": "顺丰速运",
-      "2": "京东快递",
-      "3": "中通快递",
-      "4": "圆通速递",
-      "5": "申通快递",
-      "6": "韵达快递",
-      "7": "极兔速递",
-    };
-    return expressTypeMap[String(expressType || '')] || "";
-  },
-
-  // 获取快递公司图标
-  getExpressTypeIcon(expressType?: string | number): string {
-    const expressIconMap: Record<string, string> = {
-      "0": "icon-youzhengkuaidi", // 邮政速递
-      "1": "icon-shunfengkuaidi", // 顺丰速运
-      "2": "icon-jingdong", // 京东快递
-      "3": "icon-zhongtong", // 中通快递
-      "4": "icon-yuantongkuaidi", // 圆通速递
-      "5": "icon-shentong", // 申通快递
-      "6": "icon-yunda", // 韵达快递
-      "7": "icon-jitukuaidi", // 极兔速递
-    };
-    return expressIconMap[String(expressType || '')] || "";
-  },
-
   // 获取订单状态文本
   getStatusText(status: string | number): string {
     const statusTextMap: Record<string, string> = {

+ 11 - 11
miniprogram/module/order/pages/other-detail/other-detail.wxml

@@ -1,4 +1,4 @@
-<!--module/order/pages/select-goods/select-goods.wxml-->
+<!--module/order/pages/other-detail/other-detail.wxml-->
 <t-navbar title="{{title}}" left-arrow />
 <scroll-view class="page-scroll__container" type="list" scroll-y style="{{containerStyle}}">
   <view class="info-box">
@@ -11,18 +11,18 @@
         <!-- 线下取货小标题:当遇到第一个线下取货商品时显示 -->
         <view class="offline-title" wx:if="{{goods.receiptType === '1' && (goodsIndex === 0 || sellTypeFirstItems[goodsIndex - 1].receiptType === '0')}}">线下取货</view>
         <!-- 快递信息 -->
-        <view class="express-info" wx:if="{{goods.receiptType === '0' && goods.expressTypeName && goods.expressNo && goods.receiptStatus === '1'}}">
+        <view class="express-info" wx:if="{{goods.receiptType === '0'  && goods.receiptStatus === '1'}}">
           <view class="express-text">
             <view style="font-weight:600;margin-right: 10rpx;display: flex;align-items: center;">
-             <text style="font-size: 25rpx;"> 快件{{goodsIndex + 1}}</text>
+              <text style="font-size: 25rpx;"> 快件{{goodsIndex + 1}}</text>
               <i class="iconfont {{goods.expressTypeIcon}}" style="font-size:15px" wx:if="{{goods.expressTypeIcon}}"></i>
             </view>
             <view style="color:#9b9797;font-size: 25rpx;">{{goods.expressTypeName}} {{goods.expressNo}}</view>
           </view>
-           <t-icon name="chevron-right" color="#000" size="40rpx" slot="note" />
+          <t-icon name="chevron-right" color="#000" size="40rpx" slot="note" />
         </view>
         <view>
-          <view class="goods-status {{goods.statusClass}}" wx:if="{{goods.statusText && orderStatus !== 'closed'}}" bindtap="goLogistics">{{goods.statusText}}</view>
+          <view class="goods-status {{goods.statusClass}}" wx:if="{{goods.statusText && orderStatus !== 'closed'}}" bindtap="goLogistics" data-goods="{{goods}}">{{goods.statusText}}</view>
           <view class="goods-item">
             <image class="goods-image" src="{{goods.image}}" mode="aspectFill" wx:if="{{goods.image}}" />
             <view class="service-package-placeholder" wx:else>
@@ -75,7 +75,7 @@
               <!-- 申请售后 + 评价 -->
               <view class="action-btns" catchtap="preventTap">
                 <!-- <view class="btn-aftersale" catchtap="onApplyAfterSale">申请售后</view> -->
-                  <view class="btn-review" catchtap="onReview" data-goods="{{goods}}" wx:if="{{goods.isCanEvaluate}}">{{goods.evaluateTime?"已评价":"评价"}}</view>
+                <view class="btn-review" catchtap="onReview" data-goods="{{goods}}" wx:if="{{goods.isCanEvaluate}}">{{goods.evaluateTime?"已评价":"评价"}}</view>
               </view>
             </view>
           </view>
@@ -106,7 +106,7 @@
               <!-- 申请售后 + 评价 -->
               <view class="action-btns">
                 <!-- <view class="btn-aftersale" catchtap="onApplyAfterSale">申请售后</view> -->
-                  <view class="btn-review" catchtap="onReview" data-goods="{{goods}}" wx:if="{{goods.isCanEvaluate}}">{{goods.evaluateTime?"已评价":"评价"}}</view>
+                <view class="btn-review" catchtap="onReview" data-goods="{{goods}}" wx:if="{{goods.isCanEvaluate}}">{{goods.evaluateTime?"已评价":"评价"}}</view>
               </view>
             </view>
           </view>
@@ -158,22 +158,22 @@
         <text class="info-label">创建时间</text>
         <text class="info-value">{{orderDetail.operateTime || ''}}</text>
       </view>
-       <view class="info-divider"></view>
+      <view class="info-divider"></view>
       <view class="info-item" wx:if="{{orderStatus!=='closed'}}">
         <text class="info-label">付款时间</text>
         <text class="info-value">{{orderDetail.payTime || ''}}</text>
       </view>
-       <view class="info-divider" wx:if="{{orderStatus!=='closed'}}"></view>
+      <view class="info-divider" wx:if="{{orderStatus!=='closed'}}"></view>
       <view class="info-item" wx:if="{{orderStatus==='completed'}}">
         <text class="info-label">成交时间</text>
         <text class="info-value">{{orderDetail.finishTime || ''}}</text>
       </view>
-       <view class="info-divider" wx:if="{{orderStatus==='completed'}}"></view>
+      <view class="info-divider" wx:if="{{orderStatus==='completed'}}"></view>
       <view class="info-item" wx:if="{{orderStatus==='closed'}}">
         <text class="info-label">关闭时间</text>
         <text class="info-value">{{orderDetail.cancelTime || ''}}</text>
       </view>
-       <view class="info-divider" wx:if="{{orderStatus==='closed'}}"></view>
+      <view class="info-divider" wx:if="{{orderStatus==='closed'}}"></view>
       <view class="info-item" wx:if="{{orderStatus!=='closed'}}">
         <text class="info-label">微信交易号</text>
         <text class="info-value">{{orderDetail.payTransactionNo || ''}}</text>

+ 8 - 0
miniprogram/module/order/request.ts

@@ -95,4 +95,12 @@ export function updateAppointmentMethod(offlineId: string, time: string) {
       return data;
     },
   })
+}
+// 获取物流信息 id:患者调理方案ID
+export function getLogisticsMethod(id:number){
+  return Post(`/patientCrManage/getLogistics/${id}`, {
+    transform({ data }: AnyObject) {
+      return data;
+    },
+  });
 }