recommend.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <template>
  2. <view class="container">
  3. <view class="box">
  4. <image class="img" :src="list.avatar" mode=""></image>
  5. <p class="nc">{{list.nickname}}</p>
  6. <p class="tj">我的推荐人</p>
  7. </view>
  8. </view>
  9. </template>
  10. <script>
  11. import {getUserInfo} from '@/api/user.js'
  12. export default {
  13. data() {
  14. return {
  15. list: {
  16. avatar:'',
  17. nickname:''
  18. } ,
  19. }
  20. },
  21. onShow() {
  22. this.getUserInfo()
  23. },
  24. methods: {
  25. async getUserInfo() {
  26. const res = await getUserInfo()
  27. console.log('123', res)
  28. this.list = res.data
  29. }
  30. },
  31. };
  32. </script>
  33. <style lang="scss">
  34. .container{
  35. width: 690rpx;
  36. height: 315rpx;
  37. background-image: url("../../static/img/tjr.png");
  38. margin-top: 162rpx;
  39. margin-left: 30rpx;
  40. }
  41. .img{
  42. width: 133rpx;
  43. height: 133rpx;
  44. margin-top: 42rpx;
  45. margin-left: 279rpx;
  46. }
  47. .nc{
  48. margin-left: 247rpx;
  49. margin-top: 25rpx;
  50. height: 23rpx;
  51. font-size: 30rpx;
  52. font-family: PingFang SC;
  53. font-weight: bold;
  54. color: #6E4019;
  55. }
  56. .tj{
  57. margin-top: 19rpx;
  58. margin-left: 280rpx;
  59. height: 25rpx;
  60. font-size: 26rpx;
  61. font-family: PingFang SC;
  62. font-weight: 500;
  63. color: #6E4019;
  64. line-height: 40rpx;
  65. }
  66. </style>