提交 233715c0 authored 作者: 王鹏飞's avatar 王鹏飞

优化

上级 db504aba
VUE_APP_BASE_API=
VUE_APP_WECHAT_REDIRECT_URL=
\ No newline at end of file
VUE_APP_BASE_API=https://alumni.ezijing.com
VUE_APP_WECHAT_REDIRECT_URL=https://passport.ezijing.com/rest/wechat/oauth-callback
<template>
<div class="list">
<van-list
v-model="loading"
:finished="finished"
@load="onLoad"
v-if="list.length"
>
<van-list v-model="loading" :finished="finished" @load="onLoad" v-if="list.length">
<activity-item
v-for="(item, index) in list"
:data="item"
......@@ -70,8 +65,7 @@ export default {
})
},
onLoad() {
this.requestParams.offset =
this.requestParams.offset + this.requestParams.limit
this.requestParams.offset = this.requestParams.offset + this.requestParams.limit
this.getList()
},
// 刷新
......
......@@ -5,7 +5,7 @@
</div>
<slot name="member-before" :user="data"></slot>
<div class="member-item-content">
<h4>{{ data.nickname || data.personal_name }}</h4>
<h4>{{ data.personal_name }}</h4>
<p>{{ data.class_name }}</p>
</div>
<slot name="member-after" :user="data"></slot>
......
......@@ -4,7 +4,6 @@
<input
type="search"
class="search-input"
:class="classes"
:placeholder="placeholder"
v-model="currentValue"
v-bind="$attrs"
......@@ -20,7 +19,7 @@ export default {
props: {
value: String,
focus: { type: Boolean, default: false },
placeholder: { type: String, default: '' }
placeholder: { type: String, default: '搜索校友、活动、组织' }
},
data() {
return {
......@@ -70,9 +69,9 @@ export default {
width: 100%;
height: 30px;
line-height: 30px;
background: #f3f4f5 url('~@/assets/img/icon_search.png') no-repeat center center;
background: #f3f4f5 url('~@/assets/img/icon_search.png') no-repeat 14px center;
background-size: 15px;
padding: 0 20px;
padding: 0 20px 0 40px;
border-radius: 15px;
&.is-focus {
background: #f3f4f5;
......
......@@ -161,9 +161,13 @@ const router = new VueRouter({
mode: 'history',
base: process.env.BASE_URL,
routes,
scrollBehavior() {
scrollBehavior(to, from, savedPosition) {
if (savedPosition) {
return savedPosition
} else {
return { x: 0, y: 0 }
}
}
})
export default router
......@@ -4,7 +4,7 @@ import { Notify } from 'vant'
import router from '@/router'
import { logout } from '@/api/account'
const httpRequest = axios.create({
baseURL: process.env.VUE_APP_BASE_API,
// baseURL: process.env.VUE_APP_BASE_API,
timeout: 60000,
withCredentials: true,
headers: {
......@@ -16,9 +16,7 @@ const httpRequest = axios.create({
// 请求拦截
httpRequest.interceptors.request.use(
function(config) {
if (
config.headers['Content-Type'] === 'application/x-www-form-urlencoded'
) {
if (config.headers['Content-Type'] === 'application/x-www-form-urlencoded') {
config.data = qs.stringify(config.data)
}
return config
......
......@@ -48,7 +48,8 @@ export default {
{ text: '去游学', value: '2' },
{ text: '直播课', value: '3' },
// { text: '找工作', value: '4' },
{ text: '运动家', value: '5' }
{ text: '运动家', value: '5' },
{ text: '其他', value: '9' }
]
},
{
......
......@@ -4,7 +4,10 @@
<search-bar readonly @click.native="$router.push({ name: 'search' })"></search-bar>
<!-- banner -->
<div class="banner">
<img src="img/home_banner.png" />
<van-swipe :autoplay="3000" indicator-color="white">
<van-swipe-item><img src="img/home_banner.png" /></van-swipe-item>
<van-swipe-item><img src="img/home_banner.png" /></van-swipe-item>
</van-swipe>
</div>
<!-- 导航 -->
<div class="nav">
......@@ -60,7 +63,7 @@ export default {
navList: [
{ src: 'img/home_nav_01.png', title: '公益行', type: 1 },
{ src: 'img/home_nav_02.png', title: '去游学', type: 2 },
{ src: 'img/home_nav_03.png', title: '直播课', type: 3 },
// { src: 'img/home_nav_03.png', title: '直播课', type: 3 },
// { src: 'img/home_nav_04.png', title: '找工作', type: 4 },
{ src: 'img/home_nav_04.png', title: '运动家', type: 5 }
],
......
......@@ -7,12 +7,7 @@
<div class="login-bd">
<div class="login-form">
<div class="login-form__item">
<input
type="text"
class="login-input"
placeholder="手机/邮箱/用户名"
v-model="ruleForm.account"
/>
<input type="text" class="login-input" placeholder="手机/邮箱/用户名" v-model="ruleForm.account" />
</div>
<div class="login-form__item">
<input
......@@ -24,9 +19,7 @@
/>
</div>
<div class="login-form__item">
<van-checkbox v-model="ruleForm.RememberMe" shape="square"
>下次自动登录</van-checkbox
>
<van-checkbox v-model="ruleForm.RememberMe" shape="square">下次自动登录</van-checkbox>
<!-- <div class="login-type">验证码登录</div> -->
</div>
<div class="login-form__item">
......@@ -37,9 +30,7 @@
<div class="login-ft">
<p class="login-tips">
登录遇到困难?请点击
<span class="forget-password" @click="passwordVisible = true"
>找回密码</span
>
<span class="forget-password" @click="passwordVisible = true">找回密码</span>
</p>
</div>
<password v-model="passwordVisible" />
......@@ -125,7 +116,6 @@ export default {
} else {
this.$router.replace('/')
}
// this.$router.replace('/')
} else {
this.$notify(response.msg)
}
......@@ -133,10 +123,9 @@ export default {
wechatLogin() {
const appId = 'wx451c01d40d090d7a'
// 回调地址
const redirectURI = `${
process.env.VUE_APP_WECHAT_REDIRECT_URL
}?needCheck=false&identity=friend&redirectUrl=${this.redirectURI ||
location.origin}`
const redirectURI = `${process.env.VUE_APP_WECHAT_REDIRECT_URL}?needCheck=false&identity=friend&redirectUrl=${
this.redirectURI || location.origin
}`
// 微信的地址
const wechatUrl = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appId}&redirect_uri=${encodeURIComponent(
redirectURI
......@@ -145,17 +134,41 @@ export default {
location.href = wechatUrl
},
checkWechatLogin() {
return !!(
Cookies.get('wechat_login_error') ||
Cookies.get('wechat_login_no_phone_error')
)
}
return !!(Cookies.get('wechat_login_error') || Cookies.get('wechat_login_no_phone_error'))
},
created() {
if (this.isWechat && !this.checkWechatLogin()) {
// 显示登录提示框
showLoginDialog() {
this.$dialog
.confirm({
title: '您还未登录',
message: '请先登录再进行操作',
cancelButtonText: '暂不登录',
confirmButtonText: '立即登录'
})
.then(() => {
this.wechatLogin()
})
}
},
beforeMount() {
this.$store.dispatch('checkLogin').then(isLogin => {
if (isLogin) {
this.loginSuccess({ code: 0 })
} else {
if (this.isWechat) {
if (!this.checkWechatLogin()) {
this.showLoginDialog()
return
}
const error = Cookies.get('wechat_login_error')
if (error) {
this.$toast(error)
Cookies.remove('wechat_login_error', { domain: '.ezijing.com' })
}
}
}
})
}
}
</script>
<style lang="scss">
......
......@@ -16,7 +16,7 @@
<img :src="user.avatar | avatar" />
</div>
<div class="user-content">
<div class="user-content__name">{{ user.nickname || user.personal_name }}</div>
<div class="user-content__name">{{ user.personal_name }}</div>
<div class="user-content__info">{{ user.class_name }}</div>
</div>
<!-- <div class="user-aside">
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论