<view class="pack-center pages-hint grey" wx:if="{{loading}}">
    <image src="/static/icons/loadingGif.gif"></image>
    <view>疯狂加载中</view>
</view>


<block wx:else>
    <view class="found" wx:for="{{lists}}" wx:key="id">
        <!-- 用户 -->
        <view class="avatar">
            <view class="avatar-left">
                <image class="cover" src="{{item.user.avatar ? item.user.avatar: '/static/imgs/userHead.png'}}" mode="aspectFill"/>
                <view>{{item.user.name || '未知用户'}}</view>
            </view>
            <view>{{item.created_at}}</view>
        </view>
        
        <!-- 文字描述-->
        <view class="des">{{item.describe}}</view>
    
        <!-- 主图或视频 -->
        <view class="cont">
            <!-- 图片汇总 -->
            <block wx:if="{{item.type == 'pictures'}}">
                <view class="cont-img-list" wx:if="{{item.pictures.length == 1}}">
                    <block  wx:for="{{item.pictures}}" wx:key='idx' wx:for-index="idx" wx:for-item="it">
                        <image catch:tap="preImg" data-idx="{{idx}}" data-urls='{{item.pictures}}' wx:key="it" src="{{it}}" mode="widthFix"/>
                    </block>
                </view>
                <view class="cont-img-list2" wx:if="{{item.pictures.length == 2}}">
                    <block  wx:for="{{item.pictures}}" wx:key='idx' wx:for-index="idx" wx:for-item="it">
                        <image catch:tap="preImg" data-idx="{{idx}}" data-urls='{{item.pictures}}' wx:key="it" src="{{it}}" mode="aspectFill"/>
                    </block>
                </view>
                <view class="cont-img-list" wx:if="{{item.pictures.length>=3}}">
                    <block  wx:for="{{item.pictures}}" wx:key='idx' wx:for-index="idx" wx:for-item="it">
                        <image catch:tap="preImg" data-idx="{{idx}}" data-urls='{{item.pictures}}' wx:key="it" src="{{it}}" mode="aspectFill"/>
                    </block>
                </view>
            </block>
            <!-- 视频汇总 -->
            <block wx:if="{{item.type == 'video' && item.video!=null}}">
                <video class="cont-video" src="{{item.video}}" id='myVideo{{item.id}}'/>
            </block>
        </view>

        <!-- 点赞 收藏 分享 -->
        <view class="footer">
            <view class="footer-item" catch:tap="doSubscribeFavorite" data-type='favorite' data-index='{{index}}'>
                <image src="{{!item.is.favorite?'/static/imgs/icon_un_zan@2x.png':'/static/imgs/icon_zaned@2x.png'}}" mode="widthFix" />{{!item.is.favorite?'点赞':item.count.favorite}}
            </view>
            <view class="footer-item" catch:tap="doSubscribeFavorite" data-type='subscribe' data-index='{{index}}'>
                <image src="{{!item.is.subscribe?'/static/imgs/icon_un_shou@2x.png':'/static/imgs/icon_shoued@2x.png'}}" mode="widthFix" />{{!item.is.subscribe?'收藏':item.count.subscribe}}
            </view>
            <button class="footer-item" open-type="share" hover-class="none" data-obj='{{item}}'>
                <image style="width:28rpx;" src="/static/imgs/icon_share@2x.png" mode="widthFix" />分享
            </button>
        </view>
    </view>
</block>
