<template>
  <div class="body">
    <!-- 选择类型 -->
    <div class="list">
      <router-link to="/Forgetpassword">
        <span>修改密码</span>
      </router-link>
      <!-- <router-link to="">
				<span>关于</span>
			</router-link> -->
      <router-link to="/Sytk">
        <span>使用条款</span>
      </router-link>
    </div>
    <div class="btn">
      <van-button color="#0c2469" @click="loginout">退出登录</van-button>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      titlename: "设置",
      userId: "",
      user: []
    };
  },
  created: function() {
    this.isLogin();
    this.userId = localStorage.getItem("userId");
    //this.openid = '123'
  },
  methods: {
    //跳转
    getUser() {
      this.$http
        .post(
          this.$store.state.host + "/interface/getUser",
          {
            userId: this.userId
          },
          {
            emulateJSON: true
          }
        )
        .then(
          res => {
            //发送成功
            if (res.body.code == 0) {
              this.user = res.body.userPd;
              console.log(this.user);
            }

            //if()
          },
          res => {
            //发送失败
          }
        );
    },
    //退出登录
    loginout() {
      localStorage.removeItem("userId");
      localStorage.removeItem("openid");
      this.$router.push("/Login");
      // window.location.href = 'http://localhost:8081'
      // window.location.href ='http://47.101.145.23/wuliu/';
    }
  }
};
</script>

<style lang="less" scoped>
body {
  background: #fbfbfb;
}

.body {
  .head {
    padding: 0.43rem 0.38rem;
    font-size: 0.24rem;
    color: #999;
    display: flex;
    background: white;
    flex-wrap: wrap;
    position: relative;

    img {
      width: 1.48rem;
      height: 1.48rem;
      border-radius: 50%;
      margin-right: 0.4rem;
    }

    div {
      p:nth-of-type(1) {
        font-size: 0.36rem;
        font-weight: bold;
        color: #333;
        margin-bottom: 0.2rem;
        padding-top: 0.3rem;
      }
    }

    div:after {
      content: "";
      display: block;
      width: 0.2rem;
      height: 0.2rem;
      border-left: 0.01rem solid #333;
      border-top: 0.01rem solid #333;
      transform: rotate(135deg);
      position: absolute;
      right: 0.38rem;
      top: 1rem;
    }
  }

  .list {
    background: white;
    margin-top: 0.36rem;
    border-radius: 0.05rem;

    a {
      font-size: 0.3rem;
      display: block;
      color: #333;
      padding: 0.3rem 0.4rem;
      border-bottom: 1px solid #f4f3f3;
      position: relative;

      img {
        width: 0.4rem;
        height: 0.4rem;
      }

      span {
        position: relative;
        top: -0.075rem;
        margin-left: 0rem;
      }
    }

    a:after {
      content: "";
      display: block;
      width: 0.2rem;
      height: 0.2rem;
      border-left: 0.01rem solid #b8b8b8;
      border-top: 0.01rem solid #b8b8b8;
      transform: rotate(135deg);
      position: absolute;
      right: 0.4rem;
      top: 0.4rem;
    }
  }

  .btn {
    padding: 0px 0.37rem;

    button {
      width: 100%;
      color: white;
    }
  }
}
</style>
