mypopup.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. <template>
  2. <view class="popup" v-show="show">
  3. <view class="popup-info">
  4. <view class="popup-title"> {{titleText}}
  5. <view @click="close()"
  6. style="position: absolute; top: 0; right: 14rpx; border-radius: 50%;width: 15px;height: 15px;">
  7. <image :src="loadImgSrc('icon_close.png')" style=" width: 15px; height: 15px;"></image>
  8. </view>
  9. </view>
  10. <view class="popup-text">{{popupText}}</view>
  11. <view class="popup-btn">
  12. <view class="btn-left" @click="cancel">{{cancelText}}</view>
  13. <view class="btn-right" @click="confirm">{{confirmText}}</view>
  14. </view>
  15. </view>
  16. </view>
  17. </template>
  18. <script>
  19. export default {
  20. name: "my-popup",
  21. props: {
  22. show: {
  23. type: Boolean
  24. },
  25. popupText: {
  26. type: String
  27. },
  28. titleText: {
  29. type: String
  30. },
  31. cancelText: {
  32. type: String
  33. },
  34. confirmText: {
  35. type: String
  36. }
  37. },
  38. watch: {
  39. oldshow: function(newVal, oldVal) {
  40. this.show = newVal;
  41. }
  42. },
  43. data() {
  44. return {};
  45. },
  46. methods: {
  47. close() {
  48. this.$parent.show_loding = false
  49. },
  50. cancel() {
  51. this.$emit('close')
  52. },
  53. confirm() {
  54. this.$emit('confirm')
  55. }
  56. }
  57. }
  58. </script>
  59. <style lang="scss">
  60. .popup {
  61. position: fixed;
  62. left: 0;
  63. right: 0;
  64. top: 0;
  65. height: 100vh;
  66. background-color: rgba(0, 0, 0, 0.4) !important;
  67. z-index: 9998;
  68. }
  69. .popup-info {
  70. position: fixed;
  71. width: 320px;
  72. top: 50%;
  73. left: 50%;
  74. transform: translate(-50%, -50%);
  75. font-size: 30upx;
  76. box-shadow: 0px 1px 13px -6px rgba(0, 0, 0, 0.25);
  77. background-color: #fff;
  78. z-index: 9999;
  79. border-radius: 8px;
  80. display: flex;
  81. flex-direction: column;
  82. align-items: center;
  83. .popup-title {
  84. width: 320px;
  85. height: 56px;
  86. background: linear-gradient(95.13deg, #5DA4F7 3.75%, #3285E4 95.95%);
  87. border-radius: 8px 8px 0px 0px;
  88. display: flex;
  89. justify-content: center;
  90. align-items: center;
  91. font-family: 'PingFang SC';
  92. font-style: normal;
  93. font-weight: 500;
  94. font-size: 17px;
  95. line-height: 24px;
  96. /* identical to box height, or 140% */
  97. color: #FFFFFF;
  98. }
  99. .popup-text {
  100. width: 262px;
  101. display: flex;
  102. justify-content: center;
  103. margin-top: 23px;
  104. text-align: center;
  105. font-family: 'PingFang SC';
  106. font-style: normal;
  107. font-weight: 500;
  108. font-size: 17px;
  109. line-height: 24px;
  110. }
  111. .popup-btn {
  112. display: flex;
  113. flex-direction: row;
  114. justify-content: space-between;
  115. width: 250px;
  116. height: 42px;
  117. border-top-color: #f5f5f5;
  118. margin: 0 auto;
  119. margin-top: 22px;
  120. margin-bottom: 20px;
  121. .btn-left {
  122. /* #ifndef APP-NVUE */
  123. display: flex;
  124. /* #endif */
  125. width: 107px;
  126. height: 42px;
  127. border: 0.5px solid #569FF4;
  128. border-radius: 35px;
  129. justify-content: center;
  130. align-items: center;
  131. font-family: 'PingFang SC';
  132. font-style: normal;
  133. font-weight: 500;
  134. font-size: 16px;
  135. line-height: 22px;
  136. letter-spacing: -0.2176px;
  137. color: #569FF4;
  138. }
  139. .btn-right {
  140. display: flex;
  141. align-items: center;
  142. width: 107px;
  143. height: 42px;
  144. background: linear-gradient(95.13deg, #5DA4F7 3.75%, #3285E4 95.95%);
  145. border-radius: 35px;
  146. justify-content: center;
  147. align-items: center;
  148. font-color: #FFFFFF;
  149. font-family: 'PingFang SC';
  150. font-style: normal;
  151. font-weight: 500;
  152. font-size: 16px;
  153. line-height: 22px;
  154. letter-spacing: -0.2176px;
  155. color: #FFFFFF;
  156. }
  157. }
  158. }
  159. </style>