鸿宇研学生前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

223 lines
5.1 KiB

  1. <template>
  2. <view class="card">
  3. <view class="flex card-header">
  4. <view>
  5. <view class="title">我的档案</view>
  6. <button class="flex btn btn-question">
  7. <image class="btn-icon" src="@/static/image/icon-question.png" mode="widthFix"></image>
  8. <view>如何完善我的档案</view>
  9. </button>
  10. </view>
  11. <view class="flex">
  12. <button class="btn btn-switch" @click="onSwitch">切换</button>
  13. <!-- <button class="btn btn-add" @click="onAdd">新增记录</button> -->
  14. </view>
  15. </view>
  16. <view class="card-content">
  17. <view class="flex info">
  18. <view class="avatar">
  19. <image class="img" :src="memberInfo.headImage" mode="scaleToFill"></image>
  20. <view :class="['tag', `tag-${memberInfo.role}`]">{{ memberInfo.roleDesc || '' }}</view>
  21. </view>
  22. <view class="flex summary">
  23. <view class="flex flex-column summary-item name">
  24. <view class="summary-item-content">{{ memberInfo.nickName }}</view>
  25. <view class="summary-item-label">{{ `ID:${memberInfo.id}` }}</view>
  26. </view>
  27. <view class="flex flex-column summary-item" @click="jumpToAchievement">
  28. <view class="summary-item-content">{{ medalCount }}</view>
  29. <view class="summary-item-label nowrap">成就</view>
  30. </view>
  31. <view class="flex flex-column summary-item">
  32. <view class="summary-item-content">{{ experienceCount }}</view>
  33. <view class="summary-item-label nowrap">足迹</view>
  34. </view>
  35. </view>
  36. </view>
  37. <view class="flex medal">
  38. <image class="medal-item" v-for="item in medalList" :key="item.id" :src="item.medal.icon1" mode="widthFix"></image>
  39. </view>
  40. </view>
  41. </view>
  42. </template>
  43. <script>
  44. import { mapState } from 'vuex'
  45. export default {
  46. props: {
  47. medalList: {
  48. type: Array,
  49. default() {
  50. return []
  51. }
  52. },
  53. medalCount: {
  54. type: Number,
  55. default: 0
  56. },
  57. experienceCount: {
  58. type: Number,
  59. default: 0
  60. },
  61. },
  62. data() {
  63. return {
  64. }
  65. },
  66. onLoad() {
  67. },
  68. computed: {
  69. ...mapState(['memberInfo']),
  70. },
  71. methods: {
  72. async getData() {
  73. try {
  74. await this.$fetch('queryMedalList', { pageNo: 1, pageSize: 1000, isLight: '1', })
  75. } catch (err) {
  76. }
  77. },
  78. onAdd() {
  79. this.$emit('addRecord')
  80. },
  81. onSwitch() {
  82. this.$emit('switchMember')
  83. },
  84. jumpToAchievement() {
  85. uni.navigateTo({
  86. url: '/pages_order/growing/achievement/index'
  87. })
  88. },
  89. },
  90. }
  91. </script>
  92. <style scoped lang="scss">
  93. @import '../member/styles/tag.scss';
  94. .card {
  95. font-family: PingFang SC;
  96. font-weight: 400;
  97. line-height: 1.4;
  98. background: linear-gradient(to right, #DDF4FF, #9FE1FF);
  99. border-radius: 48rpx;
  100. &-header {
  101. justify-content: space-between;
  102. padding: 24rpx 40rpx 20rpx 40rpx;
  103. .title {
  104. font-size: 32rpx;
  105. font-weight: 600;
  106. color: #000000;
  107. }
  108. .btn-question {
  109. margin-top: 4rpx;
  110. column-gap: 8rpx;
  111. font-size: 26rpx;
  112. color: #21607D;
  113. .btn-icon {
  114. width: 32rpx;
  115. height: auto;
  116. }
  117. }
  118. .btn-switch {
  119. padding: 6rpx 22rpx;
  120. font-size: 28rpx;
  121. font-weight: 400;
  122. line-height: 1.4;
  123. color: #252545;
  124. border: 2rpx solid #252545;
  125. border-radius: 28rpx;
  126. }
  127. .btn-add {
  128. padding: 8rpx 24rpx;
  129. font-size: 28rpx;
  130. font-weight: 500;
  131. line-height: 1.4;
  132. color: #FFFFFF;
  133. background: linear-gradient(to right, #21FEEC, #019AF9);
  134. border-radius: 28rpx;
  135. }
  136. .btn + .btn {
  137. margin-left: 26rpx;
  138. }
  139. }
  140. &-content {
  141. padding: 38rpx 38rpx 14rpx 38rpx;
  142. background: linear-gradient(to right, #FBFEFF, #DAF3FF);
  143. border: 2rpx solid #FFFFFF;
  144. border-radius: 48rpx;
  145. box-shadow: 0 2px 12px 0 #009AE717;
  146. .info {
  147. column-gap: 24rpx;
  148. .avatar {
  149. flex: none;
  150. position: relative;
  151. width: 128rpx;
  152. height: 128rpx;
  153. border-radius: 24rpx;
  154. overflow: hidden;
  155. .img {
  156. width: 100%;
  157. height: 100%;
  158. }
  159. }
  160. .summary {
  161. flex: 1;
  162. column-gap: 26rpx;
  163. &-item {
  164. flex: 1;
  165. row-gap: 8rpx;
  166. &.name {
  167. flex: none;
  168. }
  169. &-content {
  170. font-size: 32rpx;
  171. font-weight: 600;
  172. color: #000000;
  173. }
  174. &-label {
  175. font-size: 24rpx;
  176. color: #939393;
  177. }
  178. }
  179. }
  180. }
  181. .medal {
  182. margin-top: 16rpx;
  183. justify-content: flex-start;
  184. flex-wrap: wrap;
  185. gap: 16rpx;
  186. &-item {
  187. width: 50rpx;
  188. height: auto;
  189. }
  190. }
  191. }
  192. }
  193. .nowrap {
  194. white-space: nowrap;
  195. }
  196. </style>