<template>
  <view class="page">
	<u-navbar title="我的" placeholder  bgColor="#00337A" :titleStyle="{ color: '#FFF', fontSize: '32rpx' }"/>
		<scroll-view class="content" scroll-y="true">
			<view class="view-box">
				<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>
			
			<view class="view-item" @click="goNews"> 
				<image class="imgBox" src="../../../static/realName/news.png" mode=""></image>
				<text class="textBox">我的消息</text>
			</view>
			<view class="view-item">
				<image class="imgBox" src="../../../static/realName/reset_pass.png" mode=""></image>
				<text class="textBox">修改密码</text>
			</view>
			<view class="view-item">
				<image class="imgBox" src="../../../static/realName/my_upload.png" mode=""></image>
				<text class="textBox">上传情况</text>
			</view>
			<view class="view-item">
				<image class="imgBox" src="../../../static/realName/my_download.png" mode=""></image>
				<text class="textBox">下载情况</text>
			</view>
			<view class="view-item">
				<image class="imgBox" src="../../../static/realName/icon_update_data.png" mode=""></image>
				<text class="textBox">更新数据</text>
			</view>
			<!-- <view class="view-item">
				<image class="imgBox" src="../../../static/realName/my_update.png" mode=""></image>
				<text class="textBox">更新系统</text>
			</view> -->
			<view class="view-item">
				<image class="imgBox" src="../../../static/realName/my_about.png" mode=""></image>
				<text class="textBox">关于我们</text>
			</view>
			<view class="view-item">
				<image class="imgBox" src="../../../static/realName/icon_logout.png" mode=""></image>
				<text class="textBox">退出</text>
			</view>
			
			
			
			
			
		</scroll-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)
		  }
		})
	},
	goNews(){
		uni.navigateTo({
			url: `/pages/realName/my/news`
		})
	},
  }
}
</script>

<style lang="scss">
.page {
  width: 100vw;
  height: 100vh;
  background-color: #f8f8f8;
  // box-sizing: border-box;
  // padding: 15vh 8vw;
  .content{
  	width: 100%;
  	height: 84vh;
  	margin-top: 20rpx;
  	background-color: #f8f8f8;
  	padding-bottom: 40rpx;
  }
  
  .view-box{
	  width: 100%;
	  padding: 20rpx 0;
	  margin-bottom: 30rpx;
	  height: auto;
	  background-color: #F2F6F9;
  }
  .view-item{
	  width: 100%;
	  padding: 20rpx 0;
	  margin-bottom: 30rpx;
	  height: auto;
	  background-color: #F2F6F9;
	  display: flex;
	  align-items: center;
  }
 
  .imgBox{
	  width: 40rpx;
	  height: 40rpx;
	  margin: 0 40rpx;
  } 
  .textBox{
	  width: 200rpx;
	  height: 60rpx;
	  line-height: 60rpx;
  }
  
}
</style>
