提交 9b007cfe authored 作者: 王鹏飞's avatar 王鹏飞

bug fixes

上级 65a2fbaa
...@@ -4,26 +4,26 @@ module.exports = { ...@@ -4,26 +4,26 @@ module.exports = {
// apiBaseURL: 'https://zy2.ezijing.com/', // apiBaseURL: 'https://zy2.ezijing.com/',
webpack: { webpack: {
externals: { externals: {
'CKEDITOR': 'window.CKEDITOR', CKEDITOR: 'window.CKEDITOR',
'Base64': 'window.Base64', Base64: 'window.Base64',
'md5': 'window.md5', md5: 'window.md5',
'regeneratorRuntime': 'window.regeneratorRuntime', regeneratorRuntime: 'window.regeneratorRuntime',
'wx': 'window.wx', wx: 'window.wx'
}, },
devServer: { devServer: {
proxy: { proxy: {
'/api/passport': { // '/api/passport': {
target: 'https://passport.ezijing.com', // target: 'https://passport.ezijing.com',
pathRewrite: { // pathRewrite: {
'^/api/passport': '/' // 需要rewrite重写的 // '^/api/passport': '/' // 需要rewrite重写的
} // }
}, // },
'/usercenter': { // '/api/usercenter': {
target: 'https://api-usercenter.ezijing.com', // target: 'https://api-usercenter.ezijing.com',
pathRewrite: { // pathRewrite: {
'^/usercenter': '/' // 需要rewrite重写的 // '^/api/usercenter': '/' // 需要rewrite重写的
} // }
} // }
/* 多个代理 */ /* 多个代理 */
// '/api': { // '/api': {
// target: $GLOBAL.webConf.url, // target: $GLOBAL.webConf.url,
...@@ -43,10 +43,6 @@ module.exports = { ...@@ -43,10 +43,6 @@ module.exports = {
} }
} }
}, },
ProvidePlugin: { ProvidePlugin: {},
others: {}
},
others: {
}
} }
...@@ -47,6 +47,7 @@ export default { ...@@ -47,6 +47,7 @@ export default {
.course-item-pic { .course-item-pic {
width: 2.4rem; width: 2.4rem;
height: 1.35rem; height: 1.35rem;
margin-right: 10px;
border-radius: 6px; border-radius: 6px;
overflow: hidden; overflow: hidden;
margin-right: 0.2rem; margin-right: 0.2rem;
...@@ -66,6 +67,7 @@ export default { ...@@ -66,6 +67,7 @@ export default {
overflow: hidden; overflow: hidden;
} }
.course-item__text { .course-item__text {
max-height: 0.68rem;
font-size: 0.26rem; font-size: 0.26rem;
color: #999; color: #999;
display: -webkit-box; display: -webkit-box;
......
...@@ -50,6 +50,7 @@ export default { ...@@ -50,6 +50,7 @@ export default {
.course-item-pic { .course-item-pic {
width: 2.4rem; width: 2.4rem;
height: 1.35rem; height: 1.35rem;
margin-left: 10px;
border-radius: 6px; border-radius: 6px;
overflow: hidden; overflow: hidden;
img { img {
......
<template> <template>
<div></div> <div class="messages"></div>
</template> </template>
<script> <script>
import MessageCard from './messageCard.vue'
import * as api from '@/api/course.js'
export default { export default {
props: {}, props: {},
components: { MessageCard },
data() { data() {
return {} return {
messageList: []
}
},
getCourseTag() {
api.getCourseTag(this.courseId).then(response => {
console.log(response)
})
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.messages {
background: #eee;
}
</style> </style>
<template>
<div class="message-card">
<div class="message-card-hd">
<div class="message-card__title">{{data.name}}</div>
</div>
<div class="message-card-bd">
<ul v-if="data.tag && data.tag.length">
<li v-for="item in data.tag" :key="item.id">{{item.title}}</li>
</ul>
</div>
<div class="message-card-ft">更多</div>
</div>
</template>
<script>
export default {
name: 'MessageCard',
props: {
data: { type: Object }
}
}
</script>
...@@ -6,6 +6,9 @@ ...@@ -6,6 +6,9 @@
<van-swipe-item> <van-swipe-item>
<img src="../../assets/images/banner.png" /> <img src="../../assets/images/banner.png" />
</van-swipe-item> </van-swipe-item>
<van-swipe-item>
<img src="../../assets/images/banner.png" />
</van-swipe-item>
</van-swipe> </van-swipe>
</div> </div>
<div class="nav"> <div class="nav">
...@@ -21,7 +24,7 @@ ...@@ -21,7 +24,7 @@
</li> </li>
</ul> </ul>
</div> </div>
<card title="课程试听" style="padding-bottom:50px;"> <card title="课程试听" style="padding-bottom:60px;">
<free-course-item v-for="item in courseList" :data="item" :key="item.course_id"></free-course-item> <free-course-item v-for="item in courseList" :data="item" :key="item.course_id"></free-course-item>
</card> </card>
</div> </div>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="code-login"> <div class="code-login">
<van-form class="login-form" ref="form" v-on="$listeners"> <van-form class="login-form" ref="form" v-on="$listeners">
<van-field v-model="ruleForm.account" name="account" label="手机号" placeholder="请输入手机号" /> <van-field v-model="ruleForm.account" name="account" label="手机号" placeholder="请输入手机号" />
<van-field v-model="ruleForm.code" name="code" label="验证码" placeholder="请输入验证码"> <van-field v-model="ruleForm.password" name="password" label="验证码" placeholder="请输入验证码">
<template slot="button"> <template slot="button">
<countdown-button @click.native="onSendCode" ref="countdown"></countdown-button> <countdown-button @click.native="onSendCode" ref="countdown"></countdown-button>
</template> </template>
...@@ -20,7 +20,7 @@ export default { ...@@ -20,7 +20,7 @@ export default {
components: { CountdownButton }, components: { CountdownButton },
data() { data() {
return { return {
ruleForm: { account: '', code: '' } ruleForm: { account: '', password: '' }
} }
}, },
methods: { methods: {
...@@ -28,7 +28,7 @@ export default { ...@@ -28,7 +28,7 @@ export default {
if (!this.ruleForm.account) { if (!this.ruleForm.account) {
this.$notify('请输手机号') this.$notify('请输手机号')
return false return false
} else if (!this.ruleForm.code) { } else if (!this.ruleForm.password) {
this.$notify('请输入验证码') this.$notify('请输入验证码')
return false return false
} }
......
...@@ -11,9 +11,9 @@ ...@@ -11,9 +11,9 @@
<div class="login-bd"> <div class="login-bd">
<div class="login-form"> <div class="login-form">
<!-- 账号登录 --> <!-- 账号登录 -->
<account-login ref="form" @submit="onSubmit" v-if="!this.isWechat"></account-login> <!-- <account-login ref="form" @submit="onSubmit" v-if="!this.isWechat"></account-login> -->
<!-- 验证码登录 --> <!-- 验证码登录 -->
<code-login ref="form" @submit="onSubmit" v-if="this.isWechat"></code-login> <code-login ref="form" @submit="onSubmit"></code-login>
<div class="login-button" @click="handleSubmit">立即绑定</div> <div class="login-button" @click="handleSubmit">立即绑定</div>
</div> </div>
</div> </div>
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<img src="../../assets/images/login_wechat.png" alt="微信登录" />微信登录 <img src="../../assets/images/login_wechat.png" alt="微信登录" />微信登录
</li> </li>
</ul> </ul>
</div> --> </div>-->
</div> </div>
</div> </div>
</template> </template>
...@@ -49,8 +49,7 @@ export default { ...@@ -49,8 +49,7 @@ export default {
}, },
passwordVisible: false, passwordVisible: false,
isWechat: /micromessenger/.test(UA), isWechat: /micromessenger/.test(UA),
unionid: Cookies.get('wechat_login_no_phone_error'), unionid: Cookies.get('wechat_login_no_phone_error')
redirectUrl: ''
} }
}, },
computed: { computed: {
...@@ -69,14 +68,7 @@ export default { ...@@ -69,14 +68,7 @@ export default {
}, },
// 提交 // 提交
onSubmit(data) { onSubmit(data) {
if (this.isWechat) { this.unionid ? this.bindWechat(data) : this.loginRequest(data)
this.ruleForm.type = 2
this.bindWechat(data)
} else {
this.ruleForm.type = 1
this.loginRequest(data)
}
// !this.isWechat ? this.bindWechat(data) : this.loginRequest(data)
}, },
// 登录 // 登录
loginRequest(data) { loginRequest(data) {
...@@ -92,8 +84,10 @@ export default { ...@@ -92,8 +84,10 @@ export default {
}, },
// 绑定微信并登录 // 绑定微信并登录
bindWechat(data) { bindWechat(data) {
const params = Object.assign({}, this.ruleForm, data, { unionid: this.unionid }) const params = Object.assign({}, this.ruleForm, data, {
console.log(params) unionid: this.unionid,
code: data.password
})
api api
.bindWechat(params) .bindWechat(params)
.then(response => { .then(response => {
...@@ -126,10 +120,9 @@ export default { ...@@ -126,10 +120,9 @@ export default {
} }
}, },
wechatLogin() { wechatLogin() {
if (this.$route.query.type) { return false }
const appId = 'wx451c01d40d090d7a' const appId = 'wx451c01d40d090d7a'
// 回调地址 // 回调地址
const redirectURI = `https://passport.ezijing.com/rest/wechat/oauth-callback?needCheck=false&identity=transport&redirectUrl=${this.redirectUrl}` const redirectURI = `https://passport.ezijing.com/rest/wechat/oauth-callback?needCheck=false&identity=transport&redirectUrl=${window.location.href}`
// 微信的地址 // 微信的地址
const wechatUrl = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appId}&redirect_uri=${encodeURIComponent( const wechatUrl = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appId}&redirect_uri=${encodeURIComponent(
redirectURI redirectURI
...@@ -145,12 +138,15 @@ export default { ...@@ -145,12 +138,15 @@ export default {
} }
}, },
created() { created() {
if (this.isWechat) { this.$store.dispatch('checkLogin').then(isLogin => {
this.redirectUrl = `${window.location.origin}/login?type=1` if (isLogin) {
if (!this.$route.query.type) { this.loginSuccess({ code: 1, data: { TGC: Cookies.get('TGC') } })
this.wechatLogin() } else {
if (this.isWechat && !this.checkWechatLogin()) {
this.wechatLogin()
}
} }
} })
} }
} }
</script> </script>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论