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

添加支付

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