<template>
  <view class="page">
	<u-navbar title="我的" placeholder @leftClick="leftClick" bgColor="#00337A" :titleStyle="{ color: '#FFF', fontSize: '32rpx' }"/>
		<view style="width: 94%;margin: 20rpx auto;height: auto;">
			<view style="margin-left: 40rpx;margin-bottom: 20rpx;">
			<text>{{userData.userName}}</text> <text style="margin-left: 20rpx;">{{userData.phonenumber}}</text> <text style="margin-left: 20rpx;">{{userData.roleName}}</text>
			</view>
			<view style="margin-left: 40rpx;margin-bottom: 20rpx;">
			<text>{{userData.companyName}}</text>
			</view>
			<view style="margin-left: 40rpx;margin-bottom: 20rpx;">
			<text>{{proName}}</text>
			</view>
			
		</view>
	
	
	
	
	
	
    <m-tabbar fixed fill :current="3" :tabbar="tabbar"></m-tabbar>
  </view>
</template>

<script>
import TabbarConfig from '../util/tabbar.js'
import config from '@/config'

export default {
  data() {
    return {
		tabbar: TabbarConfig,
		userData:uni.getStorageSync('realNameUser'),
		proId:uni.getStorageSync('realNameUser').proId,
		proName:""
		// userName: uni.getStorageSync('userName'),
		// className: uni.getStorageSync('className'),
		// facePath: config.fileUrl + uni.getStorageSync('facePath'),
		// token: uni.getStorageSync('access_token')
    }
  },
  onLoad() {
		console.log(this.userData)
		this.getPro()
  },
  methods: {
	// 获取工程名称
	getPro(){
		let param={
			id:this.proId,
			subId:-1
		}
		uni.request({
		  url: config.realAppUrl + '/offLine/getPro',
		  method: 'post',
		  data: param,
		  header: {
			'Content-Type': 'application/x-www-form-urlencoded',
			Authorization: uni.getStorageSync('realNameToken')
		  },
		  success: res => {
			res = res.data;
			if(res.code==200){
				console.log(res)
				this.proName = res.data[0].abbreviation||"";
			}
		  },
		  fail: err => {
			console.log(err)
		  }
		})
	},
  }
}
</script>

<style lang="scss">
.page {
  width: 100vw;
  height: 100vh;
  background: linear-gradient(#eaf0f7, #f8f8f8);
  // box-sizing: border-box;
  // padding: 15vh 8vw;
}
</style>
