辅导员部分界面功能测试完毕;

This commit is contained in:
Saturneric 2021-04-11 03:43:07 +08:00
parent 6f57dcdac8
commit 366f9a16ec
27 changed files with 461 additions and 175 deletions

11
api/robot.js Normal file
View File

@ -0,0 +1,11 @@
import request from '../utils/request.js'
export const search = (title) => {
return request({
url: "/robot",
method: "get",
data: {
title
}
})
}

View File

@ -17,7 +17,8 @@
"pages/robot/robot", "pages/robot/robot",
"pages/my-children/my-children", "pages/my-children/my-children",
"pages/student-grade-trend/student-grade-trend", "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": { "window": {
"backgroundTextStyle": "light", "backgroundTextStyle": "light",

View File

@ -133,5 +133,12 @@ Page({
*/ */
onShareAppMessage: function () { onShareAppMessage: function () {
},
onClickQuestion() {
// 跳转
wx.navigateTo({
url: '/pages/question/question'
})
} }
}) })

View File

@ -23,7 +23,7 @@
</view> </view>
</view> </view>
<view class="weui-form-preview__ft"> <view class="weui-form-preview__ft">
<a class="weui-form-preview__btn weui-form-preview__btn_primary">修改</a> <a class="weui-form-preview__btn weui-form-preview__btn_primary" bindtap="onClickQuestion">反映问题</a>
</view> </view>
</view> </view>
</view> </view>
@ -70,7 +70,7 @@
</view> </view>
</view> </view>
<view class="weui-form-preview__ft"> <view class="weui-form-preview__ft">
<a class="weui-form-preview__btn weui-form-preview__btn_primary">反映问题</a> <a class="weui-form-preview__btn weui-form-preview__btn_primary" bindtap="onClickQuestion">反映问题</a>
</view> </view>
</view> </view>
</view> </view>

View File

