pay.vue
3 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
<template>
<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>
</template>
<script>
export default {
name: 'Pay',
props: {
title: {
type: String,
default: ''
},
money: {
type: String,
default: ''
}
},
data() {
return {
payArr: ['支付宝支付', '微信支付'],
currentId: 0
}
},
methods: {
commitsure() {
alert(this.currentId)
}
}
}
</script>
<style lang="scss" scoped>
.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>