home.vue
4.29 KB
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<template>
<div class="wrap">
<div class="pay-wrap">
<div class="title">订单支付</div>
<div class="tipstext">{{ title }}</div>
<div class="money">{{ money }}</div>
<div class="choosetext">选择支付方式</div>
<ul class="pay-way">
<li v-for="(item, index) in payArr" :key="index" :class="{checkedClass : index===currentId}" @click="currentId = index">
<span></span>
{{ item }}
</li>
</ul>
<div class="commit-btn" @click="commitsure">确认支付</div>
</div>
<Loading v-show="showflag"/>
</div>
</template>
<script>
import Loading from './Loading'
export default {
name: 'Home',
components: {
Loading
},
data() {
return {
showflag: true,
title: '',
money: '',
payArr: ['支付宝支付', '微信支付'],
currentId: 0
}
},
computed: {
// ...mapGetters([
// '_getshowflag', '_getPayFlag'
// ])
},
created() {
this.$http.get('http://39.98.54.240:8090/hmQrCodeInOutPark/noCarQRcodeInOutPark')
.then(function(response) {
console.log(response)
})
.catch(function(error) {
console.log(error)
})
setTimeout(() => {
this.showflag = false
// $http.post('/user', {
// firstName: 'Fred',
// lastName: 'Flintstone'
// })
// .then(function (response) {
// console.log(response);
// })
// .catch(function (error) {
// console.log(error);
// });
// 模拟请求
// this.$fetch('/api/v2/movie/top250').then((response) => {
// console.log(response)
// })
// },
// this.handlePayFlag()
this.title = '手机: 13911137584'
this.money = '¥100.00'
}, 2000)
},
methods: {
commitsure() {
alert(this.currentId)
}
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped>
.wrap {
width: 100%;
height: 100%;
position: relative;
.pay-wrap {
width: 100%;
height: 100%;
background-color: #eff4f5;
text-align: center;
.title {
height: 42px;
line-height: 42px;
background-color: rgba(255, 255, 255, .9);
font-size: 17px;
color: #4A4A4A;
font-weight: 500;
}
.tipstext {
margin: 35px auto 35px;
font-size: 18px;
font-weight: bold;
color: rgba(255, 7, 7, 1);
}
.money {
height: 48px;
line-height: 48px;
font-size: 48px;
font-weight: 400;
color: rgba(74, 74, 74, 1);
}
.choosetext {
padding-left: 10px;
margin: 60px 0 10px;
text-align: left;
font-size: 17px;
font-weight: 400;
color: rgba(74, 74, 74, 1);
}
.pay-way {
padding-left: 10px;
padding-right: 18px;
background-color: #fff;
text-align: left;
cursor: pointer;
li {
height: 43px;
line-height: 43px;
font-size: 14px;
font-weight: 400;
color: rgba(74, 74, 74, 1);
background-image: url("../assets/unchecked-icon.png");
background-repeat: no-repeat ;
background-position: right center ;
background-size: 18px 18px;
span {
width: 24px;
height: 24px;
display: inline-block;
margin-right: 11px;
vertical-align: middle;
}
&:nth-of-type(1) {
border-bottom: 1px solid rgba(240, 244, 245, 1);
span {
background: url("../assets/ali-icon.png") no-repeat;
background-size: 100% 100%;
}
}
&:nth-of-type(2) {
span {
background: url("../assets/wechat-icon.png") no-repeat;
background-size: 100% 100%;
}
}
}
.checkedClass{
background-image: url("../assets/checked-icon.png");
}
}
.commit-btn {
width: 80%;
height: 42px;
line-height: 42px;
margin: 120px auto 0;
border-radius: 21px;
background-color: #75CBBE;
font-size: 18px;
font-weight: 400;
color: rgba(255, 255, 255, 1);
}
}
}
</style>