<!--pages/mine/mine.wxml-->
<view class="list">
	<view bindtap="toUserinfo" class="userItem userInfo">
		<view class="logo">
			<image wx:if="{{!user.avatar||!isLogin}}" src="../../images/default-avatar.png"></image>
			<image wx:if="{{user.avatar&&isLogin}}" src="{{globalUrl+user.avatar}}"></image>
		</view>
		<view wx:if="{{isLogin}}" class="right">
			<view class="name">{{userInfo.userName?userInfo.userName:'未设置姓名'}}</view>
			<view class="mobile">手机号：{{userInfo.mobile}}</view>
		</view>
		<view wx:if="{{!isLogin}}" class="right">
			<view class="name">未登录账号</view>
			<button class="loginBtn">点击登录</button>
		</view>
		<i class="iconfont icon-arrowr"></i>
	</view>
	<!-- 登录显示 -->
	<view wx:if="{{isLogin}}" class="userItem panel">
		<view bindtap="toMobile" wx:if="{{userInfo.roles===1||userInfo.roles===2}}" class="lineGroup">
			<image class="icon" src="../../images/ico_modify@3x.png"></image>
			<text class="label">修改手机号</text>
			<i class="iconfont icon-arrowr"></i>
		</view>
		<view bindtap="toAccount" wx:if="{{userInfo.roles===1}}" class="lineGroup">
			<image class="icon" src="../../images/ico_changing-over@3x.png"></image>
			<text class="label">账号管理</text>
			<i class="iconfont icon-arrowr"></i>
		</view>
		<view bindtap="contact" wx:if="{{userInfo.roles===1||userInfo.roles===2}}" class="lineGroup">
			<image class="icon" src="../../images/ico_phone@3x.png"></image>
			<text class="label">联系客服</text>
			<i class="iconfont icon-arrowr"></i>
		</view>
	</view>
	<!-- 未登录显示 -->
	<view wx:if="{{!isLogin}}" class="userItem panel">
		<view bindtap="toMobile" class="lineGroup">
			<image class="icon" src="../../images/ico_modify@3x.png"></image>
			<text class="label">修改手机号</text>
			<i class="iconfont icon-arrowr"></i>
		</view>
		<view bindtap="toAccount" class="lineGroup">
			<image class="icon" src="../../images/ico_changing-over@3x.png"></image>
			<text class="label">账号管理</text>
			<i class="iconfont icon-arrowr"></i>
		</view>
		<view bindtap="contact" class="lineGroup">
			<image class="icon" src="../../images/ico_phone@3x.png"></image>
			<text class="label">联系客服</text>
			<i class="iconfont icon-arrowr"></i>
		</view>
	</view>
	<view class="btnGroup">
		<button bindtap="loginOut" class="btn">{{isLogin?'退出登录':'前往登录'}}</button>
	</view>
</view>