svipDialog.vue 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <!-- 中弹窗 二行文字 -->
  2. <template>
  3. <uni-popup ref="svipPopup" :animation="false" :is-mask-click="false"
  4. mask-background-color="rgba(255, 255, 255, 0.6);">
  5. <view class="ezy-svip-dialog">
  6. <view class="tip-content-box">
  7. <icon :class="'svip-img'+cardId"></icon>
  8. <view class="tip-content">开通SVIP会员解锁学习关卡</view>
  9. <view class="tip-btn-box">
  10. <view class="not-confirm-btn" @click="handleClose"></view>
  11. <view class="confirm-btn" @click="confirmBtn"></view>
  12. </view>
  13. </view>
  14. </view>
  15. </uni-popup>
  16. </template>
  17. <script setup>
  18. import { ref } from 'vue';
  19. import cacheManager from "@/utils/cacheManager.js";
  20. const props = defineProps({
  21. title: {
  22. type: String,
  23. default: '提示'
  24. },
  25. content: {
  26. type: String,
  27. require: true,
  28. default: ''
  29. },
  30. });
  31. const cardId =cacheManager.get('auth').cardId
  32. const svipPopup = ref(null); // 索引
  33. const $emit = defineEmits(['confirm-btn'])
  34. // 打开弹窗
  35. function handleShow() {
  36. svipPopup.value.open();
  37. }
  38. // 取消
  39. function handleClose() {
  40. svipPopup.value.close();
  41. }
  42. // 确认
  43. function confirmBtn(){
  44. $emit('confirm-btn');
  45. svipPopup.value.close();
  46. }
  47. defineExpose({
  48. handleShow
  49. })
  50. </script>
  51. <style>
  52. </style>