// pages/stuDocument/stuDocument.js
import stuRequest from '../../utils/stuRequest'
var app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
current: "tab1",//当前页
isTriggered: false, //自定义刷新
perTitle:{}, // 个人选题信息
openId:'',//开题教师的唯一标识openID
userId: '',
userNum:'',//用户学号
userName:'',//用户姓名
taskFile: '', //任务书
taskPath: '' , //任务书路径
taskCheck: null,//任务书审核状态
startFile: '', //开题报告
startPath:'',//开题报告路径
startCheck:'',//开题报告审核状态
middleFile: '', //中期检查
middlePath:'', //中期检查路径
middleCheck:'',//中期检查审核状态
planStart: '', //进度计划开始日期
planEnd: '',//进度计划结束日期
planCheck:'',//进度计划审核状态
guidanceDate:'', // 指导记录日期
guidanceCheck:'',//指导记录审核状态
translationFile: '', //外文译文
translationPath:'' ,//外文译文路径
translationCheck:'',//外文译文审核状态
originalFile: '', //外文原文
originalPath:'',//外文原文路径
originalCheck:'',//外文原文审核状态
literatureFile: '', //文献综述
literaturePath:'',//文献综述
literatureCheck:'',//文献综述审核状态
thesisFile: '' , //毕业论文
thesisPath:'', //毕业论文路径
thesisCheck:'',//毕业论文审核状态
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: async function (options) {
//导航栏
app.editTabBar()
//学生用户userId
let userId = wx.getStorageSync('userId')
//个人选题信息
let list = await stuRequest('/stuTitleDetail',{userId: userId},"GET")
console.log(list)
//用户个人信息
let perInfo = await stuRequest('/getUserInfo',{userId: userId},'GET')
//console.log(perInfo)
//更新数据
this.setData({
perTitle: list.data,
userNum: perInfo.data.usernum,
userName: perInfo.data.username
})
//过程文档数据更新
let file = await stuRequest('/readStuDocuments',{userId: userId},'GET')
console.log(file)
this.setData({
userId:userId,
taskFile: file.data.taskName,
taskPath: file.data.taskPath,
taskCheck: file.data.taskCheck,
startFile: file.data.startName,
startPath: file.data.startPath,
startCheck: file.data.startCheck,
middleFile:file.data.middleName,
middlePath: file.data.middlePath,
middleCheck: file.data.middleCheck,
planStart: file.data.planStart,
planEnd: file.data.planEnd,
planCheck: file.data.planCheck,
guidanceDate: file.data.guidanceDate,
guidanceCheck: file.data.guidanceCheck,
translationFile: file.data.translationName,
translationPath: file.data.translationPath,
translationCheck: file.data.translationCheck,
originalFile: file.data.originalName,
originalPath: file.data.originalPath,
originalCheck: file.data.originalCheck,
literatureFile: file.data.literatureName,
literaturePath: file.data.literaturePath,
literatureCheck: file.data.literatureCheck,
thesisFile: file.data.thesisName,
thesisPath: file.data.thesisPath,
thesisCheck: file.data.thesisCheck
})
},
// 标签页切换
handleChange({detail}){
this.setData({
current:detail.key
})
},
//取消选题
async cancelTitle(){
let userId = wx.getStorageSync('userId')
let state = this.data.perTitle.state
console.log(state)
let teachId = this.data.perTitle.userId
let getOpenId = await stuRequest('/getOpenId',{userId: teachId},'GET')
//订阅消息接受者的openID
let openId = getOpenId.data.openId
let usernum = this.data.userNum
let username = this.data.userName
let titleName = this.data.perTitle.titleName
let remarks = username + '取消了对该题的选择!'
if(state == "待确认"){
//发送订阅消息
wx.requestSubscribeMessage({
tmplIds: ['1JGJ-f9hY9PjAp94ufwjdD1fCPozS52j1Ynxx00Dgj4'],
success: async(res) => {
let value = await stuRequest('/cancelTitle',{openId: openId,remarks: remarks,titleName: titleName,username: username,usernum: usernum},'GET')
console.log(value)
},
fail:(error) => {
console.log(error)
}
})
//发送取消选题请求
let cancelRes = await stuRequest('/stuCancelTitle',{userId:userId},'GET')
if(cancelRes.code == 200){
wx.showToast({
title: '取消成功',
icon: 'none'
})
this.setData({
perTitle:null
})
}else if(cancelRes.code != 200){
wx.showToast({
title: '取消失败',
icon: 'none'
})
return
}
}else if(state == "教师已确认"){
wx.showToast({
title: '教师已确认选题,不能取消选择,若坚持要取消,请与选题教师联系!',
icon: 'none',
duration: 3000
})
}
},
//任务书预览
readtaskFile(e){
let taskPath = this.data.taskPath
//console.log(taskPath)
wx.downloadFile({
url: taskPath,
success: (result) => {
//console.log(result)
if(result.statusCode == 200){
wx.openDocument({
filePath: result.tempFilePath,
showMenu: false,
success: (res) => {
//console.log(res)
console.log('打开成功!')
},
fail:(error) => {
console.log(error)
wx.showToast({
title: '打开失败!',
icon: 'error',
duration: 3000
})
}
})
}
},
fail: (error) => {
wx.showToast({
title: '请求失败',
icon: 'none'
})
}
})
},
//开题报告上传
startFileUpload(e){
let titleState = this.data.perTitle.state
//console.log(titleState)
if(titleState == '待确认'){
wx.showToast({
title: '请在教师确认选择该题目后,再上传相关文件!',
icon: 'none'
})
return
}
let userId = this.data.userId
wx.navigateTo({
url: '/pages/stuDocUploadStart/stuDocUploadStart?userId=' + userId,
})
},
//开题报告预览
readStartFile(e){
let startPath = this.data.startPath
wx.downloadFile({
url: startPath,
success: (result) => {
if(result.statusCode == 200){
wx.openDocument({
filePath: result.tempFilePath,
showMenu: false,
success: (res) => {
console.log('开题报告打开成功')
},
fail: (error) => {
wx.showToast({
title: '打开失败',
icon: 'none'
})
}
})
}
},
fail: (error) => {
console.log(error)
wx.showToast({
title: '请求失败',
icon: 'none'
})
}
})
},
// 中期检查上传
middleFileUpload(e){
let titleState = this.data.perTitle.state
if(titleState == '待确认'){
wx.showToast({
title: '请在教师确认选择该题目后,再上传相关文件!',
icon: 'none'
})
return
}
let userId = this.data.userId
wx.navigateTo({
url: '/pages/stuDocUploadMiddle/stuDocUploadMiddle?userId='+ userId,
})
},
// 中期检查预览
readMiddleFile(e){
let middlePath = this.data.middlePath
wx.downloadFile({
url: middlePath,
success: (result) => {
if(result.statusCode == 200){
wx.openDocument({
filePath: result.tempFilePath,
showMenu: false,
success: (res) => {
co
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
毕设管理系统小程序系统.zip (719个子文件)
Graduation.iml 458B
stuDocument.js 15KB
teachManageStuFile.js 11KB
teachManageStu.js 10KB
teachIndexForm.js 10KB
index.js 7KB
teachReviewTask.js 7KB
index.js 7KB
teachReviewTitle.js 7KB
stuInfoDoc.js 6KB
teachReviewStuFile.js 6KB
login.js 5KB
teachReviewTaskDetail.js 5KB
index.js 5KB
index.js 5KB
teachManageMsg.js 5KB
index.js 5KB
index.js 5KB
app.js 5KB
stuDocUploadGuiForm.js 4KB
teachReviewTitleDetail.js 4KB
stuInfo.js 4KB
teachInfo.js 4KB
stuDocUploadTranslation.js 4KB
stuDocUploadLiterature.js 4KB
teachManage.js 4KB
stuDocUploadStart.js 4KB
stuDocUploadOriginal.js 4KB
index.js 4KB
teachManageStuEdit.js 4KB
stuDocUploadMiddle.js 4KB
stuDocUploadThesis.js 4KB
stuDocUploadPlanForm.js 4KB
teachInfoTitleList.js 4KB
teachManageStuUpload.js 4KB
stuContact.js 4KB
teachInfoDesignScoreInput.js 4KB
teachIndex.js 4KB
stuInfoDetPwd.js 4KB
teachReviewStuFileScore.js 4KB
teachManageStuFileLiterature.js 4KB
teachmanageStuFileTranslation.js 4KB
teachManageStuFileStart.js 4KB
teachManageStuFileOriginal.js 3KB
teachManageStuFileMiddle.js 3KB
teachManageStuFileThesis.js 3KB
teachManageStuFileGuidanceCheck.js 3KB
transition.js 3KB
index.js 3KB
index.js 3KB
index.js 3KB
stuIndex.js 3KB
teachManageStuFilePlanCheck.js 3KB
teachInfoReview.js 3KB
index.js 3KB
teachInfoDetPwd.js 3KB
stuIndexDetail.js 3KB
index.js 3KB
component.js 3KB
utils.js 3KB
index.js 3KB
index.js 3KB
teachReviewStu.js 3KB
stuContactDetail.js 2KB
teachInfoReviewDet.js 2KB
index.js 2KB
index.js 2KB
index.js 2KB
stuDocUploadPlanDetail.js 2KB
stuDocUploadGuiDetail.js 2KB
teachReviewStuFileGuiDet.js 2KB
teachReviewStuFilePlanDet.js 2KB
utils.js 2KB
index.js 2KB
stuDocUploadGuidance.js 2KB
animate.js 2KB
stuDocUploadPlan.js 2KB
index.js 2KB
teachInfoDesign.js 2KB
index.js 2KB
index.js 2KB
teachManageStuFilePlan.js 2KB
teachReviewStuFilePlan.js 2KB
teachManageStuFileGuidance.js 2KB
teachReviewaStuFileGui.js 2KB
index.js 2KB
index.js 1KB
teachReview.js 1KB
index.js 1KB
index.js 1KB
utils.js 1KB
index.js 1KB
index.js 1KB
teachInfoDesignScore.js 1KB
teachInfoOpen.js 1KB
stuInfoDesign.js 1KB
index.js 1KB
index.js 1KB
stuInfoOpen.js 1KB
index.js 1KB
共 719 条
- 1
- 2
- 3
- 4
- 5
- 6
- 8
资源评论
马coder
- 粉丝: 1203
- 资源: 6602
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功