| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251 |
- <template>
- <view class="container">
- <view class="box">
- <!-- 编号区域 -->
- <view class="box_item">
- <view class="item_key">编号</view>
- <view class="item_value">{{ userInfo.cardNo || '暂无' }}</view>
- </view>
- <!-- 姓名区域 -->
- <view class="box_item">
- <view class="item_key">姓名</view>
- <view class="item_value">{{ userInfo.name }}</view>
- </view>
- <!-- 身份区域 -->
- <view class="box_item">
- <view class="item_key">身份</view>
- <view class="item_value" v-if="userInfo.identityId == 1">家长</view>
- <view class="item_value" v-if="userInfo.identityId == 2">学生</view>
- <view class="item_value" v-if="userInfo.identityId == 3">教师</view>
- </view>
- <!-- 身份证区域 -->
- <view class="box_item">
- <view class="item_key">身份证</view>
- <view class="item_value">{{ userInfo.idCard ? userInfo.idCard : '暂无' }}</view>
- </view>
- <!-- 性别区域 -->
- <view class="box_item">
- <view class="item_key">性别</view>
- <view class="item_value">{{ userInfo.sexId == 0 ? '女' : '男' }}</view>
- </view>
- <!-- 部门区域 -->
- <view class="box_item">
- <view class="item_key">部门</view>
- <view class="item_value">{{ userInfo.departmentName || '暂无' }}</view>
- </view>
- <!-- 角色区域 -->
- <view class="box_item">
- <view class="item_key">角色</view>
- <view class="item_value">暂无</view>
- </view>
- <!-- 人脸照片区域 -->
- <view class="box_item no_border">
- <view class="item_key">人脸照片</view>
- <view class="item_value" v-if="userInfo.headImage" @click="previewImage(userInfo.headImage)">
- <img class="img" mode="aspectFill" :src="userInfo.headImage" />
- </view>
- <view class="item_value" v-else>暂无</view>
- </view>
- </view>
- <view class="box">
- <!-- 年级区域 -->
- <view class="box_item">
- <view class="item_key">年级</view>
- <view class="item_value">
- {{ userInfo.grade ? userInfo.grade : '暂无' }}
- <!-- <img class="value_img" src="../../static/images/right.png" /> -->
- </view>
- </view>
- <!-- 学院区域 -->
- <view class="box_item">
- <view class="item_key">学院</view>
- <view class="item_value">
- {{ userInfo.college ? userInfo.college : '暂无' }}
- <!-- <img class="value_img" src="../../static/images/right.png" /> -->
- </view>
- </view>
- <!-- 班级区域 -->
- <view class="box_item no_border">
- <view class="item_key">班级</view>
- <view class="item_value">
- {{ userInfo.school_class ? userInfo.school_class : '暂无' }}
- <!-- <img class="value_img" src="../../static/images/right.png" /> -->
- </view>
- </view>
- </view>
- <view class="box">
- <!-- 校区区域 -->
- <view class="box_item">
- <view class="item_key">校区</view>
- <view class="item_value">
- {{ userInfo.campus ? userInfo.campus : '暂无' }}
- </view>
- </view>
- <!-- 宿舍号区域 -->
- <view class="box_item">
- <view class="item_key">宿舍号</view>
- <view class="item_value">
- {{ userInfo.dormitoryNumber ? userInfo.dormitoryNumber : '暂无' }}
- </view>
- </view>
- <!-- 手机号区域 -->
- <view class="box_item no_border">
- <view class="item_key">手机号</view>
- <view class="item_value" @click="handleEditPhone">
- {{ userInfo.phone ? userInfo.phone : '暂无' }}
- <img class="value_img" src="@/static/images/right.png" />
- </view>
- </view>
- </view>
- <view class="box">
- <!-- 关联人区域 -->
- <view class="box_item">
- <view class="item_key">关联人</view>
- <view class="item_value">{{ userInfo.affiliateName ? userInfo.affiliateName : '暂无' }}</view>
- </view>
- <!-- 职称区域 -->
- <view class="box_item">
- <view class="item_key">职称</view>
- <view class="item_value">
- {{ userInfo.title ? userInfo.title : '暂无' }}
- </view>
- </view>
- <!-- 家庭地址区域 -->
- <view class="box_item">
- <view class="item_key">家庭地址</view>
- <view class="item_value">
- {{ userInfo.address ? userInfo.address : '暂无' }}
- </view>
- </view>
- <!-- 民族区域 -->
- <view class="box_item">
- <view class="item_key">民族</view>
- <view class="item_value">
- {{ userInfo.nation ? userInfo.nation : '暂无' }}
- </view>
- </view>
- <!-- 生源地区域 -->
- <view class="box_item">
- <view class="item_key">生源地</view>
- <view class="item_value">
- {{ userInfo.ofStudent ? userInfo.ofStudent : '暂无' }}
- </view>
- </view>
- <!-- 毕业学校区域 -->
- <view class="box_item">
- <view class="item_key">毕业学校</view>
- <view class="item_value">{{ userInfo.graduate ? userInfo.graduate : '暂无' }}</view>
- </view>
- <!-- 职务区域 -->
- <view class="box_item no_border">
- <view class="item_key">职务</view>
- <view class="item_value">{{ userInfo.zhiwu ? userInfo.zhiwu : '暂无' }}</view>
- </view>
- </view>
- </view>
- </template>
- <script setup>
- import { ref } from 'vue'
- import { onLoad, onShow } from '@dcloudio/uni-app'
- import { previewImage } from '@/utils/previewImage.js'
- import { myRequest } from '@/utils/api.js'
- import { decryptDes } from '@/utils/des.js'
- // 用户信息
- const userInfo = ref({})
- // 页面类型 1孩子信息 2登录账号信息
- const type = ref()
- onLoad((options) => {
- if (options.id) {
- type.value = 1
- getUserInfo(options.id)
- } else {
- type.value = 2
- userInfo.value = uni.getStorageSync('userInfo')
- }
- })
- onShow(() => {
- if (type.value === 2) {
- userInfo.value = uni.getStorageSync('userInfo')
- }
- })
- const getUserInfo = async (id) => {
- const res = await myRequest({
- url: '/wanzai/api/smartUser/queryInfoData',
- data: {
- id
- }
- })
- // console.log(res)
- const result = JSON.parse(decryptDes(res.data))
- userInfo.value = result
- }
- // 点击手机号码触发的回调
- const handleEditPhone = () => {
- uni.navigateTo({
- url: '/pages/editPhone/editPhone'
- })
- }
- </script>
- <style lang="scss" scoped>
- .container {
- display: flex;
- flex-direction: column;
- box-sizing: border-box;
- padding-bottom: 10rpx;
- min-height: 100vh;
- background-color: #f1f6fe;
- .box {
- margin-top: 20rpx;
- padding: 0 18rpx;
- background-color: #fff;
- .box_item {
- display: flex;
- justify-content: space-between;
- align-items: center;
- height: 85rpx;
- font-size: 28rpx;
- border-bottom: 1rpx solid #e6e6e6;
- .item_key {
- font-weight: bold;
- }
- .item_value {
- display: flex;
- align-items: center;
- color: #808080;
- .img {
- width: 65rpx;
- height: 65rpx;
- border-radius: 50%;
- }
- .value_img {
- margin-left: 10rpx;
- width: 31rpx;
- height: 31rpx;
- }
- }
- }
- .no_border {
- border: none;
- }
- }
- }
- </style>
|