<view class="linearBack">
    <view class="head" wx:if="{{userLogin}}">
        <image class="head-img" src="{{userData.user.avatar ? userData.user.avatar : '/static/imgs/userHead.png'}}" mode="widthFix"></image>
        <view class="head-cont">
            <view class="head-name">{{userData.user.nickname}}</view>
            <view class="head-text">生命可以如此精彩~</view>
        </view>
        <view class="head-edit" bindtap="userNav" data-url="/pages/user/setup/setup">编辑 ></view>
    </view>
    <block wx:else>
        <navigator hover-class="none" url="/pages/login/index" class="head">
            <image class="head-img" src="/static/imgs/userHead.png" mode="widthFix"></image>
            <view class="head-cont">
                <view class="head-name">请先登录</view>
                <view class="head-text">生命可以如此精彩~</view>
            </view>
        </navigator>
    </block>
</view>

<!-- 订单 -->
<view class="userCont">
    <view class="white">
        <view class="order-top">
            <view class="order-title">我的订单</view>
            <view bindtap="userNav" data-url="/pages/order/index" class="order-more">全部 ></view>
        </view>
        <view class="order-list">
            <view class="order-item" bindtap="userNav" data-url="/pages/order/index?list_type=unpay">
                <image class="order-icon" src="/static/imgs/order_01.png" mode="widthFix"></image>
                <view class="order-label">待付款</view>
                <block wx:if="{{userLogin}}">
                    <view class="order--number" wx:if="{{userData.order.init > 0}}">{{userData.order.init}}</view>
                </block>
            </view>
            <view class="order-item" bindtap="userNav" data-url="/pages/order/index?list_type=paid">
                <image class="order-icon" src="/static/imgs/order_02.png" mode="widthFix"></image>
                <view class="order-label">待发货</view>
                <block wx:if="{{userLogin}}">
                    <view class="order--number" wx:if="{{userData.order.paid > 0}}">{{userData.order.paid}}</view>
                </block>
            </view>
            <view class="order-item" bindtap="userNav" data-url="/pages/order/index?list_type=delivered">
                <image class="order-icon" src="/static/imgs/order_03.png" mode="widthFix"></image>
                <view class="order-label">待收货</view>
                <block wx:if="{{userLogin}}">
                    <view class="order--number" wx:if="{{userData.order.delivered > 0}}">{{userData.order.delivered}}</view>
                </block>
            </view>
            <view class="order-item" bindtap="userNav" data-url="/pages/order/index?list_type=signed">
                <image class="order-icon" src="/static/imgs/order_04.png" mode="widthFix"></image>
                <view class="order-label">已签收</view>
            </view>
        </view>
    </view>
</view>

<!-- 工具 -->
<view class="userCont">
    <view class="white">
        <view class="tool-list">
            <view class="order-item" bindtap="userNav" data-url="/pages/account/index">
                <image class="tool-icon" src="/static/imgs/tool_05.png" mode="widthFix"></image>
                <view class="order-label">我的账户</view>
            </view>
            <!-- <view class="order-item" bindtap="userNav" data-url="/pages/bankCard/index">
                <image class="tool-icon" src="/static/imgs/tool_08.png" mode="widthFix"></image>
                <view class="order-label">我的银行卡</view>
            </view> -->
            <view class="order-item" bindtap="userNav" data-url="/pages/user/team/index">
                <image class="tool-icon" src="/static/imgs/tool_06.png" mode="widthFix"></image>
                <view class="order-label">我的团队</view>
            </view>
            <view class="order-item" bindtap="userNav" data-url="/pages/user/code/code" data-type="needSign">
                <image class="tool-icon" src="/static/imgs/tool_07.png" mode="widthFix"></image>
                <view class="order-label">邀请码</view>
            </view>
            <view class="order-item" bindtap="userNav" data-url="/pages/site/index">
                <image class="tool-icon" src="/static/imgs/tool_01.png" mode="widthFix"></image>
                <view class="order-label">我的地址</view>
            </view>
            <view class="order-item" bindtap="userNav" data-url="/pages/idcard/idcard">
                <image class="tool-icon" src="/static/imgs/tool_02.png" mode="widthFix"></image>
                <view class="order-label">实名认证</view>
            </view>
            <navigator hover-class="none" class="order-item" url="/pages/user/about/about">
                <image class="tool-icon" src="/static/imgs/tool_03.png" mode="widthFix"></image>
                <view class="order-label">关于我们</view>
            </navigator>
            <view class="order-item" bindtap="userNav" data-url="/pages/user/setup/setup">
                <image class="tool-icon" src="/static/imgs/tool_04.png" mode="widthFix"></image>
                <view class="order-label">用户设置</view>
            </view>
        </view>
    </view>
</view>

<!-- 推荐 -->
<view class="goods" wx:if="{{userData.goods.length > 0}}">
    <view class="goods-title">
        <view class="goods-title-name"><text class="goods-title-left"></text>为你推荐<text class="goods-title-right"></text></view>
    </view>
    <view class="goodsList">
        <view class="goodsItem" wx:for="{{userData.goods}}" wx:key="goods" bind:tap="onBuy" data-id="{{item.goods_id}}">
            <view class="goodsItem-img">
                <image mode="aspectFill" src="{{item.cover}}"></image>
            </view>
            <view class="goodsItem-cont">
                <view class="nowrap goodsItem-name">{{item.name}}</view>
                <view class="nowrap goodsItem-text">{{item.description}}</view>
                <view class="goodsItem-tips">
                    <view class="goodsItem-price">￥{{item.original_price}}</view>
                    <view class="goodsItem-sales">游览 {{item.clicks}}</view>
                </view>
            </view>
        </view>
    </view>
</view>