123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184 |
- <!--pages/category/category.wxml-->
- <view class="container" style="padding-top: {{pageTopHeight}}px;">
- <!-- 头部搜索区 -->
- <navbar>
- <view class="top-search-input">
- <swiper vertical="true" circular="true" autoplay="true" interval="3000" class="top-search-swiper" bindtap="toSearchPage" bindchange="topSwiperChange">
- <swiper-item wx:for="{{hotList}}" wx:key="index">{{item.name}}</swiper-item>
- </swiper>
- <view class="top-search-line">|</view>
- <view class="top-search-text" bindtap="topHotSearch">搜索</view>
- </view>
- </navbar>
- <!-- 全部分类弹窗 -->
- <van-popup show="{{ show }}" position="top" close-on-click-overlay="{{false}}" z-index="{{99999}}" round bind:close="onClose">
- <view class="popup-box" style="padding-top: {{pageTopHeight}}px;">
- <!-- 搜索 -->
- <navbar>
- <view class="top-search-input">
- <swiper vertical="true" circular="true" autoplay="true" interval="3000" class="top-search-swiper" bindtap="toSearchPage" bindchange="topSwiperChange">
- <swiper-item wx:for="{{hotList}}" wx:key="index">{{item.name}}</swiper-item>
- </swiper>
- <view class="top-search-line">|</view>
- <view class="top-search-text" bindtap="topHotSearch">搜索</view>
- </view>
- </navbar>
- <!-- 分类 -->
- <view class="top-box top-all-box">
- <view wx:for='{{categoryList}}' class="type-item" wx:key='categoryId' data-index="{{index}}" data-id="{{item.categoryId}}" bindtap='onMenuTab'>
- <!-- <view class="icon"></view> -->
- <image class="icon" src="{{imgUrl+item.icon}}" mode="" />
- <view class='name {{selIndex==index?"active":""}} '>
- {{item.categoryName}}
- </view>
- </view>
- <view wx:if="{{5-(categoryList.length%5) >0}}" style="width: 100rpx;height: 100rpx;"></view>
- <view wx:if="{{5-(categoryList.length%5) >1}}" style="width: 100rpx;height: 100rpx;"></view>
- <view wx:if="{{5-(categoryList.length%5) >2}}" style="width: 100rpx;height: 100rpx;"></view>
- <view wx:if="{{5-(categoryList.length%5) >3}}" style="width: 100rpx;height: 100rpx;"></view>
- </view>
- <view class="close-box" bind:tap="onClose">
- 点击收起
- <image class="icon" src="../../images/icon/more-icon.png" mode="" />
- </view>
- </view>
- </van-popup>
- <!-- 顶部滚动分类 -->
- <view class="top-content">
- <scroll-view scroll-x="true" class='top-box' scroll-into-view="{{'item'+selCategory}}">
- <view wx:for='{{categoryList}}' id="{{'item'+item.categoryId}}" class="type-item" wx:key='{{item.categoryId}}' data-index="{{index}}" data-id="{{item.categoryId}}" bindtap='onMenuTab'>
- <image class="icon" src="{{imgUrl+item.icon}}" mode="" />
- <view class='name {{selIndex==index?"active":""}} '>
- {{item.categoryName}}
- </view>
- </view>
- </scroll-view>
- <view wx:if="{{categoryList.length}}" class="all" bind:tap="handleAll">全部
- <image class="icon" src="../../images/icon/more-icon.png" mode="" />
- </view>
- </view>
- <!-- 滚动内容区 -->
- <view class="main" wx:if="{{categoryList.length>0}}">
- <!-- 左侧菜单start -->
- <scroll-view scroll-y="true" class='leftmenu' scroll-into-view="{{'item'+subIndex}}">
- <view wx:for='{{subCategoryList}}' id="{{'item'+index}}" wx:key='categoryId'>
- <view class='menu-item {{subIndex==index?"active":""}} ' data-index="{{index}}" data-id="{{item.categoryId}}" bindtap='onleftMenuTab'>
- {{item.categoryName}}
- </view>
- </view>
- <view style="height: 200rpx;"></view>
- </scroll-view>
- <!-- 左侧菜单end -->
- <!-- 右侧内容start -->
- <scroll-view scroll-y="true" class='rightcontent' enable-passive scroll-into-view="{{rightView}}" upper-threshold="10" lower-threshold="10" scroll-top="{{topHeight}}" bindscroll="scroll"bindscrolltoupper="scrollTop" bindscrolltolower="scrollBottom">
- <!-- <text wx:if="{{subCategoryList.length>0}}" class="sub-title" >{{subCategoryList[subIndex].categoryName}}</text> -->
- <view class="loading" wx:if="{{showLoading}}">
- <!-- <van-icon class="icon" color="#FF941A" size="50rpx" name="replay" /> -->
- <image class="icon" src="../../images/imgs/loading-icon.png" mode=""/>
- </view>
- <view class="right-top-box">
- <view class="thrid-type-box" wx:if="{{thridCategoryList.length>0}}">
- <view class='thrid-type-item {{thridIndex==-1?"active":""}}' data-index="-1" bind:tap="handleThrid">全部</view>
- <view class='thrid-type-item {{thridIndex==index?"active":""}}' data-index="{{index}}" data-categoryId="{{item.categoryId}}" wx:for="{{thridCategoryList}}" bind:tap="handleThrid">{{item.categoryName}}</view>
- </view>
- <view class="filter-box">
- <view class="filter-item {{sort == 1 ?'active':''}}" bind:tap="handleSale">销量</view>
- <view class="filter-item" bind:tap="handlePrice">价格
- <view class="icon-box">
- <van-icon class="down" size="20rpx" color="{{sort ==2? '#FF941A':'#AAAAAA'}}" name="play" />
- <van-icon class="up" size="20rpx" color="{{sort ==3? '#FF941A':'#AAAAAA'}}" name="play" />
- </view>
- </view>
- </view>
- </view>
- <view class="right-box">
- <view class="product-item" id="{{'test'+index}}" wx:for="{{productList}}">
- <image class="pic" src="{{item.pic}}" mode="" data-prodId="{{item.prodId}}" bind:tap="toProdPage" />
- <view class="info">
- <view class="title" data-prodId="{{item.prodId}}" bind:tap="toProdPage">{{item.prodName}}</view>
- <view class="salesVolume">已售{{item.salesVolume||0}}</view>
- <view class="price-box">
- <view class="price">¥{{item.price}}</view>
- <view wx:if="{{item.show}}" class="num-box">
- <view class="btn" data-num="-1" data-item="{{item}}" bind:tap="handleNum">-</view>
- <view class="num">{{item.prodCount}}</view>
- <view class="btn" data-num="1" data-item="{{item}}" bind:tap="handleNum">+</view>
- </view>
- <image wx:else style="width:52rpx;height:52rpx;" src="/images/icon/car-btn.png" mode="" data-num="1" data-item="{{item}}" bind:tap="handleNum" />
- </view>
- </view>
- </view>
- <view id="empty" class="block" style="height: 90vh;"></view>
- <view class="sub-cate-title not-category-data" wx:if="{{subCategoryList.length==0}}">
- <view class="sub-cate-text">无二级分类</view>
- </view>
- </view>
- </scroll-view>
- <!-- 右侧内容end -->
- </view>
- <view class="not-data-list" wx:else>
- <van-empty image="search" description="附近暂无可配送门店" />
- <view class="reset-localization" bindtap="toLocationPage">定位不准确?<text style="color: rgb(40,120,255);">点击手动定位</text></view>
- </view>
- <!-- 购物车弹窗 -->
- <van-popup show="{{ showCar }}" position="bottom" safe-area-inset-bottom="{{false}}" close-on-click-overlay="{{true}}" z-index="{{99999}}" round bind:close="onCarClose">
- <view class="car-box">
- <view wx:if="{{carData.length}}">
- <view class="item" wx:for="{{carData}}">
- <image class="img" src="{{item.pic}}" mode="" />
- <view class="info">
- <view class="title">{{item.prodName}}</view>
- <view class="desc">规格:{{item.weight}}{{item.weightUnit}}</view>
- <view class="price-box">
- <view class="price">
- <view class="unit">¥</view>
- <view class="num">{{item.price}}</view>
- </view>
- <view class="num-box">
- <view class="btn" data-num="-1" data-item="{{item}}" bind:tap="handleNum">-</view>
- <view class="num">{{item.prodCount}}</view>
- <view class="btn" data-num="1" data-item="{{item}}" bind:tap="handleNum">+</view>
- </view>
- </view>
- </view>
- </view>
- </view>
- <!-- 空 -->
- <view class="empty" wx:else="{{!carData.length}}">
- <view class="empty-icon">
- <image src="../../images/icon/empty-basket.png"></image>
- </view>
- <view class="empty-text">您还没有添加商品到购物车哦~</view>
- </view>
- </view>
-
- </van-popup>
- <view class="bottom-box">
- <view class="left" bindtap="openCar">
- <view class="num" wx:if="{{totalInfo.count}}">{{totalInfo.count}}</view>
- <image class="icon" src="../../images/icon/car-icon.png" mode="" />
- <view class="price-box">
- <view class="top">
- <view class="price">¥{{totalInfo.finalMoney}}</view>
- <view class="reduce-price">共减¥{{totalInfo.subtractMoney}}</view>
- </view>
- <view class="shipping-fee">配送费¥0</view>
- </view>
- </view>
- <view class="btn" bind:tap="handleBuy">去结算</view>
- </view>
- </view>
- <wxs module="wxs" src="../../wxs/number.wxs" />
|