2024-06-13 00:50:28 +00:00
|
|
|
<template>
|
2024-07-05 07:58:15 +00:00
|
|
|
<div v-loading="fullscreenLoading"
|
|
|
|
|
style="height: 100dvh;"
|
|
|
|
|
element-loading-text="书籍加载中,请稍等"
|
|
|
|
|
|
|
|
|
|
>
|
2024-09-12 01:17:30 +00:00
|
|
|
<navigation></navigation>
|
|
|
|
|
|
2024-06-18 03:30:25 +00:00
|
|
|
<div class="xml-read" v-if="show">
|
2024-06-13 00:50:28 +00:00
|
|
|
<xml-digital-teaching
|
|
|
|
|
v-if="digitalTeaching"
|
|
|
|
|
ref="xmlDigitalTeaching"
|
2024-07-05 07:58:15 +00:00
|
|
|
systemEnvId="855e5965-d6a9-4aa0-9933-177e705399af"
|
|
|
|
|
:navBarHeight=60
|
2024-06-13 00:50:28 +00:00
|
|
|
:textBookData="textBookData"
|
|
|
|
|
:catalogList="catalogList"
|
|
|
|
|
:looseLeafData="looseLeafData"
|
2024-07-05 07:58:15 +00:00
|
|
|
:chapterId="chapterId"
|
2024-06-13 00:50:28 +00:00
|
|
|
:location="location"
|
|
|
|
|
:notesList="data.notes.list"
|
|
|
|
|
:bookmarkList="data.bookmark.list"
|
|
|
|
|
:resourcesList="data.resources.list"
|
|
|
|
|
:highlightList="data.highlight.list"
|
|
|
|
|
:isTrial="isTrial"
|
|
|
|
|
:isTrialIndex="isTrialIndex"
|
|
|
|
|
:userType="userType"
|
|
|
|
|
:setting="setting"
|
2024-07-16 10:33:58 +00:00
|
|
|
:joinClass ="joinClass"
|
|
|
|
|
:READER_MODE ="READER_MODE"
|
|
|
|
|
:gradesName = "gradesName"
|
2024-07-22 10:31:09 +00:00
|
|
|
:userInfoparms = "userInfo"
|
|
|
|
|
:teacherDateclass = "classList"
|
2024-09-12 01:17:30 +00:00
|
|
|
:teacherData = "teacherData"
|
|
|
|
|
:studentData = "studentData"
|
2024-06-13 00:50:28 +00:00
|
|
|
@updateReadLocation="updateReadLocation"
|
|
|
|
|
@addNote="addNote"
|
|
|
|
|
@editNote="editNote"
|
|
|
|
|
@deleteNote="deleteNote"
|
|
|
|
|
@deleteHighlight = "deleteHighlight"
|
|
|
|
|
@addTeacherNote="addTeacherNote"
|
|
|
|
|
@editTeacherNote="editTeacherNote"
|
|
|
|
|
@deleteTeacherNote="deleteTeacherNote"
|
|
|
|
|
@addHighlight="addHighlight"
|
|
|
|
|
@updateNotes="updateNotes"
|
|
|
|
|
@addBookmark="addBookmark"
|
|
|
|
|
@deleteBookmark="deleteBookmark"
|
|
|
|
|
@downloadFile="downloadFile"
|
|
|
|
|
@addResources="addResources"
|
|
|
|
|
@deleteResource="deleteResource"
|
|
|
|
|
@editResources="editResources"
|
|
|
|
|
@settingChange="settingChange"
|
2024-09-12 01:17:30 +00:00
|
|
|
@learningStatistics ="learningStatistics"
|
|
|
|
|
@changeClass="changeClass"
|
2024-06-13 00:50:28 +00:00
|
|
|
:action = "action"
|
|
|
|
|
:headers = "headers"
|
2024-06-18 07:53:13 +00:00
|
|
|
:data = "extradata"
|
2024-06-13 00:50:28 +00:00
|
|
|
:isShowTeacherResource="true"
|
|
|
|
|
:continueReading="true"
|
|
|
|
|
:basisPath="basisPath"
|
|
|
|
|
:pageType="pageType"
|
|
|
|
|
/>
|
2024-06-20 02:26:29 +00:00
|
|
|
<!-- officePreviewPath="https://idocview.xxxxxxx.com/view/url?url=" -->
|
|
|
|
|
|
2024-06-18 03:30:25 +00:00
|
|
|
</div>
|
|
|
|
|
<div v-show="showError">
|
2024-06-18 07:53:13 +00:00
|
|
|
<no-data :msg="errormsg"></no-data>
|
2024-06-18 03:30:25 +00:00
|
|
|
</div>
|
2024-06-13 00:50:28 +00:00
|
|
|
</div>
|
2024-06-18 03:30:25 +00:00
|
|
|
|
2024-06-13 00:50:28 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import {LOCAL_VIEW_DETAIL,LOCAL_VIEW_CATALOG,LOCAL_VIEW_DATA} from "../seed/mock"
|
2024-06-18 03:30:25 +00:00
|
|
|
import NoData from "../components/noData.vue"
|
2024-09-12 01:17:30 +00:00
|
|
|
import Navigation from "../components/Navigation"
|
2024-06-18 07:53:13 +00:00
|
|
|
import {getStore,processReuestData} from '../utils/mUtils'
|
2024-06-18 03:30:25 +00:00
|
|
|
import {bookApi} from "../service/getData"
|
2024-09-12 01:17:30 +00:00
|
|
|
import {eventBus} from '../eventBus'
|
|
|
|
|
|
2024-06-13 00:50:28 +00:00
|
|
|
export default {
|
2024-06-18 03:30:25 +00:00
|
|
|
components:{
|
2024-09-12 01:17:30 +00:00
|
|
|
NoData,
|
|
|
|
|
Navigation,
|
2024-06-18 03:30:25 +00:00
|
|
|
},
|
2024-06-13 00:50:28 +00:00
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
action:'http://60.xxxx.137.15:8081/admin-api/teachingMaterial/resource/upload/16550/6940601956829184',
|
|
|
|
|
headers:{Authorization:`eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjYyMDFlYjA3LTY4ZWUtNGJhOC1iMjc3LTk4MjU0ZGI0MzUwMSJ9.zvW8Rr8ShOvwH5i7Cvl9bgp4MtznyLusrY86LMLW7MplNOjRp6j8lx6zkAD4_CvNXVF7v7MsYcRhN90DvhTq1g`},
|
2024-07-09 10:10:54 +00:00
|
|
|
digitalTeaching: false,
|
2024-06-18 03:30:25 +00:00
|
|
|
// textBookData: LOCAL_VIEW_DETAIL,
|
|
|
|
|
// catalogList: LOCAL_VIEW_CATALOG,
|
|
|
|
|
// looseLeafData: LOCAL_VIEW_DATA,
|
|
|
|
|
textBookData: {},
|
|
|
|
|
catalogList: [],
|
|
|
|
|
looseLeafData: {},
|
|
|
|
|
bookId: '',
|
2024-07-22 10:31:09 +00:00
|
|
|
chapterId:"",
|
2024-06-18 03:30:25 +00:00
|
|
|
show:false,
|
|
|
|
|
showError:false,
|
2024-07-05 07:58:15 +00:00
|
|
|
fullscreenLoading:true,
|
|
|
|
|
// loadingText:'书籍加载中,请稍等',
|
2024-06-18 07:53:13 +00:00
|
|
|
errormsg:'无数据',
|
2024-06-13 00:50:28 +00:00
|
|
|
location: '',
|
2024-06-18 03:30:25 +00:00
|
|
|
basisPath: 'https://smile-ebook.oss-cn-qingdao.aliyuncs.com/newjc/',
|
2024-06-13 00:50:28 +00:00
|
|
|
pageType: 'pc',
|
|
|
|
|
isTrial: false,
|
2024-06-20 02:26:29 +00:00
|
|
|
isTrialIndex: 30,
|
2024-06-13 00:50:28 +00:00
|
|
|
userType: 'teacher',
|
2024-06-18 07:53:13 +00:00
|
|
|
extradata :{},
|
2024-07-16 10:33:58 +00:00
|
|
|
READER_MODE:"immersive",
|
|
|
|
|
joinClass:"",
|
|
|
|
|
gradesName:"班级名称",
|
2024-06-13 00:50:28 +00:00
|
|
|
data: {
|
|
|
|
|
notes: {
|
|
|
|
|
list: []
|
|
|
|
|
},
|
|
|
|
|
bookmark: {
|
|
|
|
|
list: []
|
|
|
|
|
},
|
|
|
|
|
highlight: {
|
|
|
|
|
list: []
|
|
|
|
|
},
|
|
|
|
|
resources: {
|
|
|
|
|
list: []
|
|
|
|
|
}
|
|
|
|
|
},
|
2024-07-22 10:31:09 +00:00
|
|
|
setting: {},
|
|
|
|
|
userInfo:{},
|
2024-09-12 01:17:30 +00:00
|
|
|
userId:{},
|
2024-07-22 10:31:09 +00:00
|
|
|
classList:[],
|
2024-09-12 01:17:30 +00:00
|
|
|
classId:'',
|
|
|
|
|
className:'',
|
|
|
|
|
teacherData:{},
|
|
|
|
|
studentData:{}
|
2024-06-13 00:50:28 +00:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
created() {
|
2024-09-12 01:17:30 +00:00
|
|
|
|
2024-07-22 10:31:09 +00:00
|
|
|
document.title = "新思课堂电子书阅读"
|
2024-06-18 03:30:25 +00:00
|
|
|
this.bookId = this.$route.query.bookId
|
2024-07-09 10:10:54 +00:00
|
|
|
|
2024-09-12 01:17:30 +00:00
|
|
|
this.userId = getStore("userId")
|
2024-07-10 08:49:16 +00:00
|
|
|
if (this.$route.query.chapterId){
|
|
|
|
|
this.chapterId = this.$route.query.chapterId
|
|
|
|
|
}
|
2024-06-18 07:53:13 +00:00
|
|
|
// this.userType = this.$route.query.userType || 'student'
|
2024-07-05 07:58:15 +00:00
|
|
|
this.$store.state.redirecturl = this.$route.query.redirecturl
|
2024-06-18 07:53:13 +00:00
|
|
|
var userType = getStore("userType")
|
2024-06-20 02:26:29 +00:00
|
|
|
|
|
|
|
|
this.isTrial = this.$route.query.isTrial=="true"?true:false
|
|
|
|
|
|
2024-06-18 07:53:13 +00:00
|
|
|
this.extradata = processReuestData({})
|
|
|
|
|
|
|
|
|
|
// var uploadUrl = "https://local.xinsiketang.com"
|
|
|
|
|
var uploadUrl = ""
|
|
|
|
|
uploadUrl = uploadUrl+'/api/smile/uploadResources'
|
|
|
|
|
this.action = uploadUrl
|
2024-09-12 01:17:30 +00:00
|
|
|
|
|
|
|
|
|
2024-06-18 07:53:13 +00:00
|
|
|
if (userType){
|
|
|
|
|
this.userType = userType
|
|
|
|
|
}
|
2024-06-20 02:26:29 +00:00
|
|
|
|
|
|
|
|
|
2024-06-18 07:53:13 +00:00
|
|
|
|
2024-06-13 00:50:28 +00:00
|
|
|
if (this.$route.query.type) {
|
|
|
|
|
this.pageType = this.$route.query.type
|
|
|
|
|
// this.isTrialIndex = Number(this.$route.query.isTrialIndex)
|
|
|
|
|
if (this.$route.query.isTrialIndex) {
|
|
|
|
|
this.isTrial = true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.location = localStorage.getItem(this.textBookData.id)
|
2024-09-12 01:17:30 +00:00
|
|
|
|
|
|
|
|
this.request()// 请求数据
|
2024-06-13 00:50:28 +00:00
|
|
|
setTimeout(() => {
|
2024-06-18 03:30:25 +00:00
|
|
|
// this.getData()
|
|
|
|
|
this.getMineData()
|
2024-09-12 01:17:30 +00:00
|
|
|
this.studySituation()
|
2024-06-13 00:50:28 +00:00
|
|
|
// this.getSetting()
|
|
|
|
|
}, 800)
|
|
|
|
|
},
|
|
|
|
|
|
2024-06-18 03:30:25 +00:00
|
|
|
async mounted(){
|
2024-09-12 01:17:30 +00:00
|
|
|
|
|
|
|
|
this.$store.state.showNaotu = true
|
|
|
|
|
|
|
|
|
|
var that = this
|
|
|
|
|
|
|
|
|
|
eventBus.$on('changeMode',(data) =>{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(data){
|
|
|
|
|
that.$refs.xmlDigitalTeaching.READER_MODE("immersive")
|
|
|
|
|
}else{
|
|
|
|
|
that.$refs.xmlDigitalTeaching.READER_MODE("initial")
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
|
|
|
|
|
async request(){
|
2024-06-20 02:26:29 +00:00
|
|
|
|
2024-07-05 07:58:15 +00:00
|
|
|
|
2024-06-13 00:50:28 +00:00
|
|
|
this.pageType = /Mobi|Android|iPhone/i.test(navigator.userAgent)?'h5':'pc'
|
2024-06-18 03:30:25 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
// resourcesList({})
|
|
|
|
|
|
2024-07-10 03:34:11 +00:00
|
|
|
// console.log(this.bookId)
|
2024-06-18 03:30:25 +00:00
|
|
|
|
|
|
|
|
// var locationData = await bookApi.userAction.getReadLocation({bookId:this.bookId})
|
|
|
|
|
// this.location = locationData.location
|
2024-06-20 02:26:29 +00:00
|
|
|
|
2024-07-09 10:10:54 +00:00
|
|
|
|
2024-07-10 08:49:16 +00:00
|
|
|
var res = await bookApi.bookinfo.json({bookId:this.bookId})
|
|
|
|
|
|
|
|
|
|
// res = JSON.stringify(res)
|
|
|
|
|
// res = res.replaceAll("https://smile-ebook.oss-cn-qingdao.aliyuncs.com/", "fileapi/")
|
|
|
|
|
// res = JSON.parse(res)
|
|
|
|
|
|
|
|
|
|
if (res){
|
|
|
|
|
var res1 = await fetch(res.LOCAL_VIEW_DETAIL,{
|
|
|
|
|
mode: 'cors'
|
|
|
|
|
})
|
|
|
|
|
this.textBookData = await res1.json()
|
|
|
|
|
var res2 = await fetch (res.LOCAL_VIEW_CATALOG,{
|
|
|
|
|
mode: 'cors'
|
|
|
|
|
})
|
2024-07-17 08:46:32 +00:00
|
|
|
this.$store.state.textBookData = this.textBookData
|
2024-07-10 08:49:16 +00:00
|
|
|
this.catalogList = await res2.json()
|
|
|
|
|
var res3 = await fetch(res.LOCAL_VIEW_DATA,{
|
|
|
|
|
mode: 'cors'
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
console.log(this.catalogList)
|
|
|
|
|
this.looseLeafData = await res3.json()
|
|
|
|
|
|
2024-07-17 08:46:32 +00:00
|
|
|
|
2024-07-10 08:49:16 +00:00
|
|
|
this.basisPath = res.basisPath
|
2024-07-17 08:46:32 +00:00
|
|
|
|
2024-07-10 08:49:16 +00:00
|
|
|
}
|
|
|
|
|
|
2024-09-12 01:17:30 +00:00
|
|
|
this.show = true
|
|
|
|
|
this.fullscreenLoading = false
|
|
|
|
|
this.digitalTeaching = true
|
2024-06-20 02:26:29 +00:00
|
|
|
|
2024-06-19 00:32:38 +00:00
|
|
|
this.data.resources.list = await bookApi.resource.list({bookId:this.bookId})
|
|
|
|
|
|
2024-06-20 02:26:29 +00:00
|
|
|
|
2024-07-09 10:10:54 +00:00
|
|
|
if (this.$route.query.chapterId){
|
2024-07-10 03:34:11 +00:00
|
|
|
this.chapterId = this.$route.query.chapterId
|
2024-07-09 10:10:54 +00:00
|
|
|
}
|
2024-06-20 02:26:29 +00:00
|
|
|
|
2024-09-12 01:17:30 +00:00
|
|
|
|
2024-07-10 08:49:16 +00:00
|
|
|
|
2024-07-22 10:31:09 +00:00
|
|
|
//
|
|
|
|
|
this.userInfo = await bookApi.user.info()
|
|
|
|
|
|
|
|
|
|
this.classList = await bookApi.user.classList({bookId:this.bookId})
|
2024-09-12 01:17:30 +00:00
|
|
|
|
|
|
|
|
if(this.classList.length>0){
|
|
|
|
|
// this.classId = this.classList[0].pkid
|
|
|
|
|
// this.className = this.classList[0].className
|
|
|
|
|
|
|
|
|
|
this.classId = this.classList.at(-1).pkid
|
|
|
|
|
this.className = this.classList.at(-1).className
|
|
|
|
|
}
|
|
|
|
|
// this.classId = 12304
|
|
|
|
|
//学情
|
|
|
|
|
this.getUerData()
|
|
|
|
|
|
|
|
|
|
this.studySituation()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var params = {
|
|
|
|
|
bookId:this.bookId,
|
|
|
|
|
userId: this.userId,
|
|
|
|
|
classId: this.classId,
|
|
|
|
|
lastAt:"0",
|
|
|
|
|
learnNum:1
|
|
|
|
|
}
|
|
|
|
|
// 初始化学情
|
|
|
|
|
bookApi.study.update({data:JSON.stringify(params)})
|
|
|
|
|
|
2024-06-13 00:50:28 +00:00
|
|
|
},
|
2024-06-18 03:30:25 +00:00
|
|
|
|
2024-09-12 01:17:30 +00:00
|
|
|
|
|
|
|
|
// 用户信息
|
|
|
|
|
async getUerData(){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var user = {
|
|
|
|
|
|
|
|
|
|
nickname:this.userInfo.nickname,
|
|
|
|
|
className:this.className,
|
|
|
|
|
img:this.userInfo.img,
|
|
|
|
|
// notNum:this.notes.list.length,
|
|
|
|
|
// bookmarkNum:this.bookmark.list.length,//书签数量
|
|
|
|
|
// lineationNum:this.highlight.list.length//划线数量
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(this.userType == "teacher"){
|
|
|
|
|
|
|
|
|
|
this.teacherData = user
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (this.userType == "student")
|
|
|
|
|
{
|
|
|
|
|
this.studentData = user
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
// 学情
|
|
|
|
|
async studySituation(){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var res = await bookApi.study.info({
|
|
|
|
|
userId: this.userId,
|
|
|
|
|
classId: this.classId
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (this.userType == "teacher") {
|
|
|
|
|
|
|
|
|
|
if (res.teacherInfo.length>0){
|
|
|
|
|
var item = res.teacherInfo[0]
|
|
|
|
|
|
|
|
|
|
this.teacherData = item
|
|
|
|
|
this.teacherData.className = item.nickname
|
|
|
|
|
this.teacherData.img = item.headImg
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// this.teacherData.studentList = res.studentList
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.$nextTick(()=> this.$set(this.teacherData,"studentList", res.studentList))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (this.userType == "student"){
|
|
|
|
|
|
|
|
|
|
if (res.length>0){
|
|
|
|
|
res = res[0]
|
|
|
|
|
this.studentData.learningProgress =res.learningProgress
|
|
|
|
|
this.studentData.learnTime =res.learnTime
|
|
|
|
|
this.studentData.learnNum =res.learnNum
|
|
|
|
|
this.studentData.totalLearnTime = res.totalLearnTime
|
|
|
|
|
this.studentData.imgLearnNum = res.imgLearnNum
|
|
|
|
|
this.studentData.audioLearnNum = res.audioLearnNum
|
|
|
|
|
this.studentData.videoLearnNum = res.videoLearnNum
|
|
|
|
|
this.studentData.videoLearnTime = res.videoLearnTime
|
|
|
|
|
this.studentData.audioLearnTime = res.audioLearnTime
|
|
|
|
|
|
|
|
|
|
this.studentData.answersNum = res.answersNum
|
|
|
|
|
|
|
|
|
|
// noteNum:'',//笔记数量
|
|
|
|
|
// bookmarkNum:'',//书签数量
|
|
|
|
|
// lineationNum:''//划线数量
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.studentData.noteNum= this.data.notes.list.length
|
|
|
|
|
this.studentData.bookmarkNum = this.data.bookmark.list.length
|
|
|
|
|
this.studentData.lineationNum = this.data.highlight.list.length
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
2024-06-13 00:50:28 +00:00
|
|
|
// 学生笔记操作 start
|
|
|
|
|
addNote(model) {
|
2024-06-18 03:30:25 +00:00
|
|
|
bookApi.note.add({
|
|
|
|
|
bookId:this.bookId,
|
|
|
|
|
data:JSON.stringify(model)
|
|
|
|
|
})
|
2024-06-13 00:50:28 +00:00
|
|
|
this.addData('notes', model)
|
|
|
|
|
},
|
|
|
|
|
editNote(model) {
|
2024-06-18 03:30:25 +00:00
|
|
|
bookApi.note.edit({
|
|
|
|
|
bookId:this.bookId,
|
|
|
|
|
data:JSON.stringify(model)
|
|
|
|
|
})
|
2024-06-13 00:50:28 +00:00
|
|
|
this.updateData('notes', model)
|
|
|
|
|
},
|
|
|
|
|
deleteNote(model,feedback) {
|
2024-06-18 03:30:25 +00:00
|
|
|
|
|
|
|
|
bookApi.note.delete({
|
|
|
|
|
bookId:this.bookId,
|
|
|
|
|
data:JSON.stringify(model)
|
|
|
|
|
})
|
2024-06-13 00:50:28 +00:00
|
|
|
this.deleteData('notes', model)
|
|
|
|
|
feedback()
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 教师笔记操作 start
|
|
|
|
|
addTeacherNote(model, rollback) {
|
2024-06-20 02:26:29 +00:00
|
|
|
bookApi.resource.add({
|
2024-06-18 03:30:25 +00:00
|
|
|
bookId:this.bookId,
|
|
|
|
|
data:JSON.stringify(model)
|
|
|
|
|
})
|
|
|
|
|
this.addData('resources', model)
|
2024-06-13 00:50:28 +00:00
|
|
|
},
|
|
|
|
|
editTeacherNote(model) {
|
2024-06-20 02:26:29 +00:00
|
|
|
bookApi.resource.edit({
|
2024-06-18 03:30:25 +00:00
|
|
|
bookId:this.bookId,
|
|
|
|
|
data:JSON.stringify(model)
|
|
|
|
|
})
|
2024-06-13 00:50:28 +00:00
|
|
|
this.updateData('resources', model)
|
|
|
|
|
},
|
|
|
|
|
deleteTeacherNote(model, feedback) {
|
2024-06-20 02:26:29 +00:00
|
|
|
bookApi.resource.delete({
|
2024-06-18 03:30:25 +00:00
|
|
|
bookId:this.bookId,
|
|
|
|
|
data:JSON.stringify(model)
|
|
|
|
|
})
|
2024-06-13 00:50:28 +00:00
|
|
|
this.deleteData('resources', model)
|
|
|
|
|
feedback()
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 高亮操作
|
|
|
|
|
addHighlight(model, rollback) {
|
2024-06-18 03:30:25 +00:00
|
|
|
|
|
|
|
|
bookApi.highlight.add({
|
|
|
|
|
bookId:this.bookId,
|
|
|
|
|
data:JSON.stringify(model)
|
|
|
|
|
})
|
2024-06-13 00:50:28 +00:00
|
|
|
this.addData('highlight', model)
|
|
|
|
|
},
|
|
|
|
|
// 高亮删除
|
|
|
|
|
deleteHighlight(model, rollback) {
|
2024-06-18 03:30:25 +00:00
|
|
|
|
|
|
|
|
bookApi.highlight.delete({
|
|
|
|
|
bookId:this.bookId,
|
|
|
|
|
data:JSON.stringify(model)
|
|
|
|
|
})
|
2024-06-13 00:50:28 +00:00
|
|
|
this.deleteData('highlight', model)
|
|
|
|
|
console.log(model,"model")
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
settingChange(key, value) {
|
|
|
|
|
// let newSetting = Object.assign({}, this.setting, { [key]: value })
|
|
|
|
|
// localStorage.setItem('setting_#_' + this.textBookData.id, JSON.stringify(newSetting))
|
|
|
|
|
// this.setting = JSON.parse(localStorage.getItem('setting_#_' + this.textBookData.id)) || {}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 更新笔记
|
|
|
|
|
updateNotes(model) {
|
2024-06-18 03:30:25 +00:00
|
|
|
|
|
|
|
|
bookApi.note.edit({
|
|
|
|
|
bookId:this.bookId,
|
|
|
|
|
data:JSON.stringify(model)
|
|
|
|
|
})
|
2024-06-13 00:50:28 +00:00
|
|
|
this.updateData('notes', model)
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 添加书签
|
2024-06-18 03:30:25 +00:00
|
|
|
addBookmark(e) {
|
|
|
|
|
bookApi.bookmark.add({
|
|
|
|
|
bookId:this.bookId,
|
|
|
|
|
data:JSON.stringify(e)
|
|
|
|
|
})
|
2024-06-13 00:50:28 +00:00
|
|
|
this.addData('bookmark', e)
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 删除书签
|
|
|
|
|
deleteBookmark(e) {
|
2024-06-18 03:30:25 +00:00
|
|
|
bookApi.bookmark.delete({
|
|
|
|
|
bookId:this.bookId,
|
|
|
|
|
pkid:e.pkid,
|
|
|
|
|
data:JSON.stringify(e)
|
|
|
|
|
})
|
2024-06-13 00:50:28 +00:00
|
|
|
this.deleteData('bookmark', e)
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 添加数据
|
|
|
|
|
addData(type, item) {
|
|
|
|
|
this.data[type].list.push(item)
|
|
|
|
|
let list = JSON.stringify(this.data)
|
|
|
|
|
localStorage.setItem('simulated-data_' + this.textBookData.id, list)
|
|
|
|
|
this.getData(type, item)
|
|
|
|
|
},
|
|
|
|
|
|
2024-06-18 03:30:25 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
async getMineData(){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.data.notes.list = await bookApi.note.list({
|
|
|
|
|
bookId:this.bookId,
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
this.data.bookmark.list = await bookApi.bookmark.list({
|
|
|
|
|
bookId:this.bookId
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
this.data.highlight.list = await bookApi.highlight.list({
|
|
|
|
|
bookId:this.bookId
|
|
|
|
|
})
|
|
|
|
|
this.data.resources.list = await bookApi.resource.list({
|
|
|
|
|
bookId:this.bookId
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
2024-06-13 00:50:28 +00:00
|
|
|
// 查询数据
|
|
|
|
|
getData(type, item) {
|
|
|
|
|
setTimeout(() => {
|
2024-06-18 03:30:25 +00:00
|
|
|
// JSON.parse(localStorage.getItem('simulated-data_' + this.textBookData.id))
|
|
|
|
|
|
|
|
|
|
this.data =
|
|
|
|
|
JSON.parse(localStorage.getItem('simulated-data_' + this.textBookData.id))
|
|
|
|
|
|
|
|
|
|
|| {
|
2024-06-13 00:50:28 +00:00
|
|
|
notes: {
|
|
|
|
|
list: []
|
|
|
|
|
},
|
|
|
|
|
bookmark: {
|
|
|
|
|
list: []
|
|
|
|
|
},
|
|
|
|
|
highlight: {
|
|
|
|
|
list: []
|
|
|
|
|
},
|
|
|
|
|
resources: {
|
|
|
|
|
list: []
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-06-18 03:30:25 +00:00
|
|
|
//
|
2024-06-13 00:50:28 +00:00
|
|
|
}, 300)
|
|
|
|
|
},
|
|
|
|
|
getSetting() {
|
|
|
|
|
this.setting = JSON.parse(localStorage.getItem('setting_#_' + this.textBookData.id)) || {}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 更新数据
|
|
|
|
|
updateData(type, item) {
|
|
|
|
|
console.log(item)
|
|
|
|
|
let i = this.data[type].list.findIndex((items) => items.id == item.id)
|
|
|
|
|
this.data[type].list[i] = item
|
|
|
|
|
let list = JSON.stringify(this.data)
|
|
|
|
|
localStorage.setItem('simulated-data_' + this.textBookData.id, list)
|
|
|
|
|
this.getData(type, item)
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 删除数据
|
|
|
|
|
deleteData(type, item) {
|
|
|
|
|
console.log(item,"deleteData")
|
|
|
|
|
let i = this.data[type].list.findIndex((items) => items.id == item.id)
|
|
|
|
|
this.data[type].list.splice(i, 1)
|
|
|
|
|
let list = JSON.stringify(this.data)
|
|
|
|
|
localStorage.setItem('simulated-data_' + this.textBookData.id, list)
|
|
|
|
|
this.getData(type, item)
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 下载资源文件
|
2024-06-18 03:30:25 +00:00
|
|
|
downloadFile(e) {
|
|
|
|
|
console.log(e)
|
|
|
|
|
},
|
2024-06-13 00:50:28 +00:00
|
|
|
|
|
|
|
|
// 更新阅读进度
|
|
|
|
|
updateReadLocation(newLocation) {
|
2024-06-18 03:30:25 +00:00
|
|
|
|
2024-09-12 01:17:30 +00:00
|
|
|
|
2024-06-18 03:30:25 +00:00
|
|
|
console.log('我要更新阅读进度了'+newLocation)
|
|
|
|
|
bookApi.userAction.updateReadLocation({
|
|
|
|
|
bookId:this.bookId,
|
|
|
|
|
data: newLocation.location
|
|
|
|
|
})
|
2024-06-13 00:50:28 +00:00
|
|
|
localStorage.setItem(this.textBookData.id, newLocation.location)
|
2024-09-12 01:17:30 +00:00
|
|
|
|
|
|
|
|
var params ={
|
|
|
|
|
bookId:this.bookId,
|
|
|
|
|
userId: this.userId,
|
|
|
|
|
classId: this.classId,
|
|
|
|
|
lastAt:Math.floor(Date.now() / 1000),
|
|
|
|
|
// learnNum:1,
|
|
|
|
|
learningProgress:newLocation.schedule
|
|
|
|
|
}
|
|
|
|
|
bookApi.study.update({data:JSON.stringify(params)})
|
2024-06-13 00:50:28 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 添加教师资源
|
|
|
|
|
addResources(e) {
|
2024-06-18 07:53:13 +00:00
|
|
|
bookApi.resource.add({
|
|
|
|
|
bookId:this.bookId,
|
|
|
|
|
data:JSON.stringify(e)
|
|
|
|
|
})
|
2024-06-13 00:50:28 +00:00
|
|
|
this.addData('resources', e)
|
|
|
|
|
},
|
|
|
|
|
// 删除教师资源
|
|
|
|
|
deleteResource(e) {
|
2024-06-18 07:53:13 +00:00
|
|
|
bookApi.resource.delete({
|
|
|
|
|
bookId:this.bookId,
|
|
|
|
|
data:JSON.stringify(e)
|
|
|
|
|
})
|
2024-06-13 00:50:28 +00:00
|
|
|
this.deleteData('resources', e)
|
|
|
|
|
},
|
|
|
|
|
// 编辑教师资源
|
|
|
|
|
editResources(e) {
|
2024-06-18 07:53:13 +00:00
|
|
|
bookApi.resource.edit({
|
|
|
|
|
bookId:this.bookId,
|
|
|
|
|
data:JSON.stringify(e)
|
|
|
|
|
})
|
2024-06-13 00:50:28 +00:00
|
|
|
this.updateData('resources', e)
|
2024-09-12 01:17:30 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
learningStatistics(e){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var params ={
|
|
|
|
|
bookId:this.bookId,
|
|
|
|
|
userId: this.userId,
|
|
|
|
|
classId: this.classId,
|
|
|
|
|
lastAt:Math.floor(Date.now() / 1000),
|
|
|
|
|
// learnNum:1
|
2024-06-13 00:50:28 +00:00
|
|
|
}
|
2024-09-12 01:17:30 +00:00
|
|
|
|
|
|
|
|
if (e.type =="image"){
|
|
|
|
|
|
|
|
|
|
params.imgLearnNum = 1
|
|
|
|
|
}
|
|
|
|
|
if (e.type =="audio"){
|
|
|
|
|
|
|
|
|
|
params.audioLearnTime = 10
|
|
|
|
|
params.audioLearnNum = 1
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (e.type =="video"){
|
|
|
|
|
|
|
|
|
|
params.videoLearnTime = 10
|
|
|
|
|
params.videoLearnNum = 1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (e.type =="question"){
|
|
|
|
|
|
|
|
|
|
params.answersNum = 1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bookApi.study.update({data:JSON.stringify(params)})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
console.log(e)
|
|
|
|
|
},
|
|
|
|
|
changeClass(e){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.classId = e.pkid
|
|
|
|
|
|
|
|
|
|
this.className = e.title
|
|
|
|
|
this.studySituation()
|
|
|
|
|
console.log(e)
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
2024-06-13 00:50:28 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|