dialog.vue 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <template>
  2. <div class="content">
  3. <div class="background"></div>
  4. <!-- 开奖页 -->
  5. <div class="dialog">
  6. <div class="txt">{{ txt }}</div>
  7. <div class="btn" @click="clickBtn">OK</div>
  8. </div>
  9. </div>
  10. </template>
  11. <script setup>
  12. import { inject, defineProps, defineEmits } from 'vue'
  13. let state = inject('state')
  14. defineProps({
  15. txt: {
  16. type: String,
  17. default: 'All treasures are hunted, good luck next time!'
  18. }
  19. })
  20. const clickBtn = () => {
  21. state.dialog.show = false
  22. }
  23. </script>
  24. <style lang="scss" scoped>
  25. .content {
  26. width: 375px;
  27. height: 500px;
  28. display: flex;
  29. align-items: center;
  30. justify-content: center;
  31. position: fixed;
  32. top: 0;
  33. left: 0;
  34. z-index: 999;
  35. .background {
  36. background: #000000;
  37. opacity: .9;
  38. position: fixed;
  39. width: 375px;
  40. height: 500px;
  41. }
  42. .dialog {
  43. z-index: 1;
  44. width: 335px;
  45. background: #FFFFFF;
  46. border-radius: 15px;
  47. .txt {
  48. color: #000000;
  49. font-weight: 500;
  50. font-size: 16px;
  51. padding: 27px 30px 16px 30px;
  52. text-align: center;
  53. }
  54. .btn {
  55. cursor: pointer;
  56. border-top: 1px solid #EEEEEE;
  57. width: 100%;
  58. height: 52px;
  59. color: #1D9BF0;
  60. font-weight: 500;
  61. font-size: 17px;
  62. line-height: 52px;
  63. text-align: center;
  64. }
  65. }
  66. }
  67. </style>