修改跟进详细功能位置

This commit is contained in:
WindowBird 2025-11-11 15:37:39 +08:00
parent d187069086
commit 28ec62e90d
2 changed files with 84 additions and 83 deletions

View File

@ -21,15 +21,6 @@
/>
<view class="followup-user-info">
<text class="followup-user-name">{{ item.userName }}</text>
<text class="followup-user-role">销售经理</text>
</view>
<view class="followup-actions">
<view class="edit-btn" @click.stop="handleEdit(item)">
<text class="edit-icon"></text>
</view>
<view class="delete-btn" @click.stop="handleDelete(item)">
<text class="delete-icon">🗑</text>
</view>
</view>
</view>
@ -50,7 +41,6 @@
<script setup>
import { computed } from 'vue';
import { deleteFollowup } from '@/common/api/customer';
const props = defineProps({
followupList: {
@ -59,7 +49,7 @@ const props = defineProps({
}
});
const emit = defineEmits(['followup-click', 'refresh']);
const emit = defineEmits(['followup-click']);
//
const groupedFollowupList = computed(() => {
@ -140,42 +130,7 @@ const handleFollowupClick = (item) => {
emit('followup-click', item);
};
//
const handleEdit = (item) => {
if (item && item.followId) {
uni.navigateTo({
url: `/pages/customer/follow/edit/index?followId=${item.followId}`
});
}
};
//
const handleDelete = (item) => {
if (!item || !item.followId) {
uni.$uv.toast('跟进记录ID不存在');
return;
}
uni.showModal({
title: '确认删除',
content: '确定要删除这条跟进记录吗?删除后无法恢复。',
confirmText: '删除',
confirmColor: '#f56c6c',
success: async (res) => {
if (res.confirm) {
try {
await deleteFollowup(item.followId);
uni.$uv.toast('删除成功');
//
emit('refresh');
} catch (error) {
console.error('删除跟进记录失败:', error);
uni.$uv.toast(error?.message || '删除失败,请重试');
}
}
}
});
};
//
</script>
<style lang="scss" scoped>
@ -260,8 +215,8 @@ const handleDelete = (item) => {
}
.followup-avatar {
width: 40px;
height: 40px;
width: 20px;
height: 20px;
border-radius: 20px;
margin-right: 12px;
background-color: #e0e0e0;
@ -289,39 +244,7 @@ const handleDelete = (item) => {
line-height: 1.2;
}
.followup-actions {
display: flex;
align-items: center;
gap: 8px;
}
.edit-btn,
.delete-btn {
width: 32px;
height: 32px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
background-color: #f5f5f5;
transition: all 0.2s ease;
&:active {
background-color: #e0e0e0;
transform: scale(0.95);
}
}
.edit-icon,
.delete-icon {
font-size: 16px;
}
.delete-btn {
&:active {
background-color: #fee;
}
}
/* 编辑与删除按钮移动到详情页 */
.followup-arrow {
font-size: 22px;

View File

@ -175,13 +175,22 @@
<text>重试</text>
</view>
</view>
<!-- 底部操作栏 -->
<view class="bottom-actions">
<view class="action-btn edit-btn" @click="handleEdit">
<text>编辑</text>
</view>
<view class="action-btn delete-btn" @click="handleDelete">
<text>删除</text>
</view>
</view>
</view>
</template>
<script setup>
import { ref, computed, onMounted } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
import { getFollowupDetail, getCustomerFollowTypeDict } from '@/common/api/customer';
import { getFollowupDetail, getCustomerFollowTypeDict, deleteFollowup } from '@/common/api/customer';
import {
getCustomerStatusText,
getCustomerStatusClass,
@ -507,6 +516,44 @@ const handleBack = () => {
uni.navigateBack();
};
//
const handleEdit = () => {
if (!followId.value) {
uni.$uv?.toast?.('缺少跟进ID');
return;
}
uni.navigateTo({
url: `/pages/customer/follow/edit/index?followId=${followId.value}`
});
};
//
const handleDelete = () => {
if (!followId.value) {
uni.$uv?.toast?.('缺少跟进ID');
return;
}
uni.showModal({
title: '确认删除',
content: '确定要删除这条跟进记录吗?删除后无法恢复。',
confirmText: '删除',
confirmColor: '#f56c6c',
success: async (res) => {
if (res.confirm) {
try {
await deleteFollowup(followId.value);
uni.$uv?.toast?.('删除成功');
//
uni.navigateBack();
} catch (err) {
console.error('删除跟进记录失败:', err);
uni.$uv?.toast?.(err?.message || '删除失败,请重试');
}
}
}
});
};
//
onMounted(() => {
// onLoad
@ -556,6 +603,7 @@ onMounted(() => {
.content-scroll {
flex: 1;
overflow-y: auto;
padding-bottom: 72px; /* 预留底部操作栏空间 */
}
@ -789,5 +837,35 @@ onMounted(() => {
opacity: 0.8;
}
}
/* 底部操作栏与按钮(左右各占一半) */
.bottom-actions {
position: fixed;
left: 0;
right: 0;
bottom: 0;
display: flex;
z-index: 200;
background-color: #fff;
box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
}
.action-btn {
flex: 1;
height: 56px;
display: flex;
align-items: center;
justify-content: center;
font-size: 16px;
}
.edit-btn {
color: #1976d2;
border-right: 1px solid #f0f0f0;
}
.delete-btn {
color: #f56c6c;
}
</style>