张田田 4 недель назад
Родитель
Сommit
7dafa243c7

+ 14 - 8
miniprogram/module/chats/components/guide/guide.wxml

@@ -2,6 +2,12 @@
   module.exports.getClassName = function (active) {
     return active ? '' : 'disabled';
   }
+  module.exports.cellClass = function (active, isLast) {
+    var cls = 'cell-border-gradient';
+    if (!active) cls += ' disabled';
+    if (isLast) cls += ' no-border';
+    return cls;
+  }
 </wxs>
 <!--module/chats/components/guide/guide.wxml-->
 <view class="chat-card left steward-wrapper">
@@ -36,24 +42,24 @@
     >
       <t-icon name="chevron-right" color="#CCCCCC" size="40rpx" slot="note" />
     </t-cell>
-    <t-cell 
-      t-class="cell-border-gradient {{_.getClassName(active)}}" 
+    <t-cell
+      t-class="{{_.cellClass(active, !i18n.chats.consult)}}"
       t-class-hover="custom-cell-hover"
        t-class-title="health-analysis-title"
-      title="3、{{i18n.chats.healthData}}" 
-      hover="{{active}}" 
+      title="3、{{i18n.chats.healthData}}"
+      hover="{{active}}"
       bind:tap="handleC"
       style="--td-cell-hover-color: #F5F5F5;"
     >
       <t-icon name="chevron-right" color="#CCCCCC" size="40rpx" slot="note" />
     </t-cell>
-    <t-cell 
+    <t-cell
       wx:if="{{i18n.chats.consult}}"
-      t-class="cell-border-gradient no-border {{_.getClassName(active)}}" 
+      t-class="{{_.cellClass(active, true)}}"
       t-class-hover="custom-cell-hover"
        t-class-title="health-analysis-title"
-      title="4、{{i18n.chats.consult}}" 
-      hover="{{active}}" 
+      title="4、{{i18n.chats.consult}}"
+      hover="{{active}}"
       bind:tap="handleE"
       style="--td-cell-hover-color: #F5F5F5;"
     >

+ 3 - 2
miniprogram/module/chats/pages/consultation-record/consultation-record.json

@@ -3,6 +3,7 @@
   "component": true,
   "usingComponents": {
     "t-navbar": "tdesign-miniprogram/navbar/navbar",
-    "t-avatar": "tdesign-miniprogram/avatar/avatar"
+    "t-avatar": "tdesign-miniprogram/avatar/avatar",
+    "towxml": "../../towxml/towxml"
   }
-}
+}

+ 2 - 2
miniprogram/module/chats/pages/consultation-record/consultation-record.scss

@@ -64,8 +64,8 @@
   }
 
   &__time {
-    font-size: 22rpx;
-    color: #bbbbbb;
+    font-size: 24rpx;
+    color: #999999;
     line-height: 1.5;
   }
 

+ 13 - 14
miniprogram/module/chats/pages/consultation-record/consultation-record.wxml

@@ -1,12 +1,12 @@
 <!--module/chats/pages/consultation-record/consultation-record.wxml-->
 <t-navbar title="{{i18n.consultChat.title}}" left-arrow />
-<scroll-view 
-  id="scrollview" 
-  class="page-scroll__container" 
-  type="list" 
-  scroll-y 
-  enhanced="{{true}}" 
-  enable-passive 
+<scroll-view
+  id="scrollview"
+  class="page-scroll__container"
+  type="list"
+  scroll-y
+  enhanced="{{true}}"
+  enable-passive
   style="height: calc(100vh - 180rpx);"
   bindscrolltolower="onScrollToLower"
   lower-threshold="{{50}}"
@@ -17,7 +17,7 @@
       <view class="consultation-session">
         <view class="timestamp">{{item.startTime}}</view>
         <view class="status-message">开始{{i18n.consultChat._}}</view>
-        
+
         <!-- 消息列表 -->
         <view class="messages-list">
           <block wx:for="{{item.items}}" wx:key="id" wx:for-item="message">
@@ -28,7 +28,7 @@
                 <text class="message-text message-text--system">{{message.messageContent}}</text>
               </view>
             </view>
-            
+
             <!-- 患者消息 (sendType === '1') - 右侧显示 -->
             <view wx:elif="{{message.sendType === '1'}}" class="message-item message-item--user">
               <view class="message-bubble message-bubble--user">
@@ -43,14 +43,14 @@
               </view>
               <t-avatar class="message-avatar" icon="user" size="40px" />
             </view>
-            
+
             <!-- 医生/AI消息 (sendType === '2' 或 '4') - 左侧显示 -->
             <view wx:else class="message-item message-item--agent">
               <t-avatar class="message-avatar message-avatar--agent" icon="{{message.sendType === '2' ? 'user' : 'service'}}" size="40px" />
               <view class="message-bubble message-bubble--agent">
                 <!-- 文本消息 -->
                 <block wx:if="{{message.messageType === '1'}}">
-                  <text class="message-text">{{message.messageContent}}</text>
+                  <towxml markdown="{{message.messageContent}}" theme="light" />
                 </block>
                 <!-- 图片消息 -->
                 <block wx:elif="{{message.messageType === '2'}}">
@@ -60,7 +60,7 @@
             </view>
           </block>
         </view>
