diff --git a/api/robot.js b/api/robot.js new file mode 100644 index 0000000..398281b --- /dev/null +++ b/api/robot.js @@ -0,0 +1,11 @@ +import request from '../utils/request.js' + +export const search = (title) => { + return request({ + url: "/robot", + method: "get", + data: { + title + } + }) +} \ No newline at end of file diff --git a/app.json b/app.json index 765f861..e5f93d0 100644 --- a/app.json +++ b/app.json @@ -17,7 +17,8 @@ "pages/robot/robot", "pages/my-children/my-children", "pages/student-grade-trend/student-grade-trend", - "pages/student-need-concerning/student-need-concerning" + "pages/student-need-concerning/student-need-concerning", + "pages/question/question" ], "window": { "backgroundTextStyle": "light", diff --git a/pages/account-doc-info/account-doc-info.js b/pages/account-doc-info/account-doc-info.js index 9dcfd7c..cf4c48c 100644 --- a/pages/account-doc-info/account-doc-info.js +++ b/pages/account-doc-info/account-doc-info.js @@ -133,5 +133,12 @@ Page({ */ onShareAppMessage: function () { + }, + + onClickQuestion() { + // 跳转 + wx.navigateTo({ + url: '/pages/question/question' + }) } }) \ No newline at end of file diff --git a/pages/account-doc-info/account-doc-info.wxml b/pages/account-doc-info/account-doc-info.wxml index bb9e28a..712f12a 100644 --- a/pages/account-doc-info/account-doc-info.wxml +++ b/pages/account-doc-info/account-doc-info.wxml @@ -23,7 +23,7 @@ - 修改 + 反映问题 @@ -70,7 +70,7 @@ - 反映问题 + 反映问题 diff --git a/pages/account-relation-info/account-relation-info.js b/pages/account-relation-info/account-relation-info.js index 1b6972f..96f7f18 100644 --- a/pages/account-relation-info/account-relation-info.js +++ b/pages/account-relation-info/account-relation-info.js @@ -9,7 +9,8 @@ Page({ data: { parentsInfo: [], childrenInfo: [], - supervisorsInfo: [] + supervisorsInfo: [], + noRecord: false }, /** @@ -60,6 +61,12 @@ Page({ supervisorsInfo: res }) }) + }).finally(res => { + if(this.data.supervisorsInfo.length === 0 && this.data.childrenInfo.length === 0 && this.data.parentsInfo.length === 0) { + this.setData({ + noRecord: true + }) + } }) }, @@ -110,5 +117,12 @@ Page({ */ onShareAppMessage: function () { + }, + + onClickQuestion() { + // 跳转 + wx.navigateTo({ + url: '/pages/question/question' + }) } }) \ No newline at end of file diff --git a/pages/account-relation-info/account-relation-info.json b/pages/account-relation-info/account-relation-info.json index 8835af0..207522e 100644 --- a/pages/account-relation-info/account-relation-info.json +++ b/pages/account-relation-info/account-relation-info.json @@ -1,3 +1,5 @@ { - "usingComponents": {} + "usingComponents": { + "i-spin": "../../dist/spin/index" + } } \ No newline at end of file diff --git a/pages/account-relation-info/account-relation-info.wxml b/pages/account-relation-info/account-relation-info.wxml index 10a2759..7c77733 100644 --- a/pages/account-relation-info/account-relation-info.wxml +++ b/pages/account-relation-info/account-relation-info.wxml @@ -35,7 +35,7 @@ - 反映问题 + 反映问题 @@ -58,7 +58,7 @@ - 反映问题 + 反映问题 @@ -93,9 +93,9 @@ - 反映问题 + 反映问题 - + 没有发现相关信息 diff --git a/pages/bind-document/bind-document.js b/pages/bind-document/bind-document.js index c1a6cda..eea3583 100644 --- a/pages/bind-document/bind-document.js +++ b/pages/bind-document/bind-document.js @@ -22,9 +22,9 @@ Page({ document: null, showDocument: false, toast: false, - hideToast: true, + hideToast: false, warnToast: false, - hideWarnToast: true, + hideWarnToast: false, warnText: '', }, @@ -138,27 +138,29 @@ Page({ toast: false, hideToast: false, }); - // 绑定成功后,跳转进入小程序首页 - wx.navigateTo({ - url: '/pages/index/index' - }) }, 300); }, 3000); + }).then(res => { + // 绑定成功后,跳转进入小程序首页 + wx.navigateTo({ + url: '/pages/index/index' + }) }).catch(err =>{ console.log(err) this.setData({ warnToast: true, warnText: '绑定失败' - }); + }) + }).then(res => { setTimeout(() => { this.setData({ - hidewarnToast: true, + hideWarnToast: true, }); setTimeout(() => { this.setData({ warnToast: false, - hidewarnToast: false, + hideWarnToast: false, }); }, 300); }, 3000); @@ -219,7 +221,8 @@ Page({ this.setData({ warnToast: true, warnText: '未找到对应档案' - }); + }) + }).then(res => { setTimeout(() => { this.setData({ hidewarnToast: true, @@ -227,7 +230,7 @@ Page({ setTimeout(() => { this.setData({ warnToast: false, - hidewarnToast: false, + hideWarnToast: false, }); }, 300); }, 3000); diff --git a/pages/bind-document/bind-document.wxml b/pages/bind-document/bind-document.wxml index 9f914e6..4420701 100644 --- a/pages/bind-document/bind-document.wxml +++ b/pages/bind-document/bind-document.wxml @@ -1,130 +1,131 @@ - - - -

绑定您的个人档案

- 在这里将您的账户与您在学院留存的档案绑定,以便确认您的身份。绑定完成后,系统将通过档案获知您的账号与其他账号的关系。 -
- -

确认您的档案信息

- 您的档案已找到,请确认这是属于您的档案。确认无误后,点击绑定按钮完成绑定流程。 如果有误的,请重新查询。 -
-
+ - - - 账号类型 - - - - - + + +

绑定您的个人档案

+ 在这里将您的账户与您在学院留存的档案绑定,以便确认您的身份。绑定完成后,系统将通过档案获知您的账号与其他账号的关系。
- - 档案口令 - - - - - + +

确认您的档案信息

+ 您的档案已找到,请确认这是属于您的档案。确认无误后,点击绑定按钮完成绑定流程。 如果有误的,请重新查询。 +
+
+ + + + 账号类型 + + + + + + + + 档案口令 + + + + + + + + 档案信息 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 查询档案 + + + 重新查询 + 绑定 + + + + + + + {{warnText}} + + + + + + + + 已完成 - - 档案信息 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - 查询档案 - - - 重新查询 - 绑定 - - - - - - - {{warnText}} - - - - - - - - 已完成 - - -
diff --git a/pages/bind-document/bind-document.wxss b/pages/bind-document/bind-document.wxss index 438029c..1f3db37 100644 --- a/pages/bind-document/bind-document.wxss +++ b/pages/bind-document/bind-document.wxss @@ -1 +1,3 @@ -/* pages/bind-document.wxss */ \ No newline at end of file +/* pages/bind-document.wxss */ +.page{height:100%} +.page{background-color:var(--weui-BG-2)} \ No newline at end of file diff --git a/pages/get-user-info/get-user-info.wxml b/pages/get-user-info/get-user-info.wxml index 9a2536e..a58be1b 100644 --- a/pages/get-user-info/get-user-info.wxml +++ b/pages/get-user-info/get-user-info.wxml @@ -1,11 +1,14 @@ - - -

个人信息授权

- 我们需要您进行基本信息授权,我们将用这些信息以初始化您的账户。 -
- - - - + + + +

个人信息授权

+ 我们需要您进行基本信息授权,我们将用这些信息以初始化您的账户。 +
+ + + + +
+
diff --git a/pages/get-user-info/get-user-info.wxss b/pages/get-user-info/get-user-info.wxss index 7f7336f..79407e3 100644 --- a/pages/get-user-info/get-user-info.wxss +++ b/pages/get-user-info/get-user-info.wxss @@ -1 +1,2 @@ -/* pages/get-user-info/get-user-info.wxss */ \ No newline at end of file +/* pages/get-user-info/get-user-info.wxss */ +.page{height:100%} \ No newline at end of file diff --git a/pages/index/index.js b/pages/index/index.js index 1c74f47..e301f71 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -287,5 +287,10 @@ Page({ wx.navigateTo({ url: '/pages/my-children/my-children?openid=' + query }) + }, + bindRobot(){ + wx.navigateTo({ + url: '/pages/robot/robot' + }) } }) diff --git a/pages/index/index.wxml b/pages/index/index.wxml index 8ab4809..2e0255a 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -56,11 +56,10 @@ 收到的消息 - 32 - + 问答机器人 diff --git a/pages/my-students/my-students.js b/pages/my-students/my-students.js index ebe668e..787f287 100644 --- a/pages/my-students/my-students.js +++ b/pages/my-students/my-students.js @@ -113,11 +113,13 @@ Page({ this.setData({ inputVal }); - searchStudents(inputVal).then(res => { - console.log(res) - this.setData({ - searchStudentsList: res + if(inputVal.length > 0) { + searchStudents(inputVal).then(res => { + console.log(res) + this.setData({ + searchStudentsList: res + }) }) - }) + } } }) \ No newline at end of file diff --git a/pages/question/question.js b/pages/question/question.js new file mode 100644 index 0000000..f04ed53 --- /dev/null +++ b/pages/question/question.js @@ -0,0 +1,79 @@ +// pages/question/question.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + textLength: 0 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + }, + + inputTyping: function (e) { + let inputVal = e.detail.value + this.setData({ + inputVal, + textLength: inputVal.length + }); + + + if(inputVal.length > 0) { + + } + }, +}) \ No newline at end of file diff --git a/pages/question/question.json b/pages/question/question.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/question/question.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/question/question.wxml b/pages/question/question.wxml new file mode 100644 index 0000000..cfacc6d --- /dev/null +++ b/pages/question/question.wxml @@ -0,0 +1,25 @@ + + + +

给系统维护者留言

+ 您的留言将发给系统维护者的账户,TA将评估并解决您的问题 +
+ + + 给系统维护者留言 + + + + + {{textLength}}/200 + + + + + + + 发送 + +
+ +
diff --git a/pages/question/question.wxss b/pages/question/question.wxss new file mode 100644 index 0000000..60ddd68 --- /dev/null +++ b/pages/question/question.wxss @@ -0,0 +1 @@ +/* pages/question/question.wxss */ \ No newline at end of file diff --git a/pages/robot/robot.js b/pages/robot/robot.js index 0a24781..6cd94a0 100644 --- a/pages/robot/robot.js +++ b/pages/robot/robot.js @@ -1,11 +1,17 @@ // pages/robot/robot.js +import {search} from '../../api/robot' + Page({ /** * 页面的初始数据 */ data: { - + inputShowed: false, + inputVal: "", + searchStudentsList: [], + targetAnswer: {}, + showAnswer: false }, /** @@ -62,5 +68,62 @@ Page({ */ onShareAppMessage: function () { + }, + + showInput: function () { + this.setData({ + inputShowed: true + }); + }, + + hideInput: function () { + this.setData({ + inputVal: "", + inputShowed: false + }); + }, + + clearInput: function () { + this.setData({ + inputVal: "" + }); + }, + + onClickShowDocument(e) { + let showIndex = e.currentTarget.dataset['index'] + let targetAnswer = this.data.searchStudentsList[showIndex] + this.setData({ + targetAnswer, + showAnswer: true + }) + }, + + inputTyping: function (e) { + let inputVal = e.detail.value + this.setData({ + inputVal + }); + if(inputVal.length > 0) { + search(inputVal).then(res => { + console.log(res) + this.setData({ + searchStudentsList: res + }) + }) + } + }, + + onClickBack() { + this.setData({ + showAnswer: false, + targetAnswer: {} + }) + }, + + onClickQuestion() { + // 跳转 + wx.navigateTo({ + url: '/pages/question/question' + }) } }) \ No newline at end of file diff --git a/pages/robot/robot.wxml b/pages/robot/robot.wxml index 124c331..14649ec 100644 --- a/pages/robot/robot.wxml +++ b/pages/robot/robot.wxml @@ -1,2 +1,49 @@ - -pages/robot/robot.wxml + + + + 机器人问答搜索 + 我关心的问题这里都有 + + + {{targetAnswer.title}} + 下面是相关问题的解释 + + + +
+ + + + + + +
+ 取消 +
+ + + + {{item.title}} + + + +
+ + + + + + + {{targetAnswer.context}} + + + + + 留言 + 返回搜索 + + +
diff --git a/pages/robot/robot.wxss b/pages/robot/robot.wxss index 52c201e..e1aedd7 100644 --- a/pages/robot/robot.wxss +++ b/pages/robot/robot.wxss @@ -1 +1 @@ -/* pages/robot/robot.wxss */ \ No newline at end of file +/* pages/robot/robot.wxss */ diff --git a/pages/student-grade-trend/student-grade-trend.js b/pages/student-grade-trend/student-grade-trend.js index fb1b8fe..48a4050 100644 --- a/pages/student-grade-trend/student-grade-trend.js +++ b/pages/student-grade-trend/student-grade-trend.js @@ -177,7 +177,7 @@ Page({ console.log(sems) option.xAxis.data = sems - option.series.data = values + option.series[0].data = values this.setData({ showGraph: true, @@ -194,12 +194,14 @@ Page({ this.setData({ inputVal }); - searchStudents(inputVal).then(res => { - console.log(res) - this.setData({ - searchStudentsList: res + if(inputVal.length > 0) { + searchStudents(inputVal).then(res => { + console.log(res) + this.setData({ + searchStudentsList: res + }) }) - }) + } }, onShareAppMessage: function (res) { diff --git a/pages/student-grade-trend/student-grade-trend.wxml b/pages/student-grade-trend/student-grade-trend.wxml index 8d58699..80edce5 100644 --- a/pages/student-grade-trend/student-grade-trend.wxml +++ b/pages/student-grade-trend/student-grade-trend.wxml @@ -33,6 +33,6 @@
- 返回搜索 + 返回搜索
\ No newline at end of file diff --git a/pages/students-grade-analyse/students-grade-analyse.js b/pages/students-grade-analyse/students-grade-analyse.js index 06fdeb2..4643472 100644 --- a/pages/students-grade-analyse/students-grade-analyse.js +++ b/pages/students-grade-analyse/students-grade-analyse.js @@ -9,7 +9,8 @@ Page({ data: { studentsGradeInfo: {}, studentsGradeSemesterInfo: {}, - showSemester: false + showSemester: false, + loading: true }, /** @@ -21,6 +22,10 @@ Page({ this.setData({ studentsGradeInfo: res }) + }).then(res => { + this.setData({ + loading: false + }) }) }, @@ -101,5 +106,12 @@ Page({ this.setData({ showSemester: false }) + }, + + onClickQuestion() { + // 跳转 + wx.navigateTo({ + url: '/pages/question/question' + }) } }) \ No newline at end of file diff --git a/pages/students-grade-analyse/students-grade-analyse.json b/pages/students-grade-analyse/students-grade-analyse.json index 8835af0..207522e 100644 --- a/pages/students-grade-analyse/students-grade-analyse.json +++ b/pages/students-grade-analyse/students-grade-analyse.json @@ -1,3 +1,5 @@ { - "usingComponents": {} + "usingComponents": { + "i-spin": "../../dist/spin/index" + } } \ No newline at end of file diff --git a/pages/students-grade-analyse/students-grade-analyse.wxml b/pages/students-grade-analyse/students-grade-analyse.wxml index d5ce445..b4f3fc6 100644 --- a/pages/students-grade-analyse/students-grade-analyse.wxml +++ b/pages/students-grade-analyse/students-grade-analyse.wxml @@ -36,7 +36,7 @@
- 反映问题 + 反映问题
@@ -97,11 +97,12 @@
- 反映问题 + 反映问题
- 返回 + 返回
+