center.vue 4.06 KB
<template>
  <div class="user_center">
    <div class="header">
      <div class="header_left"></div>
      <div class="header_right" @click="jumpPersonPage">
        <div class="right_txt">
          <div class="nick">凝视你的目光</div>
          <div class="phone">183****8924</div>
        </div>
        <div class="iconfont iconright"></div>
      </div>
    </div>
    <div class="center_menu_list">
      <van-cell title="我的消息" center is-link to="/user/message" :icon="imgList.user" value-class="right_content">
        <template #default>
          <div class="dot" v-if="GIsLogin"></div>
        </template>
      </van-cell>
      <van-cell title="我的收藏" center is-link to="/user/collect" :icon="imgList.user" />
      <van-cell title="我的学习" center is-link @click="jumpStudyPage" :icon="imgList.user" value-class="right_content" />
      <van-cell title="常见问题" center is-link to="/user/question" :icon="imgList.user" />
      <van-cell title="意见反馈" center is-link to="/user/feedback" :icon="imgList.user" />
      <van-cell title="关于协会" center is-link to="/user/about" :icon="imgList.user" value-class="right_content">
        <template #default>
          <div v-if="GIsLogin">版本2.1</div>
        </template>
      </van-cell>
      <van-cell title="设置" center is-link to="/user/setting" :icon="imgList.user" />
    </div>
  </div>
</template>
<script>
import { mapGetters } from 'vuex'

export default {
  name: 'Center',
  data() {
    return {
      imgList: {
        user: require('@/assets/icon/user_question.png')
      },
      menuList: [
        {
          icon: require('@/assets/icon/user_question.png'),
          title: '我的收藏',
          url: '/user/collect'
        },
        {
          icon: require('@/assets/icon/user_question.png'),
          title: '我的学习',
          url: '/user/message'
        },
        {
          icon: require('@/assets/icon/user_question.png'),
          title: '我的浏览',
          url: '/message'
        },
        {
          icon: require('@/assets/icon/user_question.png'),
          title: '常见问题',
          url: '/collect'
        },
        {
          icon: require('@/assets/icon/user_question.png'),
          title: '关于协会',
          url: '/user/about'
        },
        {
          icon: require('@/assets/icon/user_question.png'),
          title: '设置',
          url: '/user/setting'
        },
      ]
    }
  },
  methods: {
    // 跳转到我到学习页面
    jumpStudyPage() {
      
    },
    // 跳转到 个人设置中心
    jumpPersonPage(){
      this.$router.push({
        path:'/user/person'
      })
    }
  },
  computed: {
    ...mapGetters('user', ['GIsLogin'])
  }
}
</script>
<style lang="less">
@import "~@/assets/css/variable.less";
.user_center {
  background-color: #fafafa;
  height: 100vh;
}
.header {
  background: @theme;
  padding: 60px 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  .header_left {
    background: red;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin-right: 30px;
  }
  .header_right {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex: 1;
    color: @colorfff;
    .phone {
      margin-top: 10px;
    }
  }
}
.center_menu_list {
  background-color: #fff;
  .right_content {
    display: flex;
    align-items: center;
    justify-content: flex-end;
  }
  .dot {
    width: 15px;
    height: 15px;
    background: #ff4038;
    border-radius: 50%;
  }
}
.van-cell:not(:last-child)::after {
  right: 16px;
}

// .center_menu_list {
//   padding: 0 25px;
//   .li {
//     display: flex;
//     justify-content: space-between;
//     align-items: center;
//     border-bottom: 1px solid #ccc;
//     height: 95px;
//     .menu_left {
//       color: #333;
//       display: flex;
//       justify-content: space-between;
//       align-items: center;
//       img {
//         margin-right: 20px;
//         width: 35px;
//         height: 35px;
//       }
//     }
//     .menu_right {
//       color: #ccc;
//     }
//   }
// }
</style>