123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301 |
- <template>
- <view>
- <scroll-view scroll-y class="page">
- <cu-custom bgColor="bg-gradual-pink" :isBack="true" >
- <block slot="backText">返回</block>
- <block slot="content">用户详情</block>
- <!-- <view slot="right" @tap="rightClick">编辑</view> -->
- </cu-custom>
-
- <view class="example-body " style="display: flex;justify-content: center; margin-top: 80rpx;">
- <uni-file-picker readonly :value="fileLists" :imageStyles="imageStyles" file-mediatype="image">
- </uni-file-picker>
-
- </view>
-
-
- <!-- list列表 -->
- <uni-card>
- <view class="cu-list menu">
- <!-- <view class="cu-item animation-slide-bottom" :style="[{animationDelay: '0.1s'}]">
- <view class="content">
- <text class="text-grey">头像</text>
- </view>
- <view class="action">
- <view class="cu-avatar round sm" :style="{backgroundImage: 'url(' + personalMsg.avatar + ')'}"></view>
- </view>
-
- </view> -->
- <view class="cu-item animation-slide-bottom" :style="[{animationDelay: '0.2s'}]">
- <view class="content">
- <text class="text-grey">姓名:</text>
- </view>
- <view class="action">
- <text class="text-grey">{{user.username}}</text>
- </view>
- </view>
- <view class="cu-item animation-slide-bottom" :style="[{animationDelay: '0.2s'}]">
- <view class="content">
- <text class="text-grey">单位名称:</text>
- </view>
- <view class="action">
- <text class="text-grey">{{user.companyname}}</text>
- </view>
- </view>
- <view class="cu-item animation-slide-bottom" :style="[{animationDelay: '0.2s'}]">
- <view class="content">
- <text class="text-grey">手机号:</text>
- </view>
- <view class="action">
- <text class="text-grey">{{user.number}}</text>
- </view>
- </view>
- <view class="cu-item animation-slide-bottom" :style="[{animationDelay: '0.2s'}]">
- <view class="content">
- <text class="text-grey">邮箱:</text>
- </view>
- <view class="action">
- <text class="text-grey">{{user.remark}}</text>
- </view>
- </view>
- <view class="cu-item animation-slide-bottom" :style="[{animationDelay: '0.2s'}]">
- <view class="content">
- <text class="text-grey">备注:</text>
- </view>
- <view class="action">
- <text class="text-grey">{{user.remark}}</text>
- </view>
- </view>
- <!-- <view class="cu-item animation-slide-bottom" :style="[{animationDelay: '0.3s'}]">
- <view class="content">
- <text class="text-grey">性别</text>
- </view>
- <view class="action">
- <text class="text-grey">{{personalMsg.sex}}</text>
- </view>
- </view> -->
- <!-- <view class="cu-item animation-slide-bottom" :style="[{animationDelay: '0.4s'}]">
- <view class="content">
- <text class="text-grey">生日</text>
- </view>
- <view class="action">
- <text class="text-grey">{{personalMsg.birthday}}</text>
- </view>
- </view> -->
- </view>
-
- <!-- <view class="cu-list menu">
- <view class="cu-item animation-slide-bottom" :style="[{animationDelay: '0.5s'}]">
- <view class="content">
- <text class="text-grey">对外信息展示</text>
- </view>
- <view class="action">
- <text class="text-grey">{{getSubStringText(personalMsg.realname+'@'+personalMsg.orgCode,11)}}</text>
- </view>
- </view>
- </view> -->
-
-
-
- <!-- <view class="cu-list menu">
- <view class="cu-item animation-slide-bottom" :style="[{animationDelay: '0.9s'}]">
- <view class="content">
- <text class="text-grey">手机</text>
- </view>
- <view class="action">
- <text class="text-grey">{{personalMsg.phone}}</text>
- </view>
- </view>
- <view class="cu-item animation-slide-bottom" :style="[{animationDelay: '1s'}]">
- <view class="content">
- <text class="text-grey">邮箱</text>
- </view>
- <view class="action">
- <text class="text-grey">{{personalMsg.email}}</text>
- </view>
- </view>
- </view> -->
- </uni-card>
-
- </scroll-view>
- </view>
- </template>
- <script>
- import { ACCESS_TOKEN,USER_NAME,USER_INFO } from "@/common/util/constants"
- import api from '@/api/api.js'
- export default {
- data() {
- return {
- imageStyles: {
- width: 84,
- height: 84,
- border: {
- radius: '50%'
- }
- },
- listStyles: {
- // 是否显示边框
- border: true,
- // 是否显示分隔线
- dividline: true,
- // 线条样式
- borderStyle: {
- width: 1,
- color: 'blue',
- style: 'dashed',
- radius: 2
- }
- },
- fileLists: [{
- //url: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/b7c7f970-517d-11eb-97b7-0dc4655d6e68.jpg',
- url:'/static/touxiang.jpg',
- extname: 'png',
- name: 'shuijiao.png'
- }],
- user:{
- companyname:'',
- number:'',
- username:'',
- },
- personalMsg:{
- avatar:'',
- realname:'',
- username:'',
- sex:1,
- birthday:new Date(),
- orgCode:'',
- workNo:'',
- status:1,
- phone:'',
- telephone:'',
- email:'',
- post:'',
- departIds:'',
- identity:'',
- },
- userUrl:'/sys/user/queryById',
- positionUrl:'/sys/position/list',
- departUrl:'/sys/user/userDepartList'
- };
- },
- onLoad() {
- this.user=uni.getStorageSync(USER_INFO);
- //this.loadinfo()
-
- },
- methods: {
- getSubStringText(text,len){
- if(!text || text.length==0){
- return ''
- }
- if(text.length<len){
- return text;
- }
- return text.substr(0,len)+"..."
- },
- rightClick(){
- this.$Router.push({name:'useredit', params:this.personalMsg})
- /* uni.navigateTo({
- url: '/pages/user/useredit?item='+item
- }); */
- },
- loadinfo(){
- this.$http.get(this.userUrl,{params:{id:this.$store.getters.userid}}).then(res=> {
- console.log("用户",res)
- if (res.data.success) {
- let result = res.data.result
- if(result.avatar&&result.avatar.length >0)
- this.personalMsg.avatar = api.getFileAccessHttpUrl(result.avatar)
- this.personalMsg.realname = result.realname
- this.personalMsg.username= result.username
- this.personalMsg.post = result.post
- this.personalMsg.sex = result.sex===1?'男':'女'
- this.personalMsg.birthday = result.birthday== null?'无':result.birthday
- this.personalMsg.departIds= result.departIds
- this.personalMsg.workNo= result.workNo
- this.personalMsg.phone= result.phone
- this.personalMsg.telephone= result.telephone== null?'无':result.telephone
- this.personalMsg.email= result.email
- this.personalMsg.post= result.post
- this.personalMsg.identity= result.identity=== 1?'普通成员':'上级'
- this.personalMsg.status= result.status === 1?'正常':'冻结'
- this.personalMsg.orgCode= result.orgCode
- }
- }).catch(e=>{
- console.log("请求错误",e)
- })
-
- this.$http.get(this.departUrl,{params:{userId:this.$store.getters.userid}}).then(res=> {
- if (res.success) {
- for (let item of res.result){
- this.personalMsg.orgCode = item.title
- this.personalMsg.departIds = item.title
- }
- }
- }).catch(e=>{
- console.log("请求错误",e)
- })
-
- this.$http.get(this.positionUrl).then(res=> {
- if (res.success) {
- let postArr = res.result.records
- for (let item of postArr ){
- if (this.personalMsg.post == item.code){
- this.personalMsg.post = item.name
- }
- }
- }
- }).catch(e=>{
- console.log("请求错误",e)
- })
- },
- }
- }
- </script>
- <style>
- .page {
- height: 100Vh;
- width: 100vw;
- }
- .page.show {
- overflow: hidden;
- }
- .switch-sex::after {
- content: "\e716";
- }
- .switch-sex::before {
- content: "\e7a9";
- }
- .switch-music::after {
- content: "\e66a";
- }
- .switch-music::before {
- content: "\e6db";
- }
- .example-body {
- padding: 10px;
- padding-top: 0;
- }
-
- .custom-image-box {
- /* #ifndef APP-NVUE */
- display: flex;
- /* #endif */
- flex-direction: row;
- justify-content: space-between;
- align-items: center;
- }
-
- .text {
- font-size: 14px;
- color: #333;
- }
- </style>
|