mypopup.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  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. // console.log(newVal);
  41. this.show = newVal;
  42. console.log(newVal)
  43. }
  44. },
  45. data() {
  46. return {};
  47. },
  48. methods: {
  49. close() {
  50. this.$parent.show_loding = false
  51. },
  52. cancel() {
  53. this.$emit('close')
  54. },
  55. confirm() {
  56. this.$emit('confirm')
  57. }
  58. }
  59. }
  60. </script>
  61. <style lang="scss">
  62. .popup {
  63. position: fixed;
  64. left: 0;
  65. right: 0;
  66. top: 0;
  67. height: 100vh;
  68. background-color: rgba(0, 0, 0, 0.4) !important;
  69. z-index: 9998;
  70. }
  71. .popup-info {
  72. position: fixed;
  73. width: 320px;
  74. top: 50%;
  75. left: 50%;
  76. transform: translate(-50%, -50%);
  77. font-size: 30upx;
  78. box-shadow: 0px 1px 13px -6px rgba(0, 0, 0, 0.25);
  79. background-color: #fff;
  80. z-index: 9999;
  81. border-radius: 8px;
  82. display: flex;
  83. flex-direction: column;
  84. align-items: center;
  85. .popup-title {
  86. width: 320px;
  87. height: 56px;
  88. background: linear-gradient(95.13deg, #5DA4F7 3.75%, #3285E4 95.95%);
  89. border-radius: 8px 8px 0px 0px;
  90. display: flex;
  91. justify-content: center;
  92. align-items: center;
  93. font-family: 'PingFang SC';
  94. font-style: normal;
  95. font-weight: 500;
  96. font-size: 17px;
  97. line-height: 24px;
  98. /* identical to box height, or 140% */
  99. color: #FFFFFF;
  100. }
  101. .popup-text {
  102. width: 262px;
  103. display: flex;
  104. justify-content: center;
  105. margin-top: 23px;
  106. text-align: center;
  107. font-family: 'PingFang SC';
  108. font-style: normal;
  109. font-weight: 500;
  110. font-size: 17px;
  111. line-height: 24px;
  112. }
  113. .popup-btn {
  114. display: flex;
  115. flex-direction: row;
  116. justify-content: space-between;
  117. width: 250px;
  118. height: 42px;
  119. border-top-color: #f5f5f5;
  120. margin: 0 auto;
  121. margin-top: 22px;
  122. margin-bottom: 20px;
  123. .btn-left {
  124. /* #ifndef APP-NVUE */
  125. display: flex;
  126. /* #endif */
  127. width: 107px;
  128. height: 42px;
  129. border: 0.5px solid #569FF4;
  130. border-radius: 35px;
  131. justify-content: center;
  132. align-items: center;
  133. font-family: 'PingFang SC';
  134. font-style: normal;
  135. font-weight: 500;
  136. font-size: 16px;
  137. line-height: 22px;
  138. letter-spacing: -0.2176px;
  139. color: #569FF4;
  140. }
  141. .btn-right {
  142. display: flex;
  143. align-items: center;
  144. width: 107px;
  145. height: 42px;
  146. background: linear-gradient(95.13deg, #5DA4F7 3.75%, #3285E4 95.95%);
  147. border-radius: 35px;
  148. justify-content: center;
  149. align-items: center;
  150. font-color: #FFFFFF;
  151. font-family: 'PingFang SC';
  152. font-style: normal;
  153. font-weight: 500;
  154. font-size: 16px;
  155. line-height: 22px;
  156. letter-spacing: -0.2176px;
  157. color: #FFFFFF;
  158. }
  159. }
  160. }
  161. </style>