123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208 |
- <template>
- <div class="about-me">
- <div class="top" @click="$router.push('/editMe')" v-if="userInfo">
- <div class="avatar-wrap">
- <img class="user-avatar" v-if="userInfo.cover_photo" :src="userInfo.cover_photo" alt="">
- <div v-else class="user-avatar"
- :class="'avatar_bg' + userInfo.user_id % 9"
- :data-name="userInfo.nick_name.slice(0,2).toUpperCase()"
- ></div>
- </div>
- <div class="top-info">
- <div class="name">{{userInfo.nick_name}}</div>
- <div class="code">昵称:@{{userInfo.user_name}}</div>
- </div>
- <i class="arrow-icon el-icon-arrow-right"></i>
- </div>
- <ul class="account-list" v-if="userInfo">
- <li class="list-item" v-for="(item, key) in userInfo.binds" :key="key">
- <div class="icon-wrap">
- <i :class="`${item.type}-icon`"></i>
- </div>
- <div class="info">
- <div class="title">{{item.type.toUpperCase()}}</div>
- <div class="code">{{item.account || '未绑定'}}</div>
- </div>
- <div class="opetate" v-if="item.account" @click="hanldeChange(item)">
- <i :class="item.is_visible === 0 ? 'unopen' : 'open'"></i>
- <p>{{item.is_visible === 0 ? '未公开' : '已公开'}}</p>
- </div>
- </li>
- </ul>
- <div class="login-out-btn" @click="loginOut">退出登录</div>
- </div>
- </template>
- <script>
- import { mapState } from 'vuex'
- import API from '@/api'
- export default {
- name: 'chatList',
- data () {
- return {
- }
- },
- computed: {
- ...mapState({
- userInfo: state => {
- return state.userInfo
- }
- })
- },
- methods: {
- loginOut () {
- this.$store.dispatch('doScatterLogout')
- },
- // 账号显示与隐藏
- hanldeChange (item) {
- let type = item.type
- let val = item.is_visible == 0 ? 1 : 0
- API.user.setVisible({
- type,
- is_visible: val
- }).then(({ data }) => {
- this.$store.dispatch('getUserInfo')
- })
- }
- },
- created () {
- this.$store.dispatch('getUserInfo')
- }
- }
- </script>
- <style lang="scss" scoped>
- .top{
- padding: px2rem(50) px2rem(54);
- background-color: #ffffff;
- border-bottom: 1px solid #d8d8d8;
- position: relative;
- .avatar-wrap{
- display: inline-block;
- vertical-align: middle;
- }
- .user-avatar{
- width: px2rem(120);
- height: px2rem(120);
- border-radius: 4px;
- }
- .top-info{
- display: inline-block;
- vertical-align: middle;
- margin-left: px2rem(30);
- }
- .name{
- font-size: px2rem(42);
- color: #000000;
- margin-bottom: px2rem(30);
- }
- .code{
- color: #666666;
- font-size: px2rem(28);
- }
- .arrow-icon{
- position: absolute;
- color: #c8c8c8;
- top: px2rem(96);
- right: px2rem(24);
- font-size: px2rem(36);
- }
- }
- .account-list{
- background-color: #ffffff;
- margin: 18px 0;
- border-top: 1px solid #d8d8d8;
- border-bottom: 1px solid #d8d8d8;
- .list-item{
- display: flex;
- height: px2rem(130);
- &:last-child{
- .info{
- border-bottom: none;
- }
- .opetate{
- border-bottom: none;
- }
- }
- }
- .title{
- font-size: px2rem(30);
- color: #000000;
- margin-bottom: px2rem(22);
- }
- .code{
- font-size: px2rem(20);
- color: #999999;
- }
- .info{
- flex: 1;
- padding-top: px2rem(30);
- border-bottom: 1px solid #d8d8d8;
- }
- .opetate{
- width: px2rem(100);
- font-size: px2rem(20);
- color: #999999;
- padding-top: px2rem(32);
- border-bottom: 1px solid #d8d8d8;
- i{
- display: block;
- margin: 0 auto;
- }
- p{
- text-align: center;
- margin-top: px2rem(16);
- }
- .open{
- background: url('../../../assets/h5/open-icon.png') no-repeat;
- width: px2rem(39);
- height: px2rem(23);
- background-size: 100%;
- }
- .unopen{
- background: url('../../../assets/h5/unopen-icon.png') no-repeat;
- width: px2rem(40);
- height: px2rem(23);
- background-size: 100%;
- }
- }
- .icon-wrap{
- width: px2rem(106);
- line-height: px2rem(130);
- text-align: center;
- i{
- display: inline-block;
- vertical-align: middle;
- }
- }
- .eos-icon{
- background: url('../../../assets/h5/eos-icon.png') no-repeat;
- width: px2rem(47);
- height: px2rem(48);
- background-size: 100%;
- }
- .eth-icon{
- background: url('../../../assets/h5/eth-icon.png') no-repeat;
- width: px2rem(44);
- height: px2rem(39);
- background-size: 100%;
- }
- .tron-icon{
- background: url('../../../assets/h5/tron-icon.png') no-repeat;
- width: px2rem(34);
- height: px2rem(35);
- background-size: 100%;
- }
- }
- .login-out-btn{
- font-size: px2rem(28);
- color: #ea2d2d;
- text-align: center;
- height: px2rem(88);
- line-height: px2rem(88);
- border-top: 1px solid #d8d8d8;
- border-bottom: 1px solid #d8d8d8;
- background-color: #ffffff;
- }
- </style>
|