多租户商城-客户PC端
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.

129 lines
3.1 KiB

2 years ago
2 years ago
  1. <template>
  2. <div class='pop-ceil'>
  3. <div class='pop-box'>
  4. <header>
  5. <span @click="close" class='close-btn'> X</span>
  6. </header>
  7. <div class='pop-content'>
  8. <p><span/> 确定要删除此商品吗?</p>
  9. <p>删除后购物车将不存在该商品确定要删除吗</p>
  10. </div>
  11. <div class='pop-btns'>
  12. <p @click='confirm' v-throttle>{{$t('common.sure')}}</p>
  13. <p @click="close">{{$t('common.cancel')}}</p>
  14. </div>
  15. </div>
  16. </div>
  17. </template>
  18. <script>
  19. export default {
  20. props: {
  21. deleteOpt: {
  22. type: Object,
  23. default: () => {}
  24. }
  25. },
  26. data () {
  27. return {
  28. }
  29. },
  30. created () {
  31. this.forbidScroll()
  32. },
  33. methods: {
  34. forbidScroll () {
  35. const body = document.querySelector('body')
  36. body.style.overflow = 'hidden'
  37. },
  38. close () {
  39. this.$emit('close')
  40. },
  41. confirm () {
  42. this.$emit('confirm', this.deleteOpt)
  43. },
  44. scrollBar () {
  45. const body = document.querySelector('body')
  46. body.style.overflow = 'auto'
  47. }
  48. },
  49. beforeDestroy () {
  50. this.scrollBar()
  51. }
  52. }
  53. </script>
  54. <style lang='scss' scoped>
  55. .pop-ceil {
  56. position: fixed;
  57. top: 0;
  58. bottom: 0;
  59. left: 0;
  60. right: 0;
  61. background: rgba(0,0,0,.5);
  62. z-index: 9999;
  63. .pop-box {
  64. width: 600px;
  65. height: 300px;
  66. position: absolute;
  67. left: 50%;
  68. top: 50%;
  69. margin-left: -300px;
  70. margin-top: -150px;
  71. background: #fff;
  72. border-radius: 2px;
  73. color: #333;
  74. .close-btn {
  75. position: absolute;
  76. display: inline-block;
  77. right: 10px;
  78. top:10px;
  79. &:hover {
  80. cursor: pointer;
  81. }
  82. }
  83. .pop-content {
  84. p {
  85. text-align: center;
  86. &:nth-child(1) {
  87. font-size: 22px;
  88. line-height: 30px;
  89. margin-top: 20px;
  90. }
  91. &:nth-child(1) {
  92. font-size: 18px;
  93. line-height: 100px;
  94. }
  95. }
  96. }
  97. .pop-btns {
  98. overflow: hidden;
  99. width: 360px;
  100. margin: 40px auto 0;
  101. p {
  102. width: 160px;
  103. text-align: center;
  104. height: 48px;
  105. line-height: 48px;
  106. border-radius: 2px;
  107. box-sizing: border-box;
  108. float: left;
  109. &:nth-child(1) {
  110. background: #C83732;
  111. margin-right: 20px;
  112. color: #fff;
  113. }
  114. &:nth-child(2) {
  115. border: 1px solid #C83732;
  116. color: #C83732;
  117. }
  118. &:hover {
  119. cursor: pointer;
  120. }
  121. }
  122. }
  123. }
  124. }
  125. </style>