index.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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="selfPhotoUrl" :src="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" v-if="qrCodeImg" :src="qrCodeImg" mode=""></image> <!-- 二维码图片 -->
  19. <image class="qrcodeImage" 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. qrCodeImg:'',
  45. selfPhotoUrl:'',
  46. }
  47. },
  48. onLoad() {
  49. // 用户信息
  50. let sysInfo = uni.getSystemInfoSync()
  51. this.height = sysInfo.screenHeight - (sysInfo.screenWidth/750)*138 + 'px'
  52. },
  53. onShow(){
  54. this.userInfo = uni.getStorageSync('userInfo');
  55. this.getImgUrlByOssId(this.userInfo.selfPhoto, 1)
  56. this.getImgUrlByOssId(this.userInfo.wxQrCode, 2)
  57. },
  58. methods: {
  59. getImgUrlByOssId(ossId, type) {
  60. if (ossId===null){
  61. return
  62. }
  63. this.$api.getImgUrlByOssId({
  64. ossId:ossId,
  65. auth:true
  66. }).then(res=>{
  67. console.log(res)
  68. if (type === 1) {
  69. this.selfPhotoUrl = res.data.data[0].url.replace(/^http:/, "https:");
  70. } else if (type === 2) {
  71. this.qrCodeImg = res.data.data[0].url.replace(/^http:/, "https:");
  72. }
  73. })
  74. },
  75. /* 用户信息 */
  76. perfectUserInfo() {
  77. uni.navigateTo({
  78. url: '/pages/me/user-info',
  79. })
  80. },
  81. }
  82. }
  83. </script>
  84. <style>
  85. @import '/common/css/common.css';
  86. @import './index.rpx.css';
  87. </style>