<template>
<div>
<Myheader></Myheader>
   <div class="rc-top"></div>
 <div class="usercontend">
  <div class="rc-max-width--xl">
      <h2>新增收货地址</h2>
   <div class="rc-max-width--xl rc-people">
      <span>收货人:</span>
        <input type="text" placeholder="请输入收货人姓名">
   </div>
  <div class="rc-max-width--xl rc-phone">
      <span>手机号码:</span>
        <input type="text" placeholder="请输入11位手机号码">
   </div>
     <div class="rc-max-width--xl rc-address">
      <span>所在地区:</span>
        <input type="text" placeholder="请选择所在地区">
        <addressInput></addressInput>
   </div>
     <div class="rc-max-width--xl rc-useaddress">
      <span>详细地址:</span>
        <input type="text" placeholder="小区、门牌号等" class="userinput">
        <textarea rows="10" cols="30" placeholder="请输入详细地址">
  
</textarea>
   </div>
      
          <addressInput @getmenu="onGetMenu" @closeDialog = "handleClose1" :dialogInfo1="dialogInfo1"></addressInput>
   
  </div>
    <div class="rc-button">
                <span @click="openclose()">取消</span>
                <em @click="openclose()">确认</em>
              </div>
  </div>
     <!-- <div class="rc-button">
      <div class="rc-footbutton" @click="onAdd()">
        <span>新增收货地址</span>
      </div>
    </div> -->
      
              <MyFooter></MyFooter>
           
              
  </div>

</template>

<script>

import Myheader from '~/components/header.vue'
import addressInput from '~/components/addressInput.vue'
import MyFooter from '~/components/rc-footer.vue'
export default {
  data() {
    return {
      chosenAddressId: "1",
      checked: true,
      userid: null,
      usermessage:null,
      dialogInfo1:false,
      list: [
        {
          id: 1,
          name: "张三",
          tel: "13000000000",
          address: "浙江省杭州市西湖区文三路 138 号",
          isDefault: true,
        },
        {
          id: 2,
          name: "李四",
          tel: "1310000000",
          address: "浙江省杭州市拱墅区莫干山路 50 号",
        },
           {
          id: 3,
          name: "李四",
          tel: "1310000000",
          address: "浙江省杭州市拱墅区莫干山路 50 号",
        },
      ],
    };
  },
  methods: { 
    onGetMenu(values){
  console.log(values,+'111111');
    },
    handleClose1(){
  this.dialogInfo1 = false
    },
    onEdit(item, index) {
      // let userid = item.id;
      console.log(item);
      this.$router.push({
        path: "/useraddress/editaddress",
        query: {
          id: item,
        },
      });
    },
       onAdd(item, index) {
      // let userid = item.id;
      // console.log(item);
      this.$router.push({
        path: "/useraddress/addaddress",
        // query: {
        //   id: userid,
        // },
      });
    },



    //删除地址
    // async userdelete(item) {
    //   console.log(item.memberId);
    //   let data = await editdelete(this.userid, item.id);
    //  this.editaddress(this.usermessage);
    //   console.log(data);
    // },

    //查询人的所有地址
    // async editaddress(user) {
    //  user.data.id=844350
    //     let data = await selectaddress(user.data.id);
    //     this.list=data.data;
    //     console.log(this.list);
    //   console.log(data);
    // },
  },
  components: {
   Myheader,
   MyFooter,
   addressInput
  },

  mounted() {
    //地址的查询
    // this.usermessage = JSON.parse(localStorage.getItem("userInfo"));
    //    this.editaddress(this.usermessage);
    // this.userid = this.usermessage.data.id;
  },
};
</script>

<style lang="less" scoped >
@import url("../../assets/css/global.less");
@import url("../../assets/css/addaddress.less");
</style>
