index.vue 1.2 KB
<template>
  <view class="container">
    <uni-list>
      <uni-list-item showExtraIcon="true" :extraIcon="{type: 'person-filled'}" title="昵称" :rightText="user.name" />
      <uni-list-item showExtraIcon="true" :extraIcon="{type: 'phone-filled'}" title="手机号码" :rightText="user.telephone" />
     <uni-list-item showExtraIcon="true" :extraIcon="{type: 'auth-filled'}" title="部门" :rightText="user.deptPathsText" />
    </uni-list>
  </view>
</template>

<script>
  export default {
    data() {
      return {
        user: {},
      }
    },
    onShow() {
      const color = getApp().globalData.config.themeColor
      uni.setNavigationBarColor({
        frontColor: '#ffffff',
        backgroundColor: color
      })
    },
    onLoad() {
    },
     created() {
      console.log('this.$store.state.user', this.$store.state.user)
       this.user = {
        name : this.$store.state.user.name || '',
        deptPathsText : this.$store.state.user.deptPaths.length ? this.$store.state.user.deptPaths.join(',') : '',
        telephone: this.$store.state.user.telephone || ''
       }
    },
    methods: {
      
    }
  }
</script>

<style lang="scss">
  page {
    background-color: #ffffff;
  }
</style>