smart-admin/rc-busness/components/unlogin.vue
lin 9f955a34eb 迭代功能需求
1.修改用户信息存储位置
2.修复订单显示的问题
3.修改优惠卷显示文字显示和选择提示
4.修复地址列表排版错位的问题
5.添加搜索链接跳转查询
2022-03-23 18:04:14 +08:00

100 lines
1.7 KiB
Vue

<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>
import { mapState } from 'vuex';
export default {
data() {
return {
userunlogin: false
};
},
methods: {
//用户登录
userlogin() {
this.$router.push({
path: '/userlogin/login',
query: {
stype: 1
}
});
},
/* 初始化数据 */
initData(){
//获取缓存是否登录
let islogin = this.userInfo;
// // console.log(islogin);
// if (islogin == null) {
// this.userunlogin = true;
// console.log(this.userunlogin);
// }
if (islogin == null || islogin == undefined) {
this.userunlogin = true;
}else{
this.userunlogin = false;
}
}
},
mounted() {
this.initData();
},
computed:{
...mapState({
userInfo : state => state.user.userInfo,
})
},
watch: {
userInfo(newVal){
if(newVal){
this.initData();
}
}
}
};
</script>
<style lang="less" scoped>
.rc-login {
width: 92%;
margin: 0 auto;
margin-top: 0.7rem;
.userunlogin {
width: 100%;
height: 0.6rem;
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>