myMsg.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. <template>
  2. <view class="container">
  3. <view class="box">
  4. <!-- 编号区域 -->
  5. <view class="box_item">
  6. <view class="item_key">编号</view>
  7. <view class="item_value">{{ userInfo.cardNo || '暂无' }}</view>
  8. </view>
  9. <!-- 姓名区域 -->
  10. <view class="box_item">
  11. <view class="item_key">姓名</view>
  12. <view class="item_value">{{ userInfo.name }}</view>
  13. </view>
  14. <!-- 身份区域 -->
  15. <view class="box_item">
  16. <view class="item_key">身份</view>
  17. <view class="item_value" v-if="userInfo.identityId == 1">家长</view>
  18. <view class="item_value" v-if="userInfo.identityId == 2">学生</view>
  19. <view class="item_value" v-if="userInfo.identityId == 3">教师</view>
  20. </view>
  21. <!-- 身份证区域 -->
  22. <view class="box_item">
  23. <view class="item_key">身份证</view>
  24. <view class="item_value">{{ userInfo.idCard ? userInfo.idCard : '暂无' }}</view>
  25. </view>
  26. <!-- 性别区域 -->
  27. <view class="box_item">
  28. <view class="item_key">性别</view>
  29. <view class="item_value">{{ userInfo.sexId == 0 ? '女' : '男' }}</view>
  30. </view>
  31. <!-- 部门区域 -->
  32. <view class="box_item">
  33. <view class="item_key">部门</view>
  34. <view class="item_value">{{ userInfo.departmentName || '暂无' }}</view>
  35. </view>
  36. <!-- 角色区域 -->
  37. <view class="box_item">
  38. <view class="item_key">角色</view>
  39. <view class="item_value">暂无</view>
  40. </view>
  41. <!-- 人脸照片区域 -->
  42. <view class="box_item no_border">
  43. <view class="item_key">人脸照片</view>
  44. <view class="item_value" v-if="userInfo.headImage" @click="previewImage(userInfo.headImage)">
  45. <img class="img" mode="aspectFill" :src="userInfo.headImage" />
  46. </view>
  47. <view class="item_value" v-else>暂无</view>
  48. </view>
  49. </view>
  50. <view class="box">
  51. <!-- 年级区域 -->
  52. <view class="box_item">
  53. <view class="item_key">年级</view>
  54. <view class="item_value">
  55. {{ userInfo.grade ? userInfo.grade : '暂无' }}
  56. <!-- <img class="value_img" src="../../static/images/right.png" /> -->
  57. </view>
  58. </view>
  59. <!-- 学院区域 -->
  60. <view class="box_item">
  61. <view class="item_key">学院</view>
  62. <view class="item_value">
  63. {{ userInfo.college ? userInfo.college : '暂无' }}
  64. <!-- <img class="value_img" src="../../static/images/right.png" /> -->
  65. </view>
  66. </view>
  67. <!-- 班级区域 -->
  68. <view class="box_item no_border">
  69. <view class="item_key">班级</view>
  70. <view class="item_value">
  71. {{ userInfo.school_class ? userInfo.school_class : '暂无' }}
  72. <!-- <img class="value_img" src="../../static/images/right.png" /> -->
  73. </view>
  74. </view>
  75. </view>
  76. <view class="box">
  77. <!-- 校区区域 -->
  78. <view class="box_item">
  79. <view class="item_key">校区</view>
  80. <view class="item_value">
  81. {{ userInfo.campus ? userInfo.campus : '暂无' }}
  82. </view>
  83. </view>
  84. <!-- 宿舍号区域 -->
  85. <view class="box_item">
  86. <view class="item_key">宿舍号</view>
  87. <view class="item_value">
  88. {{ userInfo.dormitoryNumber ? userInfo.dormitoryNumber : '暂无' }}
  89. </view>
  90. </view>
  91. <!-- 手机号区域 -->
  92. <view class="box_item no_border">
  93. <view class="item_key">手机号</view>
  94. <view class="item_value" @click="handleEditPhone">
  95. {{ userInfo.phone ? userInfo.phone : '暂无' }}
  96. <img class="value_img" src="@/static/images/right.png" />
  97. </view>
  98. </view>
  99. </view>
  100. <view class="box">
  101. <!-- 关联人区域 -->
  102. <view class="box_item">
  103. <view class="item_key">关联人</view>
  104. <view class="item_value">{{ userInfo.affiliateName ? userInfo.affiliateName : '暂无' }}</view>
  105. </view>
  106. <!-- 职称区域 -->
  107. <view class="box_item">
  108. <view class="item_key">职称</view>
  109. <view class="item_value">
  110. {{ userInfo.title ? userInfo.title : '暂无' }}
  111. </view>
  112. </view>
  113. <!-- 家庭地址区域 -->
  114. <view class="box_item">
  115. <view class="item_key">家庭地址</view>
  116. <view class="item_value">
  117. {{ userInfo.address ? userInfo.address : '暂无' }}
  118. </view>
  119. </view>
  120. <!-- 民族区域 -->
  121. <view class="box_item">
  122. <view class="item_key">民族</view>
  123. <view class="item_value">
  124. {{ userInfo.nation ? userInfo.nation : '暂无' }}
  125. </view>
  126. </view>
  127. <!-- 生源地区域 -->
  128. <view class="box_item">
  129. <view class="item_key">生源地</view>
  130. <view class="item_value">
  131. {{ userInfo.ofStudent ? userInfo.ofStudent : '暂无' }}
  132. </view>
  133. </view>
  134. <!-- 毕业学校区域 -->
  135. <view class="box_item">
  136. <view class="item_key">毕业学校</view>
  137. <view class="item_value">{{ userInfo.graduate ? userInfo.graduate : '暂无' }}</view>
  138. </view>
  139. <!-- 职务区域 -->
  140. <view class="box_item no_border">
  141. <view class="item_key">职务</view>
  142. <view class="item_value">{{ userInfo.zhiwu ? userInfo.zhiwu : '暂无' }}</view>
  143. </view>
  144. </view>
  145. </view>
  146. </template>
  147. <script setup>
  148. import { ref } from 'vue'
  149. import { onLoad, onShow } from '@dcloudio/uni-app'
  150. import { previewImage } from '@/utils/previewImage.js'
  151. import { myRequest } from '@/utils/api.js'
  152. import { decryptDes } from '@/utils/des.js'
  153. // 用户信息
  154. const userInfo = ref({})
  155. // 页面类型 1孩子信息 2登录账号信息
  156. const type = ref()
  157. onLoad((options) => {
  158. if (options.id) {
  159. type.value = 1
  160. getUserInfo(options.id)
  161. } else {
  162. type.value = 2
  163. userInfo.value = uni.getStorageSync('userInfo')
  164. }
  165. })
  166. onShow(() => {
  167. if (type.value === 2) {
  168. userInfo.value = uni.getStorageSync('userInfo')
  169. }
  170. })
  171. const getUserInfo = async (id) => {
  172. const res = await myRequest({
  173. url: '/wanzai/api/smartUser/queryInfoData',
  174. data: {
  175. id
  176. }
  177. })
  178. // console.log(res)
  179. const result = JSON.parse(decryptDes(res.data))
  180. userInfo.value = result
  181. }
  182. // 点击手机号码触发的回调
  183. const handleEditPhone = () => {
  184. uni.navigateTo({
  185. url: '/pages/editPhone/editPhone'
  186. })
  187. }
  188. </script>
  189. <style lang="scss" scoped>
  190. .container {
  191. display: flex;
  192. flex-direction: column;
  193. box-sizing: border-box;
  194. padding-bottom: 10rpx;
  195. min-height: 100vh;
  196. background-color: #f1f6fe;
  197. .box {
  198. margin-top: 20rpx;
  199. padding: 0 18rpx;
  200. background-color: #fff;
  201. .box_item {
  202. display: flex;
  203. justify-content: space-between;
  204. align-items: center;
  205. height: 85rpx;
  206. font-size: 28rpx;
  207. border-bottom: 1rpx solid #e6e6e6;
  208. .item_key {
  209. font-weight: bold;
  210. }
  211. .item_value {
  212. display: flex;
  213. align-items: center;
  214. color: #808080;
  215. .img {
  216. width: 65rpx;
  217. height: 65rpx;
  218. border-radius: 50%;
  219. }
  220. .value_img {
  221. margin-left: 10rpx;
  222. width: 31rpx;
  223. height: 31rpx;
  224. }
  225. }
  226. }
  227. .no_border {
  228. border: none;
  229. }
  230. }
  231. }
  232. </style>