category.wxml 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <!--pages/category/category.wxml-->
  2. <view class="container" style="padding-top: {{pageTopHeight}}px;">
  3. <!-- 头部搜索区 -->
  4. <navbar>
  5. <view class="top-search-input">
  6. <swiper vertical="true" circular="true" autoplay="true" interval="3000" class="top-search-swiper" bindtap="toSearchPage" bindchange="topSwiperChange">
  7. <swiper-item wx:for="{{hotList}}" wx:key="index">{{item.name}}</swiper-item>
  8. </swiper>
  9. <view class="top-search-line">|</view>
  10. <view class="top-search-text" bindtap="topHotSearch">搜索</view>
  11. </view>
  12. </navbar>
  13. <!-- 滚动内容区 -->
  14. <view class="main" wx:if="{{categoryList.length>0}}">
  15. <!-- 左侧菜单start -->
  16. <scroll-view scroll-y="true" class='leftmenu'>
  17. <block wx:for='{{categoryList}}' wx:key='categoryId'>
  18. <view class='menu-item {{selIndex==index?"active":""}} ' data-index="{{index}}" data-id="{{item.categoryId}}" bindtap='onMenuTab'>
  19. {{item.categoryName}}
  20. </view>
  21. </block>
  22. </scroll-view>
  23. <!-- 左侧菜单end -->
  24. <!-- 右侧内容start -->
  25. <scroll-view scroll-y="true" class='rightcontent' scroll-into-view="{{toViewId}}">
  26. <view class='adver-map'>
  27. <view class='item-a'>
  28. <image src='{{categoryImg}}'></image>
  29. </view>
  30. </view>
  31. <block wx:if="{{subCategoryList.length>0}}">
  32. <block wx:for="{{subCategoryList}}" wx:key='categoryId' wx:for-index='subCateIndex'>
  33. <view class='sub-category'>
  34. <view class="sub-category-con">
  35. <view class="sub-cate-title">
  36. <text class="sub-cate-text">{{item.categoryName}}</text>
  37. <text class="view-all" bindtap="toCatePage" data-type="all" data-subcateindex="{{subCateIndex}}" data-parentid="{{item.parentId}}" data-categoryId="{{item.categoryId}}">查看全部</text>
  38. <van-icon name="arrow" color="#999999" size="14" />
  39. </view>
  40. <view class="th-cate-con">
  41. <block wx:for="{{item.categories}}" wx:key='categoryId' wx:for-item='thCateItem'>
  42. <view class='sub-category-item' bindtap='toCatePage' data-categoryid="{{thCateItem.categoryId}}" data-parentid="{{item.categoryId}}">
  43. <image src='{{thCateItem.pic}}' mode='widthFix' class="sub-category-item-pic"></image>
  44. <text>{{thCateItem.categoryName}}</text>
  45. </view>
  46. </block>
  47. </view>
  48. </view>
  49. </view>
  50. </block>
  51. </block>
  52. <view class="sub-cate-title not-category-data" wx:else>
  53. <view class="sub-cate-text">无二级分类</view>
  54. <view class="view-all" bindtap="toCategoryPage">查看全部
  55. <van-icon name="arrow" color="#999999" size="14" />
  56. </view>
  57. </view>
  58. </scroll-view>
  59. <!-- 右侧内容end -->
  60. </view>
  61. <view class="not-data-list" wx:else>
  62. <van-empty image="search" description="附近暂无可配送门店" />
  63. <view class="reset-localization" bindtap="toLocationPage">定位不准确?<text style="color: rgb(40,120,255);">点击手动定位</text></view>
  64. </view>
  65. </view>
  66. <wxs module="wxs" src="../../wxs/number.wxs" />