index.wxml 4.4 KB

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