index.wxml 8.19 KB
Newer Older
李嘉林 committed
1
<!-- 商品列表组件 -->
李嘉林 committed
2
<view class="goodsList" style="padding-top:{{datas.componentData.paddingList[0].value*2}}rpx;padding-bottom:{{datas.componentData.paddingList[1].value*2}}rpx;padding-left:{{datas.componentData.paddingList[2].value*2}}rpx;padding-right:{{datas.componentData.paddingList[3].value*2}}rpx;">
3 4 5 6 7 8 9 10 11 12 13 14
  <view class="list-wrap heap-wrap" style="background-color:{{datas.componentData['heapBgColorShow'] ? datas.componentData['heapBgColor'] : ''}};border-radius:{{datas.componentData['cardBorderRadius']*2}}rpx;">
    <!-- 头部 -->
    <view class="tops flex" style="padding:{{(datas.componentData['titleIcon'] || (datas.componentData['moreShow'] && datas.componentData.moreButtonSite=='top')) ?'0rpx 0rpx 0rpx 10rpx' : ''}};margin-bottom:{{datas.componentData['titleCardGap']*2}}rpx">
      <view class="left flex">
        <view class="img" wx:if="{{titleIcon}}">
          <image mode="widthFix" src="{{titleIcon}}" />
        </view>
        <view class="title">{{datas.componentData['titles']}}</view>
      </view>
      <view
        class="moreTop"
        bindtap="viewMore"
hxx committed
15
        wx:if="{{datas.componentData['moreShow'] && datas.componentData.moreButtonSite=='top' && datas.componentData['goodsSource']!='assign' && datas.componentData['goodsSource']!='intelligenceRec'}}"
16 17 18 19 20
      >
        查看更多
        <text class="jt"></text>
      </view>
    </view>
李嘉林 committed
21 22 23 24 25 26 27 28
    <!-- 筛选组件 -->
    <view class="filterComponents" wx:if="{{datas.componentData.filterComponentsFlag}}">
      <view class="filterInput flex">
        <i class="iconfont-common common-iconsousuo"></i>
        <input type="text" placeholder="搜索" bindinput="filterInput" />
        <view class="btn" bindtap="init">搜索</view>
      </view>
      <view class="filterCondition flex">
李嘉林 committed
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
        <view class="left flex">
          <view class="filterItem {{filterType == -1?'activeStatus':''}}" bindtap="filterGoods" data-item="{{-1}}">
            综合
          </view>
          <view class="filterItem {{filterType == 3?'activeStatus':''}}" bindtap="filterGoods" data-item="{{3}}">
            销量
          </view>
          <view class="filterItem flex filterPrice {{filterType == 2?'activeStatus':''}}" bindtap="filterGoods" data-item="{{2}}">
            <text>价格</text>
            <view class="svgItem flex">
              <view class="arrowTop">
                <m-svg src="/static/svg/arrowTop.svg" colors="{{[filterType == 2 && filterPriceType == 0?mainColor:'']}}"></m-svg>
              </view>
              <view class="arrowBottom">
                <m-svg src="/static/svg/arrowBottom.svg" colors="{{[filterType == 2 && filterPriceType == 1?mainColor:'']}}"></m-svg>
              </view>
李嘉林 committed
45 46
            </view>
          </view>
李嘉林 committed
47 48 49
          <view class="filterItem {{filterType == 8?'activeStatus':''}}" bindtap="filterGoods" data-item="{{8}}">
            上新
          </view>
李嘉林 committed
50
        </view>
李嘉林 committed
51 52 53
        <view class="filterItem flex verticalLine">|</view>
        <view class="filterItem flex {{selectScreen == true?'activeStatus':''}}" bindtap="filterGoods" data-item="{{99}}">
          <text>筛选</text>
李嘉林 committed
54
          <view class="shaixuan">
李嘉林 committed
55
            <m-svg src="/static/svg/shaixuan1.svg" colors="{{[selectScreen == true?mainColor:'']}}"></m-svg>
李嘉林 committed
56 57 58 59
          </view>
        </view>
      </view>
    </view>
60 61 62 63 64 65 66
    <!-- 网格布局 -->
    <view
      wx:if="{{datas.componentData.style==='list'}}"
      class="goodsItem-list flex"
      style="margin-left:{{-datas.componentData.proGap*2}}rpx;"
    >
      <view
67
        wx:for="{{pageGoodsList[datasIndex]}}"
68
        wx:key="index"
69
        class="goods-item {{'goodsItemIndex'+index}}"
70 71
        style="width:{{100/datas.componentData.columnNum}}%;padding-left:{{datas.componentData.proGap*2}}rpx"
      >
72
        <!-- <goods-item
73
          datas="{{datas}}"
74
          items="{{goodsList[index]}}"
75
          indexs="{{index}}"
76 77 78 79 80
        ></goods-item> -->
        <goods-item
          items="{{item}}"
          datas="{{datas}}"
          indexs="{{index}}"
81 82
        ></goods-item>
      </view>
