1
0

app-bottom-modal.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <template>
  2. <view class="app-bottom-modal">
  3. <view class="order-submit-picker dir-top-nowrap"
  4. :class="iVisible?'show':''">
  5. <view class="box-grow-1 close"
  6. @click="close" @touchmove.stop="true"></view>
  7. <view class="box-grow-0 container">
  8. <view class="title dir-left-nowrap" @touchmove.stop="true">
  9. <view class="box-grow-1">{{title}}</view>
  10. <view @click="close"
  11. class="box-grow-0">
  12. <image src="/static/image/icon/icon-close.png"
  13. style="width: 30rpx;height: 30rpx;"></image>
  14. </view>
  15. </view>
  16. <view class="body">
  17. <slot></slot>
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. </template>
  23. <script>
  24. export default {
  25. name: "app-bottom-modal",
  26. props: {
  27. title: {
  28. type: String,
  29. default: '',
  30. },
  31. sign: {
  32. default: null,
  33. },
  34. visible: {
  35. type: Boolean,
  36. default: false,
  37. },
  38. },
  39. data() {
  40. return {
  41. iVisible: this.visible,
  42. };
  43. },
  44. watch: {
  45. visible(v) {
  46. this.iVisible = v;
  47. },
  48. },
  49. methods: {
  50. close() {
  51. this.iVisible = false;
  52. this.$emit('update:visible', this.iVisible);
  53. },
  54. },
  55. }
  56. </script>
  57. <style scoped lang="scss">
  58. .order-submit-picker {
  59. background: rgba(0, 0, 0, 0.25);
  60. position: fixed;
  61. z-index: 1001;
  62. top: 0;
  63. left: 0;
  64. width: 100%;
  65. height: 100%;
  66. opacity: 0;
  67. visibility: hidden;
  68. transition: 300ms;
  69. .close {
  70. }
  71. .container {
  72. background: #fff;
  73. position: relative;
  74. top: 100%;
  75. transition: 300ms;
  76. transition-timing-function: ease;
  77. border-radius: #{16rpx} #{16rpx} 0 0;
  78. box-shadow: 0 0 #{24rpx} rgba(0, 0, 0, .1);
  79. .title {
  80. padding: #{28rpx} #{32rpx};
  81. font-weight: bold;
  82. font-size: #{36rpx};
  83. }
  84. }
  85. }
  86. .order-submit-picker.show {
  87. opacity: 1;
  88. visibility: visible;
  89. .container {
  90. top: 0;
  91. }
  92. }
  93. </style>