info.vue 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <template>
  2. <page-layout class="user-info">
  3. <nav-bar title="个人信息" @init="onInitNavbar"></nav-bar>
  4. <u-scroll-view>
  5. <van-cell-group>
  6. <van-cell title="头像" class="van-cell--clickable" @click="navigateTo('/pages/user/info-edit')">
  7. <view class="right-icon" slot="right-icon">
  8. <view class="user-avator">
  9. <image v-if="user.avatar" :src="user.avatar" mode="aspectFill" />
  10. <image v-else src="https://thirdwx.qlogo.cn/mmopen/vi_32/POgEwh4mIHO4nibH0KlMECNjjGxQUq24ZEaGT4poC6icRiccVGKSyXwibcPq4BWmiaIGuG1icwxaQX6grC9VemZoJ8rg/132" mode="aspectFill" />
  11. </view>
  12. <van-icon
  13. name="arrow"
  14. class="van-cell__right-icon-wrap right-icon-class"
  15. custom-class="van-cell__right-icon"
  16. />
  17. </view>
  18. </van-cell>
  19. <van-cell title="呢称" is-link :value="user.nick_name || '微信呢称'" @click="navigateTo('/pages/user/info-edit')">
  20. </van-cell>
  21. <van-cell title="公司" is-link :value="user.company_name || '点击设置'" @click="navigateTo('/pages/user/info-edit')">
  22. </van-cell>
  23. <van-cell title="职业" is-link :value="user.title || '点击设置'" @click="navigateTo('/pages/user/info-edit')">
  24. </van-cell>
  25. </van-cell-group>
  26. </u-scroll-view>
  27. </page-layout>
  28. </template>
  29. <script>
  30. import NavBar from '@/components/layout/nav-bar'
  31. import UScrollView from '@/components/common/u-scroll-view'
  32. import VanCellGroup from '@/wxcomponents/vant/cell-group/index'
  33. import VanCell from '@/wxcomponents/vant/cell/index'
  34. import VanActionSheet from '@/wxcomponents/vant/action-sheet/index'
  35. import { updateInfo } from '../../api/user'
  36. import PageLayout from "@/components/layout/page-layout";
  37. export default {
  38. options: {
  39. styleIsolation: 'shared'
  40. },
  41. components: {
  42. PageLayout,
  43. NavBar,
  44. UScrollView,
  45. VanCell,
  46. VanCellGroup,
  47. VanActionSheet
  48. },
  49. computed: {
  50. user() {
  51. return this.$store.getters.user || {}
  52. }
  53. },
  54. data() {
  55. return {}
  56. },
  57. created() {
  58. this.checkAuth('/pages/user/info')
  59. },
  60. onShow() {
  61. },
  62. methods: {
  63. onChooseAvatar(e) {
  64. this.navigateTo('/pages/user/info-edit?avatar=' + e.detail.avatarUrl)
  65. },
  66. onCellClick() {
  67. this.navigateTo('/pages/user/setting-edit')
  68. }
  69. }
  70. }
  71. </script>
  72. <style lang="scss">
  73. .user-info{
  74. .user-avator{
  75. @include display-flex-center;
  76. width: 111rpx;
  77. height: 111rpx;
  78. border-radius: 50%;
  79. overflow: hidden;
  80. margin-right: 13rpx;
  81. .icon{
  82. color: #ffffff;
  83. opacity: 0.67;
  84. font-size: 70rpx;
  85. }
  86. }
  87. }
  88. </style>