<wrapper>
  <view class="loading" a:if="{{!record}}">
    <loading size="6rpx" />
  </view>
  <view class="merchant-detail-component" a:if="{{!!record}}">
    <view class="swiper-box">
      <swiper
        class="swiper"
        onChange="onChange"
      >
        <swiper-item class="swiper-item-box" key="*this" a:for="{{record.merchantStorePics}}">
          <image src="{{item}}" class="swiper-item" />
        </swiper-item>
      </swiper>
      <view class="swiper-dots">
        {{current + 1}}/{{record.merchantStorePics.length}}
      </view>
    </view>
    <view class="header">
      <view class="name">
        {{record.merchantStoreName}}
      </view>
      <view class="tags" a:if="{{record.discountStoreRange}}">
        <view
          a:for="{{record.discountStoreRange}}"
          key="*this"
          a:for-item="tag"
        >
          {{tag}}
        </view>
      </view>
      <view class="text">
        <view>营业时间：{{record.businessHours}}</view>
        <view onTap="onMakePhoneCall">联系电话：{{record.contactInformation}}</view>
      </view>
      <view class="map">
        <view class="desc">
          {{record.merchantStoreAddress}}
        </view>
        <view class="icon" onTap="onOpenLocation">
          <image src="https://gw.alipayobjects.com/mdn/rms_9641e0/afts/img/A*KhwlRKzfLjwAAAAAAAAAAAAAARQnAQ" />
          <view>地图</view>
        </view>
      </view>
    </view>
    <view class="body">
      <view class="title">优惠方式</view>
      <view class="desc">
        {{record.discountStoreWay || '暂无'}}
      </view>
    </view>
    <view class="body">
      <view class="title">优惠规则</view>
      <view class="desc">
        <view
          a:for="{{record.discountStoreRules}}"
          key="*this"
          a:for-item="tag"
        >
          {{tag.ruleName}}
        </view>
      </view>
    </view>
    <view class="body">
      <view class="title">商家详情</view>
      <view class="rich-text">
        <block a:if="{{record.merchantStoreDetailPic}}">
          <image src="{{record.merchantStoreDetailPic}}" />
        </block>
        <block a:else>
          {{record.merchantStoreDetailInfo || '暂无'}}
        </block>
      </view>
    </view>
  </view>
</wrapper>
