ble-tip-pop.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <template>
  2. <view>
  3. <u-popup
  4. :show="errorShow"
  5. :closeOnClickOverlay="false"
  6. :safeAreaInsetBottom="false"
  7. @close="closeClick"
  8. mode="center"
  9. :round="10"
  10. >
  11. <view class="error-box">
  12. <view class="flex_box flex_row_center">
  13. <u-image
  14. src="@/static/image/error-img.png"
  15. width="112rpx"
  16. height="112rpx"
  17. ></u-image>
  18. </view>
  19. <view :class="['tips-value', { 'is-center': isCenter }]">
  20. <view>{{ content }}</view>
  21. <view class="tips-value-extra" v-if="extraText">{{ extraText }}</view>
  22. </view>
  23. <view class="btn-box">
  24. <u-button
  25. class="no-btn"
  26. type="primary"
  27. :plain="true"
  28. :text="cancelBtnText"
  29. @click="closeClick"
  30. ></u-button>
  31. <u-button
  32. class="yes-btn"
  33. type="primary"
  34. :text="confirmBtnText"
  35. @click="confirmClick"
  36. ></u-button>
  37. </view>
  38. </view>
  39. </u-popup>
  40. </view>
  41. </template>
  42. <script>
  43. export default {
  44. props: {
  45. value: {
  46. type: Boolean,
  47. default: false,
  48. },
  49. content: {
  50. type: String,
  51. default: "",
  52. },
  53. extraText: {
  54. type: String,
  55. default: "",
  56. },
  57. cancelBtnText: {
  58. type: String,
  59. default: "否",
  60. },
  61. confirmBtnText: {
  62. type: String,
  63. default: "是",
  64. },
  65. isCenter: {
  66. type: Boolean,
  67. default: false,
  68. },
  69. },
  70. watch: {
  71. value: {
  72. handler(val) {
  73. this.errorShow = val;
  74. },
  75. immediate: true,
  76. },
  77. },
  78. data() {
  79. return {
  80. errorShow: false,
  81. };
  82. },
  83. methods: {
  84. closeClick() {
  85. this.$emit("close");
  86. this.$emit("input", false);
  87. },
  88. confirmClick() {
  89. this.$emit("confirm");
  90. },
  91. },
  92. };
  93. </script>
  94. <style lang="scss" scoped>
  95. .error-box {
  96. width: 580rpx;
  97. padding: 48rpx 36rpx 48rpx;
  98. .tips-value {
  99. color: #1d212a;
  100. font-family: "PingFang SC";
  101. font-size: 32rpx;
  102. font-style: normal;
  103. font-weight: bold;
  104. margin-top: 32rpx;
  105. &.is-center {
  106. text-align: center;
  107. }
  108. &-extra {
  109. font-weight: 400;
  110. font-size: 28rpx;
  111. color: rgba(153, 153, 153, 1);
  112. margin-top: 10rpx;
  113. }
  114. }
  115. .btn-box {
  116. display: flex;
  117. justify-content: space-between;
  118. margin-top: 60rpx;
  119. .no-btn {
  120. width: 244rpx;
  121. border-radius: 16rpx;
  122. border: 1px solid #bfc8db;
  123. color: #86909c;
  124. font-size: 32rpx;
  125. }
  126. .yes-btn {
  127. width: 244rpx;
  128. border-radius: 16rpx;
  129. background: #0256ff;
  130. font-size: 32rpx;
  131. }
  132. }
  133. }
  134. </style>