斜塘答题

master
lion 2 years ago
parent 773da61a34
commit e40adfe941

@ -162,7 +162,7 @@
let redirect = encodeURIComponent(link.replace(/#\//, ""))
// let appid = 'wx7b33df2cb829cec6'
let appid = 'wxbf4862e929ab85b0'
// uni.setStorageSync('userInfo_token', {"token":"7777|QHwrodQSA6dhth3TEYjIwJfW2BNok5azI9CO25yb","user_id":5081});
uni.setStorageSync('userInfo_token', {"token":"7881|46ePF9WTeCxRWTioGoy6Sf1zVvwaCCb4DOQYm5FQ","user_id":5101});
window.location.href =
`https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${redirect}&response_type=code&scope=snsapi_base#wechat_redirect`

@ -5,17 +5,20 @@
<view class="answerwrap">
<view class='answertop'>
<view>(答题{{questionIndex+1}}/10)</view>
<view>{{minutes}}:{{seconds}}</view>
<view>
<u-image style="display: inline-block;margin-right:5px" :fade="false" width="24rpx" height="24rpx" :src='timeicon'></u-image>
{{minutes}}:{{seconds}}</view>
</view>
<view>
<view class='answercenter'>
<view class='answertitle'>
<span>{{question_list[questionIndex]?question_list[questionIndex]['type_name']:''}}</span>{{question_list[questionIndex]?question_list[questionIndex]['title']:''}}
<span :class="[{'more':question_list[questionIndex]['type_name']==='多选题'}]">{{question_list[questionIndex]?question_list[questionIndex]['type_name']:''}}</span> <text class="hasspan" v-html="question_list[questionIndex]?replaceAtSymbolsWithSpan(question_list[questionIndex]['title']):''"></text>
</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'">
<view @click="chooseAnswer(ans,ansindex)" :class="['answeritem',{'active':ans.flag},{'correct':ans.isanswer},{'wrong':ans.iswrong}]">
<span>{{answerNum[ansindex]}}</span>{{ans.title}}
<!-- {{ans.is_correct}}--- -->
<!-- :class="ans.flag?'answeritem active':'answeritem'" -->
</view>
</view>
</view>
@ -98,8 +101,11 @@
showAnswer:false,
ansicon100:require('../../static/answer100icon.png'),
ansicon80:require('../../static/answer80icon.png'),
timeicon:require('../../static/time.png'),
maskHeight:0,
maxscore:0,
isanswer:false,//
}
},
onShow(){
@ -201,6 +207,9 @@
}
})
},
replaceAtSymbolsWithSpan(str) {
return str.replace(/@/g, '<span style="display: inline-block;width:40px;border-bottom:1px solid #666;margin: 0 3px;margin-bottom: -2px;"></span>');
},
chooseAnswer(ans,ansindex){
this.hasFlag = false
if(this.question_list[this.questionIndex]['type_name']==='单选题'){
@ -265,6 +274,10 @@
nextQue(){
console.log("进入questionIndex",this.questionIndex,this.correctNum)
let that = this
// this.isanswer = false
if(this.isanswer){
return
}
if(!this.hasFlag){
this.util.toast("请先选择答案")
return
@ -300,12 +313,22 @@
// that.answerSubmit = true
// return
// }
//
this.question_list[this.questionIndex]['options'].map(item=>{
if(item.is_correct===1){
item.isanswer = true
}else if(item.flag==true&&item.is_correct===0){
item.iswrong = true
}
})
this.isanswer = true
if(that.questionIndex==9){
that.submitQue()
return
}
setTimeout(function(){
that.correctAnswer = ''
that.isanswer = false
that.questionIndex++
if(that.questionIndex==9){
that.answerSubmit = true
@ -395,8 +418,10 @@
}
.answertitle{
padding:30rpx;
line-height: 2;
font-weight: bold;
line-height: 1.8;
font-family: "宋体";
color: rgba(0,0,0,0.8);
/* font-weight: bold; */
}
.answertitle span{
@ -408,6 +433,14 @@
border-radius: 10rpx;
font-weight: normal;
}
.answertitle span.more{
background-color: cadetblue;
}
.borderb{
display: inline-block;
width:10rpx;
border-bottom:1px solid #666;
}
.answercheck{
padding:30rpx;
padding-top:0rpx;
@ -419,9 +452,12 @@
border-radius: 20rpx;
color:#666666;
}
.answeritem.active{
.answeritem.active,.answeritem.wrong{
border:4rpx solid #d22425;
}
.answeritem.correct{
border:4rpx solid green;
}
.answeritem span{
display: inline-block;
width:40rpx;
@ -433,11 +469,17 @@
border-radius: 10rpx;
margin-right:10rpx
}
.answeritem.active span{
.answeritem.active span,.answeritem.wrong span{
border:2px solid #d22425;
background-color: #d22425;
color:#fff;
}
.answeritem.correct span{
border:2px solid green;
background-color: green;
color:#fff;
}
.answerbottom{
padding:30rpx;
padding-top:10rpx;

@ -0,0 +1,355 @@
<template>
<view class="wrap">
<view class="index1" :animation="animationData" ref="apiAnimateDemo">
<view v-for="(item,index) in animations">
<gal-css-animate v-if="item.show" :animateName="item.name"
:class='item.class'
:duration="item.duration"
:autoPlay="item.autoplay"
timingFunction="ease-in">
<u-image :fade="false" :src="item.content" :width="item.width" :height="item.height"></u-image>
</gal-css-animate>
</view>
</view>
<view class="index2" :animation="animationData1" @click="towhere(true)">
<view :animation="animationData20" class="logo20">
<u-image :fade="false" :src="logo20" width="135rpx" height="119rpx"></u-image>
</view>
<view :animation="animationData21" class="logo21">
<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="53rpx" height="457rpx"></u-image>
</view>
<view :animation="animationData23" class="logo23">
<u-image :fade="false" :src="logo23" width="750rpx" height="594rpx"></u-image>
</view>
<view :animation="animationData24" class="logo24">
<u-image :fade="false" :src="logo24" width="135rpx" height="100rpx"></u-image>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
isLogin:false,//
isEnd:false,//
animations: [{
name: 'fadeIn',
duration: '1s',
timer: 1000,
content: require('../../static/index/shine.png'),
autoplay:false,
class:'logo0',
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: 'fadeIn',
duration: '1s',
timer: 1000,
content: require('../../static/index/logo1.png'),
autoplay:false,
class:'logo1',
show:false,
width:'242rpx',
height:'432rpx'
},
{
name: 'fadeInUp',
duration: '1s',
timer: 1000,
content: require('../../static/index/logo2.png'),
autoplay:false,
class:'logo2',
show:false,
width:'750rpx',
height:'605rpx'
}
],
logo20:require('../../static/index/2logo.png'),
logo21:require('../../static/index/2logo1.png'),
logo22:require('../../static/index/2logo2.png'),
logo23:require('../../static/index/2logo3.png'),
logo24:require('../../static/index/2logo4.png'),
animationData:{},
animationData0:{},
animationData1:{},
animationData20:{},
animationData21:{},
animationData22:{},
animationData23:{},
animationData24:{},
animations2: [{
name: 'fadeIn',
duration: '1.5s',
timer: 1500,
content: require('../../static/index/2logo.png'),
autoplay:false,
class:'logo20',
show:false,
width:'135rpx',
height:'100rpx'
},
],
userInfo:{}
}
},
onLoad() {
// this.play2(0)
// this.getUserInfo()
this.userInfo = uni.getStorageSync('userInfo')
this.getConfig()
this.play(2)
},
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()
//
// logo xietang
var animation24 = uni.createAnimation({
duration: 2500,
timingFunction: 'ease-in'
})
this.animationData24 = animation24.export()
//
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
this.animations[index]['autoplay'] = true
setTimeout(()=>{
this.play(index-1);
}, this.animations[index].timer)
},
play2(index){
// 1
var animation21 = uni.createAnimation({
duration: 1000,
timingFunction: 'ease-in',
delay:1000
})
animation21.height("255rpx").step()
this.animationData21 = animation21.export()
// 2
var animation22 = uni.createAnimation({
duration: 1000,
timingFunction: 'ease-in',
delay:2000
})
animation22.height("457rpx").step()
this.animationData22 = animation22.export()
//
var animation23 = uni.createAnimation({
duration: 1000,
timingFunction: 'ease-in',
delay:3000
})
animation23.opacity(1).step()
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('activeConfig',res)
uni.setStorageSync('isEnd',that.isEnd)
// this.userInfo = res;
// uni.setStorageSync("userInfo",res)
},
utilFail: (res) => {
// this.util.toast(res)
uni.clearStorageSync()
}
})
},
isCurrentTimeBetween(startTime, endTime) {
let that = this
const now = that.$moment().valueOf()
const start = that.$moment(startTime).valueOf();
const end =that.$moment(endTime).valueOf();
console.log("123",now,start,end)
return now >= start && now <= end;
},
towhere(isclick){
let userinfo = uni.getStorageSync('userInfo')
let url = '/pages/me/me'
console.log("userinfo.mobile",userinfo.mobile)
console.log("this.util.isNull(userinfo.mobile)",this.util.isNull(userinfo.mobile))
if(this.util.isNull(userinfo.mobile)){
url = '/pages/login/index'
}
console.log("url",url)
// return
//
if(isclick){
uni.navigateTo({
url:url
})
}else{
setTimeout(function(){
uni.navigateTo({
url:url
})
},4500)
}
}
}
}
</script>
<style>
page {
height: 100%;
overflow: hidden;
position: relative;
}
.wrap {
width: 100%;
height: 100%
}
.index1 {
width: 100%;
height: 100%;
background-image: url('../../static/index/bg.png');
position: absolute;
/* display: none; */
background-size: 100% 100%;
top:0;
left:0;
z-index:2;
overflow: hidden;
}
.logo0{
position: absolute;
top: 0;
left: 0;
}
.logo {
position: absolute;
top: 10%;
left: 235rpx;
}
.logo1 {
position: absolute;
bottom: 670rpx;
left: 270rpx;
}
.logo2 {
position: absolute;
bottom: 0rpx;
left: 0rpx;
}
.index2 {
width: 100%;
height: 100%;
background-image: url('../../static/index/2bg.png');
position: absolute;
background-size: 100% 100%;
top:0;
left:0;
z-index:1;
opacity: 0;
}
.logo20{
position: absolute;
top: 52rpx;
left: 70rpx;
opacity: 0;
/* opacity: 0;
top: 50%;
left: 50%;
transform: translate(-50%,-50%); */
}
.logo21 {
position: absolute;
top: 220rpx;
right: 70rpx;
height:0;
overflow: hidden;
}
.logo22 {
position: absolute;
top: 220rpx;
right: 230rpx;
height:0;
overflow: hidden;
}
.logo23 {
position: absolute;
bottom: 4%;
left: 0rpx;
opacity: 0;
}
.logo24{
position: absolute;
top: 58rpx;
right: 70rpx;
opacity: 1;
/* opacity: 0;
top: 50%;
left: 50%;
transform: translate(-50%,-50%); */
}
</style>

@ -36,7 +36,7 @@
data() {
return {
isLogin:false,//
isEnd:false,//
animations: [{
name: 'fadeIn',
duration: '1s',
@ -47,42 +47,41 @@
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',
timer: 1000,
content: require('../../static/index/logo1.png'),
content: require('../../static/index/logo12.png'),
autoplay:false,
class:'logo1',
show:false,
width:'242rpx',
height:'432rpx'
width:'671rpx',
height:'336rpx'
},
{
name: 'fadeInUp',
duration: '1s',
timer: 1000,
content: require('../../static/index/logo2.png'),
content: require('../../static/index/logo22.png'),
autoplay:false,
class:'logo2',
show:false,
width:'750rpx',
height:'605rpx'
height:'802rpx'
}
],
logo20:require('../../static/index/2logo.png'),
logo20:require('../../static/index/2logo20.png'),
logo21:require('../../static/index/2logo1.png'),
logo22:require('../../static/index/2logo2.png'),
logo23:require('../../static/index/2logo3.png'),
@ -107,17 +106,21 @@
height:'100rpx'
},
],
userInfo:{}
}
},
onLoad() {
// this.play2(0)
// this.getUserInfo()
this.userInfo = uni.getStorageSync('userInfo')
this.getConfig()
this.play(2)
this.play(3)
},
methods: {
// getUserInfo(){
// let userinfo = uni.getStorageSync('userInfo')
// if(userinfo){
// this.isLogin = true
// }
// },
play(index){
//
if(index<0){
@ -140,14 +143,13 @@
})
animation20.opacity(1).step()
this.animationData20 = animation20.export()
//
// logo xietang
var animation24 = uni.createAnimation({
duration: 2500,
timingFunction: 'ease-in'
})
this.animationData24 = animation24.export()
//
// s
var animation1 = uni.createAnimation({
duration: 2000,
timingFunction: 'ease-in',
@ -168,7 +170,7 @@
var animation21 = uni.createAnimation({
duration: 1000,
timingFunction: 'ease-in',
delay:1000
delay:2000
})
animation21.height("255rpx").step()
this.animationData21 = animation21.export()
@ -176,7 +178,7 @@
var animation22 = uni.createAnimation({
duration: 1000,
timingFunction: 'ease-in',
delay:2000
delay:3000
})
animation22.height("457rpx").step()
this.animationData22 = animation22.export()
@ -184,59 +186,20 @@
var animation23 = uni.createAnimation({
duration: 1000,
timingFunction: 'ease-in',
delay:3000
delay:4000
})
animation23.opacity(1).step()
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('activeConfig',res)
uni.setStorageSync('isEnd',that.isEnd)
// this.userInfo = res;
// uni.setStorageSync("userInfo",res)
},
utilFail: (res) => {
// this.util.toast(res)
uni.clearStorageSync()
}
})
},
isCurrentTimeBetween(startTime, endTime) {
let that = this
const now = that.$moment().valueOf()
const start = that.$moment(startTime).valueOf();
const end =that.$moment(endTime).valueOf();
console.log("123",now,start,end)
return now >= start && now <= end;
},
towhere(isclick){
let userinfo = uni.getStorageSync('userInfo')
let url = '/pages/me/me'
console.log("userinfo.mobile",userinfo.mobile)
console.log("this.util.isNull(userinfo.mobile)",this.util.isNull(userinfo.mobile))
if(this.util.isNull(userinfo.mobile)){
url = '/pages/login/index'
let url = '/pages/login/index'
if(userinfo){
url = '/pages/me/me'
}
console.log("url",url)
// return
//
console.log(userinfo,url,isclick)
return
if(isclick){
uni.navigateTo({
url:url
@ -246,7 +209,7 @@
uni.navigateTo({
url:url
})
},4500)
},8000)
}
}
}
@ -290,8 +253,8 @@
.logo1 {
position: absolute;
bottom: 670rpx;
left: 270rpx;
bottom: 520rpx;
left: 60rpx;
}
.logo2 {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 278 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 813 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 272 KiB

After

Width:  |  Height:  |  Size: 321 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 321 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 627 B

Loading…
Cancel
Save