pop-up.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <template>
  2. <div class="pop-up-div" v-if="show" @click="setValue">
  3. <div
  4. :style="{
  5. top: `${top}px`,
  6. left: `${left}px`,
  7. ...style,
  8. }"
  9. :class="{
  10. 'pop-up': true,
  11. px500: sizelay == 'min',
  12. px550: sizelay == 'big',
  13. }"
  14. @click.stop="() => {}"
  15. >
  16. <div class="pop-up-title">{{ title }}</div>
  17. <div class="pop-up-body">
  18. <slot />
  19. <div class="pop-up-item" v-for="(val, index) in item" :key="index">
  20. <div
  21. class="subheading"
  22. :style="{
  23. 'text-align': textAlign,
  24. }"
  25. >
  26. {{ val.area }}
  27. </div>
  28. <div
  29. class="jinge"
  30. :style="{
  31. 'text-align': textAlign,
  32. }"
  33. >
  34. {{ val.amount }}
  35. </div>
  36. <div
  37. class="tishi222"
  38. :style="{
  39. 'text-align': textAlign,
  40. }"
  41. >
  42. {{ val.bills }}
  43. </div>
  44. </div>
  45. </div>
  46. </div>
  47. </div>
  48. </template>
  49. <script>
  50. import bus from '@/utils/eventBus.js';
  51. export default {
  52. props: {
  53. top: {
  54. type: Number,
  55. default: 0,
  56. },
  57. left: {
  58. type: [Number, String],
  59. default: 0,
  60. },
  61. title: {
  62. type: String,
  63. default: '',
  64. },
  65. show: {
  66. type: [Boolean],
  67. default: false,
  68. },
  69. item: {
  70. type: Array,
  71. default: () => [],
  72. },
  73. style: {
  74. type: Object,
  75. default: () => ({}),
  76. },
  77. textAlign: {
  78. type: String,
  79. default: 'right',
  80. },
  81. sizelay: {
  82. type: String,
  83. default: 'min',
  84. },
  85. },
  86. watch: {
  87. show() {
  88. if (this.show) {
  89. bus.emit('autoplay', false);
  90. } else {
  91. bus.emit('autoplay', true);
  92. }
  93. },
  94. },
  95. methods: {
  96. setValue() {
  97. this.$emit('col', false);
  98. },
  99. },
  100. };
  101. </script>
  102. <style scoped lang="scss">
  103. .pop-up-div {
  104. top: 0;
  105. left: 0;
  106. width: 100%;
  107. height: 100%;
  108. position: fixed;
  109. z-index: 100000000000000;
  110. }
  111. .px500 {
  112. width: 500px;
  113. }
  114. .px550 {
  115. width: 700px;
  116. }
  117. .pop-up {
  118. display: inline-block;
  119. background: #185099;
  120. border: 1px solid #42c1eb;
  121. border-radius: 10px;
  122. position: fixed;
  123. z-index: 1000000000000000;
  124. box-sizing: border-box;
  125. padding: 20px;
  126. .pop-up-title {
  127. font-size: 18px;
  128. font-family: Source Han Sans CN, Source Han Sans CN-Medium;
  129. font-weight: 500;
  130. text-align: left;
  131. color: #93b0d8;
  132. line-height: 25px;
  133. }
  134. .pop-up-body {
  135. width: 100%;
  136. height: auto;
  137. display: flex;
  138. flex-wrap: wrap;
  139. .pop-up-item {
  140. width: 25%;
  141. height: auto;
  142. box-sizing: border-box;
  143. padding: 10px 10px;
  144. .subheading {
  145. font-size: 18px;
  146. font-family: Source Han Sans CN, Source Han Sans CN-Medium;
  147. font-weight: 500;
  148. color: #93b0d8;
  149. line-height: 25px;
  150. }
  151. .jinge {
  152. font-size: 18px;
  153. font-family: Source Han Sans CN, Source Han Sans CN-Medium;
  154. font-weight: 500;
  155. color: #ffffff;
  156. line-height: 25px;
  157. }
  158. .tishi222 {
  159. font-size: 16px;
  160. font-family: Source Han Sans CN, Source Han Sans CN-Medium;
  161. font-weight: 500;
  162. color: #7ae38d;
  163. line-height: 25px;
  164. }
  165. }
  166. }
  167. }
  168. </style>