{
        template: '${tmpl}',
                data: function() {
                        return {
                                data:"", 
                                data2:"",
                        }
                },
        mounted: function() {
          /* 获取传过来的地址信息 */
          /* this.data = JSON.parse(this.$route.query.lists); */
          this.data = this.$route.query.lists;
          console.log(this.data);
        },
        created: function() {

        },
        methods: {
                baocun(data){                              
                        this.$root.postReq("/web/useraddrCtl/updateAddress",{
                                "nick_name": data.name,
                                "nick_mobile": data.mobile,
                                "nick_address": data.address,
                                "nick_email": data.email,
                                "nick_isDefault": "0",
                                "addressid":data.id,
                                }).then((res)=>{
                                        if(!data.id){
                                                this.$root.postReq("/web/useraddrCtl/createAddress",{
                                                        "name": data.name,
                                                        "mobile": data.mobile,
                                                        "address": data.address,
                                                }).then((res)=>{  
                                                        this.$root.postReq("/web/useraddrCtl/fetchAllAddress",{}).then((res)=>{
                                                                console.log("这里有问题");                              
                                                                let lists = JSON.stringify(res.data);
                                                                this.$router.replace({ path:"/mobileaddress",query:{lists: lists}});
                                                        });

                                                });
                                        };
                                        this.$root.postReq("/web/useraddrCtl/fetchAllAddress",{}).then((res)=>{
                                                let lists = JSON.stringify(res.data);
                                                this.$router.replace({ path:"/mobileaddress",query:{lists: lists}});
                                                this.$router.go(-1);
                                              });
                                });
                                /* .then((res)=>{
                                        this.$root.postReq("/web/useraddrCtl/fetchAllAddress",{}).then((res)=>{
                                                let lists = JSON.stringify(res.data);
                                                this.$router.replace({ path:"/mobileaddress",query:{lists: lists}});
                                                this.$router.go(-1);
                                              });
                                }); */
                }
        },
        vname: "gsb-mobilenewaddress"
}
