index.wxml 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <wxs
  2. src="./index.wxs"
  3. module="utils" />
  4. <view
  5. wx:if="{{ visible }}"
  6. class="ant-guide-tour {{ className || '' }}"
  7. style="{{ style || '' }}">
  8. <mask
  9. show
  10. className="{{ maskClassName }}"
  11. style="z-index:9999;{{ maskStyle || '' }}" />
  12. <ant-icon
  13. type="CloseOutline"
  14. className="ant-guide-tour-clear"
  15. bind:tap="onCancel" />
  16. <view class="ant-guide-tour-button">
  17. <ant-button
  18. wx:if="{{ utils.checkShowJump(mixin.value, items) }}"
  19. inline
  20. size="small"
  21. bind:tap="onCancel">
  22. 跳过
  23. </ant-button>
  24. <ant-button
  25. wx:if="{{ utils.checkShowPrev(mixin.value, items) }}"
  26. inline
  27. size="small"
  28. bind:tap="onPrev"
  29. data-currentValue="{{ mixin.value }}">
  30. 上一步
  31. </ant-button>
  32. <ant-button
  33. wx:if="{{ utils.checkShowNext(mixin.value, items) }}"
  34. inline
  35. size="small"
  36. bind:tap="onNext"
  37. data-currentValue="{{ mixin.value }}">
  38. 下一步
  39. </ant-button>
  40. <ant-button
  41. wx:if="{{ utils.checkShowKnow(mixin.value, items) }}"
  42. inline
  43. size="small"
  44. bind:tap="onCancel">
  45. 知道了
  46. </ant-button>
  47. </view>
  48. <block wx:if="{{ swiperable }}">
  49. <view class="ant-guide-tour-indicator">
  50. <block
  51. wx:for="{{ items }}"
  52. wx:for-index="index"
  53. wx:for-item="item">
  54. <view
  55. class="ant-guide-tour-indicator-dot {{ index === mixin.value ? 'ant-guide-tour-indicator-dot-active' : '' }}" />
  56. </block>
  57. </view>
  58. <swiper
  59. class="ant-guide-tour-swiper"
  60. current="{{ mixin.value }}"
  61. adjust-height="none"
  62. style="height: 100vh"
  63. bind:change="onSwiperChange">
  64. <block
  65. wx:for="{{ items }}"
  66. wx:for-index="index"
  67. wx:for-item="item">
  68. <swiper-item>
  69. <view
  70. class="ant-guide-tour-item {{ item.className || '' }}"
  71. style="top:{{ item.top }}px; left:{{ item.left }}px">
  72. <image
  73. wx:if="{{ item.imageUrl }}"
  74. class="ant-guide-tour-item-img"
  75. src="{{ item.imageUrl }}"
  76. style="{{ item.imageStyle }}"
  77. mode="{{ item.imageMode }}" />
  78. <slot
  79. wx:else
  80. name="step"
  81. index="{{ current }}" />
  82. </view>
  83. </swiper-item>
  84. </block>
  85. </swiper>
  86. </block>
  87. <block wx:else>
  88. <block
  89. wx:for="{{ items }}"
  90. wx:for-index="index"
  91. wx:for-item="item">
  92. <view
  93. wx:if="{{ mixin.value === index }}"
  94. class="ant-guide-tour-item {{ item.className || '' }}"
  95. style="top:{{ item.top }}px; left:{{ item.left }}px">
  96. <image
  97. wx:if="{{ item.imageUrl }}"
  98. class="ant-guide-tour-item-img"
  99. src="{{ item.imageUrl }}"
  100. style="{{ item.imageStyle }}"
  101. mode="{{ item.imageMode }}" />
  102. <slot
  103. wx:else
  104. name="step"
  105. index="{{ index }}" />
  106. </view>
  107. </block>
  108. </block>
  109. </view>