提交 51d4b583 authored 作者: lihuihui's avatar lihuihui

updata

上级 9d929bb5
...@@ -16,21 +16,12 @@ export function getMyOrder() { ...@@ -16,21 +16,12 @@ export function getMyOrder() {
return httpRequest.get('/zy/v2/mall/order/my') return httpRequest.get('/zy/v2/mall/order/my')
} }
/* 模拟考试设置角色 */
export function setRole(data) {
return httpRequest.post('/zy/v2/examination/role', data, {
headers: { 'Content-Type': 'multipart/form-data' }
})
}
/* 获取考试状态 */
export function getExamStatus(data) {
return httpRequest.get('/zy/v2/examination/examination-papers-status', data, {
headers: { 'Content-Type': 'multipart/form-data' }
})
}
/* 获取openid */ /* 获取openid */
export function getOpenid(data) { export function getOpenid(data) {
return httpRequest.get('/usercenter/user/get-user-openid', data) return httpRequest.get('/usercenter/user/get-user-openid', data)
} }
/* 监听支付状态 */
export function getOrderStatus() {
return httpRequest.get('/v2/mall/order/status')
}
...@@ -94,6 +94,20 @@ export default { ...@@ -94,6 +94,20 @@ export default {
bottomView.style.height = (clientHeight - topViewH) + 'px' bottomView.style.height = (clientHeight - topViewH) + 'px'
console.log(bottomView.style.height) console.log(bottomView.style.height)
} }
},
computed: {
changeData() {
return this.questionsData
}
},
watch: {
changeData: {
handler(newV, oldV) {
this.$forceUpdate()
console.log(newV)
},
deep: true
}
} }
} }
</script> </script>
......
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
</div> </div>
<div class="btn-box" v-show="!topicCard.isShow"> <div class="btn-box" v-show="!topicCard.isShow">
<div class="padd"> <div class="padd">
<div class="analysis" @click="analyShow" v-if="$route.query.id || $route.query.course_id || $route.query.chapter_id">查看解析</div> <div class="analysis" @click="analyShow" v-if="$route.query.id || $route.query.course_id || $route.query.tag_id">查看解析</div>
<div class="btn left" @click="switchQuestions('left')" v-show="currentNum !== 1">上一题</div> <div class="btn left" @click="switchQuestions('left')" v-show="currentNum !== 1">上一题</div>
<div class="btn right" @click="switchQuestions('right')" v-show="nextBtnShow">下一题</div> <div class="btn right" @click="switchQuestions('right')" v-show="nextBtnShow">下一题</div>
</div> </div>
...@@ -122,20 +122,22 @@ export default { ...@@ -122,20 +122,22 @@ export default {
observer: true, observer: true,
on: { on: {
slideChangeTransitionStart: function() { slideChangeTransitionStart: function() {
const itemDid = _this.swiper.slides[_this.swiper.activeIndex].attributes['data-dId'].nodeValue if (_this.swiper.slides[_this.swiper.activeIndex].attributes['data-dId']) {
const itemCid = _this.swiper.slides[_this.swiper.activeIndex].attributes['data-cId'].nodeValue const itemDid = _this.swiper.slides[_this.swiper.activeIndex].attributes['data-dId'].nodeValue
if (_this.requestData[itemCid]) { const itemCid = _this.swiper.slides[_this.swiper.activeIndex].attributes['data-cId'].nodeValue
if (_this.requestData[itemCid][itemDid]) { if (_this.requestData[itemCid]) {
if (_this.requestData[itemCid][itemDid].sign) { if (_this.requestData[itemCid][itemDid]) {
_this.signText = '已标记' if (_this.requestData[itemCid][itemDid].sign) {
_this.signText = '已标记'
} else {
_this.signText = '标记'
}
} else { } else {
_this.signText = '标记' _this.signText = '标记'
} }
} else { } else {
_this.signText = '标记' _this.signText = '标记'
} }
} else {
_this.signText = '标记'
} }
if (this.activeIndex === _this.questionsData.sheet.question_count) { if (this.activeIndex === _this.questionsData.sheet.question_count) {
_this.topicCard.isShow = true _this.topicCard.isShow = true
...@@ -290,7 +292,7 @@ export default { ...@@ -290,7 +292,7 @@ export default {
setClock(time) { setClock(time) {
let sec = parseInt(time) let sec = parseInt(time)
this.clockCount = setInterval(() => { this.clockCount = setInterval(() => {
if (this.requestParam.course_id) { if (this.requestParam.course_id || this.requestParam.tag_id) {
this.remainingTime = this.secondToDate(sec) this.remainingTime = this.secondToDate(sec)
sec++ sec++
} else { } else {
...@@ -436,7 +438,6 @@ export default { ...@@ -436,7 +438,6 @@ 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)
......
...@@ -27,10 +27,16 @@ export default { ...@@ -27,10 +27,16 @@ export default {
prepay_id: '', // 通过调用接口获取 prepay_id: '', // 通过调用接口获取
app_id: '', // 提前设定 app_id: '', // 提前设定
app_secret: '' // 提前设定 app_secret: '' // 提前设定
} },
orderStatusTime: null
} }
}, },
mounted() { mounted() {
window.addEventListener('pageshow', function (event) {
if ((event.persisted || window.performance) && window.performance.navigation.type === 2) {
Toast('页面返回')
}
}, false)
this.getOpenid() this.getOpenid()
this.getGoodsDetail() this.getGoodsDetail()
}, },
...@@ -44,10 +50,19 @@ export default { ...@@ -44,10 +50,19 @@ export default {
}) })
}) })
}, },
getGoodsDetail() { getOrderStatus() {
// api.getGoodsDetails('6682927830365372416').then(res => { api.getOrderStatus().then(res => {
// console.log(res) switch (res.status) {
// }) case 1:
break
case -1:
break
case 100:
break
default:
}
Toast(res.status)
})
}, },
goPay () { goPay () {
// this.VueEvent.$emit('pay-wx-h5', {}) // this.VueEvent.$emit('pay-wx-h5', {})
...@@ -72,6 +87,10 @@ export default { ...@@ -72,6 +87,10 @@ export default {
}, },
success: function (res) {} success: function (res) {}
}) })
// clearInterval(this.orderStatusTime)
// this.orderStatusTime = setInterval(() => {
// this.getOrderStatus()
// }, 1000)
} }
// this.VueEvent.$emit('pay-wx-chart', {}) // this.VueEvent.$emit('pay-wx-chart', {})
// this.VueEvent.$off('pay-wx-chart-callback').$on('pay-wx-chart-callback', obj => { // this.VueEvent.$off('pay-wx-chart-callback').$on('pay-wx-chart-callback', obj => {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论