index.wxml 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <wxs src="../wxs/utils.wxs" module="utils" />
  2. <van-popup
  3. show="{{ show }}"
  4. z-index="{{ zIndex }}"
  5. overlay="{{ overlay }}"
  6. transition="{{ transition }}"
  7. custom-class="van-dialog van-dialog--{{ theme }}{{ className }} custom-class"
  8. custom-style="width: {{ utils.addUnit(width) }};{{ customStyle }}"
  9. overlay-style="{{ overlayStyle }}"
  10. close-on-click-overlay="{{ closeOnClickOverlay }}"
  11. bind:close="onClickOverlay"
  12. >
  13. <view
  14. wx:if="{{ title || useTitleSlot }}"
  15. class="{{ utils.bem('dialog__header', { isolated: !(message || useSlot) }) }}"
  16. >
  17. <slot wx:if="{{ useTitleSlot }}" name="title" />
  18. <block wx:elif="{{ title }}">{{ title }}</block>
  19. </view>
  20. <slot wx:if="{{ useSlot }}" />
  21. <view
  22. wx:elif="{{ message }}"
  23. class="{{ utils.bem('dialog__message', [theme, messageAlign, { hasTitle: title }]) }}"
  24. >
  25. <text class="van-dialog__message-text">{{ message }}</text>
  26. </view>
  27. <van-goods-action wx:if="{{ theme === 'round-button' }}" custom-class="van-dialog__footer--round-button">
  28. <van-goods-action-button
  29. wx:if="{{ showCancelButton }}"
  30. size="large"
  31. loading="{{ loading.cancel }}"
  32. class="van-dialog__button van-hairline--right"
  33. custom-class="van-dialog__cancel cancle-button-class"
  34. custom-style="color: {{ cancelButtonColor }}"
  35. bind:click="onCancel"
  36. >
  37. {{ cancelButtonText }}
  38. </van-goods-action-button>
  39. <van-goods-action-button
  40. wx:if="{{ showConfirmButton }}"
  41. size="large"
  42. class="van-dialog__button"
  43. loading="{{ loading.confirm }}"
  44. custom-class="van-dialog__confirm confirm-button-class"
  45. custom-style="color: {{ confirmButtonColor }}"
  46. button-id="{{ confirmButtonId }}"
  47. open-type="{{ confirmButtonOpenType }}"
  48. lang="{{ lang }}"
  49. business-id="{{ businessId }}"
  50. session-from="{{ sessionFrom }}"
  51. send-message-title="{{ sendMessageTitle }}"
  52. send-message-path="{{ sendMessagePath }}"
  53. send-message-img="{{ sendMessageImg }}"
  54. show-message-card="{{ showMessageCard }}"
  55. app-parameter="{{ appParameter }}"
  56. bindagreeprivacyauthorization="onAgreePrivacyAuthorization"
  57. bind:click="onConfirm"
  58. bindgetuserinfo="onGetUserInfo"
  59. bindcontact="onContact"
  60. bindgetphonenumber="onGetPhoneNumber"
  61. binderror="onError"
  62. bindlaunchapp="onLaunchApp"
  63. bindopensetting="onOpenSetting"
  64. >
  65. {{ confirmButtonText }}
  66. </van-goods-action-button>
  67. </van-goods-action>
  68. <view wx:elif="{{ showCancelButton || showConfirmButton }}" class="van-hairline--top van-dialog__footer">
  69. <block wx:if="{{ showCancelButton }}">
  70. <slot wx:if="{{ useCancelButtonSlot }}" name="cancel-button" />
  71. <van-button
  72. wx:else
  73. size="large"
  74. loading="{{ loading.cancel }}"
  75. class="van-dialog__button van-hairline--right"
  76. custom-class="van-dialog__cancel cancle-button-class"
  77. custom-style="color: {{ cancelButtonColor }}"
  78. bind:click="onCancel"
  79. >
  80. {{ cancelButtonText }}
  81. </van-button>
  82. </block>
  83. <block wx:if="{{ showConfirmButton }}">
  84. <slot wx:if="{{ useConfirmButtonSlot }}" name="confirm-button" />
  85. <van-button
  86. wx:else
  87. size="large"
  88. class="van-dialog__button"
  89. loading="{{ loading.confirm }}"
  90. custom-class="van-dialog__confirm confirm-button-class"
  91. custom-style="color: {{ confirmButtonColor }}"
  92. button-id="{{ confirmButtonId }}"
  93. open-type="{{ confirmButtonOpenType }}"
  94. lang="{{ lang }}"
  95. business-id="{{ businessId }}"
  96. session-from="{{ sessionFrom }}"
  97. send-message-title="{{ sendMessageTitle }}"
  98. send-message-path="{{ sendMessagePath }}"
  99. send-message-img="{{ sendMessageImg }}"
  100. show-message-card="{{ showMessageCard }}"
  101. app-parameter="{{ appParameter }}"
  102. bindagreeprivacyauthorization="onAgreePrivacyAuthorization"
  103. bind:click="onConfirm"
  104. bindgetuserinfo="onGetUserInfo"
  105. bindcontact="onContact"
  106. bindgetphonenumber="onGetPhoneNumber"
  107. binderror="onError"
  108. bindlaunchapp="onLaunchApp"
  109. bindopensetting="onOpenSetting"
  110. >
  111. {{ confirmButtonText }}
  112. </van-button>
  113. </block>
  114. </view>
  115. </van-popup>