|
|
@@ -17,12 +17,15 @@
|
|
17
|
17
|
<up-swipe-action>
|
|
18
|
18
|
<up-swipe-action-item :threshold="100" v-model:show="swipeShow" :options="swipeOptions"
|
|
19
|
19
|
@click="(val: any) => handleSwipeAction(val, item)">
|
|
|
20
|
+ <view class="more-btn" @tap.stop="openPopover(item, index)">
|
|
|
21
|
+ <up-icon name="more-dot-fill" size="40rpx" color="#999"></up-icon>
|
|
|
22
|
+ </view>
|
|
20
|
23
|
<view class="order-header">
|
|
21
|
24
|
<view class="order-info">
|
|
22
|
25
|
<text class="order-number">工单号:{{ item.orderId }}</text>
|
|
23
|
26
|
<text class="order-time">{{ formatTime(item.createTime) }}</text>
|
|
24
|
27
|
</view>
|
|
25
|
|
- <view class="order-status">
|
|
|
28
|
+ <view class="order-right">
|
|
26
|
29
|
<text :style="{ color: getStatusColor(item.status) }" class="status-text">{{
|
|
27
|
30
|
item.status
|
|
28
|
31
|
}}</text>
|
|
|
@@ -49,6 +52,28 @@
|
|
49
|
52
|
</view>
|
|
50
|
53
|
</up-swipe-action-item>
|
|
51
|
54
|
</up-swipe-action>
|
|
|
55
|
+
|
|
|
56
|
+ <!-- 浮层蒙版(点击空白关闭) -->
|
|
|
57
|
+ <view v-if="popoverIndex === index" class="popover-mask" @tap.stop="closePopover"></view>
|
|
|
58
|
+ <!-- Popover 浮层 -->
|
|
|
59
|
+ <view v-if="popoverIndex === index" class="popover-menu" @tap.stop>
|
|
|
60
|
+ <view class="popover-item" @tap="handlePopoverAction({ index: 0 }, item)">
|
|
|
61
|
+ <up-icon name="play-right-fill" size="32rpx" color="#42b983"></up-icon>
|
|
|
62
|
+ <text class="popover-text">进度</text>
|
|
|
63
|
+ </view>
|
|
|
64
|
+ <view class="popover-divider"></view>
|
|
|
65
|
+ <view class="popover-item" @tap="handlePopoverAction({ index: 1 }, item)">
|
|
|
66
|
+ <up-icon name="list" size="32rpx" color="#2c94f6"></up-icon>
|
|
|
67
|
+ <text class="popover-text">详情</text>
|
|
|
68
|
+ </view>
|
|
|
69
|
+ <view class="popover-divider"></view>
|
|
|
70
|
+ <view class="popover-item" @tap="handlePopoverAction({ index: 2 }, item)">
|
|
|
71
|
+ <up-icon name="rmb-circle" size="32rpx" color="#FF9900"></up-icon>
|
|
|
72
|
+ <text class="popover-text">报价</text>
|
|
|
73
|
+ </view>
|
|
|
74
|
+ <!-- 小三角箭头 -->
|
|
|
75
|
+ <view class="popover-arrow"></view>
|
|
|
76
|
+ </view>
|
|
52
|
77
|
</view>
|
|
53
|
78
|
</up-list-item>
|
|
54
|
79
|
<up-empty v-if="filteredOrders.length === 0" image="empty" text="暂无订单数据"></up-empty>
|
|
|
@@ -156,6 +181,30 @@ const handleSwipeAction = (val: any, item: any) => {
|
|
156
|
181
|
}
|
|
157
|
182
|
}
|
|
158
|
183
|
|
|
|
184
|
+// Popover 相关
|
|
|
185
|
+const popoverIndex = ref<number | null>(null)
|
|
|
186
|
+const currentPopoverItem = ref<OrderListItem_Result | null>(null)
|
|
|
187
|
+
|
|
|
188
|
+const openPopover = (item: OrderListItem_Result, index: number) => {
|
|
|
189
|
+ if (popoverIndex.value === index) {
|
|
|
190
|
+ popoverIndex.value = null
|
|
|
191
|
+ currentPopoverItem.value = null
|
|
|
192
|
+ } else {
|
|
|
193
|
+ popoverIndex.value = index
|
|
|
194
|
+ currentPopoverItem.value = item
|
|
|
195
|
+ }
|
|
|
196
|
+}
|
|
|
197
|
+
|
|
|
198
|
+const closePopover = () => {
|
|
|
199
|
+ popoverIndex.value = null
|
|
|
200
|
+ currentPopoverItem.value = null
|
|
|
201
|
+}
|
|
|
202
|
+
|
|
|
203
|
+const handlePopoverAction = (val:object, item: OrderListItem_Result) => {
|
|
|
204
|
+ closePopover()
|
|
|
205
|
+ handleSwipeAction(val, item)
|
|
|
206
|
+}
|
|
|
207
|
+
|
|
159
|
208
|
const loadMore = () => {
|
|
160
|
209
|
if (loading.value) return
|
|
161
|
210
|
|
|
|
@@ -231,7 +280,13 @@ onMounted(() => {
|
|
231
|
280
|
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
|
|
232
|
281
|
border-radius: 20rpx;
|
|
233
|
282
|
margin: 20rpx 20rpx;
|
|
234
|
|
-
|
|
|
283
|
+ position: relative;
|
|
|
284
|
+ .more-btn {
|
|
|
285
|
+ display: flex;
|
|
|
286
|
+ align-items: center;
|
|
|
287
|
+ justify-content: flex-end;
|
|
|
288
|
+ border-radius: 50%;
|
|
|
289
|
+ }
|
|
235
|
290
|
.order-header {
|
|
236
|
291
|
display: flex;
|
|
237
|
292
|
justify-content: space-between;
|
|
|
@@ -255,11 +310,17 @@ onMounted(() => {
|
|
255
|
310
|
}
|
|
256
|
311
|
}
|
|
257
|
312
|
|
|
258
|
|
- .order-status {
|
|
|
313
|
+ .order-right {
|
|
|
314
|
+ display: flex;
|
|
|
315
|
+ align-items: center;
|
|
|
316
|
+ gap: 16rpx;
|
|
|
317
|
+
|
|
259
|
318
|
.status-text {
|
|
260
|
319
|
font-size: 28rpx;
|
|
261
|
320
|
font-weight: bold;
|
|
262
|
321
|
}
|
|
|
322
|
+
|
|
|
323
|
+
|
|
263
|
324
|
}
|
|
264
|
325
|
}
|
|
265
|
326
|
|
|
|
@@ -330,6 +391,61 @@ onMounted(() => {
|
|
330
|
391
|
}
|
|
331
|
392
|
}
|
|
332
|
393
|
|
|
|
394
|
+ /* Popover 浮层 */
|
|
|
395
|
+ .popover-mask {
|
|
|
396
|
+ position: fixed;
|
|
|
397
|
+ top: 0;
|
|
|
398
|
+ left: 0;
|
|
|
399
|
+ right: 0;
|
|
|
400
|
+ bottom: 0;
|
|
|
401
|
+ z-index: 998;
|
|
|
402
|
+ }
|
|
|
403
|
+
|
|
|
404
|
+ .popover-menu {
|
|
|
405
|
+ position: absolute;
|
|
|
406
|
+ top: 80rpx;
|
|
|
407
|
+ right: 10rpx;
|
|
|
408
|
+ z-index: 999;
|
|
|
409
|
+ background: #fff;
|
|
|
410
|
+ border-radius: 16rpx;
|
|
|
411
|
+ box-shadow: 0 8rpx 32rpx rgba(0, 0, 0, 0.16);
|
|
|
412
|
+ padding: 8rpx 0;
|
|
|
413
|
+ min-width: 180rpx;
|
|
|
414
|
+
|
|
|
415
|
+ .popover-item {
|
|
|
416
|
+ display: flex;
|
|
|
417
|
+ align-items: center;
|
|
|
418
|
+ gap: 16rpx;
|
|
|
419
|
+ padding: 20rpx 32rpx;
|
|
|
420
|
+ &:active {
|
|
|
421
|
+ background: #f5f7fa;
|
|
|
422
|
+ }
|
|
|
423
|
+
|
|
|
424
|
+ .popover-text {
|
|
|
425
|
+ font-size: 28rpx;
|
|
|
426
|
+ color: #333;
|
|
|
427
|
+ }
|
|
|
428
|
+ }
|
|
|
429
|
+
|
|
|
430
|
+ .popover-divider {
|
|
|
431
|
+ height: 1rpx;
|
|
|
432
|
+ background: #f0f0f0;
|
|
|
433
|
+ margin: 0 16rpx;
|
|
|
434
|
+ }
|
|
|
435
|
+
|
|
|
436
|
+ .popover-arrow {
|
|
|
437
|
+ position: absolute;
|
|
|
438
|
+ top: -16rpx;
|
|
|
439
|
+ right: 32rpx;
|
|
|
440
|
+ width: 0;
|
|
|
441
|
+ height: 0;
|
|
|
442
|
+ border-left: 16rpx solid transparent;
|
|
|
443
|
+ border-right: 16rpx solid transparent;
|
|
|
444
|
+ border-bottom: 16rpx solid #fff;
|
|
|
445
|
+ filter: drop-shadow(0 -2rpx 2rpx rgba(0, 0, 0, 0.08));
|
|
|
446
|
+ }
|
|
|
447
|
+ }
|
|
|
448
|
+
|
|
333
|
449
|
/* 空状态 */
|
|
334
|
450
|
.empty {
|
|
335
|
451
|
padding: 80rpx 0;
|