index.wxml 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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. bindchooseavatar="onChooseAvatar"
  64. binderror="onError"
  65. bindlaunchapp="onLaunchApp"
  66. bindopensetting="onOpenSetting"
  67. >
  68. {{ confirmButtonText }}
  69. </van-goods-action-button>
  70. </van-goods-action>
  71. <view wx:elif="{{ showCancelButton || showConfirmButton }}" class="van-hairline--top van-dialog__footer">
  72. <block wx:if="{{ showCancelButton }}">
  73. <slot wx:if="{{ useCancelButtonSlot }}" name="cancel-button" />
  74. <van-button
  75. wx:else
  76. size="large"
  77. loading="{{ loading.cancel }}"
  78. class="van-dialog__button van-hairline--right"
  79. custom-class="van-dialog__cancel cancle-button-class"
  80. custom-style="color: {{ cancelButtonColor }}"
  81. bind:click="onCancel"
  82. >
  83. {{ cancelButtonText }}
  84. </van-button>
  85. </block>
  86. <block wx:if="{{ showConfirmButton }}">
  87. <slot wx:if="{{ useConfirmButtonSlot }}" name="confirm-button" />
  88. <van-button
  89. wx:else
  90. size="large"
  91. class="van-dialog__button"
  92. loading="{{ loading.confirm }}"
  93. custom-class="van-dialog__confirm confirm-button-class"
  94. custom-style="color: {{ confirmButtonColor }}"
  95. button-id="{{ confirmButtonId }}"
  96. open-type="{{ confirmButtonOpenType }}"
  97. lang="{{ lang }}"
  98. business-id="{{ businessId }}"
  99. session-from="{{ sessionFrom }}"
  100. send-message-title="{{ sendMessageTitle }}"
  101. send-message-path="{{ sendMessagePath }}"
  102. send-message-img="{{ sendMessageImg }}"
  103. show-message-card="{{ showMessageCard }}"
  104. app-parameter="{{ appParameter }}"
  105. bindagreeprivacyauthorization="onAgreePrivacyAuthorization"
  106. bindgetRealTimePhoneNumber="onGetRealTimePhoneNumber"
  107. bind:click="onConfirm"
  108. bindgetuserinfo="onGetUserInfo"
  109. bindcontact="onContact"
  110. bindgetphonenumber="onGetPhoneNumber"
  111. bindchooseavatar="onChooseAvatar"
  112. binderror="onError"
  113. bindlaunchapp="onLaunchApp"
  114. bindopensetting="onOpenSetting"
  115. >
  116. {{ confirmButtonText }}
  117. </van-button>
  118. </block>
  119. </view>
  120. </van-popup>