index.vue 2.4 KB

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