<view class="posts-page">
    <scroll-view 
        scroll-y 
        class="sub-scroll" 
        enhanced 
        show-scrollbar="{{false}}" 
        bindscrolltolower="onReachBottom"
        refresher-enabled="{{true}}"
        bindrefresherrefresh="onPullDownRefresh"
        refresher-triggered="{{isRefreshing}}"
    >
      <view wx:if="{{myPublishedPosts.length > 0}}" class="posts-list">
        <view wx:for="{{myPublishedPosts}}" wx:key="id" class="my-post-card">
            <view class="my-post-time">{{item.time}}</view>
            <t-swipe-cell class="post-swipe-cell">
                <view class="my-post-content-wrap">
                    <view class="post-header" wx:if="{{item.hasReviewed !== undefined}}">
                        <view class="status-tag pending" wx:if="{{item.hasReviewed === 0}}">待审核</view>
                        <view class="status-tag success" wx:if="{{item.hasReviewed === 1}}">已发布</view>
                    </view>
                    <text class="post-text">{{item.content}}</text>
                    <view wx:if="{{item.images.length > 0}}" class="my-post-images">
                        <t-image wx:for="{{item.images}}" wx:for-item="img" wx:key="*this"
                            src="{{img}}" mode="aspectFill" width="140rpx" height="140rpx"
                            shape="round" />
                    </view>
                    <view class="my-post-footer">
                        <view class="footer-item"><t-icon name="heart" size="28rpx" /> <text>{{item.likes.length}}</text></view>
                        <view class="footer-item"><t-icon name="chat" size="28rpx" /> <text>{{item.comments.length}}</text></view>
                    </view>
                </view>
                <view slot="right" class="delete-action" catchtap="deletePost" data-id="{{item.id}}">
                     <view class="delete-btn">
                        <t-icon name="delete" size="40rpx" color="#fff" />
                     </view>
                </view>
            </t-swipe-cell>
        </view>
      </view>
      <view wx:else class="empty-state">
         <t-icon name="file-copy" size="80rpx" color="#E0E0E0" style="margin-bottom: 24rpx;" />
         <text class="empty-text">暂无发布内容</text>
      </view>
      <view style="height: 60rpx;"></view>
    </scroll-view>
</view>
