childinfo.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  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)),url(${image})`}"></view>
  6. <!-- 孩子头部信息 -->
  7. <view class="top_info">
  8. <image class="top_avatar" v-if="childInfo.avatar === '默认'" :src="childInfo.gender==='男'?'/static/default_icons/boy_avatar.svg':'/static/default_icons/girl_avatar.svg'"></image>
  9. <image class="top_avatar" v-if="childInfo.avatar != '默认'" :src="childInfo.avatar"></image>
  10. <view class="top_name">
  11. <text class="name">{{childInfo.name}}</text>
  12. <text class="detail">{{childInfo.school}}</text>
  13. </view>
  14. </view>
  15. <!-- 卡片信息 -->
  16. <view class="main_card">
  17. <view class="flex_row">
  18. <view class="t-icon t-icon-baike"></view>
  19. <view class="flex_cloumn">
  20. <view class="subtitle">基础信息</view>
  21. <view class="title" style="margin-top: 10rpx;">性别 {{childInfo.gender}} 年龄 {{childInfo.age}}岁</view>
  22. </view>
  23. </view>
  24. <view class="flex_row" style="margin-top: 50rpx;">
  25. <view class="t-icon t-icon-tuandui1"></view>
  26. <view class="flex_cloumn">
  27. <view class="subtitle">孩子班级</view>
  28. <view class="title">{{childInfo.class}}</view>
  29. </view>
  30. </view>
  31. <view class="flex_row" style="margin-top: 50rpx;">
  32. <view class="t-icon t-icon-xuewei"></view>
  33. <view class="flex_cloumn">
  34. <view class="subtitle">学期信息</view>
  35. <view class="title">{{childInfo.semester}}</view>
  36. </view>
  37. </view>
  38. <view class="card_view" style="margin-top: 40rpx;">
  39. <view class="flex_cloumn_box" style="margin:0 auto 0 -40rpx;">
  40. <view class="cloumn_title">勋章卡片</view>
  41. <view class="bottom_tag"></view>
  42. </view>
  43. </view>
  44. <u-avatar-group :urls="medals" size="40" gap="0.2"></u-avatar-group>
  45. </view>
  46. </view>
  47. </template>
  48. <script>
  49. import {
  50. mapState
  51. } from 'vuex'
  52. export default {
  53. computed: {
  54. ...mapState('m_children', ['childInfo']),
  55. },
  56. data() {
  57. return {
  58. image: 'https://images.unsplash.com/photo-1648522102128-ef9759d8d27c?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=764&q=80',
  59. medals: [
  60. ]
  61. };
  62. },
  63. methods: {
  64. updateAvatar() {
  65. uni.chooseImage({
  66. count: 1, //默认1个图片
  67. sourceType: ['album'], //从相册选择
  68. success: function(res) {
  69. console.log(JSON.stringify(res.tempFilePaths));
  70. }
  71. })
  72. },
  73. },
  74. }
  75. </script>
  76. <style lang="scss">
  77. .flex_cloumn {
  78. display: flex;
  79. flex-direction: column;
  80. height: 80rpx;
  81. justify-content: space-between;
  82. }
  83. .page_view {
  84. display: flex;
  85. flex-direction: column;
  86. width: 100vw;
  87. height: 100vh;
  88. overflow: hidden;
  89. }
  90. .detail_image {
  91. position: fixed;
  92. width: 100%;
  93. height: 1000rpx;
  94. }
  95. .top_info {
  96. display: flex;
  97. align-items: center;
  98. margin-top: 180rpx;
  99. .top_avatar {
  100. margin-left: 50rpx;
  101. width: 140rpx;
  102. height: 140rpx;
  103. border-radius: 100%;
  104. border: 6rpx solid #FFF;
  105. box-shadow: 0 10rpx 20rpx rgba(0, 0, 0, 0.2);
  106. z-index: 55;
  107. }
  108. .top_name {
  109. margin-left: 50rpx;
  110. height: 130rpx;
  111. display: flex;
  112. flex-direction: column;
  113. justify-content: space-around;
  114. font-weight: bold;
  115. .name {
  116. color: $title;
  117. font-size: 45rpx;
  118. font-weight: bold;
  119. z-index: 55;
  120. }
  121. .detail {
  122. color: $subtitle;
  123. font-size: 32rpx;
  124. font-weight: bold;
  125. z-index: 55;
  126. }
  127. }
  128. }
  129. .main_card {
  130. display: flex;
  131. flex-direction: column;
  132. padding: 80rpx 80rpx 200rpx 80rpx;
  133. position: relative;
  134. background-color: #FFF;
  135. top: 80rpx;
  136. left: 50rpx;
  137. border-radius: 50rpx;
  138. height: 1200rpx;
  139. z-index: 55;
  140. .title {
  141. line-height: 32rpx;
  142. font-size: 32rpx;
  143. font-weight: 400;
  144. color: $title;
  145. }
  146. .subtitle {
  147. line-height: 28rpx;
  148. font-size: 28rpx;
  149. color: $subtitle;
  150. font-weight: 400;
  151. }
  152. .t-icon {
  153. margin-right: 30rpx;
  154. width: 80rpx;
  155. height: 80rpx;
  156. }
  157. }
  158. .box_title {
  159. line-height: 35rpx;
  160. font-size: 35rpx;
  161. font-weight: bold;
  162. color: $title;
  163. }
  164. .flex_cloumn_box{
  165. display:flex;
  166. flex-direction: column;
  167. .cloumn_title{
  168. line-height: 35rpx;
  169. font-size: 32rpx;
  170. font-weight: bold;
  171. color: $title;
  172. }
  173. .bottom_tag{
  174. margin-top: -10rpx;
  175. margin-left: 20%;
  176. height: 20rpx;
  177. width: 90%;
  178. border-radius: 6rpx;
  179. background-image: linear-gradient(to right, #4169E1, #FFF);
  180. z-index: -1;
  181. }
  182. }
  183. </style>