猫妈狗爸伴宠师小程序前端代码
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.

92 lines
1.6 KiB

  1. <template>
  2. <up-popup
  3. :show="show"
  4. round="16rpx"
  5. @open="open"
  6. @close="close"
  7. >
  8. <view class="popup">
  9. <view class="popup-header">
  10. <text class="popup-title">{{ props.title }}</text>
  11. <text class="popup-desc">{{ props.desc }}</text>
  12. </view>
  13. <view class="popup-content">
  14. <slot></slot>
  15. </view>
  16. <view class="popup-footer">
  17. <slot name="footer">
  18. <button class="flex-rowc btn" plain @click="onConfirm">确定</button>
  19. </slot>
  20. </view>
  21. </view>
  22. </up-popup>
  23. </template>
  24. <script setup>
  25. import { ref } from 'vue'
  26. const props = defineProps({
  27. title: {
  28. type: String,
  29. default: '',
  30. },
  31. desc: {
  32. type: String,
  33. default: '',
  34. }
  35. })
  36. const emit = defineEmits(['confirm'])
  37. const show = ref(false)
  38. const open = () => {
  39. show.value = true
  40. }
  41. const close = () => {
  42. show.value = false
  43. }
  44. const onConfirm = () => {
  45. emit('confirm')
  46. close()
  47. }
  48. defineExpose({ open, close })
  49. </script>
  50. <style lang="scss" scoped>
  51. .popup {
  52. padding: 45rpx 28rpx 28rpx 28rpx;
  53. &-header {
  54. margin-bottom: 35rpx;
  55. }
  56. &-title {
  57. color: #000000;
  58. font-weight: 700;
  59. font-size: 30rpx;
  60. line-height: 40rpx;
  61. }
  62. &-desc {
  63. color: #C7C7C7;
  64. font-size: 22rpx;
  65. }
  66. }
  67. .btn {
  68. width: 594rpx;
  69. height: auto;
  70. padding: 27rpx 0;
  71. box-sizing: border-box;
  72. border: none;
  73. background-color: #FFBF60;
  74. color: #FFFFFF;
  75. font-size: 30rpx;
  76. line-height: 40rpx;
  77. border-radius: 41rpx;
  78. }
  79. </style>