<!--pages/index.wxml-->
<wxs src="../common.wxs" module="common"></wxs>

<view class='v-page'>
  <banner banners="{{banners}}" />
  <official-account binderror="official"></official-account>
  <navs />
  <i-cell-group i-class="section-wrapper">
    <i-cell title="最新活动" is-link i-class="text-mtitle">
      <text slot="footer" class='text-gray text-small' catchtap='gotoMoreProjects' data-type='1' data-name='最新活动'>更多</text>
    </i-cell>
    <i-row i-class="col-wrapper">
      <i-col span="8" i-class="col-class" wx:for="{{news}}" wx:for-index="idx" wx:for-item="n" wx:key="n.id" wx:if="{{idx < 6}}">
        <view class='col-item' catchtap='handleProjectDetail' data-id='{{n.id}}'>
          <image class='image' src="{{n.poster}}" mode='aspectFill'></image>
          <view class='title'>{{n.title}}</view>
          <view class='info'>
            <text class='text-red text-small mergin-right-2'>¥{{common.numFixed(n.vip_price, 0)}}</text>
            <text> 起/{{n.night_num}}晚</text>
          </view>
        </view>
      </i-col>
    </i-row>
  </i-cell-group>

  <i-cell-group i-class="section-wrapper">
    <i-cell title="爆款专区" is-link i-class="text-mtitle">
      <text slot="footer" class='text-gray text-small' catchtap='gotoMoreProjects' data-type='2' data-name='爆款专区'>更多</text>
    </i-cell>
    <i-row i-class="col-wrapper">
      <i-col span="8" i-class="col-class" wx:for="{{heats}}" wx:for-index="idx" wx:for-item="n" wx:key="n.id" wx:if="{{idx < 6}}">
        <view class='col-item' catchtap='handleProjectDetail' data-id='{{n.id}}'>
          <image class='image' src="{{n.poster}}" mode='aspectFill'></image>
          <view class='title'>{{n.title}}</view>
          <view class='info'>
            <text class='text-red text-small mergin-right-2'>¥{{common.numFixed(n.price, 0)}}</text>
            <text> 起/{{n.night_num}}晚</text>
          </view>
        </view>
      </i-col>
    </i-row>
  </i-cell-group>

  <i-cell-group i-class="section-wrapper">
    <i-cell title="美行推荐" is-link i-class="text-mtitle">
      <text slot="footer" class='text-gray text-small' catchtap='gotoSearchProjects' data-catalog='5' data-name='美行推荐'>更多</text>
    </i-cell>
    <i-row i-class="col-wrapper">
      <i-col span="12" i-class="col-class" wx:for="{{businesses}}" wx:for-index="idx" wx:for-item="n" wx:key="n.id">
        <view class='col-item' catchtap='handleProjectDetail' data-id='{{n.id}}'>
          <image class='image' src="{{n.poster}}" mode='aspectFill'></image>
          <view class='title'>{{n.title}}</view>
          <view class='info'>
            <text class='text-red text-small mergin-right-2'>¥{{common.numFixed(n.price, 0)}}</text>
            <text> 起/{{n.night_num}}晚</text>
          </view>
        </view>
      </i-col>
    </i-row>
  </i-cell-group>

  <i-cell-group i-class="section-wrapper">
    <i-cell title="美行攻略" is-link url="/pages/guide/index" i-class="text-mtitle">
      <text slot="footer" class='text-gray text-small'>更多</text>
    </i-cell>
    <view class="guides-wrapper">
      <view class='guide-item' wx:for="{{guides}}" wx:for-index="idx" wx:for-item="n" wx:key="n.id" data-content="{{n.type=='1'?n.id:n.content}}" data-type="{{n.type}}" catchtap='handleGuideDetail'>
        <image class='image' src="{{n.poster}}" mode='aspectFill'></image>
        <view class='info'>
          <view class='text-small intro'>{{n.title ? n.title : ''}}</view>
          <view class='text-small text-hint'>
            {{n.intro}}
          </view>
        </view>
      </view>
    </view>
  </i-cell-group>

  <i-message id="message" />
</view>