Commit d85c7ded by 前端

添加loading

1 parent 8ca5f117
<template>
<div class="scrm-main">
<div class="scrm-main" v-loading="loading">
<div v-show="step == 1">
<div class="account-header scrm-flex-between scrm-box-f">
<span>创建子商户/门店</span>
......@@ -110,6 +110,7 @@ export default {
}
}
return {
loading: false,
editStatus: false,
nextStatus: false,
accountTypesRule: false,
......@@ -232,10 +233,12 @@ export default {
},
//下一步
handleNext() {
this.loading = true
const pm1 = new Promise((resolve, reject) => {
this.$refs.baseInfoForm.$refs.baseForm.validate(valid => {
if (valid) resolve()
else {
this.loading = false
setTimeout(() => {
var isError = document.getElementsByClassName('is-error')
isError[0].querySelector('input').focus()
......@@ -248,6 +251,7 @@ export default {
this.$refs.accountInfoForm.validate(valid => {
if (valid) resolve()
else {
this.loading = false
pm1.then(() => {
document.querySelector('#app').scrollTop = 1000
})
......@@ -259,10 +263,12 @@ export default {
})
})
if (this.accounttypeId.length == 0) {
this.loading = false
this.accountTypesRule = true
return
}
if (this.accountAddForm.merchantType == 1 && this.accountAddForm.merchantOrgcode && !util.checkIdCard(this.accountAddForm.merchantOrgcode)) {
this.loading = false
this.$message.error('请输入正确的身份证号码')
document.querySelector('#app').scrollTop = 0
setTimeout(() => {
......@@ -284,6 +290,7 @@ export default {
if (this.accountAddForm.residentPhone) {
const result = reg.test(this.accountAddForm.residentPhone)
if (!result) {
this.loading = false
this.$message({
message: '请输入正确的驻店信息',
type: 'warning'
......@@ -322,6 +329,7 @@ export default {
Promise.all([pm1, pm2]).then(() => {
this.$apis.store[merchant](params).then(res => {
if (res) {
this.loading = false
this.step = 2
this.nextStatus = true
if (typeof res == 'number') {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!