<!--module/order/pages/offline-evaluate/offline-evaluate.wxml 线下服务评价-->
<t-navbar wx:if="{{!videoFullscreen}}" title="评价" left-arrow />
<scroll-view class="page-scroll__container" type="list" scroll-y style="{{containerStyle}}">
  <view class="evaluate-container">
    <!-- 服务信息卡片 -->
    <view class="service-card">
      <image class="service-img" src="{{service.image}}" mode="aspectFill" />
      <view class="service-info">
        <view class="service-name-row">
          <text class="service-name">{{service.name}}</text>
          <text class="service-divider">|</text>
          <text class="service-date">{{service.operateTime}}</text>
        </view>
        <view class="service-row" wx:if="{{service.operateBy}}">操作人: {{service.operateBy}}</view>
        <view class="service-row" wx:if="{{service.conditioningProgramSupplierName}}">机构: {{service.conditioningProgramSupplierName}}</view>
      </view>
    </view>

    <!-- 服务质量 评分 -->
    <view class="rate-row">
      <text class="rate-label">服务质量</text>
      <view class="rate-wrap">
        <t-rate value="{{scoreServiceQuality}}" count="{{5}}" color="{{rateColor}}" placement="" bind:change="onScoreServiceQuality" />
        <text class="rate-score">{{scoreServiceQuality || '0'}}分</text>
      </view>
    </view>

    <!-- 服务态度 评分 -->
    <view class="rate-row">
      <text class="rate-label">服务态度</text>
      <view class="rate-wrap">
        <t-rate value="{{scoreAttitude}}" count="{{5}}" color="{{rateColor}}" placement="" bind:change="onScoreAttitude" />
        <text class="rate-score">{{scoreAttitude || '0'}}分</text>
      </view>
    </view>

    <!-- 环境 评分 -->
    <view class="rate-row">
      <text class="rate-label">环 境</text>
      <view class="rate-wrap">
        <t-rate value="{{scoreEnvironment}}" count="{{5}}" color="{{rateColor}}" placement="" bind:change="onScoreEnvironment" />
        <text class="rate-score">{{scoreEnvironment || '0'}}分</text>
      </view>
    </view>

    <!-- 评价输入 -->
    <view class="comment-section">
      <textarea class="comment-input" placeholder="展开说说对商品的想法吧" placeholder-class="comment-placeholder" value="{{content}}" bindinput="onContentInput" maxlength="{{200}}" show-confirm-bar="{{false}}" />
      <view class="comment-count" wx:if="{{content.length > 0}}">{{content.length}}/200</view>
    </view>

    <!-- 图/视频 上传（图片+视频总数不超过9个，添加按钮在最后，一行4个） -->
    <view class="upload-section">
      <view class="media-grid">
        <view class="media-item" wx:for="{{mediaList}}" wx:key="path">
          <image wx:if="{{item.type === 'image'}}" class="media-thumb" src="{{item.path}}" mode="aspectFill" bindtap="onPreviewMedia" data-index="{{index}}" />
          <view wx:else class="media-item-video" bindtap="onPreviewMedia" data-index="{{index}}">
            <video id="offline-video-{{index}}" class="media-thumb" src="{{item.path}}" show-center-play-btn="{{true}}" object-fit="cover" controls="{{true}}" bindfullscreenchange="onVideoFullscreenChange" />
            <view class="media-item-play">
              <t-icon name="play-circle-filled" size="56rpx" color="rgba(255,255,255,0.95)" />
            </view>
          </view>
          <view class="media-delete" catchtap="onRemoveMedia" data-index="{{index}}">
            <t-icon name="close" size="32rpx" color="#fff" />
          </view>
        </view>
        <view class="upload-trigger" wx:if="{{mediaList.length < 9}}" bindtap="onChooseMedia">
          <t-icon name="add" size="48rpx" color="#999" />
          <text class="upload-label">图/视频</text>
        </view>
      </view>
    </view>
  </view>
</scroll-view>

<!-- 发布按钮（视频全屏时隐藏，避免遮挡进度条） -->
<view class="publish-footer" wx:if="{{!videoFullscreen}}" style="padding-bottom: {{container.safeBottomOffset}}px;">
  <view class="publish-btn {{canPublish ? '' : 'disabled'}}" bindtap="onPublish">发布</view>
</view>