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

update: feat: 手机是否为横屏

上级 2e12076e
......@@ -12,7 +12,7 @@
<!-- <meta http-equiv="Pragma" content="no-cache" /> -->
<!-- <meta http-equiv="Expires" content="0" /> -->
<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>
<body>
<div id="app"></div>
......
......@@ -127,13 +127,16 @@ export default {
this.countHeight()
}
const wrapper = this.$refs.wrapper
new BScroll(wrapper)
setTimeout(() => {
const wrapper2 = this.$refs.wrapper2
new BScroll(wrapper2)
}, 3000)
new BScroll(wrapper, { click: true })
this.initBscroll()
},
methods: {
initBscroll() {
setTimeout(() => {
const wrapper2 = this.$refs.wrapper2
new BScroll(wrapper2, { click: true, bounce: false, startY: 0 })
}, 1000)
},
sendExamInfo(status) {
const param = {
student_id: this.sInfo.info.student_id,
......@@ -299,10 +302,7 @@ export default {
this.questionParams.questionIndex + 1 !== this.questionParams.question.total_question_count &&
this.questionParams.questionIndex++
}
setTimeout(() => {
const wrapper2 = this.$refs.wrapper2
new BScroll(wrapper2)
}, 3000)
this.initBscroll()
},
getTopic() {
action.Exam.getTopic(this.$route.params.examId)
......
......@@ -67,8 +67,29 @@ export default {
}
},
mounted() {
action.Login.getExamInfo(this.$route.params.examId)
.then(res => {
this.getExamInfo()
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))
this.data = res
if (this.getEnabledTime() < 0) {
......@@ -86,9 +107,7 @@ export default {
this.loginParam.is = false
}
})
.finally(res => {})
},
methods: {
},
sendExamInfo(studentId) {
const param = {
student_id: studentId,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论