产品化: 统一title
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
<uni-nav-bar
|
||||
:fixed="true"
|
||||
:statusBar="true"
|
||||
title="销冠"
|
||||
title="AI销管系统"
|
||||
leftIcon="left"
|
||||
@clickLeft="goBack"
|
||||
color="#333"
|
||||
@@ -16,11 +16,6 @@
|
||||
</uni-nav-bar>
|
||||
|
||||
<view class="content">
|
||||
<!-- AI功能横幅 -->
|
||||
<view class="ai-banner">
|
||||
<text class="banner-text">AI让销售过程和团队管理更透明</text>
|
||||
</view>
|
||||
|
||||
<!-- 标签页 -->
|
||||
<scroll-view class="tabs-scroll" scroll-x="true" show-scrollbar="false">
|
||||
<view class="tabs">
|
||||
@@ -123,11 +118,11 @@
|
||||
</view>
|
||||
|
||||
<view class="customer-tags">
|
||||
<view class="tag-item tag-blue" v-if="item.content">
|
||||
<text>详情: {{ getContentPreview(item.content) }}</text>
|
||||
<view class="tag-item tag-blue" v-if="item.content || item.detail">
|
||||
<text @tap.stop="showFullText('详情', item.content || item.detail)">详情: {{ getContentPreview(item.content || item.detail, 30) }}</text>
|
||||
</view>
|
||||
<view class="tag-item tag-orange" v-if="item.remark">
|
||||
<text>备注: {{ item.remark }}</text>
|
||||
<text @tap.stop="showFullText('提示词', item.remark)">提示词: {{ getContentPreview(item.remark, 30) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -198,18 +193,24 @@
|
||||
/>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<text class="form-item__label">文件上传</text>
|
||||
<view class="file-upload-area">
|
||||
<view class="file-item" v-if="practiceForm.file">
|
||||
<text class="file-name">{{ practiceForm.file.name || '文件' }}</text>
|
||||
<view class="file-delete" @click="removePracticeFile">
|
||||
<uni-icons type="close" size="16" color="#999"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
<view class="file-upload-btn" v-if="!practiceForm.file" @click="choosePracticeFile">
|
||||
<uni-icons type="plus" size="24" color="#2A68FF"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
<text class="form-item__label">详情</text>
|
||||
<textarea
|
||||
class="form-item__textarea"
|
||||
v-model="practiceForm.content"
|
||||
placeholder="请输入详情内容"
|
||||
placeholder-style="color: #9ca3af"
|
||||
maxlength="2000"
|
||||
/>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<text class="form-item__label">提示词</text>
|
||||
<textarea
|
||||
class="form-item__textarea"
|
||||
v-model="practiceForm.remark"
|
||||
placeholder="请输入提示词"
|
||||
placeholder-style="color: #9ca3af"
|
||||
maxlength="500"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
@@ -255,6 +256,8 @@
|
||||
placeholder="请输入知识分类"
|
||||
placeholder-style="color: #9ca3af"
|
||||
maxlength="100"
|
||||
:disabled="true"
|
||||
readonly
|
||||
/>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
@@ -278,11 +281,11 @@
|
||||
/>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<text class="form-item__label">备注</text>
|
||||
<input
|
||||
class="form-item__input"
|
||||
<text class="form-item__label">提示词</text>
|
||||
<textarea
|
||||
class="form-item__textarea"
|
||||
v-model="editPracticeForm.remark"
|
||||
placeholder="请输入备注"
|
||||
placeholder="请输入提示词"
|
||||
placeholder-style="color: #9ca3af"
|
||||
maxlength="500"
|
||||
/>
|
||||
@@ -378,11 +381,11 @@
|
||||
</view>
|
||||
|
||||
<view class="customer-tags">
|
||||
<view class="tag-item tag-blue" v-if="item.content">
|
||||
<text>详情: {{ getContentPreview(item.content) }}</text>
|
||||
<view class="tag-item tag-blue" v-if="item.content || item.detail">
|
||||
<text @tap.stop="showFullText('详情', item.content || item.detail)">详情: {{ getContentPreview(item.content || item.detail, 30) }}</text>
|
||||
</view>
|
||||
<view class="tag-item tag-orange" v-if="item.remark">
|
||||
<text>备注: {{ item.remark }}</text>
|
||||
<text @tap.stop="showFullText('提示词', item.remark)">提示词: {{ getContentPreview(item.remark, 30) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -558,6 +561,21 @@
|
||||
|
||||
<!-- 上下文菜单遮罩层 -->
|
||||
<view class="context-menu-mask" v-if="contextMenuVisible" @tap="closeContextMenu"></view>
|
||||
|
||||
<!-- 内容详情弹出框 -->
|
||||
<view class="content-popup-mask" v-if="showContentPopup" @click="closeContentPopup">
|
||||
</view>
|
||||
<view class="content-popup" v-if="showContentPopup" @click.stop>
|
||||
<view class="content-popup-header">
|
||||
<text class="content-popup-title">{{ contentPopupTitle }}</text>
|
||||
<view class="content-popup-close" @click="closeContentPopup">
|
||||
<uni-icons type="close" size="20" color="#999"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
<scroll-view class="content-popup-body" scroll-y>
|
||||
<text class="content-popup-text">{{ contentPopupText }}</text>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -645,7 +663,8 @@
|
||||
title: '',
|
||||
category: '',
|
||||
industry: '',
|
||||
files: []
|
||||
content: '',
|
||||
remark: ''
|
||||
},
|
||||
// 编辑陪练弹出框
|
||||
showEditPracticePopup: false,
|
||||
@@ -661,7 +680,11 @@
|
||||
practiceContextMenuVisible: false,
|
||||
practiceContextMenuIndex: -1,
|
||||
practiceContextMenuTop: 0,
|
||||
practiceContextMenuLeft: 0
|
||||
practiceContextMenuLeft: 0,
|
||||
// 内容详情弹出框
|
||||
showContentPopup: false,
|
||||
contentPopupTitle: '',
|
||||
contentPopupText: ''
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
@@ -794,9 +817,22 @@
|
||||
// 查看素材详情
|
||||
console.log('查看素材详情', item);
|
||||
},
|
||||
getContentPreview(content) {
|
||||
getContentPreview(content, limit = 30) {
|
||||
if (!content) return '';
|
||||
return content.length > 10 ? content.substring(0, 10) : content;
|
||||
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) {
|
||||
// 阻止事件冒泡
|
||||
@@ -1457,7 +1493,8 @@
|
||||
title: '',
|
||||
category: 'AI陪练虚拟人', // 固定值,不可修改
|
||||
industry: '汽车销售', // 默认值
|
||||
file: null
|
||||
content: '',
|
||||
remark: ''
|
||||
};
|
||||
},
|
||||
closePracticePopup() {
|
||||
@@ -1538,85 +1575,41 @@
|
||||
// 获取租户ID
|
||||
const tenantId = getTenantId();
|
||||
|
||||
let res;
|
||||
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() || ''
|
||||
};
|
||||
|
||||
// 如果有文件,使用 uni.uploadFile 同时上传文件和其他表单数据
|
||||
if (this.practiceForm.file) {
|
||||
// 使用 uni.uploadFile 将文件和其他字段一起提交
|
||||
const formData = {
|
||||
// 其他表单字段
|
||||
'title': this.practiceForm.title.trim(),
|
||||
'category': this.practiceForm.category?.trim() || '',
|
||||
'industry': this.practiceForm.industry?.trim() || '',
|
||||
'content': '-',
|
||||
'fileName': this.practiceForm.file.name || 'file' // 文件名
|
||||
};
|
||||
|
||||
// 添加租户ID到formData
|
||||
if (tenantId) {
|
||||
formData['tenantId'] = tenantId;
|
||||
}
|
||||
|
||||
res = await uni.uploadFile({
|
||||
url: getApiUrl('/api/knowledgeBase/add'),
|
||||
filePath: this.practiceForm.file.path,
|
||||
name: 'file', // 文件字段名
|
||||
formData: formData,
|
||||
header: tenantId ? {
|
||||
'X-Tenant-Id': tenantId
|
||||
} : {},
|
||||
timeout: 15000
|
||||
});
|
||||
} else {
|
||||
// 如果没有文件,使用 uni.request 提交表单数据
|
||||
const payload = {
|
||||
title: this.practiceForm.title.trim(),
|
||||
category: this.practiceForm.category?.trim() || '',
|
||||
industry: this.practiceForm.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
|
||||
});
|
||||
// 添加租户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();
|
||||
|
||||
// 处理响应(uni.uploadFile 返回的 data 可能是字符串,需要解析)
|
||||
let result;
|
||||
if (this.practiceForm.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)) {
|
||||
if (res.statusCode === 200 && res.data && (res.data.success || res.data.code === 200)) {
|
||||
uni.showToast({
|
||||
title: result?.message || "提交成功",
|
||||
title: res.data?.message || "提交成功",
|
||||
icon: "success"
|
||||
});
|
||||
// 关闭弹出框并刷新列表
|
||||
@@ -1625,7 +1618,7 @@
|
||||
this.fetchPracticeList({ force: true });
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: result?.message || "提交失败",
|
||||
title: res.data?.message || "提交失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
@@ -1653,35 +1646,38 @@
|
||||
}
|
||||
|
||||
.content {
|
||||
padding-top: 88rpx;
|
||||
padding-top: 0; /* 移除padding-top,因为tab页和内容区域都使用绝对定位 */
|
||||
margin-top: 0;
|
||||
position: relative;
|
||||
min-height: 100vh; /* 确保content有足够高度 */
|
||||
}
|
||||
|
||||
/* AI功能横幅 */
|
||||
.ai-banner {
|
||||
background-color: #E3F2FD;
|
||||
padding: 24rpx 16rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.banner-text {
|
||||
font-size: 28rpx;
|
||||
color: #1976D2;
|
||||
flex: 1;
|
||||
/* 隐藏导航栏占位区域,避免产生空白 */
|
||||
::v-deep .uni-navbar__placeholder {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
/* 标签页 */
|
||||
.tabs-scroll {
|
||||
position: fixed;
|
||||
top: 88rpx; /* 导航栏高度 */
|
||||
left: 0;
|
||||
right: 0;
|
||||
width: 100%;
|
||||
background-color: #FFFFFF;
|
||||
border-bottom: 1px solid #E0E0E0;
|
||||
white-space: nowrap;
|
||||
margin-top: 0;
|
||||
z-index: 999;
|
||||
height: 72rpx; /* 设置固定高度,确保tabs可见 */
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.tabs {
|
||||
display: inline-flex;
|
||||
padding: 0 16rpx;
|
||||
height: 100%; /* 确保tabs占满scroll-view的高度 */
|
||||
align-items: center; /* 垂直居中 */
|
||||
}
|
||||
|
||||
.tab-item {
|
||||
@@ -1711,12 +1707,27 @@
|
||||
border-radius: 2rpx;
|
||||
}
|
||||
|
||||
/* 内容区域 */
|
||||
/* 内容区域 - 使用绝对定位,从tab页底部开始,到底部导航栏结束 */
|
||||
.tab-content {
|
||||
height: calc(100vh - 300rpx);
|
||||
position: absolute;
|
||||
top: 160rpx; /* 导航栏(88rpx) + tab页(72rpx) = 160rpx */
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 96rpx; /* 底部导航栏高度 */
|
||||
background-color: #F5F5F5;
|
||||
padding: 24rpx 16rpx;
|
||||
padding: 24rpx 16rpx 0 16rpx; /* 顶部24rpx间距,底部0 */
|
||||
box-sizing: border-box;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
/* 素材内容区域和陪练内容区域使用相同定位 */
|
||||
.material-content,
|
||||
.practice-content {
|
||||
position: absolute;
|
||||
top: 160rpx; /* 导航栏(88rpx) + tab页(72rpx) = 160rpx */
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 96rpx; /* 底部导航栏高度 */
|
||||
}
|
||||
|
||||
.champion-card {
|
||||
@@ -1745,59 +1756,62 @@
|
||||
color: #999;
|
||||
}
|
||||
|
||||
/* 素材内容样式 - 参考标签管理 */
|
||||
.material-content {
|
||||
height: calc(100vh - 300rpx);
|
||||
background-color: #F5F5F5;
|
||||
padding: 24rpx 16rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.service-status-toolbar {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
flex-wrap: nowrap;
|
||||
align-items: center;
|
||||
gap: 16rpx;
|
||||
padding: 16rpx 24rpx;
|
||||
margin-bottom: 24rpx;
|
||||
gap: 2rpx;
|
||||
padding: 4rpx 4rpx;
|
||||
margin-bottom: 4rpx;
|
||||
background-color: #F8F8FA;
|
||||
border-radius: 16rpx;
|
||||
border-radius: 8rpx;
|
||||
border: 1px solid #EFEFF2;
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.toolbar-total {
|
||||
font-size: 26rpx;
|
||||
font-size: 24rpx;
|
||||
color: #666;
|
||||
margin-right: 16rpx;
|
||||
white-space: nowrap;
|
||||
flex-shrink: 0;
|
||||
margin-right: 2rpx;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.toolbar-input {
|
||||
flex: 1;
|
||||
min-width: 150rpx;
|
||||
min-width: 100rpx;
|
||||
height: 48rpx;
|
||||
line-height: 48rpx;
|
||||
background-color: #F5F6FA;
|
||||
border-radius: 12rpx;
|
||||
padding: 16rpx 24rpx;
|
||||
font-size: 28rpx;
|
||||
border-radius: 8rpx;
|
||||
padding: 0 8rpx;
|
||||
font-size: 24rpx;
|
||||
border: 1px solid transparent;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.toolbar-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-left: auto;
|
||||
flex-shrink: 0;
|
||||
gap: 2rpx;
|
||||
}
|
||||
|
||||
.toolbar-btn {
|
||||
padding: 0 16rpx;
|
||||
height: 72rpx;
|
||||
padding: 0 6rpx;
|
||||
height: 48rpx;
|
||||
min-width: 48rpx;
|
||||
color: #2A68FF;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 8rpx;
|
||||
font-size: 28rpx;
|
||||
gap: 2rpx;
|
||||
font-size: 24rpx;
|
||||
font-weight: 400;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.service-card {
|
||||
@@ -2011,9 +2025,10 @@
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
width: 90vw;
|
||||
max-width: 620rpx;
|
||||
width: calc(100vw - 80rpx);
|
||||
max-width: 90%;
|
||||
box-sizing: border-box;
|
||||
height: 80vh;
|
||||
max-height: 80vh;
|
||||
background-color: #FFFFFF;
|
||||
border-radius: 16rpx;
|
||||
@@ -2021,6 +2036,7 @@
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
box-shadow: 0 8rpx 32rpx rgba(0, 0, 0, 0.2);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.popup-header {
|
||||
@@ -2029,6 +2045,7 @@
|
||||
justify-content: space-between;
|
||||
padding: 32rpx;
|
||||
border-bottom: 1px solid #E0E0E0;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.popup-title {
|
||||
@@ -2047,9 +2064,10 @@
|
||||
|
||||
.popup-content {
|
||||
flex: 1;
|
||||
max-height: calc(80vh - 200rpx);
|
||||
min-height: 0;
|
||||
padding: 20rpx 20rpx 28rpx;
|
||||
box-sizing: border-box;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.form-card {
|
||||
@@ -2173,6 +2191,7 @@
|
||||
gap: 24rpx;
|
||||
padding: 24rpx;
|
||||
border-top: 1px solid #E0E0E0;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.popup-btn {
|
||||
@@ -2210,5 +2229,73 @@
|
||||
.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;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user