index.wxml 1.8 KB

12345678910111213141516171819202122232425262728293031323334
  1. <view class='container' wx:if="{{tab}}">
  2. <view class='flexRow menus'>
  3. <view wx:for="{{tab.items}}" class=' flex1 jCenter h100 ' data-index='{{index}}' catchtap='meunTap'>
  4. <text class='aCenter h100 {{cur_index==index&&"cur"}}'>{{item.title}}</text>
  5. </view>
  6. </view>
  7. <view class="flex1 relative">
  8. <!-- 兼容低版本iPhone -->
  9. <swiper class='wh100 absolute' current='{{cur_index}}' bindchange='swiperChange'>
  10. <swiper-item wx:for="{{tab.items}}">
  11. <list template="{{tab.template}}" templateData="{{ {title:item.title} }}" request="{{{ ...tab.request,data:item.param} }}" bind:change="change" data-index="{{index}}" reload="{{reloads[index]}}" />
  12. </swiper-item>
  13. </swiper>
  14. </view>
  15. </view>
  16. <!-- 本是要将menu与swiper分开以适应更多场景(如用户信息) 但后期需求又改了 (用户信息不需要切换了) 目前tab已满足现有需求 就不需要再扩展了
  17. (若后期有新需求 请注意 以下功能并未完成 )
  18. <view class='container'>
  19. <view class='flexRow menus'>
  20. <view wx:for="{{menu.items}}" class=' flex1 jCenter h100 ' data-index='{{index}}' catchtap='meunTap'>
  21. <text class='aCenter h100 {{cur_index==index&&"cur"}}'>{{item.title}}</text>
  22. </view>
  23. </view>
  24. <swiper class='flex1' current='{{cur_index}}' bindchange='swiperChange'>
  25. <block wx:if="{{load}}">
  26. <swiper-item wx:for="{{load.items}}">
  27. <view class='flexCol oyScroll h100 '>
  28. <list template="{{item.template||load.template}}" templateData="{{ {title:menu.items[index]} }}" request="{{{type:load.request,url:load.url,data:item.param} }}" bind:change="change" data-index="{{index}}" reload="{{reloads[index]}}" />
  29. </view>
  30. </swiper-item>
  31. </block>
  32. <slot wx:else />
  33. </swiper>
  34. </view> -->