diff --git a/App.vue b/App.vue index 5990fbc..71049d4 100644 --- a/App.vue +++ b/App.vue @@ -242,7 +242,7 @@ export default { .catch((err) => { }); //初始化获取定位 - this.getLocation() + // this.getLocation() } else { setTimeout(() => { this.CharLogin() diff --git a/common/http.api.js b/common/http.api.js index b412aaa..24fd3bf 100644 --- a/common/http.api.js +++ b/common/http.api.js @@ -90,6 +90,9 @@ const install = (Vue, vm) => { //【管理端】获取当前是否开启匿名 开启true 关闭false let CheckNM = (params = {}) => vm.$u.get("/app/My/CheckNM", params) + // 发送消息 + let SendMessageApi = (params = {}) => vm.$u.post('api/ChatAI/CreateChat', params); + // 将各个定义的接口名称,统一放进对象挂载到vm.$u.api(因为vm就是this,也即this.$u.api)下 vm.$u.api = { LoginApp, @@ -128,7 +131,8 @@ const install = (Vue, vm) => { getAPIToken, getVerifyInfo, getInfoByCard, - updateCard + updateCard, + SendMessageApi }; } diff --git a/common/http.interceptor.js b/common/http.interceptor.js index 53b347e..7c5c0eb 100644 --- a/common/http.interceptor.js +++ b/common/http.interceptor.js @@ -4,8 +4,8 @@ const install = (Vue, vm) => { Vue.prototype.$u.http.setConfig({ // baseUrl: 'https://xy.apps.service.zheke.com', // imgUrl: 'https://xy.apps.service.zheke.com/', - baseUrl: 'http://sl.vrgon.com:8003', - imgUrl: 'http://sl.vrgon.com:8003/', + baseUrl: 'http://120.55.234.65:8082', + imgUrl: 'http://120.55.234.65:8082/', // imgUrl:'http://115.238.47.235:8987/', // baseUrl: 'http://115.238.47.235:8993', // 如果将此值设置为true,拦截回调中将会返回服务端返回的所有数据response,而不是response.data diff --git a/pages/home/index/index.vue b/pages/home/index/index.vue index dca6527..54206d1 100644 --- a/pages/home/index/index.vue +++ b/pages/home/index/index.vue @@ -156,7 +156,10 @@ - + 招生在线 - + 留言板 - + - + + + + @@ -323,27 +337,46 @@ export default { ], scrollToView: "", messageGroups: [ + // { + // time: "2025-07-01 10:00:00", + // messages: [ + // { id: 1, content: "学校哪些专业比较好?", isUser: true }, + // { + // id: 2, + // content: + // "我校有多个优势学科,包括计算机科学与技术、电子信息工程、机械工程、生物医学工程等。这些专业在国内都有较高的学术声誉和就业率。如果您对某个具体专业感兴趣,可以进一步咨询更多详情。", + // isUser: false, + // }, + // { id: 3, content: "计算机科学专业就业前景如何?", isUser: true }, + // { + // id: 4, + // content: + // "计算机科学专业的就业前景非常好。根据最新数据,我校计算机专业毕业生就业率超过95%,平均起薪在全校名列前茅。主要就业方向包括互联网公司、IT企业、金融科技等领域,担任软件工程师、数据分析师、产品经理等职位。", + // isUser: false, + // }, + // ], + // }, + // { + // time: "2025-07-02 09:15:36", + // messages: [ + // { id: 5, content: "新生报到流程", isUser: true }, + // { + // id: 6, + // content: + // "新生报到流程:个人信息完善 --预报到 -- 照片信息采集 --缴费 --入校验审 -- 人脸识别 --打印报到单", + // isUser: false, + // }, + // { id: 7, content: "预报到需要准备哪些材料?", isUser: true }, + // { + // id: 8, + // content: + // "预报到需要准备以下材料:\n1. 身份证原件及复印件\n2. 录取通知书原件\n3. 2寸蓝底证件照4张\n4. 学籍档案(密封)\n5. 党团关系材料(如有)\n\n建议提前准备齐全,以便快速完成报到流程。", + // isUser: false, + // }, + // ], + // }, { - time: "2025-07-01 10:00:00", - messages: [ - { id: 1, content: "学校哪些专业比较好?", isUser: true }, - { - id: 2, - content: - "我校有多个优势学科,包括计算机科学与技术、电子信息工程、机械工程、生物医学工程等。这些专业在国内都有较高的学术声誉和就业率。如果您对某个具体专业感兴趣,可以进一步咨询更多详情。", - isUser: false, - }, - { id: 3, content: "计算机科学专业就业前景如何?", isUser: true }, - { - id: 4, - content: - "计算机科学专业的就业前景非常好。根据最新数据,我校计算机专业毕业生就业率超过95%,平均起薪在全校名列前茅。主要就业方向包括互联网公司、IT企业、金融科技等领域,担任软件工程师、数据分析师、产品经理等职位。", - isUser: false, - }, - ], - }, - { - time: "2025-07-02 09:15:36", + time: "", messages: [ { id: 5, content: "新生报到流程", isUser: true }, { @@ -352,17 +385,12 @@ export default { "新生报到流程:个人信息完善 --预报到 -- 照片信息采集 --缴费 --入校验审 -- 人脸识别 --打印报到单", isUser: false, }, - { id: 7, content: "预报到需要准备哪些材料?", isUser: true }, - { - id: 8, - content: - "预报到需要准备以下材料:\n1. 身份证原件及复印件\n2. 录取通知书原件\n3. 2寸蓝底证件照4张\n4. 学籍档案(密封)\n5. 党团关系材料(如有)\n\n建议提前准备齐全,以便快速完成报到流程。", - isUser: false, - }, ], }, ], scrollTop: 0, + + messageValue: "", // 输入框内容 }; }, watch: { @@ -389,6 +417,12 @@ export default { }, methods: { handleLeftClick() { + this.$refs.uToast.show({ + title: "暂未开放", + type: "warning", + }); + + return; this.popupShow = true; }, selectChatItem(index) { @@ -422,19 +456,58 @@ export default { handleFeatureClick(item) { if (item.title === "电话咨询") { this.advicePhoneShow = true; - } else if (item.title === "招办在线") { - uni.navigateTo({ - url: "/pages/home/admissions/index", + } else { + this.$refs.uToast.show({ + title: "暂未开放", + type: "warning", }); - } else if (item.title === "留言板") { - // this.leaveMessageShow = true; + + return; } }, + + sendMessageFn() { + if (!this.messageValue) { + return; + } + + const sendMessage = this.messageValue; + + console.log("发送消息", sendMessage); + this.messageGroups[0].messages.push({ + id: this.messageGroups[0].messages.length + 1, + content: sendMessage, + isUser: true, + }); + this.messageValue = ""; + + this.$u.api + .SendMessageApi({ + query: sendMessage, + conversationId: "", + }) + .then((res) => { + console.log("res.....", res); + this.messageGroups[0].messages.push({ + id: res.messageId, + content: res.content, + isUser: false, + }); + }); + }, }, };