feat: batch update - gift card breakdown spec, backend APIs, miniprogram pages, ETL finance recharge, docs & migrations

This commit is contained in:
Neo
2026-03-20 01:43:48 +08:00
parent 075caf067f
commit 79f9a0e1da
437 changed files with 118603 additions and 976 deletions

View File

@@ -0,0 +1,18 @@
{
"navigationBarTitleText": "任务详情",
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black",
"usingComponents": {
"note-modal": "/components/note-modal/note-modal",
"abandon-modal": "/components/abandon-modal/abandon-modal",
"star-rating": "/components/star-rating/star-rating",
"heart-icon": "/components/heart-icon/heart-icon",
"ai-inline-icon": "/components/ai-inline-icon/ai-inline-icon",
"ai-title-badge": "/components/ai-title-badge/ai-title-badge",
"t-icon": "tdesign-miniprogram/icon/icon",
"t-loading": "tdesign-miniprogram/loading/loading",
"clue-card": "/components/clue-card/clue-card",
"service-record-card": "/components/service-record-card/service-record-card",
"dev-fab": "/components/dev-fab/dev-fab"
}
}

View File

@@ -0,0 +1,411 @@
import { mockTaskDetails } from '../../utils/mock-data'
import type { TaskDetail, Note } from '../../utils/mock-data'
import { sortByTimestamp } from '../../utils/sort'
import { formatRelativeTime } from '../../utils/time'
import { formatMoney } from '../../utils/money'
/** 维客线索项 */
interface RetentionClue {
tag: string
tagColor: 'primary' | 'success' | 'purple' | 'error'
emoji: string
text: string
source: string
desc?: string
expanded?: boolean
}
/** 服务记录项 */
interface ServiceRecord {
table: string
type: string
typeClass: 'basic' | 'vip' | 'tip' | 'recharge' | 'incentive'
/** 卡片类型course=普通课recharge=充值提成 */
recordType?: 'course' | 'recharge'
duration: number // 折算后课时小时number
durationRaw?: number // 折算前课时小时number可选
income: number // 收入(元,整数)
/** 是否预估金额 */
isEstimate?: boolean
drinks: string
date: string
}
/** 服务汇总 */
interface ServiceSummary {
totalHours: number
totalIncome: number
avgIncome: number
}
/**
* 将 ISO/空格分隔的日期字符串格式化为中文短格式
* "2026-02-07T21:30" → "2月7日 21:30"
* 与 customer-service-records 页面拼接方式保持一致
*/
function formatServiceDate(dateStr: string): string {
if (!dateStr) return dateStr
// 兼容 "2026-02-07T21:30" 和 "2026-02-07 21:30"
const normalized = dateStr.replace('T', ' ')
const [datePart, timePart] = normalized.split(' ')
if (!datePart) return dateStr
const parts = datePart.split('-')
if (parts.length < 3) return dateStr
const month = parseInt(parts[1], 10)
const day = parseInt(parts[2], 10)
return timePart ? `${month}${day}${timePart}` : `${month}${day}`
}
Page({
data: {
pageState: 'loading' as 'loading' | 'empty' | 'normal' | 'error',
detail: null as TaskDetail | null,
sortedNotes: [] as Note[],
noteModalVisible: false,
// --- 维客线索 ---
retentionClues: [
{ tag: '客户\n基础', tagColor: 'primary', emoji: '🎂', text: '生日 3月15日 · VIP会员 · 注册2年', source: 'By:系统', expanded: false },
{ tag: '消费\n习惯', tagColor: 'success', emoji: '🌙', text: '常来夜场 · 月均4-5次', source: 'By:系统', expanded: false },
{ tag: '消费\n习惯', tagColor: 'success', emoji: '💰', text: '高客单价', source: 'By:系统', desc: '近60天场均消费 ¥420高于门店均值 ¥180偏好夜场时段酒水附加消费占比 35%', expanded: false },
{ tag: '玩法\n偏好', tagColor: 'purple', emoji: '🎱', text: '偏爱中式八球 · 斯诺克进阶中 · 最近对花式九球也有兴趣偏爱中式八球 · 斯诺克进阶中 · 最近对花式九球也有兴趣', source: 'By:系统', desc: '中式八球占比 60%,斯诺克 30%近2周开始尝试花式九球技术水平中等偏上', expanded: false },
{ tag: '重要\n反馈', tagColor: 'error', emoji: '⚠️', text: '上次提到想练斯诺克走位', source: 'By:小燕', desc: '2月7日到店时主动提及希望有针对性的走位训练建议下次安排斯诺克专项课程', expanded: false },
{ tag: '社交\n偏好', tagColor: 'purple', emoji: '👥', text: '喜欢带朋友来玩 · 社交型客户', source: 'By:系统', desc: '70%的到店记录都是多人消费,经常介绍新客户;建议推荐团建套餐和会员推荐奖励', expanded: false },
{ tag: '消费\n习惯', tagColor: 'success', emoji: '🍷', text: '酒水消费占比高 · 偏好高端酒水', source: 'By:系统', desc: '每次到店必点酒水偏好芝华士、百威等品牌酒水消费占总消费的40%', expanded: false },
{ tag: '重要\n反馈', tagColor: 'error', emoji: '💬', text: '上次提到想办生日派对', source: 'By:Lucy', desc: '3月15日生日想在店里办派对预计10-15人已记录需求建议提前联系确认', expanded: false },
] as RetentionClue[],
// --- 话术参考 ---
talkingPoints: [
'王哥您好,好久不见!最近店里新到了几张国际标准的斯诺克球桌,知道您是斯诺克爱好者,想邀请您有空来体验一下~',
'王哥,最近忙吗?这周末我们有个老客户专属的球友交流赛,奖品还挺丰富的,您要不要来参加?',
'王哥好呀,上次您提到想练练斯诺克的走位,我最近研究了一些新的训练方法,下次来的时候可以一起试试~',
'王哥,好久没见您了,您的老位置 A12 号台一直给您留着呢!最近晚上人不多,环境特别好,随时欢迎您来~',
'王哥您好,我们这个月推出了储值会员专属的夜场优惠套餐,包含球台+酒水,性价比很高,给您留意着呢~',
] as string[],
copiedIndex: -1,
// --- 近期服务记录 ---
serviceSummary: { totalHours: 6.0, totalIncome: 510, avgIncome: 170 } as ServiceSummary,
serviceRecords: [
{ table: 'A12号台', type: '基础课', typeClass: 'basic', duration: 2.5, durationRaw: 3.0, income: 200, isEstimate: true, drinks: '🍷 百威x2 红牛x1', date: formatServiceDate('2026-02-07T21:30') },
{ table: '3号台', type: '基础课', typeClass: 'basic', duration: 2.0, durationRaw: 2.0, income: 160, isEstimate: false, drinks: '🍷 可乐x1', date: formatServiceDate('2026-02-01T20:30') },
{ table: 'VIP1号房', type: '包厢课', typeClass: 'vip', duration: 1.5, durationRaw: 1.5, income: 150, isEstimate: true, drinks: '🍷 芝华士x1 矿泉水x2', date: formatServiceDate('2026-01-28T19:00') },
{ table: '', type: '充值', typeClass: 'recharge', recordType: 'recharge', duration: 0, durationRaw: 0, income: 80, isEstimate: false, drinks: '', date: formatServiceDate('2026-01-15T10:00') },
] as ServiceRecord[],
// --- 放弃弹窗 ---
abandonModalVisible: false,
// --- 手机号显示 ---
phoneVisible: false,
// --- 储值等级 ---
storageLevel: '非常多',
// --- 关系等级相关 ---
relationLevel: 'excellent' as 'poor' | 'normal' | 'good' | 'excellent',
relationLevelText: '很好',
relationColor: '#e91e63',
// --- Banner 背景(根据任务类型动态切换)---
bannerBgSvg: '/assets/images/banner-bg-red-aurora.svg',
// --- 调试面板 ---
showDebugPanel: false,
debugTaskType: 'high_priority',
debugHeartScore: 8.5,
debugShowExpandBtn: true, // 调试:备注弹窗是否显示展开/收起按钮
// --- AI 配色 ---
aiColor: 'indigo' as 'red' | 'orange' | 'yellow' | 'blue' | 'indigo' | 'purple',
},
onLoad(options: { id?: string }) {
const id = options?.id || ''
// 随机 AI 配色
const aiColors = ['red', 'orange', 'yellow', 'blue', 'indigo', 'purple'] as const
const aiColor = aiColors[Math.floor(Math.random() * aiColors.length)]
this.setData({ aiColor })
this.loadData(id)
},
loadData(id: string) {
this.setData({ pageState: 'loading' })
setTimeout(() => {
try {
const detail = mockTaskDetails.find((t) => t.id === id) || mockTaskDetails[0]
if (!detail) {
this.setData({ pageState: 'empty' })
return
}
// 根据任务类型设置 Banner 背景
let bannerBgSvg = '/assets/images/banner-bg-red-aurora.svg'
if (detail.taskType === 'high_priority') {
bannerBgSvg = '/assets/images/banner-bg-red-aurora.svg'
} else if (detail.taskType === 'priority_recall') {
bannerBgSvg = '/assets/images/banner-bg-orange-aurora.svg'
} else if (detail.taskType === 'relationship') {
bannerBgSvg = '/assets/images/banner-bg-pink-aurora.svg'
} else if (detail.taskType === 'callback') {
bannerBgSvg = '/assets/images/banner-bg-teal-aurora.svg'
}
// 添加更多 mock 备注
const mockNotes: Note[] = [
{ id: 'note-1', content: '已通过微信联系王先生,表示对新到的斯诺克球桌感兴趣,周末可能来体验。', tagType: 'customer', tagLabel: '客户:王先生', createdAt: '2026-03-10T16:30', score: 10 },
{ id: 'note-2', content: '王先生最近出差较多,到店频率降低。建议等他回来后再约。', tagType: 'customer', tagLabel: '客户:王先生', createdAt: '2026-03-05T14:20', score: 7.5 },
{ id: 'note-3', content: '上次到店时推荐了会员续费活动,客户说考虑一下。', tagType: 'customer', tagLabel: '客户:王先生', createdAt: '2026-02-28T18:45', score: 6 },
{ id: 'note-4', content: '客户对今天的服务非常满意,特别提到小燕的教学很专业。', tagType: 'customer', tagLabel: '客户:王先生', createdAt: '2026-02-20T21:15', score: 9.5 },
{ id: 'note-5', content: '完成高优先召回任务。客户反馈最近工作太忙,这周末会来店里。', tagType: 'customer', tagLabel: '客户:王先生', createdAt: '2026-02-15T10:30', score: 8 },
]
// 附加 timeLabel 字段
const notesWithLabel = mockNotes.map((n) => ({
...n,
timeLabel: formatRelativeTime(n.createdAt),
}))
const sorted = sortByTimestamp(notesWithLabel) as (Note & { timeLabel: string })[]
this.updateRelationshipDisplay(detail.heartScore)
this.setData({
pageState: 'normal',
detail,
sortedNotes: sorted,
debugHeartScore: detail.heartScore,
bannerBgSvg,
})
} catch (_e) {
this.setData({ pageState: 'error' })
}
}, 500)
},
/** 更新关系等级显示 */
updateRelationshipDisplay(score: number) {
let level: 'poor' | 'normal' | 'good' | 'excellent' = 'poor'
let text = '待发展'
let color = '#64748b' // 蓝灰色,区别于蓝色爱心
if (score > 8.5) {
level = 'excellent'
text = '很好'
color = '#e91e63' // 深粉色,区别于粉红爱心
} else if (score >= 6) {
level = 'good'
text = '良好'
color = '#ea580c' // 深橙色,区别于橙色爱心
} else if (score >= 3.5) {
level = 'normal'
text = '一般'
color = '#eab308' // 金黄色,区别于黄色爱心
}
this.setData({
relationLevel: level,
relationLevelText: text,
relationColor: color,
})
},
/** 返回 */
onBack() {
wx.navigateBack()
},
/** 重试 */
onRetry() {
const id = this.data.detail?.id || ''
this.loadData(id)
},
/** 查看/隐藏手机号 */
onTogglePhone() {
this.setData({ phoneVisible: !this.data.phoneVisible })
},
/** 复制手机号 */
onCopyPhone() {
const phone = '13812345678'
wx.setClipboardData({
data: phone,
success: () => {
wx.showToast({ title: '手机号码已复制', icon: 'none' })
},
})
},
/** 展开/收起维客线索描述 */
onToggleClue(e: WechatMiniprogram.BaseEvent) {
const idx = e.currentTarget.dataset.index as number
const key = `retentionClues[${idx}].expanded`
const current = this.data.retentionClues[idx]?.expanded || false
this.setData({ [key]: !current })
},
/** 复制话术 */
onCopySpeech(e: WechatMiniprogram.BaseEvent) {
const idx = e.currentTarget.dataset.index as number
const text = this.data.talkingPoints[idx]
if (!text) return
wx.setClipboardData({
data: text,
success: () => {
this.setData({ copiedIndex: idx })
setTimeout(() => this.setData({ copiedIndex: -1 }), 2000)
},
})
},
/** 打开备注弹窗 */
onAddNote() {
this.setData({ noteModalVisible: true })
},
/** 备注弹窗确认 */
onNoteConfirm(e: WechatMiniprogram.CustomEvent) {
const { content } = e.detail
wx.showToast({ title: '备注已保存', icon: 'success' })
this.setData({ noteModalVisible: false })
const newNote: Note = {
id: `note-${Date.now()}`,
content,
tagType: 'customer',
tagLabel: `客户:${this.data.detail?.customerName || ''}`,
createdAt: new Date().toLocaleString('zh-CN', { hour12: false }),
}
this.setData({ sortedNotes: [newNote, ...this.data.sortedNotes] })
},
/** 备注弹窗取消 */
onNoteCancel() {
this.setData({ noteModalVisible: false })
},
/** 删除备注 */
onDeleteNote(e: WechatMiniprogram.BaseEvent) {
const noteId = e.currentTarget.dataset.id as string
wx.showModal({
title: '删除备注',
content: '确定要删除这条备注吗?删除后无法恢复。',
confirmColor: '#e34d59',
success: (res) => {
if (res.confirm) {
const notes = this.data.sortedNotes.filter((n) => n.id !== noteId)
this.setData({ sortedNotes: notes })
wx.showToast({ title: '已删除', icon: 'success' })
}
},
})
},
/** 放弃/取消放弃 */
onAbandon() {
// 如果已放弃,直接取消放弃(不需要二次确认)
if (this.data.detail?.status === 'abandoned') {
this.cancelAbandon()
return
}
// 否则打开放弃弹窗
this.setData({ abandonModalVisible: true })
},
/** 取消放弃 - 直接修改状态 */
cancelAbandon() {
wx.showLoading({ title: '处理中...' })
setTimeout(() => {
wx.hideLoading()
// 更新状态为 pending
this.setData({ 'detail.status': 'pending' })
wx.showToast({ title: '已取消放弃', icon: 'success' })
}, 500)
},
/** 放弃 — 确认 */
onAbandonConfirm(_e: WechatMiniprogram.CustomEvent<{ reason: string }>) {
this.setData({ abandonModalVisible: false })
wx.showLoading({ title: '处理中...' })
setTimeout(() => {
wx.hideLoading()
// 更新状态为 abandoned
this.setData({ 'detail.status': 'abandoned' })
wx.showToast({ title: '已放弃该客户的维护', icon: 'none' })
}, 500)
},
/** 放弃 — 取消 */
onAbandonCancel() {
this.setData({ abandonModalVisible: false })
},
/** 问问助手 */
onAskAssistant() {
const customerId = this.data.detail?.id || ''
wx.navigateTo({
url: `/pages/chat/chat?customerId=${customerId}`,
fail: () => wx.showToast({ title: '页面跳转失败', icon: 'none' }),
})
},
/** 查看全部服务记录 */
onViewAllRecords() {
const customerId = this.data.detail?.id || ''
wx.navigateTo({
url: `/pages/customer-service-records/customer-service-records?customerId=${customerId}`,
fail: () => wx.showToast({ title: '页面跳转失败', icon: 'none' }),
})
},
/** noop — 阻止弹窗背景点击冒泡 */
noop() {},
/** 切换调试面板 */
toggleDebugPanel() {
this.setData({ showDebugPanel: !this.data.showDebugPanel })
},
/** 调试 - 切换任务类型 */
onDebugTaskType(e: WechatMiniprogram.BaseEvent) {
const type = e.currentTarget.dataset.type as string
const typeMap: Record<string, string> = {
high_priority: '高优先召回',
priority_recall: '优先召回',
relationship: '关系构建',
callback: '客户回访',
}
// 根据任务类型设置 Banner 背景
let bannerBgSvg = '/assets/images/banner-bg-red-aurora.svg'
if (type === 'high_priority') {
bannerBgSvg = '/assets/images/banner-bg-red-aurora.svg'
} else if (type === 'priority_recall') {
bannerBgSvg = '/assets/images/banner-bg-orange-aurora.svg'
} else if (type === 'relationship') {
bannerBgSvg = '/assets/images/banner-bg-pink-aurora.svg'
} else if (type === 'callback') {
bannerBgSvg = '/assets/images/banner-bg-teal-aurora.svg'
}
this.setData({
debugTaskType: type,
'detail.taskTypeLabel': typeMap[type] || '高优先召回',
bannerBgSvg,
})
},
/** 调试 - 调整关系数值 */
onDebugHeartScore(e: WechatMiniprogram.SliderChange) {
const score = e.detail.value
this.setData({
debugHeartScore: score,
'detail.heartScore': score,
})
this.updateRelationshipDisplay(score)
},
/** 调试 - 切换备注弹窗展开按钮 */
onDebugToggleExpandBtn(e: WechatMiniprogram.BaseEvent) {
const value = e.currentTarget.dataset.value as boolean
this.setData({ debugShowExpandBtn: value })
},
})

