提交 2730253a authored 作者: lihuihui's avatar lihuihui

updata

上级 731b1c5c
...@@ -27,10 +27,6 @@ export default class API { ...@@ -27,10 +27,6 @@ export default class API {
return window.G.$instance_vue return window.G.$instance_vue
} }
isWeapp() {
return this.$store.state.isWeapp
}
/* 重新封装 请求时的执行函数 */ /* 重新封装 请求时的执行函数 */
_request (_config = {}) { _request (_config = {}) {
/* 具体执行请求成功后业务逻辑前,先执行该方法 */ /* 具体执行请求成功后业务逻辑前,先执行该方法 */
...@@ -98,18 +94,16 @@ export default class API { ...@@ -98,18 +94,16 @@ export default class API {
const { status, data } = res.response const { status, data } = res.response
if (data) { if (data) {
if (status === 402) { if (status === 402) {
console.log(this.isWeapp) if (window.G.$instance_vue.$store.state.isWeapp) {
if (this.isWeapp) {
wx.miniProgram.navigateTo({ url: `/pages/web/index?src=${window.location.origin}/pay` }) wx.miniProgram.navigateTo({ url: `/pages/web/index?src=${window.location.origin}/pay` })
} else { } else {
window.G.$instance_vue.$router.replace({ window.G.$instance_vue.$router.replace({
path: '/pay' path: '/pay'
}) })
} }
// const routeData = window.G.$instance_vue.$router.resolve({ // window.G.$instance_vue.$router.replace({
// name: 'pay' // path: '/pay'
// }) // })
// window.open(routeData.href, '_blank')
} }
} }
err = new Error(JSON.stringify(res.response)) err = new Error(JSON.stringify(res.response))
......
...@@ -27,8 +27,8 @@ ...@@ -27,8 +27,8 @@
<div v-else class="txt">您离成功还有一段距离,继续努力!</div> <div v-else class="txt">您离成功还有一段距离,继续努力!</div>
</div> </div>
<div class="nl-btn" v-if="title == '能力自测'"> <div class="nl-btn" v-if="title == '能力自测'">
<div class="btn" @click="$router.go(-1)">重做测试</div> <div class="btn" @click="goAbilityExam">重做测试</div>
<div class="btn">学习课程</div> <div class="btn" @click="goCourse">学习课程</div>
</div> </div>
<div class="card"> <div class="card">
<div class="tit">答题卡:</div> <div class="tit">答题卡:</div>
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
</div> </div>
<div class="st-btn" v-if="title === '随堂测试'"> <div class="st-btn" v-if="title === '随堂测试'">
<div class="btn" @click="go(1)">全部解析</div> <div class="btn" @click="go(1)">全部解析</div>
<div class="btn" @click="go(-1)">解析</div> <div class="btn" @click="go(-1)">解析</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -128,7 +128,31 @@ export default { ...@@ -128,7 +128,31 @@ export default {
// this.title // this.title
this.initData() this.initData()
}, },
computed: {
isWeapp() {
return this.$store.state.isWeapp
}
},
methods: { methods: {
goAbilityExam() {
this.$router.push({
path: '/exam/answer',
query: {
type: 1,
is_create: 1,
papersUrl: 'zy/v2/examination/examination-papers'
}
})
},
goCourse() {
if (this.isWeapp) {
wx.miniProgram.navigateTo({ url: `/pages/web/index?src=${window.location.origin}/course/learn` })
} else {
this.$router.push({
path: '/course/learn'
})
}
},
go(id) { go(id) {
const param = this.$route.query const param = this.$route.query
param.id = id param.id = id
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<div class="time">{{ remainingTime }}</div> <div class="time">{{ remainingTime }}</div>
<div class="tag-box"> <div class="tag-box">
<span @click="signQuestion" v-if="isExamEnd">标记</span> <span @click="signQuestion" v-if="isExamEnd">标记</span>
<span @click="showCard">答题卡</span> <span @click="showCard" v-if="isExamEnd">答题卡</span>
<span @click="submitShowPop" v-if="isExamEnd">交卷</span> <span @click="submitShowPop" v-if="isExamEnd">交卷</span>
</div> </div>
</div> </div>
...@@ -283,9 +283,20 @@ export default { ...@@ -283,9 +283,20 @@ export default {
sec-- sec--
if (sec === 0) { if (sec === 0) {
clearInterval(this.clockCount) clearInterval(this.clockCount)
this.remainingTime = '00:00:00'
this.timePopIsShow = true this.timePopIsShow = true
return false return false
} }
if (sec === 600) {
Toast({
duration: 1000,
message: '距离考试结束还有10分钟!'
})
const body = document.querySelector('body')
body.addEventListener('click', (e) => {
Toast.clear()
}, false)
}
this.remainingTime = this.secondToDate(sec) this.remainingTime = this.secondToDate(sec)
} }
this.questionsData.sheet.duration++ this.questionsData.sheet.duration++
...@@ -407,6 +418,7 @@ export default { ...@@ -407,6 +418,7 @@ export default {
} else { } else {
this.questionsData = res this.questionsData = res
} }
console.log(this.questionsData)
window.localStorage.userId = res.user_id window.localStorage.userId = res.user_id
this.remainingTime = this.secondToDate(times) this.remainingTime = this.secondToDate(times)
this.setClock(times) this.setClock(times)
...@@ -614,6 +626,7 @@ export default { ...@@ -614,6 +626,7 @@ export default {
} }
} }
.exp{ .exp{
margin-top: .4rem;
overflow: hidden; overflow: hidden;
p{ p{
float: left; float: left;
......
...@@ -58,7 +58,14 @@ png图片,可以方便你直接应用到自己的设计作品中,我们 ...@@ -58,7 +58,14 @@ png图片,可以方便你直接应用到自己的设计作品中,我们
</template> </template>
</ul> </ul>
</div> </div>
<div v-show="tabNav.navIndex === 2">3</div> <div v-show="tabNav.navIndex === 2" class="tab3">
<ul>
<li>
<div class="tit">啊啊啊啊</div>
<van-icon name="arrow" class="arr"/>
</li>
</ul>
</div>
</div> </div>
<div class="exam_submit" v-if="isExamPop"> <div class="exam_submit" v-if="isExamPop">
<div class="pop"> <div class="pop">
...@@ -330,6 +337,25 @@ export default { ...@@ -330,6 +337,25 @@ export default {
} }
} }
} }
.tab3{
ul{
li{
display: flex;
padding: .4rem 0;
border-bottom: .01rem solid #eee;
align-items: center;
.tit{
width: 6.15rem;
color: rgba(34,34,34,1);
font-size: .3rem;
font-weight: bold;
}
.arr{
margin-left: auto;
}
}
}
}
} }
} }
.exam_submit{ .exam_submit{
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论