测评列表滚动条问题修复
This commit is contained in:
parent
062e1d16eb
commit
6d7458fb5a
|
@ -19,6 +19,12 @@ export const loginAPI = (loginBody) => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const userInfoAPI = () => {
|
||||||
|
return request({
|
||||||
|
url: '/system/user/getInfo'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
export const getPublishAPI = () => {
|
export const getPublishAPI = () => {
|
||||||
return request({
|
return request({
|
||||||
url: '/web/scale/publish'
|
url: '/web/scale/publish'
|
||||||
|
|
|
@ -21,6 +21,7 @@ http.interceptors.request.use(config => {
|
||||||
http.interceptors.response.use(res => {
|
http.interceptors.response.use(res => {
|
||||||
if(res.data.code == 401) {
|
if(res.data.code == 401) {
|
||||||
localStorage.removeItem('token')
|
localStorage.removeItem('token')
|
||||||
|
localStorage.removeItem('userInfo')
|
||||||
window.location.href = '/login'
|
window.location.href = '/login'
|
||||||
}
|
}
|
||||||
return res.data;
|
return res.data;
|
||||||
|
|
|
@ -2,8 +2,9 @@
|
||||||
<el-container class="container-exam">
|
<el-container class="container-exam">
|
||||||
<el-header class="header">
|
<el-header class="header">
|
||||||
<img src="@/assets/images/logo.png" alt="">
|
<img src="@/assets/images/logo.png" alt="">
|
||||||
<span class="desc">本平台提供专业的自评量表、请仔细地阅读每一条,根据近期内您的实际感受,点击适合您的选项,请注意不要漏题、答题完成后您将获得一份专业的分析报告!</span>
|
<span class="desc">本平台提供专业的自评量表、请仔细地阅读每一条,根据近期内您的实际感受,点击适合您的选项,请注意不要漏题!</span>
|
||||||
<el-button round classs="right-btn" style="margin-left: 50px;" @click="logout">退出登录</el-button>
|
<span class="user">{{ userInfo.nickName }}</span>
|
||||||
|
<el-button round classs="right-btn" style="margin-left: 20px;" @click="logout">退出登录</el-button>
|
||||||
</el-header>
|
</el-header>
|
||||||
|
|
||||||
<div class="content">
|
<div class="content">
|
||||||
|
@ -90,6 +91,8 @@ const recordId = route.query.recordId
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
|
||||||
|
const userInfo = ref(JSON.parse(localStorage.getItem('userInfo')))
|
||||||
|
|
||||||
const timeLeft = ref(Date.now() + 1000 * 60 * scaleTime)
|
const timeLeft = ref(Date.now() + 1000 * 60 * scaleTime)
|
||||||
|
|
||||||
const questionList = ref([])
|
const questionList = ref([])
|
||||||
|
@ -149,6 +152,7 @@ function handleChange() {
|
||||||
|
|
||||||
function logout() {
|
function logout() {
|
||||||
localStorage.removeItem('token')
|
localStorage.removeItem('token')
|
||||||
|
localStorage.removeItem('userInfo')
|
||||||
router.replace("/login")
|
router.replace("/login")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -200,6 +204,13 @@ async function submit() {
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
padding-top: 15px;
|
padding-top: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.user {
|
||||||
|
margin-left: 50px;
|
||||||
|
color: #41515C;
|
||||||
|
font-size: 18px;
|
||||||
|
padding-top: 15px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<img src="@/assets/images/logo.png" alt="">
|
<img src="@/assets/images/logo.png" alt="">
|
||||||
<span class="desc">本平台提供专业的自评量表、请仔细地阅读每一条,根据近期内您的实际感受,点击适合您的选项,请注意不要漏题、答题完成后您将获得一份专业的分析报告!</span>
|
<span class="desc">本平台提供专业的自评量表、请仔细地阅读每一条,根据近期内您的实际感受,点击适合您的选项,请注意不要漏题!</span>
|
||||||
<el-button round classs="right-btn" style="margin-left: 50px;" @click="logout">退出登录</el-button>
|
<span class="user">{{ userInfo.nickName }}</span>
|
||||||
|
<el-button round classs="right-btn" style="margin-left: 20px;" @click="logout">退出登录</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<el-card style="margin-top: 20px;min-height: calc(100vh - 100px);">
|
<el-card style="margin-top: 20px;min-height: calc(100vh - 100px);">
|
||||||
|
@ -39,6 +40,8 @@ const router = useRouter()
|
||||||
const data = localStorage.getItem('examDetail') || ''
|
const data = localStorage.getItem('examDetail') || ''
|
||||||
const des = JSON.parse(data)
|
const des = JSON.parse(data)
|
||||||
|
|
||||||
|
const userInfo = ref(JSON.parse(localStorage.getItem('userInfo')))
|
||||||
|
|
||||||
function goToHome() {
|
function goToHome() {
|
||||||
localStorage.removeItem('examDetail')
|
localStorage.removeItem('examDetail')
|
||||||
router.push('/')
|
router.push('/')
|
||||||
|
@ -46,6 +49,7 @@ function goToHome() {
|
||||||
|
|
||||||
function logout() {
|
function logout() {
|
||||||
localStorage.removeItem('token')
|
localStorage.removeItem('token')
|
||||||
|
localStorage.removeItem('userInfo')
|
||||||
router.replace("/login")
|
router.replace("/login")
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -53,14 +57,21 @@ function logout() {
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.header {
|
.header {
|
||||||
height: 60px;
|
height: 60px;
|
||||||
color: #41515C;
|
|
||||||
background-color: #FFF;
|
background-color: #FFF;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 18px;
|
|
||||||
padding-top: 15px;
|
|
||||||
|
|
||||||
.desc {
|
.desc {
|
||||||
margin-left: 20px;
|
margin-left: 20px;
|
||||||
|
color: #41515C;
|
||||||
|
font-size: 18px;
|
||||||
|
padding-top: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.user {
|
||||||
|
margin-left: 50px;
|
||||||
|
color: #41515C;
|
||||||
|
font-size: 18px;
|
||||||
|
padding-top: 15px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,41 +1,44 @@
|
||||||
<template>
|
<template>
|
||||||
<el-container class="container-exam">
|
<el-scrollbar height="100vh">
|
||||||
<el-header class="header">
|
<el-container class="container-exam">
|
||||||
<img src="@/assets/images/logo.png" alt="">
|
<el-header class="header">
|
||||||
<span
|
<img src="@/assets/images/logo.png" alt="">
|
||||||
class="desc">本平台提供专业的自评量表、请仔细地阅读每一条,根据近期内您的实际感受,点击适合您的选项,请注意不要漏题、答题完成后您将获得一份专业的分析报告!</span>
|
<span class="desc">本平台提供专业的自评量表、请仔细地阅读每一条,根据近期内您的实际感受,点击适合您的选项,请注意不要漏题!</span>
|
||||||
<el-button round classs="right-btn" style="margin-left: 50px;" @click="logout">退出登录</el-button>
|
<span class="user">{{ userInfo.nickName }}</span>
|
||||||
</el-header>
|
<el-button round classs="right-btn" style="margin-left: 20px;" @click="logout">退出登录</el-button>
|
||||||
<el-main class="main">
|
</el-header>
|
||||||
<div class="content" v-if="scaleList.length > 0">
|
<el-main class="main">
|
||||||
<el-card shadow="hover" style="max-width: 520px; margin-bottom: 10px; position: relative;"
|
|
||||||
v-for="item in scaleList" :key="item.scaleId" @click="gotoExam(item)">
|
<div class="content" v-if="scaleList.length > 0">
|
||||||
<img :src="item.coverUrl" alt="">
|
<el-card shadow="hover" style="max-width: 520px; margin-bottom: 10px; position: relative;"
|
||||||
<div class="title">{{ item.scaleName }}</div>
|
v-for="item in scaleList" :key="item.scaleId" @click="gotoExam(item)">
|
||||||
<div v-if="item.used" class="desc">
|
<img :src="item.coverUrl" alt="">
|
||||||
<el-tag round effect="dark" type="danger">已测评</el-tag>
|
<div class="title">{{ item.scaleName }}</div>
|
||||||
</div>
|
<div v-if="item.used" class="desc">
|
||||||
<template #footer>
|
<el-tag round effect="dark" type="danger">已测评</el-tag>
|
||||||
<div class="footer">
|
|
||||||
<div>
|
|
||||||
{{ item.scaleTitle }}
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
{{ item.questionsNum }}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
<template #footer>
|
||||||
</el-card>
|
<div class="footer">
|
||||||
</div>
|
<div>
|
||||||
<el-empty v-else description="暂无测评量表" style=" height: 600px;"/>
|
{{ item.scaleTitle }}
|
||||||
</el-main>
|
</div>
|
||||||
</el-container>
|
<div>
|
||||||
|
{{ item.questionsNum }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-card>
|
||||||
|
</div>
|
||||||
|
<el-empty v-else description="暂无测评量表" style=" height: 600px;" />
|
||||||
|
</el-main>
|
||||||
|
</el-container>
|
||||||
|
</el-scrollbar>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {ref, onMounted} from 'vue'
|
import { ref, onMounted } from 'vue'
|
||||||
import {useRouter} from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
import {getPublishAPI, addRecordIdAPI} from '@/apis/user'
|
import { getPublishAPI, addRecordIdAPI, userInfoAPI } from '@/apis/user'
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
|
||||||
|
@ -72,21 +75,29 @@ async function gotoExam(item) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const userInfo = ref('')
|
||||||
|
async function getUserInfo() {
|
||||||
|
const res = await userInfoAPI()
|
||||||
|
userInfo.value = res.data.user
|
||||||
|
|
||||||
|
localStorage.setItem('userInfo', JSON.stringify(userInfo.value))
|
||||||
|
}
|
||||||
|
|
||||||
function logout() {
|
function logout() {
|
||||||
localStorage.removeItem('token')
|
localStorage.removeItem('token')
|
||||||
|
localStorage.removeItem('userInfo')
|
||||||
router.replace("/login")
|
router.replace("/login")
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getScaleList()
|
getScaleList()
|
||||||
|
getUserInfo()
|
||||||
})
|
})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.container-exam {
|
.container-exam {
|
||||||
height: 100vh;
|
|
||||||
|
|
||||||
.header {
|
.header {
|
||||||
height: 60px;
|
height: 60px;
|
||||||
background-color: #FFF;
|
background-color: #FFF;
|
||||||
|
@ -98,12 +109,20 @@ onMounted(() => {
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
padding-top: 15px;
|
padding-top: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.user {
|
||||||
|
margin-left: 50px;
|
||||||
|
color: #41515C;
|
||||||
|
font-size: 18px;
|
||||||
|
padding-top: 15px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.main {
|
.main {
|
||||||
width: 1200px;
|
width: 1200px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
padding: 0;
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
font-size: 30px;
|
font-size: 30px;
|
||||||
|
@ -115,6 +134,7 @@ onMounted(() => {
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 50% 50%;
|
grid-template-columns: 50% 50%;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
img {
|
img {
|
||||||
width: 500px;
|
width: 500px;
|
||||||
|
@ -133,6 +153,8 @@ onMounted(() => {
|
||||||
color: red;
|
color: red;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.footer {
|
.footer {
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>云舒-心理健康平台-学生端</title>
|
<title>云舒-心理健康平台-学生端</title>
|
||||||
<link rel="stylesheet" href="//at.alicdn.com/t/font_2143783_iq6z4ey5vu.css" />
|
<link rel="stylesheet" href="//at.alicdn.com/t/font_2143783_iq6z4ey5vu.css" />
|
||||||
<script type="module" crossorigin src="/web/assets/index--qMp6osd.js"></script>
|
<script type="module" crossorigin src="/web/assets/index-hcESTLrl.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="/web/assets/index-_wR1FQpr.css">
|
<link rel="stylesheet" crossorigin href="/web/assets/index-jbRSnGfa.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
|
|
Loading…
Reference in New Issue