-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpay-alert.vue
161 lines (159 loc) · 4.43 KB
/
pay-alert.vue
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
/*
* @Author: likai
* @Date: 2019-06-06 15:55:56
* @Last Modified by: likai
* @Last Modified time: 2019-07-04 14:50:23
*/
<template>
<div class="pay-alert">
<!-- 支付弹窗 -->
<van-action-sheet v-model="myPayShow" title="确认支付">
<div class="pay-box">
<div class="price">¥{{priceFixed(allPrice)}}</div>
<div class="text">支付方式</div>
<van-radio-group v-model="radio" class="card-box">
<van-cell-group>
<van-cell class="card" clickable @click="radio = '1'">
<van-image
width="0.5rem"
height="0.5rem"
fit="contain"
:src="payIcons[0]"
/>
<label for="">云豆支付</label>
<div v-if="!wxHide" class="over">{{userAccountMoney}}云豆</div>
<van-radio name="1" />
</van-cell>
<van-cell class="card" v-if="!wxHide" clickable @click="radio = '2'">
<van-image
width="0.5rem"
height="0.5rem"
fit="contain"
:src="payIcons[1]"
/>
<label for="">微信支付 <span>微信安全支付</span></label>
<van-radio name="2" />
</van-cell>
</van-cell-group>
</van-radio-group>
<div class="button"
@click="paySubmit">{{radio=='1'?'云豆':'微信'}}支付</div>
</div>
</van-action-sheet>
</div>
</template>
<script>
import {$queryWorkUserInfo} from '@/api/main/index'
export default {
name:'pay-alert',
props:['payShow','allPrice','wxHide'],
data(){
return {
myPayShow:this.payShow,
radio:'1', // 支付类型
userAccountMoney:0,
payIcons:[
require("@/assets/images/market/my-order/icons-card.png"),
require("@/assets/images/market/my-order/icons-wx.png")
],
}
},
watch:{
payShow(val){
this.myPayShow=val;
},
myPayShow(val){
this.$emit('showChange',val)
}
},
created(){
this.queryWorkUserInfo();
},
methods:{
paySubmit(){
this.myPayShow=false;
this.$emit('paySubmit',this.radio);
},
// 获取个人信息
async queryWorkUserInfo(){
const data=await $queryWorkUserInfo();
if(data&&data.code===0){
this.userAccountMoney=data.data.workUser.userMoney;
}
},
}
}
</script>
<style lang="less" scoped>
.pay-alert{
-webkit-overflow-scrolling: auto;
.van-action-sheet{
border-radius: 0.2rem 0.2rem 0 0;
.pay-box{
display: flex;
flex-direction: column;
align-items: center;
.price{
font-size: 0.72rem;
color:@title-color;
margin: 0.3rem 0;
}
.text{
width: 100%;
height: 0.6rem;
padding: 0 0.2rem;
text-align: left;
font-size: @big-size;
color: @msg-time-color;
}
.card-box{
width: 100%;
padding: 0.2rem;
.card{
width: 100%;
height: 1rem;
margin: 0.2rem 0;
background: #fff;
box-shadow: @box-shadow;
border-radius: 0.1rem;
align-items: center;
padding: 0 0.2rem;
.van-cell__value--alone{
width: 100%;
height: 100%;
display: flex;
align-items: center;
label{
margin:0 0.2rem;
margin-right:auto;
display: flex;
flex-direction: column;
line-height: 0.3rem;
span{
color:@msg-time-color;
font-size: @small-size;
}
}
.over{
margin-right: 0.4rem;
color: rgba(255, 149, 53, 1);
}
}
}
}
.button{
width: 80%;
height: 0.9rem;
font-size: @title-size;
line-height: 0.9rem;
text-align: center;
border-radius: 0.5rem;
background: @btn-color;
box-shadow: @btn-shadow;
color: #fff;
margin: 0.2rem 0 0.4rem;
}
}
}
}
</style>