From b53b0b4c64b499238484bba50ce56a02d687bdc9 Mon Sep 17 00:00:00 2001 From: zeyan <258785420@qq.com> Date: Fri, 1 Aug 2025 12:07:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/student/StudentController.php | 17 ++++++++++++ .../service/api/student/StudentService.php | 13 ++++++++++ uniapp/common/config.js | 4 +-- .../client-info-card/client-info-card.vue | 11 ++++++-- uniapp/pages-market/clue/clue_info.vue | 5 ++-- uniapp/pages-student/child/add.vue | 9 ++++--- uniapp/pages.json | 26 +++++++++---------- uniapp/pages/common/home/index.vue | 5 ---- uniapp/pages/student/home/index.vue | 9 +------ uniapp/pages/student/login/login.vue | 4 +-- 10 files changed, 66 insertions(+), 37 deletions(-) diff --git a/niucloud/app/api/controller/student/StudentController.php b/niucloud/app/api/controller/student/StudentController.php index 994e570f..bb6be18d 100644 --- a/niucloud/app/api/controller/student/StudentController.php +++ b/niucloud/app/api/controller/student/StudentController.php @@ -301,4 +301,21 @@ class StudentController extends BaseController return fail($e->getMessage()); } } + + /** + * 获取学员标签列表 + * @param Request $request + */ + public function getStudentTagList(Request $request) + { + try { + $service = new StudentService(); + $result = $service->getStudentTagList(); + + return success($result); + + } catch (\Exception $e) { + return fail($e->getMessage()); + } + } } \ No newline at end of file diff --git a/niucloud/app/service/api/student/StudentService.php b/niucloud/app/service/api/student/StudentService.php index 97ed2119..76b62db2 100644 --- a/niucloud/app/service/api/student/StudentService.php +++ b/niucloud/app/service/api/student/StudentService.php @@ -8,6 +8,7 @@ namespace app\service\api\student; use app\model\customer_resources\CustomerResources; use app\model\student\Student; use app\model\member\Member; +use app\model\student_label\StudentLabel; use think\facade\Db; use core\base\BaseService; use core\exception\CommonException; @@ -660,4 +661,16 @@ class StudentService extends BaseService // 如果都没有,抛出异常 throw new CommonException('用户未登录'); } + + /** + * 学员标签 + * @return array + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + */ + public function getStudentTagList() + { + return (new StudentLabel())->order('sort desc,create_time desc')->select()->toArray(); + } } \ No newline at end of file diff --git a/uniapp/common/config.js b/uniapp/common/config.js index 2459f37b..c98a2253 100644 --- a/uniapp/common/config.js +++ b/uniapp/common/config.js @@ -1,6 +1,6 @@ // 环境变量配置 -// const env = 'development' -const env = 'prod' +const env = 'development' +// const env = 'prod' const isMockEnabled = false // 默认禁用Mock优先模式,仅作为回退 const isDebug = false // 默认启用调试模式 const devurl = 'http://localhost:20080/api' diff --git a/uniapp/components/client-info-card/client-info-card.vue b/uniapp/components/client-info-card/client-info-card.vue index b71133db..5c5fe555 100644 --- a/uniapp/components/client-info-card/client-info-card.vue +++ b/uniapp/components/client-info-card/client-info-card.vue @@ -17,8 +17,8 @@ 📞 - - {{ actionsExpanded ? '▲' : '▼' }} + + 💬 @@ -89,6 +89,13 @@ export default { handleAction(action) { this.$emit('action', { action, client: this.clientInfo }) + }, + + handleSendMessage() { + this.$util.navigateToPage('/pages-common/im_chat_info', { + from_id: uni.getStorageSync('userInfo').id, + to_id: this.$util.safeGet(this.clientInfo, 'customerResource.id', '') + }) } } } diff --git a/uniapp/pages-market/clue/clue_info.vue b/uniapp/pages-market/clue/clue_info.vue index 21e0060c..0e067e2b 100644 --- a/uniapp/pages-market/clue/clue_info.vue +++ b/uniapp/pages-market/clue/clue_info.vue @@ -357,7 +357,8 @@ export default { { id: 1, name: '基本资料' }, { id: 3, name: '通话记录' }, { id: 7, name: '修改资料' }, - { id: 6, name: '修改记录' } + { id: 6, name: '修改记录' }, + { id: 8, name: '赠品记录' } ], actionButtons: [ @@ -905,7 +906,7 @@ export default { if (!labelId) return [] // TODO: 调用接口获取student_label表中的标签名称 - // const res = await apiRoute.getStudentLabel({ id: labelId }) + const res = await apiRoute.getStudentLabel({ id: labelId }) // 模拟数据 const labelMap = { diff --git a/uniapp/pages-student/child/add.vue b/uniapp/pages-student/child/add.vue index cc91443a..97e36b2a 100644 --- a/uniapp/pages-student/child/add.vue +++ b/uniapp/pages-student/child/add.vue @@ -33,7 +33,8 @@ 姓名 - 紧急联系人 - 联系电话 - 我的孩子 - + {{ studentList.length > 1 ? '切换' : '学员' }} ({{ studentList.length }}) @@ -322,13 +322,6 @@ }, openStudentPopup() { - if (this.studentList.length === 0) { - uni.showToast({ - title: '暂无学员信息', - icon: 'none' - }) - return - } this.showStudentPopup = true }, diff --git a/uniapp/pages/student/login/login.vue b/uniapp/pages/student/login/login.vue index 41f08969..8a111213 100644 --- a/uniapp/pages/student/login/login.vue +++ b/uniapp/pages/student/login/login.vue @@ -759,8 +759,8 @@ // 检查是否为tabBar页面,使用对应的跳转方法 const tabBarPages = [ - '/pages/student/home/index', - '/pages/student/profile/index' + '/pages/common/home/index', + '/pages/common/profile/index' ]; if (tabBarPages.includes(openPath)) {