myGroup.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <template>
  2. <view class="container">
  3. <view class="top-img-box">
  4. <image class="top-img" :src="avatar" />
  5. <view class="top-name"> {{ nickname }} </view>
  6. </view>
  7. <view class="group-item-box">
  8. <view class="item-top">
  9. <view class="top-l">团队成员</view>
  10. <view class="top-r">></view>
  11. </view>
  12. <view class="item-content">
  13. <view class="person-item" v-for="item of teamPersonList">
  14. <image class="item-img" :src="item.inviteUserAvatar" mode="aspectFill" />
  15. <view class="item-name">{{ item.name }}</view>
  16. </view>
  17. </view>
  18. </view>
  19. <!-- <view class="group-item-box">
  20. <view class="item-top">
  21. <view class="top-l">最近动态</view>
  22. <view class="top-r">></view>
  23. </view>
  24. <view class="item-content dynamic-img-box">
  25. <img class="dynamic-img" src="@/static/logo.png" alt="" />
  26. </view>
  27. </view>
  28. <view class="group-item-box">
  29. <view class="item-top">
  30. <view class="top-l">团队任务</view>
  31. <view class="top-r">></view>
  32. </view>
  33. <view class="item-content">
  34. <img class="item-img" src="@/static/logo.png" alt="" :key="item" v-for="item of 3" />
  35. </view>
  36. </view> -->
  37. <button @click='handlerBind'>绑定</button>
  38. </view>
  39. </template>
  40. <script>
  41. import {
  42. getMyTeam,
  43. inviteBind
  44. } from "@/api/client/mine.js"
  45. import {
  46. mapGetters
  47. } from "vuex"
  48. export default {
  49. data() {
  50. return {
  51. queryParams: {
  52. paging: '1,10'
  53. },
  54. teamPersonList: []
  55. };
  56. },
  57. mounted() {
  58. this.handlerInitList()
  59. },
  60. computed: {
  61. ...mapGetters(['userId', 'gender', 'avatar', 'nickname'])
  62. },
  63. methods: {
  64. // 初始化我的团队列表
  65. handlerInitList() {
  66. getMyTeam(this.queryParams).then(res => {
  67. let {
  68. records
  69. } = res.data
  70. this.teamPersonList = records
  71. console.log("Res", res)
  72. })
  73. },
  74. // 测试绑定
  75. handlerBind() {
  76. let params = {
  77. userId: this.userId,
  78. targetId: '1774462327015325697',
  79. type: 1
  80. }
  81. inviteBind(params).then(res => {
  82. console.log("@@@@res", res)
  83. })
  84. }
  85. }
  86. };
  87. </script>
  88. <style lang="scss" scoped>
  89. .container {
  90. padding: 20rpx 10rpx 50rpx;
  91. .top-img-box {
  92. text-align: center;
  93. .top-img {
  94. width: 160rpx;
  95. height: 160rpx;
  96. border-radius: 100rpx;
  97. }
  98. .top-name {
  99. color: #6b7280;
  100. font-weight: bold;
  101. font-size: 32rpx;
  102. margin-top: 20rpx;
  103. }
  104. }
  105. .group-item-box {
  106. padding: 0 20rpx;
  107. margin-top: 60rpx;
  108. .item-top {
  109. display: flex;
  110. justify-content: space-between;
  111. .top-l,
  112. .top-r {
  113. color: #6b7280;
  114. font-weight: bold;
  115. font-size: 32rpx;
  116. margin-top: 20rpx;
  117. }
  118. }
  119. .item-content {
  120. display: flex;
  121. width: 100%;
  122. .person-item {
  123. margin-right: 20rpx;
  124. text-align: center;
  125. width: 25%;
  126. }
  127. .item-name {
  128. font-size: 28rpx;
  129. font-weight: bold;
  130. color: #000;
  131. width: 100%;
  132. text-overflow: ellipsis;
  133. white-space: nowrap;
  134. overflow: hidden;
  135. }
  136. .person-item:last-child {
  137. margin: 0;
  138. }
  139. .item-img {
  140. width: 160rpx;
  141. height: 160rpx;
  142. border-radius: 100rpx;
  143. margin: 60rpx 20rpx 0 0;
  144. }
  145. .dynamic-img {
  146. width: 100%;
  147. height: 500rpx;
  148. margin-top: 60rpx;
  149. }
  150. }
  151. }
  152. }
  153. </style>