<!--pages/detail/index.wxml-->
<import src="../../wxParse/wxParse.wxml" />

<view class='v-page'>
  <banner banners="{{detail.banners}}" />
  
  <view class="attributes-wrapper">
    <view class='header'>
      <view class='title'>{{detail.title}}</view>
      <view class='intro'>
        {{detail.type=='2'?'':'限'+detail.sign_limits+'组报名'}} 收藏{{detail.collect_num}}次
      </view>
    </view>
    <i-cell-group>
      <i-cell wx-if="{{detail.type=='1'}}">
        <image slot="icon" src='/images/icon_tag.png' mode='scaleToFill' class='icon'></image>
        <view>活动时间：{{detail.time_period}}</view>
      </i-cell>
      <i-cell wx-if="{{detail.type=='1'}}">
        <image slot="icon" src='/images/icon_clock.png' mode='scaleToFill' class='icon'></image>
        <view>报名截止：{{detail.sign_endtime}}</view>
      </i-cell>
      <i-cell>
        <image slot="icon" src='/images/icon_location.png' mode='scaleToFill' class='icon'></image>
        <view class='text_address' catchtap='handleMap'>{{detail.location}}</view>
        <view slot="footer">
          <image src='/images/icon_map.png' class='icon-map' catchtap='handleMap'></image>
        </view>
      </i-cell>

      <i-cell wx-if="{{detail.type=='2'}}">
        <image slot="icon" src='/images/icon_rmb.png' mode='scaleToFill' class='icon'></image>
        <view catchtap='handleMap'>
        <text>参考价格：<text class='text-red'>￥{{detail.price}}起/{{detail.night_num}}晚</text> </text>
        </view>
      </i-cell>
      <i-cell wx-if="{{detail.type=='1'}}">
        <image slot="icon" src='/images/icon_rmb.png' mode='scaleToFill' class='icon'></image>
        <view class='text-red'>
          <text>¥{{detail.price}}</text>
          <text class='margin-left-10'>Vip: ¥{{detail.vip_price}}</text>
        </view>
        <view slot="footer">
          <button class='btn-pay-vip' catchtap='handleVip'>购买会员卡</button>
        </view>
      </i-cell>
    </i-cell-group>
  </view>
  <view class='desc-wrapper'>
    <view class='title'>{{detail.type=='1'?'活动':'商家'}}详情</view>
    <view class='content'>
      <template is="wxParse" data="{{wxParseData:description.nodes}}" />
    </view>
  </view>
  <view wx-if="{{detail.type=='1'}}" class='comments-wrapper'>
    <view class='title'>活动评价（{{comments.length > 0 ? comments.lenght : 0}}）</view>
    <view class='content-wrapper'>
    </view>
  </view>

  <more hasMore="{{hasMore}}" loading="{{loading}}" page="{{currentPage}}" />

  <view class='actions-wrapper'>
    <view class='actions-box'>
      <view class='actions-section ops-wrapper'>
        <view class='op-wrapper' catchtap='handleHome'>
          <image src='/images/icon_home.png' class='icon'></image>
          <text class='title'>首页</text>
        </view>
        <view class='op-wrapper' catchtap='handleCollect'>
          <image src='/images/icon_star{{detail.is_collect==1?"_active":""}}.png' class='icon'></image>
          <text class='title'>收藏</text>
        </view>
        <button open-type='share' class='form-button op-wrapper' catchtap='handleShare'>
          <image src='/images/icon_share.png' class='icon'></image>
          <text class='title'>分享</text>
        </button>
      </view>
      <view wx-if="{{detail.type=='1'}}" class="actions-section btn-wrapper {{detail.status==1?'btn-overdate':''}} {{detail.status==2?'btn-soldout':''}}" catchtap='enrollClick'>{{detail.status_text}}</view>
      <view wx-if="{{detail.type=='2'}}" class='actions-section btn-wrapper' catchtap='kfClick'>咨询客服</view>
    </view>
  </view>
  <i-toast id="toast" />

  <i-modal title="咨询客服" visible="{{show_kf}}" bind:ok="handleKfClose" bind:cancel="handleKfClose" ok-text="保存图片">
    <view class="qrcode">
      <image style='width:236rpx;height:236rpx;border-radius:4rpx;' src='{{detail.kf_qrcode}}'></image>
      <text style='width:100%;text-align:center;height:24px;line-height:24px;font-size:24rpx;'>
      保存图片后，扫码添加客服咨询
      </text>
    </view>
  </i-modal>

  


</view>