Commit dbe2402e authored by 黄奎's avatar 黄奎

页面修改

parent cdc28195
......@@ -37,27 +37,24 @@
msg: {
ChapterId: 0, //当前章节编号
CourseId: 0,
ReviewChapterId: 0,//复习章节编号
ReviewChapterId: 0, //复习章节编号
},
StudyList: [],
ReviewList: [],
current: 73,
readMsg: {
Id: 0,
ClassId: 1,
CourseId: 1,
Stu_Account_Id: 1,
ChapterId: 1,
StudyNum: 1
ClassId: 0,
CourseId: 0,
Stu_Account_Id: 0,
ChapterId: 0,
ReviewCourseChapterId: 0, //复习章节编号
PrepNum: 0, //预习数量
ReviewNum: 0, //复习单词数量
StudyNum: 0, //学习总单词数量
StudyType: 1, //1-预习,2-复习
},
reviewMsg: {
Id: 0,
ClassId: 1,
CourseId: 1,
Stu_Account_Id: 1,
ChapterId: 1,
ReviewNum: 1
}
})
let methods = {
getData() {
......@@ -67,35 +64,34 @@
})
},
swiperChange(val) {
data.current=val.detail.current
data.current = val.detail.current
if (data.current <= data.StudyList.length) {
methods.completeRead(val.detail.current)
} else if (data.current <= (data.ReviewList.length+data.StudyList.length)) {
methods.completeReview(val.detail.current)
methods.completeRead(val.detail.current, 1)
} else if (data.current <= (data.ReviewList.length + data.StudyList.length)) {
methods.completeRead(val.detail.current, 2)
}
const total = data.StudyList.length + data.ReviewList.length + 1
if (val.detail.current + 1 == total && total > 1) {
uni.navigateTo({
url: "/pages/word/studyComplete?CourseId="+data.readMsg.CourseId+'&&ChapterId='+data.readMsg.ChapterId+'&&NextChapterId='+'0'
url: "/pages/word/studyComplete?CourseId=" + data.readMsg.CourseId + '&&ChapterId=' + data.readMsg.ChapterId +
'&&NextChapterId=' + '0'
})
}
},
completeRead(n) {
data.readMsg.StudyNum = n
completeRead(n, type) {
if (type == 1) {
data.readMsg.PrepNum = n
} else {
data.readMsg.ReviewNum = n
}
data.readMsg.StudyType = type;
proxy.$request('/AppletWords/SetStuWordsPrep', data.readMsg).then(res => {
console.log(74, res)
})
},
completeReview(n) {
data.readMsg.ReviewNum = n-data.StudyList.length
proxy.$request('/AppletWords/SetStuWordsReview', data.reviewMsg).then(res => {
console.log(75, res)
})
}
}
onMounted(() => {
})
let that = methods;
return {
......@@ -104,24 +100,21 @@
};
},
onLoad(options) {
console.log("options",options);
console.log("options", options);
uni.setNavigationBarTitle({
title: '单词学习'
});
this.msg.ChapterId = options.ChapterId??0
this.msg.CourseId = options.CourseId??0
this.msg.ReviewChapterId = options.ReviewChapterId??0
if(options.ChapterId&&options.CourseId&&options.ReviewChapterId){
this.getData()
this.msg.ChapterId = options.ChapterId ?? 0;
this.msg.CourseId = options.CourseId ?? 0;
this.msg.ReviewChapterId = options.ReviewChapterId ?? 0;
if (options.ChapterId && options.CourseId && options.ReviewChapterId) {
this.getData();
}
const userInfo = uni.getStorageSync('userInfo');
this.readMsg.Stu_Account_Id = userInfo.Id??0
this.readMsg.CourseId = options.CourseId??0
this.readMsg.ChapterId = options.ChapterId??0
this.reviewMsg.Stu_Account_Id = userInfo.Id??0
this.reviewMsg.CourseId = options.CourseId??0
this.reviewMsg.ChapterId = options.ChapterId??0
console.log(124,userInfo.Id)
this.readMsg.Stu_Account_Id = userInfo.Id ?? 0;
this.readMsg.CourseId = options.CourseId ?? 0;
this.readMsg.ReviewCourseChapterId = options.ReviewChapterId ?? 0;
this.readMsg.ChapterId = options.ChapterId ?? 0;
},
}
</script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment