<view class='promotionProd'>
  <!-- 搜索框 -->
  <view class='pd-seach'>
    <input type='text' placeholder='请输入商品名称' confirm-type="search" bindinput="onProdNameInput" bindconfirm="onProdNameSearch" />
    <view class='pd-seach-icon'>
      <image src="../../images/icon/sousuo.png"></image>
    </view>
  </view>

  <!--头部导航tab -->
  <view class='pd-tab'>
    <view class='pd-tab-list'>
      <!-- <view class="tab-item {{sort==0 && (orderBy==1?'down':'up')}}" bindtap='onTabTouch' data-sort='0'>佣金</view> -->
      <view class="tab-item {{sort==1 && (orderBy==1?'down':'up')}}" bindtap='onTabTouch' data-sort='1'>最新</view>
      <view class="tab-item {{sort==2 && (orderBy==1?'down':'up')}}" bindtap='onTabTouch' data-sort='2'>销量</view>
      <view class="tab-item {{sort==3 && (orderBy==1?'down':'up')}}" bindtap='onTabTouch' data-sort='3'>价格</view>
    </view>
  </view>

  <view class='pd-main'>
    <!-- 商品项 -->
    <view class="pd-item" wx:for="{{records}}" wx:key="index">
      <view class="pd-item-top">
        <view class="pd-item-left">
          <image src="{{item.pic}}"></image>
        </view>
        <view class="pd-item-right">
          <view class="pd-item-tit">
            {{item.prodName}}
          </view>
          <view class="pd-item-price">
            <text>￥</text>{{wxs.toPrice(item.price)}}
          </view>
          <view class="pd-item-info">
            <text class="rate">预计可赚 {{item.awardNumber}}{{item.awardProportion==0?'%':'元'}}</text>
          </view>
          <view class="pd-item-btm">
            <view class='btn' bindtap='onShowShare' data-prodid="{{item.prodId}}" 
              data-prodname="{{item.prodName}}" data-pic="{{item.pic}}"  data-type="2">分享</view>
          </view>
        </view>
      </view>
    </view>
    <!-- 商品项 end -->

  </view>
  <view class="empty" wx:if="{{records.length==0}}">{{emptyMsg}}</view>
  <view class="loading" wx:if="{{totalPage>1}}">{{loadingMsg}}</view>

</view>

<!-- 分享弹窗 -->
<view class='promo-share' wx:if="{{shareShow}}">
  <view class='promo-main'>
    <view class='promo-icons-close' bindtap='closeEarn'>
      <image src="../../images/icon/close.png"></image>
    </view>
    <view class='promo-tit'>
      <title>立即分享给好友</title>
    </view>
    <view class='promo-desc'>
      <text>朋友通过你分享的页面成功购买后，你可获得对应的佣金，佣金可“个人中心-分销员中心" 里查看</text>
    </view>
    <view class='promo-icons'>
      <button class='promo-img1' open-type='share'>
        <image src="../../images/icon/weixin.png" ></image>
        微信
      </button>
      <view class='promo-img1' bindtap='genWeixinCode'>
        <image src="../../images/icon/erweima.png"></image>
        二维码
      </view>

    </view>
  </view>
</view>
<!-- 分享弹窗 end -->

<!-- 二维码弹窗 -->
<view class='code-popup' wx:if="{{wxCodeShow}}" >
  <view class='code-main'>
    <view class="close-v" catchtap='closeCodePopup'><image src="../../images/icon/close.png" class="close-png"></image></view>
    <view class="code-v"><image src="{{shareWxCode}}" class="wx-code"></image></view>
    <view class="code-txt" bindtap="downloadImg">保存至相册</view>
  </view>
</view>
<!-- 二维码弹窗 end -->

<wxs module="wxs" src="../../wxs/number.wxs" />