mypopup.vue 3.4 KB

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