View File

@@ -0,0 +1,273 @@
<wxs src="../../utils/format.wxs" module="fmt" />
<!-- 加载态toast 浮层,不白屏) -->
<view class="g-toast-loading" wx:if="{{pageState === 'loading'}}">
<view class="g-toast-loading-inner">
<t-loading theme="circular" size="40rpx" />
<text class="g-toast-loading-text">加载中...</text>
</view>
</view>
<!-- 空态 -->
<view class="page-empty" wx:elif="{{pageState === 'empty'}}">
<t-icon name="info-circle" size="120rpx" color="#c5c5c5" />
<text class="empty-text">未找到任务信息</text>
</view>
<!-- 错误态 -->
<view class="page-error" wx:elif="{{pageState === 'error'}}">
<t-icon name="close-circle" size="120rpx" color="#e34d59" />
<text class="error-text">加载失败</text>
<view class="retry-btn" bindtap="onRetry" hover-class="retry-btn--hover">点击重试</view>
</view>
<!-- 正常态 -->
<block wx:elif="{{pageState === 'normal'}}">
<!-- Banner 区域SVG 背景)-->
<view class="banner-area">
<image src="{{bannerBgSvg}}" class="banner-bg-svg" mode="scaleToFill" />
<view class="banner-content">
<!-- 放弃/取消放弃按钮 - 右上角 -->
<view class="banner-abandon-btn" bindtap="onAbandon" hover-class="banner-abandon-btn--hover">
<text class="banner-abandon-text">{{detail.status === 'abandoned' ? '取消放弃' : '放弃'}}</text>
</view>
<view class="customer-info">
<view class="avatar-box">
<text class="avatar-text">{{detail.customerName[0] || '?'}}</text>
</view>
<view class="info-right">
<view class="name-row">
<text class="customer-name">{{detail.customerName}}</text>
<text class="task-type-tag">{{detail.taskTypeLabel || '高优先召回'}}</text>
</view>
<view class="sub-info">
<text class="phone">{{phoneVisible ? '13812345678' : '138****5678'}}</text>
<view class="phone-toggle-btn" bindtap="{{phoneVisible ? 'onCopyPhone' : 'onTogglePhone'}}" hover-class="phone-toggle-btn--hover">
<text class="phone-toggle-text">{{phoneVisible ? '复制' : '查看'}}</text>
</view>
<text class="storage-level-text">💰 储值 {{storageLevel}}</text>
</view>
</view>
</view>
</view>
</view>
<!-- 主体内容 -->
<view class="main-content">
<!-- 与我的关系(动态颜色)-->
<view class="card">
<view class="card-header">
<text class="section-title title-pink">与我的关系</text>
<ai-title-badge color="{{aiColor}}" />
</view>
<view class="relationship-row">
<view class="rel-tag rel-level-{{relationLevel}}">
<heart-icon score="{{detail.heartScore}}" />
<text class="rel-tag-text">{{relationLevelText}}</text>
</view>
<view class="rel-bar">
<view class="rel-bar-fill rel-fill-{{relationLevel}}" style="width: {{detail.heartScore * 10}}%; background: {{relationColor}};"></view>
</view>
<text class="rel-score" style="color: {{relationColor}};">{{fmt.toFixed(detail.heartScore, 1)}}</text>
</view>
<view class="card-desc-wrap">
<text class="card-desc">{{detail.aiAnalysis.summary}}</text>
</view>
</view>
<!-- 任务建议 -->
<view class="card">
<view class="card-header">
<text class="section-title title-orange">任务建议</text>
<ai-title-badge color="{{aiColor}}" />
</view>
<view class="suggestion-box">
<view class="suggestion-header">
<text class="suggestion-icon-text">💡 建议执行</text>
</view>
<view class="suggestion-body">
<view class="suggestion-intro-wrap">
<text class="suggestion-intro">该客户已有 15 天未到店,存在流失风险。建议通过微信联系:</text>
</view>
<view class="suggestion-item" wx:for="{{detail.aiAnalysis.suggestions}}" wx:key="index">
<text class="suggestion-item-text">• {{item}}</text>
</view>
</view>
</view>
<view class="speech-section">
<text class="speech-title">💬 话术参考</text>
<view class="speech-list">
<view class="speech-bubble" wx:for="{{talkingPoints}}" wx:key="index">
<view class="speech-text-wrap">
<ai-inline-icon color="{{aiColor}}" />
<text class="speech-text">{{item}}</text>
</view>
<view class="speech-copy-row">
<view class="copy-btn" bindtap="onCopySpeech" data-index="{{index}}" hover-class="copy-btn--hover">
<text class="copy-btn-text">{{copiedIndex === index ? '✓ 已复制' : '复制'}}</text>
</view>
</view>
<view class="speech-arrow"></view>
</view>
</view>
</view>
</view>
<!-- 维客线索 -->
<view class="card">
<view class="card-header">
<text class="section-title title-green">维客线索</text>
<ai-title-badge color="{{aiColor}}" />
</view>
<view class="clue-list">
<clue-card
wx:for="{{retentionClues}}"
wx:key="index"
tag="{{item.tag}}"
category="{{item.tagColor}}"
emoji="{{item.emoji}}"
title="{{item.text}}"
source="{{item.source}}"
content="{{item.desc || ''}}"
/>
</view>
</view>
<!-- 我给TA的备注 -->
<view class="card">
<view class="card-header">
<text class="section-title title-blue">我给TA的备注</text>
<text class="note-count">{{sortedNotes.length}} 条备注</text>
</view>
<block wx:if="{{sortedNotes.length > 0}}">
<view class="note-item" wx:for="{{sortedNotes}}" wx:key="id">
<view class="note-top">
<view class="note-date-wrap">
<text class="note-date">{{item.timeLabel || item.createdAt}}</text>
</view>
<view class="note-top-right">
<star-rating score="{{item.score || 3}}" size="28rpx" readonly="{{true}}" />
<view class="note-delete-btn" catchtap="onDeleteNote" data-id="{{item.id}}" hover-class="note-delete-btn--hover">
<t-icon name="delete" size="32rpx" color="#a6a6a6" />
</view>
</view>
</view>
<view class="note-content-wrap">
<text class="note-content">{{item.content}}</text>
</view>
</view>
</block>
<view class="note-empty" wx:else>
<t-icon name="edit-1" size="80rpx" color="#dcdcdc" />
<text class="empty-hint">暂无备注</text>
</view>
</view>
<!-- 60天内服务记录 -->
<view class="card">
<view class="card-header">
<text class="section-title title-blue">60天内服务记录</text>
<text class="note-count">共 {{serviceRecords.length}} 次</text>
</view>
<!-- 汇总统计 -->
<view class="svc-summary">
<view class="svc-summary-item svc-summary-blue">
<view class="svc-summary-value-row">
<text class="svc-summary-value svc-val-blue">{{fmt.hours(serviceSummary.totalHours)}}</text>
</view>
<text class="svc-summary-label">总时长</text>
</view>
<view class="svc-summary-item svc-summary-green">
<text class="svc-summary-value svc-val-green">{{fmt.money(serviceSummary.totalIncome)}}</text>
<text class="svc-summary-label">总收入</text>
</view>
<view class="svc-summary-item svc-summary-orange">
<text class="svc-summary-value svc-val-orange">{{fmt.money(serviceSummary.avgIncome)}}</text>
<text class="svc-summary-label">场均</text>
</view>
</view>
<!-- 记录列表(使用 service-record-card 组件)-->
<view class="svc-list">
<service-record-card
wx:for="{{serviceRecords}}"
wx:key="index"
time="{{item.date}}"
course-label="{{item.type}}"
type-class="{{item.typeClass}}"
type="{{item.recordType || 'course'}}"
table-no="{{item.table}}"
hours="{{item.duration}}"
hours-raw="{{item.durationRaw}}"
drinks="{{item.drinks}}"
income="{{item.income}}"
is-estimate="{{item.isEstimate}}"
/>
</view>
<view class="svc-view-all" bindtap="onViewAllRecords" hover-class="svc-view-all--hover">
<text class="svc-view-all-text">查看全部服务记录 →</text>
</view>
</view>
</view>
<!-- 底部操作栏 -->
<view class="bottom-bar safe-area-bottom">
<view class="btn-ask" bindtap="onAskAssistant" hover-class="btn-ask--hover">
<t-icon name="chat" size="36rpx" color="#ffffff" />
<text class="btn-text">问问助手</text>
</view>
<view class="btn-note" bindtap="onAddNote" hover-class="btn-note--hover">
<t-icon name="edit-1" size="36rpx" color="#242424" />
<text class="btn-text-dark">备注</text>
</view>
</view>
<!-- 备注弹窗 -->
<note-modal visible="{{noteModalVisible}}" customerName="{{detail.customerName || ''}}" initialScore="{{0}}" initialContent="" showExpandBtn="{{detail.taskType !== 'callback'}}" showRating="{{true}}" bind:confirm="onNoteConfirm" bind:cancel="onNoteCancel" />
<!-- 放弃弹窗 -->
<abandon-modal
visible="{{abandonModalVisible}}"
customerName="{{detail.customerName || ''}}"
bind:confirm="onAbandonConfirm"
bind:cancel="onAbandonCancel"
/>
<!-- 页面调试工具 -->
<view class="debug-panel" wx:if="{{showDebugPanel}}">
<view class="debug-header">
<text class="debug-title">🔧 页面调试</text>
<view class="debug-close" bindtap="toggleDebugPanel" hover-class="debug-close--hover">
<t-icon name="close" size="32rpx" color="#5e5e5e" />
</view>
</view>
<view class="debug-section">
<text class="debug-label">任务类型:</text>
<view class="debug-btn-group">
<view class="debug-btn {{debugTaskType === 'high_priority' ? 'debug-btn--active' : ''}}" bindtap="onDebugTaskType" data-type="high_priority">高优先召回</view>
<view class="debug-btn {{debugTaskType === 'priority_recall' ? 'debug-btn--active' : ''}}" bindtap="onDebugTaskType" data-type="priority_recall">优先召回</view>
<view class="debug-btn {{debugTaskType === 'relationship' ? 'debug-btn--active' : ''}}" bindtap="onDebugTaskType" data-type="relationship">关系构建</view>
<view class="debug-btn {{debugTaskType === 'callback' ? 'debug-btn--active' : ''}}" bindtap="onDebugTaskType" data-type="callback">客户回访</view>
</view>
</view>
<view class="debug-section">
<text class="debug-label">关系数值:{{debugHeartScore}}</text>
<slider class="debug-slider" min="0" max="10" step="0.5" value="{{debugHeartScore}}" bindchange="onDebugHeartScore" activeColor="#ec4899" backgroundColor="#f3f3f3" block-size="24" />
<view class="debug-hint">
<text>0-3.5: 待发展</text>
<text>3.5-6: 一般</text>
<text>6-8.5: 良好</text>
<text>>8.5: 很好</text>
</view>
</view>
</view>
<!-- 调试面板触发按钮 -->
<view class="debug-trigger" bindtap="toggleDebugPanel" hover-class="debug-trigger--hover">
<text>🔧</text>
</view>
</block>

File diff suppressed because it is too large Load Diff