调整接点页面
This commit is contained in:
@@ -62,46 +62,9 @@
|
||||
</view>
|
||||
<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="actionMenuForId && String(actionMenuForId) === String(item.id)"
|
||||
class="action-menu"
|
||||
@click.stop
|
||||
>
|
||||
<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>
|
||||
</template>
|
||||
<view class="service-status-indicator">
|
||||
<uni-icons type="bars" size="16" color="#007AFF"></uni-icons>
|
||||
<text class="service-status-indicator__text">{{ recordStateLabel }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -145,6 +108,31 @@
|
||||
<view class="service-duration">
|
||||
<text>{{ item.durationText }}</text>
|
||||
</view>
|
||||
<view class="service-actions-row">
|
||||
<view
|
||||
v-if="!isRecordingItem(item.id)"
|
||||
class="service-action-btn service-action-btn--record"
|
||||
@click.stop="startPhoneRecord(item)"
|
||||
>
|
||||
<text>录音</text>
|
||||
</view>
|
||||
<view
|
||||
v-else
|
||||
class="service-action-btn 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>
|
||||
</view>
|
||||
</view>
|
||||
<view class="service-status-empty" v-if="!serviceStatusLoading && !serviceStatusList.length">
|
||||
<text>{{ emptyListHint }}</text>
|
||||
@@ -154,12 +142,6 @@
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
<view
|
||||
v-if="actionMenuForId"
|
||||
class="action-menu-mask"
|
||||
@click="closeActionMenu"
|
||||
/>
|
||||
|
||||
<!-- 补录弹窗 -->
|
||||
<view class="supplement-dialog-mask" v-if="showSupplementModal" @click="closeSupplementDialog">
|
||||
<view class="supplement-dialog" @click.stop>
|
||||
@@ -286,8 +268,7 @@ export default {
|
||||
recorderSupported: false,
|
||||
recorderManager: null,
|
||||
recordingServiceId: null,
|
||||
recordingContext: null,
|
||||
actionMenuForId: null
|
||||
recordingContext: null
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@@ -308,51 +289,6 @@ 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) {
|
||||
@@ -820,7 +756,6 @@ export default {
|
||||
},
|
||||
async uploadFileForRecord(item, selectedFile) {
|
||||
const recordId = String(item.id);
|
||||
this.closeActionMenu();
|
||||
this.uploadingIds = [...this.uploadingIds, recordId];
|
||||
try {
|
||||
uni.showLoading({
|
||||
@@ -878,8 +813,6 @@ export default {
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.closeActionMenu();
|
||||
|
||||
uni.showModal({
|
||||
title: '确认结束',
|
||||
content: `确定要结束这条服务记录吗?`,
|
||||
@@ -1285,92 +1218,65 @@ export default {
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.service-status {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8rpx;
|
||||
}
|
||||
|
||||
.action-trigger {
|
||||
.service-status-indicator {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6rpx;
|
||||
padding: 0;
|
||||
border-radius: 10rpx;
|
||||
background-color: #EEF4FF;
|
||||
overflow: hidden;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.action-trigger__primary {
|
||||
padding: 6rpx 12rpx;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.action-trigger__primary-text {
|
||||
.service-status-indicator__text {
|
||||
font-size: 26rpx;
|
||||
color: #007AFF;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.service-actions-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
flex-wrap: wrap;
|
||||
gap: 12rpx;
|
||||
margin-top: 18rpx;
|
||||
}
|
||||
|
||||
.action-trigger__more {
|
||||
padding: 6rpx 10rpx 6rpx 6rpx;
|
||||
.service-action-btn {
|
||||
padding: 8rpx 18rpx;
|
||||
border-radius: 10rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 1.2;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-left: 1px solid rgba(0, 122, 255, 0.15);
|
||||
background-color: transparent;
|
||||
border: 1px solid transparent;
|
||||
background-color: #F8FAFF;
|
||||
}
|
||||
|
||||
.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;
|
||||
.service-action-btn--record {
|
||||
color: #007AFF;
|
||||
border-color: rgba(0, 122, 255, 0.22);
|
||||
}
|
||||
|
||||
.service-action-btn--recording {
|
||||
color: #FF3B30;
|
||||
border-color: rgba(255, 59, 48, 0.25);
|
||||
}
|
||||
|
||||
.service-action-btn--supplement {
|
||||
color: #10B981;
|
||||
border-color: rgba(16, 185, 129, 0.25);
|
||||
}
|
||||
|
||||
.service-action-btn--upload {
|
||||
color: #7C3AED;
|
||||
border-color: rgba(124, 58, 237, 0.25);
|
||||
}
|
||||
|
||||
.service-action-btn--finish {
|
||||
color: #EF4444;
|
||||
border-color: rgba(239, 68, 68, 0.28);
|
||||
background-color: #FFF7F7;
|
||||
}
|
||||
|
||||
.customer-tags {
|
||||
|
||||
Reference in New Issue
Block a user