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