childinfo.vue 5.2 KB

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