Blame view

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