diff --git a/xietang-answer-h5/App.vue b/xietang-answer-h5/App.vue index 8914298..63de7eb 100644 --- a/xietang-answer-h5/App.vue +++ b/xietang-answer-h5/App.vue @@ -5,7 +5,8 @@ onLaunch: function() { console.log('App Launch') this.$nextTick(() => { - let link = window.location.href; + let link = window.location.href; + let that = this if (/code=/.test(link) || link.indexOf("code") > -1) { let temp = decodeURIComponent((new RegExp('[?|&]' + 'code' + '=' + '([^&;]+?)(&|#|;|$)') @@ -19,12 +20,108 @@ method: 'GET', utilSuccess: function(res) { console.log(res) - uni.setStorageSync('userInfo_token', {"token":"7777|QHwrodQSA6dhth3TEYjIwJfW2BNok5azI9CO25yb","user_id":5081}); + uni.setStorageSync('userInfo_token', {"token":"7777|QHwrodQSA6dhth3TEYjIwJfW2BNok5azI9CO25yb","user_id":5081}); + // 分享 + let url = location.href.split('#')[0] + let link = "http://vr.langye.net/h5xtdt/"; + that.util.request({ + api: '/api/mobile/user/wechat-share', + data: { + url:url + }, + method: 'GET', + utilSuccess: function(res) { + jwx.config({ + debug: false, // 开启调试模式,调用的所有 api 的返回值会在客户端 alert 出来,若要查看传入的参数,可以在 pc 端打开,参数信息会通过 log 打出,仅在 pc 端时才会打印。 + appId: res.appId, + jsApiList: res.jsApiList, + nonceStr: res.nonceStr, + signature: res.signature, + timestamp: res.timestamp, + }) + jwx.ready(() => { + jwx.updateAppMessageShareData({ + title: '百步芳草·与理同行——斜塘街道2023-2024年度基层党员冬训', // 分享标题 + link: link, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致 + desc: ' ', + imgUrl: 'http://vr.langye.net/storage/files/170701702865bf034424468.jpg', // 分享图标 + success: () => { + console.log( + 'updateAppMessageShareData-success' + ) + }, + + }); + jwx.updateTimelineShareData({ + title: '百步芳草·与理同行——斜塘街道2023-2024年度基层党员冬训', // 分享标题 + desc: ' ', + link: link, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致 + imgUrl: 'http://vr.langye.net/storage/files/170701702865bf034424468.jpg', // 分享图标 + success: () => { + console.log( + 'updateTimelineShareData-success' + ) + } + }); + }) + }, + utilFail: function(res) { + that.util.toast(res) + } + }) }, utilFail: function(res) { that.util.toast(res) } }) + }else{ + let url = location.href.split('#')[0] + let link = "http://vr.langye.net/h5xtdt/"; + that.util.request({ + api: '/api/mobile/user/wechat-share', + data: { + url:url + }, + method: 'GET', + utilSuccess: function(res) { + jwx.config({ + debug: false, // 开启调试模式,调用的所有 api 的返回值会在客户端 alert 出来,若要查看传入的参数,可以在 pc 端打开,参数信息会通过 log 打出,仅在 pc 端时才会打印。 + appId: res.appId, + jsApiList: res.jsApiList, + nonceStr: res.nonceStr, + signature: res.signature, + timestamp: res.timestamp, + }) + jwx.ready(() => { + jwx.updateAppMessageShareData({ + title: '百步芳草·与理同行——斜塘街道2023-2024年度基层党员冬训', // 分享标题 + link: link, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致 + desc: ' ', + imgUrl: 'http://vr.langye.net/storage/files/170701702865bf034424468.jpg', // 分享图标 + success: () => { + console.log( + 'updateAppMessageShareData-success' + ) + }, + + }); + jwx.updateTimelineShareData({ + title: '百步芳草·与理同行——斜塘街道2023-2024年度基层党员冬训', // 分享标题 + desc: ' ', + link: link, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致 + imgUrl: 'http://vr.langye.net/storage/files/170701702865bf034424468.jpg', // 分享图标 + success: () => { + console.log( + 'updateTimelineShareData-success' + ) + } + }); + }) + }, + utilFail: function(res) { + that.util.toast(res) + } + }) } } else { let redirect = encodeURIComponent(link.replace(/#\//, "")) diff --git a/xietang-answer-h5/pages/answer/index.vue b/xietang-answer-h5/pages/answer/index.vue index 601821e..ab0e4eb 100644 --- a/xietang-answer-h5/pages/answer/index.vue +++ b/xietang-answer-h5/pages/answer/index.vue @@ -14,7 +14,8 @@ - {{answerNum[ansindex]}}{{ans.is_correct}}---{{ans.title}} + {{answerNum[ansindex]}}{{ans.title}} + @@ -28,7 +29,7 @@ - + @@ -52,13 +53,13 @@ - 生成证书 + 生成证书 结束答题 再来一次 - 生成证书 + 生成证书 结束答题 @@ -96,6 +97,7 @@ showAnswer:false, ansicon100:require('../../static/answer100icon.png'), ansicon80:require('../../static/answer80icon.png'), + maskHeight:0, } }, onLoad() { @@ -118,6 +120,11 @@ url:'/pages/me/me' }) }, + toCer(){ + uni.redirectTo({ + url:'/pages/certificate/certificate' + }) + }, againAnswer(){ setTimeout(() => { this.$router.go(0) @@ -179,6 +186,11 @@ }, submitQue(){ console.log("this.myAnswer",this.myAnswer) + let that = this + const query = uni.createSelectorQuery().in(this); + query.select('.wrap').boundingClientRect(({ height }) => { + that.maskHeight = height + 'px' + }).exec(); if(this.myAnswer.length>0){ let count = 0 this.myAnswer.map(item=>{ @@ -190,7 +202,8 @@ }else{ this.correctScore = 0 } - let that = this + this.showAnswer = true + this.util.request({ api: '/api/mobile/quiz/save-quiz-simple', data: { @@ -201,8 +214,8 @@ method: 'POST', utilSuccess: function(res) { console.log(res) - this.showAnswer = true - clearTimeout(this.timer) + that.showAnswer = true + clearTimeout(that.timer) }, utilFail: function(res) { @@ -260,7 +273,7 @@ that.answerSubmit = true // return } - },100) + },1500) }, countdown(duration, onTick, onEnd) { @@ -293,7 +306,7 @@ /* padding-top: 11vh; */ } .wrap{ - height: 100%; + /* height: 100%; */ width:100%; } @@ -415,8 +428,9 @@ width:100%; height:100%; background-color: rgba(0,0,0,0.7); - padding-top:397rpx; - padding-bottom:300rpx; + /* padding-top:397rpx; + padding-bottom:300rpx; */ + z-index:9; } .answertipitem{ position: absolute; diff --git a/xietang-answer-h5/pages/certificate/certificate.vue b/xietang-answer-h5/pages/certificate/certificate.vue index c97e167..8a869b3 100644 --- a/xietang-answer-h5/pages/certificate/certificate.vue +++ b/xietang-answer-h5/pages/certificate/certificate.vue @@ -9,10 +9,10 @@ @@ -180,12 +167,17 @@ export default { showwin:false, showtips:false, winimg:require('../../static/index/logo2.png'), - tiptitle:require('../../static/tiptitle.png') - + tiptitle:require('../../static/tiptitle.png'), + isEnd:true, + active_tip:'', }; }, methods: { toanswer(){ + if(!this.isEnd){ + this.util.toast("答题已结束") + return + } if(this.answercount==2){ this.util.toast("每人只有2次答题机会") return @@ -255,6 +247,8 @@ export default { onLoad() { this.getUserInfo() this.getQuestion() + this.isEnd = uni.getStorageSync('isEnd') + this.active_tip = uni.getStorageSync('active_tip') }, } diff --git a/xietang-answer-h5/pages/record/index.vue b/xietang-answer-h5/pages/record/index.vue index a8d644e..c5e7eca 100644 --- a/xietang-answer-h5/pages/record/index.vue +++ b/xietang-answer-h5/pages/record/index.vue @@ -20,17 +20,17 @@ - - - - - - + + + + + +