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

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

    <!-- 2张图片 -->
    <view class="picture2" wx:if="{{images.length==2}}">
        <image mode="scaleToFill" bindtap="openpreviewImg" 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="openpreviewImg" data-index="{{index}}" class="{{imageclass}}" wx:for="{{images}}" src="{{item}}" bindload="onImageLoad"> </image>
    </view>
        <!-- 预览组件 -->
        <previewImg id="previewComponent" previewImgList = "{{imgList}}" previewImg = "{{currentImg}}"  />
    <!-- 地址 -->
    <view class="addbox" wx:if="{{cicleList[0].location}}">
        <van-icon name="location-o" size='28rpx' />
        <view class="add-tex">{{cicleList[0].location}}</view>
    </view>
    <view class="timebox">
        <!-- 点赞 -->
        <view class="dianzan" wx:if="{{!isclick}}" bindtap="isclick" data-id="{{cicleList[0].objectId}}">
            <van-icon name="good-job-o" size='32rpx' />
            {{chickList.length}}
        </view>

        <view class="dianzan" wx:if="{{isclick}}" bindtap="isclick">
            <van-icon name="good-job-o" size='32rpx' color='#FF6C00' />
            {{chickList.length}}
        </view>

        <view class="time-box">
            <!-- <view class="time">{{time}}</view> -->
            <!-- 删除 -->
            <van-icon wx:if="{{ permission=='delete'}}" color='#1a1abd' bind:click='showconfirm' name="delete-o" size='32rpx' />
            <van-dialog id="van-dialog" showCancelButton message='你确认要删除吗' show="{{ showconfirm }}" bind:cancel='cancleconfirm' bind:confirm='clickconfirm' />
            <!-- 评论 -->
            <!-- 没有回复的评论的数量 -->
            <view class="pinlunbox" bindtap="showPopup">
                <van-icon name="chat-o" size='32rpx' />
                {{noCommentCount}}
            </view>
            <!-- 转发 -->
            <view class="pinlunbox" style="margin-left: 10rpx;">
                <van-icon name="share-o" size='32rpx' />
                0
            </view>
        </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: #4896FB;margin-right:10rpx">{{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: #4896FB;">{{item.user.nickname}}</span>
                回复
                <span style="color: #4896FB;margin-right:10rpx">{{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>

<view class="trends-two" bindtouchstart="onTouchStart" wx:if="{{objectId&&type=='surface'}}">
    <!--主页  -->
    <view class="namebax" wx:if="{{type=='surface'}}" bindtap="gourl" data-url="../../pages/circle/circle-detail/index" data-id="{{cicleList[0].objectId}}">
        <image src="{{cicleList[0].profile.user.avatar}}"></image>
        <view class="name">{{cicleList[0].profile.user.nickname}}</view>
        <view class="guanzhu">
            <van-icon name="plus" size='24rpx' />
            关注
        </view>
    </view>
    <view wx:if="{{!showFull}}" class="text">
        <view wx:if="{{cicleList[0].content.length > maxLength}}">
            <view class="contentbox">{{cicleList[0].content}}</view>
            <text bindtap="showFullContent" class="quanwen">查看全文</text>
        </view>
        <view wx:if="{{cicleList[0].content.length <= maxLength}}">
            <view bindtap="gourl" style="max-height: 134rpx;" data-url="../../pages/circle/circle-detail/index" data-id="{{cicleList[0].objectId}}" class="contentbox">{{cicleList[0].content}}</view>
        </view>
    </view>

    <!-- 全文内容 -->
    <view wx:if="{{showFull}}" class="full-content">
        <view bindtap="gourl" data-url="../../pages/circle/circle-detail/index" data-id="{{cicleList[0].objectId}}">
            {{cicleList[0].content}}
        </view>
        <text bindtap="showLessContent" class="quanwen">收起</text>
    </view>

    <!-- 图片 -->
    <!-- 4张图片 -->
    <view class="picture4" wx:if="{{images.length==4}}">
        <image mode="scaleToFill" bindtap="openpreviewImg" data-index="{{index}}" class="image" wx:for="{{images}}" src="{{item}}"> </image>
    </view>
    <!-- 3张和5-9张图片 -->
    <block wx:if="{{ type=='surface'}}">
        <view class="picture" wx:if="{{images.length>4  && images.length<=9 || images.length==3 }}">
            <image mode="scaleToFill" bindtap="openpreviewImg" 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="openpreviewImg" data-index="{{index}}" class="image" src="{{item}}"></image>
                <view class="more-images" wx:if="{{index==8}}" bindtap="gourl" data-url="../../pages/circle/circle-detail/index" data-id="{{cicleList[0].objectId}}">+{{images.length - 9}}</view>
            </view>
        </view>

    </view>
    <!-- 2张图片 -->
    <view class="picture2" wx:if="{{images.length==2}}">
        <image mode="scaleToFill" bindtap="openpreviewImg" data-index="{{index}}" class="image" wx:for="{{images}}" wx:key="{{index}}" src="{{item}}"> </image>
    </view>
    <!-- 1张图片 -->
    <view class="picture3" wx:if="{{images.length==1}}">
        <image mode="scaleToFill" class="{{imageclass}}" data-index="{{index}}" wx:for="{{images}}" wx:key="index" src="{{item}}" bindload="onImageLoad" bindtap="openpreviewImg"> </image>
    </view>
    <!-- 预览组件 -->
    <previewImg id="previewComponent" previewImgList = "{{imgList}}" previewImg = "{{currentImg}}"  />


    <view class="addbox" wx:if="{{cicleList[0].location}}">
        <van-icon name="location-o" size='28rpx' />
        <view class="add-tex">{{cicleList[0].location}}</view>
    </view>
    <view class="timebox">
        <!-- 点赞 -->
        <view class="dianzan" wx:if="{{!isclick}}" bindtap="isclick" data-id="{{cicleList[0].objectId}}">
            <van-icon name="good-job-o" size='32rpx' />
            {{chickList.length}}
        </view>

        <view class="dianzan" wx:if="{{isclick}}" bindtap="isclick">
            <van-icon name="good-job-o" size='32rpx' color='#FF6C00' />
            {{chickList.length}}
        </view>

        <view class="time-box">
            <!-- <view class="time">{{time}}</view> -->
            <!-- 删除 -->
            <van-icon wx:if="{{ permission=='delete'}}" color='#1a1abd' bind:click='showconfirm' name="delete-o" size='32rpx' />
            <van-dialog id="van-dialog" showCancelButton message='你确认要删除吗' show="{{ showconfirm }}" bind:cancel='cancleconfirm' bind:confirm='clickconfirm' />
            <!-- 评论 -->
            <!-- 没有回复的评论的数量 -->
            <view class="pinlunbox" bindtap="showPopup">
                <van-icon name="chat-o" size='32rpx' />
                {{noCommentCount}}
            </view>
            <!-- 转发 -->
            <view class="pinlunbox" style="margin-left: 10rpx;">
                <van-icon name="share-o" size='32rpx' />
                0
            </view>
        </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: #4896FB;margin-right:10rpx">{{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: #4896FB;">{{item.user.nickname}}</span>
                回复
                <span style="color: #4896FB;margin-right:10rpx">{{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>