@ -9,7 +9,8 @@ Page({
data: { data: {
parentsInfo: [], parentsInfo: [],
childrenInfo: [], childrenInfo: [],
supervisorsInfo: [] supervisorsInfo: [],
noRecord: false
}, },
/** /**
@ -60,6 +61,12 @@ Page({
supervisorsInfo: res 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 () { onShareAppMessage: function () {
},
onClickQuestion() {
// 跳转
wx.navigateTo({
url: '/pages/question/question'
})
} }
}) })

View File

@ -1,3 +1,5 @@
{ {
"usingComponents": {} "usingComponents": {
"i-spin": "../../dist/spin/index"
}
} }

View File

@ -35,7 +35,7 @@
</view> </view>
</view> </view>
<view class="weui-form-preview__ft"> <view class="weui-form-preview__ft">
<a class="weui-form-preview__btn weui-form-preview__btn_primary">反映问题</a> <a class="weui-form-preview__btn weui-form-preview__btn_primary" bindtap="onClickQuestion">反映问题</a>
</view> </view>
</view> </view>
</view> </view>
@ -58,7 +58,7 @@
</view> </view>
</view> </view>
<view class="weui-form-preview__ft"> <view class="weui-form-preview__ft">
<a class="weui-form-preview__btn weui-form-preview__btn_primary">反映问题</a> <a class="weui-form-preview__btn weui-form-preview__btn_primary" bindtap="onClickQuestion">反映问题</a>
</view> </view>
</view> </view>
</view> </view>
@ -93,9 +93,9 @@
</view> </view>
</view> </view>
<view class="weui-form-preview__ft"> <view class="weui-form-preview__ft">
<a class="weui-form-preview__btn weui-form-preview__btn_primary">反映问题</a> <a class="weui-form-preview__btn weui-form-preview__btn_primary" bindtap="onClickQuestion">反映问题</a>
</view> </view>
</view> </view>
</view> </view>
<i-spin size="large" fix wx:if="{{ noRecord }}" custom><view>没有发现相关信息</view></i-spin>
</view> </view>

View File

@ -22,9 +22,9 @@ Page({
document: null, document: null,
showDocument: false, showDocument: false,
toast: false, toast: false,
hideToast: true, hideToast: false,
warnToast: false, warnToast: false,
hideWarnToast: true, hideWarnToast: false,
warnText: '', warnText: '',
}, },
@ -138,27 +138,29 @@ Page({
toast: false, toast: false,
hideToast: false, hideToast: false,
}); });
}, 300);
}, 3000);
}).then(res => {
// 绑定成功后,跳转进入小程序首页 // 绑定成功后,跳转进入小程序首页
wx.navigateTo({ wx.navigateTo({
url: '/pages/index/index' url: '/pages/index/index'
}) })
}, 300);
}, 3000);
}).catch(err =>{ }).catch(err =>{
console.log(err) console.log(err)
this.setData({ this.setData({
warnToast: true, warnToast: true,
warnText: '绑定失败' warnText: '绑定失败'
}); })
}).then(res => {
setTimeout(() => { setTimeout(() => {
this.setData({ this.setData({
hidewarnToast: true, hideWarnToast: true,
}); });
setTimeout(() => { setTimeout(() => {
this.setData({ this.setData({
warnToast: false, warnToast: false,
hidewarnToast: false, hideWarnToast: false,
}); });
}, 300); }, 300);
}, 3000); }, 3000);
@ -219,7 +221,8 @@ Page({
this.setData({ this.setData({
warnToast: true, warnToast: true,
warnText: '未找到对应档案' warnText: '未找到对应档案'
}); })
}).then(res => {
setTimeout(() => { setTimeout(() => {
this.setData({ this.setData({
hidewarnToast: true, hidewarnToast: true,
@ -227,7 +230,7 @@ Page({
setTimeout(() => { setTimeout(() => {
this.setData({ this.setData({
warnToast: false, warnToast: false,
hidewarnToast: false, hideWarnToast: false,
}); });
}, 300); }, 300);
}, 3000); }, 3000);

View File

@ -1,4 +1,5 @@
<view class="container"> <view class="page" data-weui-theme="{{theme}}">
<view class="weui-form">
<view class="weui-form__text-area"> <view class="weui-form__text-area">
<view wx:if="{{!showDocument}}"> <view wx:if="{{!showDocument}}">
<h2 class="weui-form__title">绑定您的个人档案</h2> <h2 class="weui-form__title">绑定您的个人档案</h2>
@ -107,7 +108,7 @@
<a class="weui-btn weui-btn_primary" bindtap="onConfirm">查询档案</a> <a class="weui-btn weui-btn_primary" bindtap="onConfirm">查询档案</a>
</view> </view>
<view wx:if="{{showDocument}}"> <view wx:if="{{showDocument}}">
<a class="weui-btn weui-btn_disabled weui-btn_default" bindtap="onReset">重新查询</a> <a class="weui-btn weui-btn_default" bindtap="onReset">重新查询</a>
<a class="weui-btn weui-btn_primary" bindtap="onBind">绑定</a> <a class="weui-btn weui-btn_primary" bindtap="onBind">绑定</a>
</view> </view>
@ -126,5 +127,5 @@
<view class="weui-toast__content">已完成</view> <view class="weui-toast__content">已完成</view>
</view> </view>
</view> </view>
</view>
</view> </view>

View File

@ -1 +1,3 @@
/* pages/bind-document.wxss */ /* pages/bind-document.wxss */
.page{height:100%}
.page{background-color:var(--weui-BG-2)}

View File

@ -1,4 +1,5 @@
<view class="container"> <view class="page" data-weui-theme="{{theme}}">
<view class="weui-form">
<view class="weui-form__text-area"> <view class="weui-form__text-area">
<h2 class="weui-form__title">个人信息授权</h2> <h2 class="weui-form__title">个人信息授权</h2>
<view class="weui-form__desc">我们需要您进行基本信息授权,我们将用这些信息以初始化您的账户。</view> <view class="weui-form__desc">我们需要您进行基本信息授权,我们将用这些信息以初始化您的账户。</view>
@ -9,3 +10,5 @@
</view> </view>
</view> </view>
</view> </view>
</view>

View File

@ -1 +1,2 @@
/* pages/get-user-info/get-user-info.wxss */ /* pages/get-user-info/get-user-info.wxss */
.page{height:100%}

View File

@ -287,5 +287,10 @@ Page({
wx.navigateTo({ wx.navigateTo({
url: '/pages/my-children/my-children?openid=' + query url: '/pages/my-children/my-children?openid=' + query
}) })
},
bindRobot(){
wx.navigateTo({
url: '/pages/robot/robot'
})
} }
}) })

View File

