斜塘答题

master
lion 2 years ago
parent c954ff6812
commit e5b97e7d49

@ -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(/#\//, ""))

@ -14,7 +14,8 @@
</view>
<view class='answercheck' v-for="(ans,ansindex) in question_list[questionIndex]?question_list[questionIndex].options:[]">
<view @click="chooseAnswer(ans,ansindex)" :class="ans.flag?'answeritem active':'answeritem'">
<span>{{answerNum[ansindex]}}</span>{{ans.is_correct}}---{{ans.title}}
<span>{{answerNum[ansindex]}}</span>{{ans.title}}
<!-- {{ans.is_correct}}--- -->
</view>
</view>
</view>
@ -28,7 +29,7 @@
<u-button v-if="answerSubmit" color="#d22425" shape="circle" size='large' text="提交" type='primary' @click="nextQue"></u-button>
</view>
<view class="bottom"></view>
<view class="answertip" v-if="showAnswer">
<view class="answertip" v-if="showAnswer" :style="{'height':maskHeight}">
<view class="answer100 answertipitem">
<view :class="correctScore<100?'ansicon80':'ansicon'">
<u-image v-if="correctScore==100" :fade="false" :src="ansicon100" width="120rpx" height="231rpx"></u-image>
@ -52,13 +53,13 @@
<view class='ansflag' v-if="correctScore==100"></view>
<!-- 第一次答题 -->
<view class="answerBtn" v-if="answercount===0">
<view v-if="correctScore==100"></view>
<view v-if="correctScore==100" @click="toCer"></view>
<view @click="endAnswer" v-if="correctScore<100"></view>
<view @click="againAnswer"></view>
</view>
<!-- 第二次答题 -->
<view class="answerBtn" v-else>
<view style="width:45%" v-if="correctScore==100"></view>
<view style="width:45%" v-if="correctScore==100" @click="toCer"></view>
<view style="width:45%" @click="endAnswer" v-else></view>
</view>
</view>
@ -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;

@ -9,10 +9,10 @@
<img class="bkg" :src="imgData" alt="">
</template>
<template v-else>
<img class="bkg" src="/static/certificate/certificate.png" alt="">
<img class="bkg" :src="certificate" alt="">
<img class="icon1" src="/static/certificate/icon1.png" alt="">
<img class="title" src="/static/certificate/title.png" alt="">
<img class="icon1" :src="icon1" alt="">
<img class="title" :src="title" alt="">
<view class="no">
<view>
@ -50,7 +50,7 @@
<transition name="share-pop" enter-active-class="fade-in" leave-to-class="fade-out">
<view class="share_cover" v-show="isShare" @click="isShare = false">
<image src="/static/toShare.png" class="share_cover_arrow"></image>
<image :src="toShare" class="share_cover_arrow"></image>
<view class="share_cover_word">
请点击右上角将它发送给指定朋友或分享到朋友圈
</view>
@ -68,7 +68,11 @@ export default {
userInfo: {},
isRotate: false,
scale: 1,
imgData: ''
imgData: '',
certificate:require("../../static/certificate/certificate.png"),
icon1:require("../../static/certificate/icon1.png"),
title:require("../../static/certificate/title.png"),
toShare:require("../../static/toShare.png"),
};
},
methods: {
@ -123,7 +127,7 @@ export default {
converToDate (date) {
let chinese = ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九'];
let y = date.getFullYear().toString();
let m = date.getMonth().toString();
let m = (date.getMonth()+1).toString();
let d = date.getDate().toString();
let result = "";
for (let i = 0; i < y.length; i++) {

@ -16,10 +16,10 @@
<u-image :fade="false" :src="logo20" width="135rpx" height="100rpx"></u-image>
</view>
<view :animation="animationData21" class="logo21">
<u-image :fade="false" :src="logo21" width="147rpx" height="420rpx"></u-image>
<u-image :fade="false" :src="logo21" width="143rpx" height="255rpx"></u-image>
</view>
<view :animation="animationData22" class="logo22">
<u-image :fade="false" :src="logo22" width="52rpx" height="457rpx"></u-image>
<u-image :fade="false" :src="logo22" width="53rpx" height="457rpx"></u-image>
</view>
<view :animation="animationData23" class="logo23">
<u-image :fade="false" :src="logo23" width="750rpx" height="594rpx"></u-image>
@ -32,7 +32,8 @@
export default {
data() {
return {
isLogin:false,//
isLogin:false,//
isEnd:false,//
animations: [{
name: 'fadeIn',
duration: '1s',
@ -43,17 +44,18 @@
show:false,
width:'750rpx',
height:'1650rpx'
},{
name: 'heartBeat',
duration: '1.5s',
timer: 1000,
content: require('../../static/index/logo.png'),
autoplay:false,
class:'logo',
show:false,
width:'285rpx',
height:'202rpx'
},
},
// {
// name: 'heartBeat',
// duration: '1.5s',
// timer: 1000,
// content: require('../../static/index/logo.png'),
// autoplay:false,
// class:'logo',
// show:false,
// width:'285rpx',
// height:'202rpx'
// },
{
name: 'fadeIn',
duration: '1s',
@ -62,8 +64,8 @@
autoplay:false,
class:'logo1',
show:false,
width:'671rpx',
height:'336rpx'
width:'242rpx',
height:'432rpx'
},
{
name: 'fadeInUp',
@ -74,7 +76,7 @@
class:'logo2',
show:false,
width:'750rpx',
height:'802rpx'
height:'605rpx'
}
],
logo20:require('../../static/index/2logo.png'),
@ -105,45 +107,40 @@
onLoad() {
// this.play2(0)
// this.getUserInfo()
this.play(3)
this.getConfig()
this.play(2)
},
methods: {
// getUserInfo(){
// let userinfo = uni.getStorageSync('userInfo')
// if(userinfo){
// this.isLogin = true
// }
// },
methods: {
play(index){
//
if(index<0){
//
let that = this
var animation = uni.createAnimation({
duration: 1500,
timingFunction: 'ease-in',
})
// this.animations[1]['show'] = true
setTimeout(function(){
that.animations[1]['show'] = false
},500)
animation.opacity(0).width("135rpx").height("100rpx").top('106rpx').left('55rpx').step()
this.animationData = animation.export()
// logo
var animation20 = uni.createAnimation({
duration: 2500,
timingFunction: 'ease-in'
})
animation20.opacity(1).step()
this.animationData20 = animation20.export()
// s
var animation1 = uni.createAnimation({
duration: 2000,
timingFunction: 'ease-in',
})
animation1.opacity(1).step()
this.animationData1 = animation1.export()
this.play2()
// let that = this
// var animation = uni.createAnimation({
// duration: 1500,
// timingFunction: 'ease-in',
// })
// // this.animations[1]['show'] = true
// setTimeout(function(){
// that.animations[1]['show'] = false
// },500)
// animation.opacity(0).width("135rpx").height("100rpx").top('106rpx').left('55rpx').step()
// this.animationData = animation.export()
// // logo
// var animation20 = uni.createAnimation({
// duration: 2500,
// timingFunction: 'ease-in'
// })
// animation20.opacity(1).step()
// this.animationData20 = animation20.export()
// // s
// var animation1 = uni.createAnimation({
// duration: 2000,
// timingFunction: 'ease-in',
// })
// animation1.opacity(1).step()
// this.animationData1 = animation1.export()
// this.play2()
return
}
this.animations[index]['show'] = true
@ -179,14 +176,48 @@
this.animationData23 = animation23.export()
this.towhere()
},
getConfig(){
// /
let that = this
this.util.request({
api: '/api/mobile/user/wechat-login-url',
method: 'GET',
data:{
activity_tag:'bbfc'
},
utilSuccess: (res) => {
that.isEnd = that.isCurrentTimeBetween(res.start_time,res.end_time)
let config = res.config
config.map(item=>{
if(item.key==='active_tip'){
uni.setStorageSync('active_tip',item.value)
}
})
uni.setStorageSync('isEnd',that.isEnd)
// this.userInfo = res;
// uni.setStorageSync("userInfo",res)
},
utilFail: (res) => {
this.util.toast(res)
}
})
},
isCurrentTimeBetween(startTime, endTime) {
const now = new Date();
const start = new Date(startTime);
const end = new Date(endTime);
return now >= start && now <= end;
},
towhere(isclick){
let userinfo = uni.getStorageSync('userInfo')
let url = '/pages/login/index'
if(userinfo){
url = '/pages/me/me'
}
console.log(userinfo,url,isclick)
// return
//
if(isclick){
uni.navigateTo({
url:url
@ -240,8 +271,8 @@
.logo1 {
position: absolute;
bottom: 520rpx;
left: 60rpx;
bottom: 670rpx;
left: 270rpx;
}
.logo2 {

@ -67,12 +67,14 @@ export default {
address: '',
department_id:''
},
showTip:true
showTip:false,
isEnd:true,
}
},
onLoad() {
this.getParty()
this.isEnd = uni.getStorageSync('isEnd')
console.log(this.isEnd)
},
methods: {
openMe(){
@ -81,6 +83,15 @@ export default {
})
},
openAnswer(){
if(!this.isEnd){
this.util.toast("答题已结束")
setTimeout(function(){
uni.redirectTo({
url:'/pages/me/me'
})
},3500)
return
}
uni.redirectTo({
url:'/pages/answer/index'
})

@ -133,19 +133,7 @@
</view>
<view class="tipcenter">
<view>
<view>
1填写真实姓名手机号居住地所属党支部
</view>
<view>
2答题时间3月x日至3月xx日
</view> <view>
3答题数目10题答完一道题显示一道题正确答案一道题目10分得分100分的页面可生成优秀之星证书得分90分及以下显示再接再厉题库随机抽题目每个微信号2次学习机会以最高成绩为准
</view>
<view>
4答题时间为15分钟
</view> <view>
5竞赛结束后抽出20名优胜奖
</view>
<view v-html="active_tip"></view>
</view>
</view>
<view class="answerBtn">
@ -153,7 +141,6 @@
</view>
<view class="tipbottom"></view>
</view>
</view>
</view>
</template>
@ -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')
},
}
</script>

@ -20,17 +20,17 @@
</svg>
</view>
<img class="stage" src="/static/me/bkg-back.png" alt="">
<img class="grass1" src="/static/me/grass1.png" alt="">
<img class="grass2" src="/static/me/grass2.png" alt="">
<img class="cloud1" src="/static/me/cloud1.png" alt="">
<img class="cloud2" src="/static/me/cloud2.png" alt="">
<img class="shuibaxian" src="/static/me/shuibaxian.png" alt="">
<img class="stage" :src="stage" alt="">
<img class="grass1" :src="grass1" alt="">
<img class="grass2" :src="grass2" alt="">
<img class="cloud1" :src="cloud1" alt="">
<img class="cloud2" :src="cloud2" alt="">
<img class="shuibaxian" :src="shuibaxian" alt="">
</view>
<view class="container">
<view class="user-info">
<img class="avatar" :src="userInfo.headimgurl ? userInfo.headimgurl : '/static/index/logo.png'" alt="">
<img class="avatar" :src="userInfo.headimgurl ? userInfo.headimgurl : logo" alt="">
<view class="user-info__text">
<view class="name">
@ -53,14 +53,14 @@
</view>
</view>
<view>
<view class="panel1 panel2">
<view class="panel1 panel2" v-for="(item,index) in askList">
<view class="left">
<view class="num">
80<span></span></view>
{{item.score}}<span></span></view>
</view>
<view class="right">
<view class="num">一次答题</view>
<view class="text">2024-02-03 12:00</view>
<view class="num">{{countList[index]}}答题</view>
<view class="text">{{item.created_at?item.created_at.substring(0,16):''}}</view>
</view>
</view>
</view>
@ -76,15 +76,45 @@ export default {
data() {
return {
src: "http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2119_s.jpg",
stage:require("../../static/me/bkg-back.png"),
grass1:require("../../static/me/grass1.png"),
grass2:require("../../static/me/grass2.png"),
cloud1:require("../../static/me/cloud1.png"),
cloud2:require("../../static/me/cloud2.png"),
shuibaxian:require("../../static/me/shuibaxian.png"),
logo:require("../../static/index/logo.png"),
pencil:require("../../static/me/pencil.png"),
record:require("../../static/me/record.png"),
collect:require("../../static/me/collect.png"),
userInfo: {},
answercount:0,
askList:[],
countList:["一","二"],
};
},
methods: {
getQuestion(){
let that = this
this.util.request({
api: '/api/mobile/quiz/get-questions',
data: {
activity_tag:'bbfc'
},
method: 'GET',
utilSuccess: function(res) {
that.answercount = res.ask_count
that.askList = res.ask
},
utilFail: function(res) {
that.util.toast(res)
}
})
},
},
onLoad() {
this.userInfo = uni.getStorageSync("userInfo")
this.getQuestion()
},
}
</script>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 516 KiB

After

Width:  |  Height:  |  Size: 321 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 516 KiB

Loading…
Cancel
Save