diff --git a/common/env.js b/common/env.js
index 1a46984..9066d70 100644
--- a/common/env.js
+++ b/common/env.js
@@ -3,6 +3,6 @@
* apiEnv 可选:'local' | 'prod'
*/
export default {
- apiEnv: 'local'
+ apiEnv: 'prod'
}
diff --git a/pages.json b/pages.json
index 18be5be..df82fe6 100644
--- a/pages.json
+++ b/pages.json
@@ -18,7 +18,7 @@
}
},
{
- "path": "pages/insight/insight",
+ "path": "pages/champion/champion",
"style": {
"navigationStyle": "custom"
}
@@ -286,11 +286,11 @@
"iconPath": "static/tabbar/team.png",
"selectedIconPath": "static/tabbar/team_active.png",
"text": "团队"
- }, {
- "pagePath": "pages/insight/insight",
+ }, {
+ "pagePath": "pages/champion/champion",
"iconPath": "static/tabbar/insight.png",
"selectedIconPath": "static/tabbar/insight_active.png",
- "text": "洞察"
+ "text": "销冠"
}, {
"pagePath": "pages/ucenter/ucenter",
"iconPath": "static/tabbar/me.png",
diff --git a/pages/champion/champion.vue b/pages/champion/champion.vue
new file mode 100644
index 0000000..a7847c1
--- /dev/null
+++ b/pages/champion/champion.vue
@@ -0,0 +1,221 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ AI让销售过程和团队管理更透明
+
+
+
+
+
+ 摸底
+
+
+ 陪练
+
+
+ 实战
+
+
+ 质检
+
+
+
+
+
+
+ 摸底
+ 这里是摸底相关的内容展示区域
+
+
+
+
+
+
+ 陪练
+ 这里是陪练相关的内容展示区域
+
+
+
+
+
+
+ 实战
+ 这里是实战相关的内容展示区域
+
+
+
+
+
+
+ 质检
+ 这里是质检相关的内容展示区域
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/reception/reception.vue b/pages/reception/reception.vue
index bf43474..880d291 100644
--- a/pages/reception/reception.vue
+++ b/pages/reception/reception.vue
@@ -254,49 +254,108 @@
-
-
-
+
+
+ scroll-y>
-
+
所属行业
-
+
标签分类
详情
+
+ 是否启用
+
+
取消
- 保存
+ {{ tagViewMode === 'edit' ? '更新' : '保存' }}
@@ -432,17 +499,32 @@ import { getApiUrl } from "@/common/config.js";
},
serviceStatusList: [],
// 标签管理
- tagViewMode: 'list', // 'list' 或 'add'
+ tagViewMode: 'list', // 'list' 或 'add' 或 'edit'
tagList: [],
+ tagLoading: false,
+ tagTotal: 0,
+ tagPage: {
+ current: 1,
+ size: 10
+ },
+ tagQuery: {
+ industry: '',
+ tagType: '',
+ tagName: ''
+ },
tagForm: {
+ id: '',
industry: '家居行业',
tagType: '',
name: '',
detail: '',
- remark: ''
+ remark: '',
+ enabled: true
},
tagTypeOptions: ["接待客户", "质检SOP", "客户画像"],
- showTagTypeDropdown: false
+ showTagTypeDropdown: false,
+ selectedTagItem: null,
+ showTagActionMenu: false
}
},
onLoad() {
@@ -458,6 +540,7 @@ import { getApiUrl } from "@/common/config.js";
this.fetchServiceStatusList();
} else if (tab === 'tag') {
this.tagViewMode = 'list';
+ // 当进入标签管理页面时,请求接口填充数据
this.fetchTagList();
}
},
@@ -774,31 +857,190 @@ import { getApiUrl } from "@/common/config.js";
}
},
// 标签管理相关方法
- fetchTagList() {
- // TODO: 从API获取标签列表
- // 目前使用模拟数据
+ onTagListSearch() {
+ if (this.activeTab !== 'tag') {
+ this.activeTab = 'tag';
+ }
+ this.tagPage.current = 1;
+ this.fetchTagList({ force: true });
+ },
+ onTagListRefresh() {
+ this.tagPage.current = 1;
+ this.fetchTagList({ force: true });
+ },
+ onTagListReachBottom() {
+ // 已在加载中或全部加载完成则不再触发
+ if (this.tagLoading) return;
+ if (this.tagList.length >= this.tagTotal) return;
+ this.tagPage.current += 1;
+ this.fetchTagList();
+ },
+ async fetchTagList({ force = false } = {}) {
+ if (this.tagLoading && !force) {
+ return;
+ }
+ this.tagLoading = true;
+ try {
+ const queryParams = {
+ current: this.tagPage.current,
+ size: this.tagPage.size
+ };
+ const trimmedTagType = this.tagQuery?.tagType?.trim();
+ const trimmedTagName = this.tagQuery?.tagName?.trim();
+ if (trimmedTagType) {
+ queryParams.tagType = trimmedTagType;
+ }
+ if (trimmedTagName) {
+ queryParams.tagName = trimmedTagName;
+ }
+ const queryString = Object.keys(queryParams)
+ .map(key => `${key}=${encodeURIComponent(queryParams[key])}`)
+ .join('&');
+ const url = `${getApiUrl('/api/industryTags/list')}?${queryString}`;
+ const res = await uni.request({
+ url,
+ method: 'GET',
+ timeout: 10000
+ });
+ if (res.statusCode === 200 && res.data && res.data.success) {
+ const records = Array.isArray(res.data.data) ? res.data.data : [];
+ // 第一页或强制刷新时重置列表,否则追加
+ if (this.tagPage.current === 1 || force) {
+ this.tagList = records;
+ } else {
+ this.tagList = this.tagList.concat(records);
+ }
+ this.tagTotal = Number(res.data.total) || 0;
+ } else {
this.tagList = [];
+ this.tagTotal = 0;
+ uni.showToast({
+ title: res.data?.message || '获取标签列表失败',
+ icon: 'none'
+ });
+ }
+ } catch (error) {
+ console.error('获取标签列表失败:', error);
+ uni.showToast({
+ title: '获取标签列表失败,请稍后重试',
+ icon: 'none'
+ });
+ } finally {
+ this.tagLoading = false;
+ }
},
showAddTag() {
this.tagViewMode = 'add';
this.showTagTypeDropdown = false;
this.tagForm = {
+ id: '',
industry: '家居行业',
tagType: '',
name: '',
detail: '',
- remark: ''
+ remark: '',
+ enabled: true
};
},
+ onTagItemClick(item) {
+ // 点击卡片内容区域,不做任何操作(保留用于其他可能的交互)
+ },
+ onTagActionBtnClick(item) {
+ // 如果已经选中当前项,则关闭菜单
+ if (this.selectedTagItem && this.selectedTagItem.id === item.id && this.showTagActionMenu) {
+ this.closeTagActionMenu();
+ return;
+ }
+
+ // 显示菜单
+ this.selectedTagItem = item;
+ this.showTagActionMenu = true;
+ },
+ closeTagActionMenu() {
+ this.showTagActionMenu = false;
+ this.selectedTagItem = null;
+ },
+ editTag(item) {
+ this.closeTagActionMenu();
+ this.tagViewMode = 'edit';
+ this.showTagTypeDropdown = false;
+ this.tagForm = {
+ id: item.id || '',
+ industry: item.industry || '家居行业',
+ tagType: item.tagType || '',
+ name: item.tagName || item.name || '',
+ detail: item.tagDetail || item.detail || '',
+ remark: item.remark || '',
+ enabled: item.enabled !== undefined ? item.enabled : (item.isEnabled !== undefined ? item.isEnabled : true)
+ };
+ },
+ async deleteTag(item) {
+ this.closeTagActionMenu();
+ const tagId = item.id;
+ if (!tagId) {
+ uni.showToast({
+ title: '无法获取标签ID',
+ icon: 'none'
+ });
+ return;
+ }
+
+ uni.showModal({
+ title: '确认删除',
+ content: `确定要删除标签"${item.tagName || item.name || '未命名标签'}"吗?`,
+ success: async (res) => {
+ if (res.confirm) {
+ try {
+ uni.showLoading({
+ title: '删除中...'
+ });
+
+ const deleteUrl = getApiUrl(`/api/industryTags/delete/${tagId}`);
+ const deleteRes = await uni.request({
+ url: deleteUrl,
+ method: 'DELETE',
+ timeout: 10000
+ });
+
+ uni.hideLoading();
+
+ if (deleteRes.statusCode === 200 && deleteRes.data && deleteRes.data.success) {
+ uni.showToast({
+ title: deleteRes.data?.message || '删除成功',
+ icon: 'success'
+ });
+ // 删除成功后刷新列表
+ this.tagPage.current = 1;
+ this.fetchTagList({ force: true });
+ } else {
+ uni.showToast({
+ title: deleteRes.data?.message || '删除失败',
+ icon: 'none'
+ });
+ }
+ } catch (error) {
+ uni.hideLoading();
+ console.error('删除标签失败:', error);
+ uni.showToast({
+ title: '删除失败,请重试',
+ icon: 'none'
+ });
+ }
+ }
+ }
+ });
+ },
cancelAddTag() {
this.tagViewMode = 'list';
this.showTagTypeDropdown = false;
this.tagForm = {
+ id: '',
industry: '家居行业',
tagType: '',
name: '',
detail: '',
- remark: ''
+ remark: '',
+ enabled: true
};
},
toggleTagTypeDropdown() {
@@ -811,6 +1053,9 @@ import { getApiUrl } from "@/common/config.js";
closeTagTypeDropdown() {
this.showTagTypeDropdown = false;
},
+ onEnabledChange(e) {
+ this.tagForm.enabled = e.detail.value;
+ },
async saveTag() {
// 表单验证
if (!this.tagForm.name || !this.tagForm.name.trim()) {
@@ -823,7 +1068,7 @@ import { getApiUrl } from "@/common/config.js";
try {
uni.showLoading({
- title: "保存中..."
+ title: this.tagViewMode === 'edit' ? "更新中..." : "保存中..."
});
const payload = {
@@ -831,12 +1076,25 @@ import { getApiUrl } from "@/common/config.js";
tagType: this.tagForm.tagType?.trim() || '',
tagName: this.tagForm.name.trim(),
tagDetail: this.tagForm.detail?.trim() || '',
- remark: this.tagForm.remark?.trim() || ''
+ remark: this.tagForm.remark?.trim() || '',
+ enabled: this.tagForm.enabled !== undefined ? this.tagForm.enabled : true
};
+ // 如果是编辑模式,添加id
+ if (this.tagViewMode === 'edit' && this.tagForm.id) {
+ payload.id = this.tagForm.id;
+ }
+
+ // 根据模式选择不同的接口
+ const url = this.tagViewMode === 'edit'
+ ? getApiUrl('/api/industryTags/update')
+ : getApiUrl('/api/industryTags/add');
+
+ const method = this.tagViewMode === 'edit' ? 'PUT' : 'POST';
+
const res = await uni.request({
- url: getApiUrl('/api/industryTags/add'),
- method: "POST",
+ url: url,
+ method: method,
data: payload,
header: {
"Content-Type": "application/json"
@@ -847,19 +1105,20 @@ import { getApiUrl } from "@/common/config.js";
const { statusCode, data } = res;
if (statusCode === 200 && data && (data.success || data.code === 200)) {
uni.showToast({
- title: data?.message || "保存成功",
+ title: data?.message || (this.tagViewMode === 'edit' ? "更新成功" : "保存成功"),
icon: "success"
});
// 保存成功后返回列表并刷新
this.tagViewMode = 'list';
- this.fetchTagList();
+ this.tagPage.current = 1;
+ this.fetchTagList({ force: true });
} else {
- throw new Error(data?.message || "保存失败");
+ throw new Error(data?.message || (this.tagViewMode === 'edit' ? "更新失败" : "保存失败"));
}
} catch (error) {
console.error("保存标签失败:", error);
uni.showToast({
- title: error?.message || "保存失败,请重试",
+ title: error?.message || (this.tagViewMode === 'edit' ? "更新失败,请重试" : "保存失败,请重试"),
icon: "none"
});
} finally {
@@ -999,6 +1258,18 @@ import { getApiUrl } from "@/common/config.js";
padding: 32rpx;
margin-bottom: 24rpx;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
+ box-sizing: border-box;
+ width: 100%;
+ overflow: visible;
+ /* 确保左右padding完全对称,所有内容都在padding范围内 */
+ }
+
+ /* 标签卡片特殊处理 */
+ .service-card.tag-card-item {
+ padding-left: 32rpx;
+ padding-right: 32rpx;
+ padding-top: 32rpx;
+ padding-bottom: 32rpx;
}
.card-header {
@@ -1006,11 +1277,20 @@ import { getApiUrl } from "@/common/config.js";
justify-content: space-between;
align-items: center;
margin-bottom: 20rpx;
+ width: 100%;
+ box-sizing: border-box;
+ padding: 0;
+ margin: 0;
+ /* 确保头部内容在卡片padding范围内 */
}
.staff-info {
display: flex;
align-items: center;
+ flex: 1;
+ min-width: 0;
+ margin: 0;
+ padding: 0;
}
.staff-avatar {
@@ -1022,6 +1302,10 @@ import { getApiUrl } from "@/common/config.js";
align-items: center;
justify-content: center;
margin-right: 16rpx;
+ margin-left: 0;
+ margin-top: 0;
+ margin-bottom: 0;
+ flex-shrink: 0;
}
.avatar-text {
@@ -1052,6 +1336,13 @@ import { getApiUrl } from "@/common/config.js";
flex-wrap: wrap;
margin-bottom: 20rpx;
gap: 12rpx;
+ box-sizing: border-box;
+ margin-left: 0;
+ margin-right: 0;
+ padding: 0;
+ /* 确保标签容器不会超出卡片padding范围 */
+ width: 100%;
+ max-width: 100%;
}
.customer-info {
@@ -1059,6 +1350,13 @@ import { getApiUrl } from "@/common/config.js";
display: flex;
flex-direction: column;
gap: 8rpx;
+ box-sizing: border-box;
+ margin-left: 0;
+ margin-right: 0;
+ padding: 0;
+ /* 确保信息容器不会超出卡片padding范围 */
+ width: 100%;
+ max-width: 100%;
}
.customer-name,
@@ -1070,6 +1368,12 @@ import { getApiUrl } from "@/common/config.js";
.tag-item {
padding: 8rpx 16rpx;
border-radius: 8rpx;
+ box-sizing: border-box;
+ word-wrap: break-word;
+ word-break: break-all;
+ /* 确保标签项不会超出卡片padding范围,允许换行 */
+ display: inline-block;
+ max-width: 100%;
}
.tag-blue {
@@ -1305,11 +1609,11 @@ import { getApiUrl } from "@/common/config.js";
.tag-select-wrapper {
position: relative;
- width: 50%;
+ width: 75%;
}
.tag-select {
- flex: 1;
+ width: 100%;
height: 88rpx;
background-color: #f9fafb;
border-radius: 12rpx;
@@ -1325,9 +1629,7 @@ import { getApiUrl } from "@/common/config.js";
position: absolute;
top: 100%;
left: 160rpx;
- width: calc(100% - 160rpx);
- min-width: 260rpx;
- max-width: none;
+ right: 0;
background-color: #fff;
border-radius: 16rpx;
box-shadow: 0 12rpx 30rpx rgba(15, 23, 42, 0.1);
@@ -1408,95 +1710,89 @@ import { getApiUrl } from "@/common/config.js";
color: #ffffff;
}
- /* 标签管理样式 */
+ /* 标签管理样式 - 添加表单 */
.tag-management {
height: calc(100vh - 300rpx);
background-color: #F5F5F5;
}
- .tag-list {
- height: 100%;
- padding: 24rpx 32rpx;
- box-sizing: border-box;
- }
-
- .tag-list-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 24rpx;
- padding: 0;
- }
-
- .tag-list-total {
- font-size: 26rpx;
- color: #666;
- }
-
- .tag-list-btn {
- display: flex;
- align-items: center;
- gap: 8rpx;
- padding: 12rpx 24rpx;
- background-color: #E3F2FD;
- border-radius: 12rpx;
- color: #2A68FF;
- font-size: 28rpx;
- }
-
- .tag-card {
- background-color: #FFFFFF;
- border-radius: 16rpx;
- padding: 32rpx;
- margin-bottom: 24rpx;
- margin-left: 0;
- margin-right: 0;
- box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
- box-sizing: border-box;
- }
-
- .tag-card-header {
- margin-bottom: 20rpx;
- }
-
- .tag-card-name {
- font-size: 32rpx;
- font-weight: 500;
- color: #333;
- }
-
- .tag-card-content {
- display: flex;
- flex-direction: column;
- gap: 12rpx;
- }
-
+ /* 标签卡片操作菜单 */
.tag-card-item {
+ position: relative;
+ }
+
+ .tag-card-action-btn {
+ width: 60rpx;
+ height: 60rpx;
display: flex;
- flex-direction: column;
- gap: 8rpx;
+ 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;
+ /* 确保按钮在卡片padding范围内,距离右边框32rpx */
}
- .tag-card-label {
- font-size: 26rpx;
- color: #666;
+ .tag-card-action-btn uni-icons {
+ display: block;
+ margin: 0;
+ padding: 0;
+ line-height: 1;
}
- .tag-card-value {
+ .tag-card-action-btn:active {
+ opacity: 0.7;
+ }
+
+ .tag-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;
+ }
+
+ .tag-action-menu-item {
+ padding: 24rpx 32rpx;
font-size: 28rpx;
color: #333;
- line-height: 1.6;
- width: 40%;
- max-width: 40%;
- word-wrap: break-word;
- word-break: break-all;
+ text-align: center;
+ background-color: #FFFFFF;
}
- .tag-list-empty {
- padding: 48rpx 0;
- text-align: center;
- color: #999;
- font-size: 28rpx;
+ .tag-action-menu-item:active {
+ background-color: #F5F5F5;
+ }
+
+ .tag-action-menu-item--danger {
+ color: #FF5722;
+ }
+
+ .tag-action-menu-divider {
+ height: 1rpx;
+ background-color: #E0E0E0;
+ margin: 0 16rpx;
+ }
+
+ .tag-action-menu-mask {
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background-color: transparent;
+ z-index: 99;
}
.tag-form {
@@ -1516,4 +1812,19 @@ import { getApiUrl } from "@/common/config.js";
box-sizing: border-box;
line-height: 1.6;
}
+
+ .form-item__textarea--detail {
+ min-height: 100rpx;
+ height: 100rpx;
+ }
+
+ .form-item__textarea--remark {
+ min-height: 88rpx;
+ height: 88rpx;
+ }
+
+ /* 开关样式 */
+ .form-item switch {
+ margin-left: auto;
+ }