pull-down-refresh.wxml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <scroll-view
  2. class="{{classPrefix}} {{prefix}}-class"
  3. scroll-top="{{scrollTop}}"
  4. bind:touchstart="onTouchStart"
  5. bind:touchmove="onTouchMove"
  6. bind:touchend="onTouchEnd"
  7. bind:scroll="onScroll"
  8. bindscrolltoupper="onScrollToTop"
  9. bindscrolltolower="onScrollToBottom"
  10. scroll-y
  11. enable-back-to-top
  12. enhanced
  13. scroll-with-animation
  14. bounces="{{false}}"
  15. >
  16. <view
  17. class="{{classPrefix}}__track {{classPrefix + '__track--' + (loosing ? 'loosing' : '')}}"
  18. style="transform: translate3d(0, {{barHeight + 'rpx'}}, 0);"
  19. >
  20. <view class="{{classPrefix}}__tips" style="height: {{computedLoadingBarHeight}}rpx">
  21. <t-loading
  22. wx:if="{{refreshStatus === 2}}"
  23. delay="{{loadingProps.delay || 0}}"
  24. duration="{{loadingProps.duration || 800}}"
  25. indicator="{{loadingProps.indicator || true}}"
  26. layout="{{loadingProps.layout || 'horizontal'}}"
  27. loading="{{loadingProps.loading || true}}"
  28. pause="{{loadingProps.pause || false}}"
  29. progress="{{loadingProps.progress}}"
  30. reverse="{{loadingProps.reverse}}"
  31. size="{{loadingProps.size || '50rpx'}}"
  32. text="{{loadingProps.text || loadingTexts[refreshStatus]}}"
  33. theme="{{loadingProps.theme || 'circular'}}"
  34. t-class-indicator="{{prefix}}-class-indicator"
  35. />
  36. <view wx:elif="{{refreshStatus >= 0}}" class="{{classPrefix}}__text {{prefix}}-class-text"
  37. >{{loadingTexts[refreshStatus]}}</view
  38. >
  39. </view>
  40. <slot />
  41. </view>
  42. </scroll-view>