<template>
  <div class="app-container" >
    <div class="header">
      <van-row style="width: 80%; margin: 0 auto">
        <van-col span="7">
          <van-image
            round
            width="2rem"
            height="2rem"
            src="https://img01.yzcdn.cn/vant/cat.jpeg"
            style="border: 2px solid #FFF"
          />
        </van-col>
        <van-col span="17">
          <p>{{phone}}</p>
          <p onclick="window.location='accountSetting'">账户设置</p>
        </van-col>
      </van-row>
    </div>
    <div style="width: 96%;transform: translateY(-30%);margin: 0 auto;border-radius: 0.4rem;overflow: hidden;">
      <van-cell title="我的竞价" is-link icon="bar-chart-o" to="bidding" />
      <van-cell title="我的咨询" is-link icon="service-o" to="userInteraction" />
      <van-cell title="我的供求" is-link icon="bag-o" to="userSupply" />
    </div>
    <van-button class="loginOut" color="linear-gradient(to right, #ff6034, #ee0a24)" @click="loginOut">
      退出登录
    </van-button>
  </div>
</template>

<script>
import { getMember , supplyList , deleteSupply} from "@/api/user/index";
import { logout ,getInfo } from "@/api/login/index";
export default {
  name: "user",
  data() {
    return {
      phone:''
    };
  },
  created() {
    this.getInfo();
  },
  methods: {
    loginOut(){
      logout().then(response => {
        location.reload(true);
      });
    },
    getInfo(){
      getInfo().then(response => {
        console.log(response)
        getMember(response.user.userId).then(response => {
          console.log(response)
          this.phone = response.data.phone;
        });
      });
    },
  },
};
</script>

<style scoped lang="scss">
.app-container {

}
  .header{
    background-color: #007E72;
    padding: 1rem 0rem 1.5rem;
    width: 100%;
    p{
      color: #FFF;
      font-size: 0.4rem;
      margin-top: 0.2rem;
    }
    p:nth-child(2){
      background-color: #03655C;
      width: 40%;
      text-align: center;
      padding: 10px;
      border-radius: 0.5rem;
      margin-top: 0.2rem;
      font-size: 0.2rem;
    }
  }
  .van-icon{
    color: #007E72;
  }
  .loginOut{
    width: 94%;
    margin-left: 3%;
  }
</style>
