提交 2372d916 authored 作者: 王鹏飞's avatar 王鹏飞

bug fixes

上级 728d0874
......@@ -78,7 +78,6 @@
"core-js": "^3.8.0",
"cross-env": "^7.0.2",
"element-ui": "^2.15.6",
"jquery": "^3.5.1",
"js-cookie": "^2.2.1",
"js-md5": "^0.7.3",
"lodash": "^4.17.20",
......
......@@ -13,7 +13,6 @@
<script src="https://zws-imgs-pub.ezijing.com/static/build/learn-mba/static/compatible/es5-shim.min.js"></script>
<script src="https://zws-imgs-pub.ezijing.com/static/build/learn-mba/static/compatible/es5-sham.min.js"></script>
<!-- 三方插件引入 -->
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.js" async></script>
<script src="https://zws-imgs-pub.ezijing.com/static/build/learn-mba/static/convertString/base64-new.js"></script>
<script src="https://zws-imgs-pub.ezijing.com/static/build/learn-mba/static/common/runtime.js"></script>
......
......@@ -94,11 +94,14 @@ export default {
},
methods: {
pointScroll(){
console.log($(`#point${this.$route.query.point}`), '123')
if (this.$route.query.point !== undefined) {
$('html, body').animate({
scrollTop: $(`#point${this.$route.query.point}`).offset().top
}, 300)
const element = document.getElementById(`point${this.$route.query.point}`);
if (element) {
element.scrollIntoView({
behavior: 'smooth',
block: 'start'
});
}
}
},
goPage(path, n) {
......
......@@ -141,12 +141,13 @@ export default {
methods: {
pointScroll() {
if (this.$route.query.point !== undefined) {
$('html, body').animate(
{
scrollTop: $(`#point${this.$route.query.point}`).offset().top
},
500
)
const target = document.getElementById(`point${this.$route.query.point}`);
if (target) {
target.scrollIntoView({
behavior: 'smooth',
block: 'start'
});
}
}
},
goPage(path, n) {
......
......@@ -133,12 +133,13 @@ export default {
methods: {
pointScroll() {
if (this.$route.query.point !== undefined) {
$('html, body').animate(
{
scrollTop: $(`#point${this.$route.query.point}`).offset().top
},
500
)
const target = document.getElementById(`point${this.$route.query.point}`);
if (target) {
target.scrollIntoView({
behavior: 'smooth',
block: 'start'
});
}
}
},
goPage(path, n) {
......
......@@ -171,10 +171,14 @@ export default {
return false
}
if (n.id) {
$('html, body').animate({
scrollTop: $('#' + n.id).offset().top
})
return false
const target = document.getElementById(n.id);
if (target) {
target.scrollIntoView({
behavior: 'smooth',
block: 'start'
});
}
return false;
}
if (n.path) {
this.$router.push(n)
......
......@@ -8,7 +8,7 @@
</div>
<div class="tips-cen mar-t-20">
<div class="name">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;用:</div>
<div class="money">3800<span></span></div>
<div class="money">{{ price }}<span></span></div>
</div>
<div class="tips-top">
<div class="name">支付方式:</div>
......@@ -45,16 +45,20 @@ import action from '@action'
import QrcodeVue from 'qrcode.vue'
export default {
components: {
QrcodeVue
QrcodeVue,
},
props: {
formData: {
type: Object
type: Object,
},
periods: {
type: Number,
default: '1'
}
default: '1',
},
price: {
type: Number,
default: 3800,
},
},
data() {
return {
......@@ -62,7 +66,7 @@ export default {
isCodeShow: false,
product_id: '6787934443077107712',
payInfo: {},
time: null
time: null,
}
},
methods: {
......@@ -73,15 +77,15 @@ export default {
const param = {
pay_type: this.payMethod,
product_id: this.product_id,
form_id: this.formData.id && this.formData.id.toString()
form_id: this.formData.id && this.formData.id.toString(),
}
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
background: 'rgba(0, 0, 0, 0.7)',
})
action.articleAction.getOrder(param).then(res => {
action.articleAction.getOrder(param).then((res) => {
if (res.code === 200) {
this.payInfo = res.data
this.isCodeShow = true
......@@ -98,13 +102,13 @@ export default {
})
},
checkPay(id, order_no) {
action.articleAction.checkPay(id).then(res => {
action.articleAction.checkPay(id).then((res) => {
if (res.code === 0) {
const [order = {}] = res.data
if (order.status === 1) {
this.$message({
message: '支付成功',
type: 'success'
type: 'success',
})
this.payEnd(order_no)
this.$emit('payStatus')
......@@ -119,19 +123,19 @@ export default {
closeClear() {
this.isCodeShow = false
this.$emit('closePayPop')
// clearInterval()
clearInterval(this.time)
},
payEnd(orderOn) {
const param = {
order_no: orderOn,
form_id: this.formData.id.toString()
}
action.articleAction.payEnd(param).then(res => {})
form_id: this.formData.id.toString(),
}
action.articleAction.payEnd(param).then((res) => {})
},
},
beforeDestroy() {
// clearInterval(this.time)
}
},
}
</script>
<style lang="scss" scoped>
......
......@@ -14,6 +14,7 @@ export default [
contact_number: '18500913837',
desc: '',
payment: '1280元/人',
price: 1280,
content: `<p style="text-align: center"><strong>直播课程</strong></p>
<div align="center">
<table style="width: 100%;" border="1" cellspacing="0" cellpadding="0">
......
......@@ -37,7 +37,7 @@
<el-radio :label="0"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item style="height:10px;">
<el-form-item style="height: 10px">
<div class="line">发票信息填写</div>
</el-form-item>
<el-form-item label="发票类型" id="fplx" prop="invoice_type">
......@@ -51,24 +51,21 @@
label="发票抬头"
v-if="form.invoice_type && form.invoice_type !== '无'"
prop="invoice_title"
:rules="{ required: true, message: '请输入发票抬头', trigger: 'blur' }"
>
:rules="{ required: true, message: '请输入发票抬头', trigger: 'blur' }">
<el-input v-model="form.invoice_title"></el-input>
</el-form-item>
<el-form-item
label="纳税人识别号"
v-if="form.invoice_type && form.invoice_type !== '无'"
prop="taxpayer_registration_num"
:rules="{ required: true, message: '请输入纳税人识别号', trigger: 'blur' }"
>
:rules="{ required: true, message: '请输入纳税人识别号', trigger: 'blur' }">
<el-input v-model="form.taxpayer_registration_num"></el-input>
</el-form-item>
<el-form-item
label="注册地址"
v-if="form.invoice_type === '增值税专用发票'"
prop="invoice_address_mobile"
:rules="{ required: true, message: '请输入注册地址', trigger: 'blur' }"
>
:rules="{ required: true, message: '请输入注册地址', trigger: 'blur' }">
<el-input v-model="form.invoice_address_mobile"></el-input>
</el-form-item>
<el-form-item
......@@ -76,8 +73,7 @@
id="account"
v-if="form.invoice_type === '增值税专用发票'"
prop="opening_bank_account"
:rules="{ required: true, message: '请输入开户行及账号', trigger: 'blur' }"
>
:rules="{ required: true, message: '请输入开户行及账号', trigger: 'blur' }">
<el-input v-model="form.opening_bank_account"></el-input>
</el-form-item>
<el-form-item label="发票内容" id="sh" v-if="form.invoice_type && form.invoice_type !== '无'">
......@@ -134,9 +130,7 @@
>
</template>
<template v-else>
<el-button style="width: 100px; margin-left: 10px" type="primary" @click="formVerification(onSubmit)"
>提 交</el-button
>
<el-button style="width: 100px" type="primary" @click="formVerification(onSubmit)">提 交</el-button>
<el-button
v-if="!hidePayBtn"
style="width: 100px; margin-left: 10px"
......@@ -160,11 +154,11 @@
<pay-pop
v-show="isPayPopShow"
:formData="form"
:price="detail.price"
:periods="id"
@payStatus="payStatus"
@closePayPop="closePayPop"
class="payPop"
/>
class="payPop" />
</div>
</template>
<script>
......@@ -173,13 +167,16 @@ import action from '@action'
import breadcrumb from '@/components/breadcrumb'
import payPop from './components/payPop'
import nations from '@/tool/nations'
const IDCARD_REG = /(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)|(^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{2}[0-9Xx]$)/
import datalist from './data.js'
const IDCARD_REG =
/(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)|(^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{2}[0-9Xx]$)/
const MOBILE_REG = /^1(3[0-9]|4[01456879]|5[0-35-9]|6[2567]|7[0-8]|8[0-9]|9[0-35-9])\d{8}$/
const EMAIL_REG = /^[A-Za-z0-9]+([_\.\\-][A-Za-z0-9]+)*@([A-Za-z0-9\-]+\.)+[A-Za-z]{2,6}$/
export default {
components: {
breadcrumb,
payPop
payPop,
},
data() {
const IDChecked = (rule, value, callback) => {
......@@ -201,16 +198,17 @@ export default {
}
}
return {
datalist,
isInfoNull: false,
isPayStatus: false,
crumbData: [
{
path: '/',
name: '首页'
name: '首页',
},
{
name: '师资培训'
}
name: '师资培训',
},
],
nations: nations,
form: {
......@@ -230,7 +228,7 @@ export default {
opening_bank_account: '',
invoice_detail: '非学历教育*培训费',
mobile: '',
checked_code: ''
checked_code: '',
},
rules: {
school_name: { required: true, message: '请输入院校名称', trigger: 'blur' },
......@@ -239,18 +237,18 @@ export default {
nation: { required: true, message: '请输入民族', trigger: 'blur' },
id_num: [
{ required: true, message: '请输入身份证号', trigger: 'blur' },
{ validator: IDChecked, trigger: 'blur' }
{ validator: IDChecked, trigger: 'blur' },
],
live_status: { required: true, message: '请选择居住方式', trigger: 'change' },
invoice_type: { required: true, message: '请选择发票类型', trigger: 'change' },
mobile: [
{ required: true, message: '请输入手机号', trigger: 'blur' },
{ validator: mobileChecked, trigger: 'blur' }
]
{ validator: mobileChecked, trigger: 'blur' },
],
},
isBtnDisabled: false,
isPayPopShow: false,
isLogin: false
isLogin: false,
}
},
computed: {
......@@ -261,13 +259,16 @@ export default {
},
hidePayBtn() {
return [6, 202201, 202202, 2022001, 2022002].includes(this.id)
}
},
detail() {
return this.datalist.find((item) => item.id == this.id) || {}
},
},
created() {
if (!this.id) {
this.$router.push('/train')
}
action.articleAction.getUserInfo().then(res => {
action.articleAction.getUserInfo().then((res) => {
if (res && res.code === 0) {
window.sessionStorage.userInfo = JSON.stringify(res.data)
this.isLogin = true
......@@ -276,13 +277,13 @@ export default {
})
},
mounted() {
// $('#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;族')
// $('#mail label').html('邮&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;箱')
// $('#zs>label').html('单&nbsp;/合住')
// $('#account label').html('账&nbsp;&nbsp;&nbsp;号')
// $('#sh label').html('税&nbsp;&nbsp;&nbsp;号')
// document.querySelector('#name label').innerHTML = '姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名'
// document.querySelector('#sex>label').innerHTML = '性&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;别'
// document.querySelector('#mz>label').innerHTML = '民&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;族'
// document.querySelector('#mail label').innerHTML = '邮&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;箱'
// document.querySelector('#zs>label').innerHTML = '单&nbsp;/合住'
// document.querySelector('#account label').innerHTML = '账&nbsp;&nbsp;&nbsp;号'
// document.querySelector('#sh label').innerHTML = '税&nbsp;&nbsp;&nbsp;号'
},
methods: {
goPay() {
......@@ -296,9 +297,9 @@ export default {
getDetail(call) {
// 登录状态不需要手机号验证码
const params = {
periods: this.id
periods: this.id,
}
action.articleAction.getFormDetail(params).then(res => {
action.articleAction.getFormDetail(params).then((res) => {
if (res.code === 200) {
if (!Object.keys(res.data.detail).length) {
this.isInfoNull = true
......@@ -315,7 +316,7 @@ export default {
},
// 支付
checkPay(id, call) {
action.articleAction.checkPay(id).then(res => {
action.articleAction.checkPay(id).then((res) => {
if (res.code === 0) {
const [order = {}] = res.data
if (order.status === 1) {
......@@ -372,7 +373,7 @@ export default {
this.form.order_no = '1'
}
}
this.$refs.form.validate(valid => {
this.$refs.form.validate((valid) => {
if (valid) {
call()
} else {
......@@ -435,7 +436,7 @@ export default {
// 登录了直接走报名表单 没有登录走注册登录后再走报名表单
if (this.isLogin) {
this.sendEnrollInfo()
.then(res => {
.then((res) => {
this.isInfoNull = false
this.getDetail()
this.message('提交成功!', 'success', 6000)
......@@ -444,7 +445,7 @@ export default {
// this.message('手机号注册成功!','success', 6000)
// }, 300)
})
.catch(error => {
.catch((error) => {
if (error && error.type === 'register') {
// this.message('报名信息提交成功!','success', 6000)
// setTimeout(() => {
......@@ -456,10 +457,10 @@ export default {
}
})
} else {
this.defaultRegister().then(res => {
this.defaultRegister().then((res) => {
this.getDetail(
this.sendEnrollInfo()
.then(res => {
.then((res) => {
this.message('报名信息提交成功!', 'success', 6000)
// this.message('报名信息修改成功!','success', 6000)
// setTimeout(() => {
......@@ -469,7 +470,7 @@ export default {
this.$router.go(0)
}, 1000)
})
.catch(error => {
.catch((error) => {
if (error && error.type === 'register') {
// this.message('报名信息提交成功!','success', 6000)
// setTimeout(() => {
......@@ -497,18 +498,18 @@ export default {
form.invoice_detail = ''
}
}
action.articleAction.formCommit(form).then(res => {
action.articleAction.formCommit(form).then((res) => {
if (res && res.code === 200) {
resolve({
type: 'enroll',
state: 'success',
msg: '报名信息提交成功'
msg: '报名信息提交成功',
})
} else {
reject({
type: 'enroll',
state: 'fail',
msg: res.msg || '报名信息提交失败'
msg: res.msg || '报名信息提交失败',
})
}
})
......@@ -523,18 +524,18 @@ export default {
} else {
let param = {
account: this.form.mobile,
service: 'sofia.ezijing.com'
service: 'sofia.ezijing.com',
}
action.articleAction.sendCheckedCode(param).then(res => {
action.articleAction.sendCheckedCode(param).then((res) => {
if (res && res.code === 0) {
this.$message({
message: '验证码发送成功',
type: 'success'
type: 'success',
})
} else {
this.$message({
message: res.msg || '发送验证码失败',
type: 'error'
type: 'error',
})
}
})
......@@ -549,9 +550,9 @@ export default {
if (count < 1) {
clearInterval(timer)
this.isBtnDisabled = false
$('#checkedCode').html('获取验证码')
document.querySelector('#checkedCode').innerHTML = '获取验证码'
} else {
$('#checkedCode').html(count + '秒后重发')
document.querySelector('#checkedCode').innerHTML = count + '秒后重发'
}
}, 1000)
},
......@@ -592,32 +593,32 @@ export default {
mobile: this.form.mobile,
code: this.form.checked_code,
nickname: this.form.username || this.randomNickname(),
project_id: 5002
project_id: 5002,
// password: '123456',
// secret: true,
// service: 'sofia.ezijing.com'
}
let promise = new Promise((resolve, reject) => {
action.articleAction.register2(param).then(res => {
action.articleAction.register2(param).then((res) => {
if (res && res.code === 0) {
//code: 0注册成功 5已注册
resolve({
type: 'register',
state: 'success',
msg: 'success'
msg: 'success',
})
} else if (res && res.code === 5) {
reject({
type: 'register',
state: 'fail',
msg: res.msg || '此手机号已经被注册'
msg: res.msg || '此手机号已经被注册',
})
} else {
this.$message.error(res.msg)
reject({
type: 'register',
state: 'fail',
msg: res.msg || '注册失败'
msg: res.msg || '注册失败',
})
}
})
......@@ -644,19 +645,19 @@ export default {
this.$message({
message: errMsg,
type: type || 'info',
duration: dur || 3000
duration: dur || 3000,
})
},
fetchUpdateUserInfo() {
console.log(1111)
const params = {
real_name: this.form.username || ''
real_name: this.form.username || '',
}
action.articleAction.updateUserInfo(params).then(res => {
action.articleAction.updateUserInfo(params).then((res) => {
console.log(res)
})
}
}
},
},
}
</script>
<style lang="scss" scoped>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论