goPay.vue
2.4 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
<template>
<view class="page">
<view class="timsg">
<view class="msgtitle">您正在成都锦江绿道有限公司支付金额</view>
<view class="price">
<u-icon name="rmb" style="font-size: 24rpx;" />
{{allPay}}
</view>
</view>
<view style="height: 120rpx;"></view>
<view class="page-footer">
<u-button style="width: 100%;border-radius: 15px;" type="success" @click="submit">支付</u-button>
</view>
</view>
</template>
<script>
export default {
data() {
return {
receivedMsg: [],
allPay: 0
}
},
onLoad(options) {
if (options.msg) {
let receivedMsg = JSON.parse(options.msg)
this.receivedMsg = receivedMsg
receivedMsg.map(item => {
this.allPay += item.paymentAmount
})
}
},
onShow() {
const isLogin = uni.getStorageSync('token');
if (isLogin == '') {
// 如果未登录,跳转到登录页面
uni.navigateTo({
url: '/pages/login/login'
})
} else {
this.$http.sendRequest('/cerePlatformMerchant/queryByPage', 'POST', {
"pageSize": 10,
pageNumber: 0,
phone: uni.getStorageSync('user').phone
}).then(res => {
if (res.data.code == '20004' || res.data.code == '20003') {
uni.navigateTo({
url: '/pages/login/login'
})
}
})
}
},
methods: {
submit() {
let arr = []
this.receivedMsg.map(item => {
let obj = {
orderId: item.tenementOrder,
money: item.paymentAmount,
}
arr.push(obj)
})
// return
this.$http.sendRequest('/order/rentAggregatePayment', 'POST', arr, 3).then(res => {
console.log(JSON.parse(res.data.data).data.codeUrl)
if (res.data.data) {
uni.redirectTo({
url: `/pagesA/rentPay/webView?urls=${JSON.parse(res.data.data).data.codeUrl}`
})
}
})
}
}
}
</script>
<style scoped lang="scss">
.page {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
padding: 0 20rpx;
}
.timsg {
height: 20vh;
text-align: center;
padding: 50px 0;
.msgtitle {
margin-bottom: 20px;
font-size: 30rpx;
color: #A4A4A4;
}
.price {
color: #0FBB59;
font-size: 50rpx;
font-weight: 700;
}
}
.page-footer {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
background-color: #FFFFFF;
padding: 20rpx 20rpx;
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
z-index: 999;
}
</style>