index.vue 1.4 KB
<template>
	<view class="UserInfo"  @click="$service.jump" data-url="/page_admin/one_setting/one_setting">
		<view class="UserInfo-l">
			<u--image 
				shape="circle"
				height="88rpx"
				width="88rpx"
				:src="info.img_url"></u--image>
			<text class="UserInfo-l-n">{{ info.name }}</text>
			<text class="UserInfo-l-l">管理员</text>
		</view>
		<view class="UserInfo-r">
			<u-icon name="arrow-right"></u-icon>
		</view>
	</view>
</template>

<script>
	export default {
		name: 'UserInfo',
		data() {
			return {
				info: {}
			}
		},
		mounted() {
			this.getData()
		},
		methods: {
			getData() {
				var datas = {}
				var jkurl = '/admin'
				this.$service.P_get(jkurl, datas).then(res => {
					console.log(res)
					this.info = res.data
					this.$store.commit('setuserinfo', res.data)
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.UserInfo{
		border-radius: 15rpx;
		box-shadow: 7px 0px 24px 0px rgba(153,153,153,0.22);
		background: #F8F8F8;
		height: 180rpx;
		padding: 0 40rpx;
		display: flex;
		align-items: center;
		justify-content: space-between;
		.UserInfo-l{
			display: flex;
			align-items: center;
			.UserInfo-l-n{
				font-size: 30rpx;
				color: #3D4054;
				margin: 0 20rpx;
				font-weight: bold;
			}
			.UserInfo-l-l{
				border-radius: 3rpx;
				background: #EBF2F8;
				font-size: 22rpx;
				line-height: 32rpx;
				padding: 0 10rpx;
				color: #3C80D7;
			}
		}
	}
</style>