提交 4b7717b2 authored 作者: 王鹏飞's avatar 王鹏飞

bug fixes

上级 cb6b6a25
...@@ -160,9 +160,11 @@ export default { ...@@ -160,9 +160,11 @@ export default {
this.wechatLogin() this.wechatLogin()
return return
} }
if (Cookies.get('wechat_login_error')) { const error = Cookies.get('wechat_login_error')
if (error) {
this.$toast(error)
Cookies.remove('wechat_login_error', { domain: '.ezijing.com' }) Cookies.remove('wechat_login_error', { domain: '.ezijing.com' })
wx.miniProgram.navigateBack() // wx.miniProgram.navigateBack()
} }
} }
} }
......
<template> <template>
<div> <div>
<div class="info-box"> <div class="info-box">
<img v-if="info.avatar" :src="info.avatar" alt=""> <img v-if="info.avatar" :src="info.avatar" />
<img v-else src="../../assets/images/tx.png" alt=""> <img v-else src="../../assets/images/tx.png" />
<div class="name" v-if="info.nickname">{{ info.nickname }}</div> <div class="name" v-if="info.nickname">{{ info.nickname }}</div>
<div class="name" v-else @click="goLogin">点击登录</div> <div class="name" v-else @click="goLogin">点击登录</div>
</div> </div>
<ul> <ul>
<li v-for="(item, index) in navList" :key="index" @click="go(item.url)"> <li v-for="(item, index) in navList" :key="index" @click="go(item.url)">
<div class="title">{{ item.title }}</div> <div class="title">{{ item.title }}</div>
<van-icon name="arrow" class="icon"/> <van-icon name="arrow" class="icon" />
</li> </li>
</ul> </ul>
<div class="login-out" @click="logout"> <div class="login-out" @click="logout">退出登录</div>
退出登录
<!-- <van-button type="default" >退出登录</van-button> -->
</div>
</div> </div>
</template> </template>
...@@ -58,7 +55,6 @@ export default { ...@@ -58,7 +55,6 @@ export default {
methods: { methods: {
logout() { logout() {
logout().then(response => { logout().then(response => {
console.log(response, '======')
this.$toast('退出成功') this.$toast('退出成功')
}) })
}, },
...@@ -74,17 +70,11 @@ export default { ...@@ -74,17 +70,11 @@ export default {
goLogin() { goLogin() {
if (this.isWeapp) { if (this.isWeapp) {
// 小程序 // 小程序
wx.miniProgram.navigateTo({ wx.miniProgram.navigateTo({ url: '/pages/login/index' })
url: `/pages/login/index?redirect_uri=${encodeURIComponent(
`/exam/result?type=${this.$route.query.type}&is_create=0&papersUrl=${this.$route.query.papersUrl}`
)}`
})
} else { } else {
this.$router.push({ this.$router.push({
path: '/login', path: '/login',
query: { query: { redirect_uri: window.location.href }
redirect_uri: '/my'
}
}) })
} }
} }
...@@ -97,51 +87,51 @@ export default { ...@@ -97,51 +87,51 @@ export default {
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.info-box{ .info-box {
display: flex; display: flex;
align-items: center; align-items: center;
height: 2rem; height: 2rem;
img{ img {
width: 1.2rem; width: 1.2rem;
height: 1.2rem; height: 1.2rem;
margin:0 .2rem 0 .4rem; margin: 0 0.2rem 0 0.4rem;
} }
.name{ .name {
font-size: .34rem; font-size: 0.34rem;
color: #222; color: #222;
} }
} }
ul{ ul {
padding: 0 .4rem; padding: 0 0.4rem;
li{ li {
height: 1.1rem; height: 1.1rem;
border-bottom: .01rem solid rgba(238,238,238,1); border-bottom: 0.01rem solid rgba(238, 238, 238, 1);
display: flex; display: flex;
align-items: center; align-items: center;
.title{ .title {
font-size: .3rem; font-size: 0.3rem;
color: #222; color: #222;
} }
.icon{ .icon {
margin-left: auto; margin-left: auto;
} }
} }
li:last-child{ li:last-child {
border: none; border: none;
} }
} }
.login-out{ .login-out {
position: absolute; position: absolute;
bottom: 2rem; bottom: 2rem;
left: 50%; left: 50%;
-webkit-transform: translateX(-50%); -webkit-transform: translateX(-50%);
width:6.7rem; width: 6.7rem;
height:.7rem; height: 0.7rem;
background:rgba(247,247,247,1); background: rgba(247, 247, 247, 1);
border-radius:.12rem; border-radius: 0.12rem;
text-align: center; text-align: center;
line-height: .7rem; line-height: 0.7rem;
font-size: .3rem; font-size: 0.3rem;
color: #ccc; color: #ccc;
} }
</style> </style>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论