student.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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 class="box_img" src="../../static/images/user-photo.png" />
  9. <view class="box_info">
  10. <view class="info_name">李商隐</view>
  11. <view class="info_phone">13677985689</view>
  12. </view>
  13. <view class="box_btn" @click="callPhone">呼叫</view>
  14. </view>
  15. <!-- 家长信息区域 -->
  16. <view class="identity">家长</view>
  17. <view class="box mb-50" v-for="item in familyList" :key="item.id">
  18. <img class="box_img" src="../../static/images/user-photo.png" />
  19. <view class="box_info">
  20. <view class="info_name">
  21. {{ item.name }}
  22. <view class="info_type">{{ item.identity }}</view>
  23. </view>
  24. <view class="info_phone">{{ item.phone }}</view>
  25. </view>
  26. <view class="box_btn" @click="callPhone">呼叫</view>
  27. </view>
  28. </view>
  29. </template>
  30. <script setup>
  31. import { ref } from 'vue'
  32. import { onLoad } from '@dcloudio/uni-app'
  33. const familyList = ref([
  34. {
  35. id: 1,
  36. url: '',
  37. name: '李白',
  38. phone: '13677985689',
  39. identity: '父亲'
  40. },
  41. {
  42. id: 2,
  43. url: '',
  44. name: '李白白',
  45. phone: '13677985689',
  46. identity: '母亲'
  47. },
  48. {
  49. id: 3,
  50. url: '',
  51. name: '李桃桃',
  52. phone: '13677985689',
  53. identity: '叔叔'
  54. }
  55. ])
  56. // 点击呼叫按钮回调
  57. const callPhone = () => {
  58. console.log(666)
  59. }
  60. </script>
  61. <style lang="scss" scoped>
  62. .container {
  63. display: flex;
  64. flex-direction: column;
  65. padding: 0 20rpx;
  66. min-height: 100vh;
  67. background-color: #f1f6fe;
  68. // 背景图片区域样式
  69. .img_bg {
  70. position: absolute;
  71. top: -70rpx;
  72. right: -32rpx;
  73. width: 589rpx;
  74. height: 320rpx;
  75. pointer-events: none;
  76. }
  77. .identity {
  78. margin: 20rpx 0 40rpx 0;
  79. color: #808080;
  80. font-size: 28rpx;
  81. }
  82. .box {
  83. display: flex;
  84. margin-bottom: 30rpx;
  85. height: 120rpx;
  86. .box_img {
  87. width: 120rpx;
  88. height: 120rpx;
  89. border-radius: 50%;
  90. }
  91. .box_info {
  92. display: flex;
  93. flex-direction: column;
  94. justify-content: space-evenly;
  95. margin-left: 22rpx;
  96. .info_name {
  97. display: flex;
  98. align-items: center;
  99. font-size: 32rpx;
  100. .info_type {
  101. margin-left: 15rpx;
  102. padding: 0 14rpx;
  103. height: 37rpx;
  104. line-height: 37rpx;
  105. font-size: 20rpx;
  106. color: #0061ff;
  107. border: 1rpx solid #0061ff;
  108. border-radius: 6rpx;
  109. background-color: #d9e7ff;
  110. }
  111. }
  112. .info_phone {
  113. color: #808080;
  114. font-size: 28rpx;
  115. }
  116. }
  117. .box_btn {
  118. display: flex;
  119. justify-content: center;
  120. align-items: center;
  121. align-self: center;
  122. margin-left: auto;
  123. width: 140rpx;
  124. height: 68rpx;
  125. color: #fff;
  126. font-size: 28rpx;
  127. border-radius: 10rpx;
  128. background-color: #0061ff;
  129. }
  130. }
  131. .mb-50 {
  132. margin-bottom: 50rpx;
  133. }
  134. }
  135. </style>