Commit 4e6926c0 by 前端

Merge branch 'develop' into 'master'

Develop

See merge request !89
2 parents eb1c83c6 74f5e3b4
<template> <template>
<div class="scrm-main"> <div class="scrm-main" v-loading="loading">
<div v-show="step == 1"> <div v-show="step == 1">
<div class="account-header scrm-flex-between scrm-box-f"> <div class="account-header scrm-flex-between scrm-box-f">
<span>创建子商户/门店</span> <span>创建子商户/门店</span>
...@@ -105,9 +105,12 @@ export default { ...@@ -105,9 +105,12 @@ export default {
console.log(value) console.log(value)
if (value.length == 11 && !isNaN(value)) { if (value.length == 11 && !isNaN(value)) {
callback(new Error('登录账户名不可为 11 位纯数字')) callback(new Error('登录账户名不可为 11 位纯数字'))
} else {
callback()
} }
} }
return { return {
loading: false,
editStatus: false, editStatus: false,
nextStatus: false, nextStatus: false,
accountTypesRule: false, accountTypesRule: false,
...@@ -230,10 +233,13 @@ export default { ...@@ -230,10 +233,13 @@ export default {
}, },
//下一步 //下一步
handleNext() { handleNext() {
console.log(2222)
this.loading = true
const pm1 = new Promise((resolve, reject) => { const pm1 = new Promise((resolve, reject) => {
this.$refs.baseInfoForm.$refs.baseForm.validate(valid => { this.$refs.baseInfoForm.$refs.baseForm.validate(valid => {
if (valid) resolve() if (valid) resolve()
else { else {
this.loading = false
setTimeout(() => { setTimeout(() => {
var isError = document.getElementsByClassName('is-error') var isError = document.getElementsByClassName('is-error')
isError[0].querySelector('input').focus() isError[0].querySelector('input').focus()
...@@ -246,6 +252,7 @@ export default { ...@@ -246,6 +252,7 @@ export default {
this.$refs.accountInfoForm.validate(valid => { this.$refs.accountInfoForm.validate(valid => {
if (valid) resolve() if (valid) resolve()
else { else {
this.loading = false
pm1.then(() => { pm1.then(() => {
document.querySelector('#app').scrollTop = 1000 document.querySelector('#app').scrollTop = 1000
}) })
...@@ -257,10 +264,12 @@ export default { ...@@ -257,10 +264,12 @@ export default {
}) })
}) })
if (this.accounttypeId.length == 0) { if (this.accounttypeId.length == 0) {
this.loading = false
this.accountTypesRule = true this.accountTypesRule = true
return return
} }
if (this.accountAddForm.merchantType == 1 && this.accountAddForm.merchantOrgcode && !util.checkIdCard(this.accountAddForm.merchantOrgcode)) { if (this.accountAddForm.merchantType == 1 && this.accountAddForm.merchantOrgcode && !util.checkIdCard(this.accountAddForm.merchantOrgcode)) {
this.loading = false
this.$message.error('请输入正确的身份证号码') this.$message.error('请输入正确的身份证号码')
document.querySelector('#app').scrollTop = 0 document.querySelector('#app').scrollTop = 0
setTimeout(() => { setTimeout(() => {
...@@ -282,6 +291,7 @@ export default { ...@@ -282,6 +291,7 @@ export default {
if (this.accountAddForm.residentPhone) { if (this.accountAddForm.residentPhone) {
const result = reg.test(this.accountAddForm.residentPhone) const result = reg.test(this.accountAddForm.residentPhone)
if (!result) { if (!result) {
this.loading = false
this.$message({ this.$message({
message: '请输入正确的驻店信息', message: '请输入正确的驻店信息',
type: 'warning' type: 'warning'
...@@ -320,6 +330,7 @@ export default { ...@@ -320,6 +330,7 @@ export default {
Promise.all([pm1, pm2]).then(() => { Promise.all([pm1, pm2]).then(() => {
this.$apis.store[merchant](params).then(res => { this.$apis.store[merchant](params).then(res => {
if (res) { if (res) {
this.loading = false
this.step = 2 this.step = 2
this.nextStatus = true this.nextStatus = true
if (typeof res == 'number') { if (typeof res == 'number') {
......
...@@ -82,6 +82,8 @@ export default { ...@@ -82,6 +82,8 @@ export default {
console.log(value) console.log(value)
if (value.length == 11 && !isNaN(value)) { if (value.length == 11 && !isNaN(value)) {
callback(new Error('登录账户名不可为 11 位纯数字')) callback(new Error('登录账户名不可为 11 位纯数字'))
} else {
callback()
} }
} }
return { return {
......
...@@ -64,10 +64,12 @@ export default { ...@@ -64,10 +64,12 @@ export default {
} }
this.$apis.baseInfo.merchantInfo(para).then(res => { this.$apis.baseInfo.merchantInfo(para).then(res => {
this.blocInfo = res this.blocInfo = res
this.storesList = res.stores.map(item => { if (res.stores) {
item.date = `${this.dateFormat(item.starttime, 'YYYY.MM.DD')}--${this.dateFormat(item.endtime, 'YYYY.MM.DD')}` this.storesList = res.stores.map(item => {
return item item.date = `${this.dateFormat(item.starttime, 'YYYY.MM.DD')}--${this.dateFormat(item.endtime, 'YYYY.MM.DD')}`
}) return item
})
}
}) })
}, },
dateFormat: function(dateTime, format = 'yyyy-MM-dd') { dateFormat: function(dateTime, format = 'yyyy-MM-dd') {
......
...@@ -5,77 +5,74 @@ const publicPath = node_env ? `/child/${packageName}/` : '/' ...@@ -5,77 +5,74 @@ const publicPath = node_env ? `/child/${packageName}/` : '/'
const resolve = dir => path.join(__dirname, dir) const resolve = dir => path.join(__dirname, dir)
const CDN_DOMAIN = 'https://img02.glsx.com.cn/' const CDN_DOMAIN = 'https://img02.glsx.com.cn/'
const cdn = { const cdn = {
css: [ css: [`${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/theme-chalk/index.css`],
`${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/theme-chalk/index.css` js: [
], `${CDN_DOMAIN}ajax/libs/vue/2.6.11/vue.min.js`,
js: [ `${CDN_DOMAIN}ajax/libs/vue-router/3.2.0/vue-router.min.js`,
`${CDN_DOMAIN}ajax/libs/vue/2.6.11/vue.min.js`, `${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/index.js`,
`${CDN_DOMAIN}ajax/libs/vue-router/3.2.0/vue-router.min.js`, `${CDN_DOMAIN}ajax/libs/vuex/3.6.2/vuex.min.js`,
`${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/index.js`, `${CDN_DOMAIN}ajax/libs/echarts/5.1.2/echarts.min.js`
`${CDN_DOMAIN}ajax/libs/vuex/3.6.2/vuex.min.js`, // 'https://webapi.amap.com/maps?v=1.3&key=bd290dc27d0945959280753215ddda71&plugin=AMap.Geocoder'
`${CDN_DOMAIN}ajax/libs/echarts/5.1.2/echarts.min.js`, ]
// 'https://webapi.amap.com/maps?v=1.3&key=bd290dc27d0945959280753215ddda71&plugin=AMap.Geocoder'
]
} }
module.exports = { module.exports = {
outputDir: `../dist/${packageName}`, outputDir: `dist`,
publicPath, publicPath,
assetsDir: 'static', assetsDir: 'static',
productionSourceMap: false, productionSourceMap: false,
configureWebpack: { configureWebpack: {
resolve: { resolve: {
alias: { alias: {
'@': resolve('src'), '@': resolve('src'),
assets: resolve('src/assets'), assets: resolve('src/assets'),
views: resolve('src/views'), views: resolve('src/views'),
components: resolve('src/components') components: resolve('src/components')
} }
},
output: {
library: `${packageName}-[name]`,
libraryTarget: 'umd', // 把微应用打包成 umd 库格式
jsonpFunction: `webpackJsonp_${packageName}`
},
externals: {
'vue': 'Vue',
'element-ui': 'ELEMENT',
'vue-router': 'VueRouter',
'vuex': 'Vuex',
'axios': 'axios',
'echarts': 'echarts',
'AMap': 'AMap'
}
}, },
devServer: { output: {
hot: true, library: `${packageName}-[name]`,
disableHostCheck: true, libraryTarget: 'umd', // 把微应用打包成 umd 库格式
host: process.env.VUE_APP_HOST, jsonpFunction: `webpackJsonp_${packageName}`
port: process.env.VUE_APP_PORT,
headers: {
'Access-Control-Allow-Origin': '*' // 主应用获取子应用时跨域响应头
}
}, },
chainWebpack: config => { externals: {
config.plugin('html') vue: 'Vue',
.tap(args => { 'element-ui': 'ELEMENT',
// args[0].minify.removeComments = false; 'vue-router': 'VueRouter',
args[0].cdn = cdn vuex: 'Vuex',
return args axios: 'axios',
}) echarts: 'echarts',
config.plugins.delete('preload') // TODO: need test AMap: 'AMap'
config.plugins.delete('prefetch') // TODO: need test }
config.module },
.rule('fonts') devServer: {
.test(/.(ttf|otf|eot|woff|woff2)$/) hot: true,
.use('url-loader') disableHostCheck: true,
.loader('url-loader') host: process.env.VUE_APP_HOST,
.tap(options => { port: process.env.VUE_APP_PORT,
options = { headers: {
// limit: 10000, 'Access-Control-Allow-Origin': '*' // 主应用获取子应用时跨域响应头
name: '/static/fonts/[name].[ext]'
}
return options
})
.end()
} }
}
\ No newline at end of file \ No newline at end of file
},
chainWebpack: config => {
config.plugin('html').tap(args => {
// args[0].minify.removeComments = false;
args[0].cdn = cdn
return args
})
config.plugins.delete('preload') // TODO: need test
config.plugins.delete('prefetch') // TODO: need test
config.module
.rule('fonts')
.test(/.(ttf|otf|eot|woff|woff2)$/)
.use('url-loader')
.loader('url-loader')
.tap(options => {
options = {
// limit: 10000,
name: '/static/fonts/[name].[ext]'
}
return options
})
.end()
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!