diff --git a/components/ai-analysis-dashboard-body.vue b/components/ai-analysis-dashboard-body.vue new file mode 100644 index 0000000..a4f30f9 --- /dev/null +++ b/components/ai-analysis-dashboard-body.vue @@ -0,0 +1,389 @@ + + + + + diff --git a/custom-tab-bar/index.js b/custom-tab-bar/index.js index 93c5bd1..83029f4 100644 --- a/custom-tab-bar/index.js +++ b/custom-tab-bar/index.js @@ -54,13 +54,6 @@ Component({ iconPath: '/static/tabbar/customer.png', selectedIconPath: '/static/tabbar/customer_active.png', }, - { - key: 'ai_analysis', - text: 'AI分析', - pagePath: 'pages/ai_analysis/ai_analysis', - iconPath: '/static/tabbar/ai_analysis.png', - selectedIconPath: '/static/tabbar/ai_analysis_active.png', - }, { key: 'workbench', text: '工作台', @@ -283,7 +276,6 @@ Component({ 'common_begin_reception': 'pages/furniture_reception/common_begin_reception', 'workbench': 'pages/workbench/workbench', 'furniture_customer': 'pages-subpackage/furniture_customer/furniture_customer', - 'ai_analysis': 'pages/ai_analysis/ai_analysis', 'furniture_top_sales': 'pages/furniture_top_sales/furniture_top_sales' }; @@ -511,7 +503,7 @@ Component({ const hasFurnitureRole = roles.includes('furniture'); if (isAdminFurniture || hasFurnitureRole) { - const furnitureTabs = ['ai_analysis', 'workbench', 'ucenter']; + const furnitureTabs = ['workbench', 'ucenter']; console.log('[TabBar][allowed] furniture/admin_furniture role ->', furnitureTabs); return furnitureTabs; } diff --git a/custom-tab-bar/index.vue b/custom-tab-bar/index.vue index 20c4378..7e4713a 100644 --- a/custom-tab-bar/index.vue +++ b/custom-tab-bar/index.vue @@ -77,13 +77,6 @@ export default { iconPath: '/static/tabbar/team.png', selectedIconPath: '/static/tabbar/team_active.png', }, - { - key: 'ai_analysis', - text: 'AI分析', - pagePath: '/pages/ai_analysis/ai_analysis', - iconPath: '/static/tabbar/ai_analysis.png', - selectedIconPath: '/static/tabbar/ai_analysis_active.png', - }, { key: 'meeting_summary', text: '总结和统计', @@ -96,15 +89,8 @@ export default { }, computed: { furnitureTabs() { - // 与 pages.json 的 tabBar 一致:AI分析、工作台、我的 + // 与 pages.json 的 tabBar 一致:工作台、我的 return [ - { - key: 'ai_analysis', - text: 'AI分析', - pagePath: '/pages/ai_analysis/ai_analysis', - iconPath: '/static/tabbar/ai_analysis.png', - selectedIconPath: '/static/tabbar/ai_analysis_active.png', - }, { key: 'workbench', text: '工作台', @@ -127,7 +113,7 @@ export default { console.log('VISIBLE TABS CALC - THIS MUST SHOW IN H5'); // 简化逻辑:直接返回家具相关的tabs,跳过权限检查 - const furnitureKeys = ['ai_analysis', 'workbench', 'ucenter']; + const furnitureKeys = ['workbench', 'ucenter']; const result = furnitureKeys.map(key => { return this.allTabs.find(tab => tab.key === key); }).filter(Boolean); @@ -282,15 +268,15 @@ export default { console.log('GET ALLOWED KEYS - 简化版本,总是返回家具相关tabs'); // 简化逻辑:总是返回家具相关的tabs - const furnitureTabs = ['ai_analysis', 'workbench', 'ucenter']; + const furnitureTabs = ['workbench', 'ucenter']; console.log('[TabBar][allowed] 简化逻辑 ->', furnitureTabs); return furnitureTabs; }, // #ifdef H5 toggleNativeTabs() { // H5 平台自定义 tabbar 不生效,直接根据角色显隐原生 tabbar 项 - // 当前位置顺序(与 pages.json 的 tabBar.list 一致):AI分析、工作台、我的… - const ORDER = ['ai_analysis', 'workbench', 'ucenter', 'reception', 'customer', 'team', 'meeting_summary', 'common_begin_reception']; + // 当前位置顺序(与 pages.json 的 tabBar.list 一致):工作台、我的… + const ORDER = ['workbench', 'ucenter', 'reception', 'customer', 'team', 'meeting_summary', 'common_begin_reception']; const allowed = this.getAllowedKeys(); // 限制重试次数,防止渲染时机未就绪 this._h5TabRetries = (this._h5TabRetries || 0) + 1; @@ -319,7 +305,6 @@ export default { isInTabBar(pagePath) { // 检查页面路径是否在原生tabBar配置中 const tabBarList = [ - 'pages/ai_analysis/ai_analysis', 'pages/workbench/workbench', 'pages/ucenter/ucenter', ]; @@ -359,7 +344,6 @@ export default { const allElements = document.querySelectorAll('*'); const tabElements = Array.from(allElements).filter(el => el.textContent && ( - el.textContent.includes('AI分析') || el.textContent.includes('工作台') || el.textContent.includes('我的') ) @@ -397,9 +381,9 @@ export default { return; } - // 按文本内容排序:AI分析、工作台、我的 + // 按文本内容排序:工作台、我的 const sortedElements = tabElements.sort((a, b) => { - const order = ['AI分析', '工作台', '我的']; + const order = ['工作台', '我的']; const aIndex = order.findIndex(text => a.textContent.includes(text)); const bIndex = order.findIndex(text => b.textContent.includes(text)); return aIndex - bIndex; @@ -409,7 +393,7 @@ export default { // 处理每个元素 sortedElements.forEach((element, index) => { - const keyMap = ['ai_analysis', 'workbench', 'ucenter']; + const keyMap = ['workbench', 'ucenter']; const key = keyMap[index]; const shouldShow = allowed.includes(key); diff --git a/manifest.json b/manifest.json index 165d38b..6483681 100644 --- a/manifest.json +++ b/manifest.json @@ -79,7 +79,6 @@ }, "usingComponents" : true, "optimization" : { - "lazyCodeLoading" : "requiredComponents", "subPackages" : true } }, diff --git a/pages-subpackage/furniture_reception/furniture_reception-impl.vue b/pages-subpackage/furniture_reception/furniture_reception-impl.vue index a09bc87..679b489 100644 --- a/pages-subpackage/furniture_reception/furniture_reception-impl.vue +++ b/pages-subpackage/furniture_reception/furniture_reception-impl.vue @@ -477,8 +477,8 @@ import ServiceListFurniture from "./serviceListFurniture.vue"; */ refreshPageData() { this.$nextTick(() => { + const list = this.$refs.serviceListRef; if (this.activeTab === 'status') { - const list = this.$refs.serviceListRef; if (list && typeof list.onServiceStatusRefresh === 'function') { list.onServiceStatusRefresh(); } @@ -489,7 +489,9 @@ import ServiceListFurniture from "./serviceListFurniture.vue"; }, applyIncomingTab(tab) { const allowed = ['status', 'reception', 'tag']; - if (!allowed.includes(tab)) return; + if (!allowed.includes(tab)) { + return; + } // 切tab并执行必要初始化(开始接待需要重置表单) if (this.activeTab !== tab) { @@ -500,6 +502,11 @@ import ServiceListFurniture from "./serviceListFurniture.vue"; } else if (tab === 'tag') { this.tagViewMode = 'list'; this.fetchTagList({ force: true }); + } else if (tab === 'status') { + // 从工作台进入「服务中」时补拉列表(mounted 可能早于布局或与 refresh 竞态) + this.$nextTick(() => { + this.refreshPageData(); + }); } }, // 计算并更新导航栏和内容区域的位置 @@ -568,11 +575,11 @@ import ServiceListFurniture from "./serviceListFurniture.vue"; // 检查页面栈,如果当前是第一个页面,则不能返回 const pages = getCurrentPages(); if (pages.length <= 1) { - // 作为 tabBar 页从其他入口跳转进来时,兜底切回 AI 分析页 + // 作为 tabBar 页从其他入口跳转进来时,兜底切回工作台 uni.switchTab({ - url: '/pages/ai_analysis/ai_analysis', + url: '/pages/workbench/workbench', fail: (err) => { - console.error('[FurnitureReception][goBack] 切回AI分析页失败:', err); + console.error('[FurnitureReception][goBack] 切回工作台失败:', err); } }); return; @@ -1247,6 +1254,12 @@ import ServiceListFurniture from "./serviceListFurniture.vue"; /* top值通过内联样式动态设置 */ left: 0; right: 0; + /* #ifdef MP-WEIXIN */ + /* 子组件内 scroll-view 需明确高度链;flex 可避免 MP 下 height:100% 失效导致空白 */ + display: flex; + flex-direction: column; + min-height: 0; + /* #endif */ /* #ifndef MP-WEIXIN */ bottom: 96rpx; /* H5环境:底部导航栏高度 */ /* #endif */ diff --git a/pages-subpackage/furniture_reception/furniture_reception_entry.vue b/pages-subpackage/furniture_reception/furniture_reception_entry.vue new file mode 100644 index 0000000..1e3be1c --- /dev/null +++ b/pages-subpackage/furniture_reception/furniture_reception_entry.vue @@ -0,0 +1,24 @@ + + + diff --git a/pages-subpackage/furniture_reception/serviceListFurniture.vue b/pages-subpackage/furniture_reception/serviceListFurniture.vue index ae93480..b2f9de8 100644 --- a/pages-subpackage/furniture_reception/serviceListFurniture.vue +++ b/pages-subpackage/furniture_reception/serviceListFurniture.vue @@ -79,6 +79,10 @@ 服务中 + + + {{ item.title }} + 客户:{{ item.customerName || '未知客户' }} @@ -540,6 +544,11 @@ export default { if (record.projectName) { tags.push({ text: `项目:${record.projectName}`, color: 'blue' }); } + + const title = + firstNonEmptyString(record.recordingName) || + (firstNonEmptyString(record.customerName) ? `${String(record.customerName).trim()}的接待记录` : '') || + ''; return { id: record.id || '', @@ -549,6 +558,7 @@ export default { customerPhone: record.customerPhone || '', customerId: record.customerId || '', recordingName: record.recordingName || '', + title, remarks: record.remarks || '', tags, durationText: formattedCreateTime ? `开始时间:${formattedCreateTime}` : '暂无开始时间' @@ -1012,11 +1022,16 @@ export default { diff --git a/pages/furniture_reception/furniture_reception.vue b/pages/furniture_reception/furniture_reception.vue index fa05ea5..74053ec 100644 --- a/pages/furniture_reception/furniture_reception.vue +++ b/pages/furniture_reception/furniture_reception.vue @@ -13,16 +13,12 @@ diff --git a/pages/workbench/workbench.vue b/pages/workbench/workbench.vue index cc42450..e8190fa 100644 --- a/pages/workbench/workbench.vue +++ b/pages/workbench/workbench.vue @@ -19,7 +19,14 @@ :contentTop="contentTop" :contentBottom="contentBottom" /> - 正在跳转到 AI 分析... + + + 当前未配置为销售或轻销场景(backend-scenario 不是 sales / soft_sales),工作台入口已隐藏。 + @@ -29,6 +36,7 @@ import statusBar from '@/uni_modules/uni-nav-bar/components/uni-nav-bar/uni-status-bar'; // #endif import SalesScenarioNew from './components/sales_scenario_new.vue'; +import AiAnalysisDashboardBody from '@/components/ai-analysis-dashboard-body.vue'; function getSystemInfo() { try { @@ -49,6 +57,7 @@ export default { statusBar, // #endif SalesScenarioNew, + AiAnalysisDashboardBody, }, data() { const systemInfo = getSystemInfo(); @@ -57,6 +66,7 @@ export default { contentTop: totalNavbarHeight + 'rpx', contentBottom: '96rpx', isSalesScenario: false, + isSoftSalesScenario: false, }; }, onShow() { @@ -64,13 +74,9 @@ export default { }, methods: { refreshScenario() { - const scenario = (uni.getStorageSync('backend-scenario') || '').toString().toLowerCase(); + const scenario = (uni.getStorageSync('backend-scenario') || '').toString().trim().toLowerCase(); this.isSalesScenario = scenario === 'sales'; - if (!this.isSalesScenario) { - uni.switchTab({ - url: '/pages/ai_analysis/ai_analysis', - }); - } + this.isSoftSalesScenario = scenario === 'soft_sales'; }, }, }; @@ -86,9 +92,13 @@ page { background-color: #f5f5f5; } +/* 子组件(销售工作台 / AI 分析主体)使用 position:absolute + top/bottom,不占文档流; + 若此处无明确高度,父级会被压成 0,导致整块空白。 */ .content { position: relative; + width: 100%; min-height: 100vh; + box-sizing: border-box; } .redirecting-text { diff --git a/uni_modules/uni-id-pages/components/uni-id-pages-fab-login/uni-id-pages-fab-login.vue b/uni_modules/uni-id-pages/components/uni-id-pages-fab-login/uni-id-pages-fab-login.vue index e5bb02b..71c22ee 100644 --- a/uni_modules/uni-id-pages/components/uni-id-pages-fab-login/uni-id-pages-fab-login.vue +++ b/uni_modules/uni-id-pages/components/uni-id-pages-fab-login/uni-id-pages-fab-login.vue @@ -528,7 +528,7 @@ // 微信登录成功后跳转到首页 setTimeout(() => { uni.switchTab({ - url: '/pages/ai_analysis/ai_analysis' + url: '/pages/workbench/workbench' }) }, 500); }).catch(err => { @@ -542,7 +542,7 @@ // 即使获取用户信息失败,也要跳转 setTimeout(() => { uni.switchTab({ - url: '/pages/ai_analysis/ai_analysis' + url: '/pages/workbench/workbench' }) }, 500); }); diff --git a/uni_modules/uni-id-pages/pages/login/login-withpwd.vue b/uni_modules/uni-id-pages/pages/login/login-withpwd.vue index d5024f6..3def308 100644 --- a/uni_modules/uni-id-pages/pages/login/login-withpwd.vue +++ b/uni_modules/uni-id-pages/pages/login/login-withpwd.vue @@ -230,13 +230,13 @@ console.warn('[Login] Failed to update global role info:', e); } - // 登录成功后跳转到首页(tabBar 首页:AI分析) + // 登录成功后跳转到首页(tabBar 首页:工作台) // 在微信小程序中增加延迟,确保store更新完全后再跳转 // #ifdef MP-WEIXIN setTimeout(() => { console.log('[Login] Preparing to navigate after login, hasLogin:', store.hasLogin) uni.switchTab({ - url: '/pages/ai_analysis/ai_analysis', + url: '/pages/workbench/workbench', success: () => { console.log('[Login] Navigation successful, checking login status after navigation') // 延迟检查,确保页面跳转完成后再检查状态 @@ -253,7 +253,7 @@ // #ifndef MP-WEIXIN setTimeout(() => { uni.switchTab({ - url: '/pages/ai_analysis/ai_analysis' + url: '/pages/workbench/workbench' }) }, 300) // #endif diff --git a/unpackage/dist/build/mp-weixin/app.json b/unpackage/dist/build/mp-weixin/app.json index 2976506..9d4bf80 100644 --- a/unpackage/dist/build/mp-weixin/app.json +++ b/unpackage/dist/build/mp-weixin/app.json @@ -46,6 +46,7 @@ "workspace/workspace", "workspace/scene-detail", "furniture_customer/furniture_customer", + "furniture_reception/furniture_reception_entry", "bluetooth-recorder/bluetooth-recorder", "uni-agree/uni-agree", "ucenter/settings/settings", @@ -86,18 +87,6 @@ "borderStyle": "black", "backgroundColor": "#FFFFFF", "list": [ - { - "pagePath": "pages/furniture_reception/furniture_reception", - "iconPath": "static/tabbar/reception.png", - "selectedIconPath": "static/tabbar/reception_active.png", - "text": "接待" - }, - { - "pagePath": "pages/ai_analysis/ai_analysis", - "iconPath": "static/tabbar/ai_analysis.png", - "selectedIconPath": "static/tabbar/ai_analysis_active.png", - "text": "AI分析" - }, { "pagePath": "pages/workbench/workbench", "iconPath": "static/tabbar/team.png", diff --git a/unpackage/dist/build/mp-weixin/common/store.js b/unpackage/dist/build/mp-weixin/common/store.js index 39d919b..71128f7 100644 --- a/unpackage/dist/build/mp-weixin/common/store.js +++ b/unpackage/dist/build/mp-weixin/common/store.js @@ -1 +1 @@ -"use strict";const e=require("./vendor.js"),t=require("./config.js"),a={pages:[{path:"pages/workbench/workbench",style:{navigationStyle:"custom"}},{path:"pages/furniture_reception/furniture_reception",style:{navigationStyle:"custom"}},{path:"pages/ucenter/ucenter",style:{navigationStyle:"custom"}},{path:"pages/team/team",style:{navigationStyle:"custom"}},{path:"pages/furniture_reception/common_begin_reception",style:{navigationStyle:"custom"}},{path:"pages/ai_analysis/ai_analysis",style:{navigationStyle:"custom"},componentPlaceholder:{QualityCoveragePopup:"pages-subpackage/ai_features/quality_coverage/quality-coverage-popup"}},{path:"pages/ai_qa/ai_qa",style:{navigationStyle:"custom"}},{path:"pages/xixi/xixi",style:{navigationStyle:"custom"},componentPlaceholder:{XixiWhoAmI:"pages-subpackage/xixi/components/xixi-who-am-i",XixiFirstMeeting:"pages-subpackage/xixi/components/xixi-first-meeting",XixiRecord:"pages-subpackage/xixi/components/xixi-record",XixiDiagnosis:"pages-subpackage/xixi/components/xixi-diagnosis",XixiDatingAdvice:"pages-subpackage/xixi/components/xixi-dating-advice"}}],subPackages:[{root:"uni_modules/uni-feedback",pages:[{path:"pages/opendb-feedback/opendb-feedback",style:{navigationBarTitleText:"意见反馈",enablePullDownRefresh:!1}}]},{root:"uni_modules/uni-id-pages",pages:[{path:"pages/userinfo/userinfo",style:{navigationBarTitleText:"个人资料"}},{path:"pages/userinfo/realname-verify/realname-verify",style:{enablePullDownRefresh:!1,navigationBarTitleText:"实名认证"}},{path:"pages/login/login-withoutpwd"},{path:"pages/login/login-withpwd"},{path:"pages/userinfo/deactivate/deactivate",style:{navigationBarTitleText:"注销账号"}},{path:"pages/userinfo/bind-mobile/bind-mobile",style:{navigationBarTitleText:"绑定手机号码"}},{path:"pages/login/login-smscode",style:{navigationBarTitleText:"手机验证码登录"}},{path:"pages/register/register",style:{navigationBarTitleText:"注册"}},{path:"pages/retrieve/retrieve",style:{navigationBarTitleText:"重置密码"}},{path:"pages/common/webview/webview",style:{enablePullDownRefresh:!1,navigationBarTitleText:""}},{path:"pages/userinfo/change_pwd/change_pwd",style:{enablePullDownRefresh:!1,navigationBarTitleText:"修改密码"}},{path:"pages/register/register-by-email",style:{navigationBarTitleText:"邮箱验证码注册"}},{path:"pages/retrieve/retrieve-by-email",style:{navigationBarTitleText:"通过邮箱重置密码"}},{path:"pages/userinfo/set-pwd/set-pwd",style:{enablePullDownRefresh:!1,navigationBarTitleText:"设置密码"}}]},{root:"pages-subpackage",pages:[{path:"champion/champion",style:{navigationStyle:"custom"}},{path:"list/list",style:{enablePullDownRefresh:!0,navigationStyle:"custom"}},{path:"grid/grid",style:{}},{path:"list/search/search",style:{navigationBarTitleText:"搜索"}},{path:"list/detail",style:{"app-plus":{titleNView:{buttons:[{type:"share"}],type:"transparent"}},h5:{titleNView:{type:"transparent"}},navigationBarTitleText:"文章详情"}},{path:"workspace/workspace",style:{navigationStyle:"custom"}},{path:"workspace/scene-detail",style:{navigationStyle:"custom"}},{path:"furniture_customer/furniture_customer",style:{navigationStyle:"custom"}},{path:"bluetooth-recorder/bluetooth-recorder",style:{navigationBarTitleText:"蓝牙录音设备",navigationStyle:"custom"}},{path:"uni-agree/uni-agree",style:{navigationStyle:"custom","app-plus":{popGesture:"none"}}},{path:"ucenter/settings/settings",style:{navigationBarTitleText:"设置"}},{path:"ucenter/read-news-log/read-news-log",style:{navigationBarTitleText:"阅读记录",enablePullDownRefresh:!0}},{path:"ai_features/speech_rating/speech_rating",style:{navigationStyle:"custom"}},{path:"ai_features/intent_level/intent_level",style:{navigationStyle:"custom"}},{path:"ai_features/deal_attribution/deal_attribution",style:{navigationStyle:"custom"}},{path:"ai_features/recording_duration/recording_duration",style:{navigationStyle:"custom"}},{path:"ai_features/customer_count/customer_count",style:{navigationStyle:"custom"}},{path:"ai_features/opening_rate/opening_rate",style:{navigationStyle:"custom"}},{path:"ai_features/over_commitment/over_commitment",style:{navigationStyle:"custom"}},{path:"ai_features/red_line_touch/red_line_touch",style:{navigationStyle:"custom"}},{path:"ai_qa/general_qa/general_qa",style:{navigationStyle:"custom"}},{path:"ai_qa/demand_qa/demand_qa",style:{navigationStyle:"custom"}},{path:"ai_qa/price_qa/price_qa",style:{navigationStyle:"custom"}},{path:"ai_qa/trust_qa/trust_qa",style:{navigationStyle:"custom"}},{path:"ai_qa/decision_qa/decision_qa",style:{navigationStyle:"custom"}},{path:"ai_qa/competitor_qa/competitor_qa",style:{navigationStyle:"custom"}},{path:"ai_qa/objection_qa/objection_qa",style:{navigationStyle:"custom"}},{path:"ai_qa/sharp_qa/sharp_qa",style:{navigationStyle:"custom"}},{path:"ai_qa/after_sales_qa/after_sales_qa",style:{navigationStyle:"custom"}}]}],globalStyle:{navigationBarTextStyle:"black",navigationBarTitleText:"移多旺科技",navigationBarBackgroundColor:"#FFFFFF",backgroundColor:"#F8F8F8",enablePullDownRefresh:!1,rpxCalcMaxDeviceWidth:375,rpxCalcBaseDeviceWidth:375},condition:{list:[{path:"pages-subpackage/list/detail"},{path:"pages-subpackage/ucenter/settings/settings"}],current:0},tabBar:{custom:!1,color:"#7A7E83",selectedColor:"#007AFF",borderStyle:"black",backgroundColor:"#FFFFFF",list:[{pagePath:"pages/furniture_reception/furniture_reception",iconPath:"static/tabbar/reception.png",selectedIconPath:"static/tabbar/reception_active.png",text:"接待"},{pagePath:"pages/ai_analysis/ai_analysis",iconPath:"static/tabbar/ai_analysis.png",selectedIconPath:"static/tabbar/ai_analysis_active.png",text:"AI分析"},{pagePath:"pages/workbench/workbench",iconPath:"static/tabbar/team.png",selectedIconPath:"static/tabbar/team_active.png",text:"工作台"},{pagePath:"pages/ucenter/ucenter",iconPath:"static/tabbar/me.png",selectedIconPath:"static/tabbar/me_active.png",text:"我的"}]},uniIdRouter:{loginPage:"uni_modules/uni-id-pages/pages/login/login-withpwd",needLogin:["/uni_modules/uni-id-pages/pages/userinfo/userinfo"],resToLogin:!0},easycom:{autoscan:!0,custom:{"^cloud-image$":"@/uni_modules/uni-id-pages/components/cloud-image/cloud-image.vue"}}};const i=function(){try{if(void 0!==e.index&&e.index&&"function"==typeof e.index.getStorageSync){return e.index.getStorageSync("uni-id-pages-userInfo")||{}}}catch(t){}return{}}()||{},n={async updateUserInfo(t=!1){t&&(this.setUserInfo(t),void 0!==e.index&&e.index.showToast&&e.index.showToast({title:"更新成功",icon:"none",duration:3e3}))},syncUserInfoFromStorage(){try{if(void 0!==e.index&&e.index&&"function"==typeof e.index.getStorageSync){const t=e.index.getStorageSync("uni-id-pages-userInfo")||{};if(Object.keys(t).length>0)return this.setUserInfo(t,{cover:!0}),!0}}catch(t){}return!1},setUserInfo(t,{cover:a}={cover:!1}){const i=t&&"object"==typeof t?t:{};let n=a?i:Object.assign({},o.userInfo||{},i);if(o.userInfo=Object.assign({},n),o.hasLogin=0!=Object.keys(o.userInfo).length,void 0!==e.index&&e.index&&"function"==typeof e.index.setStorageSync)try{e.index.setStorageSync("uni-id-pages-userInfo",o.userInfo)}catch(s){}return i},async logout(){if(void 0===e.index)return void console.warn("uni API not available for logout");const i=e.index.getStorageSync("backend-user-id");if(i)try{await e.index.request({url:t.getApiUrl("/api/sys/auth/logout"),method:"POST",header:{"Content-Type":"application/x-www-form-urlencoded"},data:{userId:i}})}catch(n){console.error("后端登出接口调用失败:",n)}e.index.removeStorageSync("backend-token"),e.index.removeStorageSync("backend-login-response"),e.index.removeStorageSync("backend-user-id"),e.index.removeStorageSync("backend-tenant-id"),e.index.removeStorageSync("uni_id_token"),e.index.setStorageSync("uni_id_token_expired",0),this.setUserInfo({},{cover:!0}),e.index.$emit("uni-id-pages-logout"),e.index.redirectTo({url:`/${a.uniIdRouter&&a.uniIdRouter.loginPage?a.uniIdRouter.loginPage:"uni_modules/uni-id-pages/pages/login/login-withoutpwd"}`})},loginBack(t={}){if(void 0===e.index)return void console.warn("uni API not available for loginBack");const{uniIdRedirectUrl:i=""}=t;let n=0,o=getCurrentPages();if(o.forEach(((e,t)=>{"login"==o[o.length-t-1].route.split("/")[3]&&n++})),i)return e.index.redirectTo({url:i,fail:t=>{e.index.switchTab({url:i,fail:e=>{console.log(t,e)}})}});if(n){const t=a.pages[0];return e.index.reLaunch({url:`/${t.path}`})}e.index.navigateBack({delta:n})},loginSuccess(t={}){const{showToast:a=!0,toastText:i="登录成功",autoBack:n=!0,uniIdRedirectUrl:o="",passwordConfirmed:s}=t;void 0!==e.index?(a&&e.index.showToast({title:i,icon:"none",duration:3e3}),this.updateUserInfo(),e.index.$emit("uni-id-pages-login-success"),n&&this.loginBack({uniIdRedirectUrl:o})):console.warn("uni API not available for loginSuccess")}},o={userInfo:i,hasLogin:0!=Object.keys(i).length};exports.mutations=n,exports.pagesJson=a,exports.store=o; +"use strict";const e=require("./vendor.js"),t=require("./config.js"),a={pages:[{path:"pages/workbench/workbench",style:{navigationStyle:"custom"},componentPlaceholder:{QualityCoveragePopup:"pages-subpackage/ai_features/quality_coverage/quality-coverage-popup"}},{path:"pages/furniture_reception/furniture_reception",style:{navigationStyle:"custom"}},{path:"pages/ucenter/ucenter",style:{navigationStyle:"custom"}},{path:"pages/team/team",style:{navigationStyle:"custom"}},{path:"pages/furniture_reception/common_begin_reception",style:{navigationStyle:"custom"}},{path:"pages/ai_analysis/ai_analysis",style:{navigationStyle:"custom"},componentPlaceholder:{QualityCoveragePopup:"pages-subpackage/ai_features/quality_coverage/quality-coverage-popup"}},{path:"pages/ai_qa/ai_qa",style:{navigationStyle:"custom"}},{path:"pages/xixi/xixi",style:{navigationStyle:"custom"},componentPlaceholder:{XixiWhoAmI:"pages-subpackage/xixi/components/xixi-who-am-i",XixiFirstMeeting:"pages-subpackage/xixi/components/xixi-first-meeting",XixiRecord:"pages-subpackage/xixi/components/xixi-record",XixiDiagnosis:"pages-subpackage/xixi/components/xixi-diagnosis",XixiDatingAdvice:"pages-subpackage/xixi/components/xixi-dating-advice"}}],subPackages:[{root:"uni_modules/uni-feedback",pages:[{path:"pages/opendb-feedback/opendb-feedback",style:{navigationBarTitleText:"意见反馈",enablePullDownRefresh:!1}}]},{root:"uni_modules/uni-id-pages",pages:[{path:"pages/userinfo/userinfo",style:{navigationBarTitleText:"个人资料"}},{path:"pages/userinfo/realname-verify/realname-verify",style:{enablePullDownRefresh:!1,navigationBarTitleText:"实名认证"}},{path:"pages/login/login-withoutpwd"},{path:"pages/login/login-withpwd"},{path:"pages/userinfo/deactivate/deactivate",style:{navigationBarTitleText:"注销账号"}},{path:"pages/userinfo/bind-mobile/bind-mobile",style:{navigationBarTitleText:"绑定手机号码"}},{path:"pages/login/login-smscode",style:{navigationBarTitleText:"手机验证码登录"}},{path:"pages/register/register",style:{navigationBarTitleText:"注册"}},{path:"pages/retrieve/retrieve",style:{navigationBarTitleText:"重置密码"}},{path:"pages/common/webview/webview",style:{enablePullDownRefresh:!1,navigationBarTitleText:""}},{path:"pages/userinfo/change_pwd/change_pwd",style:{enablePullDownRefresh:!1,navigationBarTitleText:"修改密码"}},{path:"pages/register/register-by-email",style:{navigationBarTitleText:"邮箱验证码注册"}},{path:"pages/retrieve/retrieve-by-email",style:{navigationBarTitleText:"通过邮箱重置密码"}},{path:"pages/userinfo/set-pwd/set-pwd",style:{enablePullDownRefresh:!1,navigationBarTitleText:"设置密码"}}]},{root:"pages-subpackage",pages:[{path:"champion/champion",style:{navigationStyle:"custom"}},{path:"list/list",style:{enablePullDownRefresh:!0,navigationStyle:"custom"}},{path:"grid/grid",style:{}},{path:"list/search/search",style:{navigationBarTitleText:"搜索"}},{path:"list/detail",style:{"app-plus":{titleNView:{buttons:[{type:"share"}],type:"transparent"}},h5:{titleNView:{type:"transparent"}},navigationBarTitleText:"文章详情"}},{path:"workspace/workspace",style:{navigationStyle:"custom"}},{path:"workspace/scene-detail",style:{navigationStyle:"custom"}},{path:"furniture_customer/furniture_customer",style:{navigationStyle:"custom"}},{path:"furniture_reception/furniture_reception_entry",style:{navigationStyle:"custom"}},{path:"bluetooth-recorder/bluetooth-recorder",style:{navigationBarTitleText:"蓝牙录音设备",navigationStyle:"custom"}},{path:"uni-agree/uni-agree",style:{navigationStyle:"custom","app-plus":{popGesture:"none"}}},{path:"ucenter/settings/settings",style:{navigationBarTitleText:"设置"}},{path:"ucenter/read-news-log/read-news-log",style:{navigationBarTitleText:"阅读记录",enablePullDownRefresh:!0}},{path:"ai_features/speech_rating/speech_rating",style:{navigationStyle:"custom"}},{path:"ai_features/intent_level/intent_level",style:{navigationStyle:"custom"}},{path:"ai_features/deal_attribution/deal_attribution",style:{navigationStyle:"custom"}},{path:"ai_features/recording_duration/recording_duration",style:{navigationStyle:"custom"}},{path:"ai_features/customer_count/customer_count",style:{navigationStyle:"custom"}},{path:"ai_features/opening_rate/opening_rate",style:{navigationStyle:"custom"}},{path:"ai_features/over_commitment/over_commitment",style:{navigationStyle:"custom"}},{path:"ai_features/red_line_touch/red_line_touch",style:{navigationStyle:"custom"}},{path:"ai_qa/general_qa/general_qa",style:{navigationStyle:"custom"}},{path:"ai_qa/demand_qa/demand_qa",style:{navigationStyle:"custom"}},{path:"ai_qa/price_qa/price_qa",style:{navigationStyle:"custom"}},{path:"ai_qa/trust_qa/trust_qa",style:{navigationStyle:"custom"}},{path:"ai_qa/decision_qa/decision_qa",style:{navigationStyle:"custom"}},{path:"ai_qa/competitor_qa/competitor_qa",style:{navigationStyle:"custom"}},{path:"ai_qa/objection_qa/objection_qa",style:{navigationStyle:"custom"}},{path:"ai_qa/sharp_qa/sharp_qa",style:{navigationStyle:"custom"}},{path:"ai_qa/after_sales_qa/after_sales_qa",style:{navigationStyle:"custom"}}]}],globalStyle:{navigationBarTextStyle:"black",navigationBarTitleText:"移多旺科技",navigationBarBackgroundColor:"#FFFFFF",backgroundColor:"#F8F8F8",enablePullDownRefresh:!1,rpxCalcMaxDeviceWidth:375,rpxCalcBaseDeviceWidth:375},condition:{list:[{path:"pages-subpackage/list/detail"},{path:"pages-subpackage/ucenter/settings/settings"}],current:0},tabBar:{custom:!1,color:"#7A7E83",selectedColor:"#007AFF",borderStyle:"black",backgroundColor:"#FFFFFF",list:[{pagePath:"pages/workbench/workbench",iconPath:"static/tabbar/team.png",selectedIconPath:"static/tabbar/team_active.png",text:"工作台"},{pagePath:"pages/ucenter/ucenter",iconPath:"static/tabbar/me.png",selectedIconPath:"static/tabbar/me_active.png",text:"我的"}]},uniIdRouter:{loginPage:"uni_modules/uni-id-pages/pages/login/login-withpwd",needLogin:["/uni_modules/uni-id-pages/pages/userinfo/userinfo"],resToLogin:!0},easycom:{autoscan:!0,custom:{"^cloud-image$":"@/uni_modules/uni-id-pages/components/cloud-image/cloud-image.vue"}}};const i=function(){try{if(void 0!==e.index&&e.index&&"function"==typeof e.index.getStorageSync){return e.index.getStorageSync("uni-id-pages-userInfo")||{}}}catch(t){}return{}}()||{},n={async updateUserInfo(t=!1){t&&(this.setUserInfo(t),void 0!==e.index&&e.index.showToast&&e.index.showToast({title:"更新成功",icon:"none",duration:3e3}))},syncUserInfoFromStorage(){try{if(void 0!==e.index&&e.index&&"function"==typeof e.index.getStorageSync){const t=e.index.getStorageSync("uni-id-pages-userInfo")||{};if(Object.keys(t).length>0)return this.setUserInfo(t,{cover:!0}),!0}}catch(t){}return!1},setUserInfo(t,{cover:a}={cover:!1}){const i=t&&"object"==typeof t?t:{};let n=a?i:Object.assign({},o.userInfo||{},i);if(o.userInfo=Object.assign({},n),o.hasLogin=0!=Object.keys(o.userInfo).length,void 0!==e.index&&e.index&&"function"==typeof e.index.setStorageSync)try{e.index.setStorageSync("uni-id-pages-userInfo",o.userInfo)}catch(s){}return i},async logout(){if(void 0===e.index)return void console.warn("uni API not available for logout");const i=e.index.getStorageSync("backend-user-id");if(i)try{await e.index.request({url:t.getApiUrl("/api/sys/auth/logout"),method:"POST",header:{"Content-Type":"application/x-www-form-urlencoded"},data:{userId:i}})}catch(n){console.error("后端登出接口调用失败:",n)}e.index.removeStorageSync("backend-token"),e.index.removeStorageSync("backend-login-response"),e.index.removeStorageSync("backend-user-id"),e.index.removeStorageSync("backend-tenant-id"),e.index.removeStorageSync("uni_id_token"),e.index.setStorageSync("uni_id_token_expired",0),this.setUserInfo({},{cover:!0}),e.index.$emit("uni-id-pages-logout"),e.index.redirectTo({url:`/${a.uniIdRouter&&a.uniIdRouter.loginPage?a.uniIdRouter.loginPage:"uni_modules/uni-id-pages/pages/login/login-withoutpwd"}`})},loginBack(t={}){if(void 0===e.index)return void console.warn("uni API not available for loginBack");const{uniIdRedirectUrl:i=""}=t;let n=0,o=getCurrentPages();if(o.forEach(((e,t)=>{"login"==o[o.length-t-1].route.split("/")[3]&&n++})),i)return e.index.redirectTo({url:i,fail:t=>{e.index.switchTab({url:i,fail:e=>{console.log(t,e)}})}});if(n){const t=a.pages[0];return e.index.reLaunch({url:`/${t.path}`})}e.index.navigateBack({delta:n})},loginSuccess(t={}){const{showToast:a=!0,toastText:i="登录成功",autoBack:n=!0,uniIdRedirectUrl:o="",passwordConfirmed:s}=t;void 0!==e.index?(a&&e.index.showToast({title:i,icon:"none",duration:3e3}),this.updateUserInfo(),e.index.$emit("uni-id-pages-login-success"),n&&this.loginBack({uniIdRedirectUrl:o})):console.warn("uni API not available for loginSuccess")}},o={userInfo:i,hasLogin:0!=Object.keys(i).length};exports.mutations=n,exports.pagesJson=a,exports.store=o; diff --git a/unpackage/dist/build/mp-weixin/components/ai-analysis-dashboard-body.js b/unpackage/dist/build/mp-weixin/components/ai-analysis-dashboard-body.js new file mode 100644 index 0000000..320fbc1 --- /dev/null +++ b/unpackage/dist/build/mp-weixin/components/ai-analysis-dashboard-body.js @@ -0,0 +1 @@ +"use strict";const e=require("../common/vendor.js"),o={name:"AiAnalysisDashboardBody",props:{contentTop:{type:String,default:""},contentBottom:{type:String,default:"96rpx"}},data:()=>({showQualityCoverage:!1,openQualityCoverageTrigger:0}),computed:{scrollTop(){return this.contentTop||"88rpx"},scrollBottom(){return this.contentBottom||"96rpx"}},methods:{showQualityCoveragePopup(){this.showQualityCoverage=!0,this.$nextTick((()=>{this.openQualityCoverageTrigger++}))},onQualityCoveragePopupClose(){this.showQualityCoverage=!1},navigateToPage(o){const t=`pages-subpackage/ai_features/${o}/${o}`;e.index.navigateTo({url:`/${t}`,fail:o=>{console.error("导航失败:",o),e.index.showToast({title:"页面跳转失败",icon:"none"})}})},quickJumpReceptionTab(o){if(["status","reception","tag"].includes(o)){try{e.index.setStorageSync("workbench-reception-tab",o)}catch(t){console.warn("[AiAnalysisDashboardBody] 写入接待tab快捷跳转参数失败:",t)}e.index.navigateTo({url:`/pages-subpackage/furniture_reception/furniture_reception_entry?tab=${encodeURIComponent(o)}`,fail:o=>{console.error("[AiAnalysisDashboardBody] 快捷跳转接待页失败:",o),e.index.showToast({title:"跳转失败,请稍后重试",icon:"none"})}})}},quickJumpCustomerTab(o){["service","customer"].includes(o)&&e.index.navigateTo({url:`/pages-subpackage/furniture_customer/furniture_customer?tab=${o}`,fail:o=>{console.error("[AiAnalysisDashboardBody] 快捷跳转客户页失败:",o),e.index.showToast({title:"跳转失败,请稍后重试",icon:"none"})}})}}};if(!Array){e.resolveComponent("QualityCoveragePopup")()}const t=e._export_sfc(o,[["render",function(o,t,a,i,n,r){return e.e({a:e.o((e=>r.quickJumpReceptionTab("reception")),"9a"),b:e.o((e=>r.quickJumpReceptionTab("status")),"18"),c:e.o((e=>r.quickJumpReceptionTab("tag")),"59"),d:e.o((e=>r.quickJumpCustomerTab("customer")),"7c"),e:e.o((e=>r.quickJumpCustomerTab("service")),"e4"),f:e.o((e=>r.navigateToPage("recording_duration")),"99"),g:e.o((e=>r.navigateToPage("customer_count")),"57"),h:e.o(((...e)=>r.showQualityCoveragePopup&&r.showQualityCoveragePopup(...e)),"05"),i:e.o((e=>r.navigateToPage("speech_rating")),"a9"),j:e.o((e=>r.navigateToPage("intent_level")),"5b"),k:e.o((e=>r.navigateToPage("deal_attribution")),"4b"),l:e.o((e=>r.navigateToPage("opening_rate")),"89"),m:e.o((e=>r.navigateToPage("over_commitment")),"52"),n:e.o((e=>r.navigateToPage("red_line_touch")),"e8"),o:r.scrollTop,p:r.scrollBottom,q:n.showQualityCoverage},n.showQualityCoverage?{r:e.o(r.onQualityCoveragePopupClose,"99"),s:e.p({"open-trigger":n.openQualityCoverageTrigger})}:{})}],["__scopeId","data-v-da88ed95"]]);wx.createComponent(t); diff --git a/unpackage/dist/build/mp-weixin/components/ai-analysis-dashboard-body.json b/unpackage/dist/build/mp-weixin/components/ai-analysis-dashboard-body.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/unpackage/dist/build/mp-weixin/components/ai-analysis-dashboard-body.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/unpackage/dist/build/mp-weixin/components/ai-analysis-dashboard-body.wxml b/unpackage/dist/build/mp-weixin/components/ai-analysis-dashboard-body.wxml new file mode 100644 index 0000000..d7a75a4 --- /dev/null +++ b/unpackage/dist/build/mp-weixin/components/ai-analysis-dashboard-body.wxml @@ -0,0 +1 @@ +🚀接待🤝开始接待📋服务中🏷️标签管理👤AI分析👥客户列表📝服务记录📊录音和接待统计⏱️录音时长👥接待客户数质量管控📊质检覆盖率🗣️员工话术评分📈销售分析🎯客户意向分级💰成交归因🚪开口率⚠️风险监控🚨过度承诺统计🔴触及红线统计 \ No newline at end of file diff --git a/unpackage/dist/build/mp-weixin/components/ai-analysis-dashboard-body.wxss b/unpackage/dist/build/mp-weixin/components/ai-analysis-dashboard-body.wxss new file mode 100644 index 0000000..c6e905b --- /dev/null +++ b/unpackage/dist/build/mp-weixin/components/ai-analysis-dashboard-body.wxss @@ -0,0 +1 @@ +.ai-dashboard-body.data-v-da88ed95{position:relative;width:100%}.content.data-v-da88ed95{padding-top:0!important;margin-top:0!important;position:relative;top:0;min-height:calc(100vh - 200rpx)}.content-scroll.data-v-da88ed95{position:absolute;left:0;right:0;top:0;bottom:0;padding:0!important;margin:0!important;box-sizing:border-box}.content-scroll>view.data-v-da88ed95{margin-top:0;padding-top:0;margin-bottom:0;padding-bottom:0}.category-section.data-v-da88ed95{margin:20rpx 30rpx;background:#fff;border-radius:16rpx;overflow:hidden;box-shadow:0 2rpx 8rpx rgba(0,0,0,.04)}.category-section.data-v-da88ed95:first-child{margin-top:0}.category-section.data-v-da88ed95:last-child{margin-bottom:0}.category-header.data-v-da88ed95{display:flex;align-items:center;padding:30rpx;background:#fff;border-bottom:1rpx solid #f0f0f0}.category-icon.data-v-da88ed95{font-size:32rpx;margin-right:20rpx}.category-title.data-v-da88ed95{font-size:32rpx;font-weight:500;color:#333}.function-grid.data-v-da88ed95{display:flex;flex-wrap:wrap;padding:10rpx}.quick-links-section .function-item.data-v-da88ed95{width:calc(33.333% - 10rpx);background:#fff;border-radius:12rpx;padding:24rpx 12rpx;margin:5rpx;text-align:center;box-shadow:0 2rpx 4rpx rgba(0,0,0,.04);transition:all .3s ease;border:1rpx solid #f0f0f0;box-sizing:border-box}.two-column .function-item.data-v-da88ed95{flex:1;background:#fff;border-radius:12rpx;padding:24rpx 16rpx;margin:0 5rpx;text-align:center;box-shadow:0 2rpx 4rpx rgba(0,0,0,.04);transition:all .3s ease;border:1rpx solid #f0f0f0}.three-column .function-item.data-v-da88ed95{width:31%;background:#fff;border-radius:12rpx;padding:24rpx 12rpx;margin:1%;text-align:center;box-shadow:0 2rpx 4rpx rgba(0,0,0,.04);transition:all .3s ease;border:1rpx solid #f0f0f0}.sales-analysis .function-item.full-row-item.data-v-da88ed95{flex:1;width:calc(50% - 10rpx);background:#fff;border-radius:12rpx;padding:24rpx 16rpx;margin:0 5rpx;text-align:center;box-shadow:0 2rpx 4rpx rgba(0,0,0,.04);transition:all .3s ease;border:1rpx solid #f0f0f0}.sales-analysis .function-item.new-line-item.data-v-da88ed95{flex-basis:100%;width:calc(50% - 10rpx);margin-top:10rpx}.function-item.data-v-da88ed95:active{transform:scale(.95);box-shadow:0 1rpx 2rpx rgba(0,0,0,.1)}.function-icon.data-v-da88ed95{font-size:48rpx;margin-bottom:12rpx}.function-name.data-v-da88ed95{display:block;font-size:28rpx;font-weight:500;color:#333;margin-bottom:8rpx}.function-desc.data-v-da88ed95{display:block;font-size:24rpx;color:#666;line-height:1.4} diff --git a/unpackage/dist/build/mp-weixin/custom-tab-bar/index.js b/unpackage/dist/build/mp-weixin/custom-tab-bar/index.js index 6c1da5d..83029f4 100644 --- a/unpackage/dist/build/mp-weixin/custom-tab-bar/index.js +++ b/unpackage/dist/build/mp-weixin/custom-tab-bar/index.js @@ -40,13 +40,6 @@ Component({ iconPath: '/static/tabbar/insight.png', selectedIconPath: '/static/tabbar/insight_active.png', }, - { - key: 'furniture_reception', - text: '接待', - pagePath: 'pages/furniture_reception/furniture_reception', - iconPath: '/static/tabbar/reception.png', - selectedIconPath: '/static/tabbar/reception_active.png', - }, { key: 'common_begin_reception', text: '开始接待', @@ -62,11 +55,11 @@ Component({ selectedIconPath: '/static/tabbar/customer_active.png', }, { - key: 'ai_analysis', - text: 'AI分析', - pagePath: 'pages/ai_analysis/ai_analysis', - iconPath: '/static/tabbar/ai_analysis.png', - selectedIconPath: '/static/tabbar/ai_analysis_active.png', + key: 'workbench', + text: '工作台', + pagePath: 'pages/workbench/workbench', + iconPath: '/static/tabbar/team.png', + selectedIconPath: '/static/tabbar/team_active.png', }, { key: 'furniture_top_sales', @@ -280,10 +273,9 @@ Component({ 'team': 'pages/team/team', 'ucenter': 'pages/ucenter/ucenter', 'meeting_summary': 'pages-subpackage/meeting_summary/meeting_summary', - 'furniture_reception': 'pages/furniture_reception/furniture_reception', 'common_begin_reception': 'pages/furniture_reception/common_begin_reception', + 'workbench': 'pages/workbench/workbench', 'furniture_customer': 'pages-subpackage/furniture_customer/furniture_customer', - 'ai_analysis': 'pages/ai_analysis/ai_analysis', 'furniture_top_sales': 'pages/furniture_top_sales/furniture_top_sales' }; @@ -511,7 +503,7 @@ Component({ const hasFurnitureRole = roles.includes('furniture'); if (isAdminFurniture || hasFurnitureRole) { - const furnitureTabs = ['furniture_reception', 'furniture_customer', 'ai_analysis', 'ucenter']; + const furnitureTabs = ['workbench', 'ucenter']; console.log('[TabBar][allowed] furniture/admin_furniture role ->', furnitureTabs); return furnitureTabs; } diff --git a/unpackage/dist/build/mp-weixin/custom-tab-bar/index.vue b/unpackage/dist/build/mp-weixin/custom-tab-bar/index.vue index 967839b..7e4713a 100644 --- a/unpackage/dist/build/mp-weixin/custom-tab-bar/index.vue +++ b/unpackage/dist/build/mp-weixin/custom-tab-bar/index.vue @@ -34,13 +34,6 @@ export default { roles: [], currentPath: '', allTabs: [ - { - key: 'furniture_reception', - text: '接待', - pagePath: '/pages/furniture_reception/furniture_reception', - iconPath: '/static/tabbar/reception.png', - selectedIconPath: '/static/tabbar/reception_active.png', - }, { key: 'furniture_customer', text: '客户', @@ -78,11 +71,11 @@ export default { selectedIconPath: '/static/tabbar/me_active.png', }, { - key: 'ai_analysis', - text: 'AI分析', - pagePath: '/pages/ai_analysis/ai_analysis', - iconPath: '/static/tabbar/ai_analysis.png', - selectedIconPath: '/static/tabbar/ai_analysis_active.png', + key: 'workbench', + text: '工作台', + pagePath: '/pages/workbench/workbench', + iconPath: '/static/tabbar/team.png', + selectedIconPath: '/static/tabbar/team_active.png', }, { key: 'meeting_summary', @@ -96,36 +89,22 @@ export default { }, computed: { furnitureTabs() { - // 强制返回所有家具角色的tab,使用与pages.json相同的路径格式 + // 与 pages.json 的 tabBar 一致:工作台、我的 return [ { - key: 'furniture_reception', - text: '接待', - pagePath: 'pages/furniture_reception/furniture_reception', // 移除开头的/ - iconPath: '/static/tabbar/reception.png', - selectedIconPath: '/static/tabbar/reception_active.png', - }, - { - key: 'furniture_customer', - text: '客户', - pagePath: 'pages-subpackage/furniture_customer/furniture_customer', // 移除开头的/ - iconPath: '/static/tabbar/customer.png', - selectedIconPath: '/static/tabbar/customer_active.png', - }, - { - key: 'ai_analysis', - text: 'AI分析', - pagePath: 'pages/ai_analysis/ai_analysis', - iconPath: '/static/tabbar/ai_analysis.png', - selectedIconPath: '/static/tabbar/ai_analysis_active.png', + key: 'workbench', + text: '工作台', + pagePath: '/pages/workbench/workbench', + iconPath: '/static/tabbar/team.png', + selectedIconPath: '/static/tabbar/team_active.png', }, { key: 'ucenter', text: '我的', - pagePath: 'pages/ucenter/ucenter', // 移除开头的/ + pagePath: '/pages/ucenter/ucenter', iconPath: '/static/tabbar/me.png', selectedIconPath: '/static/tabbar/me_active.png', - } + }, ]; }, @@ -134,7 +113,7 @@ export default { console.log('VISIBLE TABS CALC - THIS MUST SHOW IN H5'); // 简化逻辑:直接返回家具相关的tabs,跳过权限检查 - const furnitureKeys = ['furniture_reception', 'furniture_customer', 'ai_analysis', 'ucenter']; + const furnitureKeys = ['workbench', 'ucenter']; const result = furnitureKeys.map(key => { return this.allTabs.find(tab => tab.key === key); }).filter(Boolean); @@ -289,15 +268,15 @@ export default { console.log('GET ALLOWED KEYS - 简化版本,总是返回家具相关tabs'); // 简化逻辑:总是返回家具相关的tabs - const furnitureTabs = ['furniture_reception', 'furniture_customer', 'ai_analysis', 'ucenter']; + const furnitureTabs = ['workbench', 'ucenter']; console.log('[TabBar][allowed] 简化逻辑 ->', furnitureTabs); return furnitureTabs; }, // #ifdef H5 toggleNativeTabs() { // H5 平台自定义 tabbar 不生效,直接根据角色显隐原生 tabbar 项 - // 当前位置顺序(根据 pages.json 中的 tabBar.list 顺序):接待、客户、AI分析、我的、团队、总结和统计… - const ORDER = ['furniture_reception', 'furniture_customer', 'ai_analysis', 'ucenter', 'reception', 'customer', 'team', 'meeting_summary', 'common_begin_reception']; + // 当前位置顺序(与 pages.json 的 tabBar.list 一致):工作台、我的… + const ORDER = ['workbench', 'ucenter', 'reception', 'customer', 'team', 'meeting_summary', 'common_begin_reception']; const allowed = this.getAllowedKeys(); // 限制重试次数,防止渲染时机未就绪 this._h5TabRetries = (this._h5TabRetries || 0) + 1; @@ -326,10 +305,8 @@ export default { isInTabBar(pagePath) { // 检查页面路径是否在原生tabBar配置中 const tabBarList = [ - 'pages/furniture_reception/furniture_reception', - 'pages-subpackage/furniture_customer/furniture_customer', - 'pages/ai_analysis/ai_analysis', - 'pages/ucenter/ucenter' + 'pages/workbench/workbench', + 'pages/ucenter/ucenter', ]; const normalizedPath = pagePath.startsWith('/') ? pagePath.substring(1) : pagePath; const result = tabBarList.includes(normalizedPath); @@ -367,9 +344,7 @@ export default { const allElements = document.querySelectorAll('*'); const tabElements = Array.from(allElements).filter(el => el.textContent && ( - el.textContent.includes('接待') || - el.textContent.includes('客户') || - el.textContent.includes('AI分析') || + el.textContent.includes('工作台') || el.textContent.includes('我的') ) ); @@ -406,9 +381,9 @@ export default { return; } - // 按文本内容排序:接待、客户、AI分析、我的 + // 按文本内容排序:工作台、我的 const sortedElements = tabElements.sort((a, b) => { - const order = ['接待', '客户', 'AI分析', '我的']; + const order = ['工作台', '我的']; const aIndex = order.findIndex(text => a.textContent.includes(text)); const bIndex = order.findIndex(text => b.textContent.includes(text)); return aIndex - bIndex; @@ -418,7 +393,7 @@ export default { // 处理每个元素 sortedElements.forEach((element, index) => { - const keyMap = ['furniture_reception', 'furniture_customer', 'ai_analysis', 'ucenter']; + const keyMap = ['workbench', 'ucenter']; const key = keyMap[index]; const shouldShow = allowed.includes(key); diff --git a/unpackage/dist/build/mp-weixin/pages-subpackage/furniture_reception/furniture_reception-impl.js b/unpackage/dist/build/mp-weixin/pages-subpackage/furniture_reception/furniture_reception-impl.js index b4efe01..a7cd08b 100644 --- a/unpackage/dist/build/mp-weixin/pages-subpackage/furniture_reception/furniture_reception-impl.js +++ b/unpackage/dist/build/mp-weixin/pages-subpackage/furniture_reception/furniture_reception-impl.js @@ -1 +1 @@ -"use strict";const e=require("../../common/vendor.js"),t=require("../../common/config.js"),o={props:{incomingTab:{type:String,default:""}},components:{CommonBeginReception:()=>"./common_begin_reception.js",ServiceListFurniture:()=>"./serviceListFurniture.js"},data:()=>({activeTab:"status",navbarTop:"88rpx",contentTop:"160rpx",receptionForm:{id:"",customerName:"",contact:"",customerSource:"",gender:"女",age:"",dealershipId:"",dealershipName:"",salesId:"",salesName:"",salesPhone:"",recordingCount:0,intendedModel:"",infoCard:"",remark:"",detailedAddress:"",contactCount:0},tagViewMode:"list",tagList:[],tagLoading:!1,tagTotal:0,tagPage:{current:1,size:10},tagQuery:{industry:"",tagType:"",tagName:""},tagForm:{id:"",industry:"家居行业",tagType:"",name:"",detail:"",remark:"",enabled:!0},tagTypeOptions:["接待客户","质检SOP","客户画像"],showTagTypeDropdown:!1,selectedTagItem:null,showTagActionMenu:!1}),watch:{incomingTab:{immediate:!0,handler(e){this.applyIncomingTab(e)}}},computed:{computedNavbarTop(){console.log("[FurnitureReception][computedNavbarTop] 计算导航栏位置");const t=e.index.getSystemInfoSync().statusBarHeight||20,o=2*t+88,a=o+"rpx";return console.log("[FurnitureReception][computedNavbarTop] 计算结果:",{statusBarHeight:t,navbarHeight:44,totalNavbarHeight:o,result:a}),a},computedContentTop(){console.log("[FurnitureReception][computedContentTop] 计算内容区域位置");const t=e.index.getSystemInfoSync().statusBarHeight||20,o=2*t+88,a=o+72+"rpx";return console.log("[FurnitureReception][computedContentTop] 计算结果:",{statusBarHeight:t,navbarHeight:44,totalNavbarHeight:o,result:a}),a}},onLoad(){console.log("[FurnitureReception][onLoad] 页面加载"),this.updateNavbarPosition(),this.loadCurrentUserInfo()},onShow(){console.log("[FurnitureReception][onShow] 页面显示"),this.$nextTick((()=>{this.updateNavbarPosition(),setTimeout((()=>{this.updateNavbarPosition(),console.log("[FurnitureReception][onShow] 延迟更新后的位置:",{navbarTop:this.navbarTop,contentTop:this.contentTop,computedNavbarTop:this.computedNavbarTop,computedContentTop:this.computedContentTop})}),50)}))},onReady(){console.log("[FurnitureReception][onReady] 页面渲染完成"),console.log("[FurnitureReception][onReady] activeTab:",this.activeTab),console.log("[FurnitureReception][onReady] navbarTop:",this.navbarTop),console.log("[FurnitureReception][onReady] contentTop:",this.contentTop),console.log("[FurnitureReception][onReady] computedNavbarTop:",this.computedNavbarTop),console.log("[FurnitureReception][onReady] computedContentTop:",this.computedContentTop),this.updateNavbarPosition(),this.initUrlHidingAfterPageLoad();const t=e.index.getSystemInfoSync();console.log("[FurnitureReception][onReady] 系统信息:",{statusBarHeight:t.statusBarHeight,windowHeight:t.windowHeight,screenHeight:t.screenHeight}),setTimeout((()=>{e.index.createSelectorQuery().in(this).select(".tabs").boundingClientRect((e=>{console.log("[FurnitureReception][onReady] tab栏元素信息:",e),e?(console.log("[FurnitureReception][onReady] tab栏位置:",{top:e.top,left:e.left,width:e.width,height:e.height,expectedTop:this.navbarTop,computedNavbarTop:this.computedNavbarTop,isVisible:e.width>0&&e.height>0,isOnScreen:e.top>=0&&e.top{this.showTagTypeDropdown&&this.updateTagTypeDropdownPosition()}))},methods:{applyIncomingTab(e){["status","reception","tag"].includes(e)&&(this.activeTab!==e&&(this.activeTab=e),"reception"===e?this.resetReceptionForm():"tag"===e&&(this.tagViewMode="list",this.fetchTagList({force:!0})))},updateNavbarPosition(){console.log("[FurnitureReception][updateNavbarPosition] 开始更新导航栏位置");const t=e.index.getSystemInfoSync().statusBarHeight||20,o=2*t+88,a=o+"rpx",i=o+72+"rpx";console.log("[FurnitureReception][updateNavbarPosition] 更新导航栏位置:",{statusBarHeight:t,navbarHeight:44,totalNavbarHeight:o,navbarTop:a,contentTop:i,currentNavbarTop:this.navbarTop,currentContentTop:this.contentTop}),this.$set(this,"navbarTop",a),this.$set(this,"contentTop",i),this.$forceUpdate()},loadCurrentUserInfo(){try{const t=e.index.getStorageSync("backend-login-response")||{};t.userName&&(this.receptionForm.salesName=t.userName),t.phone?this.receptionForm.salesPhone=t.phone:t.userName&&(this.receptionForm.salesPhone=t.userName),t.userId&&(this.receptionForm.salesId=String(t.userId))}catch(t){console.error("加载当前登录用户信息失败:",t)}},goBack(){getCurrentPages().length<=1?e.index.switchTab({url:"/pages/ai_analysis/ai_analysis",fail:e=>{console.error("[FurnitureReception][goBack] 切回AI分析页失败:",e)}}):e.index.navigateBack({fail:e=>{console.error("[FurnitureReception][goBack] 返回失败:",e)}})},switchTab(e){this.activeTab=e,"reception"===e?this.resetReceptionForm():"tag"===e&&(this.tagViewMode="list",this.fetchTagList())},resetReceptionForm(){this.receptionForm={id:"",customerName:"",contact:"",customerSource:"",gender:"女",age:"",dealershipId:"",dealershipName:"",salesId:"",salesName:"",salesPhone:"",recordingCount:0,intendedModel:"",infoCard:"",remark:"",detailedAddress:"",contactCount:0},this.loadCurrentUserInfo()},onReceptionCancel(){this.resetReceptionForm()},onReceptionSaveSuccess({action:e,data:t}){t&&(this.receptionForm={...this.receptionForm,...t}),this.resetReceptionForm(),"start"===e&&console.log("开始接待成功",t)},onReceptionSaveError({action:e,error:t}){console.error("保存失败:",t)},onTagListSearch(){"tag"!==this.activeTab&&(this.activeTab="tag"),this.tagPage.current=1,this.fetchTagList({force:!0})},onTagListRefresh(){this.tagPage.current=1,this.fetchTagList({force:!0})},onTagListReachBottom(){this.tagLoading||this.tagList.length>=this.tagTotal||(this.tagPage.current+=1,this.fetchTagList())},async fetchTagList({force:o=!1}={}){var a,i,n,s,r;if(!this.tagLoading||o){this.tagLoading=!0;try{const c={current:this.tagPage.current,size:this.tagPage.size},g=null==(i=null==(a=this.tagQuery)?void 0:a.tagType)?void 0:i.trim(),l=null==(s=null==(n=this.tagQuery)?void 0:n.tagName)?void 0:s.trim();g&&(c.tagType=g),l&&(c.tagName=l);const h=t.getApiUrl("/api/industryTags/list");let p="",u="";try{p=e.index.getStorageSync("backend-tenant-id")||"",u=e.index.getStorageSync("backend-token")||""}catch(d){console.error("获取认证信息失败:",d)}const T={"Content-Type":"application/json"};u&&(T.Authorization=`Bearer ${u}`),p&&(T["X-Tenant-Id"]=p);const m=await e.index.request({url:h,method:"POST",data:c,header:T,timeout:3e4});if(200===m.statusCode&&m.data&&m.data.success){const e=Array.isArray(m.data.data)?m.data.data:[];1===this.tagPage.current||o?this.tagList=e:this.tagList=this.tagList.concat(e),this.tagTotal=Number(m.data.total)||0}else this.tagList=[],this.tagTotal=0,e.index.showToast({title:(null==(r=m.data)?void 0:r.message)||"获取标签列表失败",icon:"none"})}catch(c){console.error("获取标签列表失败:",c);let t="获取标签列表失败,请稍后重试";c.errMsg&&(c.errMsg.includes("timeout")?t="请求超时,请检查网络连接后重试":c.errMsg.includes("fail")&&(t="网络请求失败,请检查网络连接")),e.index.showToast({title:t,icon:"none",duration:3e3})}finally{this.tagLoading=!1}}},showAddTag(){this.tagViewMode="add",this.showTagTypeDropdown=!1,this.tagForm={id:"",industry:"家居行业",tagType:"",name:"",detail:"",remark:"",enabled:!0}},onTagItemClick(e){},onTagActionBtnClick(e){this.selectedTagItem&&this.selectedTagItem.id===e.id&&this.showTagActionMenu?this.closeTagActionMenu():(this.selectedTagItem=e,this.showTagActionMenu=!0)},closeTagActionMenu(){this.showTagActionMenu=!1,this.selectedTagItem=null},editTag(e){this.closeTagActionMenu(),this.tagViewMode="edit",this.showTagTypeDropdown=!1,this.tagForm={id:e.id||"",industry:e.industry||"家居行业",tagType:e.tagType||"",name:e.tagName||e.name||"",detail:e.tagDetail||e.detail||"",remark:e.remark||"",enabled:void 0!==e.enabled?e.enabled:void 0===e.isEnabled||e.isEnabled}},async deleteTag(o){this.closeTagActionMenu();const a=o.id;a?e.index.showModal({title:"确认删除",content:`确定要删除标签"${o.tagName||o.name||"未命名标签"}"吗?`,success:async o=>{var i,n;if(o.confirm)try{e.index.showLoading({title:"删除中..."});const o=t.getApiUrl(`/api/industryTags/delete/${a}`);let r="",d="";try{r=e.index.getStorageSync("backend-tenant-id")||"",d=e.index.getStorageSync("backend-token")||""}catch(s){console.error("获取认证信息失败:",s)}const c={};d&&(c.Authorization=`Bearer ${d}`),r&&(c["X-Tenant-Id"]=r);const g=await e.index.request({url:o,method:"DELETE",header:c,timeout:3e4});e.index.hideLoading(),200===g.statusCode&&g.data&&g.data.success?(e.index.showToast({title:(null==(i=g.data)?void 0:i.message)||"删除成功",icon:"success"}),this.tagPage.current=1,this.fetchTagList({force:!0})):e.index.showToast({title:(null==(n=g.data)?void 0:n.message)||"删除失败",icon:"none"})}catch(r){e.index.hideLoading(),console.error("删除标签失败:",r);let t="删除失败,请重试";r.errMsg&&(r.errMsg.includes("timeout")?t="请求超时,请检查网络连接后重试":r.errMsg.includes("fail")&&(t="网络请求失败,请检查网络连接")),e.index.showToast({title:t,icon:"none",duration:3e3})}}}):e.index.showToast({title:"无法获取标签ID",icon:"none"})},cancelAddTag(){this.tagViewMode="list",this.showTagTypeDropdown=!1,this.tagForm={id:"",industry:"家居行业",tagType:"",name:"",detail:"",remark:"",enabled:!0}},toggleTagTypeDropdown(){this.showTagTypeDropdown=!this.showTagTypeDropdown,this.showTagTypeDropdown&&this.$nextTick((()=>{this.updateTagTypeDropdownPosition()}))},updateTagTypeDropdownPosition(){e.index.createSelectorQuery().in(this).select(".tag-select").boundingClientRect((e=>{if(e){const t=this.$refs.tagTypeDropdown;t&&this.$nextTick((()=>{const o=t.$el||t;o&&o.style&&(o.style.top=e.bottom+8+"px",o.style.left=e.left+"px",o.style.width=e.width+"px")}))}})).exec()},selectTagType(e){this.tagForm.tagType=e,this.showTagTypeDropdown=!1},closeTagTypeDropdown(){this.showTagTypeDropdown=!1},onEnabledChange(e){this.tagForm.enabled=e.detail.value},async saveTag(){var o,a,i,n;if(this.tagForm.name&&this.tagForm.name.trim())try{e.index.showLoading({title:"edit"===this.tagViewMode?"更新中...":"保存中..."});const r={industry:(null==(o=this.tagForm.industry)?void 0:o.trim())||"",tagType:(null==(a=this.tagForm.tagType)?void 0:a.trim())||"",tagName:this.tagForm.name.trim(),tagDetail:(null==(i=this.tagForm.detail)?void 0:i.trim())||"",remark:(null==(n=this.tagForm.remark)?void 0:n.trim())||"",enabled:void 0===this.tagForm.enabled||this.tagForm.enabled};"edit"===this.tagViewMode&&this.tagForm.id&&(r.id=this.tagForm.id);const d="edit"===this.tagViewMode?t.getApiUrl("/api/industryTags/update"):t.getApiUrl("/api/industryTags/add"),c="edit"===this.tagViewMode?"PUT":"POST";let g="",l="";try{g=e.index.getStorageSync("backend-tenant-id")||"",l=e.index.getStorageSync("backend-token")||""}catch(s){console.error("获取认证信息失败:",s)}const h={"Content-Type":"application/json"};l&&(h.Authorization=`Bearer ${l}`),g&&(h["X-Tenant-Id"]=g);const p=await e.index.request({url:d,method:c,data:r,header:h,timeout:3e4}),{statusCode:u,data:T}=p;if(200!==u||!T||!T.success&&200!==T.code)throw new Error((null==T?void 0:T.message)||("edit"===this.tagViewMode?"更新失败":"保存失败"));e.index.showToast({title:(null==T?void 0:T.message)||("edit"===this.tagViewMode?"更新成功":"保存成功"),icon:"success"}),this.tagViewMode="list",this.tagPage.current=1,this.fetchTagList({force:!0})}catch(r){console.error("保存标签失败:",r);let t=(null==r?void 0:r.message)||("edit"===this.tagViewMode?"更新失败,请重试":"保存失败,请重试");r.errMsg&&(r.errMsg.includes("timeout")?t="请求超时,请检查网络连接后重试":r.errMsg.includes("fail")&&(t="网络请求失败,请检查网络连接")),e.index.showToast({title:t,icon:"none",duration:3e3})}finally{e.index.hideLoading()}else e.index.showToast({title:"请输入标签名",icon:"none"})},initUrlHidingAfterPageLoad(){},attemptUrlHidingForCurrentPage(){},setupTabNavigationHiding(){},setupBrowserNavigationHiding(){}}};if(!Array){(e.resolveComponent("uni-nav-bar")+e.resolveComponent("service-list-furniture")+e.resolveComponent("common-begin-reception")+e.resolveComponent("uni-icons"))()}Math||((()=>"../../uni_modules/uni-nav-bar/components/uni-nav-bar/uni-nav-bar.js")+(()=>"../../uni_modules/uni-icons/components/uni-icons/uni-icons.js"))();const a=e._export_sfc(o,[["render",function(t,o,a,i,n,s){return e.e({a:e.o(s.goBack,"66"),b:e.p({fixed:!0,statusBar:!0,border:!1,title:"AI销冠系统",leftIcon:"left",color:"#333",backgroundColor:"#FFFFFF"}),c:"reception"===n.activeTab?1:"",d:e.o((e=>s.switchTab("reception")),"5d"),e:"status"===n.activeTab?1:"",f:e.o((e=>s.switchTab("status")),"a2"),g:"tag"===n.activeTab?1:"",h:e.o((e=>s.switchTab("tag")),"4c"),i:s.computedNavbarTop||n.navbarTop,j:"status"===n.activeTab},"status"===n.activeTab?{k:s.computedContentTop||n.contentTop}:{},{l:"reception"===n.activeTab},"reception"===n.activeTab?{m:e.o(s.onReceptionCancel,"4e"),n:e.o(s.onReceptionSaveSuccess,"82"),o:e.o(s.onReceptionSaveError,"79"),p:e.p({"initial-data":n.receptionForm})}:{},{q:"tag"===n.activeTab&&"list"===n.tagViewMode},"tag"===n.activeTab&&"list"===n.tagViewMode?e.e({r:e.t(n.tagTotal),s:e.o(((...e)=>s.onTagListSearch&&s.onTagListSearch(...e)),"b3"),t:n.tagQuery.tagType,v:e.o((e=>n.tagQuery.tagType=e.detail.value),"48"),w:e.o(((...e)=>s.onTagListSearch&&s.onTagListSearch(...e)),"13"),x:n.tagQuery.tagName,y:e.o((e=>n.tagQuery.tagName=e.detail.value),"c3"),z:e.p({type:"refresh",size:"18",color:"#2A68FF"}),A:e.o(((...e)=>s.onTagListRefresh&&s.onTagListRefresh(...e)),"fe"),B:e.p({type:"plus",size:"18",color:"#2A68FF"}),C:e.o(((...e)=>s.showAddTag&&s.showAddTag(...e)),"0b"),D:e.f(n.tagList,((t,o,a)=>e.e({a:e.t((t.tagName||t.name||"标").charAt(0)),b:e.t(t.tagName||t.name||"未命名标签"),c:e.o((e=>s.onTagItemClick(t)),o),d:"638dc4bb-5-"+a,e:e.o((e=>s.onTagActionBtnClick(t)),o),f:t.industry},t.industry?{g:e.t(t.industry)}:{},{h:e.o((e=>s.onTagItemClick(t)),o),i:t.tagDetail||t.detail||t.remark},t.tagDetail||t.detail||t.remark?e.e({j:t.tagDetail||t.detail},t.tagDetail||t.detail?{k:e.t(t.tagDetail||t.detail)}:{},{l:t.remark},t.remark?{m:e.t(t.remark)}:{},{n:e.o((e=>s.onTagItemClick(t)),o)}):{},{o:n.selectedTagItem&&n.selectedTagItem.id===t.id&&n.showTagActionMenu},n.selectedTagItem&&n.selectedTagItem.id===t.id&&n.showTagActionMenu?{p:e.o((e=>s.editTag(t)),o),q:e.o((e=>s.deleteTag(t)),o),r:e.o((()=>{}),o)}:{},{s:o,t:n.selectedTagItem&&n.selectedTagItem.id===t.id?1:""}))),E:e.p({type:"more-filled",size:"20",color:"#999"}),F:n.showTagActionMenu},n.showTagActionMenu?{G:e.o(((...e)=>s.closeTagActionMenu&&s.closeTagActionMenu(...e)),"46")}:{},{H:!n.tagLoading&&!n.tagList.length},(n.tagLoading||n.tagList.length,{}),{I:n.tagLoading&&n.tagList.length},(n.tagLoading&&n.tagList.length,{}),{J:s.computedContentTop||n.contentTop,K:e.o(((...e)=>s.onTagListReachBottom&&s.onTagListReachBottom(...e)),"9d")}):{},{L:"tag"===n.activeTab&&("add"===n.tagViewMode||"edit"===n.tagViewMode)},"tag"!==n.activeTab||"add"!==n.tagViewMode&&"edit"!==n.tagViewMode?{}:e.e({M:"add"===n.tagViewMode},"add"===n.tagViewMode?{N:n.tagForm.industry,O:e.o((e=>n.tagForm.industry=e.detail.value),"ac")}:{},{P:e.t(n.tagForm.tagType||"请选择标签分类"),Q:e.n(n.tagForm.tagType?"form-item__picker-text":"form-item__picker-placeholder"),R:e.p({type:"bottom",size:"16",color:"#9ca3af"}),S:e.o(((...e)=>s.toggleTagTypeDropdown&&s.toggleTagTypeDropdown(...e)),"ff"),T:n.showTagTypeDropdown},n.showTagTypeDropdown?{U:e.f(n.tagTypeOptions,((t,o,a)=>({a:e.t(t),b:t===n.tagForm.tagType?1:"",c:t,d:e.o((e=>s.selectTagType(t)),t)}))),V:e.o((()=>{}),"e2")}:{},{W:n.tagForm.name,X:e.o((e=>n.tagForm.name=e.detail.value),"9d"),Y:n.tagForm.detail,Z:e.o((e=>n.tagForm.detail=e.detail.value),"dd"),aa:n.tagForm.remark,ab:e.o((e=>n.tagForm.remark=e.detail.value),"d3"),ac:n.tagForm.enabled,ad:e.o(((...e)=>s.onEnabledChange&&s.onEnabledChange(...e)),"46"),ae:e.o(((...e)=>s.cancelAddTag&&s.cancelAddTag(...e)),"74"),af:e.t("edit"===n.tagViewMode?"更新":"保存"),ag:e.o(((...e)=>s.saveTag&&s.saveTag(...e)),"ce"),ah:n.showTagTypeDropdown},n.showTagTypeDropdown?{ai:e.o(((...e)=>s.closeTagTypeDropdown&&s.closeTagTypeDropdown(...e)),"6e")}:{},{aj:s.computedContentTop||n.contentTop}))}]]);wx.createComponent(a); +"use strict";const e=require("../../common/vendor.js"),t=require("../../common/config.js"),o={props:{incomingTab:{type:String,default:""}},components:{CommonBeginReception:()=>"./common_begin_reception.js",ServiceListFurniture:()=>"./serviceListFurniture.js"},data:()=>({activeTab:"status",navbarTop:"88rpx",contentTop:"160rpx",receptionForm:{id:"",customerName:"",contact:"",customerSource:"",gender:"女",age:"",dealershipId:"",dealershipName:"",salesId:"",salesName:"",salesPhone:"",recordingCount:0,intendedModel:"",infoCard:"",remark:"",detailedAddress:"",contactCount:0},tagViewMode:"list",tagList:[],tagLoading:!1,tagTotal:0,tagPage:{current:1,size:10},tagQuery:{industry:"",tagType:"",tagName:""},tagForm:{id:"",industry:"家居行业",tagType:"",name:"",detail:"",remark:"",enabled:!0},tagTypeOptions:["接待客户","质检SOP","客户画像"],showTagTypeDropdown:!1,selectedTagItem:null,showTagActionMenu:!1}),watch:{incomingTab:{immediate:!0,handler(e){this.applyIncomingTab(e)}}},computed:{computedNavbarTop(){console.log("[FurnitureReception][computedNavbarTop] 计算导航栏位置");const t=e.index.getSystemInfoSync().statusBarHeight||20,o=2*t+88,a=o+"rpx";return console.log("[FurnitureReception][computedNavbarTop] 计算结果:",{statusBarHeight:t,navbarHeight:44,totalNavbarHeight:o,result:a}),a},computedContentTop(){console.log("[FurnitureReception][computedContentTop] 计算内容区域位置");const t=e.index.getSystemInfoSync().statusBarHeight||20,o=2*t+88,a=o+72+"rpx";return console.log("[FurnitureReception][computedContentTop] 计算结果:",{statusBarHeight:t,navbarHeight:44,totalNavbarHeight:o,result:a}),a}},onLoad(){console.log("[FurnitureReception][onLoad] 页面加载"),this.updateNavbarPosition(),this.loadCurrentUserInfo()},onShow(){console.log("[FurnitureReception][onShow] 页面显示"),this.$nextTick((()=>{this.updateNavbarPosition(),setTimeout((()=>{this.updateNavbarPosition(),console.log("[FurnitureReception][onShow] 延迟更新后的位置:",{navbarTop:this.navbarTop,contentTop:this.contentTop,computedNavbarTop:this.computedNavbarTop,computedContentTop:this.computedContentTop})}),50)}))},onReady(){console.log("[FurnitureReception][onReady] 页面渲染完成"),console.log("[FurnitureReception][onReady] activeTab:",this.activeTab),console.log("[FurnitureReception][onReady] navbarTop:",this.navbarTop),console.log("[FurnitureReception][onReady] contentTop:",this.contentTop),console.log("[FurnitureReception][onReady] computedNavbarTop:",this.computedNavbarTop),console.log("[FurnitureReception][onReady] computedContentTop:",this.computedContentTop),this.updateNavbarPosition(),this.initUrlHidingAfterPageLoad();const t=e.index.getSystemInfoSync();console.log("[FurnitureReception][onReady] 系统信息:",{statusBarHeight:t.statusBarHeight,windowHeight:t.windowHeight,screenHeight:t.screenHeight}),setTimeout((()=>{e.index.createSelectorQuery().in(this).select(".tabs").boundingClientRect((e=>{console.log("[FurnitureReception][onReady] tab栏元素信息:",e),e?(console.log("[FurnitureReception][onReady] tab栏位置:",{top:e.top,left:e.left,width:e.width,height:e.height,expectedTop:this.navbarTop,computedNavbarTop:this.computedNavbarTop,isVisible:e.width>0&&e.height>0,isOnScreen:e.top>=0&&e.top{this.showTagTypeDropdown&&this.updateTagTypeDropdownPosition()}))},methods:{refreshPageData(){this.$nextTick((()=>{const e=this.$refs.serviceListRef;"status"===this.activeTab?e&&"function"==typeof e.onServiceStatusRefresh&&e.onServiceStatusRefresh():"tag"===this.activeTab&&"list"===this.tagViewMode&&this.fetchTagList({force:!0})}))},applyIncomingTab(e){["status","reception","tag"].includes(e)&&(this.activeTab!==e&&(this.activeTab=e),"reception"===e?this.resetReceptionForm():"tag"===e?(this.tagViewMode="list",this.fetchTagList({force:!0})):"status"===e&&this.$nextTick((()=>{this.refreshPageData()})))},updateNavbarPosition(){console.log("[FurnitureReception][updateNavbarPosition] 开始更新导航栏位置");const t=e.index.getSystemInfoSync().statusBarHeight||20,o=2*t+88,a=o+"rpx",i=o+72+"rpx";console.log("[FurnitureReception][updateNavbarPosition] 更新导航栏位置:",{statusBarHeight:t,navbarHeight:44,totalNavbarHeight:o,navbarTop:a,contentTop:i,currentNavbarTop:this.navbarTop,currentContentTop:this.contentTop}),this.$set(this,"navbarTop",a),this.$set(this,"contentTop",i),this.$forceUpdate()},loadCurrentUserInfo(){try{const t=e.index.getStorageSync("backend-login-response")||{};t.userName&&(this.receptionForm.salesName=t.userName),t.phone?this.receptionForm.salesPhone=t.phone:t.userName&&(this.receptionForm.salesPhone=t.userName),t.userId&&(this.receptionForm.salesId=String(t.userId))}catch(t){console.error("加载当前登录用户信息失败:",t)}},goBack(){getCurrentPages().length<=1?e.index.switchTab({url:"/pages/workbench/workbench",fail:e=>{console.error("[FurnitureReception][goBack] 切回工作台失败:",e)}}):e.index.navigateBack({fail:e=>{console.error("[FurnitureReception][goBack] 返回失败:",e)}})},switchTab(e){this.activeTab=e,"reception"===e?this.resetReceptionForm():"tag"===e&&(this.tagViewMode="list",this.fetchTagList())},resetReceptionForm(){this.receptionForm={id:"",customerName:"",contact:"",customerSource:"",gender:"女",age:"",dealershipId:"",dealershipName:"",salesId:"",salesName:"",salesPhone:"",recordingCount:0,intendedModel:"",infoCard:"",remark:"",detailedAddress:"",contactCount:0},this.loadCurrentUserInfo()},onReceptionCancel(){this.resetReceptionForm()},onReceptionSaveSuccess({action:e,data:t}){t&&(this.receptionForm={...this.receptionForm,...t}),this.resetReceptionForm(),"start"===e&&console.log("开始接待成功",t)},onReceptionSaveError({action:e,error:t}){console.error("保存失败:",t)},onTagListSearch(){"tag"!==this.activeTab&&(this.activeTab="tag"),this.tagPage.current=1,this.fetchTagList({force:!0})},onTagListRefresh(){this.tagPage.current=1,this.fetchTagList({force:!0})},onTagListReachBottom(){this.tagLoading||this.tagList.length>=this.tagTotal||(this.tagPage.current+=1,this.fetchTagList())},async fetchTagList({force:o=!1}={}){var a,i,n,s,r;if(!this.tagLoading||o){this.tagLoading=!0;try{const d={current:this.tagPage.current,size:this.tagPage.size},g=null==(i=null==(a=this.tagQuery)?void 0:a.tagType)?void 0:i.trim(),l=null==(s=null==(n=this.tagQuery)?void 0:n.tagName)?void 0:s.trim();g&&(d.tagType=g),l&&(d.tagName=l);const h=t.getApiUrl("/api/industryTags/list");let p="",u="";try{p=e.index.getStorageSync("backend-tenant-id")||"",u=e.index.getStorageSync("backend-token")||""}catch(c){console.error("获取认证信息失败:",c)}const T={"Content-Type":"application/json"};u&&(T.Authorization=`Bearer ${u}`),p&&(T["X-Tenant-Id"]=p);const m=await e.index.request({url:h,method:"POST",data:d,header:T,timeout:3e4});if(200===m.statusCode&&m.data&&m.data.success){const e=Array.isArray(m.data.data)?m.data.data:[];1===this.tagPage.current||o?this.tagList=e:this.tagList=this.tagList.concat(e),this.tagTotal=Number(m.data.total)||0}else this.tagList=[],this.tagTotal=0,e.index.showToast({title:(null==(r=m.data)?void 0:r.message)||"获取标签列表失败",icon:"none"})}catch(d){console.error("获取标签列表失败:",d);let t="获取标签列表失败,请稍后重试";d.errMsg&&(d.errMsg.includes("timeout")?t="请求超时,请检查网络连接后重试":d.errMsg.includes("fail")&&(t="网络请求失败,请检查网络连接")),e.index.showToast({title:t,icon:"none",duration:3e3})}finally{this.tagLoading=!1}}},showAddTag(){this.tagViewMode="add",this.showTagTypeDropdown=!1,this.tagForm={id:"",industry:"家居行业",tagType:"",name:"",detail:"",remark:"",enabled:!0}},onTagItemClick(e){},onTagActionBtnClick(e){this.selectedTagItem&&this.selectedTagItem.id===e.id&&this.showTagActionMenu?this.closeTagActionMenu():(this.selectedTagItem=e,this.showTagActionMenu=!0)},closeTagActionMenu(){this.showTagActionMenu=!1,this.selectedTagItem=null},editTag(e){this.closeTagActionMenu(),this.tagViewMode="edit",this.showTagTypeDropdown=!1,this.tagForm={id:e.id||"",industry:e.industry||"家居行业",tagType:e.tagType||"",name:e.tagName||e.name||"",detail:e.tagDetail||e.detail||"",remark:e.remark||"",enabled:void 0!==e.enabled?e.enabled:void 0===e.isEnabled||e.isEnabled}},async deleteTag(o){this.closeTagActionMenu();const a=o.id;a?e.index.showModal({title:"确认删除",content:`确定要删除标签"${o.tagName||o.name||"未命名标签"}"吗?`,success:async o=>{var i,n;if(o.confirm)try{e.index.showLoading({title:"删除中..."});const o=t.getApiUrl(`/api/industryTags/delete/${a}`);let r="",c="";try{r=e.index.getStorageSync("backend-tenant-id")||"",c=e.index.getStorageSync("backend-token")||""}catch(s){console.error("获取认证信息失败:",s)}const d={};c&&(d.Authorization=`Bearer ${c}`),r&&(d["X-Tenant-Id"]=r);const g=await e.index.request({url:o,method:"DELETE",header:d,timeout:3e4});e.index.hideLoading(),200===g.statusCode&&g.data&&g.data.success?(e.index.showToast({title:(null==(i=g.data)?void 0:i.message)||"删除成功",icon:"success"}),this.tagPage.current=1,this.fetchTagList({force:!0})):e.index.showToast({title:(null==(n=g.data)?void 0:n.message)||"删除失败",icon:"none"})}catch(r){e.index.hideLoading(),console.error("删除标签失败:",r);let t="删除失败,请重试";r.errMsg&&(r.errMsg.includes("timeout")?t="请求超时,请检查网络连接后重试":r.errMsg.includes("fail")&&(t="网络请求失败,请检查网络连接")),e.index.showToast({title:t,icon:"none",duration:3e3})}}}):e.index.showToast({title:"无法获取标签ID",icon:"none"})},cancelAddTag(){this.tagViewMode="list",this.showTagTypeDropdown=!1,this.tagForm={id:"",industry:"家居行业",tagType:"",name:"",detail:"",remark:"",enabled:!0}},toggleTagTypeDropdown(){this.showTagTypeDropdown=!this.showTagTypeDropdown,this.showTagTypeDropdown&&this.$nextTick((()=>{this.updateTagTypeDropdownPosition()}))},updateTagTypeDropdownPosition(){e.index.createSelectorQuery().in(this).select(".tag-select").boundingClientRect((e=>{if(e){const t=this.$refs.tagTypeDropdown;t&&this.$nextTick((()=>{const o=t.$el||t;o&&o.style&&(o.style.top=e.bottom+8+"px",o.style.left=e.left+"px",o.style.width=e.width+"px")}))}})).exec()},selectTagType(e){this.tagForm.tagType=e,this.showTagTypeDropdown=!1},closeTagTypeDropdown(){this.showTagTypeDropdown=!1},onEnabledChange(e){this.tagForm.enabled=e.detail.value},async saveTag(){var o,a,i,n;if(this.tagForm.name&&this.tagForm.name.trim())try{e.index.showLoading({title:"edit"===this.tagViewMode?"更新中...":"保存中..."});const r={industry:(null==(o=this.tagForm.industry)?void 0:o.trim())||"",tagType:(null==(a=this.tagForm.tagType)?void 0:a.trim())||"",tagName:this.tagForm.name.trim(),tagDetail:(null==(i=this.tagForm.detail)?void 0:i.trim())||"",remark:(null==(n=this.tagForm.remark)?void 0:n.trim())||"",enabled:void 0===this.tagForm.enabled||this.tagForm.enabled};"edit"===this.tagViewMode&&this.tagForm.id&&(r.id=this.tagForm.id);const c="edit"===this.tagViewMode?t.getApiUrl("/api/industryTags/update"):t.getApiUrl("/api/industryTags/add"),d="edit"===this.tagViewMode?"PUT":"POST";let g="",l="";try{g=e.index.getStorageSync("backend-tenant-id")||"",l=e.index.getStorageSync("backend-token")||""}catch(s){console.error("获取认证信息失败:",s)}const h={"Content-Type":"application/json"};l&&(h.Authorization=`Bearer ${l}`),g&&(h["X-Tenant-Id"]=g);const p=await e.index.request({url:c,method:d,data:r,header:h,timeout:3e4}),{statusCode:u,data:T}=p;if(200!==u||!T||!T.success&&200!==T.code)throw new Error((null==T?void 0:T.message)||("edit"===this.tagViewMode?"更新失败":"保存失败"));e.index.showToast({title:(null==T?void 0:T.message)||("edit"===this.tagViewMode?"更新成功":"保存成功"),icon:"success"}),this.tagViewMode="list",this.tagPage.current=1,this.fetchTagList({force:!0})}catch(r){console.error("保存标签失败:",r);let t=(null==r?void 0:r.message)||("edit"===this.tagViewMode?"更新失败,请重试":"保存失败,请重试");r.errMsg&&(r.errMsg.includes("timeout")?t="请求超时,请检查网络连接后重试":r.errMsg.includes("fail")&&(t="网络请求失败,请检查网络连接")),e.index.showToast({title:t,icon:"none",duration:3e3})}finally{e.index.hideLoading()}else e.index.showToast({title:"请输入标签名",icon:"none"})},initUrlHidingAfterPageLoad(){},attemptUrlHidingForCurrentPage(){},setupTabNavigationHiding(){},setupBrowserNavigationHiding(){}}};if(!Array){(e.resolveComponent("uni-nav-bar")+e.resolveComponent("service-list-furniture")+e.resolveComponent("common-begin-reception")+e.resolveComponent("uni-icons"))()}Math||((()=>"../../uni_modules/uni-nav-bar/components/uni-nav-bar/uni-nav-bar.js")+(()=>"../../uni_modules/uni-icons/components/uni-icons/uni-icons.js"))();const a=e._export_sfc(o,[["render",function(t,o,a,i,n,s){return e.e({a:e.o(s.goBack,"66"),b:e.p({fixed:!0,statusBar:!0,border:!1,title:"AI销冠系统",leftIcon:"left",color:"#333",backgroundColor:"#FFFFFF"}),c:"reception"===n.activeTab?1:"",d:e.o((e=>s.switchTab("reception")),"5d"),e:"status"===n.activeTab?1:"",f:e.o((e=>s.switchTab("status")),"a2"),g:"tag"===n.activeTab?1:"",h:e.o((e=>s.switchTab("tag")),"4c"),i:s.computedNavbarTop||n.navbarTop,j:"status"===n.activeTab},"status"===n.activeTab?{k:e.sr("serviceListRef","638dc4bb-1"),l:s.computedContentTop||n.contentTop}:{},{m:"reception"===n.activeTab},"reception"===n.activeTab?{n:e.o(s.onReceptionCancel,"be"),o:e.o(s.onReceptionSaveSuccess,"03"),p:e.o(s.onReceptionSaveError,"cf"),q:e.p({"initial-data":n.receptionForm})}:{},{r:"tag"===n.activeTab&&"list"===n.tagViewMode},"tag"===n.activeTab&&"list"===n.tagViewMode?e.e({s:e.t(n.tagTotal),t:e.o(((...e)=>s.onTagListSearch&&s.onTagListSearch(...e)),"e9"),v:n.tagQuery.tagType,w:e.o((e=>n.tagQuery.tagType=e.detail.value),"2d"),x:e.o(((...e)=>s.onTagListSearch&&s.onTagListSearch(...e)),"02"),y:n.tagQuery.tagName,z:e.o((e=>n.tagQuery.tagName=e.detail.value),"a5"),A:e.p({type:"refresh",size:"18",color:"#2A68FF"}),B:e.o(((...e)=>s.onTagListRefresh&&s.onTagListRefresh(...e)),"bb"),C:e.p({type:"plus",size:"18",color:"#2A68FF"}),D:e.o(((...e)=>s.showAddTag&&s.showAddTag(...e)),"a9"),E:e.f(n.tagList,((t,o,a)=>e.e({a:e.t((t.tagName||t.name||"标").charAt(0)),b:e.t(t.tagName||t.name||"未命名标签"),c:e.o((e=>s.onTagItemClick(t)),o),d:"638dc4bb-5-"+a,e:e.o((e=>s.onTagActionBtnClick(t)),o),f:t.industry},t.industry?{g:e.t(t.industry)}:{},{h:e.o((e=>s.onTagItemClick(t)),o),i:t.tagDetail||t.detail||t.remark},t.tagDetail||t.detail||t.remark?e.e({j:t.tagDetail||t.detail},t.tagDetail||t.detail?{k:e.t(t.tagDetail||t.detail)}:{},{l:t.remark},t.remark?{m:e.t(t.remark)}:{},{n:e.o((e=>s.onTagItemClick(t)),o)}):{},{o:n.selectedTagItem&&n.selectedTagItem.id===t.id&&n.showTagActionMenu},n.selectedTagItem&&n.selectedTagItem.id===t.id&&n.showTagActionMenu?{p:e.o((e=>s.editTag(t)),o),q:e.o((e=>s.deleteTag(t)),o),r:e.o((()=>{}),o)}:{},{s:o,t:n.selectedTagItem&&n.selectedTagItem.id===t.id?1:""}))),F:e.p({type:"more-filled",size:"20",color:"#999"}),G:n.showTagActionMenu},n.showTagActionMenu?{H:e.o(((...e)=>s.closeTagActionMenu&&s.closeTagActionMenu(...e)),"0a")}:{},{I:!n.tagLoading&&!n.tagList.length},(n.tagLoading||n.tagList.length,{}),{J:n.tagLoading&&n.tagList.length},(n.tagLoading&&n.tagList.length,{}),{K:s.computedContentTop||n.contentTop,L:e.o(((...e)=>s.onTagListReachBottom&&s.onTagListReachBottom(...e)),"89")}):{},{M:"tag"===n.activeTab&&("add"===n.tagViewMode||"edit"===n.tagViewMode)},"tag"!==n.activeTab||"add"!==n.tagViewMode&&"edit"!==n.tagViewMode?{}:e.e({N:"add"===n.tagViewMode},"add"===n.tagViewMode?{O:n.tagForm.industry,P:e.o((e=>n.tagForm.industry=e.detail.value),"73")}:{},{Q:e.t(n.tagForm.tagType||"请选择标签分类"),R:e.n(n.tagForm.tagType?"form-item__picker-text":"form-item__picker-placeholder"),S:e.p({type:"bottom",size:"16",color:"#9ca3af"}),T:e.o(((...e)=>s.toggleTagTypeDropdown&&s.toggleTagTypeDropdown(...e)),"d4"),U:n.showTagTypeDropdown},n.showTagTypeDropdown?{V:e.f(n.tagTypeOptions,((t,o,a)=>({a:e.t(t),b:t===n.tagForm.tagType?1:"",c:t,d:e.o((e=>s.selectTagType(t)),t)}))),W:e.o((()=>{}),"85")}:{},{X:n.tagForm.name,Y:e.o((e=>n.tagForm.name=e.detail.value),"c7"),Z:n.tagForm.detail,aa:e.o((e=>n.tagForm.detail=e.detail.value),"ab"),ab:n.tagForm.remark,ac:e.o((e=>n.tagForm.remark=e.detail.value),"05"),ad:n.tagForm.enabled,ae:e.o(((...e)=>s.onEnabledChange&&s.onEnabledChange(...e)),"8c"),af:e.o(((...e)=>s.cancelAddTag&&s.cancelAddTag(...e)),"f8"),ag:e.t("edit"===n.tagViewMode?"更新":"保存"),ah:e.o(((...e)=>s.saveTag&&s.saveTag(...e)),"52"),ai:n.showTagTypeDropdown},n.showTagTypeDropdown?{aj:e.o(((...e)=>s.closeTagTypeDropdown&&s.closeTagTypeDropdown(...e)),"07")}:{},{ak:s.computedContentTop||n.contentTop}))}]]);wx.createComponent(a); diff --git a/unpackage/dist/build/mp-weixin/pages-subpackage/furniture_reception/furniture_reception-impl.wxml b/unpackage/dist/build/mp-weixin/pages-subpackage/furniture_reception/furniture_reception-impl.wxml index e40d7dc..a1b6e11 100644 --- a/unpackage/dist/build/mp-weixin/pages-subpackage/furniture_reception/furniture_reception-impl.wxml +++ b/unpackage/dist/build/mp-weixin/pages-subpackage/furniture_reception/furniture_reception-impl.wxml @@ -1 +1 @@ -开始接待服务中标签管理共{{r}}条{{item.a}}{{item.b}}所属行业:{{item.g}}详情:{{item.k}}备注:{{item.m}}编辑删除暂无标签正在加载更多...所属行业标签分类{{P}}{{option.a}}标签名详情