modal.wxml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <custom style="height:{{CustomBar}}px;">
  2. <bar class="fixed gradual-pink" style="height:{{CustomBar}}px;padding-top:{{StatusBar}}px;">
  3. <navigator class='action' open-type="navigateBack" delta="1" hover-class="none">
  4. <text class='icon-back'></text> 模态窗口
  5. </navigator>
  6. </bar>
  7. </custom>
  8. <bar class="">
  9. <view class='action'>
  10. <text class='icon-titles text-orange '></text> 模态窗口
  11. </view>
  12. <view class='action'>
  13. <button class='bg-green shadow' bindtap="showModal" data-target="Modal">Modal</button>
  14. </view>
  15. </bar>
  16. <modal-box class="{{modalName=='Modal'?'show':''}}">
  17. <dialog>
  18. <bar class="justify-end">
  19. <view class='content'>Modal标题</view>
  20. <view class='action' bindtap='hideModal'>
  21. <text class='icon-close text-red'></text>
  22. </view>
  23. </bar>
  24. <view class='padding-xl'>
  25. Modal 内容。
  26. </view>
  27. </dialog>
  28. </modal-box>
  29. <bar class=" margin-top">
  30. <view class='action'>
  31. <text class='icon-titles text-orange '></text> 底部窗口
  32. </view>
  33. <view class='action'>
  34. <button class='bg-green shadow' bindtap="showModal" data-target="bottomModal">Bottom</button>
  35. </view>
  36. </bar>
  37. <modal-box class="bottom-modal {{modalName=='bottomModal'?'show':''}}">
  38. <dialog>
  39. <bar class="">
  40. <view class='action text-green'>确定</view>
  41. <view class='action text-blue' bindtap='hideModal'>取消</view>
  42. </bar>
  43. <view class='padding-xl'>
  44. Modal 内容。
  45. </view>
  46. </dialog>
  47. </modal-box>
  48. <bar class=" margin-top">
  49. <view class='action'>
  50. <text class='icon-titles text-orange '></text> 对话窗口
  51. </view>
  52. <view class='action'>
  53. <button class='bg-green shadow' bindtap="showModal" data-target="DialogModal1">Dialog</button>
  54. <button class='bg-blue shadow margin-left' bindtap="showModal" data-target="DialogModal2">Dialog</button>
  55. </view>
  56. </bar>
  57. <modal-box class="{{modalName=='DialogModal1'?'show':''}}">
  58. <dialog>
  59. <bar class="justify-end">
  60. <view class='content'>Modal标题</view>
  61. <view class='action' bindtap='hideModal'>
  62. <text class='icon-close text-red'></text>
  63. </view>
  64. </bar>
  65. <view class='padding-xl'>
  66. Modal 内容。
  67. </view>
  68. <bar class="justify-end">
  69. <view class='action'>
  70. <button class='line-green text-green' bindtap='hideModal'>取消</button>
  71. <button class='bg-green margin-left' bindtap='hideModal'>确定</button>
  72. </view>
  73. </bar>
  74. </dialog>
  75. </modal-box>
  76. <modal-box class="{{modalName=='DialogModal2'?'show':''}}">
  77. <dialog>
  78. <bar class="justify-end">
  79. <view class='content'>Modal标题</view>
  80. <view class='action' bindtap='hideModal'>
  81. <text class='icon-close text-red'></text>
  82. </view>
  83. </bar>
  84. <view class='padding-xl'>
  85. Modal 内容。
  86. </view>
  87. <bar>
  88. <view class='action margin-0 flex-sub text-green ' bindtap='hideModal'>
  89. <text class='icon-moneybag'></text>微信支付</view>
  90. <view class='action margin-0 flex-sub text-green solid-left' bindtap='hideModal'>取消</view>
  91. <view class='action margin-0 flex-sub solid-left' bindtap='hideModal'>确定</view>
  92. </bar>
  93. </dialog>
  94. </modal-box>
  95. <bar class=" margin-top">
  96. <view class='action'>
  97. <text class='icon-titles text-orange '></text> 图片窗口
  98. </view>
  99. <view class='action'>
  100. <button class='bg-green shadow' bindtap="showModal" data-target="Image">Image</button>
  101. </view>
  102. </bar>
  103. <modal-box class="{{modalName=='Image'?'show':''}}">
  104. <dialog>
  105. <view class="bg-img" style="background-image: url('https://albedo-theme.com/wp-content/uploads/2016/08/pexels-photo-26180.jpg');height:200px;">
  106. <bar class="justify-end none-bg text-white">
  107. <view class='action' bindtap='hideModal'>
  108. <text class='icon-close '></text>
  109. </view>
  110. </bar>
  111. </view>
  112. <bar>
  113. <view class='action margin-0 flex-sub solid-left' bindtap='hideModal'>我知道了</view>
  114. </bar>
  115. </dialog>
  116. </modal-box>