<template>
	<view class="user-content">
		<!-- 头部 -->
		<view class="user-head">
			<view class="user-photo">
				<u-image width="90rpx" shape="circle" height="90rpx" :src="src"></u-image>
			</view>
			<view class="user-info">
				李磊
			</view>
		</view>
		<!-- 列表 -->
		<view class="user-list">
			<u-cell-group>
				<u-cell-item icon="gift" index="0" @click="toPage" title="我的优惠卷"></u-cell-item>
				<u-cell-item icon="order" index="1" @click="toPage" title="我的订单"></u-cell-item>
				<u-cell-item icon="file-text" index="2" @click="toPage" title="服务协议"></u-cell-item>
				<!-- <u-cell-item icon="info-circle" index="3" @click="toPage" title="关于我们"></u-cell-item> -->
			</u-cell-group>
		</view>
		<!-- 退出 -->
		<view class="user-btn">
			<u-button type="error" @click="quitSys" shape="circle">退出登录</u-button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				src: 'https://cdn.uviewui.com/uview/example/fade.jpg'
			};
		},
		methods:{
			// 打开对应的页面
			toPage(index){
				let pageUrl=['/pages/coupon/index/index','/pages/order/order']
				uni.navigateTo({
					url: pageUrl[index]
				})
			},
			// 退出登录
			quitSys(){
				
			},
			bindGetUserInfo(res){
				console.log(res)
			},
		}
	}
</script>

<style lang="scss">
	.user-content{
		width: 100%;
		.user-head{
			display: flex;
			align-items: center;
			padding: 35rpx;
			.user-info{
				flex-grow: 1;
				padding: 0 20rpx;
			}
		}
		.user-list{
			padding:0 20rpx;
		}
		.user-btn{
			padding: 85rpx 100rpx;
		}
	}
</style>
