提交 27b4fa3b authored 作者: 王鹏飞's avatar 王鹏飞

bug fixes

上级 a2df94dc
...@@ -29,25 +29,27 @@ export default { ...@@ -29,25 +29,27 @@ export default {
data() { data() {
const UA = window.navigator.userAgent const UA = window.navigator.userAgent
const isMobile = /android|iphone|ipad|ipod/i.test(UA) const isMobile = /android|iphone|ipad|ipod/i.test(UA)
const voteApply = window.localStorage.getItem('voteApply')
const defaultModel = {
vote_city: '',
vote_config_id: '',
name: '',
gender: '',
area: '',
class: '',
company: '',
job: '',
email: '',
phone: '',
address: '',
honor: '',
recommend: '',
photo: ''
}
return { return {
isMobile, isMobile,
applyCityList: [], applyCityList: [],
formModel: { formModel: Object.assign(defaultModel, JSON.parse(voteApply))
vote_city: '',
vote_config_id: '',
name: '',
gender: '',
area: '',
class: '',
company: '',
job: '',
email: '',
phone: '',
address: '',
honor: '',
recommend: '',
photo: ''
}
} }
}, },
watch: { watch: {
...@@ -266,10 +268,6 @@ export default { ...@@ -266,10 +268,6 @@ export default {
} }
}, },
beforeMount() { beforeMount() {
const voteApply = window.localStorage.getItem('voteApply')
if (voteApply) {
this.formModel = Object.assign(this.formModel, JSON.parse(voteApply))
}
this.getApplyCity() this.getApplyCity()
}, },
beforeCreate() { beforeCreate() {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论