index.vue 3.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <template>
  2. <view class="page WoDe">
  3. <!-- 背景 -->
  4. <view class="Bg">
  5. <image mode="widthFix" src="https://cjgw.oss-cn-hangzhou.aliyuncs.com/ygcxxfb/image/wodebeijingtu.png"></image>
  6. <view class="centerLabel">
  7. <view class="flex-h">
  8. <view class="Icon">
  9. <image mode="widthFix" :src="IconUrl"></image>
  10. </view>
  11. <view class="flex-item">
  12. <navigator url="../SignIn/index" hover-class="other-navigator-hover" class="SiginIn" v-if="UserInfo === null || UserInfo.Phone === undefined || UserInfo.Phone === null">立即登录</navigator>
  13. <text v-else>{{UserInfo.Name}}</text>
  14. <text v-if="!(UserInfo === null || UserInfo.Phone === undefined || UserInfo.Phone === null)">{{UserInfo.Phone}}</text>
  15. </view>
  16. </view>
  17. </view>
  18. </view>
  19. <!-- tab -->
  20. <view class="TabList">
  21. <navigator url="./MyActivityList/index" hover-class="other-navigator-hover" class="flex-h">
  22. <view>
  23. <image mode="heightFix" src="https://cjgw.oss-cn-hangzhou.aliyuncs.com/ygcxxfb/image/iconhuodong.png"></image>
  24. </view>
  25. <text class="flex-item">我的活动</text>
  26. <text class="iconfont iconjiantouright"></text>
  27. </navigator>
  28. <navigator url="./MyRecommed/index" hover-class="other-navigator-hover" class="flex-h">
  29. <view>
  30. <image mode="heightFix" src="https://cjgw.oss-cn-hangzhou.aliyuncs.com/ygcxxfb/image/wodeicon1.png"></image>
  31. </view>
  32. <text class="flex-item">我的推荐</text>
  33. <text class="iconfont iconjiantouright"></text>
  34. </navigator>
  35. <!-- <navigator url="./Feedback/index" hover-class="other-navigator-hover" class="flex-h">
  36. <view>
  37. <image mode="heightFix" src="https://cjgw.oss-cn-hangzhou.aliyuncs.com/ygcxxfb/image/wodeicon2.png"></image>
  38. </view>
  39. <text class="flex-item">意见反馈</text>
  40. <text class="iconfont iconjiantouright"></text>
  41. </navigator> -->
  42. </view>
  43. <!-- 授权头像获取弹窗 -->
  44. <GetUserIcon @UserInfoChange="UserInfoChange"></GetUserIcon>
  45. </view>
  46. </template>
  47. <script>
  48. import GetUserIcon from '../../components/GetUserIcon/index'
  49. import { createNamespacedHelpers } from 'vuex'
  50. const { mapState: mapUserState, mapActions: mapUserActions, mapMutations: mapUserMutations } = createNamespacedHelpers('user')
  51. export default {
  52. name: 'WoDe',
  53. data () {
  54. return {
  55. IconUrl: 'https://cjgw.oss-cn-hangzhou.aliyuncs.com/ygcxxfb/image/morentouxiang.png',
  56. }
  57. },
  58. computed: {
  59. ...mapUserState({
  60. UserInfo: x => x.UserInfo // 用户信息
  61. })
  62. },
  63. components: {
  64. GetUserIcon
  65. },
  66. created () {
  67. this.$authed(() => {
  68. this.Init()
  69. })
  70. },
  71. methods: {
  72. ...mapUserActions([
  73. 'MainSignIn' // 获取用户信息
  74. ]),
  75. ...mapUserMutations([
  76. 'EditUserInfo' // 编辑用户信息
  77. ]),
  78. Init () { // 初始化
  79. if (this.UserInfo === null && this.UserInfo.Phone === undefined && this.UserInfo.Phone === null) {
  80. this.IconUrl = this.UserInfo.Icon
  81. }
  82. },
  83. UserInfoChange () {
  84. this.IconUrl = this.UserInfo.Icon
  85. console.log(this.IconUrl, '1`````')
  86. }
  87. }
  88. }
  89. </script>
  90. <style lang="scss">
  91. @import "page.scss";
  92. </style>