index.wxml 3.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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 }}"
  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"
  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"
  45. custom-style="color: {{ confirmButtonColor }}"
  46. open-type="{{ confirmButtonOpenType }}"
  47. lang="{{ lang }}"
  48. business-id="{{ businessId }}"
  49. session-from="{{ sessionFrom }}"
  50. send-message-title="{{ sendMessageTitle }}"
  51. send-message-path="{{ sendMessagePath }}"
  52. send-message-img="{{ sendMessageImg }}"
  53. show-message-card="{{ showMessageCard }}"
  54. app-parameter="{{ appParameter }}"
  55. bind:click="onConfirm"
  56. bindgetuserinfo="onGetUserInfo"
  57. bindcontact="onContact"
  58. bindgetphonenumber="onGetPhoneNumber"
  59. binderror="onError"
  60. bindlaunchapp="onLaunchApp"
  61. bindopensetting="onOpenSetting"
  62. >
  63. {{ confirmButtonText }}
  64. </van-goods-action-button>
  65. </van-goods-action>
  66. <view wx:else class="van-hairline--top van-dialog__footer">
  67. <van-button
  68. wx:if="{{ showCancelButton }}"
  69. size="large"
  70. loading="{{ loading.cancel }}"
  71. class="van-dialog__button van-hairline--right"
  72. custom-class="van-dialog__cancel"
  73. custom-style="color: {{ cancelButtonColor }}"
  74. bind:click="onCancel"
  75. >
  76. {{ cancelButtonText }}
  77. </van-button>
  78. <van-button
  79. wx:if="{{ showConfirmButton }}"
  80. size="large"
  81. class="van-dialog__button"
  82. loading="{{ loading.confirm }}"
  83. custom-class="van-dialog__confirm"
  84. custom-style="color: {{ confirmButtonColor }}"
  85. open-type="{{ confirmButtonOpenType }}"
  86. lang="{{ lang }}"
  87. business-id="{{ businessId }}"
  88. session-from="{{ sessionFrom }}"
  89. send-message-title="{{ sendMessageTitle }}"
  90. send-message-path="{{ sendMessagePath }}"
  91. send-message-img="{{ sendMessageImg }}"
  92. show-message-card="{{ showMessageCard }}"
  93. app-parameter="{{ appParameter }}"
  94. bind:click="onConfirm"
  95. bindgetuserinfo="onGetUserInfo"
  96. bindcontact="onContact"
  97. bindgetphonenumber="onGetPhoneNumber"
  98. binderror="onError"
  99. bindlaunchapp="onLaunchApp"
  100. bindopensetting="onOpenSetting"
  101. >
  102. {{ confirmButtonText }}
  103. </van-button>
  104. </view>
  105. </van-popup>