提交 32878af0 authored 作者: zhengyadong's avatar zhengyadong

修改

上级 7ee9079d
......@@ -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'
})
}
......@@ -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:{
......
......@@ -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">
<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>
......@@ -134,7 +138,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 +157,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;
}
......
......@@ -344,7 +344,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 +374,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 index = startIndex === 0 ? 0 : list.length - 1
this.currentChildrenIndex = index
console.log(this.childrenList,11,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)
......
......@@ -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" >已领取积分</div> </div>
</div>
</div>
<div class="footer-but">
......@@ -185,10 +190,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 +249,7 @@ export default {
bottom: 0;
left: 0;
right: 0;
height: 1rem;
height: 1.6rem;
display: flex;
padding-left: 0.27rem;
padding-bottom: 0.1rem;
......@@ -294,9 +301,31 @@ export default {
.info-long{
bottom: -.3rem;
}
.info-integral{
bottom: -.58rem;
.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',
......@@ -71,14 +83,17 @@
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>
<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-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-text">积分</div>
</div>
</div>
</div>
</div>
</template>
<script>
import { getDetailIntegralAPI } from '@/api/xywApi'
import topHeader from "@/components/header/topHeader.vue";
export default {
name: "integral",
components:{
topHeader
},
data() {
return {
topTitle:'积分明细',
detail:[],
active:0
};
},
filters:{
defaultCount:function(value){
return value||0
},
},
created() {
this.getDetail()
},
watch: {},
methods: {
openExplain(){
this.topTitle = '积分说明'
},
backTo(){
if(this.topTitle == '积分明细'){
this.$router.go(-1)
}else{
this.topTitle = '积分明细'
}
},
getDetail(id) {
let data = {
paperId:id
}
getDetailIntegralAPI(data).then(res=>{
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)
}else{
this.$message.error(res.data.msg)
}
})
},
change(item,index){
this.active = index
}
// 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">
.header-right{
font-size: .12rem;
}
.tab-change{
margin-top: .44rem;
height: .55rem;
width: 100%;
box-sizing: border-box;
padding: .05rem .25rem .04rem;
.tab-change-wrap{
overflow-x: scroll;
display: flex;
flex-wrap:nowrap;
.tab-change-item{
flex: 1 0 .48rem;
height: .46rem;
display: flex;
flex-direction: column;
align-items: center;
margin-right: .2rem;
border-radius: .04rem;
.item-num{
font-size: .1rem;
color: #FA4F03;
}
.item-time{
font-size: .12rem;
color: #727272;
}
.item-text{
font-size: .09rem;
color: #727272;
}
}
.item-active{
background: #FA6F52;
.item-num, .item-time, .item-text{
color: #fff;
}
}
}
}
</style>
......@@ -9,10 +9,17 @@
<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>
......@@ -98,10 +105,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 +118,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;
......
......@@ -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" >已领取积分</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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论