-        
+
         <!-- 咨询结束 -->
         <view class="session-end">
           <view class="session-end__content">
@@ -70,7 +70,7 @@
         </view>
       </view>
     </block>
-    
+
     <!-- 加载更多/无更多数据提示 -->
     <view class="loading-container" style="text-align: center; padding: 20rpx; color: #999; font-size: 24rpx;" wx:if="{{isPage}}">
       <view wx:if="{{isLoading}}">加载中...</view>
@@ -79,4 +79,3 @@
   </view>
 </scroll-view>
 
-  

+ 2 - 2
miniprogram/module/chats/pages/index/index.scss

@@ -23,9 +23,9 @@
   right: 0;
   bottom: 0;
   z-index: 100;
-  background-color: #fff;
+  // background-color: #fff;
   padding-bottom: env(safe-area-inset-bottom);
-  box-shadow: 0 -2rpx 6rpx rgba(0, 0, 0, 0.1);
+  // box-shadow: 0 -2rpx 6rpx rgba(0, 0, 0, 0.1);
 }
 
 .chat {

+ 15 - 0
miniprogram/module/order/components/after-sale-type-popup/after-sale-type-popup.scss

@@ -103,6 +103,21 @@
   position: relative;
 }
 
+.after-sale-type-card__placeholder {
+  width: 132rpx;
+  height: 108rpx;
+  background: #f5f5f5;
+  border-radius: 8rpx;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  border: 1px solid #e8e8e8;
+}
+
+.placeholder-icon {
+  font-size: 48rpx;
+}
+
 .after-sale-type-card__icon::after {
   content: "";
   width: 28rpx;

+ 3 - 1
miniprogram/module/order/components/after-sale-type-popup/after-sale-type-popup.wxml

@@ -28,7 +28,9 @@
       >
         <view class="after-sale-type-card__left">
           <image class="after-sale-type-card__icon" src="{{siteOption.image}}" mode="aspectFill" wx:if="{{siteOption.image}}" />
-          <view class="after-sale-type-card__icon" wx:else />
+          <view class="after-sale-type-card__placeholder" wx:else>
+            <text class="placeholder-icon">📦</text>
+          </view>
         </view>
 
         <view class="after-sale-type-card__main">

+ 5 - 0
miniprogram/module/order/components/refund-proof-popup/refund-proof-popup.scss

@@ -168,4 +168,9 @@
   color: #fff;
   background: #2f6df6;
   font-size: 34rpx;
+
+  &--disabled {
+    opacity: 0.5;
+    pointer-events: none;
+  }
 }

+ 36 - 4
miniprogram/module/order/components/refund-proof-popup/refund-proof-popup.ts

@@ -1,3 +1,5 @@
+import { upload } from "../../../../lib/request/upload";
+
 Component({
   properties: {
     visible: { type: Boolean, value: false },
@@ -7,6 +9,7 @@ Component({
   data: {
     inputDesc: "",
     inputImages: [] as string[],
+    uploading: false,
   },
   observers: {
     visible(v: boolean) {
@@ -36,16 +39,44 @@ Component({
         wx.showToast({ title: "最多上传9张", icon: "none" });
         return;
       }
-      wx.chooseImage({
+      wx.chooseMedia({
         count: remain,
-        sizeType: ["compressed"],
+        mediaType: ["image"],
         sourceType: ["album", "camera"],
+        camera: "back",
         success: (res) => {
-          const next = [...this.data.inputImages, ...res.tempFilePaths].slice(0, 9);
-          this.setData({ inputImages: next });
+          const tempPaths = res.tempFiles.map((f) => f.tempFilePath);
+          this.setData({ uploading: true });
+          this._uploadSequentially(tempPaths, 0);
         },
       });
     },
+    _uploadSequentially(paths: string[], index: number) {
+      if (index >= paths.length) {
+        this.setData({ uploading: false });
+        return;
+      }
+      upload<string, any>({
+        params: { name: "file", file: paths[index] },
+        transform({ data }: any): string {
+          return (data as any)?.url || (data as any);
+        },
+      }).then(
+        (url) => {
+          this.setData({
+            inputImages: [...this.data.inputImages, url],
+          });
+          this._uploadSequentially(paths, index + 1);
+        },
+        (error: any) => {
+          wx.showToast({
+            title: error?.errMsg || "上传失败",
+            icon: "none",
+          });
+          this.setData({ uploading: false });
+        }
+      );
+    },
     onRemoveImage(e: WechatMiniprogram.TouchEvent) {
       const index = Number((e.currentTarget.dataset as { index?: number })?.index ?? -1);
       if (index < 0) return;
@@ -54,6 +85,7 @@ Component({
       this.setData({ inputImages: next });
     },
     onConfirm() {
+      if (this.data.uploading) return;
       this.triggerEvent("confirm", {
         desc: this.data.inputDesc,
         images: this.data.inputImages,

+ 1 - 1
miniprogram/module/order/components/refund-proof-popup/refund-proof-popup.wxml

@@ -43,7 +43,7 @@
     </view>
 
     <view class="proof-popup__footer">
-      <view class="done-btn" bindtap="onConfirm">完成</view>
+      <view class="done-btn {{uploading ? 'done-btn--disabled' : ''}}" bindtap="onConfirm">完成</view>
     </view>
   </view>
 </t-popup>