123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158 |
- const app = getApp();
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- baseImgUrl: app.globalData.baseImgUrl,
- thumbnail: app.globalData.thumbnail,
- idx: 0,
- isMohu:false,
- learningState: [
- // {
- // "name": "积极性",
- // "type": 1
- // },
- // {
- // "name": "自律性",
- // "type": 2
- // },
- // {
- // "name": "专注度",
- // "type": 3
- // },
- // {
- // "name": "作业速度",
- // "type": 2
- // }
- ],
- subjectList: [],
- nodata: {
- nodataObj: {
- image: '../../assets/task_nodata.png',
- text: '没有任务哦'
- }
- },
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
- this.setData({ options })
- this.getSingleSubject()
- },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady: function () {
-
- },
- /**
- * 生命周期函数--监听页面显示
- */
- onShow: function () {
-
- },
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide: function () {
- },
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload: function () {
- },
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh: function () {
- },
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom: function () {
- },
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage: function () {
- const { vipId, date, subject } = this.data.options
- return {
- title: `${subject}作业批改详情`,
- path: `pages/subject_detail/subject_detail?subject=${subject}&vipId=${vipId}`,
- success: res => {
- wx.showToast({
- title: '转发成功',
- icon: 'success'
- })
- }
- }
- },
- //查看图片
- viewImageCtl: app.viewImageCtl,
- /**
- * 跳转
- */
- navigateCtl: app.navigateCtl,
- /**
- * 底部导航跳转
- */
- redirectCtl: app.redirectCtl,
- // 获取作业报告/api/parents/parents/homeworkReport
- getSingleSubject: function () {
- const postData = { fn: this.getSingleSubject, param: { ...arguments } }
- const { idx, options } = this.data
- const { vipId, date,subject} = options;
- const fn = res => {
- if (res.data!=null){
- const { correctTeacherId, homeworkCommentList = [], homeworkId, homeworkList = [], relateKnowledgeList = [], subject, unfinishedList = [], wrongItemList = [], wrongQuestionCount, correctionStatus, homeworkTime} = res.data;
- this.setData({ correctTeacherId, homeworkCommentList, homeworkId, homeworkList, relateKnowledgeList, subject, unfinishedList, wrongItemList, wrongQuestionCount, correctionStatus, homeworkTime});
- if (correctionStatus == 0 && homeworkCommentList.length==0) {
- wx.setNavigationBarTitle({
- title: `作业已提交`,
- })
- } else {
- wx.setNavigationBarTitle({
- title: `${subject}作业批改详情`,
- })
- }
- var temp = {};
- for (var i in homeworkList) {
- if (homeworkList[i].isVague == 1) {
- this.setData({ isMohu: true })
- }
- temp[`homeworkList[${i}].photoKey`] = homeworkList[i].homeworkPictureUrl
- temp[`homeworkList[${i}].isVague`] =homeworkList[i].isVague
- }
- for (var i in homeworkCommentList) {
- temp[`homeworkCommentList[${i}].photoKey`] = homeworkCommentList[i].homeworkCommentUrl
- temp[`homeworkCommentList[${i}].isComposition`] = homeworkCommentList[i].isComposition
- temp[`homeworkCommentList[${i}].compositionCommentModuleList`] = homeworkCommentList[i].compositionCommentModuleList
- }
- this.setData(temp);
- }else{
- this.setData({ homeworkList:[]});
- }
- }
- app.post('/api/teacher/library/V1/correctDetail3', { vipId, date, subject}, 0, postData).then(fn)
- },
-
- })
|