提交 bbf645c4 authored 作者: lihuihui's avatar lihuihui

添加支付

上级 37bb14f5
module.exports = { module.exports = {
domain: 'dev.ezijing.com', domain: 'dev.ezijing.com',
url: 'https://project-api.ezijing.com', url: 'https://project-api2.ezijing.com',
isEnableToIphoneDebugger: false, isEnableToIphoneDebugger: false,
apiBaseURL: '/api', apiBaseURL: '/api',
webpack: { webpack: {
......
...@@ -10,4 +10,5 @@ export default class ArticleAction { ...@@ -10,4 +10,5 @@ export default class ArticleAction {
register (obj) { return articleApi.register(obj).then(res => res) } register (obj) { return articleApi.register(obj).then(res => res) }
register2 (obj) { return articleApi.register2(obj).then(res => res) } register2 (obj) { return articleApi.register2(obj).then(res => res) }
getUserInfo (obj) { return articleApi.getUserInfo(obj).then(res => res) } getUserInfo (obj) { return articleApi.getUserInfo(obj).then(res => res) }
getFormDetail () { return articleApi.getFormDetail().then(res => res) }
} }
...@@ -8,7 +8,7 @@ export default class ScoreAPI extends BaseAPI { ...@@ -8,7 +8,7 @@ export default class ScoreAPI extends BaseAPI {
// 获取文章详情 // 获取文章详情
getArticleDetail = (id) => this.get(`/api/microservices/api/article/${id}/info`) getArticleDetail = (id) => this.get(`/api/microservices/api/article/${id}/info`)
// formCommit = (data) => this.post('/api/microservices/api/form/commit', data) // formCommit = (data) => this.post('/api/microservices/api/form/commit', data)
formCommit = (data) => this.post('/api/microservices/api/apply/teacher-form', data) formCommit = (data) => this.post('/api/microservices/api/v3/apply/teacher-form', data)
// 获取轮播 // 获取轮播
getBanner = (obj = {}) => this.get('/api/microservices/api/carousel/list', obj, {}) getBanner = (obj = {}) => this.get('/api/microservices/api/carousel/list', obj, {})
// 发送验证码 // 发送验证码
...@@ -19,4 +19,6 @@ export default class ScoreAPI extends BaseAPI { ...@@ -19,4 +19,6 @@ export default class ScoreAPI extends BaseAPI {
register2 = (obj = {}) => this.post('/api/usercenter/user/register-and-login-by-mobile', obj) register2 = (obj = {}) => this.post('/api/usercenter/user/register-and-login-by-mobile', obj)
// 获取用户信息 // 获取用户信息
getUserInfo = () => this.get('/api/passport/account/get-user-info') getUserInfo = () => this.get('/api/passport/account/get-user-info')
// 表单回显
getFormDetail = () => this.get('/api/microservices/api/v3/apply/teacher-form-detail')
} }
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
</template> </template>
</ul> </ul>
<div class="login"> <div class="login">
<template v-if="isLogin"> <template v-if="Object.values(user).length">
<div class="login-name"> <div class="login-name">
<span class="name">{{ user.realname || user.username }}</span> <span class="name">{{ user.realname || user.username }}</span>
<span @click="handleLogout">退出</span> <span @click="handleLogout">退出</span>
...@@ -149,7 +149,7 @@ export default { ...@@ -149,7 +149,7 @@ export default {
} }
], ],
isLogin: false, isLogin: false,
user: null, user: {},
options: { options: {
baseUrl: webConf.url, baseUrl: webConf.url,
register: { register: {
...@@ -197,6 +197,7 @@ export default { ...@@ -197,6 +197,7 @@ export default {
}, },
mounted() { mounted() {
// this.loginSuccess() // this.loginSuccess()
console.log(JSON.parse(window.sessionStorage.userInfo))
this.user = JSON.parse(window.sessionStorage.userInfo) this.user = JSON.parse(window.sessionStorage.userInfo)
}, },
methods: { methods: {
...@@ -227,7 +228,7 @@ export default { ...@@ -227,7 +228,7 @@ export default {
this.passport.logout() this.passport.logout()
this.isLogin = false this.isLogin = false
window.G.UserInfo = {} window.G.UserInfo = {}
window.sessionStorage.userInfo = JSON.stringify({}) // window.sessionStorage.userInfo = JSON.stringify({})
this.$router.go(0) this.$router.go(0)
// window.location.href = window.location.href // window.location.href = window.location.href
// this.$router.push('/') // this.$router.push('/')
...@@ -236,6 +237,7 @@ export default { ...@@ -236,6 +237,7 @@ export default {
// this.isLogin = isLogin // this.isLogin = isLogin
this.user = user this.user = user
window.G.UserInfo = user window.G.UserInfo = user
window.sessionStorage.userInfo = JSON.stringify(user)
}, },
loginSuccess(data) { loginSuccess(data) {
this.passport.checkLoginStatus((isLogin, user = {}) => { this.passport.checkLoginStatus((isLogin, user = {}) => {
......
...@@ -101,7 +101,14 @@ ...@@ -101,7 +101,14 @@
</el-upload> </el-upload>
</el-form-item> --> </el-form-item> -->
<el-form-item label-width="110px"> <el-form-item label-width="110px">
<template v-if="isLogin">
<el-button style="width: 100px; margin-left: 10px" type="primary" @click="onSubmit">修 改</el-button>
<el-button style="width: 100px; margin-left: 10px" type="primary" @click="isPayPopShow = true">去付款</el-button>
</template>
<template v-else>
<el-button style="width: 200px; margin-left: 44px" type="primary" @click="onSubmit">提 交</el-button> <el-button style="width: 200px; margin-left: 44px" type="primary" @click="onSubmit">提 交</el-button>
</template>
<!-- <el-button style="width: 200px; margin-left: 44px" type="primary" @click="onSubmit">去付款</el-button> -->
<!-- <el-button @click="back">返回</el-button> --> <!-- <el-button @click="back">返回</el-button> -->
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -159,15 +166,18 @@ export default { ...@@ -159,15 +166,18 @@ export default {
created() { created() {
action.articleAction.getUserInfo().then(res => { action.articleAction.getUserInfo().then(res => {
if (res && res.code === 0) { if (res && res.code === 0) {
window.sessionStorage.userInfo = JSON.stringify(res.data)
this.isLogin = true this.isLogin = true
} }
}) })
}, },
mounted() { mounted() {
if (this.isLogin) { // 登录状态不需要手机号验证码
this.form.mobile = '13111111111' action.articleAction.getFormDetail().then(res => {
this.form.checked_code = '1234' if (res.code === 200) {
this.form = res.data.detail
} }
})
// $('#name label').html('姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名') // $('#name label').html('姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名')
$('#sex label').html('性&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;别') $('#sex label').html('性&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;别')
$('#mz label').html('民&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;族') $('#mz label').html('民&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;族')
...@@ -177,6 +187,7 @@ export default { ...@@ -177,6 +187,7 @@ export default {
// $('#sh label').html('税&nbsp;&nbsp;&nbsp;号') // $('#sh label').html('税&nbsp;&nbsp;&nbsp;号')
}, },
methods: { methods: {
// 关闭支付弹窗
closePayPop() { closePayPop() {
this.isPayPopShow = false this.isPayPopShow = false
}, },
...@@ -210,10 +221,15 @@ export default { ...@@ -210,10 +221,15 @@ export default {
} }
}, */ }, */
onSubmit() { onSubmit() {
if (this.isLogin) {
this.form.mobile = '13111111111'
this.form.checked_code = '1234'
}
let flag = true let flag = true
// console.log(this.form) // console.log(this.form)
Object.keys(this.form).map(item => { Object.keys(this.form).map(item => {
if (this.form[item] === '') { if (this.form[item] === '') {
console.log(item)
flag = false flag = false
} }
}) })
...@@ -258,7 +274,7 @@ export default { ...@@ -258,7 +274,7 @@ export default {
}) })
.catch(err => { .catch(err => {
}) */ }) */
// 登录了走报名表单 没有登录走注册登录后再走报名表单 // 登录了直接走报名表单 没有登录走注册登录后再走报名表单
if (this.isLogin) { if (this.isLogin) {
this.sendEnrollInfo() this.sendEnrollInfo()
.then(res => { .then(res => {
...@@ -280,30 +296,29 @@ export default { ...@@ -280,30 +296,29 @@ export default {
}) })
} else { } else {
this.defaultRegister().then(res => { this.defaultRegister().then(res => {
this.sendEnrollInfo()
.then(res => {
this.message('报名信息提交成功!','success', 6000) this.message('报名信息提交成功!','success', 6000)
// this.message('报名信息修改成功!','success', 6000)
// setTimeout(() => {
// this.message('手机号注册成功!','success', 6000)
// }, 300)
setTimeout(() => { setTimeout(() => {
this.$router.go(0) this.$router.go(0)
}, 1000) }, 1000)
}) })
// this.sendEnrollInfo() .catch(error => {
// .then(res => this.defaultRegister()) if (error && error.type === 'register') {
// .then(res => {
// this.message('报名信息提交成功!','success', 6000)
// setTimeout(() => {
// this.message('手机号注册成功!','success', 6000)
// }, 300)
// })
// .catch(error => {
// if (error && error.type === 'register') {
// this.message('报名信息提交成功!','success', 6000) // this.message('报名信息提交成功!','success', 6000)
// setTimeout(() => { // setTimeout(() => {
// this.message('注册失败,' + error.msg + ',请重新注册','error', 6000) // this.message('注册失败,' + error.msg + ',请重新注册','error', 6000)
// }, 300) // }, 300)
// } else { } else {
// let errorMsg = error.msg || '' let errorMsg = error.msg || ''
// this.message('报名信息提交失败!' + errorMsg,'error', 6000) this.message('报名信息提交失败!' + errorMsg,'error', 6000)
// } }
// }) })
})
} }
} }
}, },
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论