<!--pages/kabaw/detail.wxml-->
<import src='../../wxParse/wxParse.wxml'></import>
<view class="main">
  <view class="detail-box">
    <!-- <view class="title">{{detail.name}}</view> -->
    <view class="img">
      <image class="kabawimg" src="{{detail.pic_url}}" mode="aspectFill"></image>
    </view>
    <view class="minfo">
      <view class="names">
        <view class="name">{{detail.name}}</view><view class="price">¥0.15</view>
      </view>
      <view class="store">
        <view class="address">
          <image src="../../images/weizhi.png" class="weizhi"></image>
          <view class="add" style="width:50%;overflow:hidden">{{detail.address}}</view>
          <!-- <view class="daohang">
            <view>到这里去</view>
            <image src="../../images/user-integral-arrow.png" class="gothere"></image>
          </view> -->
        </view>
      </view>
      <view class="info">
        <view class="title" wx:if="{{way=='use'}}">剩余张数： <text>{{detail.can_use}}张</text></view>
        <!-- <view class="txt" >{{detail.begin_time}}  -  {{detail.end_time}}</view> -->
        <view class="title">使用规则</view>
        <!-- <view class="txt"><template is='wxParse' data='{{wxParseData:detail.nodes}}'></template></view> -->
        <rich-text class="txt" nodes="{{detail.desc}}"></rich-text>
      </view>
      <view class="btn-box" wx:if="{{way=='buy'}}">
        <view class="price">¥{{detail.price}}</view>
        <view class="btns" bindtap="buy">{{detail.is_pay==1?'立即购买':'立即领取'}}</view>
      </view>
      <view class="btn-box" wx:if="{{way=='use'}}">
        <view class="price"></view>
        <view class="btns" bindtap="useit">立即使用</view>
      </view>
    </view>
  </view>
</view>

  <view class="qr_box" wx:if="{{useqr==true}}">
    <view class="qr">
      <view class="title">扫描下方二维码使用</view>
      <view class="goclose" bindtap="close">X</view>
      <view class="qrcode">
        <image class="use_qr" src="{{qrurl}}"></image>
      </view>
      <view class="shuabtn">
        <image src="../../images/shua.png" bindtap="shuaxin" data-id="2"></image>
        <view bindtap="shuaxin" data-id="2">点击刷新</view> 
      </view>
    </view>
  </view>