childinfo.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. <template>
  2. <view class="page-view">
  3. <top-return text="孩子名片" color="#FFF"></top-return>
  4. <view class="detail-image"
  5. :style="{backgroundImage:`linear-gradient(to top, #f3f4f9, rgba(255, 255, 255, 0) 60%),url(${image})`}"></view>
  6. <!-- 孩子头部信息 -->
  7. <view class="top-info">
  8. <image class="top-avatar" v-if="childInfo.avatar === '默认'"
  9. :src="childInfo.gender==='男'?'/static/default_icons/boy_avatar.svg':'/static/default_icons/girl_avatar.svg'">
  10. </image>
  11. <image class="top-avatar" v-if="childInfo.avatar != '默认'" :src="childInfo.avatar"></image>
  12. <view class="top-name">
  13. <view class="flex-baseline">
  14. <text class="name">{{childInfo.name}}</text>
  15. <view class="tag-fill"
  16. style="margin-left: 30rpx;">
  17. <view class="t-icon t-icon-xueshengziliao"></view>
  18. <view class="tag-text" style="color: #4169E1;font-size: 28rpx;">{{childInfo.gender}}</view>
  19. </view>
  20. <view class="tag-fill"
  21. style="margin-left: 10rpx;">
  22. <view class="t-icon t-icon-nongyekeji2">
  23. </view>
  24. <view class="tag-text" style="color: #4169E1;font-size: 28rpx;">{{childInfo.age}}岁</view>
  25. </view>
  26. </view>
  27. <view class="tag-fill">
  28. <view class="t-icon t-icon-xuewei1"></view>
  29. <view class="tag-text" style="color: #4169E1;font-size: 28rpx;">{{childInfo.tmdid}} 绑定学号</view>
  30. </view>
  31. </view>
  32. </view>
  33. <!-- 卡片信息 -->
  34. <view class="main-card">
  35. <view class="flex-row">
  36. <view class="t-icon t-icon-biaoqian"></view>
  37. <view class="flex-column">
  38. <view class="subtitle">就读学校</view>
  39. <view class="title" style="margin-top: 10rpx;">{{childInfo.school}}</view>
  40. </view>
  41. </view>
  42. <view class="flex-row" style="margin-top: 50rpx;">
  43. <view class="t-icon t-icon-fenlei1"></view>
  44. <view class="flex-column">
  45. <view class="subtitle">所在班级</view>
  46. <view class="title">{{childInfo.class}}</view>
  47. </view>
  48. </view>
  49. <view class="flex-row" style="margin-top: 50rpx;">
  50. <view class="t-icon t-icon-jiaoyu"></view>
  51. <view class="flex-column">
  52. <view class="subtitle">当前学期</view>
  53. <view class="title">{{childInfo.semester}}</view>
  54. </view>
  55. </view>
  56. <view class="card-view" style="margin-top: 40rpx;">
  57. <view class="flex-column-box" style="margin:0 auto 0 -40rpx;">
  58. <view class="column-title">勋章卡片</view>
  59. <view class="bottom-tag"></view>
  60. </view>
  61. </view>
  62. <u-avatar-group :urls="medals" size="40" gap="0.2"></u-avatar-group>
  63. </view>
  64. </view>
  65. </template>
  66. <script>
  67. import {
  68. mapState
  69. } from 'vuex'
  70. export default {
  71. computed: {
  72. ...mapState('m_parent', ['childrenData']),
  73. },
  74. data() {
  75. return {
  76. image: 'https://image.meiye.art/pic_1628493302098',
  77. medals: [
  78. ],
  79. childInfo: ''
  80. };
  81. },
  82. onLoad(param) {
  83. this.childInfo = this.childrenData[param.index]
  84. },
  85. methods: {
  86. updateAvatar() {
  87. uni.chooseImage({
  88. count: 1, //默认1个图片
  89. sourceType: ['album'], //从相册选择
  90. success: function(res) {
  91. console.log(JSON.stringify(res.tempFilePaths));
  92. }
  93. })
  94. },
  95. },
  96. }
  97. </script>
  98. <style lang="scss">
  99. .flex-column {
  100. height: 80rpx;
  101. justify-content: space-between;
  102. }
  103. .detail-image {
  104. position: fixed;
  105. width: 100%;
  106. height: 800rpx;
  107. }
  108. .top-info {
  109. display: flex;
  110. align-items: center;
  111. margin-top: 180rpx;
  112. .top-avatar {
  113. margin-left: 50rpx;
  114. width: 140rpx;
  115. height: 140rpx;
  116. border-radius: 100%;
  117. border: 6rpx solid #FFF;
  118. box-shadow: 0 10rpx 20rpx rgba(0, 0, 0, 0.2);
  119. z-index: 55;
  120. }
  121. .top-name {
  122. margin-left: 50rpx;
  123. height: 130rpx;
  124. display: flex;
  125. flex-direction: column;
  126. justify-content: space-around;
  127. font-weight: bold;
  128. .name {
  129. color: $title;
  130. font-size: 45rpx;
  131. font-weight: bold;
  132. z-index: 55;
  133. }
  134. .t-icon{
  135. width: 32rpx;
  136. height: 32rpx;
  137. margin-right: 5rpx;
  138. }
  139. }
  140. }
  141. .main-card {
  142. display: flex;
  143. flex-direction: column;
  144. padding: 80rpx;
  145. position: relative;
  146. background-color: #FFF;
  147. top: 80rpx;
  148. left: 50rpx;
  149. border-radius: 50rpx;
  150. z-index: 55;
  151. .title {
  152. line-height: 32rpx;
  153. font-size: 32rpx;
  154. font-weight: 400;
  155. color: $title;
  156. }
  157. .subtitle {
  158. line-height: 28rpx;
  159. font-size: 28rpx;
  160. color: $subtitle;
  161. font-weight: 400;
  162. }
  163. .t-icon {
  164. margin-right: 30rpx;
  165. width: 80rpx;
  166. height: 80rpx;
  167. }
  168. }
  169. .box_title {
  170. line-height: 35rpx;
  171. font-size: 35rpx;
  172. font-weight: bold;
  173. color: $title;
  174. }
  175. .flex-column-box {
  176. display: flex;
  177. flex-direction: column;
  178. .column-title {
  179. line-height: 35rpx;
  180. font-size: 32rpx;
  181. font-weight: bold;
  182. color: $title;
  183. }
  184. }
  185. .tag-fill{
  186. background-color: #d8deff;
  187. width:fit-content;
  188. z-index: 99;
  189. }
  190. </style>