| | |
| | | <template> |
| | | <view class="container"> |
| | | <div class="avatarBox"> |
| | | <u-avatar @click="uploadAvatar" :src="userInfo.avatar" size="114" mode="aspectFill" /> |
| | | <!-- @click="uploadAvatar" --> |
| | | <u-avatar :src="userInfo.avatar" size="114" mode="aspectFill" /> |
| | | </div> |
| | | <view class="detailBox"> |
| | | <div class="detailCon"> |
| | | <div class="orderRow"> |
| | | <div class="rowTitle">姓名</div> |
| | | <div>{{userInfo.realName}}</div> |
| | | </div> |
| | | <div class="rowTitle">姓名</div> |
| | | <u-input input-align="right" v-model="userInfo.nickName" placeholder="请输入姓名" class="input-item" /> |
| | | </div> |
| | | <div class="orderRow"> |
| | | <div class="rowTitle">所属单位</div> |
| | | <div>{{userInfo.deptName}}</div> |
| | | </div> |
| | | <div class="orderRow"> |
| | | <div class="rowTitle">手机号</div> |
| | | <u-input input-align="right" v-model="userInfo.phone" type="number" placeholder="请输入手机号" |
| | | class="input-item" /> |
| | | <div>{{userInfo.phone}}</div> |
| | | <!-- <u-input input-align="right" v-model="userInfo.phone" type="number" placeholder="请输入手机号" |
| | | class="input-item" /> --> |
| | | |
| | | </div> |
| | | <div class="orderRow"> |
| | | <div class="rowTitle">邮箱</div> |
| | | <u-input input-align="right" v-model="userInfo.email" type="email" placeholder="请输入邮箱" |
| | | class="input-item" /> |
| | | <div>{{userInfo.email}}</div> |
| | | <!-- <u-input input-align="right" v-model="userInfo.email" type="email" placeholder="请输入邮箱" |
| | | class="input-item" /> --> |
| | | </div> |
| | | </div> |
| | | </view> |
| | |
| | | getEnvObj, |
| | | getWebViewUrl |
| | | } from "@/utils/index.js"; |
| | | import { |
| | | getUserInfo, |
| | | updateInfo, |
| | | updatePassword |
| | | } from '@/api/user/index.js'; |
| | | import { |
| | | useUserStore |
| | | } from "@/store/index.js"; |
| | | const userInfo = ref({ |
| | | id: '', |
| | | import { getUserInfo, updateInfo, updatePassword } from '@/api/user/index.js'; |
| | | import { useUserStore } from "@/store/index.js"; |
| | | const userInfo = ref({ |
| | | userId: '', |
| | | avatar: '', |
| | | realName: '', |
| | | name: '', |
| | | nickName: '', |
| | | phone: '', |
| | | email: '', |
| | | deptName: '', |
| | |
| | | getUserInfo().then(res => { |
| | | const user = res.data.data; |
| | | userInfo.value = { |
| | | id: user.id, |
| | | userId: user.userId, |
| | | avatar: user.avatar, |
| | | name: user.name, |
| | | realName: user.realName, |
| | | phone: user.phone, |
| | | email: user.email, |
| | | deptName: user.deptName, |
| | | nickName: user.nickName, |
| | | phone: user.sysDept.phone, |
| | | email: user.sysDept.email, |
| | | deptName: user.sysDept.deptName, |
| | | }; |
| | | |
| | | }); |
| | |
| | | const pathWithoutProtocol = filePath.replace(/^file:\/\//, ''); |
| | | fileName = pathWithoutProtocol.split('/').pop() || 'unknown.png'; |
| | | } |
| | | |
| | | |
| | | // 显示加载中 |
| | | uni.showLoading({ |
| | | title: '上传中...' |
| | |
| | | |
| | | // 上传文件 |
| | | uploadUtil({ |
| | | filePath: filePath, |
| | | filePath: filePath, |
| | | formData: { |
| | | fileName: fileName, |
| | | fileName: fileName, |
| | | sn: 'avatar_upload' |
| | | }, |
| | | url: '/blade-resource/oss/endpoint/put-file' |
| | |
| | | } |
| | | const submit = () => { |
| | | if (!validatePhone() || !validateEmail()) return |
| | | userInfo.value.name = userInfo.value.realName; |
| | | updateInfo(userInfo.value).then(res => { |
| | | if (res.data.code === 200) { |
| | | uni.showToast({ |
| | |
| | | } |
| | | |
| | | }); |
| | | |
| | | |
| | | }; |
| | | onShow(async () => { |
| | | getUserInfoData() |
| | |
| | | white-space: nowrap; |
| | | } |
| | | |
| | | ::v-deep .u-input { |
| | | :deep(.u-input) { |
| | | border: none !important; |
| | | background: transparent !important; |
| | | padding: 0 !important; |
| | | } |
| | | |
| | | ::v-deep .u-input__input { |
| | | :deep(.u-input__input) { |
| | | border: none !important; |
| | | box-shadow: none !important; |
| | | background: transparent !important; |
| | |
| | | width: 276rpx !important; |
| | | height: 76rpx !important; |
| | | } |
| | | </style> |
| | | </style> |