斜塘答题

master
lion 2 years ago
commit 8b78f09e2c

@ -1,25 +1,25 @@
<script> <script>
import util from "@/utils/util.js" import util from "@/utils/util.js"
const jwx = require('jweixin-module') const jwx = require('jweixin-module')
export default { export default {
onLaunch: function() { onLaunch: function() {
console.log('App Launch') console.log('App Launch')
this.$nextTick(() => { this.$nextTick(() => {
let link = window.location.href; let link = window.location.href;
let that = this let that = this
if (/code=/.test(link) || link.indexOf("code") > -1) { if (/code=/.test(link) || link.indexOf("code") > -1) {
let temp = decodeURIComponent((new RegExp('[?|&]' + 'code' + '=' + let temp = decodeURIComponent((new RegExp('[?|&]' + 'code' + '=' +
'([^&;]+?)(&|#|;|$)') '([^&;]+?)(&|#|;|$)')
.exec(link) || [, ''])[1].replace(/\+/g, '%20')) || null .exec(link) || [, ''])[1].replace(/\+/g, '%20')) || null
let lifeData = uni.getStorageSync('userInfo_token') let lifeData = uni.getStorageSync('userInfo_token')
if (!lifeData) { if (!lifeData) {
let that = this let that = this
this.util.request({ this.util.request({
api: '/api/mobile/user/wechat-login?code=' + temp+'&activity_tag=bbfc', api: '/api/mobile/user/wechat-login?code=' + temp+'&activity_tag=bbfc',
data: '', data: '',
method: 'GET', method: 'GET',
utilSuccess: function(res) { utilSuccess: function(res) {
console.log(res) console.log(res)
uni.setStorageSync('userInfo_token', res); uni.setStorageSync('userInfo_token', res);
that.util.request({ that.util.request({
api: '/api/mobile/user/show', api: '/api/mobile/user/show',
@ -58,7 +58,7 @@
'updateAppMessageShareData-success' 'updateAppMessageShareData-success'
) )
}, },
}); });
jwx.updateTimelineShareData({ jwx.updateTimelineShareData({
title: '百步芳草 与理同行', // title: '百步芳草 与理同行', //
@ -76,7 +76,7 @@
utilFail: function(res) { utilFail: function(res) {
// that.util.toast(res) // that.util.toast(res)
// uni.clearStorageSync() // uni.clearStorageSync()
} }
}) })
}, },
@ -85,13 +85,13 @@
// uni.clearStorageSync() // uni.clearStorageSync()
} }
}) })
}, },
utilFail: function(res) { utilFail: function(res) {
// that.util.toast(res) // that.util.toast(res)
// uni.clearStorageSync() // uni.clearStorageSync()
} }
}) })
}else{ }else{
this.util.request({ this.util.request({
api: '/api/mobile/user/show', api: '/api/mobile/user/show',
@ -129,7 +129,7 @@
'updateAppMessageShareData-success' 'updateAppMessageShareData-success'
) )
}, },
}); });
jwx.updateTimelineShareData({ jwx.updateTimelineShareData({
title: '百步芳草 与理同行', // title: '百步芳草 与理同行', //
@ -157,31 +157,32 @@
// this.$router.go(0) // this.$router.go(0)
} }
}) })
} }
} else { } else {
let redirect = encodeURIComponent(link.replace(/#\//, "")) let redirect = encodeURIComponent(link.replace(/#\//, ""))
// let appid = 'wx7b33df2cb829cec6' // let appid = 'wx7b33df2cb829cec6'
let appid = 'wxbf4862e929ab85b0' let appid = 'wxbf4862e929ab85b0'
uni.setStorageSync('userInfo_token', {"token":"7881|46ePF9WTeCxRWTioGoy6Sf1zVvwaCCb4DOQYm5FQ","user_id":5101});
// uni.setStorageSync('userInfo_token', {"token":"7777|QHwrodQSA6dhth3TEYjIwJfW2BNok5azI9CO25yb","user_id":5081});
window.location.href =
`https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${redirect}&response_type=code&scope=snsapi_base#wechat_redirect` window.location.href =
`https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${redirect}&response_type=code&scope=snsapi_base#wechat_redirect`
}
}) }
})
},
onShow: function() { },
console.log('App Show') onShow: function() {
}, console.log('App Show')
onHide: function() { },
console.log('App Hide') onHide: function() {
} console.log('App Hide')
} }
</script> }
</script>
<style lang="scss">
/* 注意要写在第一行同时给style标签加入lang="scss"属性 */ <style lang="scss">
/* 注意要写在第一行同时给style标签加入lang="scss"属性 */
@import "@/uni_modules/uview-ui/index.scss"; @import "@/uni_modules/uview-ui/index.scss";
@import "@/GAL/css/gal.css"; @import "@/GAL/css/gal.css";
</style> </style>

