index.wxml 1.6KB

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. open-type="{{ openType }}"
  6. hover-class="van-button--active hover-class"
  7. style="{{ color ? 'border-color: ' + color + ';' + (plain ? 'color: ' + color : 'color: #fff; background-color: ' + color) : '' }}"
  8. lang="{{ lang }}"
  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. color="{{ type === 'default' ? '#c9c9c9' : '' }}"
  30. />
  31. <view
  32. wx:if="{{ loadingText }}"
  33. class="van-button__loading-text"
  34. >
  35. {{ loadingText }}
  36. </view>
  37. </block>
  38. <block wx:else>
  39. <van-icon
  40. wx:if="{{ icon }}"
  41. size="1.2em"
  42. name="{{ icon }}"
  43. class="van-button__icon"
  44. custom-style="line-height: inherit;"
  45. />
  46. <view class="van-button__text">
  47. <slot />
  48. </view>
  49. </block>
  50. </button>