bug
This commit is contained in:
@@ -68,79 +68,93 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {mapState} from 'vuex'
|
||||
import {mapState} from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'add',
|
||||
data() {
|
||||
return {
|
||||
name: '',
|
||||
files: [],
|
||||
form: {
|
||||
bossName: '',
|
||||
businessAddress: '',
|
||||
businessName: '',
|
||||
lat: '',
|
||||
lon: '',
|
||||
storePicUrl: [],
|
||||
telephone: ''
|
||||
export default {
|
||||
name: 'add',
|
||||
|
||||
appName: '新增商户',
|
||||
|
||||
data() {
|
||||
return {
|
||||
name: '',
|
||||
files: [],
|
||||
form: {
|
||||
bossName: '',
|
||||
businessAddress: '',
|
||||
businessName: '',
|
||||
lat: '',
|
||||
lng: '',
|
||||
storePicUrl: [],
|
||||
telephone: ''
|
||||
},
|
||||
id: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
computed: {...mapState(['user'])},
|
||||
|
||||
onLoad () {
|
||||
|
||||
},
|
||||
|
||||
onShow() {
|
||||
document.title = "新增商户"
|
||||
},
|
||||
|
||||
methods: {
|
||||
chooseLocation () {
|
||||
uni.chooseLocation({
|
||||
success: res => {
|
||||
this.form.businessAddress = res.name
|
||||
this.form.lat = res.latitude
|
||||
this.form.lon = res.longitude
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
save () {
|
||||
if (!this.form.bossName) {
|
||||
return this.$u.toast('请输入店名')
|
||||
}
|
||||
computed: {...mapState(['user'])},
|
||||
|
||||
if (!this.form.businessAddress) {
|
||||
return this.$u.toast('请输入所在地址')
|
||||
}
|
||||
onLoad (query) {
|
||||
this.id = query.id
|
||||
this.getInfo()
|
||||
},
|
||||
|
||||
if (!this.form.businessName) {
|
||||
return this.$u.toast('请输入店长名称')
|
||||
}
|
||||
methods: {
|
||||
chooseLocation () {
|
||||
uni.chooseLocation({
|
||||
success: res => {
|
||||
this.form.businessAddress = res.name
|
||||
this.form.lat = res.latitude
|
||||
this.form.lng = res.longitude
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
this.$loading()
|
||||
this.$http.post('/api/appcompany/addORUpdate', {
|
||||
...this.form,
|
||||
storePicUrl: this.form.storePicUrl.length ? this.form.storePicUrl[0].url : ''
|
||||
}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.$u.toast('提交成功')
|
||||
getInfo () {
|
||||
this.$loading()
|
||||
this.$http.post(`/app/appcompany/getDetailById?id=${this.id}`).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.form = {
|
||||
...this.form,
|
||||
...res.data,
|
||||
storePicUrl: res.data.storePicUrl ? [{url: res.data.storePicUrl}] : []
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
setTimeout(() => {
|
||||
uni.$emit('update')
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
}, 500)
|
||||
save () {
|
||||
if (!this.form.bossName) {
|
||||
return this.$u.toast('请输入店名')
|
||||
}
|
||||
|
||||
if (!this.form.businessAddress) {
|
||||
return this.$u.toast('请输入所在地址')
|
||||
}
|
||||
|
||||
if (!this.form.businessName) {
|
||||
return this.$u.toast('请输入店长名称')
|
||||
}
|
||||
|
||||
this.$loading()
|
||||
this.$http.post('/api/appcompany/addORUpdate', {
|
||||
...this.form,
|
||||
storePicUrl: this.form.storePicUrl.length ? this.form.storePicUrl[0].url : ''
|
||||
}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.$u.toast('提交成功')
|
||||
|
||||
setTimeout(() => {
|
||||
uni.$emit('update')
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
}, 500)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
Reference in New Issue
Block a user