鸿宇研学生前端代码
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.

219 lines
5.0 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="info.headImage" mode="scaleToFill"></image>
  20. <view :class="['tag', `tag-${info.role}`]">{{ info.roleDesc || '' }}</view>
  21. </view>
  22. <view class="flex summary">
  23. <view class="flex flex-column summary-item name">
  24. <view class="summary-item-content">{{ info.nickName || '' }}</view>
  25. <view class="summary-item-label">{{ `ID:${info.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" @click="jumpToAchievement">
  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(['userInfo', 'memberInfo']),
  70. info() {
  71. return this.memberInfo || this.userInfo
  72. },
  73. },
  74. methods: {
  75. onAdd() {
  76. this.$emit('addRecord')
  77. },
  78. onSwitch() {
  79. this.$emit('switchMember')
  80. },
  81. jumpToAchievement() {
  82. uni.navigateTo({
  83. url: '/pages_order/growing/achievement/index'
  84. })
  85. },
  86. },
  87. }
  88. </script>
  89. <style scoped lang="scss">
  90. @import '../member/styles/tag.scss';
  91. .card {
  92. font-family: PingFang SC;
  93. font-weight: 400;
  94. line-height: 1.4;
  95. background: linear-gradient(to right, #DDF4FF, #9FE1FF);
  96. border-radius: 48rpx;
  97. &-header {
  98. justify-content: space-between;
  99. padding: 24rpx 40rpx 20rpx 40rpx;
  100. .title {
  101. font-size: 32rpx;
  102. font-weight: 600;
  103. color: #000000;
  104. }
  105. .btn-question {
  106. margin-top: 4rpx;
  107. column-gap: 8rpx;
  108. font-size: 26rpx;
  109. color: #21607D;
  110. .btn-icon {
  111. width: 32rpx;
  112. height: auto;
  113. }
  114. }
  115. .btn-switch {
  116. padding: 6rpx 22rpx;
  117. font-size: 28rpx;
  118. font-weight: 400;
  119. line-height: 1.4;
  120. color: #252545;
  121. border: 2rpx solid #252545;
  122. border-radius: 28rpx;
  123. }
  124. .btn-add {
  125. padding: 8rpx 24rpx;
  126. font-size: 28rpx;
  127. font-weight: 500;
  128. line-height: 1.4;
  129. color: #FFFFFF;
  130. background: linear-gradient(to right, #21FEEC, #019AF9);
  131. border-radius: 28rpx;
  132. }
  133. .btn + .btn {
  134. margin-left: 26rpx;
  135. }
  136. }
  137. &-content {
  138. padding: 38rpx 38rpx 14rpx 38rpx;
  139. background: linear-gradient(to right, #FBFEFF, #DAF3FF);
  140. border: 2rpx solid #FFFFFF;
  141. border-radius: 48rpx;
  142. box-shadow: 0 2px 12px 0 #009AE717;
  143. .info {
  144. column-gap: 24rpx;
  145. .avatar {
  146. flex: none;
  147. position: relative;
  148. width: 128rpx;
  149. height: 128rpx;
  150. border-radius: 24rpx;
  151. overflow: hidden;
  152. .img {
  153. width: 100%;
  154. height: 100%;
  155. }
  156. }
  157. .summary {
  158. flex: 1;
  159. column-gap: 26rpx;
  160. &-item {
  161. flex: 1;
  162. row-gap: 8rpx;
  163. &.name {
  164. flex: none;
  165. }
  166. &-content {
  167. font-size: 32rpx;
  168. font-weight: 600;
  169. color: #000000;
  170. }
  171. &-label {
  172. font-size: 24rpx;
  173. color: #939393;
  174. }
  175. }
  176. }
  177. }
  178. .medal {
  179. margin-top: 16rpx;
  180. justify-content: flex-start;
  181. flex-wrap: wrap;
  182. gap: 16rpx;
  183. &-item {
  184. width: 50rpx;
  185. height: auto;
  186. }
  187. }
  188. }
  189. }
  190. .nowrap {
  191. white-space: nowrap;
  192. }
  193. </style>