|
@@ -474,24 +474,25 @@ export default {
|
|
|
params.expire = true
|
|
|
}
|
|
|
this.$api.lessonRecord.getLessonList(params).then(
|
|
|
- res => {
|
|
|
+ async res => {
|
|
|
if (res.lessonRecords) {
|
|
|
res.lessonRecords.forEach(item => {
|
|
|
item.show = item.show ? item.show : []
|
|
|
item.isShare = item.show.includes('student')
|
|
|
})
|
|
|
- this.recordList = res.lessonRecords
|
|
|
+ let reList = res.lessonRecords
|
|
|
let sasInfo = {}
|
|
|
let blobInfo = this.rcdParams.scope === 'school' ? this.$store.state.user.schoolProfile : this.$store.state.user.userProfile
|
|
|
sasInfo.sas = '?' + blobInfo.blob_sas
|
|
|
sasInfo.name = this.rcdParams.scope === 'school' ? this.$store.state.userInfo.schoolCode : this.$store.state.userInfo.TEAMModelId
|
|
|
sasInfo.url = blobInfo.blob_uri.slice(0, blobInfo.blob_uri.lastIndexOf(sasInfo.name) - 1)
|
|
|
- this.recordList.forEach(item => {
|
|
|
+ reList.forEach(item => {
|
|
|
item.sokrateImg = `${sasInfo.url}/${sasInfo.name}/records/${item.id}/Sokrates/SokratesResults/event.png${sasInfo.sas}`
|
|
|
item.eNote = `${sasInfo.url}/${sasInfo.name}/records/${item.id}/Note.pdf${sasInfo.sas}`
|
|
|
item.video = `${sasInfo.url}/${sasInfo.name}/records/${item.id}/Record/CourseRecord.mp4${sasInfo.sas}`
|
|
|
- item.poster = `${sasInfo.url}/${sasInfo.name}/records/${item.id}/Record/CoverImage.jpg${sasInfo.sas}`
|
|
|
+ // item.poster = `${sasInfo.url}/${sasInfo.name}/records/${item.id}/Record/CoverImage.jpg${sasInfo.sas}`
|
|
|
})
|
|
|
+ this.recordList = await this.getCoverImg(reList)
|
|
|
this.recordList.sort((a, b) => {
|
|
|
return a.startTime - b.startTime > 0 ? -1 : 1
|
|
|
})
|
|
@@ -502,6 +503,35 @@ export default {
|
|
|
}
|
|
|
)
|
|
|
},
|
|
|
+ getCoverImg(lists) {
|
|
|
+ return new Promise(async (resolve, reject) => {
|
|
|
+ let promiseArr = []
|
|
|
+ let sasInfo = {}
|
|
|
+ let blobInfo = this.rcdParams.scope === 'school' ? this.$store.state.user.schoolProfile : this.$store.state.user.userProfile
|
|
|
+ sasInfo.sas = '?' + blobInfo.blob_sas
|
|
|
+ sasInfo.name = this.rcdParams.scope === 'school' ? this.$store.state.userInfo.schoolCode : this.$store.state.userInfo.TEAMModelId
|
|
|
+ sasInfo.url = blobInfo.blob_uri.slice(0, blobInfo.blob_uri.lastIndexOf(sasInfo.name) - 1)
|
|
|
+ lists.forEach((item, index) => {
|
|
|
+ promiseArr.push(new Promise(async (r, j) => {
|
|
|
+ let imageCover = ''
|
|
|
+ try {
|
|
|
+ let url = `${sasInfo.url}/${sasInfo.name}/records/${item.id}/IES/TimeLine.json${sasInfo.sas}`
|
|
|
+ let res = JSON.parse(await this.$tools.getFile(url))
|
|
|
+ let pgids = res.PgIdList || []
|
|
|
+ imageCover = `${sasInfo.url}/${sasInfo.name}/records/${item.id}/Memo/${pgids[0]}.jpg${sasInfo.sas}`
|
|
|
+ } catch (e) {
|
|
|
+ }
|
|
|
+ item.poster = imageCover
|
|
|
+ r(item)
|
|
|
+ }))
|
|
|
+ })
|
|
|
+ Promise.all(promiseArr).then(res => {
|
|
|
+ resolve(res)
|
|
|
+ }).catch(err => {
|
|
|
+ reject(err)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
},
|
|
|
watch: {
|
|
|
rcdParams: {
|