Blame view

admin-web-master/src/views/couponmanagement/allinfo.vue 1.13 KB
8db25941   李宇   2
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
  <template>
    <div>
      <!-- 根据 type 的值决定显示哪个组件 -->
      <capitalpoolinfo ref="capitalpoolinforef" v-if="type == '1'" @changecouponid="changecouponid"/>
      <couponinfo ref="couponinforef" v-else-if="type == '2'" @changecouponid="changecouponid"/>
    </div>
  </template>
  
  <script>
  import capitalpoolinfo from './capitalpoolinfo.vue';
  import couponinfo from './couponinfo.vue';
  
  export default {
    components: {
      capitalpoolinfo,
      couponinfo
    },
    props: {
      type: {
        type: String,
        required: '1'
      },
    },
    data() {
      return {
93c8bac5   李宇   1
26
27
        id: '',
        info: {}
8db25941   李宇   2
28
29
30
      }
    },
    methods: {
93c8bac5   李宇   1
31
      int(e,info) {
8db25941   李宇   2
32
33
34
          if(this.type === '1'){
            this.$refs.capitalpoolinforef.int(e)
          }else{
93c8bac5   李宇   1
35
36
            this.info = info
            this.$refs.couponinforef.int(e,info)
8db25941   李宇   2
37
38
39
40
41
42
43
44
45
          }
      },
      chanetype(e) {
          this.type = e
      },
      changecouponid(e) {
          console.error(e)
          let c1 = {
            type:'2',
93c8bac5   李宇   1
46
47
            id:e.id,
            info:e
8db25941   李宇   2
48
49
          }
          this.$emit('changetypeinfo',c1)
8db25941   李宇   2
50
51
52
53
54
55
56
57
58
59
60
      },
      changecapitalpoolid(e) {
         
      },
    },
  };
  </script>
  
  <style scoped>
  /* 添加样式 */
  </style>