提交 904f7ac5 编写于 作者: M maguohua

udpate

上级 cd1ed9df
...@@ -56,11 +56,11 @@ ...@@ -56,11 +56,11 @@
standbytele:'', standbytele:'',
standbytelenum:'', standbytelenum:'',
addSearch:false, addSearch:false,
//newAddress:{}, //增加数组的元素 newAddress:{}, //增加数组的元素
} }
}, },
created(){ created(){
console.log(this.addAddress)
}, },
mixins: [getImgPath], mixins: [getImgPath],
components: { components: {
...@@ -69,14 +69,15 @@ ...@@ -69,14 +69,15 @@
}, },
computed:{ computed:{
...mapState([ ...mapState([
'addAddress', 'addAddress','removeAddress','newAddress',
]), ]),
...mapMutations([
'ADD_ADDRESS'
])
}, },
props:[], props:[],
methods: { methods: {
...mapMutations([
'ADD_ADDRESS'
]),
inputThing(){ inputThing(){
(!this.message) ? this.verify=true : this.verify=false; (!this.message) ? this.verify=true : this.verify=false;
this.bindThing() this.bindThing()
...@@ -122,9 +123,19 @@ ...@@ -122,9 +123,19 @@
} }
}, },
submitThing(){ submitThing(){
if(this.butpart){ //if(this.butpart){
//this.ADD_ADDRESS({"name":this.message,"address":this.mesthree,"address_detail":}) this.ADD_ADDRESS({
} name: this.message,
address: this.mesthree,
address_detail: this.addAddress,
geohash: 'wtw37r7cxep4',
phone: this.telenum,
phone_bk: this.standbytelenum,
poi: this.addAddress,
poi_type: 0,
});
this.$router.go(-1);
//}
} }
} }
} }
......
...@@ -25,10 +25,10 @@ export default { ...@@ -25,10 +25,10 @@ export default {
if(state.removeAddress.length > 0) return; if(state.removeAddress.length > 0) return;
let addres = await getAddressList(state.userInfo.user_id).then( res =>{ // let addres = await getAddressList(state.userInfo.user_id).then( res =>{
return res // return res
}); // });
let addres = await getAddressList()
commit(SAVE_ADDRESS, addres); commit(SAVE_ADDRESS, addres);
}, },
} }
\ No newline at end of file
...@@ -31,8 +31,6 @@ const state = { ...@@ -31,8 +31,6 @@ const state = {
removeAddress:[],//移除地址 removeAddress:[],//移除地址
addAddress:'', //新增地址 addAddress:'', //新增地址
question: null,//问题详情 question: null,//问题详情
//增加地址的几个key值
newAddress:{},
} }
export default new Vuex.Store({ export default new Vuex.Store({
......
...@@ -27,6 +27,7 @@ import { ...@@ -27,6 +27,7 @@ import {
SAVE_QUESTION, SAVE_QUESTION,
ADD_ADDRESS, ADD_ADDRESS,
} from './mutation-types.js' } from './mutation-types.js'
import { import {
setStore, setStore,
getStore, getStore,
...@@ -262,8 +263,9 @@ export default { ...@@ -262,8 +263,9 @@ export default {
[SAVE_QUESTION](state, question) { [SAVE_QUESTION](state, question) {
state.question = {...question}; state.question = {...question};
}, },
[ADD_ADDRESS](state, obj){
state.newAddress = {...obj}; [ADD_ADDRESS](state, obj) {
state.removeAddress = state.removeAddress.unshift(state.newAddress) console.log(state.removeAddress)
state.removeAddress = [...state.removeAddress, obj];
} }
} }
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册