diff --git a/pages/champion/champion.vue b/pages/champion/champion.vue
index fd05ef9..a020ebd 100644
--- a/pages/champion/champion.vue
+++ b/pages/champion/champion.vue
@@ -44,352 +44,13 @@
-
-
-
- 共{{ practiceTotal }}条
-
-
-
-
-
- 刷新
-
-
-
-
-
-
-
-
-
-
- 所属行业: {{ item.industry }}
-
-
-
-
- 详情: {{ getContentPreview(item.content || item.detail, 30) }}
-
-
- 提示词: {{ getContentPreview(item.remark, 30) }}
-
-
-
-
-
-
-
- 暂无陪练
-
-
- 正在加载更多...
-
-
+
+
-
-
-
+
+
-
-
-
-
-
-
-
- 共{{ trainingTotal }}条
-
-
-
-
-
-
- 刷新
-
-
-
-
-
-
-
-
-
-
- 陪练场景: {{ item.scenario }}
-
-
-
-
- 参与人: {{ item.participantName }}
-
-
- 电话: {{ item.participantPhone }}
-
-
-
-
- 创建时间: {{ formatDateTime(item.createTime) }}
-
-
- 结束时间: {{ formatDateTime(item.endTime) }}
-
-
-
- 暂无陪练记录
-
-
- 正在加载更多...
-
-
-
-
-
-
+
-
-
-
- 共{{ materialTotal }}条
-
-
-
-
-
- 刷新
-
-
-
-
-
-
-
-
-
-
- 所属行业: {{ item.industry }}
-
-
-
-
- 详情: {{ getContentPreview(item.content || item.detail, 30) }}
-
-
- 提示词: {{ getContentPreview(item.remark, 30) }}
-
-
-
-
-
-
-
- 暂无素材
-
-
- 正在加载更多...
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -775,147 +71,33 @@
// #ifdef APP
import statusBar from "@/uni_modules/uni-nav-bar/components/uni-nav-bar/uni-status-bar";
// #endif
- import { getApiUrl } from "@/common/config.js";
-
- // 获取租户ID
- function getTenantId() {
- try {
- return uni.getStorageSync('backend-tenant-id') || '';
- } catch (e) {
- console.error('获取 tenantId 失败:', e);
- return '';
- }
- }
+ import PracticeTab from "./components/practice-tab.vue";
+ import TrainingTab from "./components/training-tab.vue";
+ import MaterialTab from "./components/material-tab.vue";
export default {
// #ifdef APP
components: {
- statusBar
+ statusBar,
+ PracticeTab,
+ TrainingTab,
+ MaterialTab
+ },
+ // #endif
+ // #ifndef APP
+ components: {
+ PracticeTab,
+ TrainingTab,
+ MaterialTab
},
// #endif
data() {
return {
- activeTab: 'practice',
- // 素材相关数据
- materialList: [],
- materialLoading: false,
- materialTotal: 0,
- materialPage: {
- current: 1,
- size: 10
- },
- materialQuery: {
- title: '',
- category: '基础知识库',
- industry: '',
- creator: '',
- status: ''
- },
- // 陪练相关数据
- practiceList: [],
- practiceLoading: false,
- practiceTotal: 0,
- practicePage: {
- current: 1,
- size: 10
- },
- practiceQuery: {
- title: '',
- industry: '',
- creator: '',
- status: ''
- },
- // 添加素材弹出框
- showMaterialPopup: false,
- materialForm: {
- title: '',
- category: '',
- industry: '',
- files: []
- },
- // 编辑素材弹出框
- showEditMaterialPopup: false,
- editMaterialForm: {
- id: '',
- title: '',
- category: '',
- industry: '',
- content: '',
- remark: ''
- },
- // 上下文菜单
- contextMenuVisible: false,
- contextMenuIndex: -1,
- contextMenuTop: 0,
- contextMenuLeft: 0,
- // 添加陪练弹出框
- showPracticePopup: false,
- practiceForm: {
- title: '',
- category: '',
- industry: '',
- content: '',
- remark: ''
- },
- // 编辑陪练弹出框
- showEditPracticePopup: false,
- editPracticeForm: {
- id: '',
- title: '',
- category: '',
- industry: '',
- content: '',
- remark: ''
- },
- // 陪练操作菜单
- selectedPracticeItem: null,
- showPracticeActionMenu: false,
- // 陪练弹出框
- showPracticeTrainingPopup: false,
- practiceTrainingForm: {
- scenarioId: '',
- title: '',
- scenario: '',
- participantName: '',
- participantPhone: ''
- },
- // 陪练列表相关数据
- trainingList: [],
- trainingLoading: false,
- trainingTotal: 0,
- trainingPage: {
- current: 1,
- size: 10
- },
- trainingQuery: {
- title: '',
- participantName: '',
- participantPhone: ''
- },
- // 内容详情弹出框
- showContentPopup: false,
- contentPopupTitle: '',
- contentPopupText: '',
- // 陪练操作菜单
- selectedTrainingItem: null,
- showTrainingActionMenu: false,
- // 陪练详情列表弹出框
- showTrainingItemListPopup: false,
- trainingItemList: [],
- trainingItemLoading: false,
- trainingItemTotal: 0,
- trainingItemPage: {
- current: 1,
- size: 10
- },
- currentTrainingParentId: ''
+ activeTab: 'practice'
}
},
onLoad() {
- // 页面加载时,如果默认是场景tab页,则调用接口填充数据
- if (this.activeTab === 'practice') {
- this.fetchPracticeList();
- }
+ // 页面加载时,如果默认是场景tab页,子组件会自动加载数据
},
methods: {
goBack() {
@@ -923,1318 +105,15 @@
},
switchTab(tab) {
this.activeTab = tab;
- if (tab === 'material') {
- // 当进入素材页面时,请求接口填充数据
- this.fetchMaterialList();
- } else if (tab === 'practice') {
- // 当进入场景页面时,请求接口填充数据
- this.fetchPracticeList();
- } else if (tab === 'training') {
- // 当进入陪练页面时,请求接口填充数据
- this.fetchTrainingList();
- }
},
- // 素材相关方法
- onMaterialSearch() {
- if (this.activeTab !== 'material') {
- this.activeTab = 'material';
- }
- this.materialPage.current = 1;
- this.fetchMaterialList({ force: true });
+ handleSwitchToTraining() {
+ // 处理从场景tab切换到陪练tab的事件
+ this.switchTab('training');
},
- onMaterialRefresh() {
- this.materialPage.current = 1;
- this.fetchMaterialList({ force: true });
- },
- onMaterialReachBottom() {
- // 已在加载中或全部加载完成则不再触发
- if (this.materialLoading) return;
- if (this.materialList.length >= this.materialTotal) return;
- this.materialPage.current += 1;
- this.fetchMaterialList();
- },
- async fetchMaterialList({ force = false } = {}) {
- if (this.materialLoading && !force) {
- return;
- }
- this.materialLoading = true;
- try {
- const queryParams = {
- current: this.materialPage.current,
- size: this.materialPage.size,
- category: '基础知识库' // 默认添加知识分类参数
- };
- const trimmedTitle = this.materialQuery?.title?.trim();
- const trimmedIndustry = this.materialQuery?.industry?.trim();
- const trimmedCreator = this.materialQuery?.creator?.trim();
- const trimmedStatus = this.materialQuery?.status?.trim();
-
- if (trimmedTitle) {
- queryParams.title = trimmedTitle;
- }
- if (trimmedIndustry) {
- queryParams.industry = trimmedIndustry;
- }
- if (trimmedCreator) {
- queryParams.creator = trimmedCreator;
- }
- if (trimmedStatus) {
- queryParams.status = trimmedStatus;
- }
-
- const queryString = Object.keys(queryParams)
- .map(key => `${key}=${encodeURIComponent(queryParams[key])}`)
- .join('&');
- const url = `${getApiUrl('/api/knowledgeBase/list')}?${queryString}`;
-
- // 获取租户ID
- const tenantId = getTenantId();
- const headers = {};
- if (tenantId) {
- headers['X-Tenant-Id'] = tenantId;
- }
-
- const res = await uni.request({
- url,
- method: 'POST',
- header: headers,
- timeout: 10000
- });
-
- if (res.statusCode === 200 && res.data && res.data.success) {
- const records = Array.isArray(res.data.data) ? res.data.data : [];
- // 第一页或强制刷新时重置列表,否则追加
- if (this.materialPage.current === 1 || force) {
- this.materialList = records;
- } else {
- this.materialList = this.materialList.concat(records);
- }
- this.materialTotal = Number(res.data.total) || 0;
- } else {
- this.materialList = [];
- this.materialTotal = 0;
- uni.showToast({
- title: res.data?.message || '获取素材列表失败',
- icon: 'none'
- });
- }
- } catch (error) {
- console.error('获取素材列表失败:', error);
- uni.showToast({
- title: '获取素材列表失败,请稍后重试',
- icon: 'none'
- });
- } finally {
- this.materialLoading = false;
- }
- },
- formatDateTime(value) {
- if (!value) {
- return '';
- }
- const date = new Date(value);
- if (Number.isNaN(date.getTime())) {
- return '';
- }
- const year = date.getFullYear();
- const month = String(date.getMonth() + 1).padStart(2, '0');
- const day = String(date.getDate()).padStart(2, '0');
- const hours = String(date.getHours()).padStart(2, '0');
- const minutes = String(date.getMinutes()).padStart(2, '0');
- const seconds = String(date.getSeconds()).padStart(2, '0');
- return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
- },
- viewMaterialDetail(item) {
- // 查看素材详情
- console.log('查看素材详情', item);
- },
- getContentPreview(content, limit = 30) {
- if (!content) return '';
- const text = String(content).replace(/\s+/g, ' ').trim();
- if (!text) return '';
- return text.length > limit ? `${text.substring(0, limit)}...` : text;
- },
- showFullText(title, content) {
- if (!content) return;
- this.contentPopupTitle = title || '详情';
- this.contentPopupText = String(content);
- this.showContentPopup = true;
- },
- closeContentPopup() {
- this.showContentPopup = false;
- this.contentPopupTitle = '';
- this.contentPopupText = '';
- },
- showContextMenu(item, index, event) {
- // 阻止事件冒泡
- if (event && event.stopPropagation) {
- event.stopPropagation();
- }
- // 获取系统信息以计算位置
- const systemInfo = uni.getSystemInfoSync();
- // 获取点击位置 - 优先使用触摸事件坐标
- let top = 100;
- let left = systemInfo.windowWidth - 180;
-
- if (event) {
- if (event.touches && event.touches.length > 0) {
- // 触摸事件
- top = event.touches[0].clientY;
- left = event.touches[0].clientX - 80;
- } else if (event.detail && typeof event.detail.x === 'number') {
- // tap事件坐标(单位:px,需要转换)
- top = event.detail.y;
- left = event.detail.x - 80;
- } else if (event.clientY !== undefined) {
- // 鼠标事件
- top = event.clientY;
- left = event.clientX - 80;
- }
- }
-
- // 确保菜单不超出屏幕
- if (left + 160 > systemInfo.windowWidth) {
- left = systemInfo.windowWidth - 180;
- }
- if (left < 0) {
- left = 10;
- }
-
- this.contextMenuTop = top;
- this.contextMenuLeft = left;
- // 显示菜单
- this.contextMenuIndex = index;
- this.contextMenuVisible = true;
- },
- closeContextMenu() {
- this.contextMenuVisible = false;
- this.contextMenuIndex = -1;
- },
- handleEditMaterial(item) {
- this.closeContextMenu();
- // 填充编辑表单
- this.editMaterialForm = {
- id: item.id,
- title: item.title || '',
- category: item.category || '',
- industry: item.industry || '',
- content: item.content || '',
- remark: item.remark || ''
- };
- this.showEditMaterialPopup = true;
- },
- closeEditMaterialPopup() {
- this.showEditMaterialPopup = false;
- this.editMaterialForm = {
- id: '',
- title: '',
- category: '',
- industry: '',
- content: '',
- remark: ''
- };
- },
- async submitEditMaterial() {
- // 表单验证
- if (!this.editMaterialForm.title || !this.editMaterialForm.title.trim()) {
- uni.showToast({
- title: "请输入知识标题",
- icon: "none"
- });
- return;
- }
-
- try {
- uni.showLoading({
- title: "保存中..."
- });
-
- // 获取租户ID
- const tenantId = getTenantId();
- const headers = {
- "Content-Type": "application/json"
- };
- if (tenantId) {
- headers['X-Tenant-Id'] = tenantId;
- // 同时在数据中也添加租户ID(如果后端需要)
- if (!this.editMaterialForm.tenantId) {
- this.editMaterialForm.tenantId = tenantId;
- }
- }
-
- const res = await uni.request({
- url: getApiUrl('/api/knowledgeBase/update'),
- method: 'PUT',
- data: this.editMaterialForm,
- header: headers,
- timeout: 15000
- });
-
- uni.hideLoading();
-
- if (res.statusCode === 200 && res.data && (res.data.success || res.data.code === 200)) {
- uni.showToast({
- title: res.data?.message || "保存成功",
- icon: "success"
- });
- // 关闭弹出框并刷新列表
- this.closeEditMaterialPopup();
- this.materialPage.current = 1;
- this.fetchMaterialList({ force: true });
- } else {
- uni.showToast({
- title: res.data?.message || "保存失败",
- icon: "none"
- });
- }
- } catch (error) {
- uni.hideLoading();
- console.error("保存素材失败:", error);
- uni.showToast({
- title: error?.message || "保存失败,请重试",
- icon: "none"
- });
- }
- },
- handleDeleteMaterial(item) {
- this.closeContextMenu();
- uni.showModal({
- title: '提示',
- content: '确认删除该素材吗?',
- success: async (res) => {
- if (res.confirm) {
- try {
- uni.showLoading({
- title: "删除中..."
- });
-
- // 获取租户ID
- const tenantId = getTenantId();
- const headers = {};
- if (tenantId) {
- headers['X-Tenant-Id'] = tenantId;
- }
-
- const deleteRes = await uni.request({
- url: getApiUrl(`/api/knowledgeBase/delete/${item.id}`),
- method: 'DELETE',
- header: headers,
- timeout: 15000
- });
-
- uni.hideLoading();
-
- if (deleteRes.statusCode === 200 && deleteRes.data && (deleteRes.data.success || deleteRes.data.code === 200)) {
- uni.showToast({
- title: deleteRes.data?.message || "删除成功",
- icon: "success"
- });
- // 刷新列表
- this.materialPage.current = 1;
- this.fetchMaterialList({ force: true });
- } else {
- uni.showToast({
- title: deleteRes.data?.message || "删除失败",
- icon: "none"
- });
- }
- } catch (error) {
- uni.hideLoading();
- console.error("删除素材失败:", error);
- uni.showToast({
- title: error?.message || "删除失败,请重试",
- icon: "none"
- });
- }
- }
- }
- });
- },
- // 添加素材相关方法
- showAddMaterial() {
- this.showMaterialPopup = true;
- this.materialForm = {
- title: '',
- category: '基础知识库', // 固定值,不可修改
- industry: '汽车销售', // 默认值
- file: null
- };
- },
- closeMaterialPopup() {
- this.showMaterialPopup = false;
- },
- chooseFile() {
- // 限制只能上传一个文件
- // #ifdef H5
- // H5平台使用chooseFile
- uni.chooseFile({
- count: 1,
- success: (res) => {
- const tempFiles = res.tempFiles || [];
- if (tempFiles.length > 0) {
- const file = tempFiles[0];
- // 替换文件,而不是添加
- this.materialForm.file = {
- name: file.name || '文件',
- path: file.path || file.url,
- size: file.size
- };
- }
- },
- fail: (err) => {
- console.error('选择文件失败:', err);
- uni.showToast({
- title: '选择文件失败',
- icon: 'none'
- });
- }
- });
- // #endif
- // #ifndef H5
- // 非H5平台使用chooseImage(可以选择图片文件)
- uni.chooseImage({
- count: 1,
- success: (res) => {
- const tempFiles = res.tempFiles || [];
- if (tempFiles.length > 0) {
- const file = tempFiles[0];
- // 替换文件,而不是添加
- this.materialForm.file = {
- name: file.name || '图片',
- path: file.path,
- size: file.size
- };
- }
- },
- fail: (err) => {
- console.error('选择文件失败:', err);
- uni.showToast({
- title: '选择文件失败',
- icon: 'none'
- });
- }
- });
- // #endif
- },
- removeFile() {
- // 清空文件
- this.materialForm.file = null;
- },
- async submitMaterial() {
- // 表单验证
- if (!this.materialForm.title || !this.materialForm.title.trim()) {
- uni.showToast({
- title: "请输入知识标题",
- icon: "none"
- });
- return;
- }
-
- try {
- uni.showLoading({
- title: "提交中..."
- });
-
- // 获取租户ID
- const tenantId = getTenantId();
-
- let res;
-
- // 如果有文件,使用 uni.uploadFile 同时上传文件和其他表单数据
- if (this.materialForm.file) {
- // 使用 uni.uploadFile 将文件和其他字段一起提交
- const formData = {
- // 其他表单字段
- 'title': this.materialForm.title.trim(),
- 'category': this.materialForm.category?.trim() || '',
- 'industry': this.materialForm.industry?.trim() || '',
- 'content': '-',
- 'fileName': this.materialForm.file.name || 'file' // 文件名
- };
-
- // 添加租户ID到formData
- if (tenantId) {
- formData['tenantId'] = tenantId;
- }
-
- res = await uni.uploadFile({
- url: getApiUrl('/api/knowledgeBase/add'),
- filePath: this.materialForm.file.path,
- name: 'file', // 文件字段名
- formData: formData,
- header: tenantId ? {
- 'X-Tenant-Id': tenantId
- } : {},
- timeout: 15000
- });
- } else {
- // 如果没有文件,使用 uni.request 提交表单数据
- const payload = {
- title: this.materialForm.title.trim(),
- category: this.materialForm.category?.trim() || '',
- industry: this.materialForm.industry?.trim() || '',
- content: "-"
- };
-
- // 添加租户ID到payload
- if (tenantId) {
- payload.tenantId = tenantId;
- }
-
- const headers = {
- "Content-Type": "application/json"
- };
-
- // 添加租户ID到header
- if (tenantId) {
- headers['X-Tenant-Id'] = tenantId;
- }
-
- res = await uni.request({
- url: getApiUrl('/api/knowledgeBase/add'),
- method: 'POST',
- data: payload,
- header: headers,
- timeout: 15000
- });
- }
-
- uni.hideLoading();
-
- // 处理响应(uni.uploadFile 返回的 data 可能是字符串,需要解析)
- let result;
- if (this.materialForm.file) {
- // uni.uploadFile 返回的数据需要解析
- try {
- result = typeof res.data === 'string' ? JSON.parse(res.data) : res.data;
- } catch (e) {
- result = res.data;
- }
- } else {
- result = res.data;
- }
-
- if (res.statusCode === 200 && result && (result.success || result.code === 200)) {
- uni.showToast({
- title: result?.message || "提交成功",
- icon: "success"
- });
- // 关闭弹出框并刷新列表
- this.closeMaterialPopup();
- this.materialPage.current = 1;
- this.fetchMaterialList({ force: true });
- } else {
- uni.showToast({
- title: result?.message || "提交失败",
- icon: "none"
- });
- }
- } catch (error) {
- uni.hideLoading();
- console.error("提交素材失败:", error);
- uni.showToast({
- title: error?.message || "提交失败,请重试",
- icon: "none"
- });
- }
- },
- // 陪练相关方法
- onPracticeSearch() {
- if (this.activeTab !== 'practice') {
- this.activeTab = 'practice';
- }
- this.practicePage.current = 1;
- this.fetchPracticeList({ force: true });
- },
- onPracticeRefresh() {
- this.practicePage.current = 1;
- this.fetchPracticeList({ force: true });
- },
- onPracticeReachBottom() {
- // 已在加载中或全部加载完成则不再触发
- if (this.practiceLoading) return;
- if (this.practiceList.length >= this.practiceTotal) return;
- this.practicePage.current += 1;
- this.fetchPracticeList();
- },
- async fetchPracticeList({ force = false } = {}) {
- if (this.practiceLoading && !force) {
- return;
- }
- this.practiceLoading = true;
- try {
- const queryParams = {
- current: this.practicePage.current,
- size: this.practicePage.size,
- category: 'AI陪练虚拟人' // 默认添加知识分类参数
- };
- const trimmedTitle = this.practiceQuery?.title?.trim();
- const trimmedIndustry = this.practiceQuery?.industry?.trim();
- const trimmedCreator = this.practiceQuery?.creator?.trim();
- const trimmedStatus = this.practiceQuery?.status?.trim();
-
- if (trimmedTitle) {
- queryParams.title = trimmedTitle;
- }
- if (trimmedIndustry) {
- queryParams.industry = trimmedIndustry;
- }
- if (trimmedCreator) {
- queryParams.creator = trimmedCreator;
- }
- if (trimmedStatus) {
- queryParams.status = trimmedStatus;
- }
-
- const queryString = Object.keys(queryParams)
- .map(key => `${key}=${encodeURIComponent(queryParams[key])}`)
- .join('&');
- const url = `${getApiUrl('/api/knowledgeBase/list')}?${queryString}`;
-
- // 获取租户ID
- const tenantId = getTenantId();
- const headers = {};
- if (tenantId) {
- headers['X-Tenant-Id'] = tenantId;
- }
-
- const res = await uni.request({
- url,
- method: 'POST',
- header: headers,
- timeout: 10000
- });
-
- if (res.statusCode === 200 && res.data && res.data.success) {
- const records = Array.isArray(res.data.data) ? res.data.data : [];
- // 第一页或强制刷新时重置列表,否则追加
- if (this.practicePage.current === 1 || force) {
- this.practiceList = records;
- } else {
- this.practiceList = this.practiceList.concat(records);
- }
- this.practiceTotal = Number(res.data.total) || 0;
- } else {
- this.practiceList = [];
- this.practiceTotal = 0;
- uni.showToast({
- title: res.data?.message || '获取陪练列表失败',
- icon: 'none'
- });
- }
- } catch (error) {
- console.error('获取陪练列表失败:', error);
- uni.showToast({
- title: '获取陪练列表失败,请稍后重试',
- icon: 'none'
- });
- } finally {
- this.practiceLoading = false;
- }
- },
- onPracticeActionBtnClick(item) {
- // 如果已经选中当前项,则关闭菜单
- if (this.selectedPracticeItem && this.selectedPracticeItem.id === item.id && this.showPracticeActionMenu) {
- this.closePracticeActionMenu();
- return;
- }
-
- // 显示菜单
- this.selectedPracticeItem = item;
- this.showPracticeActionMenu = true;
- },
- closePracticeActionMenu() {
- this.showPracticeActionMenu = false;
- this.selectedPracticeItem = null;
- },
- handleStartPractice(item) {
- this.closePracticeActionMenu();
-
- // 获取当前登录用户信息
- let participantName = '';
- let participantPhone = '';
- try {
- const loginResponse = uni.getStorageSync('backend-login-response') || {};
- const phone = loginResponse.phone || '';
- const userName = loginResponse.userName || '';
-
- // 参与人电话默认为当前登录人的电话
- participantPhone = phone;
-
- // 参与人姓名默认为当前登录人的登录手机号或者登录账号(优先手机号)
- participantName = phone || userName;
- } catch (e) {
- console.error('获取登录用户信息失败:', e);
- }
-
- // 填充陪练表单
- this.practiceTrainingForm = {
- scenarioId: item.id || '',
- title: item.title || '',
- scenario: item.content || item.detail || '',
- participantName: participantName,
- participantPhone: participantPhone
- };
- this.showPracticeTrainingPopup = true;
- },
- closePracticeTrainingPopup() {
- this.showPracticeTrainingPopup = false;
- this.practiceTrainingForm = {
- scenarioId: '',
- title: '',
- scenario: '',
- participantName: '',
- participantPhone: ''
- };
- },
- async submitPracticeTraining() {
- // 表单验证
- if (!this.practiceTrainingForm.title || !this.practiceTrainingForm.title.trim()) {
- uni.showToast({
- title: "请输入陪练标题",
- icon: "none"
- });
- return;
- }
- if (!this.practiceTrainingForm.participantName || !this.practiceTrainingForm.participantName.trim()) {
- uni.showToast({
- title: "请输入参与人姓名",
- icon: "none"
- });
- return;
- }
- if (!this.practiceTrainingForm.participantPhone || !this.practiceTrainingForm.participantPhone.trim()) {
- uni.showToast({
- title: "请输入参与人电话",
- icon: "none"
- });
- return;
- }
-
- try {
- uni.showLoading({
- title: "创建中..."
- });
-
- // 获取租户ID
- const tenantId = getTenantId();
-
- const payload = {
- scenarioId: this.practiceTrainingForm.scenarioId || '',
- title: this.practiceTrainingForm.title?.trim() || '',
- scenario: this.practiceTrainingForm.scenario?.trim() || '',
- participantName: this.practiceTrainingForm.participantName.trim(),
- participantPhone: this.practiceTrainingForm.participantPhone.trim()
- };
-
- // 添加租户ID到payload
- if (tenantId) {
- payload.tenantId = tenantId;
- }
-
- const headers = {
- "Content-Type": "application/json"
- };
-
- // 添加租户ID到header
- if (tenantId) {
- headers['X-Tenant-Id'] = tenantId;
- }
-
- const res = await uni.request({
- url: getApiUrl('/api/trainingMain/add'),
- method: 'POST',
- data: payload,
- header: headers,
- timeout: 15000
- });
-
- uni.hideLoading();
-
- if (res.statusCode === 200 && res.data && (res.data.success || res.data.code === 200)) {
- uni.showToast({
- title: res.data?.message || "创建成功",
- icon: "success"
- });
- // 关闭弹出框
- this.closePracticeTrainingPopup();
- // 跳转到陪练页面并刷新列表
+ handleRefreshTrainingList() {
+ // 处理刷新陪练列表的事件
+ // 切换到陪练tab(如果不在的话)
this.switchTab('training');
- this.trainingPage.current = 1;
- this.fetchTrainingList({ force: true });
- } else {
- uni.showToast({
- title: res.data?.message || "创建失败",
- icon: "none"
- });
- }
- } catch (error) {
- uni.hideLoading();
- console.error("创建陪练失败:", error);
- uni.showToast({
- title: error?.message || "创建失败,请重试",
- icon: "none"
- });
- }
- },
- handleEditPractice(item) {
- this.closePracticeActionMenu();
- // 填充编辑表单
- this.editPracticeForm = {
- id: item.id,
- title: item.title || '',
- category: item.category || '',
- industry: item.industry || '',
- content: item.content || '',
- remark: item.remark || ''
- };
- this.showEditPracticePopup = true;
- },
- closeEditPracticePopup() {
- this.showEditPracticePopup = false;
- this.editPracticeForm = {
- id: '',
- title: '',
- category: '',
- industry: '',
- content: '',
- remark: ''
- };
- },
- async submitEditPractice() {
- // 表单验证
- if (!this.editPracticeForm.title || !this.editPracticeForm.title.trim()) {
- uni.showToast({
- title: "请输入知识标题",
- icon: "none"
- });
- return;
- }
-
- try {
- uni.showLoading({
- title: "保存中..."
- });
-
- // 获取租户ID
- const tenantId = getTenantId();
- const headers = {
- "Content-Type": "application/json"
- };
- if (tenantId) {
- headers['X-Tenant-Id'] = tenantId;
- // 同时在数据中也添加租户ID(如果后端需要)
- if (!this.editPracticeForm.tenantId) {
- this.editPracticeForm.tenantId = tenantId;
- }
- }
-
- const res = await uni.request({
- url: getApiUrl('/api/knowledgeBase/update'),
- method: 'PUT',
- data: this.editPracticeForm,
- header: headers,
- timeout: 15000
- });
-
- uni.hideLoading();
-
- if (res.statusCode === 200 && res.data && (res.data.success || res.data.code === 200)) {
- uni.showToast({
- title: res.data?.message || "保存成功",
- icon: "success"
- });
- // 关闭弹出框并刷新列表
- this.closeEditPracticePopup();
- this.practicePage.current = 1;
- this.fetchPracticeList({ force: true });
- } else {
- uni.showToast({
- title: res.data?.message || "保存失败",
- icon: "none"
- });
- }
- } catch (error) {
- uni.hideLoading();
- console.error("保存陪练失败:", error);
- uni.showToast({
- title: error?.message || "保存失败,请重试",
- icon: "none"
- });
- }
- },
- handleDeletePractice(item) {
- this.closePracticeActionMenu();
- uni.showModal({
- title: '提示',
- content: '确认删除该陪练吗?',
- success: async (res) => {
- if (res.confirm) {
- try {
- uni.showLoading({
- title: "删除中..."
- });
-
- // 获取租户ID
- const tenantId = getTenantId();
- const headers = {};
- if (tenantId) {
- headers['X-Tenant-Id'] = tenantId;
- }
-
- const deleteRes = await uni.request({
- url: getApiUrl(`/api/knowledgeBase/delete/${item.id}`),
- method: 'DELETE',
- header: headers,
- timeout: 15000
- });
-
- uni.hideLoading();
-
- if (deleteRes.statusCode === 200 && deleteRes.data && (deleteRes.data.success || deleteRes.data.code === 200)) {
- uni.showToast({
- title: deleteRes.data?.message || "删除成功",
- icon: "success"
- });
- // 刷新列表
- this.practicePage.current = 1;
- this.fetchPracticeList({ force: true });
- } else {
- uni.showToast({
- title: deleteRes.data?.message || "删除失败",
- icon: "none"
- });
- }
- } catch (error) {
- uni.hideLoading();
- console.error("删除陪练失败:", error);
- uni.showToast({
- title: error?.message || "删除失败,请重试",
- icon: "none"
- });
- }
- }
- }
- });
- },
- // 添加陪练相关方法
- showAddPractice() {
- this.showPracticePopup = true;
- this.practiceForm = {
- title: '',
- category: 'AI陪练虚拟人', // 固定值,不可修改
- industry: '汽车销售', // 默认值
- content: '',
- remark: ''
- };
- },
- closePracticePopup() {
- this.showPracticePopup = false;
- },
- choosePracticeFile() {
- // 限制只能上传一个文件
- // #ifdef H5
- // H5平台使用chooseFile
- uni.chooseFile({
- count: 1,
- success: (res) => {
- const tempFiles = res.tempFiles || [];
- if (tempFiles.length > 0) {
- const file = tempFiles[0];
- // 替换文件,而不是添加
- this.practiceForm.file = {
- name: file.name || '文件',
- path: file.path || file.url,
- size: file.size
- };
- }
- },
- fail: (err) => {
- console.error('选择文件失败:', err);
- uni.showToast({
- title: '选择文件失败',
- icon: 'none'
- });
- }
- });
- // #endif
- // #ifndef H5
- // 非H5平台使用chooseImage(可以选择图片文件)
- uni.chooseImage({
- count: 1,
- success: (res) => {
- const tempFiles = res.tempFiles || [];
- if (tempFiles.length > 0) {
- const file = tempFiles[0];
- // 替换文件,而不是添加
- this.practiceForm.file = {
- name: file.name || '图片',
- path: file.path,
- size: file.size
- };
- }
- },
- fail: (err) => {
- console.error('选择文件失败:', err);
- uni.showToast({
- title: '选择文件失败',
- icon: 'none'
- });
- }
- });
- // #endif
- },
- removePracticeFile() {
- // 清空文件
- this.practiceForm.file = null;
- },
- async submitPractice() {
- // 表单验证
- if (!this.practiceForm.title || !this.practiceForm.title.trim()) {
- uni.showToast({
- title: "请输入知识标题",
- icon: "none"
- });
- return;
- }
-
- try {
- uni.showLoading({
- title: "提交中..."
- });
-
- // 获取租户ID
- const tenantId = getTenantId();
-
- const payload = {
- title: this.practiceForm.title.trim(),
- category: this.practiceForm.category?.trim() || '',
- industry: this.practiceForm.industry?.trim() || '',
- content: this.practiceForm.content?.trim() || '',
- remark: this.practiceForm.remark?.trim() || ''
- };
-
- // 添加租户ID到payload
- if (tenantId) {
- payload.tenantId = tenantId;
- }
-
- const headers = {
- "Content-Type": "application/json"
- };
-
- // 添加租户ID到header
- if (tenantId) {
- headers['X-Tenant-Id'] = tenantId;
- }
-
- const res = await uni.request({
- url: getApiUrl('/api/knowledgeBase/add'),
- method: 'POST',
- data: payload,
- header: headers,
- timeout: 15000
- });
-
- uni.hideLoading();
-
- if (res.statusCode === 200 && res.data && (res.data.success || res.data.code === 200)) {
- uni.showToast({
- title: res.data?.message || "提交成功",
- icon: "success"
- });
- // 关闭弹出框并刷新列表
- this.closePracticePopup();
- this.practicePage.current = 1;
- this.fetchPracticeList({ force: true });
- } else {
- uni.showToast({
- title: res.data?.message || "提交失败",
- icon: "none"
- });
- }
- } catch (error) {
- uni.hideLoading();
- console.error("提交陪练失败:", error);
- uni.showToast({
- title: error?.message || "提交失败,请重试",
- icon: "none"
- });
- }
- },
- // 陪练列表相关方法
- onTrainingSearch() {
- if (this.activeTab !== 'training') {
- this.activeTab = 'training';
- }
- this.trainingPage.current = 1;
- this.fetchTrainingList({ force: true });
- },
- onTrainingRefresh() {
- this.trainingPage.current = 1;
- this.fetchTrainingList({ force: true });
- },
- onTrainingReachBottom() {
- // 已在加载中或全部加载完成则不再触发
- if (this.trainingLoading) return;
- if (this.trainingList.length >= this.trainingTotal) return;
- this.trainingPage.current += 1;
- this.fetchTrainingList();
- },
- async fetchTrainingList({ force = false } = {}) {
- if (this.trainingLoading && !force) {
- return;
- }
- this.trainingLoading = true;
- try {
- // 构建查询参数
- const queryParams = {
- current: this.trainingPage.current,
- size: this.trainingPage.size
- };
-
- const trimmedTitle = this.trainingQuery?.title?.trim();
- const trimmedParticipantName = this.trainingQuery?.participantName?.trim();
- const trimmedParticipantPhone = this.trainingQuery?.participantPhone?.trim();
-
- if (trimmedTitle) {
- queryParams.title = trimmedTitle;
- }
- if (trimmedParticipantName) {
- queryParams.participantName = trimmedParticipantName;
- }
- if (trimmedParticipantPhone) {
- queryParams.participantPhone = trimmedParticipantPhone;
- }
-
- // 将参数转换为 URL 查询字符串
- const queryString = Object.keys(queryParams)
- .map(key => `${key}=${encodeURIComponent(queryParams[key])}`)
- .join('&');
- const url = `${getApiUrl('/api/trainingMain/list')}?${queryString}`;
-
- // 获取租户ID
- const tenantId = getTenantId();
- const headers = {};
- if (tenantId) {
- headers['X-Tenant-Id'] = tenantId;
- // 同时添加到查询参数中
- queryParams.tenantId = tenantId;
- }
-
- // 重新构建查询字符串(包含tenantId)
- const finalQueryString = Object.keys(queryParams)
- .map(key => `${key}=${encodeURIComponent(queryParams[key])}`)
- .join('&');
- const finalUrl = `${getApiUrl('/api/trainingMain/list')}?${finalQueryString}`;
-
- const res = await uni.request({
- url: finalUrl,
- method: 'POST',
- header: headers,
- timeout: 10000
- });
-
- if (res.statusCode === 200 && res.data && res.data.success) {
- const records = Array.isArray(res.data.data) ? res.data.data : [];
- // 第一页或强制刷新时重置列表,否则追加
- if (this.trainingPage.current === 1 || force) {
- this.trainingList = records;
- } else {
- this.trainingList = this.trainingList.concat(records);
- }
- this.trainingTotal = Number(res.data.total) || 0;
- } else {
- this.trainingList = [];
- this.trainingTotal = 0;
- uni.showToast({
- title: res.data?.message || '获取陪练列表失败',
- icon: 'none'
- });
- }
- } catch (error) {
- console.error('获取陪练列表失败:', error);
- uni.showToast({
- title: '获取陪练列表失败,请稍后重试',
- icon: 'none'
- });
- } finally {
- this.trainingLoading = false;
- }
- },
- // 陪练操作菜单相关方法
- onTrainingActionBtnClick(item) {
- // 如果已经选中当前项,则关闭菜单
- if (this.selectedTrainingItem && this.selectedTrainingItem.id === item.id && this.showTrainingActionMenu) {
- this.closeTrainingActionMenu();
- return;
- }
-
- // 显示菜单
- this.selectedTrainingItem = item;
- this.showTrainingActionMenu = true;
- },
- closeTrainingActionMenu() {
- this.showTrainingActionMenu = false;
- this.selectedTrainingItem = null;
- },
- async startTraining(item) {
- this.closeTrainingActionMenu();
- // 打开详情列表弹窗
- this.currentTrainingParentId = item.id || '';
- this.trainingItemList = [];
- this.showTrainingItemListPopup = true;
- // 加载详情列表(调用listAll接口)
- await this.fetchTrainingItemListAll(item.id || '');
- },
- closeTrainingItemListPopup() {
- this.showTrainingItemListPopup = false;
- this.currentTrainingParentId = '';
- this.trainingItemPage.current = 1;
- this.trainingItemList = [];
- },
- onTrainingItemListReachBottom() {
- // 已在加载中或全部加载完成则不再触发
- if (this.trainingItemLoading) return;
- if (this.trainingItemList.length >= this.trainingItemTotal) return;
- this.trainingItemPage.current += 1;
- this.fetchTrainingItemList();
- },
- async fetchTrainingItemListAll(parentId) {
- if (!parentId) {
- uni.showToast({
- title: '缺少父ID参数',
- icon: 'none'
- });
- return;
- }
-
- this.trainingItemLoading = true;
- try {
- // 获取租户ID
- const tenantId = getTenantId();
-
- // 构建查询参数
- const queryParams = {
- parentId: parentId
- };
-
- if (tenantId) {
- queryParams.tenantId = tenantId;
- }
-
- // 将参数转换为 URL 查询字符串
- const queryString = Object.keys(queryParams)
- .filter(key => queryParams[key] !== null && queryParams[key] !== undefined && queryParams[key] !== '')
- .map(key => `${encodeURIComponent(key)}=${encodeURIComponent(queryParams[key])}`)
- .join('&');
- const url = `${getApiUrl('/api/trainingItem/listAll')}?${queryString}`;
-
- // 构建请求头
- const headers = {
- "Content-Type": "application/json"
- };
- if (tenantId) {
- headers['X-Tenant-Id'] = tenantId;
- }
-
- const res = await uni.request({
- url: url,
- method: 'POST',
- header: headers,
- timeout: 30000
- });
-
- if (res.statusCode === 200 && res.data && res.data.success) {
- const records = Array.isArray(res.data.data) ? res.data.data : [];
- this.trainingItemList = records;
- this.trainingItemTotal = Number(res.data.count) || records.length;
- } else {
- this.trainingItemList = [];
- this.trainingItemTotal = 0;
- uni.showToast({
- title: res.data?.message || '获取陪练详情列表失败',
- icon: 'none'
- });
- }
- } catch (error) {
- console.error('获取陪练详情列表失败:', error);
- uni.showToast({
- title: '获取陪练详情列表失败,请稍后重试',
- icon: 'none'
- });
- } finally {
- this.trainingItemLoading = false;
- }
- },
- async fetchTrainingItemList({ force = false } = {}) {
- if (this.trainingItemLoading && !force) {
- return;
- }
- if (!this.currentTrainingParentId) {
- return;
- }
- this.trainingItemLoading = true;
- try {
- // 构建查询参数
- const queryParams = {
- current: this.trainingItemPage.current,
- size: this.trainingItemPage.size,
- parentId: this.currentTrainingParentId
- };
-
- // 获取租户ID
- const tenantId = getTenantId();
- if (tenantId) {
- queryParams.tenantId = tenantId;
- }
-
- // 将参数转换为 URL 查询字符串
- const queryString = Object.keys(queryParams)
- .filter(key => queryParams[key] !== null && queryParams[key] !== undefined && queryParams[key] !== '')
- .map(key => `${encodeURIComponent(key)}=${encodeURIComponent(queryParams[key])}`)
- .join('&');
- const url = `${getApiUrl('/api/trainingItem/list')}?${queryString}`;
-
- // 构建请求头
- const headers = {};
- if (tenantId) {
- headers['X-Tenant-Id'] = tenantId;
- }
-
- const res = await uni.request({
- url: url,
- method: 'GET',
- header: headers,
- timeout: 30000
- });
-
- if (res.statusCode === 200 && res.data && res.data.success) {
- const records = Array.isArray(res.data.data) ? res.data.data : [];
- // 第一页或强制刷新时重置列表,否则追加
- if (this.trainingItemPage.current === 1 || force) {
- this.trainingItemList = records;
- } else {
- this.trainingItemList = this.trainingItemList.concat(records);
- }
- this.trainingItemTotal = Number(res.data.total) || 0;
- } else {
- this.trainingItemList = [];
- this.trainingItemTotal = 0;
- uni.showToast({
- title: res.data?.message || '获取陪练详情列表失败',
- icon: 'none'
- });
- }
- } catch (error) {
- console.error('获取陪练详情列表失败:', error);
- uni.showToast({
- title: '获取陪练详情列表失败,请稍后重试',
- icon: 'none'
- });
- } finally {
- this.trainingItemLoading = false;
- }
}
}
}
@@ -2303,34 +182,6 @@
border-radius: 2rpx;
}
- /* 内容区域 - 使用绝对定位,从tab页底部开始,到底部导航栏结束 */
- .tab-content {
- position: absolute;
- top: 160rpx; /* 导航栏(88rpx) + tab页(72rpx) = 160rpx */
- left: 0;
- right: 0;
- bottom: 96rpx; /* 底部导航栏高度 */
- background-color: #F5F5F5;
- padding: 24rpx 16rpx 0 16rpx; /* 顶部24rpx间距,底部0 */
- box-sizing: border-box;
- overflow-y: auto;
- }
-
- /* 素材内容区域和陪练内容区域使用相同定位 */
- .material-content,
- .practice-content,
- .training-content {
- position: absolute;
- top: 160rpx; /* 导航栏(88rpx) + tab页(72rpx) = 160rpx */
- left: 0;
- right: 0;
- bottom: 96rpx; /* 底部导航栏高度 */
- background-color: #F5F5F5;
- padding: 24rpx 16rpx 0 16rpx; /* 顶部24rpx间距(与列表项间距一致),底部0 */
- box-sizing: border-box;
- overflow-y: auto;
- }
-
.champion-card {
width: 100%;
box-sizing: border-box;
@@ -2356,704 +207,4 @@
font-size: 28rpx;
color: #999;
}
-
-
- .service-status-toolbar {
- display: flex;
- flex-wrap: nowrap;
- align-items: center;
- gap: 8rpx; /* 增加间距,避免元素被挤压 */
- padding: 12rpx 8rpx; /* 增加内边距,给搜索框更多空间 */
- margin-bottom: 24rpx; /* 与列表项间距保持一致(24rpx) */
- background-color: #F8F8FA;
- border-radius: 8rpx;
- border: 1px solid #EFEFF2;
- overflow-x: auto;
- min-height: 64rpx; /* 设置最小高度,确保搜索区域不被挤压 */
- box-sizing: border-box;
- }
-
- .toolbar-total {
- font-size: 24rpx;
- color: #666;
- white-space: nowrap;
- flex-shrink: 0;
- margin-right: 8rpx; /* 增加右边距,与搜索框保持距离 */
- line-height: 1.2;
- padding: 0 4rpx; /* 增加左右内边距 */
- }
-
- .toolbar-input {
- flex: 1;
- min-width: 120rpx; /* 增加最小宽度,避免被挤压变形 */
- max-width: 200rpx; /* 设置最大宽度,保持合理比例 */
- height: 56rpx; /* 稍微增加高度,提升可用性 */
- line-height: 56rpx;
- background-color: #F5F6FA;
- border-radius: 8rpx;
- padding: 0 12rpx; /* 增加左右内边距 */
- font-size: 24rpx;
- border: 1px solid transparent;
- box-sizing: border-box;
- flex-shrink: 1; /* 允许适当收缩,但保持最小宽度 */
- }
-
- .toolbar-actions {
- display: flex;
- align-items: center;
- margin-left: auto;
- flex-shrink: 0;
- gap: 8rpx; /* 增加按钮之间的间距 */
- }
-
- .toolbar-btn {
- padding: 0 12rpx; /* 增加左右内边距 */
- height: 56rpx; /* 与输入框高度保持一致 */
- min-width: 56rpx;
- color: #2A68FF;
- display: flex;
- align-items: center;
- justify-content: center;
- gap: 4rpx; /* 增加图标和文字之间的间距 */
- font-size: 24rpx;
- font-weight: 400;
- line-height: 1;
- box-sizing: border-box;
- }
-
- .toolbar-btn text {
- color: #2A68FF;
- }
-
- .service-card {
- width: 100%;
- box-sizing: border-box;
- background-color: #FFFFFF;
- border-radius: 16rpx;
- padding: 32rpx;
- margin-bottom: 24rpx;
- box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
- overflow: visible;
- }
-
- .material-card-item,
- .training-card-item {
- padding-left: 32rpx;
- padding-right: 32rpx;
- padding-top: 32rpx;
- padding-bottom: 32rpx;
- }
-
- .card-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 20rpx;
- width: 100%;
- box-sizing: border-box;
- padding: 0;
- margin: 0;
- position: relative;
- }
-
- .card-menu-trigger {
- width: 60rpx;
- height: 60rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- cursor: pointer;
- flex-shrink: 0;
- margin-left: auto;
- margin-right: 0;
- margin-top: 0;
- margin-bottom: 0;
- flex-grow: 0;
- position: relative;
- padding: 0;
- }
-
- .card-menu-trigger:active {
- opacity: 0.7;
- }
-
- .context-menu {
- position: fixed;
- background-color: #FFFFFF;
- border-radius: 8rpx;
- box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.15);
- z-index: 1001;
- min-width: 160rpx;
- padding: 8rpx 0;
- max-width: 200rpx;
- }
-
- /* 陪练操作菜单样式 */
- .practice-card-item {
- position: relative;
- }
-
- .practice-action-menu {
- position: absolute;
- top: 60rpx;
- right: 32rpx;
- width: 160rpx;
- background-color: #FFFFFF;
- border-radius: 12rpx;
- box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.15);
- z-index: 100;
- overflow: hidden;
- margin-right: 0;
- }
-
- .practice-action-menu-item {
- padding: 24rpx 32rpx;
- font-size: 28rpx;
- color: #333;
- text-align: center;
- background-color: #FFFFFF;
- }
-
- .practice-action-menu-item:active {
- background-color: #F5F5F5;
- }
-
- .practice-action-menu-item--danger {
- color: #FF5722;
- }
-
- .practice-action-menu-divider {
- height: 1rpx;
- background-color: #E0E0E0;
- margin: 0 16rpx;
- }
-
- .practice-action-menu-mask {
- position: fixed;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- background-color: transparent;
- z-index: 99;
- }
-
- .context-menu-item {
- padding: 24rpx 32rpx;
- font-size: 28rpx;
- color: #333;
- text-align: left;
- }
-
- .context-menu-item:active {
- background-color: #f5f5f5;
- }
-
- .context-menu-item--danger {
- color: #FF3B30;
- }
-
- .context-menu-mask {
- position: fixed;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- z-index: 1000;
- background-color: transparent;
- }
-
- .staff-info {
- display: flex;
- align-items: center;
- flex: 1;
- min-width: 0;
- margin: 0;
- padding: 0;
- }
-
- .staff-avatar {
- width: 64rpx;
- height: 64rpx;
- background-color: #2196F3;
- border-radius: 50%;
- display: flex;
- align-items: center;
- justify-content: center;
- margin-right: 16rpx;
- margin-left: 0;
- margin-top: 0;
- margin-bottom: 0;
- flex-shrink: 0;
- }
-
- .avatar-text {
- font-size: 32rpx;
- color: #FFFFFF;
- font-weight: 500;
- }
-
- .staff-name {
- font-size: 32rpx;
- font-weight: 500;
- color: #333;
- }
-
- .customer-tags {
- display: flex;
- flex-wrap: wrap;
- margin-bottom: 20rpx;
- gap: 12rpx;
- box-sizing: border-box;
- margin-left: 0;
- margin-right: 0;
- padding: 0;
- width: 100%;
- max-width: 100%;
- }
-
- .customer-info {
- margin-bottom: 16rpx;
- display: flex;
- flex-direction: column;
- gap: 8rpx;
- box-sizing: border-box;
- margin-left: 0;
- margin-right: 0;
- padding: 0;
- width: 100%;
- max-width: 100%;
- }
-
- .customer-name {
- font-size: 28rpx;
- color: #555;
- }
-
- .tag-item {
- padding: 8rpx 16rpx;
- border-radius: 8rpx;
- box-sizing: border-box;
- word-wrap: break-word;
- word-break: break-all;
- display: inline-block;
- max-width: 100%;
- }
-
- .tag-blue {
- background-color: #E3F2FD;
- }
-
- .tag-blue text {
- font-size: 24rpx;
- color: #1976D2;
- }
-
- .tag-orange {
- background-color: #FFF3E0;
- }
-
- .tag-orange text {
- font-size: 24rpx;
- color: #F57C00;
- }
-
- .service-duration {
- padding-top: 16rpx;
- border-top: 1px solid #F0F0F0;
- }
-
- .service-duration text {
- font-size: 26rpx;
- color: #999;
- }
-
- .service-status-empty {
- padding: 48rpx 0;
- text-align: center;
- color: #999;
- font-size: 28rpx;
- }
-
- .service-status-loading-more {
- padding: 24rpx 0;
- text-align: center;
- color: #999;
- font-size: 26rpx;
- }
-
- /* 添加素材弹出框样式 */
- .material-popup-mask {
- position: fixed;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- background-color: rgba(0, 0, 0, 0.5);
- z-index: 999;
- }
-
- .material-popup {
- position: fixed;
- left: 50%;
- top: 50%;
- transform: translate(-50%, -50%);
- width: calc(100vw - 80rpx);
- max-width: 90%;
- box-sizing: border-box;
- height: 80vh;
- max-height: 80vh;
- background-color: #FFFFFF;
- border-radius: 16rpx;
- z-index: 1000;
- display: flex;
- flex-direction: column;
- box-shadow: 0 8rpx 32rpx rgba(0, 0, 0, 0.2);
- overflow: hidden;
- }
-
- .popup-header {
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 32rpx;
- border-bottom: 1px solid #E0E0E0;
- flex-shrink: 0;
- }
-
- .popup-title {
- font-size: 36rpx;
- font-weight: 500;
- color: #333;
- }
-
- .popup-close {
- width: 48rpx;
- height: 48rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- }
-
- .popup-content {
- flex: 1;
- min-height: 0;
- padding: 20rpx 20rpx 28rpx;
- box-sizing: border-box;
- overflow-y: auto;
- }
-
- .form-card {
- width: 100%;
- box-sizing: border-box;
- }
-
- .form-item {
- display: flex;
- align-items: center;
- margin-bottom: 20rpx;
- gap: 16rpx;
- }
-
- .form-item__label {
- font-size: 32rpx;
- color: #333;
- font-weight: 500;
- width: 160rpx;
- flex-shrink: 0;
- text-align: left;
- }
-
- .form-item__input {
- flex: 1;
- min-width: 0;
- height: 88rpx;
- background-color: #f9fafb;
- border-radius: 12rpx;
- padding: 0 24rpx;
- font-size: 32rpx;
- color: #333;
- box-sizing: border-box;
- }
-
- /* 只读输入框样式 */
- .form-item__input[disabled],
- .form-item__input[readonly] {
- background-color: #f3f4f6;
- color: #6b7280;
- cursor: not-allowed;
- }
-
- .form-item__textarea {
- flex: 1;
- min-width: 0;
- min-height: 200rpx;
- background-color: #f9fafb;
- border-radius: 12rpx;
- padding: 24rpx;
- font-size: 32rpx;
- color: #333;
- box-sizing: border-box;
- }
-
- .file-upload-area {
- width: 100%;
- display: flex;
- flex-direction: column;
- gap: 12rpx;
- }
-
- .file-item {
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 16rpx 24rpx;
- background-color: #f9fafb;
- border-radius: 12rpx;
- margin-bottom: 12rpx;
- }
-
- .file-upload-btn {
- width: 100%;
- height: 88rpx;
- border: 1px dashed #d1d5db;
- border-radius: 12rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- gap: 0;
- box-sizing: border-box;
- }
-
- .file-name {
- font-size: 28rpx;
- color: #333;
- flex: 1;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
-
- .file-delete {
- width: 40rpx;
- height: 40rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- margin-left: 16rpx;
- }
-
- .file-upload-btn {
- display: flex;
- flex-direction: row;
- align-items: center;
- justify-content: center;
- height: 88rpx;
- padding: 0;
- background-color: #f9fafb;
- border: 2rpx dashed #d1d5db;
- border-radius: 12rpx;
- }
-
- .file-upload-text {
- display: none;
- }
-
- .popup-actions {
- display: flex;
- gap: 24rpx;
- padding: 24rpx;
- border-top: 1px solid #E0E0E0;
- flex-shrink: 0;
- }
-
- .popup-btn {
- flex: 1;
- height: 88rpx;
- border-radius: 12rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- }
-
- .popup-btn--cancel {
- background-color: #f3f4f6;
- }
-
- .popup-btn--submit {
- /* 对齐取消按钮的风格:浅色背景与边框 */
- background-color: #f3f4f6;
- border: 1px solid #d1d5db;
- }
-
- .popup-btn__text {
- font-size: 32rpx;
- font-weight: 500;
- }
-
- .popup-btn__icon {
- margin-right: 8rpx;
- }
-
- .popup-btn--cancel .popup-btn__text {
- color: #2A68FF;
- }
-
- .popup-btn--submit .popup-btn__text {
- color: #2A68FF;
- }
-
- /* 内容详情弹出框样式 */
- .content-popup-mask {
- position: fixed;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- background-color: rgba(0, 0, 0, 0.5);
- z-index: 999;
- }
-
- .content-popup {
- position: fixed;
- left: 10%;
- right: 10%;
- top: 50%;
- transform: translateY(-50%);
- box-sizing: border-box;
- max-height: calc(100vh - 320rpx);
- height: auto;
- background-color: #FFFFFF;
- border-radius: 16rpx;
- z-index: 1000;
- display: flex;
- flex-direction: column;
- box-shadow: 0 8rpx 32rpx rgba(0, 0, 0, 0.2);
- overflow: hidden;
- }
-
- .content-popup-header {
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 32rpx;
- border-bottom: 1px solid #E0E0E0;
- flex-shrink: 0;
- }
-
- .content-popup-title {
- font-size: 36rpx;
- font-weight: 500;
- color: #333;
- }
-
- .content-popup-close {
- width: 48rpx;
- height: 48rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- }
-
- .content-popup-body {
- flex: 1;
- min-height: 0;
- padding: 32rpx;
- box-sizing: border-box;
- overflow-y: auto;
- }
-
- .content-popup-text {
- font-size: 32rpx;
- color: #333;
- line-height: 1.8;
- white-space: pre-wrap;
- word-wrap: break-word;
- }
-
- /* 陪练操作菜单样式 */
- .training-card-item {
- position: relative;
- }
-
- .training-card-action-btn {
- width: 60rpx;
- height: 60rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- cursor: pointer;
- margin-left: auto;
- margin-right: 0;
- margin-top: 0;
- margin-bottom: 0;
- flex-shrink: 0;
- flex-grow: 0;
- position: relative;
- padding: 0;
- }
-
- .training-card-action-btn uni-icons {
- display: block;
- margin: 0;
- padding: 0;
- line-height: 1;
- }
-
- .training-card-action-btn:active {
- opacity: 0.7;
- }
-
- .training-action-menu {
- position: absolute;
- top: 60rpx;
- right: 32rpx;
- width: 160rpx;
- background-color: #FFFFFF;
- border-radius: 12rpx;
- box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.15);
- z-index: 100;
- overflow: hidden;
- margin-right: 0;
- }
-
- .training-action-menu-item {
- padding: 24rpx 32rpx;
- font-size: 28rpx;
- color: #333;
- text-align: center;
- background-color: #FFFFFF;
- }
-
- .training-action-menu-item:active {
- background-color: #F5F5F5;
- }
-
- .training-action-menu-mask {
- position: fixed;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- background-color: transparent;
- z-index: 99;
- }
-
- /* 陪练详情列表弹窗样式 */
- .training-item-list-popup {
- max-height: 80vh;
- }
-
- .training-item-list-popup .popup-content {
- padding: 24rpx;
- }
-
- .training-item-card {
- margin-bottom: 24rpx;
- }
-
- .training-item-card:last-child {
- margin-bottom: 0;
- }
-
-
+
\ No newline at end of file
diff --git a/pages/champion/components/material-tab.vue b/pages/champion/components/material-tab.vue
new file mode 100644
index 0000000..c5966a0
--- /dev/null
+++ b/pages/champion/components/material-tab.vue
@@ -0,0 +1,1394 @@
+
+
+
+
+ 共{{ materialTotal }}条
+
+
+
+
+
+ 刷新
+
+
+
+
+
+
+
+
+
+
+ 所属行业: {{ item.industry }}
+
+
+
+
+ 详情: {{ getContentPreview(item.content || item.detail, 30) }}
+
+
+ 提示词: {{ getContentPreview(item.remark, 30) }}
+
+
+
+
+
+
+
+ 暂无素材
+
+
+ 正在加载更多...
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/champion/components/practice-tab.vue b/pages/champion/components/practice-tab.vue
new file mode 100644
index 0000000..12b0cfa
--- /dev/null
+++ b/pages/champion/components/practice-tab.vue
@@ -0,0 +1,1427 @@
+
+
+
+
+ 共{{ practiceTotal }}条
+
+
+
+
+
+ 刷新
+
+
+
+
+
+
+
+
+
+
+ 所属行业: {{ item.industry }}
+
+
+
+
+ 详情: {{ getContentPreview(item.content || item.detail, 30) }}
+
+
+ 提示词: {{ getContentPreview(item.remark, 30) }}
+
+
+
+
+
+
+
+ 暂无陪练
+
+
+ 正在加载更多...
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/champion/components/training-tab.vue b/pages/champion/components/training-tab.vue
new file mode 100644
index 0000000..a97a1c1
--- /dev/null
+++ b/pages/champion/components/training-tab.vue
@@ -0,0 +1,1242 @@
+
+
+
+
+ 共{{ trainingTotal }}条
+
+
+
+ {{ finishStatusIndex === -1 ? '状态' : finishStatusOptions[finishStatusIndex].label }}
+
+
+
+
+
+
+
+
+
+ 刷新
+
+
+
+
+
+
+
+
+
+
+ 陪练场景: {{ item.scenario }}
+
+
+
+
+ 参与人: {{ item.participantName }}
+
+
+ 电话: {{ item.participantPhone }}
+
+
+ 状态: {{ getFinishStatusLabel(item.finishStatus) }}
+
+
+
+
+ 结束时间: {{ formatDateTime(item.endTime) }}
+
+
+
+ 暂无陪练记录
+
+
+ 正在加载更多...
+
+
+
+
+
+
+
+
+
+
+
+
+
+