当前位置:   article > 正文

小程序商城开发,二级分类列表实现点击分类标题切换商品显示,前端和接口代码_商城点击分类搜索前端的实现

商城点击分类搜索前端的实现

废话不说直接上代码

<!-- HTML --!>
<navigation id='Navigation' show-search='{
   {true}}'></navigation>
<view class="container">
  <view class="type-container-boxx">
  <!-- 分类 -->
    <view class="type-container">
      <view wx:for-items="{
   {firstclasslist}}" wx:key="id" class="type-box" bindtap="firstclassClick" id="{
   {item.id}}">
        <view class="type-navbar-item {
   {classid == item.id ? 'type-item-on' : ''}}">
          {
   {
   item.name}}
        </view>
      </view>
    </view>
    <view class="type-list">
    <!-- 分类轮播图 -->
      <view class="swiper-container">
        <swiper class="swiper_box" autoplay="{
   {autoplay}}" interval="{
   {interval}}" duration="{
   {duration}}" bindchange="swiperchange">
          <block wx:for="{
   {banners}}" wx:key="id">
            <swiper-item>
              <image bindtap="toDetailsTap" data-id="{
   {item.businessId}}" src="{
   {item.picUrl}}_m" class="slide-image" mode="widthFix" />
            </swiper-item>
          </block>
        </swiper>
        <view class="dots">
          <block wx:for="{
   {banners}}" wx:key="unique">
            <view class="dot{
   {index == swiperCurrent ? ' active' : ''}}"></view>
          </block>
        </view>
      </view>
      <!-- 分类商品 -->
      <view class="type-menu">
        <view class="type-level-box" wx:for="{
   {twoclasslist}}" wx:key="id">
          <view id="{
   {item.id}}" class="type-level-item " bindtap="levelClick" data-id="{
   {item.id}}">
            <image class="type-img" src="http://shop.linkeddream.com{
   {item.pic}}"></image>
            <text>{
   {
   item.name}}</text>
          </view>
        </view>
      </view>
    </view>
  </view>
</view>
<view hidden="{
   {search}}" class="search-box {
   {iponesc}}">
  <view hidden="{
   {searchidden}}" class="goods-box" wx:for-items="{
   {searchs}}" wx:key="index" bindtap="toDetailsTap" data-id="{
   {item.id}}">
    <view class="img-box">
      <image src="{
   {item.pic}}_m" class="image" mode="widthFix" lazy-load="true" />
      <view class="goods-characteristic">
        <text>{
   {
   item.characteristic}}</text>
      </view>
    </view>
    <view class="goods-title">{
   {
   item.name}}</view>
    <view style='display:flex;'>
      <view class="goods-price">Ұ{
   {
   item.minPrice}}</view>
      <view class="goods-price-naver">已售{
   {
   item.numberOrders}}</view>
    </view>
  </view>
  <view hidden="{
   {nonehidden}}" class=<
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小丑西瓜9/article/detail/247270
推荐阅读
相关标签