student.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. <template>
  2. <view class="container">
  3. <!-- 背景图片区域 -->
  4. <img class="img_bg" src="../../static/images/center-bg.png" />
  5. <!-- 学生信息区域 -->
  6. <view class="identity">学生</view>
  7. <view class="box">
  8. <img
  9. class="box_img"
  10. mode="aspectFill"
  11. :src="msg.headImage || msg.student?.headImage || '../../static/images/user-photo.png'"
  12. @click="previewImage(msg.headImage || msg.student?.headImage || '../../static/images/user-photo.png')"
  13. />
  14. <view class="box_info">
  15. <view class="info_name">{{ msg.name || msg.student?.name }}</view>
  16. <view class="info_phone">{{ msg.cardNo || msg.student?.cardNo }}</view>
  17. </view>
  18. </view>
  19. <!-- 家长信息区域 -->
  20. <view class="identity">家长</view>
  21. <view class="box mb-50" v-for="item in msg.userParents || msg.patriarch" :key="item.id">
  22. <img
  23. class="box_img"
  24. mode="aspectFill"
  25. :src="item.headImage || 'https://wanzai-1306339220.cos.ap-shanghai.myqcloud.com/excelModel/nupp7VVnHWpVa413437dba82ce85374b2a4ee1a6b973.png'"
  26. @click="previewImage(item.headImage || 'https://wanzai-1306339220.cos.ap-shanghai.myqcloud.com/excelModel/nupp7VVnHWpVa413437dba82ce85374b2a4ee1a6b973.png')"
  27. />
  28. <view class="box_info">
  29. <view class="info_name">
  30. {{ item.name }}
  31. <view class="info_type">家长</view>
  32. </view>
  33. <view class="info_phone">{{ item.phone }}</view>
  34. </view>
  35. <view class="box_btn" @click="callPhone(item.phone)">呼叫</view>
  36. </view>
  37. <NoData v-if="!msg.userParents?.length && !msg.patriarch?.length" />
  38. </view>
  39. </template>
  40. <script setup>
  41. import { ref } from 'vue'
  42. import { onLoad } from '@dcloudio/uni-app'
  43. import { previewImage } from '@/utils/previewImage.js'
  44. import NoData from '@/components/noData.vue'
  45. onLoad((options) => {
  46. msg.value = JSON.parse(decodeURIComponent(options.msg))
  47. uni.setNavigationBarTitle({
  48. title: msg.value.name || msg.value.student?.name
  49. })
  50. })
  51. const msg = ref({})
  52. // 点击呼叫按钮回调
  53. const callPhone = (phoneNumber) => {
  54. uni.makePhoneCall({
  55. phoneNumber
  56. })
  57. }
  58. </script>
  59. <style lang="scss" scoped>
  60. .container {
  61. display: flex;
  62. flex-direction: column;
  63. padding: 0 20rpx;
  64. min-height: 100vh;
  65. background-color: #f1f6fe;
  66. // 背景图片区域样式
  67. .img_bg {
  68. position: absolute;
  69. top: -70rpx;
  70. right: 0;
  71. width: 589rpx;
  72. height: 320rpx;
  73. pointer-events: none;
  74. }
  75. .identity {
  76. margin: 20rpx 0 40rpx 0;
  77. color: #808080;
  78. font-size: 28rpx;
  79. }
  80. .box {
  81. display: flex;
  82. margin-bottom: 30rpx;
  83. height: 120rpx;
  84. .box_img {
  85. width: 120rpx;
  86. height: 120rpx;
  87. border-radius: 50%;
  88. }
  89. .box_info {
  90. display: flex;
  91. flex-direction: column;
  92. justify-content: space-evenly;
  93. margin-left: 22rpx;
  94. .info_name {
  95. display: flex;
  96. align-items: center;
  97. font-size: 32rpx;
  98. .info_type {
  99. margin-left: 15rpx;
  100. padding: 0 14rpx;
  101. height: 37rpx;
  102. line-height: 37rpx;
  103. font-size: 20rpx;
  104. color: #0061ff;
  105. border: 1rpx solid #0061ff;
  106. border-radius: 6rpx;
  107. background-color: #d9e7ff;
  108. }
  109. }
  110. .info_phone {
  111. color: #808080;
  112. font-size: 28rpx;
  113. }
  114. }
  115. .box_btn {
  116. display: flex;
  117. justify-content: center;
  118. align-items: center;
  119. align-self: center;
  120. margin-left: auto;
  121. width: 140rpx;
  122. height: 68rpx;
  123. color: #fff;
  124. font-size: 28rpx;
  125. border-radius: 10rpx;
  126. background-color: #0061ff;
  127. }
  128. }
  129. .mb-50 {
  130. margin-bottom: 50rpx;
  131. }
  132. }
  133. </style>