index.wxml 8.48 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
    <!-- 网格布局 -->
    <view
      wx:if="{{datas.componentData.style==='list'}}"
      class="goodsItem-list flex"
侯体倬 committed
64
      style="display:grid;grid-template-columns:repeat({{datas.componentData.columnNum}},minmax(0px, 1fr));gap:{{datas.componentData.proGap*2}}rpx;"
65 66
    >
      <view
李嘉林 committed
67
        wx:for="{{goodsList}}"
68
        wx:key="index"
69
        class="goods-item {{'goodsItemIndex'+index}}"
侯体倬 committed
70
        style="margin-bottom:20rpx;"
71
      >
72
        <!-- <goods-item
73
          datas="{{datas}}"
74
          items="{{goodsList[index]}}"
75
          indexs="{{index}}"
76 77
        ></goods-item> -->
        <goods-item
78
          items="{{item}}"
79 80
          datas="{{datas}}"
          indexs="{{index}}"
侯体倬 committed
81
          style="height: 100%;"
82 83
        ></goods-item>
      </view>
84 85 86 87
      <!-- 网格布局滚动加载 -->
      <view class="scrollLoading" wx:if="{{scrollLoading}}">
        <van-loading size="16px" color="#fff"><text class="scrollLoadingText">加载中...</text></van-loading>
      </view>
88 89
    </view>
    <!-- 横向滚动 -->
侯体倬 committed
90
    <view class="goods-across" wx:elif="{{datas.componentData.style==='across'}}" style="display:flex;gap: {{datas.componentData.proGap*2}}rpx;">
91 92 93 94 95 96 97 98 99 100
      <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"
侯体倬 committed
101
        style="width:{{100/datas.componentData.columnNum}}%;flex:0 0 {{100/datas.componentData.columnNum}}%;margin-bottom:20rpx;"
102 103 104 105 106
      >
        <goods-item
          datas="{{datas}}"
          items="{{datas.componentData.goodsList[index]}}"
          indexs="{{index}}"
侯体倬 committed
107
          style="height:100%;"
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
        ></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
128
      id="goods-rowList"
李嘉林 committed
129
      wx:if="{{datas.componentData.style==='rowList'}}"
130 131 132
      style="margin-left:{{-datas.componentData.proGap*2}}rpx;"
    >
      <view
李嘉林 committed
133
        wx:for="{{goodsList}}"
134 135
        wx:key="index"
        class="goods-item"
136
        style="width:{{100/datas.componentData.columnNum}}%;padding-left:{{datas.componentData.proGap*2}}rpx;display:flex;"
137 138 139
      >
        <goods-item
          datas="{{datas}}"
李嘉林 committed
140
          items="{{item}}"
141 142 143
          indexs="{{index}}"
        ></goods-item>
      </view>
李嘉林 committed
144 145
      <!-- 上拉加载底部展示 -->
      <view class="loadBottom" wx:if="{{datas.componentData.moreShow == false && datas.componentData.style == 'rowList'}}">
李嘉林 committed
146 147
        <van-loading size="16px" wx:if="{{loading}}" color="#999"><text class="scrollLoadingText">加载中</text></van-loading>
        <text wx:elif="{{ finished}}">暂无更多</text>
李嘉林 committed
148
      </view>
149 150 151 152 153
    </view>
    <!-- 堆叠卡片 -->
    <view class="goods-heap-Item" wx:if="{{datas.componentData.style==='heap'}}">
      <heap-item datas="{{datas}}"></heap-item>
    </view>
hxx committed
154
    <!-- 轮播滑动 -->
155 156
    <view wx:if="{{datas.componentData.style === 'swipe' && datas.componentData.goodsList.length > 0}}" style="position:relative;">
      <swiper bindchange="handleSwipeChange" style="height: {{swiperHeight}}px">
李嘉林 committed
157
        <block wx:for="{{swipeInfo}}" wx:key="index">
hxx committed
158
          <swiper-item>
159
            <view class="goods-item" style="display: grid;gap:{{datas.componentData.proGap*2}}rpx;grid-template-columns:repeat({{datas.componentData.columnNum}}, 1fr)">
李嘉林 committed
160
              <view wx:for="{{item}}" wx:key="indey" wx:for-index="indey" style="display:flex;">
hxx committed
161 162
                <goods-item
                  datas="{{datas}}"
李嘉林 committed
163
                  items="{{pageGoodsList[datasIndex][index * datas.componentData.columnNum + indey]}}"
hxx committed
164 165 166
                  indexs="{{index}}"
                ></goods-item>
              </view>
HouTiZhuo committed
167 168 169 170
            </view>
          </swiper-item>
        </block>
      </swiper>
171
      <view class="flex custom-indicator" wx:if="{{swiperHeight > 0}}">
李嘉林 committed
172
        <block wx:for="{{swipeInfo}}" wx:key="index">
HouTiZhuo committed
173 174 175 176
          <view class="custom-indicator__item {{currentSwiperIndex === index && 'custom-indicator__active'}}"></view>
        </block>
      </view>
    </view>
李嘉林 committed
177
    <view class="noGoods" wx:if="{{datas.componentData.goodsList.length == 0 && datas.componentData.filterComponentsFlag && !loading && datas.componentData.style != 'rowList'}}">
李嘉林 committed
178 179 180
      <image mode="widthFix" src="https://cdn.mayi888.com/static/img/empty-goods.png"></image>
      没有找到商品
    </view>
181 182 183
    <view
      class="moreBottom"
      bindtap="viewMore"
李嘉林 committed
184
      wx:if="{{datas.componentData['moreShow'] && datas.componentData.moreButtonSite=='bottom' && datas.componentData['goodsSource']!='assign' && datas.componentData['goodsSource']!='intelligenceRec' && !loading}}"
185 186 187 188 189
    >
      查看更多
      <text class="jt"></text>
    </view>
  </view>
李嘉林 committed
190 191
</view>