浏览代码

fix(report-list): 调整归属按钮移至滑动操作区,与删除按钮并列显示

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
liaoxg 6 天之前
父节点
当前提交
1e08b172c4
共有 1 个文件被更改,包括 16 次插入 和 9 次删除
  1. 16 9
      cfc-frontend/pages/health/report-list.vue

+ 16 - 9
cfc-frontend/pages/health/report-list.vue

@@ -42,14 +42,15 @@
     <!-- 报告列表 -->
     <view class="report-list" v-else-if="reports.length > 0">
       <view class="swipe-row" v-for="item in reports" :key="item.id">
-        <!-- 右侧删除按钮(滑动后露出) -->
+        <!-- 右侧操作按钮(左滑后露出:删除 + 调整归属) -->
         <view class="swipe-actions">
           <view class="swipe-delete" @click.stop="confirmDelete(item)">删除</view>
+          <view class="swipe-adjust" @click.stop="adjustBinding(item)">调整归属</view>
         </view>
         <!-- 卡片内容(可左滑) -->
         <view class="swipe-content"
               :class="{ 'swipe-moving': curId === item.id }"
-              :style="'transform: translateX(' + (curId === item.id ? moveOffset : (openMap[item.id] ? -80 : 0)) + 'px)'"
+              :style="'transform: translateX(' + (curId === item.id ? moveOffset : (openMap[item.id] ? -160 : 0)) + 'px)'"
               @touchstart="onTouchStart($event, item)"
               @touchmove="onTouchMove"
               @touchend="onTouchEnd"
@@ -68,10 +69,6 @@
               <text class="report-arrow">›</text>
             </view>
           </view>
-          <!-- 调整归属按钮(始终显示,已绑定成员点击将提示无法修改) -->
-          <view class="action-btns">
-            <button type="primary" size="small" @click.stop="adjustBinding(item)">调整归属</button>
-          </view>
         </view>
       </view>
     </view>
@@ -380,7 +377,7 @@ export default {
       this.startX = touch.clientX
       this.startY = touch.clientY
       this.touchDidMove = false
-      this.baseOffset = this.openMap[item.id] ? -80 : 0
+      this.baseOffset = this.openMap[item.id] ? -160 : 0
       this.moveOffset = this.baseOffset
     },
     onTouchMove(e) {
@@ -392,7 +389,7 @@ export default {
       if (Math.abs(dx) > Math.abs(dy)) {
         this.touchDidMove = Math.abs(dx) > 10
         var offset = this.baseOffset + dx
-        if (offset < -80) offset = -80
+        if (offset < -160) offset = -160
         if (offset > 0) offset = 0
         this.moveOffset = offset
       }
@@ -402,7 +399,7 @@ export default {
       // 位移超过阈值则打开,否则收起
       var shouldOpen = this.moveOffset < -20
       this.$set(this.openMap, this.curId, shouldOpen)
-      this.moveOffset = shouldOpen ? -80 : 0
+      this.moveOffset = shouldOpen ? -160 : 0
       this.curId = null
     },
     goToUpload() {
@@ -594,6 +591,16 @@ export default {
   align-items: center;
   justify-content: center;
 }
+.swipe-adjust {
+  width: 80px;
+  height: 100%;
+  background: #5B9BD5;
+  color: #fff;
+  font-size: 28rpx;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
 .swipe-content {
   position: relative;
   z-index: 2;