83 84 85 86
      <!-- 网格布局滚动加载 -->
      <view class="scrollLoading" wx:if="{{scrollLoading}}">
        <van-loading size="16px" color="#fff"><text class="scrollLoadingText">加载中...</text></van-loading>
      </view>
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
    </view>
    <!-- 横向滚动 -->
    <view class="goods-across" wx:elif="{{datas.componentData.style==='across'}}">
      <view class="prev-btn">
        <text class="iconfont-common common-iconyoujiantou"></text>
      </view>
      <view class="next-btn">
        <text class="iconfont-common common-iconyoujiantou"></text>
      </view>
      <view
        wx:for="{{datas.componentData.goodsList}}"
        wx:key="index"
        class="goods-item"
        style="width:{{100/datas.componentData.columnNum}}%;margin-right:{{datas.componentData.proGap*2}}rpx"
      >
        <goods-item
          datas="{{datas}}"
          items="{{datas.componentData.goodsList[index]}}"
          indexs="{{index}}"
        ></goods-item>
      </view>
    </view>
    <!-- 瀑布流 -->
    <view wx:if="{{datas.componentData.style==='waterfall'}}">
      <waterfall-flow
        generic:defaultCom="goods-item"
        id="waterfallFlow"
        note="{{datas.componentData.goodsList}}"
        datas="{{datas}}"
        padding="{{datas.componentData.proGap}}"
        wx:if="{{datas.componentData.goodsList}}"
        bindonLoad="onLoad"
        loading="{{loading}}"
        finished="{{finished}}"
      ></waterfall-flow>
    </view>
    <!-- 横向列表 -->
    <view
      class="goods goods-rowList"
李嘉林 committed
126
      id="goods-rowList"
李嘉林 committed
127
      wx:if="{{datas.componentData.style==='rowList'}}"
128 129 130
      style="margin-left:{{-datas.componentData.proGap*2}}rpx;"
    >
      <view
李嘉林 committed
131
        wx:for="{{pageGoodsList[datasIndex]}}"
132 133 134 135 136 137
        wx:key="index"
        class="goods-item"
        style="width:{{100/datas.componentData.columnNum}}%;padding-left:{{datas.componentData.proGap*2}}rpx"
      >
        <goods-item
          datas="{{datas}}"
李嘉林 committed
138
          items="{{pageGoodsList[datasIndex][index]}}"
139 140 141
          indexs="{{index}}"
        ></goods-item>
      </view>
李嘉林 committed
142 143
      <!-- 上拉加载底部展示 -->
      <view class="loadBottom" wx:if="{{datas.componentData.moreShow == false && datas.componentData.style == 'rowList'}}">
李嘉林 committed
144 145
        <van-loading size="16px" wx:if="{{loading}}" color="#999"><text class="scrollLoadingText">加载中</text></van-loading>
        <text wx:elif="{{ finished}}">暂无更多</text>
李嘉林 committed
146
      </view>
147 148 149 150 151
    </view>
    <!-- 堆叠卡片 -->
    <view class="goods-heap-Item" wx:if="{{datas.componentData.style==='heap'}}">
      <heap-item datas="{{datas}}"></heap-item>
    </view>
hxx committed
152
    <!-- 轮播滑动 -->
李嘉林 committed
153
    <view wx:if="{{datas.componentData.style === 'swipe'}}" style="position:relative;">
HouTiZhuo committed
154 155
      <swiper bindchange="handleSwipeChange">
        <block wx:for="{{swipeInfo}}">
hxx committed
156 157 158 159 160 161 162 163 164
          <swiper-item>
            <view style="display: grid;gap:{{datas.componentData.proGap*2}}rpx;grid-template-columns:repeat({{datas.componentData.columnNum}}, 1fr)">
              <view wx:for="{{item}}" wx:for-index="indey">
                <goods-item
                  datas="{{datas}}"
                  items="{{datas.componentData.goodsList[index * datas.componentData.columnNum + indey]}}"
                  indexs="{{index}}"
                ></goods-item>
              </view>
HouTiZhuo committed
165 166 167 168 169 170 171 172 173 174
            </view>
          </swiper-item>
        </block>
      </swiper>
      <view class="flex custom-indicator">
        <block wx:for="{{swipeInfo}}">
          <view class="custom-indicator__item {{currentSwiperIndex === index && 'custom-indicator__active'}}"></view>
        </block>
      </view>
    </view>
李嘉林 committed
175
    <view class="noGoods" wx:if="{{datas.componentData.goodsList.length == 0 && datas.componentData.filterComponentsFlag && !loading && datas.componentData.style != 'rowList'}}">
李嘉林 committed
176 177 178
      <image mode="widthFix" src="https://cdn.mayi888.com/static/img/empty-goods.png"></image>
      没有找到商品
    </view>
179 180 181
    <view
      class="moreBottom"
      bindtap="viewMore"
李嘉林 committed
182
      wx:if="{{datas.componentData['moreShow'] && datas.componentData.moreButtonSite=='bottom' && datas.componentData['goodsSource']!='assign' && datas.componentData['goodsSource']!='intelligenceRec' && !loading}}"
183 184 185 186 187
    >
      查看更多
      <text class="jt"></text>
    </view>
  </view>
李嘉林 committed
188 189
</view>