index.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <template>
  2. <view class="page">
  3. <view class="content" :style="{'height':height}">
  4. <view class="outView flex-col">
  5. <view class="member-head-img flex-row justify-center">
  6. <image class="imageLogo" v-if="userInfo.selfPhotoUrl" :src="userInfo.selfPhotoUrl" mode=""></image> <!-- 用户头像 -->
  7. <image class="imageLogo" v-else src="../../static/logo.png" mode=""></image> <!-- 用户头像 -->
  8. </view>
  9. <view class="member-content flex-col">
  10. <view class="user-name flex-row justify-center">
  11. <text>hi.亲爱的{{userInfo.ncikName}}</text>
  12. </view> <!-- 用户名 -->
  13. <view @click="perfectUserInfo()" class="flex-row justify-center">
  14. <text>你前资料尚不完善,</text>
  15. <text>立即完善</text>
  16. </view>
  17. <view class="qrcode flex-row justify-center">
  18. <image class="qrcodeImage bord" v-if="userInfo.qrCodeImg" :src="userInfo.qrCodeImg" mode=""></image> <!-- 二维码图片 -->
  19. <image class="qrcodeImage bord" v-else src="../../static/index/u41.png" mode=""></image> <!-- 二维码图片 -->
  20. </view>
  21. <view class="qrcode-desc flex-row justify-center">
  22. <text>会员码,分享邀请好友加入</text>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. <view class="tabBarLineHeight"></view>
  28. <view class="tabBarView">
  29. <tab-bar :tabIndex="tabIndex"></tab-bar>
  30. </view>
  31. </view>
  32. </template>
  33. <script>
  34. import tabBar from "../../components/tabBar/tabBar";
  35. export default {
  36. components:{
  37. tabBar
  38. },
  39. data() {
  40. return {
  41. height: '',
  42. tabIndex:2,
  43. userInfo:''
  44. }
  45. },
  46. onLoad() {
  47. let sysInfo = uni.getSystemInfoSync()
  48. this.height = sysInfo.screenHeight - (sysInfo.screenWidth/750)*138 + 'px'
  49. },
  50. mounted() {
  51. // 用户信息
  52. this.userInfo = this.$store.state.loginUserInfo;
  53. this.getImgUrlByOssId(this.userInfo.selfPhoto, 1)
  54. this.getImgUrlByOssId(this.userInfo.wxQrCode, 2)
  55. },
  56. methods: {
  57. getImgUrlByOssId(ossId, type) {
  58. let url = this.$getImgUrlByOssId(ossId);
  59. if (type == 1) {
  60. this.userInfo.selfPhotoUrl = url;
  61. } else if (type == 2) {
  62. this.userInfo.qrCodeImg = url;
  63. }
  64. return url;
  65. },
  66. /* 用户信息 */
  67. perfectUserInfo() {
  68. uni.navigateTo({
  69. url: '/pages/me/user-info',
  70. })
  71. },
  72. }
  73. }
  74. </script>
  75. <style>
  76. @import '/common/css/common.css';
  77. @import './index.rpx.css';
  78. </style>