调整接待中验页面的4个按钮。

This commit is contained in:
zhonghua.li
2026-04-18 21:45:23 +08:00
parent 453b6e8841
commit f373f591dd
8 changed files with 171 additions and 79 deletions

View File

@@ -63,29 +63,41 @@
<text class="staff-name">{{ item.staffName || '未分配销售' }}</text>
</view>
<view class="service-status">
<view class="action-trigger">
<view class="action-trigger__primary" @click.stop="finishService(item)">
<text class="action-trigger__primary-text">结束服务</text>
</view>
<view class="action-trigger__more" @click.stop="toggleActionMenu(item.id)">
<uni-icons type="bottom" size="16" color="#007AFF"></uni-icons>
</view>
</view>
<view
v-if="!isRecordingItem(item.id)"
class="service-action-btn service-action-btn--record"
@click.stop="startPhoneRecord(item)"
v-if="actionMenuForId && String(actionMenuForId) === String(item.id)"
class="action-menu"
@click.stop
>
<text>录音</text>
</view>
<view
v-else
class="service-action-btn service-action-btn--record service-action-btn--recording"
@click.stop="stopPhoneRecordAndUpload(item)"
>
<text>停止</text>
</view>
<view class="service-action-btn service-action-btn--supplement" @click.stop="showSupplementDialog(item)">
<text>补录</text>
</view>
<view class="service-action-btn service-action-btn--upload" @click.stop="chooseAndUploadFile(item)">
<text>{{ isUploading(item.id) ? '上传中' : '上传' }}</text>
</view>
<view class="service-action-btn service-action-btn--finish" @click.stop="finishService(item)">
<text>结束</text>
<view
class="action-menu-item"
@click.stop="onActionMenuSelect('record', item)"
>
<text>{{ isRecordingItem(item.id) ? '停止录音' : '开始录音' }}</text>
</view>
<view
class="action-menu-item"
@click.stop="onActionMenuSelect('supplement', item)"
>
<text>补录客户</text>
</view>
<view
class="action-menu-item"
:class="{ 'action-menu-item--disabled': isUploading(item.id) }"
@click.stop="onActionMenuSelect('upload', item)"
>
<text>{{ isUploading(item.id) ? '上传中' : '上传录音' }}</text>
</view>
</view>
<template v-if="showRecordStateIndicator">
<uni-icons type="bars" size="16" color="#007AFF"></uni-icons>
<text>{{ recordStateLabel }}</text>
@@ -141,6 +153,12 @@
<text>正在加载更多...</text>
</view>
</scroll-view>
<view
v-if="actionMenuForId"
class="action-menu-mask"
@click="closeActionMenu"
/>
<!-- 补录弹窗 -->
<view class="supplement-dialog-mask" v-if="showSupplementModal" @click="closeSupplementDialog">
@@ -268,7 +286,8 @@ export default {
recorderSupported: false,
recorderManager: null,
recordingServiceId: null,
recordingContext: null
recordingContext: null,
actionMenuForId: null
}
},
mounted() {
@@ -289,6 +308,51 @@ export default {
}
},
methods: {
toggleActionMenu(recordId) {
const id = recordId === undefined || recordId === null ? null : String(recordId);
if (!id) {
this.actionMenuForId = null;
return;
}
this.actionMenuForId = this.actionMenuForId === id ? null : id;
},
closeActionMenu() {
this.actionMenuForId = null;
},
onActionMenuSelect(action, item) {
if (!item || !item.id) {
this.closeActionMenu();
return;
}
const id = String(item.id);
if (this.actionMenuForId && String(this.actionMenuForId) !== id) {
// 避免列表复用导致错点
this.actionMenuForId = id;
}
if (action === 'record') {
if (this.isRecordingItem(item.id)) {
this.stopPhoneRecordAndUpload(item);
} else {
this.startPhoneRecord(item);
}
this.closeActionMenu();
return;
}
if (action === 'supplement') {
this.showSupplementDialog(item);
this.closeActionMenu();
return;
}
if (action === 'upload') {
if (this.isUploading(item.id)) {
return;
}
this.chooseAndUploadFile(item);
this.closeActionMenu();
return;
}
this.closeActionMenu();
},
initServiceRecorder() {
this.recorderSupported = typeof uni.getRecorderManager === 'function';
if (!this.recorderSupported) {
@@ -756,6 +820,7 @@ export default {
},
async uploadFileForRecord(item, selectedFile) {
const recordId = String(item.id);
this.closeActionMenu();
this.uploadingIds = [...this.uploadingIds, recordId];
try {
uni.showLoading({
@@ -813,6 +878,7 @@ export default {
});
return;
}
this.closeActionMenu();
uni.showModal({
title: '确认结束',
@@ -1155,6 +1221,7 @@ export default {
margin-bottom: 24rpx;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
overflow: visible;
position: relative;
}
.card-header {
@@ -1224,6 +1291,82 @@ export default {
align-items: center;
gap: 8rpx;
}
.action-trigger {
display: inline-flex;
align-items: center;
gap: 6rpx;
padding: 0;
border-radius: 10rpx;
background-color: #EEF4FF;
overflow: hidden;
}
.action-trigger__primary {
padding: 6rpx 12rpx;
display: inline-flex;
align-items: center;
justify-content: center;
background-color: transparent;
}
.action-trigger__primary-text {
font-size: 26rpx;
color: #007AFF;
white-space: nowrap;
}
.action-trigger__more {
padding: 6rpx 10rpx 6rpx 6rpx;
display: inline-flex;
align-items: center;
justify-content: center;
border-left: 1px solid rgba(0, 122, 255, 0.15);
background-color: transparent;
}
.action-menu {
position: absolute;
right: 24rpx;
top: 96rpx;
min-width: 220rpx;
background-color: #FFFFFF;
border-radius: 16rpx;
box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.12);
border: 1px solid #EEF0F3;
z-index: 50;
overflow: hidden;
}
.action-menu-item {
padding: 22rpx 24rpx;
display: flex;
align-items: center;
justify-content: flex-start;
}
.action-menu-item text {
font-size: 28rpx;
color: #111827;
}
.action-menu-item:active {
background-color: #F5F7FA;
}
.action-menu-item--disabled {
opacity: 0.55;
}
.action-menu-mask {
position: fixed;
left: 0;
top: 0;
right: 0;
bottom: 0;
background-color: transparent;
z-index: 40;
}
.service-status text {
font-size: 26rpx;
@@ -1386,58 +1529,6 @@ export default {
font-size: 26rpx;
color: #999;
}
.service-action-btn {
padding: 6rpx 16rpx;
border-radius: 4rpx;
font-size: 26rpx;
font-weight: 400;
display: flex;
align-items: center;
justify-content: center;
margin-right: 12rpx;
cursor: pointer;
}
.service-action-btn--finish {
color: #007AFF;
background-color: transparent;
}
.service-action-btn--finish:active {
opacity: 0.7;
}
.service-action-btn--supplement {
color: #10B981;
background-color: transparent;
}
.service-action-btn--supplement:active {
opacity: 0.7;
}
.service-action-btn--upload {
color: #7C3AED;
background-color: transparent;
}
.service-action-btn--upload:active {
opacity: 0.7;
}
.service-action-btn--record {
color: #007AFF;
background-color: transparent;
}
.service-action-btn--record:active {
opacity: 0.7;
}
.service-action-btn--recording {
color: #FF3B30;
}
.service-status-empty {
padding: 48rpx 0;