Blame view

src/components/home.vue 1.94 KB
35b48aa6   liuqimichale   init
1
2
  <template>
    <div class="wrap">
05b3e86b   liuqimichale   eslint
3
      <InOut v-if="inOutVal==='1'" :toflag = "0"/>
8da434bf   liuqimichale   车场进出场支付
4
      <Pay v-else-if="inOutVal==='2'&&_getPayFlag" :title="title" :money="money"/>
145c620a   liuqimichale   传值
5
      <InOut v-else :toflag = "1" @commitpass="transmit"/>
35b48aa6   liuqimichale   init
6
7
8
9
10
11
12
      <Loading v-show="_getshowflag"/>
    </div>
  </template>
  
  <script>
  import Loading from './Loading'
  import InOut from './InOut'
8da434bf   liuqimichale   车场进出场支付
13
  import Pay from './Pay'
35b48aa6   liuqimichale   init
14
15
16
17
18
  import { mapGetters, mapActions } from 'vuex'
  
  export default {
    name: 'HelloWorld',
    components: {
8da434bf   liuqimichale   车场进出场支付
19
      Loading, InOut, Pay
35b48aa6   liuqimichale   init
20
21
22
23
    },
    data() {
      return {
        payFlag: false,
8da434bf   liuqimichale   车场进出场支付
24
        inOutVal: this.$route.query.id,
35b48aa6   liuqimichale   init
25
        // isShow: ''
8da434bf   liuqimichale   车场进出场支付
26
27
        title: '',
        money: ''
35b48aa6   liuqimichale   init
28
29
30
31
32
33
34
35
      }
    },
    computed: {
      ...mapGetters([
        '_getshowflag', '_getPayFlag'
      ])
    },
    created() {
0bfdd97a   liuqimichale   调接口
36
37
38
39
40
41
42
      this.$http.get('http://39.98.54.240:8090/hmQrCodeInOutPark/noCarQRcodeInOutPark')
        .then(function(response) {
          console.log(response)
        })
        .catch(function(error) {
          console.log(error)
        })
35b48aa6   liuqimichale   init
43
44
      setTimeout(() => {
        this.handleHide()
e495e419   liuqimichale   传值
45
  
e495e419   liuqimichale   传值
46
47
48
49
50
51
52
53
54
55
56
        // $http.post('/user', {
        //   firstName: 'Fred',
        //   lastName: 'Flintstone'
        // })
        // .then(function (response) {
        //   console.log(response);
        // })
        // .catch(function (error) {
        //   console.log(error);
        // });
  
35b48aa6   liuqimichale   init
57
58
59
60
61
        // 模拟请求
        // this.$fetch('/api/v2/movie/top250').then((response) => {
        //   console.log(response)
        // })
        // },
145c620a   liuqimichale   传值
62
        // this.handlePayFlag()
35b48aa6   liuqimichale   init
63
        console.log(this._getPayFlag)
145c620a   liuqimichale   传值
64
65
        // this.title = '手机: 13911137584'
        // this.money = '¥100.00'
35b48aa6   liuqimichale   init
66
67
68
69
70
71
72
      }, 2000)
    },
    methods: {
      ...mapActions([
        'handleHide',
        'handleShow',
        'handlePayFlag'
145c620a   liuqimichale   传值
73
74
75
76
77
78
      ]),
      transmit(data) {
        console.log(data)
        this.title = data.title
        this.money = data.money
      }
35b48aa6   liuqimichale   init
79
80
81
82
83
84
85
86
87
88
89
90
    }
  }
  </script>
  
  <!-- Add "scoped" attribute to limit CSS to this component only -->
  <style scoped>
    .wrap {
      width: 100%;
      height: 100%;
      position: relative;
    }
  </style>