@ -56,11 +56,10 @@
<view class="weui-cell weui-cell_active weui-cell_access" bindtap="bindMessage"> <view class="weui-cell weui-cell_active weui-cell_access" bindtap="bindMessage">
<view class="weui-cell__bd"> <view class="weui-cell__bd">
<text class="demo_badge_title">收到的消息</text> <text class="demo_badge_title">收到的消息</text>
<text class="weui-badge">32</text>
</view> </view>
<view class="weui-cell__ft"></view> <view class="weui-cell__ft"></view>
</view> </view>
<view class="weui-cell weui-cell_active weui-cell_access" wx:if="{{userDocument.role === 'ROLE_PARENT'}}"> <view class="weui-cell weui-cell_active weui-cell_access" bindtap="bindRobot" wx:if="{{userDocument.role === 'ROLE_PARENT'}}">
<view class="weui-cell__bd"> <view class="weui-cell__bd">
<text class="demo_badge_title">问答机器人</text> <text class="demo_badge_title">问答机器人</text>
</view> </view>

View File

@ -113,6 +113,7 @@ Page({
this.setData({ this.setData({
inputVal inputVal
}); });
if(inputVal.length > 0) {
searchStudents(inputVal).then(res => { searchStudents(inputVal).then(res => {
console.log(res) console.log(res)
this.setData({ this.setData({
@ -120,4 +121,5 @@ Page({
}) })
}) })
} }
}
}) })

View File

@ -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) {
}
},
})

View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@ -0,0 +1,25 @@
<view class="page" data-weui-theme="{{theme}}">
<view class="weui-form">
<view class="weui-form__text-area">
<h2 class="weui-form__title">给系统维护者留言</h2>
<view class="weui-form__desc">您的留言将发给系统维护者的账户TA将评估并解决您的问题</view>
</view>
<view class="weui-form__control-area">
<view class="weui-cells__group weui-cells__group_form">
<view class="weui-cells__title">给系统维护者留言</view>
<view class="weui-cells weui-cells_form">
<view class="weui-cell">
<view class="weui-cell__bd">
<textarea class="weui-textarea" placeholder="请描述你所发生的问题" placeholder-class="weui-input__placeholder" rows="3" bindinput="inputTyping"></textarea>
<view class="weui-textarea-counter"><span>{{textLength}}</span>/200</view>
</view>
</view>
</view>
</view>
</view>
<view class="weui-form__opr-area">
<a class="weui-btn weui-btn_primary" bindtap="bindSend">发送</a>
</view>
</view>
</view>

View File

@ -0,0 +1 @@
/* pages/question/question.wxss */

View File

@ -1,11 +1,17 @@
// pages/robot/robot.js // pages/robot/robot.js
import {search} from '../../api/robot'
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
inputShowed: false,
inputVal: "",
searchStudentsList: [],
targetAnswer: {},
showAnswer: false
}, },
/** /**
@ -62,5 +68,62 @@ Page({
*/ */
onShareAppMessage: function () { 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'
})
} }
}) })

View File

@ -1,2 +1,49 @@
<!--pages/robot/robot.wxml--> <!--pages/my-student/my-students.wxml-->
<text>pages/robot/robot.wxml</text> <view class="page" data-weui-theme="{{theme}}">
<view class="page__hd" wx:if="{{!showAnswer}}">
<view class="page__title">机器人问答搜索</view>
<view class="page__desc">我关心的问题这里都有</view>
</view>
<view class="page__hd" wx:else>
<view class="page__title">{{targetAnswer.title}}</view>
<view class="page__desc">下面是相关问题的解释</view>
</view>
<view class="page__bd" wx:if="{{!showAnswer}}">
<view class="weui-search-bar {{inputShowed ? 'weui-search-bar_focusing' : ''}}" id="searchBar">
<form class="weui-search-bar__form">
<view class="weui-search-bar__box">
<i class="weui-icon-search"></i>
<input type="text" class="weui-search-bar__input" placeholder="搜索" value="{{inputVal}}" focus="{{inputShowed}}" bindinput="inputTyping" />
<span class="weui-icon-clear" wx:if="{{inputVal.length > 0}}" bindtap="clearInput"></span>
</view>
<label class="weui-search-bar__label" bindtap="showInput">
<i class="weui-icon-search"></i>
<span class="weui-search-bar__text">输入学号搜索</span>
</label>
</form>
<view class="weui-search-bar__cancel-btn" bindtap="hideInput">取消</view>
</view>
<view class="weui-cells searchbar-result" wx:if="{{inputVal.length > 0}}">
<view class="weui-cell weui-cell_active weui-cell_access" wx:for="{{searchStudentsList}}" wx:key="index" data-index="{{index}}" bindtap="onClickShowDocument">
<view class="weui-cell__bd weui-cell_primary">
<view>{{item.title}}</view>
</view>
</view>
</view>
</view>
<view wx:else>
<view class="page__bd">
<view class="weui-article">
<view class="weui-article__section">
<view class="weui-article__section">
<view class="weui-article__p">
{{targetAnswer.context}}
</view>
</view>
</view>
</view>
<a class="weui-btn weui-btn_primary" bindtap="onClickQuestion">留言</a>
<a class="weui-btn weui-btn_disabled weui-btn_default" bindtap="onClickBack">返回搜索</a>
</view>
</view>
</view>

