index.wxml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <wxs src="../wxs/utils.wxs" module="utils" />
  2. <button
  3. id="{{ id }}"
  4. class="custom-class {{ utils.bem('button', [type, size, { block, round, plain, square, loading, disabled, hairline, unclickable: disabled || loading }]) }} {{ hairline ? 'van-hairline--surround' : '' }}"
  5. hover-class="van-button--active hover-class"
  6. lang="{{ lang }}"
  7. style="{{ style }} {{ customStyle }}"
  8. open-type="{{ openType }}"
  9. business-id="{{ businessId }}"
  10. session-from="{{ sessionFrom }}"
  11. send-message-title="{{ sendMessageTitle }}"
  12. send-message-path="{{ sendMessagePath }}"
  13. send-message-img="{{ sendMessageImg }}"
  14. show-message-card="{{ showMessageCard }}"
  15. app-parameter="{{ appParameter }}"
  16. aria-label="{{ ariaLabel }}"
  17. bindtap="onClick"
  18. bindgetuserinfo="bindGetUserInfo"
  19. bindcontact="bindContact"
  20. bindgetphonenumber="bindGetPhoneNumber"
  21. binderror="bindError"
  22. bindlaunchapp="bindLaunchApp"
  23. bindopensetting="bindOpenSetting"
  24. >
  25. <block wx:if="{{ loading }}">
  26. <van-loading
  27. custom-class="loading-class"
  28. size="{{ loadingSize }}"
  29. type="{{ loadingType }}"
  30. color="{{ type === 'default' ? '#c9c9c9' : 'white' }}"
  31. />
  32. <view
  33. wx:if="{{ loadingText }}"
  34. class="van-button__loading-text"
  35. >
  36. {{ loadingText }}
  37. </view>
  38. </block>
  39. <block wx:else>
  40. <van-icon
  41. wx:if="{{ icon }}"
  42. size="1.2em"
  43. name="{{ icon }}"
  44. class="van-button__icon"
  45. custom-style="line-height: inherit;"
  46. />
  47. <view class="van-button__text">
  48. <slot />
  49. </view>
  50. </block>
  51. </button>