childinfo.vue 5.0 KB

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