tipMiddleDialog.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <!-- 中弹窗 二行文字 -->
  2. <template>
  3. <uni-popup ref="tipMiddlePopup" :animation="false" :is-mask-click="false"
  4. mask-background-color="rgba(255, 255, 255, 0.6);">
  5. <view class="ezy-tip-dialog tip-middle-dialog">
  6. <view class="tip-content-box">
  7. <view class="tip-title">{{title}}</view>
  8. <view class="tip-content">{{content}}</view>
  9. <view class="tip-btn-box" style="position: relative">
  10. <view v-if="closeFlag" class="not-confirm-btn" @click="handleClose"></view>
  11. <view class="confirm-btn" @click="confirmBtn"></view>
  12. <view v-if="showTip" @click="handleShowImage" style="position: absolute;right: 0;top: 22px"><uni-icons type="info" size="30"></uni-icons></view>
  13. </view>
  14. </view>
  15. </view>
  16. </uni-popup>
  17. </template>
  18. <script setup>
  19. import { ref } from 'vue';
  20. const props = defineProps({
  21. title: {
  22. type: String,
  23. default: '提示'
  24. },
  25. closeFlag: {
  26. type: Boolean,
  27. default: true
  28. },
  29. content: {
  30. type: String,
  31. require: true,
  32. default: ''
  33. },
  34. notClose: {
  35. type: Boolean,
  36. default: false
  37. },
  38. showTip: {
  39. type: Boolean,
  40. default: false
  41. }
  42. });
  43. const tipMiddlePopup = ref(null); // 索引
  44. const $emit = defineEmits(['confirm-btn'])
  45. // 打开弹窗
  46. function handleShow() {
  47. tipMiddlePopup.value.open();
  48. }
  49. // 取消
  50. function handleClose() {
  51. tipMiddlePopup.value.close();
  52. }
  53. // 确认
  54. function confirmBtn(){
  55. $emit('confirm-btn');
  56. if (!props.notClose) {
  57. tipMiddlePopup.value.close();
  58. }
  59. }
  60. function handleShowImage() {
  61. uni.previewImage({
  62. urls: ['/static/images/login/ggg.gif'],
  63. });
  64. }
  65. defineExpose({
  66. handleShow,
  67. handleClose
  68. })
  69. </script>
  70. <style>
  71. </style>