提交 ef2b6d37 authored 作者: lihuihui's avatar lihuihui

update: feat: 手机是否为横屏

上级 2e12076e
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<!-- <meta http-equiv="Pragma" content="no-cache" /> --> <!-- <meta http-equiv="Pragma" content="no-cache" /> -->
<!-- <meta http-equiv="Expires" content="0" /> --> <!-- <meta http-equiv="Expires" content="0" /> -->
<title>标题</title> <title>标题</title>
<meta name="viewport" id="viewport" content="initial-scale=-1,maximum-scale=1,shrink-to-fit=no" /> <meta name="viewport" id="viewport" content="initial-scale=-1,maximum-scale=1,shrink-to-fit=no,user-scalable=no" />
</head> </head>
<body> <body>
<div id="app"></div> <div id="app"></div>
......
...@@ -127,13 +127,16 @@ export default { ...@@ -127,13 +127,16 @@ export default {
this.countHeight() this.countHeight()
} }
const wrapper = this.$refs.wrapper const wrapper = this.$refs.wrapper
new BScroll(wrapper) new BScroll(wrapper, { click: true })
setTimeout(() => { this.initBscroll()
const wrapper2 = this.$refs.wrapper2
new BScroll(wrapper2)
}, 3000)
}, },
methods: { methods: {
initBscroll() {
setTimeout(() => {
const wrapper2 = this.$refs.wrapper2
new BScroll(wrapper2, { click: true, bounce: false, startY: 0 })
}, 1000)
},
sendExamInfo(status) { sendExamInfo(status) {
const param = { const param = {
student_id: this.sInfo.info.student_id, student_id: this.sInfo.info.student_id,
...@@ -299,10 +302,7 @@ export default { ...@@ -299,10 +302,7 @@ export default {
this.questionParams.questionIndex + 1 !== this.questionParams.question.total_question_count && this.questionParams.questionIndex + 1 !== this.questionParams.question.total_question_count &&
this.questionParams.questionIndex++ this.questionParams.questionIndex++
} }
setTimeout(() => { this.initBscroll()
const wrapper2 = this.$refs.wrapper2
new BScroll(wrapper2)
}, 3000)
}, },
getTopic() { getTopic() {
action.Exam.getTopic(this.$route.params.examId) action.Exam.getTopic(this.$route.params.examId)
......
...@@ -67,8 +67,29 @@ export default { ...@@ -67,8 +67,29 @@ export default {
} }
}, },
mounted() { mounted() {
action.Login.getExamInfo(this.$route.params.examId) this.getExamInfo()
.then(res => { this.tipsMobileAngle()
window.onresize = () => {
this.tipsMobileAngle()
}
},
methods: {
tipsMobileAngle() {
if (this.isMobile()) {
if (window.orientation === 180 || window.orientation === 0) {
console.log(1)
this.$message({
message: '请横屏预览',
type: 'warning'
})
}
}
},
isMobile() {
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)
},
getExamInfo() {
action.Login.getExamInfo(this.$route.params.examId).then(res => {
window.localStorage.setItem('examInfo', JSON.stringify(res)) window.localStorage.setItem('examInfo', JSON.stringify(res))
this.data = res this.data = res
if (this.getEnabledTime() < 0) { if (this.getEnabledTime() < 0) {
...@@ -86,9 +107,7 @@ export default { ...@@ -86,9 +107,7 @@ export default {
this.loginParam.is = false this.loginParam.is = false
} }
}) })
.finally(res => {}) },
},
methods: {
sendExamInfo(studentId) { sendExamInfo(studentId) {
const param = { const param = {
student_id: studentId, student_id: studentId,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论