dialog.wxml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <import src="../common/template/button.wxml" />
  2. <wxs src="./dialog.wxs" module="_" />
  3. <t-popup
  4. name="dialog"
  5. class="{{classPrefix}}__wrapper"
  6. visible="{{visible}}"
  7. showOverlay="{{showOverlay}}"
  8. closeOnOverlayClick="{{closeOnOverlayClick}}"
  9. preventScrollThrough="{{preventScrollThrough}}"
  10. overlayProps="{{overlayProps}}"
  11. zIndex="{{zIndex}}"
  12. placement="center"
  13. bind:visible-change="overlayClick"
  14. >
  15. <view slot="content" class="{{classPrefix}} {{prefix}}-class">
  16. <view class="{{classPrefix}}__content {{prefix}}-class-content">
  17. <view wx:if="{{title}}" class="{{classPrefix}}__header">{{title}}</view>
  18. <slot name="title" />
  19. <view wx:if="{{content}}" class="{{classPrefix}}__body {{title ? '' : classPrefix + '__body--without-title'}}">
  20. <text class="{{classPrefix}}__body-text">{{content}}</text>
  21. </view>
  22. <slot name="content" />
  23. </view>
  24. <view
  25. class="{{classPrefix}}__footer {{classPrefix}}__footer--default {{buttonLayout === 'vertical' ? classPrefix + '__footer--column' : ''}}"
  26. >
  27. <t-button
  28. block
  29. class="{{classPrefix}}__footer-button-host"
  30. wx:if="{{actions}}"
  31. wx:for="{{actions}}"
  32. wx:key="action"
  33. data-index="{{index}}"
  34. t-class="{{classPrefix}}__button {{classPrefix}}__button-{{item.primary ? 'confirm' : 'cancel'}} {{prefix}}-class-action"
  35. bindtap="onActionTap"
  36. >
  37. {{item.name}}
  38. </t-button>
  39. <slot name="actions" />
  40. <t-button
  41. block
  42. class="{{classPrefix}}__footer-button-host {{classPrefix}}__footer-button--cancel"
  43. wx:if="{{cancelBtn && _.getTypeof(cancelBtn) == 'string'}}"
  44. t-class="{{classPrefix}}__button {{classPrefix}}__button-cancel {{confirmBtn ? classPrefix + '__button-half' : ''}} {{prefix}}-class-cancel"
  45. bindtap="onCancel"
  46. >
  47. {{cancelBtn}}
  48. </t-button>
  49. <block wx:elif="{{_.getTypeof(cancelBtn) == 'object'}}">
  50. <template
  51. is="button"
  52. data="{{...cancelBtn, block: true, type: 'cancel', externalClass: classPrefix + '__button ' + classPrefix + '__button-cancel ' + (cancelBtn ? classPrefix + '__button-half ' : ' ') + prefix + '-class-cancel',class: classPrefix + '__footer-button-host ' + classPrefix + '__footer-button--cancel' }}"
  53. ></template>
  54. </block>
  55. <slot name="cancelBtn" />
  56. <t-button
  57. block
  58. class="{{classPrefix}}__footer-button-host {{classPrefix}}__footer-button--confirm"
  59. wx:if="{{confirmBtn && _.getTypeof(confirmBtn) == 'string'}}"
  60. t-class="{{classPrefix}}__button {{classPrefix}}__button-confirm {{cancelBtn ? classPrefix + '__button-half' : ''}} {{prefix}}-class-confirm"
  61. bind:tap="onConfirm"
  62. bind:getuserinfo="openValueCBHandle"
  63. bind:contact="openValueCBHandle"
  64. bind:getphonenumber="openValueCBHandle"
  65. bind:opensetting="openValueCBHandle"
  66. bind:launchapp="openValueCBHandle"
  67. bind:error="openValueErrCBHandle"
  68. >
  69. {{confirmBtn}}
  70. </t-button>
  71. <block wx:elif="{{_.getTypeof(confirmBtn) == 'object'}}">
  72. <template
  73. is="button"
  74. data="{{...confirmBtn, block: true, type: 'confirm', externalClass: classPrefix + '__button ' + classPrefix + '__button-confirm ' + (cancelBtn ? classPrefix + '__button-half ' : ' ') + prefix + '-class-confirm', class: classPrefix + '__footer-button-host ' + classPrefix + '__footer-button--confirm'}}"
  75. ></template>
  76. </block>
  77. <slot name="confirmBtn" />
  78. </view>
  79. </view>
  80. </t-popup>