Commit dbe2402e authored by 黄奎's avatar 黄奎

页面修改

parent cdc28195
...@@ -37,27 +37,24 @@ ...@@ -37,27 +37,24 @@
msg: { msg: {
ChapterId: 0, //当前章节编号 ChapterId: 0, //当前章节编号
CourseId: 0, CourseId: 0,
ReviewChapterId: 0,//复习章节编号 ReviewChapterId: 0, //复习章节编号
}, },
StudyList: [], StudyList: [],
ReviewList: [], ReviewList: [],
current: 73, current: 73,
readMsg: { readMsg: {
Id: 0, Id: 0,
ClassId: 1, ClassId: 0,
CourseId: 1, CourseId: 0,
Stu_Account_Id: 1, Stu_Account_Id: 0,
ChapterId: 1, ChapterId: 0,
StudyNum: 1 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 = { let methods = {
getData() { getData() {
...@@ -67,35 +64,34 @@ ...@@ -67,35 +64,34 @@
}) })
}, },
swiperChange(val) { swiperChange(val) {
data.current=val.detail.current data.current = val.detail.current
if (data.current <= data.StudyList.length) { if (data.current <= data.StudyList.length) {
methods.completeRead(val.detail.current) methods.completeRead(val.detail.current, 1)
} else if (data.current <= (data.ReviewList.length+data.StudyList.length)) { } else if (data.current <= (data.ReviewList.length + data.StudyList.length)) {
methods.completeReview(val.detail.current) methods.completeRead(val.detail.current, 2)
} }
const total = data.StudyList.length + data.ReviewList.length + 1 const total = data.StudyList.length + data.ReviewList.length + 1
if (val.detail.current + 1 == total && total > 1) { if (val.detail.current + 1 == total && total > 1) {
uni.navigateTo({ 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) { completeRead(n, type) {
data.readMsg.StudyNum = n if (type == 1) {
data.readMsg.PrepNum = n
} else {
data.readMsg.ReviewNum = n
}
data.readMsg.StudyType = type;
proxy.$request('/AppletWords/SetStuWordsPrep', data.readMsg).then(res => { proxy.$request('/AppletWords/SetStuWordsPrep', data.readMsg).then(res => {
console.log(74, 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(() => { onMounted(() => {
}) })
let that = methods; let that = methods;
return { return {
...@@ -104,24 +100,21 @@ ...@@ -104,24 +100,21 @@
}; };
}, },
onLoad(options) { onLoad(options) {
console.log("options",options); console.log("options", options);
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: '单词学习' title: '单词学习'
}); });
this.msg.ChapterId = options.ChapterId??0 this.msg.ChapterId = options.ChapterId ?? 0;
this.msg.CourseId = options.CourseId??0 this.msg.CourseId = options.CourseId ?? 0;
this.msg.ReviewChapterId = options.ReviewChapterId??0 this.msg.ReviewChapterId = options.ReviewChapterId ?? 0;
if(options.ChapterId&&options.CourseId&&options.ReviewChapterId){ if (options.ChapterId && options.CourseId && options.ReviewChapterId) {
this.getData() this.getData();
} }
const userInfo = uni.getStorageSync('userInfo'); const userInfo = uni.getStorageSync('userInfo');
this.readMsg.Stu_Account_Id = userInfo.Id??0 this.readMsg.Stu_Account_Id = userInfo.Id ?? 0;
this.readMsg.CourseId = options.CourseId??0 this.readMsg.CourseId = options.CourseId ?? 0;
this.readMsg.ChapterId = options.ChapterId??0 this.readMsg.ReviewCourseChapterId = options.ReviewChapterId ?? 0;
this.reviewMsg.Stu_Account_Id = userInfo.Id??0 this.readMsg.ChapterId = options.ChapterId ?? 0;
this.reviewMsg.CourseId = options.CourseId??0
this.reviewMsg.ChapterId = options.ChapterId??0
console.log(124,userInfo.Id)
}, },
} }
</script> </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