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

77 lines
1.5 KiB

  1. <template>
  2. <up-popup :show="show" mode="center" @close="close" @open="open" :zIndex="999999" :round="10"
  3. :safeAreaInsetBottom="false" :customStyle="{padding:'40rpx 20rpx',width:'80%'}">
  4. <view>
  5. <view>
  6. <view class="content">
  7. <slot></slot>
  8. </view>
  9. <view class="btn">
  10. <view class="cancle" @click="handleCancel">
  11. 取消
  12. </view>
  13. <view class="ok" @click="handleConfirm">
  14. 确定
  15. </view>
  16. </view>
  17. </view>
  18. </view>
  19. </up-popup>
  20. </template>
  21. <script setup>
  22. import { ref, defineEmits } from "vue";
  23. const show = ref(false);
  24. const emits = defineEmits(['confirm', 'cancel']);
  25. const close = () => {
  26. show.value = false;
  27. };
  28. const open = () => {
  29. show.value = true;
  30. };
  31. const handleConfirm = () => {
  32. emits('confirm');
  33. close();
  34. };
  35. const handleCancel = () => {
  36. emits('cancel');
  37. close();
  38. };
  39. defineExpose({
  40. close,
  41. open
  42. });
  43. </script>
  44. <style lang="scss" scoped>
  45. .content {
  46. padding: 20rpx 0rpx;
  47. }
  48. .btn {
  49. display: flex;
  50. justify-content: space-between;
  51. }
  52. .cancle,
  53. .ok {
  54. display: flex;
  55. align-items: center;
  56. justify-content: center;
  57. width: 48%;
  58. height: 80rpx;
  59. background: #FFBF60;
  60. border-radius: 40rpx;
  61. color: white;
  62. }
  63. .cancle {
  64. background: #FFF4E6;
  65. color: #FFC269;
  66. }
  67. </style>