<!--packageH/shopRanking/shopRankingList/list.wxml-->
<wxs module="themeTool">
  function rankMet(str) {
    if (str == 1) {
      return '昨日'
    } else if (str == 2) {
      return '上一周'
    } else if (str == 3) {
      return '上一月'
    } else if (str == 4) {
      return '上一季度'
    }
  }
  module.exports = {
    rankMet: rankMet
  }
</wxs>
<view id="shopRankingList">
  <!-- <view class="title">商品排行榜</view> -->
  <view class="banner">
    <image src="{{topBanner}}"></image>
    <!-- 分类 -->
    <view class="classifY" wx:if="{{status}}">
      <view class="classMr {{calsst == 'z' ? 'classbtn' : 'selectBtn'}}" catchtap="tapClass" data-ind="z">{{info.name}}</view>
      <view class="classMr {{calsst == index ? 'classbtn' : 'selectBtn'}}" catchtap="tapClass"
        wx:for="{{info.other_rank_list}}" wx:for-item='inst' wx:key="index" data-ind="{{index}}">{{inst.name}}</view>
    </view>
    <view class="listBox {{status == '0' ? 'isfenlei' : ''}}">
      <view class="list" wx:if="{{status == '1' && calsst!='z'}}" wx:for="{{navinfo.goods_list}}" wx:key="index"
      bindtap='goDetail' data-id="{{item.id}}">
        <view class="left">
          <image src="{{item.thumb}}" alt=""></image>
          <view class="posInd" style="background-image: url('https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/shopRanking.png')"
            wx:if="{{index == '0'}}">{{index + 1}}</view>
          <view class="posInd" style="background-image: url('https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/shopRanking2.png')"
            wx:if="{{index == '1'}}">{{index + 1}}</view>
          <view class="posInd" style="background-image: url('https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/shopRanking3.png')"
            wx:if="{{index == '2'}}">{{index + 1}}</view>
          <view class="posInd" style="background-image: url('https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/shopRanking4.png')"
            wx:if="{{index > 2}}">{{index + 1}}</view>
        </view>
        <view class="right">
          <view class="rightTop">
            <view class="shoptitle">{{item.title}}</view>
            <view class="seleNumber">
              <icon class="iconfont icon-fontclass-shouchu"></icon>
              {{themeTool.rankMet(navinfo.rank_type)}}售出 <view class="p">{{item.sales_volume}}</view> 件
            </view>
          </view>
          <view class="price">￥{{item.price}}</view>
        </view>
      </view>
      <view class="list" wx:if="{{status == '0'}}" wx:for="{{info.goods_list}}" wx:key="index" bindtap='goDetail'
        data-id="{{item.id}}">
        <view class="left">
          <image src="{{item.thumb}}" alt=""></image>
          <view class="posInd" style="background-image: url('https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/shopRanking.png')"
            wx:if="{{index == '0'}}">{{index + 1}}</view>
          <view class="posInd" style="background-image: url('https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/shopRanking2.png')"
            wx:if="{{index == '1'}}">{{index + 1}}</view>
          <view class="posInd" style="background-image: url('https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/shopRanking3.png')"
            wx:if="{{index == '2'}}">{{index + 1}}</view>
          <view class="posInd" style="background-image: url('https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/shopRanking4.png')"
            wx:if="{{index > 2}}">{{index + 1}}</view>
        </view>
        <view class="right">
          <view class="rightTop">
            <view class="shoptitle">{{item.title}}</view>
            <view class="seleNumber">
              <icon class="iconfont icon-fontclass-shouchu"></icon>
              {{themeTool.rankMet(info.rank_type)}}售出 <view class="p">{{item.sales_volume}}</view> 件
            </view>
          </view>
          <view class="price">{{language['money']}}{{item.price}}</view>
        </view>
      </view>
      <view class="list" wx:if="{{status == '1' && calsst == 'z'}}" wx:for="{{info.goods_list}}" wx:key="index"
        bindtap='goDetail' data-id="{{item.id}}">
        <view class="left">
          <image src="{{item.thumb}}" alt=""></image>
          <view class="posInd" style="background-image: url('https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/shopRanking.png')"
            wx:if="{{index == '0'}}">{{index + 1}}</view>
          <view class="posInd" style="background-image: url('https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/shopRanking2.png')"
            wx:if="{{index == '1'}}">{{index + 1}}</view>
          <view class="posInd" style="background-image: url('https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/shopRanking3.png')"
            wx:if="{{index == '2'}}">{{index + 1}}</view>
          <view class="posInd" style="background-image: url('https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/shopRanking4.png')"
            wx:if="{{index > 2}}">{{index + 1}}</view>
        </view>
        <view class="right">
          <view class="rightTop">
            <view class="shoptitle">{{item.title}}</view>
            <view class="seleNumber">
              <icon class="iconfont icon-fontclass-shouchu"></icon>
              {{themeTool.rankMet(info.rank_type)}}售出 <view class="p">{{item.sales_volume}}</view> 件
            </view>
          </view>
          <view class="price">{{language['money']}}{{item.price}}</view>
        </view>
      </view>
    </view>
  </view>
</view>
<shopfoot></shopfoot>