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

增加功能

上级 2ba5d73e
......@@ -23,7 +23,7 @@ module.exports = {
// Various Dev Server settings
host: 'localhost', // can be overwritten by process.env.HOST
host: '192.168.2.39', // 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,
......
......@@ -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({
......
......@@ -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;
......
......@@ -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>
......@@ -378,7 +378,7 @@ export default {
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.changeAns('refChildrenObj',this.currentChildrenObj,'_getUserChildAnswer')
}else{
......@@ -387,6 +387,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>
......
......@@ -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>
......
......@@ -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" >已领取积分</div> </div>
<div class="item-bg" v-if="detail.isFirst == 1">已领取积分</div> </div>
</div>
</div>
<div class="footer-but">
......@@ -113,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() {
......@@ -299,10 +300,12 @@ export default {
}
}
.info-long{
bottom: -.3rem;
// bottom: -.3rem;
height: 1rem;
}
.info-integral{
bottom: -.58rem;
// bottom: -.58rem;
height: .5rem;
.item-right-integral{
width: .3rem;
}
......
<template>
<!--答题报告-->
<div>
<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">
<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}}</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">
{{item.num}}积分
</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:{
......@@ -29,7 +54,9 @@ export default {
return {
topTitle:'积分明细',
detail:[],
active:0
active:0,
integralInfo:[],
toastPage:null
};
},
filters:{
......@@ -40,6 +67,7 @@ export default {
},
created() {
this.getDetail()
this.getIntegral()
},
watch: {},
methods: {
......@@ -57,18 +85,36 @@ export default {
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.concat(res.data.data).concat(res.data.data).concat(res.data.data).concat(res.data.data).concat(res.data.data).concat(res.data.data).concat(res.data.data).concat(res.data.data).concat(res.data.data).concat(res.data.data).concat(res.data.data).concat(res.data.data).concat(res.data.data).concat(res.data.data).concat(res.data.data).concat(res.data.data).concat(res.data.data).concat(res.data.data)
this.detail = res.data.data
}else{
this.$message.error(res.data.msg)
}
})
},
change(item,index){
this.active = 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'})
// },
......@@ -84,6 +130,10 @@ export default {
<!-- 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;
}
......@@ -93,12 +143,16 @@ export default {
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: 1 0 .48rem;
flex: 0 0 .48rem;
height: .46rem;
display: flex;
flex-direction: column;
......@@ -106,15 +160,20 @@ export default {
margin-right: .2rem;
border-radius: .04rem;
.item-num{
font-size: .1rem;
// font-size: .1rem;
font-size: .125rem;
transform: scale(0.8);
color: #FA4F03;
}
.item-time{
padding-top: .005rem;
font-size: .12rem;
color: #727272;
}
.item-text{
font-size: .09rem;
// font-size: .09rem;
font-size: .12rem;
transform: scale(0.8);
color: #727272;
}
}
......@@ -127,4 +186,66 @@ export default {
}
}
}
.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{
font-size: .12rem;
color: #FA4F03;
}
}
.integral-info{
padding: .64rem .25rem 0;
background: #fff;
height: calc(100% - .44rem);
.integral-html{
h2{
line-height: .3rem;
}
}
}
</style>
......@@ -37,7 +37,7 @@
<img src="" alt="">
<span class="item-right">积分:</span>
<span class="item-integral">+{{detail.integralNum}}</span>
<div class="item-bg" >已领取积分</div>
<div class="item-bg" v-if="detail.isFirst == 1">已领取积分</div>
</div>
<div class="info-item info-item-1">
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论