提交 63577ce2 authored 作者: zhengyadong's avatar zhengyadong

修改

上级 b5731783
......@@ -8,13 +8,17 @@
</template>
<script>
import { getUserAPI } from '@/api/login'
export default {
name: 'App',
data(){
return{}
},
created() {
created(){
console.log(11111);
getUserAPI().then(res=>{
console.log(res,22);
})
},
methods:{
......
......@@ -24,3 +24,12 @@ export function getPhoneCodeAPI(data){
data
})
}
export function getUserAPI() {
return request({
url: `${requestPath.resource}/member-center/check/login`,
method: 'get'
})
}
......@@ -46,9 +46,9 @@ Vue.use(VideoPlayer)
/*import './.xgplayer/skin/index.js';*/
import valert from './components/alertMess/index.js'
Vue.use(valert);
// import Vconsole from 'vconsole';
// const vConsole = new Vconsole();
// export default vConsole;
import Vconsole from 'vconsole';
const vConsole = new Vconsole();
export default vConsole;
/*id图片路径*/
Vue.prototype.imgLink=function(id){
......
<template>
<div class="pdf_wrap">
<!-- <iframe :src="`${this.domain}${requestPath.file}?fileName=${this.videoAndPdf}&isOnLine=true`" frameborder="0" class="iframe"> </iframe> -->
<!-- <div v-if="pdfAndPath" v-html="iframeHtml" style="width:100%;height:100%" > -->
<!-- </div> -->
<div v-if="pdfAndPath" v-html="iframeHtml" style="width:100%;height:100%" >
</div>
<ul class="back_btn">
<li @click="collection"><img :src="`./static/img/icon_soucang_${isColl?'sel':'nor'}.png`" alt=""></li>
<li @click="goBack"><img src="../../assets/img/public/fanhui.png" alt=""></li>
......@@ -57,7 +57,12 @@ export default {
// 查询是否已经达到最大积分
let res1 = await this.getExceed()
if(!res1) return
if(!res1) {
this.learnTime = setInterval(()=>{
this.saveLearn()
},5*1000)
return
}
// 保存学习记录
this.time = setTimeout(()=>{
......@@ -126,6 +131,16 @@ export default {
console.log(res.data,'学习时长');
})
},
// 超过积分上限保存学习时长
saveLearn(){
let form = {
id:this.videoAndPdf,
studyTime:(new Date().getTime())-this.startTime
}
saveLearnTimeAPI(form).then(res=>{
console.log(res.data,'超过积分上限学习时长');
})
},
getCollectioncheck(){
......
......@@ -375,7 +375,7 @@ export default {
_showDetail(startIndex){ // startIndex 0 代表大题,1代表小题
let currentObj = this.currentObj
if(currentObj.questionType === 5||currentObj.questionType === 6){
let list = this.childrenList = this.currentObj.children
let list = this.childrenList = this.currentObj.children||[]
let index = startIndex === 0 ? 0 : list.length - 1
this.currentChildrenIndex = index
this.currentChildrenObj = this.childrenList[index]||{}
......
......@@ -201,10 +201,10 @@ export default {
_showDetail(startIndex){
let currentObj = this.currentObj
if(currentObj.questionType === 5||currentObj.questionType === 6){
let list = this.childrenList = this.currentObj.children
let list = this.childrenList = this.currentObj.children||[]
let index = startIndex === 0 ? 0 : list.length - 1
this.currentChildrenIndex = index
this.currentChildrenObj = this.childrenList[index]
this.currentChildrenObj = this.childrenList[index]||{}
this._showCom(this.currentChildrenObj)
this.changeScore(this.currentChildrenObj,this.refChildrenObj)
......
......@@ -259,10 +259,10 @@ export default {
_showDetail(startIndex){
let currentObj = this.currentObj
if(currentObj.questionType === 5||currentObj.questionType === 6){
let list = this.childrenList = this.currentObj.children
let list = this.childrenList = this.currentObj.children||[]
let index = startIndex === 0 ? 0 : list.length - 1
this.currentChildrenIndex = index
this.currentChildrenObj = this.childrenList[index]
this.currentChildrenObj = this.childrenList[index]||{}
this._showCom(this.currentChildrenObj)
this.changeScore(this.currentChildrenObj,this.refChildrenObj)
......
......@@ -47,7 +47,7 @@
<img src="" alt="">
<span class="item-right item-right-integral">积分:</span>
<span class="item-integral">+{{detail.integralNum}}</span>
<div class="item-bg" v-if="detail.isFirst == 1">已领取积分</div> </div>
<div class="item-bg" v-if="detail.isFirst == 0">已领取积分</div> </div>
</div>
</div>
<div class="footer-but">
......
......@@ -17,6 +17,7 @@
import { getIntegralAPI, getExceedAPI,saveLearnRecordAPI,saveLearnTimeAPI} from '@/api/student'
import { getCollectioncheckAPI,addCollectionAPI,delCollectionAPI,getFilePathAPI} from '@/api/xywApi';
import {getVideo} from '../../utils/global';
import { log } from 'util';
export default {
name: 'HelloWorld',
data() {
......@@ -44,15 +45,23 @@
async saveStudy(){
// 查询积分规则
console.log(1);
let result = await this.getIntegral()
let time = Number(result[1]&&result[1].value||1)
console.log(result,1);
// 查询是否已经达到最大积分
let res1 = await this.getExceed()
if(!res1) return
console.log(res1,221);
if(!res1) {
this.learnTime = setInterval(()=>{
this.saveLearn()
},5*1000)
return
}
console.log(12);
// 保存学习记录
this.time = setTimeout(()=>{
console.log(1222);
this.saveLearnRecord()
},time*1000)
},
......@@ -119,6 +128,17 @@
})
},
// 超过积分上限保存学习时长
saveLearn(){
let form = {
id:this.videoAndPdf,
studyTime:(new Date().getTime())-this.startTime
}
saveLearnTimeAPI(form).then(res=>{
console.log(res.data,'超过积分上限学习时长');
})
},
......
......@@ -37,7 +37,7 @@
<img src="" alt="">
<span class="item-right">积分:</span>
<span class="item-integral">+{{detail.integralNum}}</span>
<div class="item-bg" v-if="detail.isFirst == 1">已领取积分</div>
<div class="item-bg" v-if="detail.isFirst == 0">已领取积分</div>
</div>
<div class="info-item info-item-1">
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论