<!--nova-werun/components/circle-card/index.wxml-->
<view class="trends-one" bindtouchstart="onTouchStart" wx:if="{{objectId}}">
    <!-- 详细-->
    <view wx:if="{{type=='detail'}}" class="namebax">
        <image src="{{cicleList[0].profile.user.avatar}}"></image>
        <view class="name">{{cicleList[0].profile.name}}</view>
    </view>
    <view class="text" wx:if="{{type=='detail'}}">{{cicleList[0].content}}</view>
    <!--  -->
    <view class="namebax" wx:if="{{type=='surface'}}" bindtap="gourl" data-url="../../pages/circle-detail/index" data-id="{{cicleList[0].objectId}}">
        <image src="{{cicleList[0].profile.user.avatar}}"></image>
        <view class="name">{{cicleList[0].profile.name}}</view>
    </view>
    <view wx:if="{{type=='surface'}}" class="text" bindtap="gourl" data-url="../../pages/circle-detail/index" data-id="{{cicleList[0].objectId}}">{{cicleList[0].content}}</view>
    <!-- 图片 -->
    <!-- 4张图片 -->
    <view class="picture4" wx:if="{{images.length==4}}">
        <image mode="scaleToFill" bindtap="previewImage" data-index="{{index}}" class="image" wx:for="{{images}}" src="{{item}}"> </image>
    </view>
    <!-- 3张和4-9张图片 -->
    <block wx:if="{{ type=='surface'}}">
        <view class="picture" wx:if="{{images.length>4  && images.length<=9 || images.length==3 }}">
            <image mode="scaleToFill" bindtap="previewImage" data-index="{{index}}" class="image" wx:for="{{images}}" src="{{item}}"> </image>
        </view>
    </block>

    <block wx:if="{{ type=='detail'}}">
        <view class="picture" wx:if="{{images.length>4   || images.length==3 }}">
            <image mode="scaleToFill" bindtap="previewImage" data-index="{{index}}" class="image" wx:for="{{images}}" src="{{item}}"> </image>
        </view>
    </block>

    <!-- 9张以上图片 -->
    <view class="picture5" wx:if="{{images.length > 9 && type=='surface'}}">
        <view wx:for="{{images}}" wx:if="{{index < 9}}">
            <view class="image-wrapper">
                <image mode="scaleToFill" bindtap="previewImage" data-index="{{index}}" class="image" src="{{item}}"></image>
                <view class="more-images" wx:if="{{index==8}}" bindtap="gourl" data-id="{{cicleList[0].objectId}}" data-url="../../pages/circle-detail/index">+{{images.length - 9}}</view>
            </view>
        </view>

    </view>
    <!-- 2张图片 -->
    <view class="picture2" wx:if="{{images.length==2}}">
        <image mode="scaleToFill" bindtap="previewImage" data-index="{{index}}" class="image" wx:for="{{images}}" src="{{item}}"> </image>
    </view>
    <!-- 1张图片 -->
    <view class="picture3" wx:if="{{images.length==1}}">
        <image mode="scaleToFill" bindtap="previewImage" data-index="{{index}}" class="{{imageclass}}" wx:for="{{images}}" src="{{item}}" bindload="onImageLoad"> </image>
    </view>
    <!--  -->
    <view class="timebox">
        <view class="time-box">
            <view class="time">{{time}}</view>
            <van-icon wx:if="{{ permission=='delete'}}"  color='#1a1abd' bind:click='deletecircle' name="delete-o" size='20' />
        </view>
        <!-- 点赞评论 -->
        <view class="functionbox" wx:if="{{isgood}}">
            <view class="function">
                <view class="function1" wx:if="{{isclick}}" bindtap="isclick" data-id="{{cicleList[0].objectId}}">
                    <van-icon name="like-o" />
                    <view class="text2">赞</view>
                </view>
                <view class="function1" wx:if="{{!isclick}}" bindtap="isclick">
                    <van-icon name="like" color='red' />
                    <view class="text2">取消</view>
                </view>
                |
                <view class="function1" bindtap="showPopup">
                    <van-icon name="chat-o" />
                    <view class="text2">评论</view>
                </view>
            </view>
        </view>
        <!-- 输入框 -->
        <view class="point" bindtap="showgood"> ·· </view>
        <van-popup show="{{ show }}" position="bottom" custom-style="height: {{bottomNavHeight+textareaHeight+70}}rpx;" bind:close="onClose" overlay-style='background-color: rgba(255, 255, 255, 0); ' custom-style='background-color: #efefef;'>

            <view class='sending' style="height: {{textareaHeight+40}}rpx;">
                <textarea placeholder="{{commenttext}}" class="textarea" style="height: {{textareaHeight}}rpx;" bindinput="onInput" value="{{inputValue}}"></textarea>
                <view class="button2" wx:if="{{!inputValue}}">发送</view>
                <view class="button" wx:if="{{inputValue}}" bindtap="sendComment">发送</view>
            </view>

        </van-popup>
    </view>
    <!-- 点赞人 -->
    <view class="chinkinbox" wx:if="{{chickList.length!=0}}">
        <van-icon name="like-o" size='18' />
        <block wx:for="{{chickList}}">
            <view class="chickname" wx:if="{{index!=chickList.length-1}}">{{item.user.nickname}} ,</view>
            <view class="chickname" wx:if="{{index==chickList.length-1}}">{{item.user.nickname}}</view>
        </block>

    </view>
    <!-- 评论 -->
    <view class="{{chickList.length !=0? 'commentbox' :'commentbox2' }}" wx:if="{{commentList.length!=0}}">
        <block wx:for="{{commentList}}">
            <view class="{{item.showdeletid?'comment2':'comment'}}" wx:if="{{!item.comment}}" bindtap="showpop" data-id="{{item.objectId}}">
                <span style="color: #072d79;">{{item.user.nickname}}</span>
                :
                <span>{{item.content}}</span>
                <view wx:if="{{item.showdeletid}}" class="delete" bindtap="deletecomment" data-id="{{item.objectId}}">删除</view>
            </view>
            <view class="{{item.showdeletid?'comment2':'comment'}}" wx:if="{{item.comment&&!item.comment.isDeleted}}" bindtap="showpop" data-id="{{item.objectId}}">
                <span style="color: #072d79;">{{item.user.nickname}}</span>
                回复
                <span style="color: #072d79;">{{item.comment.user.nickname}}</span>
                :
                <span>{{item.content}}</span>
                <view wx:if="{{item.showdeletid}}" class="delete" bindtap="deletecomment" data-id="{{item.objectId}}">删除</view>
            </view>
        </block>

    </view>
</view>