提交 cc757016 authored 作者: zhengyadong's avatar zhengyadong

解决冲突

......@@ -23,7 +23,7 @@ module.exports = {
// Various Dev Server settings
host: 'localhost', // can be overwritten by process.env.HOST
host: '192.168.2.64', // can be overwritten by process.env.HOST
port: 8082, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
autoOpenBrowser: false,
errorOverlay: true,
......
......@@ -8,6 +8,7 @@
</template>
<script>
import { getUserAPI } from '@/api/login'
export default {
name: 'App',
data(){
......
......@@ -85,3 +85,12 @@ export function addHotswAPI(data){
})
}
// 下载文件列表
export function getDownListAPI(params){
return request({
url:`${requestPath.resource}/download/file/page`,
method:'get',
params
})
}
......@@ -24,3 +24,12 @@ export function getPhoneCodeAPI(data){
data
})
}
export function getUserAPI() {
return request({
url: `${requestPath.resource}/member-center/check/login`,
method: 'get'
})
}
import request from '@/utils/request';
import { requestPath } from '@/utils/global.js';
// 获取积分信息
export function getIntegralAPI(params){
return request({
url:`${requestPath.commonbg}/dictionary/integral`,
method:'get',
params
})
}
// 是否超过最大积分
export function getExceedAPI(params){
return request({
url:`${requestPath.resourcefg}/video-library/check/exceed`,
method:'get',
params
})
}
// 保存学习记录
export function saveLearnRecordAPI(data){
return request({
url:`${requestPath.resourcefg}/video-library/save`,
method:'post',
data
})
}
// 保存学习时长
export function saveLearnTimeAPI(data){
return request({
url:`${requestPath.resourcefg}/video-library/saveOrUpdate`,
method:'post',
data
})
}
......@@ -153,3 +153,21 @@ export function sendMessageAPI(data) {
data
})
}
// 总积分
export function getIntegralAPI() {
return request({
url: `${requestPath.resourcefg}/integralLog/get/sum`,
method: 'get'
})
}
// 积分详情
export function getDetailIntegralAPI() {
return request({
url: `${requestPath.resourcefg}/integralLog/list`,
method: 'get'
})
}
<template>
<div class="no-data-tip">
<img src="@/assets/img/list/no-content.png" alt="">
<span><slot></slot></span>
</div>
</template>
......@@ -26,7 +27,14 @@ export default {
line-height: .36rem;
font-size: .16rem;
img{
width: 2rem;
margin: 0 auto;
}
span{
display: inline-block;
color: #999999;
padding-top: .3rem;
font-size: .18rem;
}
}
</style>
......@@ -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){
......@@ -108,6 +108,20 @@ Vue.prototype.timeE=function(val){
return val;
}
var a = function(s, t) {
let flag = true
let str = t
for(let i = 0; i< s.length; i ++){
let j = t.indexOf(s[i])
if(j > -1){
str = str.substr(j + 1)
}else{
flag = false
break
}
}
return flag
}
new Vue({
......
......@@ -70,6 +70,15 @@ let router = new Router({
component: () => import('@/views/my/index.vue'),
},
{
path: '/integral',
name: 'integral',
meta: {
title: "积分明细",
isLogin: true
},
component: () => import('@/views/my/integral.vue'),
},
{
path: '/myCompletion',
name: 'myCompletion',
meta:{
......
......@@ -22,6 +22,10 @@ export const baseUrl = `${process.env.BASE_API}/wap-y/index.html#`/*分享文章
export const downloadPath = 'download'
export const uploadPath = 'upload'
export const downText = function(link){
console.log(`${process.env.BASE_API}file/file/download/${link}`,22222222);
window.open(`${process.env.BASE_API}file/file/download/${link}`,'_blank')
}
export const videoUrl = function(link){
// return `${process.env.BASE_API}/file/file/?fileName=${link}&isOnLine=true`
return `${process.env.BASE_API}/file/file/download/${link}`
......
......@@ -114,7 +114,7 @@ export default {
<style scoped lang="less">
.answer-record {
width: 100%;
height: 100%;
// height: 100%;
position: relative;
background: #f2f2f2;
.banner {
......@@ -210,6 +210,7 @@ export default {
}
.record-list {
height: calc(100% - 1rem - 1.11rem);
.list-item {
margin: 0.1rem 0.14rem;
background: #fff;
......
......@@ -15,7 +15,9 @@
<script>
import { Toast,Icon } from 'vant';
import { uploadUrl, uploadPath, requestPath } from "@/utils/global.js";
import { getIntegralAPI, getExceedAPI,saveLearnRecordAPI,saveLearnTimeAPI} from '@/api/student'
import { getPathAPI,getCollectioncheckAPI,addCollectionAPI,delCollectionAPI} from '@/api/xywApi';
import { setTimeout, setInterval, clearInterval } from 'timers';
export default {
name: 'pdf',
components: {
......@@ -29,16 +31,124 @@ export default {
pdfAndPath:'' ,
iframeHtml:'',
isColl:false,
time:null,
learnTime:null,
startTime:new Date().getTime(),
integraLogId:null,
}
},
created () {
this.videoAndPdf=this.$route.query.videoAndPdf;
this.getCollectioncheck();
this.saveStudy()
},
mounted () {
this.videoAndPdf=this.$route.query.videoAndPdf;
this.getPath();
},
destroyed(){
clearInterval(this.learnTime)
clearTimeout(this.time)
},
methods: {
async saveStudy(){
// 查询积分规则
let result = await this.getIntegral()
let time = Number(result[1]&&result[1].value||1)
// 查询是否已经达到最大积分
let res1 = await this.getExceed()
if(!res1) {
this.learnTime = setInterval(()=>{
this.saveLearn()
},5*60*1000)
return
}
// 保存学习记录
this.time = setTimeout(()=>{
this.saveLearnRecord()
},time*1000*60)
},
// 获取积分规则
getIntegral(){
return new Promise((resolve,reject)=>{
getIntegralAPI().then(res=>{
if(res.data.code == 0){
resolve(res.data.data)
console.log(res.data.data,2222);
}else{
reject(res.data.msg)
}
}).catch(err=>{
reject(err)
})
})
},
//判断用户积分是否已经获取到上限了
getExceed(){
let obj = {
id:this.videoAndPdf
}
return new Promise((resolve,reject)=>{
getExceedAPI(obj).then(res=>{
if(res.data.code == 0){
resolve(res.data.data)
console.log(res.data.data,33333);
}else{
console.log(res.data.msg,33333);
// reject(res.data.msg)
}
}).catch(err=>{
// reject(err)
})
})
},
// 保存学习记录
saveLearnRecord(){
let form = {
id:this.videoAndPdf,
// integraLogId:'',
}
saveLearnRecordAPI(form).then(res=>{
if(res.data.code == 0){
this.learnTime = setInterval(()=>{
this.saveLearnTime(res.data.data.id)
},5*60*1000)
console.log(res.data.data,'学习记录');
}else{
console.log(res.data.msg,33333);
}
})
},
// 保存学习时长
saveLearnTime(id){
let form = {
id:this.videoAndPdf,
integraLogId:id,
studyTime:(new Date().getTime())-this.startTime
}
saveLearnTimeAPI(form).then(res=>{
console.log(res.data,'学习时长');
})
},
// 超过积分上限保存学习时长
saveLearn(){
let form = {
id:this.videoAndPdf,
studyTime:(new Date().getTime())-this.startTime,
integraLogId:this.integraLogId
}
saveLearnTimeAPI(form).then(res=>{
if(res.data.code == 0){
this.integraLogId = res.data.data.id
console.log(res.data,'超过积分上限学习时长');
}
})
},
getCollectioncheck(){
getCollectioncheckAPI({
goodsId:this.$route.query.id,
......
......@@ -194,7 +194,7 @@
if (this.phone == '') {
return '请输入手机号';
} else {
if (!(/^1[3456789]\d{9}$/.test(this.phone))) {
if (!(/^1\d{10}$/.test(this.phone))) {
return '请输入正确的手机号';
} else {
return '';
......
......@@ -5,9 +5,13 @@
<div class="list-cnt">
<div v-for="(item,key) in list" :key="key" class="list-item">
<div class="item-name" >{{item.name}}</div>
<div class="item-detail">
<div class="item-time">
<div class="item-time">
<span v-if="item.beginTime">{{item.beginTime}}-{{item.endTime}}</span>
<span v-else></span>
</div>
<div class="item-detail">
<div class="item-integral">
<span class="integral-num" v-if="item.integralNum">+{{item.integralNum}}</span><span v-if="item.integralNum" class="integral-text">积分</span>
</div>
<div class="item-btn">
<span v-if="item.examStatus === '3'||item.examStatus === '-2'||item.examStatus === '-1'" @click="view(item)">查看解析</span>
......@@ -16,8 +20,8 @@
</div>
</div>
<div>
<div v-if="list.length == 0">
<none-data></none-data>
<div v-if="list.length == 0&&listStatus">
<none-data>暂无相关内容</none-data>
</div>
<list-footer title='这是我的底线' v-if="list.length > 5"></list-footer>
</div>
......@@ -70,6 +74,7 @@ export default {
},
},
toastPage:null,
listStatus:false
};
},
created() {
......@@ -84,9 +89,11 @@ export default {
loadingType: 'spinner',
duration: 0
});
this.listStatus = false
getMoonListAPI(this.listQuery).then(res=>{
this.toastPage.clear()
if(res.data.code == 0){
this.listStatus = true
this.list = res.data.data.list
}
})
......@@ -134,7 +141,8 @@ export default {
margin: .1rem .15rem;
padding: .15rem .12rem;
box-sizing: border-box;
height: 1rem;
// height: 1rem;
height: 1.3rem;
background: #fff;
border-radius: .05rem;
.item-name{
......@@ -152,8 +160,20 @@ export default {
}
}
}
.item-integral{
font-size: .12rem;
color: #FA4F03;
.integral-num{
font-weight: Bold;
}
.integral-text{
}
}
.item-time{
height: .28rem;
line-height: .28rem;
color: #999999;
font-size: .11rem;
}
......
......@@ -33,7 +33,7 @@
<div style="minHeight:.05rem;">
<div style="display:flex">
<p-button name="上一题" @click="childrenPrevQuestion" class-type="prev" v-if="currentChildrenIndex != 0"></p-button>
<p-button name="下一题" @click="childrenNextQuestion" v-if="!(currentIndex === list.length -1&&currentChildrenIndex === childrenList.length - 1)"></p-button>
<p-button name="下一题" @click="childrenNextQuestion" v-if="!(currentIndex === list.length -1&&(currentChildrenIndex === childrenList.length - 1||childrenList.length == 0))"></p-button>
</div>
</div>
<div>
......@@ -47,8 +47,8 @@
<p-button name="下一题" @click="nextQuestion" v-if="currentIndex+1 != list.length"></p-button>
</div>
</div>
<div v-if="list.length == 0">
<none-data></none-data>
<div v-if="list.length == 0&&listStatus">
<none-data>暂无相关内容</none-data>
</div>
......@@ -228,6 +228,7 @@ export default {
},
componentName:'',
toastPage:null,
listStatus:false
};
},
async created() {
......@@ -305,6 +306,7 @@ export default {
loadingType: 'spinner',
duration: 0
});
this.listStatus = false
let API
if(status){
API = getMatchConDetailAPI(this.conQuery)
......@@ -314,6 +316,7 @@ export default {
API.then(res=>{
this.toastPage.clear()
if(res.data.code == 0){
this.listStatus = true
if(res.data.data.length === 0) return
this.list = res.data.data
if(this.list.length == 0) return
......@@ -344,7 +347,6 @@ export default {
// 继续答题初始化用户答案数据
resetList(list){
let startIndex = 0
// this.answerRecordList
list.forEach((item,index)=>{
if(item.questionType == '5'||item.questionType == '6'){
item.children.forEach((el,ind)=>{
......@@ -375,21 +377,12 @@ export default {
// 根据题目类型来确定渲染内容
_showDetail(startIndex){ // startIndex 0 代表大题,1代表小题
let currentObj = this.currentObj
if(currentObj.questionType === 5||currentObj.questionType === 6){
console.log(this.currentObj,4556);
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
console.log(this.childrenList,11,index);
this.currentChildrenObj = this.childrenList[index]
this.currentChildrenObj = this.childrenList[index]||{}
this._showCom(this.currentChildrenObj)
console.log(this.currentChildrenObj,333);
this.changeAns('refChildrenObj',this.currentChildrenObj,'_getUserChildAnswer')
}else{
this._showCom(currentObj)
......@@ -397,6 +390,7 @@ export default {
}
},
changeAns(refName,currentObj,getAnsMethod){
if(!currentObj||!currentObj.questionType) return
this.$nextTick(()=>{
let key = currentObj.questionType == '4' ? 'value':'activeName' // 填空题
this.userAns = this.$refs[this[refName][currentObj.questionType]][key] = this[getAnsMethod](this.currentIndex,this.currentChildrenIndex)
......
......@@ -19,7 +19,7 @@
<div style="minHeight:.05rem;">
<div style="display:flex">
<p-button name="上一题" @click="childrenPrevQuestion" class-type="prev"></p-button>
<p-button name="下一题" @click="childrenNextQuestion" v-if="!(currentIndex === list.length -1&&currentChildrenIndex === childrenList.length - 1)"></p-button>
<p-button name="下一题" @click="childrenNextQuestion" v-if="!(currentIndex === list.length -1&&(currentChildrenIndex === childrenList.length - 1||childrenList.length == 0))"></p-button>
</div>
</div>
<right-answer :analysis='currentChildrenObj.analysis' :answer="currentChildrenObj.rightanswer"></right-answer>
......@@ -37,8 +37,8 @@
</div>
</div>
<div v-if="list.length == 0">
<none-data></none-data>
<div v-if="list.length == 0&&listStatus">
<none-data>暂无相关内容</none-data>
</div>
<!-- 答案 -->
<div v-if="(qusType([1,2,3,4],currentObj.questionType))">
......@@ -154,7 +154,8 @@ export default {
'4':completion
},
componentName:'',
title:''
title:'',
listStatus:false
};
},
created() {
......@@ -185,8 +186,10 @@ export default {
},
// 获取题目详情
getDetail(){
this.listStatus = false
getWeekDetailAPI(this.listQuery).then(res=>{
if(res.data.code == 0){
this.listStatus = true
if(res.data.data.length === 0) return
this.list = res.data.data
this.currentIndex = 0 // 当前选中索引值
......@@ -201,10 +204,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)
......
......@@ -27,7 +27,7 @@
<div style="minHeight:.05rem;">
<div style="display:flex">
<p-button name="上一题" @click="childrenPrevQuestion" class-type="prev"></p-button>
<p-button name="下一题" @click="childrenNextQuestion" v-if="!(currentIndex === list.length -1&&currentChildrenIndex === childrenList.length - 1)"></p-button>
<p-button name="下一题" @click="childrenNextQuestion" v-if="!(currentIndex === list.length -1&&(currentChildrenIndex === childrenList.length - 1||childrenList.length == 0))"></p-button>
</div>
</div>
<right-answer :analysis='currentChildrenObj.analysis' :answer="currentChildrenObj.rightanswer" :show-ans="true" :ans-status="ansStatus"></right-answer>
......@@ -37,8 +37,8 @@
</text-case>
</div>
</div>
<div v-if="list.length == 0">
<none-data></none-data>
<div v-if="list.length == 0&&listStatus">
<none-data>暂无相关内容</none-data>
</div>
<!-- 切换题目 -->
<div v-if="qusType([1,2,3,4],currentObj.questionType)" style="minHeight:.05rem;">
......@@ -201,6 +201,7 @@ export default {
goodsType:4,
},
collectionStatus:false,
listStatus:false
};
},
created() {
......@@ -238,12 +239,14 @@ export default {
loadingType: 'spinner',
duration: 0
});
this.listStatus = false
this.topTitle = this.viewType[type].title
this.iconType = this.viewType[type].iconType
let API = this.viewType[type]['API'](this[this.viewType[type].query])
API.then(res=>{
if(res.data.code == 0){
this.toastPage.clear()
this.listStatus = true
if(res.data.data.length === 0) return
this.list = res.data.data
this.currentIndex = 0 // 当前选中索引值
......@@ -259,10 +262,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)
......
......@@ -43,6 +43,11 @@
<span class="item-right">答错:<span class="item-per item-per-color">{{detail.errorCount | defaultCount}}</span><span class="item-false"></span></span>
<span class="item-false item-point">未答:<span class="item-num item-num-color">{{detail.unFinishCount | defaultCount}}</span><span class="item-false"></span></span>
</div>
<div class="info-item info-integral">
<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 == 0">已领取积分</div> </div>
</div>
</div>
<div class="footer-but">
......@@ -108,6 +113,7 @@ export default {
this.$router.push({name:'moonMatch'})
},
view(){
console.log(111);
this.$router.push({name:'viewMatch',query:{id:this.id, type:'match'}})
},
doAgain() {
......@@ -185,10 +191,12 @@ export default {
.report-statistics {
margin-top: -0.8rem;
padding: 0 0.1rem;
// height: 1.66rem;
height: 1.66rem;
.statistics-detail {
position: relative;
height: 1.9rem;
// height: 1.9rem;
height: 2.26rem;
width: 100%;
background: url("~@/assets/img/practice/match-view-bg.png") no-repeat;
background-size: cover;
......@@ -242,7 +250,7 @@ export default {
bottom: 0;
left: 0;
right: 0;
height: 1rem;
height: 1.6rem;
display: flex;
padding-left: 0.27rem;
padding-bottom: 0.1rem;
......@@ -292,11 +300,35 @@ export default {
}
}
.info-long{
bottom: -.3rem;
// bottom: -.3rem;
height: 1rem;
}
.info-integral{
// bottom: -.58rem;
height: .5rem;
.item-right-integral{
width: .3rem;
}
.item-integral{
margin-left: .05rem;
font-weight: Bold;
font-size: .13rem;
color: #FA4F03;
}
.item-bg{
color: #fff;
font-size: .12rem;
width: .65rem;
height: .18rem;
padding: .02rem .04rem .02rem .12rem;
transform: scale(0.9);
background: url("~@/assets/img/practice/integral-bg.png") no-repeat;
background-size: 100% 100%;
}
}
.footer-but {
margin-top: 0.5rem;
margin-top: 0.8rem;
padding: 0 0.2rem;
display: flex;
justify-content: space-around;
......
......@@ -2,11 +2,23 @@
<!--个人中心-->
<div class="my">
<div class="info">
<img :src="userMssage.reserve4?imgLink(userMssage.reserve4):defoultHead" alt="">
<img class="info-img" :src="userMssage.reserve4?imgLink(userMssage.reserve4):defoultHead" alt="">
<div class="name">
<h1>{{userMssage.realName}}</h1>
<p>{{userMssage.unitName}}</p>
</div>
<div class="integral" @click="$router.push({name:'integral'})">
<div class="integral-wrap" >
<div class="integral-wrap-num">{{integral}}</div>
<div class="integral-wrap-text">
积分
</div>
</div>
<div class="integral-wrap-img">
<img src="@/assets/img/my/right-integral.png" alt="">
</div>
</div>
</div>
<ul class="cont1">
<li v-for="(item,index) in liList" :key="index" class="publicMY">
......@@ -47,7 +59,7 @@
</template>
<script>
import {getUserMessageAPI} from '@/api/xywApi.js';
import {getUserMessageAPI,getIntegralAPI} from '@/api/xywApi.js';
import defoultHead from '../../assets/img/my/head.png';
export default {
name: 'HelloWorld',
......@@ -59,26 +71,29 @@
name:'错题本',
icon:'icon_cuotiben',
link:'/myWrongbook',
},{
name:'收藏的试题',
icon:'icon_soucang',
link:'/myCollection',
},{
name:'收藏的课件',
icon:'icon_kejian',
link:'/myCourseware',
},{
name:'答题记录',
icon:'icon_ceshijilu',
link:'/answerRecord',
}],
},{
name:'收藏的试题',
icon:'icon_soucang',
link:'/myCollection',
},{
name:'收藏的课件',
icon:'icon_kejian',
link:'/myCourseware',
},{
name:'答题记录',
icon:'icon_ceshijilu',
link:'/answerRecord',
}
],
userMssage:{
reserve4:'头像'
},
integral:0
}
},
created() {
this.getUserMessage();
this.getIntegral()
},
watch: {},
methods: {
......@@ -86,7 +101,15 @@
getUserMessage(){
getUserMessageAPI().then(res=>{
if(res.data.status){
this.userMssage=res.data.data;
this.userMssage=res.data.data||0;
}
})
},
getIntegral(){
getIntegralAPI().then(res=>{
if(res.data.status){
this.integral=res.data.data;
}
})
},
......@@ -104,6 +127,7 @@
height: 100%;
background: #f2f2f2;
overflow: auto;
position: relative;
.info{
width: 100%;
height: 1.35rem;
......@@ -111,7 +135,7 @@
background-size: cover;
display: flex;
padding-top: .55rem;
img{
.info-img{
width: .45rem;
height: .45rem;
margin-right: .11rem;
......@@ -148,7 +172,40 @@
text-overflow: ellipsis;
}
}
// 积分
.integral{
position: absolute;
top: .6rem;
right: .1rem;
display: flex;
height: .4rem;
.integral-wrap{
line-height: .2rem;
color: #fff;
.integral-wrap-num{
font-weight: Bold;
font-size: .17rem;
}
.integral-wrap-text{
font-size: .12rem;
}
}
.integral-wrap-img{
margin-left: .09rem;
width: .1rem;
display: flex;
align-items: center;
text-align: center;
img{
height: .14rem;
width: .08rem;
}
}
}
}
.publicMY{
display: flex;
justify-content: space-between;
......@@ -177,7 +234,7 @@
height: 2.16rem;
margin: -.35rem auto 0;
li{
list-style: none;
list-style: none;
}
li:last-child .word{
border-bottom: none;
......
<template>
<!--答题报告-->
<div class="integral-wrap">
<topHeader @back="backTo">
<template v-slot:title>{{topTitle}}</template>
<div class="header-right" v-if="topTitle == '积分明细'" @click="openExplain">积分说明</div>
</topHeader>
<div class="tab-change" v-if="topTitle == '积分明细'" id="integral">
<div class="tab-change-wrap">
<div v-for="(item,index) in detail" :key="index" class="tab-change-item" :class="active==index?'item-active':''" @click="change(item,index)">
<div class="item-time">{{item.time.substring(5,10).replace('-','.')}}</div>
<div class="item-num">{{item.num||0}}</div>
<div class="item-text">积分</div>
</div>
</div>
</div>
<div class="integral-item" v-if="topTitle == '积分明细'">
<div class="integral-item-now">当前积分
<span>{{detail[active]&&detail[active].num}}</span>
</div>
<div class="integral-item-time">{{detail[active]&&detail[active].time}}</div>
</div>
<div class="integral-list" v-if="detail[active]&&detail[active].list&&topTitle == '积分明细'" >
<div class="child-list">
<div v-for="item in detail[active].list" :key="item.createTime" class="list-item">
<div >
<span class="list-item-time">{{item.createTime&&item.createTime.substr(11)}}</span>
<span class="list-item-text">{{item.typeZh}}</span>
</div>
<div class="list-item-num">
<span class="list-item-num-text">{{item.num}}</span>积分
</div>
</div>
</div>
</div>
<div v-if="topTitle == '积分说明'" class="integral-info">
<div class="integral-html" v-html="integralInfo&&integralInfo[5]&&integralInfo[5].value"></div>
</div>
</div>
</template>
<script>
import { getIntegralAPI } from '@/api/student'
import { getDetailIntegralAPI } from '@/api/xywApi'
import topHeader from "@/components/header/topHeader.vue";
import { Toast } from 'vant';
export default {
name: "integral",
components:{
topHeader
},
data() {
return {
topTitle:'积分明细',
detail:[],
active:0,
integralInfo:[],
toastPage:null
};
},
filters:{
defaultCount:function(value){
return value||0
},
},
created() {
this.getDetail()
this.getIntegral()
},
watch: {},
methods: {
openExplain(){
this.topTitle = '积分说明'
},
backTo(){
if(this.topTitle == '积分明细'){
this.$router.go(-1)
}else{
this.topTitle = '积分明细'
}
},
getDetail(id) {
let data = {
paperId:id
}
this.toastPage = Toast.loading({
message: '加载中...',
forbidClick: true,
loadingType: 'spinner',
duration: 0
});
getDetailIntegralAPI(data).then(res=>{
this.toastPage.clear()
if(res.data.code == 0){
this.detail = res.data.data
}else{
this.$message.error(res.data.msg)
}
})
},
change(item,index){
this.active = Number(index)
document.getElementById('integral').scrollTop=100
},
// 获取积分规则
getIntegral(){
console.log(2222);
getIntegralAPI().then(res=>{
if(res.data.code == 0){
console.log(res.data.data,2222);
this.integralInfo = res.data.data
}else{
}
})
},
// backTo() {
// this.$router.push({name:'weekPractice'})
// },
// doAgain() {
// this.$router.push({name:'practice',query:{
// title:this.title,
// id:this.id
// }})
// }
}
};
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="less">
.integral-wrap{
height: 100%;
background: #F4F1F4;
}
.header-right{
font-size: .12rem;
}
.tab-change{
margin-top: .44rem;
height: .55rem;
width: 100%;
box-sizing: border-box;
padding: .05rem .25rem .04rem;
background: #fff;
.tab-change-wrap{
overflow-x: scroll;
display: flex;
flex-wrap:nowrap;
&::-webkit-scrollbar {
display: none;
}
.tab-change-item{
flex: 0 0 .48rem;
height: .46rem;
display: flex;
flex-direction: column;
align-items: center;
margin-right: .2rem;
border-radius: .04rem;
.item-num{
// font-size: .1rem;
font-size: .12rem;
// transform: scale(0.8);
color: #FA4F03;
}
.item-time{
padding-top: .005rem;
font-size: .12rem;
color: #727272;
}
.item-text{
// font-size: .09rem;
font-size: .12rem;
transform: scale(0.8);
color: #727272;
}
}
.item-active{
background: #FA6F52;
.item-num, .item-time, .item-text{
color: #fff;
}
}
}
}
.integral-item{
display: flex;
padding: .05rem 0.10rem 0;
justify-content: space-between;
line-height: .42rem;
.integral-item-now{
color: #333;
font-size: .125rem;
transform: scale(0.8);
span{
color: #FA4F03;
font-size: .18rem;
}
}
.integral-item-time{
color: #727272;
font-size: .125rem;
transform: scale(0.8);
}
}
.integral-list{
background: #fff;
border-radius: .08rem;
margin: 0 .1rem;
.child-list{
padding: 0 .14rem .17rem;
}
}
.list-item{
height: .6rem;
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: .005rem solid #eee;
.list-item-time{
font-size: .12rem;
color: #999999;
padding-right: .1rem;
}
.list-item-text{
font-size: .14rem;
color: #000000;
}
.list-item-num{
line-height: .15rem;
font-size: .12rem;
color: #FA4F03;
}
.list-item-num-text{
font-size: .15rem;
}
}
.integral-info{
padding: .64rem .25rem 0;
background: #fff;
height: calc(100% - .44rem);
.integral-html{
h2{
line-height: .3rem;
}
}
}
</style>
......@@ -14,23 +14,134 @@
/*import HlsJsPlayer from 'xgplayer-hls.js';*/
import HlsJsPlayer from 'xgplayer-hls.js';
import { Toast,Icon } from 'vant';
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() {
return {
isColl:false,
player:null,
videoAndPdf:'',
time:null,
learnTime:null,
startTime:new Date().getTime()
}
},
created() {
this.videoAndPdf=this.$route.query.videoAndPdf;
this.getCollectioncheck();
this.palyVideo();
this.saveStudy()
},
watch: {},
destroyed(){
clearInterval(this.learnTime)
clearTimeout(this.time)
},
methods: {
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()
console.log(res1,221);
if(!res1) {
this.learnTime = setInterval(()=>{
this.saveLearn()
},5*60*1000)
return
}
console.log(12);
// 保存学习记录
this.time = setTimeout(()=>{
console.log(1222);
this.saveLearnRecord()
},time*60*1000)
},
// 获取积分规则
getIntegral(){
return new Promise((resolve,reject)=>{
getIntegralAPI().then(res=>{
if(res.data.code == 0){
resolve(res.data.data)
console.log(res.data.data,2222);
}else{
reject(res.data.msg)
}
}).catch(err=>{
reject(err)
})
})
},
//判断用户积分是否已经获取到上限了
getExceed(){
let obj = {
id:this.videoAndPdf
}
return new Promise((resolve,reject)=>{
getExceedAPI(obj).then(res=>{
if(res.data.code == 0){
resolve(res.data.data)
console.log(res.data.data,33333);
}else{
console.log(res.data.msg,33333);
// reject(res.data.msg)
}
}).catch(err=>{
// reject(err)
})
})
},
// 保存学习记录
saveLearnRecord(){
let form = {
id:this.videoAndPdf,
// integraLogId:'',
}
saveLearnRecordAPI(form).then(res=>{
if(res.data.code == 0){
this.learnTime = setInterval(()=>{
this.saveLearnTime(res.data.data.id)
},5*60*1000)
console.log(res.data.data,'学习记录');
}else{
console.log(res.data.msg,33333);
}
})
},
// 保存学习时长
saveLearnTime(id){
let form = {
id:this.videoAndPdf,
integraLogId:id,
studyTime:(new Date().getTime())-this.startTime
}
saveLearnTimeAPI(form).then(res=>{
console.log(res.data,'学习时长');
})
},
// 超过积分上限保存学习时长
saveLearn(){
let form = {
id:this.videoAndPdf,
studyTime:(new Date().getTime())-this.startTime
}
saveLearnTimeAPI(form).then(res=>{
console.log(res.data,'超过积分上限学习时长');
})
},
getVideo(data){
console.log(2222,`${process.env.BASE_API}/file/${data}/index.m3u8`)
return `${process.env.BASE_API}/file/${data}/index.m3u8`
......@@ -38,7 +149,7 @@
// 播放视频
palyVideo(record) {
getFilePathAPI(this.$route.query.videoAndPdf).then(res=>{
getFilePathAPI(this.videoAndPdf).then(res=>{
if(res.data.code == 0){
let startIndex=res.data.data.indexOf('.mp4');
let file=res.data.data.slice(0,startIndex);
......
<template>
<!-- 下载资料-->
<div class="uploadFile">
<comHeader></comHeader>
<ul class="cont2">
<div class="uploadFile">
<comHeader></comHeader>
<ul class="cont2">
<van-list
v-model="loading"
:immediate-check="false"
:finished="finished"
:finished-text="noHave"
@load="onLoad"
>
<li v-for="(item,index) in list" :key="index" @click="upload(item)">
<h1>{{item.name}}</h1>
<h1>{{item.originalFileName}}</h1>
<!--<img src="./static/file/竞赛通知附件.docx" alt="">-->
</li>
</ul>
</div>
</van-list>
</ul>
</div>
</template>
<script>
export default {
name: 'HelloWorld',
data() {
return {
list:[
{name:'竞赛通知(含附件).docx',link:'./static/file/竞赛通知(含附件).docx'},
{name:'比武政策目录.docx',link:'./static/file/文件政策/比武政策目录.docx'},
{name:'国务院关于进一步做好稳就业工作的意见(国发[2019]28号).docx',link:'./static/file/文件政策/10.国务院关于进一步做好稳就业工作的意见(国发[2019]28号).docx'},
{name:'关于推进全方位公共就业服务的指导意见.doc',link:'./static/file/文件政策/11.关于推进全方位公共就业服务的指导意见.doc'},
{name:'关于进一步加大创业担保贷款贴息力度全力支持重点群体创业就业的通知(财金[2020]21号).docx',link:'./static/file/文件政策/12.关于进一步加大创业担保贷款贴息力度全力支持重点群体创业就业的通知(财金[2020]21号).docx'},
{name:'国务院扶贫办关于进一步支持和促进重点群体创业就业有关税收政策的通知(财税[2019]22号).docx',link:'./static/file/文件政策/13.国务院扶贫办关于进一步支持和促进重点群体创业就业有关税收政策的通知(财税[2019]22号).docx'},
{name:'关于做好当前形势下高校毕业生就业创业工作的通知(人社部发[2019]72号).doc',link:'./static/file/文件政策/14.关于做好当前形势下高校毕业生就业创业工作的通知(人社部发[2019]72号).doc'},
{name:'关于进一步加大就业扶贫力度 提高劳务组织化程度的通知(人社部发(2018)46号).docx',link:'./static/file/文件政策/15.关于进一步加大就业扶贫力度 提高劳务组织化程度的通知(人社部发(2018)46号).docx'},
{name:'国务院扶贫办关于做好易地扶贫搬迁就业帮扶工作的通知(人社部发[2019]47号).docx',link:'./static/file/文件政策/16.国务院扶贫办关于做好易地扶贫搬迁就业帮扶工作的通知(人社部发[2019]47号).docx'},
{name:'关于深入推进扶贫劳务协作提升劳务组织化程度的通知(人社厅发[2018]75号).docx',link:'./static/file/文件政策/17.关于深入推进扶贫劳务协作提升劳务组织化程度的通知(人社厅发[2018]75号).docx'},
{name:'国务院办公厅关于应对新冠肺炎疫情影响(国办发[2020]6号).docx',link:'./static/file/文件政策/18.国务院办公厅关于应对新冠肺炎疫情影响(国办发[2020]6号).docx'},
{name:'竞赛通知.docx',link:'./static/file/竞赛通知.docx'},
{name:'竞赛通知附件.docx',link:'./static/file/竞赛通知附件.docx'},
]
}
},
created() {
},
watch: {},
methods: {
upload(item){
window.open(encodeURI(item.link));
import { getDownListAPI } from '@/api/home'
import { List} from 'vant';
import { downText } from '@/utils/global'
export default {
name: "HelloWorld",
components: {
"van-list": List,
},
data() {
return {
loading: false,
finished: false,
noHave: "",
listQuery: {
pageNum: 1,
pageSize: 20
},
total: 0,
list: [
// {name:'竞赛通知(含附件).docx',link:'./static/file/竞赛通知(含附件).docx'},
// {name:'比武政策目录.docx',link:'./static/file/文件政策/比武政策目录.docx'},
// {name:'国务院关于进一步做好稳就业工作的意见(国发[2019]28号).docx',link:'./static/file/文件政策/10.国务院关于进一步做好稳就业工作的意见\(国发\[2019\]28号\).docx'},
// {name:'关于推进全方位公共就业服务的指导意见.doc',link:'./static/file/文件政策/11.关于推进全方位公共就业服务的指导意见.doc'},
// {name:'关于进一步加大创业担保贷款贴息力度全力支持重点群体创业就业的通知(财金[2020]21号).docx',link:'./static/file/文件政策/12.关于进一步加大创业担保贷款贴息力度全力支持重点群体创业就业的通知(财金[2020]21号).docx'},
// {name:'国务院扶贫办关于进一步支持和促进重点群体创业就业有关税收政策的通知(财税[2019]22号).docx',link:'./static/file/文件政策/13.国务院扶贫办关于进一步支持和促进重点群体创业就业有关税收政策的通知(财税[2019]22号).docx'},
// {name:'关于做好当前形势下高校毕业生就业创业工作的通知(人社部发[2019]72号).doc',link:'./static/file/文件政策/14.关于做好当前形势下高校毕业生就业创业工作的通知(人社部发[2019]72号).doc'},
// {name:'关于进一步加大就业扶贫力度 提高劳务组织化程度的通知(人社部发(2018)46号).docx',link:'./static/file/文件政策/15.关于进一步加大就业扶贫力度 提高劳务组织化程度的通知(人社部发(2018)46号).docx'},
// {name:'国务院扶贫办关于做好易地扶贫搬迁就业帮扶工作的通知(人社部发[2019]47号).docx',link:'./static/file/文件政策/16.国务院扶贫办关于做好易地扶贫搬迁就业帮扶工作的通知(人社部发[2019]47号).docx'},
// {name:'关于深入推进扶贫劳务协作提升劳务组织化程度的通知(人社厅发[2018]75号).docx',link:'./static/file/文件政策/17.关于深入推进扶贫劳务协作提升劳务组织化程度的通知(人社厅发[2018]75号).docx'},
// {name:'国务院办公厅关于应对新冠肺炎疫情影响(国办发[2020]6号).docx',link:'./static/file/文件政策/18.国务院办公厅关于应对新冠肺炎疫情影响(国办发[2020]6号).docx'},
// {name:'竞赛通知.docx',link:'./static/file/竞赛通知.docx'},
// {name:'竞赛通知附件.docx',link:'./static/file/竞赛通知附件.docx'},
]
};
},
created() {
this.getList();
},
watch: {},
methods: {
onLoad() {
if (this.listQuery.pageNum * 20 < this.total) {
this.listQuery.pageNum++;
this.getList();
} else {
this.finished = true;
this.noHave = "——这是我的底线——";
}
},
getList() {
this.noHave = "";
getDownListAPI(this.listQuery).then(res => {
if (res.data.status) {
this.list = [...this.list, ...res.data.data.list];
this.total = res.data.data.total || 0;
if (res.data.data.total == 0) {
this.finished = true;
this.noHave = "暂无数据";
} else if (res.data.data.pages == 1) {
this.finished = true;
this.noHave = "——这是我的底线——";
}
},
}
this.loading = false;
});
},
upload(item) {
// downText()
window.open(`${process.env.BASE_API}file/file/download/${item.fileName}`,'_blank')
// window.open(encodeURI(item.link));
}
}
};
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="less">
.uploadFile{
.uploadFile {
width: 3.75rem;
height: 100%;
background: #f3f3f3;
margin: 0;
padding: 0;
.cont2 {
padding-top: .55rem;
padding-top: 0.55rem;
li {
width: 3.27rem;
background: #fff;
border-radius: .05rem;
padding: .12rem;
margin: 0 auto .1rem;
box-shadow: .02rem .01rem .08rem rgba(0,0,0,0.1);
h1{
font-size: .14rem;
border-radius: 0.05rem;
padding: 0.12rem;
margin: 0 auto 0.1rem;
box-shadow: 0.02rem 0.01rem 0.08rem rgba(0, 0, 0, 0.1);
h1 {
font-size: 0.14rem;
color: #000000;
font-weight: normal;
line-height: .2rem;
line-height: 0.2rem;
}
.other{
.other {
display: flex;
justify-content: space-between;
padding-top: .1rem;
.indexCSS{
padding-top: 0.1rem;
.indexCSS {
display: flex;
justify-content: flex-start;
h2{
font-size: .11rem;
h2 {
font-size: 0.11rem;
font-weight: normal;
color: #999999;
span{
span {
color: #000000;
}
}
h3{
h3 {
color: #999999;
font-size: .11rem;
font-size: 0.11rem;
font-weight: normal;
padding-left: .1rem;
padding-left: 0.1rem;
}
}
h4{
h4 {
color: #999999;
font-size: .11rem;
font-size: 0.11rem;
font-weight: normal;
padding-left: .1rem;
span{
padding-left: 0.1rem;
span {
font-weight: bold;
color: #E9493E;
color: #e9493e;
}
}
}
......
......@@ -9,16 +9,23 @@
<div v-for="(el,ind) in item" :key="ind" class="item-child" @click="linkTo(el)">
<div class="item-child-cnt">
<div class="item-child-title">{{el.name}}</div>
<img src="@/assets/img/list/list-right.png" alt="">
</div>
<div class="item-child-cnt">
<div class="item-child-has" v-if="el.isJoin === '1'">已参加</div>
<div v-else class="item-child-no">未参加</div>
<div v-if="el.integralNum||el.integralNum == 0">
<span class="integral-num">+{{el.integralNum}}</span>
<span class="integral-text">积分</span>
</div>
</div>
<img src="@/assets/img/list/list-right.png" alt="">
</div>
</div>
</div>
<div>
<div v-if="list.length == 0">
<none-data></none-data>
<div v-if="list.length == 0&&listStatus">
<none-data>暂无相关内容</none-data>
</div>
<list-footer title='这是我的底线' v-if="list.length > 5"></list-footer>
</div>
......@@ -45,6 +52,7 @@ export default {
pageSize:100,
},
toastPage:null,
listStatus:false
};
},
created() {
......@@ -59,9 +67,11 @@ export default {
loadingType: 'spinner',
duration: 0
});
this.listStatus = false
getWeekListAPI(this.listQuery).then(res=>{
this.toastPage.clear()
if(res.data.code == 0){
this.listStatus = true
this.list = res.data.data.map
}
})
......@@ -98,10 +108,10 @@ export default {
}
.item-child{
display: flex;
flex-direction: column;
padding: .06rem 0 ;
line-height: .25rem;
justify-content: space-between;
align-items: center;
border-bottom: .005rem solid #EBEBEB;
img{
height: .115rem;
......@@ -111,7 +121,20 @@ export default {
border-bottom: 0;
}
.item-child-cnt{
height: .28rem;
display: flex;
justify-content: space-between;
align-items: center;
font-size: .12rem;
.integral-num{
font-size: .12rem;
color: #FA4F03;
font-weight: Bold;
}
.integral-text{
font-size: .12rem;
color: #FA4F03;
}
}
.item-child-title{
font-weight: medium;
......
......@@ -67,8 +67,8 @@
<right-answer :analysis='currentObj.analysis' :answer="currentObj.rightanswer"></right-answer>
</div>
<div v-if="list.length == 0">
<none-data></none-data>
<div v-if="list.length == 0&&listStatus">
<none-data>暂无相关内容</none-data>
</div>
<p-dialog :isShow="isShow">
......@@ -228,6 +228,7 @@ export default {
}
],
toastPage:null,
listStatus:false
};
},
created() {
......@@ -253,10 +254,12 @@ export default {
loadingType: 'spinner',
duration: 0
});
this.listStatus = false
getWeekDetailAPI(this.listQuery).then(res=>{
this.toastPage.clear()
if(res.data.code == 0){
this.list = res.data.data
this.listStatus = true
if(this.list.length === 0) return
this.currentIndex = 1 // 当前选中索引值
this.currentObj = this.list[0] // 当前选中题目
......@@ -264,10 +267,10 @@ export default {
this.colQuery.goodsId = this.currentObj.questionid
this.getColStatus()
if(this.currentObj.questionType === 5||this.currentObj.questionType === 6){
this.childrenList = this.currentObj.children
this.childrenList = this.currentObj.children||[]
if(this.childrenList.length === 0) return
this.currentChildrenIndex = 1
this.currentChildrenObj = this.childrenList[0]
this.currentChildrenObj = this.childrenList[0]||{}
this.rightAns = this.currentChildrenObj.rightanswer
}
......
......@@ -34,6 +34,13 @@
</div>
</div>
<div class="info-item">
<img src="" alt="">
<span class="item-right">积分:</span>
<span class="item-integral">+{{detail.integralNum}}</span>
<div class="item-bg" v-if="detail.isFirst == 0">已领取积分</div>
</div>
<div class="info-item info-item-1">
<img src="@/assets/img/practice/info-tip.png" alt="">
<span class="item-right">正确率:</span>
<span class="item-per">{{detail.correct}}</span>
......@@ -179,10 +186,11 @@ export default {
.report-statistics {
margin-top: -0.8rem;
padding: 0 0.1rem;
height: 1.66rem;
// height: 1.66rem;
height: 1.86rem;
.statistics-detail {
position: relative;
height: 1.66rem;
height: 2.26rem;
width: 100%;
background: url("~@/assets/img/practice/statistics-bg.png") no-repeat;
background-size: cover;
......@@ -276,6 +284,25 @@ export default {
background: #ffab18;
}
}
.item-integral{
margin-left: .05rem;
font-weight: Bold;
font-size: .13rem;
color: #FA4F03;
}
.item-bg{
color: #fff;
font-size: .12rem;
width: .65rem;
height: .18rem;
padding: .02rem .04rem .02rem .12rem;
transform: scale(0.9);
background: url("~@/assets/img/practice/integral-bg.png") no-repeat;
background-size: 100% 100%;
}
}
.info-item-1{
bottom: .4rem;
}
.footer-but {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论