index.wxml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <wxs src="../../../utils/nova.wxs" module="nova" />
  2. <!-- 导航:预加载各类导航组件并设置TAB显示对应关系 -->
  3. <view class="{{active == 0 ? 'indexPage' : '' }}">
  4. <block wx:for="{{tabbarList}}" wx:key="index" wx:item="item">
  5. <view hidden="{{active == index ? false:true}}">
  6. <block wx:if="{{nova.novapath(item,'module')=='comp'}}">
  7. <template is="{{nova.novapath(item,'tag')}}"
  8. data="{{ ...{id:index},...{isInit:isInit},...{options: nova.novapath(item,'params')} }}" />
  9. </block>
  10. </view>
  11. </block>
  12. </view>
  13. <!-- 注入:组件注入到template中,方便路演变量转tag后加载调用 -->
  14. <block wx:if="{{ template.style == 1 }}">
  15. <template name="nova-home-template1">
  16. <nova-home-template1 id="comp{{id}}" />
  17. </template>
  18. <template name="nova-gourmet-template1">
  19. <nova-gourmet-template1 id="comp{{id}}" />
  20. </template>
  21. <template name="nova-homestay-template1">
  22. <nova-homestay-template1 id="comp{{id}}" />
  23. </template>
  24. <template name="nova-shop-template1">
  25. <nova-shop-template1 id="comp{{id}}" />
  26. </template>
  27. <template name="nova-my-template1">
  28. <nova-my-template1 id="comp{{id}}" />
  29. </template>
  30. </block>
  31. <block wx:elif="{{ template.style == 2 }}">
  32. <template name="nova-home-template2">
  33. <nova-home-template2 id="comp{{id}}" />
  34. </template>
  35. <template name="nova-gourmet-template2">
  36. <nova-gourmet-template2 id="comp{{id}}" />
  37. </template>
  38. <template name="nova-homestay-template2">
  39. <nova-homestay-template2 id="comp{{id}}" />
  40. </template>
  41. <template name="nova-shop-template2">
  42. <nova-shop-template2 id="comp{{id}}" />
  43. </template>
  44. <template name="nova-my-template2">
  45. <nova-my-template2 id="comp{{id}}" />
  46. </template>
  47. </block>
  48. <block wx:else>
  49. <template name="nova-tourism-pages-my-index">
  50. <nova-tourism-pages-my-index id="comp{{id}}" />
  51. </template>
  52. <template name="nova-tourism-pages-shop-index">
  53. <nova-tourism-pages-shop-index id="comp{{id}}" />
  54. </template>
  55. <template name="nova-tourism-pages-home-index">
  56. <nova-tourism-pages-home-index id="comp{{id}}" />
  57. </template>
  58. <template name="nova-tourism-pages-gourmet-index">
  59. <nova-tourism-pages-gourmet-index id="comp{{id}}" />
  60. </template>
  61. <template name="nova-tourism-pages-homestay-index">
  62. <nova-tourism-pages-homestay-index id="comp{{id}}" />
  63. </template>
  64. </block>
  65. <!-- 底部导航 -->
  66. <!-- #009de1 -->
  67. <van-tabbar active="{{ active }}" bind:change="onChange"
  68. active-color="{{tabbarOption.activeColor ? tabbarOption.activeColor : '#009de1' }}"
  69. inactive-color="{{tabbarOption.inactiveColor ? tabbarOption.inactiveColor : '#000000' }}">
  70. <block wx:for="{{tabbarList}}" wx:key="index">
  71. <van-tabbar-item name="{{index}}" wx:if="{{item.open}}">
  72. <image slot="icon" src="{{ item.iconPath }}" mode="aspectFit" style="width:40rpx;height:40rpx;" />
  73. <image slot="icon-active" src="{{ item.selectedIconPath }}" mode="aspectFit"
  74. style="width:40rpx;height:40rpx;" />
  75. {{item.text}}
  76. </van-tabbar-item>
  77. </block>
  78. </van-tabbar>
  79. <!-- <view class="tarbar-module" style="bottom:{{bottomHeight + 10}}rpx">
  80. <view class="tarbar" style="grid-template-columns:repeat({{tabbarList.length}} , {{660 / tabbarList.length + 'rpx'}});">
  81. <block wx:for="{{tabbarList}}" wx:key="index">
  82. <view
  83. class="tarbar-item"
  84. wx:if="{{item.open}}"
  85. data-index="{{index}}"
  86. bind:tap="onChange"
  87. >
  88. <image
  89. wx:if="{{index == active}}"
  90. src="{{ item.selectedIconPath }}"
  91. mode="aspectFit"
  92. class="icon active-icon"
  93. />
  94. <image
  95. wx:else
  96. src="{{ item.iconPath }}"
  97. mode="aspectFit"
  98. class="icon"
  99. />
  100. <view style="color:{{index == active ? tabbarOption.activeColor || '#009de1' : tabbarOption.inactiveColor || '#000000'}}" class="tarbar-text {{index == active ? 'active-text' : ''}}">
  101. {{item.text}}
  102. </view>
  103. </view>
  104. </block>
  105. </view>
  106. </view> -->