View File

@ -177,7 +177,7 @@ Page({
console.log(sems) console.log(sems)
option.xAxis.data = sems option.xAxis.data = sems
option.series.data = values option.series[0].data = values
this.setData({ this.setData({
showGraph: true, showGraph: true,
@ -194,12 +194,14 @@ Page({
this.setData({ this.setData({
inputVal inputVal
}); });
if(inputVal.length > 0) {
searchStudents(inputVal).then(res => { searchStudents(inputVal).then(res => {
console.log(res) console.log(res)
this.setData({ this.setData({
searchStudentsList: res searchStudentsList: res
}) })
}) })
}
}, },
onShareAppMessage: function (res) { onShareAppMessage: function (res) {

View File

@ -33,6 +33,6 @@
</view> </view>
<view class="graph" wx:else> <view class="graph" wx:else>
<ec-canvas id="mychart-dom-line" canvas-id="mychart-line" ec="{{ ec }}"></ec-canvas> <ec-canvas id="mychart-dom-line" canvas-id="mychart-line" ec="{{ ec }}"></ec-canvas>
<a class="weui-btn weui-btn_disabled weui-btn_default" bindtap="onClickBack">返回搜索</a> <a class="weui-btn weui-btn_primary" bindtap="onClickBack">返回搜索</a>
</view> </view>
</view> </view>

View File

@ -9,7 +9,8 @@ Page({
data: { data: {
studentsGradeInfo: {}, studentsGradeInfo: {},
studentsGradeSemesterInfo: {}, studentsGradeSemesterInfo: {},
showSemester: false showSemester: false,
loading: true
}, },
/** /**
@ -21,6 +22,10 @@ Page({
this.setData({ this.setData({
studentsGradeInfo: res studentsGradeInfo: res
}) })
}).then(res => {
this.setData({
loading: false
})
}) })
}, },
@ -101,5 +106,12 @@ Page({
this.setData({ this.setData({
showSemester: false showSemester: false
}) })
},
onClickQuestion() {
// 跳转
wx.navigateTo({
url: '/pages/question/question'
})
} }
}) })

View File

@ -1,3 +1,5 @@
{ {
"usingComponents": {} "usingComponents": {
"i-spin": "../../dist/spin/index"
}
} }

View File

@ -36,7 +36,7 @@
</view> </view>
</view> </view>
<view class="weui-form-preview__ft"> <view class="weui-form-preview__ft">
<a class="weui-form-preview__btn weui-form-preview__btn_primary">反映问题</a> <a class="weui-form-preview__btn weui-form-preview__btn_primary" bindtap="onClickQuestion">反映问题</a>
</view> </view>
</view> </view>
</view> </view>
@ -97,11 +97,12 @@
</view> </view>
</view> </view>
<view class="weui-form-preview__ft"> <view class="weui-form-preview__ft">
<a class="weui-form-preview__btn weui-form-preview__btn_primary">反映问题</a> <a class="weui-form-preview__btn weui-form-preview__btn_primary" bindtap="onClickQuestion">反映问题</a>
</view> </view>
</view> </view>
</view> </view>
<a class="weui-btn weui-btn_disabled weui-btn_default" bindtap="onClickBack">返回</a> <a class="weui-btn weui-btn_primary" bindtap="onClickBack">返回</a>
</view> </view>
<i-spin size="large" fix wx:if="{{ loading }}"></i-spin>
</view> </view>