You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

TipsInfo.vue 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <!--警示信息的公共弹窗-->
  2. <template>
  3. <u-popup v-model="state.showPopup" mode="center" border-radius="12" @close="close">
  4. <view class="popup-content">
  5. <view class="title">
  6. <!-- <image class="icon_tips" :src="`${$imgUrl}common/icon-tips.png`"></image> -->
  7. <image class="tips-image" :src="`${$imgUrl}common/tips.png`" mode=""></image>
  8. <text class="text">{{title}}</text>
  9. </view>
  10. <view class="des"><text>{{ des }}</text></view>
  11. <view class="action">
  12. <view class="btn" @click="cancel">取消</view>
  13. <view class="btn confirm" @click="confirm">确认</view>
  14. </view>
  15. </view>
  16. </u-popup>
  17. </template>
  18. <script setup lang="ts">
  19. import { reactive, watch } from 'vue'
  20. const emits = defineEmits(['cancel', 'confirm', 'close', 'update:modelValue']);
  21. const props = defineProps({
  22. modelValue: {
  23. type: Boolean,
  24. default: false
  25. },
  26. title: {
  27. type: String,
  28. default: '提示'
  29. },
  30. des: {
  31. type: String,
  32. default: ''
  33. }
  34. })
  35. watch(() => props.modelValue, (newValue) => {
  36. if (newValue) {
  37. state.showPopup = true
  38. } else {
  39. state.showPopup = false
  40. }
  41. })
  42. const state = reactive({
  43. showPopup: false
  44. })
  45. const cancel = () => {
  46. state.showPopup = false
  47. emits('update:modelValue', false)
  48. emits('cancel')
  49. }
  50. const confirm = () => {
  51. state.showPopup = false
  52. emits('update:modelValue', false)
  53. emits('confirm')
  54. }
  55. const close = () => {
  56. state.showPopup = false
  57. emits('update:modelValue', false)
  58. emits('close')
  59. }
  60. </script>
  61. <style scoped lang="scss">
  62. .popup-content{
  63. width: 560rpx;
  64. padding: 51rpx 38rpx;
  65. text-align: center;
  66. .title{
  67. display: flex;
  68. align-items: center;
  69. justify-content: center;
  70. .text{
  71. margin-left: 16rpx;
  72. font-weight: bold;
  73. font-size: 34rpx;
  74. color: #01243A;
  75. }
  76. .tips-image{
  77. width: 40rpx;
  78. height: 40rpx;
  79. }
  80. }
  81. .des{
  82. color: #222222;
  83. font-size: 28rpx;
  84. margin: 35rpx 12rpx;
  85. min-height: 120rpx;
  86. display: flex;
  87. align-items: center;
  88. justify-content: center;
  89. }
  90. .action{
  91. display: flex;
  92. align-items: center;
  93. justify-content: space-between;
  94. .btn{
  95. width: 230rpx;
  96. height: 80rpx;
  97. color: #01243A;
  98. border-radius: 40px 40px 40px 40px;
  99. border: 1px solid #004576;
  100. display: flex;
  101. align-items: center;
  102. justify-content: center;
  103. }
  104. .confirm{
  105. color: #FFFFFF;
  106. font-size: 30rpx;
  107. background: radial-gradient(circle, #01243A, #004576);
  108. }
  109. }
  110. }
  111. </style>