@ -199,7 +199,7 @@
url = '/pages/me/me' url = '/pages/me/me'
} }
console.log(userinfo,url,isclick) console.log(userinfo,url,isclick)
return // return
if(isclick){ if(isclick){
uni.navigateTo({ uni.navigateTo({
url:url url:url

@ -1,4 +1,4 @@
<template> <template>
<view class='wrap'> <view class='wrap'>
<view class="formwrap"> <view class="formwrap">
<view class='logintitle'> <view class='logintitle'>
@ -30,7 +30,7 @@
</view> </view>
</view> </view>
<u-picker @confirm="confirmParty" keyName="name" @cancel='cancelParty' :show="partyShow" :columns="partyColumns"></u-picker> <u-picker @confirm="confirmParty" keyName="name" @cancel='cancelParty' :show="partyShow" :columns="partyColumns"></u-picker>
<!-- <view class="loginsucess" v-if="showSucess" :style="{'height':maskHeight+'px'}"> <!-- <view class="loginsucess" v-if="showSucess" :style="{'height':maskHeight+'px'}">
<view class="loginsucesswrap"> <view class="loginsucesswrap">
<view class="answerBtn"> <view class="answerBtn">
@ -67,7 +67,7 @@
</view> </view>
<view class="tipcenter"> <view class="tipcenter">
<view> <view>
<view v-html="active_tip"></view> <view v-html="active_tip"></view>
</view> </view>
</view> </view>
<view class="answerBtn"> <view class="answerBtn">
@ -75,13 +75,13 @@
</view> </view>
<view class="tipbottom"></view> <view class="tipbottom"></view>
</view> </view>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
logintitle:require("../../static/logintitle.png"), logintitle:require("../../static/logintitle.png"),
loginicon:require("../../static/loginicon.png"), loginicon:require("../../static/loginicon.png"),
@ -89,12 +89,12 @@ export default {
tip:require("../../static/logintip.png"), tip:require("../../static/logintip.png"),
partyShow:false, partyShow:false,
showSucess:false, showSucess:false,
partyColumns:[], partyColumns:[],
form: { form: {
name: '', name: '',
mobile: '', mobile: '',
address: '', address: '',
department_id:'' department_id:''
}, },
showTip:false, showTip:false,
isEnd:true, isEnd:true,
@ -105,8 +105,8 @@ export default {
windowHeight:0, windowHeight:0,
activeConfig:{}, activeConfig:{},
startTime:'', startTime:'',
endTime:'' endTime:''
} }
}, },
onShow(){ onShow(){
let that = this let that = this
@ -144,9 +144,9 @@ export default {
_this.windowHeight = res.windowHeight _this.windowHeight = res.windowHeight
} }
}); });
}, },
methods: { methods: {
formatDateToMonthDay(dateString) { formatDateToMonthDay(dateString) {
// const date = new Date(dateString); // const date = new Date(dateString);
@ -194,6 +194,7 @@ export default {
api: '/api/mobile/quiz/get-departments', api: '/api/mobile/quiz/get-departments',
data: this.form, data: this.form,
method: 'GET', method: 'GET',
customLoading: true,
utilSuccess: function(res) { utilSuccess: function(res) {
let _arr = [] let _arr = []
res.map(item=>{ res.map(item=>{
@ -209,6 +210,9 @@ export default {
openPicker(){ openPicker(){
uni.hideKeyboard() uni.hideKeyboard()
this.partyShow = true this.partyShow = true
if (this.partyColumns.length === 0) {
this.getParty()
}
}, },
confirmParty(e){ confirmParty(e){
console.log(e) console.log(e)
@ -224,8 +228,8 @@ export default {
isOnlyChinese(str) { isOnlyChinese(str) {
const chineseRegex = /^[\u4e00-\u9fa5]+$/; const chineseRegex = /^[\u4e00-\u9fa5]+$/;
return chineseRegex.test(str); return chineseRegex.test(str);
}, },
submit() { submit() {
if(this.util.isNull(this.form.name)||this.util.isNull(this.form.mobile)||this.util.isNull(this.form.address)){ if(this.util.isNull(this.form.name)||this.util.isNull(this.form.mobile)||this.util.isNull(this.form.address)){
this.util.toast("请填写所有信息") this.util.toast("请填写所有信息")
return return
@ -264,12 +268,12 @@ export default {
utilFail: function(res) { utilFail: function(res) {
that.util.toast(res) that.util.toast(res)
} }
}) })
} }
} }
} }
</script> </script>
<style scoped> <style scoped>
page { page {
/* background-color: #F6F3EA; */ /* background-color: #F6F3EA; */
@ -278,7 +282,7 @@ export default {
position: relative; position: relative;
background-color: #fffafa; background-color: #fffafa;
/* padding-top: 11vh; */ /* padding-top: 11vh; */
} }
.wrap{ .wrap{
height: 100%; height: 100%;
width:100%; width:100%;
@ -294,11 +298,11 @@ export default {
padding-bottom:120rpx padding-bottom:120rpx
} }
.logintitle{ .logintitle{
} }
/deep/ .logintitle .u-image{ /deep/ .logintitle .u-image{
margin:0 auto; margin:0 auto;
} }
.logintitletext{ .logintitletext{
margin-top:40rpx; margin-top:40rpx;
@ -308,7 +312,7 @@ export default {
font-size: 28rpx; font-size: 28rpx;
color:#999999; color:#999999;
border-radius:0 60rpx 60rpx 0; border-radius:0 60rpx 60rpx 0;
background-color: #fff; background-color: #fff;
padding:10rpx 20rpx padding:10rpx 20rpx
} }
.logintitletext span:first-child{ .logintitletext span:first-child{
@ -344,7 +348,7 @@ export default {
} }
/deep/ .loginbtn .u-button--circle{ /deep/ .loginbtn .u-button--circle{
box-shadow: 1rpx 7rpx 18rpx 0rpx rgba(235,107,85,0.3); box-shadow: 1rpx 7rpx 18rpx 0rpx rgba(235,107,85,0.3);
} }
</style> </style>
<style lang="scss"> <style lang="scss">
.tips{ .tips{
@ -427,16 +431,16 @@ export default {
font-size: 28rpx; font-size: 28rpx;
border-radius: 10rpx; border-radius: 10rpx;
display: inline-block; display: inline-block;
} }
& > view:last-child{ & > view:last-child{
color:#fff; color:#fff;
background: linear-gradient(90deg, #E73928, #F07963); background: linear-gradient(90deg, #E73928, #F07963);
} }
} }
} }
} }
.loginsucess{ .loginsucess{
.tipwrap{ .tipwrap{
@ -464,4 +468,4 @@ export default {
} }
} }
} }
</style> </style>

@ -32,7 +32,7 @@
<view class="user-info"> <view class="user-info">
<view class="user-info-avatar"> <view class="user-info-avatar">
<img class="avatar" :src="userInfo.headimgurl ? userInfo.headimgurl : logo" alt=""> <img class="avatar" :src="userInfo.headimgurl ? userInfo.headimgurl : logo" alt="">
</view> </view>
<view class="user-info__text"> <view class="user-info__text">
@ -86,7 +86,7 @@
</view> </view>
</view> </view>
</view> </view>
<!-- 未获得证书 --> <!-- 未获得证书 -->
<view class="norecord tips" v-if="showRecord"> <view class="norecord tips" v-if="showRecord">
<view class="tipwrap"> <view class="tipwrap">
@ -184,7 +184,7 @@
</view> </view>
<view class="tipcenter" style="text-align: left;"> <view class="tipcenter" style="text-align: left;">
<view> <view>
<view v-html="active_tip"></view> <view v-html="active_tip"></view>
</view> </view>
</view> </view>
<view class="answerBtn"> <view class="answerBtn">
@ -222,7 +222,7 @@ export default {
showtips:false, showtips:false,
winimg:require('../../static/index/logo2.png'), winimg:require('../../static/index/logo2.png'),
tiptitle:require('../../static/tiptitle.png'), tiptitle:require('../../static/tiptitle.png'),
isEnd:true, isEnd:true,
active_tip:'', active_tip:'',
maxCount:2, maxCount:2,
}; };
@ -297,7 +297,7 @@ export default {
method: 'GET', method: 'GET',
utilSuccess: function(res) { utilSuccess: function(res) {
that.answercount = res.ask_count that.answercount = res.ask_count
}, },
utilFail: function(res) { utilFail: function(res) {
that.util.toast(res) that.util.toast(res)
@ -436,7 +436,7 @@ export default {
// color:#fff; // color:#fff;
// background: linear-gradient(90deg, #E73928, #F07963); // background: linear-gradient(90deg, #E73928, #F07963);
// } // }
// } // }
// } // }
// } // }
@ -447,7 +447,7 @@ export default {
// height:643rpx; // height:643rpx;
// background-size: 100% 100%; // background-size: 100% 100%;
// .tipwrap{ // .tipwrap{
// .nowintip{ // .nowintip{
// top:320rpx; // top:320rpx;
// } // }
@ -563,16 +563,16 @@ export default {
font-size: 28rpx; font-size: 28rpx;
border-radius: 10rpx; border-radius: 10rpx;
display: inline-block; display: inline-block;
} }
& > view:last-child{ & > view:last-child{
color:#fff; color:#fff;
background: linear-gradient(90deg, #E73928, #F07963); background: linear-gradient(90deg, #E73928, #F07963);
} }
} }
} }
} }
.norecord{ .norecord{
.tipwrap{ .tipwrap{
@ -594,18 +594,18 @@ export default {
min-height:120rpx; min-height:120rpx;
& >view:last-child{ & >view:last-child{
padding-top:0; padding-top:0;
} }
& span{ & span{
color:#E73928 color:#E73928
} }
} }
} }
} }
.nowin{ .nowin{
.tipwrap{ .tipwrap{
.tipicon{ .tipicon{
background: url(../../static/nowinicon.png); background: url(../../static/nowinicon.png);
background-size: 100% 100%; background-size: 100% 100%;
@ -624,7 +624,7 @@ export default {
min-height:120rpx; min-height:120rpx;
} }
} }
} }
.win{ .win{
.tipwrap{ .tipwrap{

Loading…
Cancel
Save