<template>
  	<div class="rc-login">
		<div class="userunlogin" v-show="userunlogin" @click="userlogin">
			<div class="user-left">
				<img src="../assets/image/rc-people.png" alt="">
				<span>
					登录/注册
				</span>
			</div>
			<div class="user-right">
				<img src="../assets/image/rc-left.png" alt="">
			</div>
		</div>
	</div>
</template>

<script>
export default {
data(){
    return{
        userunlogin:false,

    }
},
methods:{
       //用户登录
        userlogin(){
       this.$router.push({
        path: "/userlogin/login",
        query: {
          stype: 1,
        },
      });
        },
},
mounted(){
    //获取缓存是否登录
 let islogin=JSON.parse(localStorage.getItem("userInfo"));
 console.log(islogin);
 if(islogin==null){
   this.userunlogin=true;
   console.log(this.userunlogin);
 }
 if(islogin==null ||islogin==undefined){
                  this.userunlogin=true
            }
}
}
</script>

<style lang="less" scoped >
.rc-login{
    width: 92%;
    margin: 0 auto;
    margin-top: 0.70rem;
      .userunlogin{
    width: 100%;
    height: 0.60rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    .user-left{
      display: flex;
      align-items: center;
      img{
            width: 0.16rem;
            height: 0.16rem;
            display: block;
      }
      span{
        color: #444444;
        font-size: 0.16rem;
       margin-left: 0.06rem;
      }
    }
    .user-right{
      img{
        width: 0.08rem;
        height: 0.16rem;
        display: block;
      }
    }
    
   }
}
</style>