|
@@ -4,16 +4,18 @@ import request, { apis } from '@/utils/request'
|
4
|
4
|
import SlidePopup from '@/components/SlidePopup/index'
|
5
|
5
|
import Page from '@/layouts'
|
6
|
6
|
import { useModel } from '@/store'
|
|
7
|
+import toolclass from '@/utils/toolclass.js'
|
7
|
8
|
import '@/assets/css/reset.less'
|
8
|
9
|
import '@/assets/css/iconfont.less'
|
9
|
10
|
import './index.less'
|
10
|
11
|
|
11
|
12
|
export default function JiaoFeiDetail () {
|
12
|
13
|
const { user } = useModel('user')
|
13
|
|
- const [bill, setBill] = useState([])
|
|
14
|
+ const [bill, setBill] = useState(null)
|
14
|
15
|
const [ShowPopup, setShowPopup] = useState(false)
|
15
|
16
|
|
16
|
17
|
const [PopupType, setPopupType] = useState(0)
|
|
18
|
+ const [PhoneList, setPhoneList] = useState([])
|
17
|
19
|
|
18
|
20
|
const { id } = Current.router.params
|
19
|
21
|
const paying = useRef(false)
|
|
@@ -26,7 +28,7 @@ export default function JiaoFeiDetail () {
|
26
|
28
|
|
27
|
29
|
const cancelOrder = () => {
|
28
|
30
|
if (order.current && order.current.outTradeNo) {
|
29
|
|
- request({...apis.wxCancelPay, args: { outTradeNo: order.current.outTradeNo }, params: { type: 'bill' }}).then(res => {
|
|
31
|
+ request({ ...apis.wxCancelPay, args: { outTradeNo: order.current.outTradeNo }, params: { type: 'bill' } }).then(res => {
|
30
|
32
|
order.current = undefined
|
31
|
33
|
}).catch(er => {
|
32
|
34
|
Taro.showToast({
|
|
@@ -50,14 +52,14 @@ export default function JiaoFeiDetail () {
|
50
|
52
|
}
|
51
|
53
|
|
52
|
54
|
paying.current = true
|
53
|
|
-
|
|
55
|
+
|
54
|
56
|
// 准备下单
|
55
|
|
- request({...apis.wxStartPay, data: { type: 'bill', idArray: [id].map(x => x-0) }}).then(res => {
|
|
57
|
+ request({ ...apis.wxStartPay, data: { type: 'bill', idArray: [id].map(x => x - 0) } }).then(res => {
|
56
|
58
|
order.current = res
|
57
|
59
|
const outTradeNo = res.outTradeNo
|
58
|
60
|
// 下单
|
59
|
|
- request({...apis.wxUnifiedOrder, args: { outTradeNo }, params: { type: 'bill'}} ).then(res => {
|
60
|
|
- wx.requestPayment({
|
|
61
|
+ request({ ...apis.wxUnifiedOrder, args: { outTradeNo }, params: { type: 'bill' } }).then(res => {
|
|
62
|
+ Taro.requestPayment({
|
61
|
63
|
timeStamp: `${res.timeStamp}`,
|
62
|
64
|
nonceStr: res.nonceStr,
|
63
|
65
|
package: res.package,
|
|
@@ -101,54 +103,96 @@ export default function JiaoFeiDetail () {
|
101
|
103
|
})
|
102
|
104
|
})
|
103
|
105
|
}
|
104
|
|
-
|
|
106
|
+
|
|
107
|
+ const Init = () => {
|
|
108
|
+ request({ ...apis.getWuYePhone }).then((res) => { // 获取物业电话
|
|
109
|
+ setPhoneList(res || [])
|
|
110
|
+ })
|
|
111
|
+ }
|
|
112
|
+
|
105
|
113
|
useEffect(() => {
|
106
|
114
|
if (user && id) {
|
107
|
|
- request({ ...apis.getBillInvoiced, args: { orgId: 1, id }}).then(res => {
|
|
115
|
+ request({ ...apis.getBillInvoiced, args: { orgId: 1, id } }).then(res => {
|
108
|
116
|
if (res) {
|
109
|
117
|
setBill(res)
|
110
|
118
|
}
|
111
|
119
|
})
|
|
120
|
+ Init()
|
112
|
121
|
}
|
113
|
122
|
}, [user, id])
|
114
|
123
|
|
115
|
124
|
return (
|
116
|
125
|
<Page>
|
117
|
126
|
<view className='JiaoFeiDetail'>
|
118
|
|
- <view className='DetailContainer'>
|
119
|
|
- <view className='Info'>
|
120
|
|
- <view className='flex-h'>
|
121
|
|
- <text className='flex-item'>物业费</text>
|
122
|
|
- <text>2020/06/08 0:00截止</text>
|
|
127
|
+ {
|
|
128
|
+ bill !== null &&
|
|
129
|
+ <view className='DetailContainer'>
|
|
130
|
+ <view className='Info'>
|
|
131
|
+ <view className='flex-h'>
|
|
132
|
+ <text className='flex-item'>{bill.billName}</text>
|
|
133
|
+ <text>{toolclass.FormatDate(bill.endDate)}截止</text>
|
|
134
|
+ </view>
|
|
135
|
+ <view className='Detail'>
|
|
136
|
+ <view className='Title flex-h'>
|
|
137
|
+ <text className='flex-item'>缴费金额</text>
|
|
138
|
+ <text className='Num'>{bill.payPrice}</text>
|
|
139
|
+ <text>元</text>
|
|
140
|
+ </view>
|
|
141
|
+ <text>{bill.billExplain}</text>
|
|
142
|
+ {/* <view className='Line flex-h'>
|
|
143
|
+ <text>垃圾费:</text>
|
|
144
|
+ <text className='flex-item'>100元</text>
|
|
145
|
+ </view>
|
|
146
|
+ <view className='Line flex-h'>
|
|
147
|
+ <text>绿地维护费:</text>
|
|
148
|
+ <text className='flex-item'>100元</text>
|
|
149
|
+ </view>
|
|
150
|
+ <view className='Line flex-h'>
|
|
151
|
+ <text>公摊电费:</text>
|
|
152
|
+ <text className='flex-item'>100元</text>
|
|
153
|
+ </view> */}
|
|
154
|
+ </view>
|
123
|
155
|
</view>
|
124
|
156
|
<view className='Detail'>
|
125
|
|
- <view className='Title flex-h'>
|
126
|
|
- <text className='flex-item'>缴费金额</text>
|
127
|
|
- <text className='Num'>{bill.payPrice}</text>
|
128
|
|
- <text>元</text>
|
|
157
|
+ <view className='flex-h'>
|
|
158
|
+ <text>订单编号</text>
|
|
159
|
+ <text className='flex-item'>{bill.id}</text>
|
|
160
|
+ </view>
|
|
161
|
+ <view className='flex-h'>
|
|
162
|
+ <text>缴费人</text>
|
|
163
|
+ <text className='flex-item'>{null}</text>
|
|
164
|
+ </view>
|
|
165
|
+ <view className='flex-h'>
|
|
166
|
+ <text>下单时间</text>
|
|
167
|
+ <text className='flex-item'>{toolclass.FormatDate(bill.createTime)}</text>
|
|
168
|
+ </view>
|
|
169
|
+ <view className='flex-h'>
|
|
170
|
+ <text>缴费时间</text>
|
|
171
|
+ <text className='flex-item'>{null}</text>
|
129
|
172
|
</view>
|
130
|
|
- <text>2020年5月物业管理费</text>
|
131
|
|
- <view className='Line flex-h'>
|
132
|
|
- <text>垃圾费:</text>
|
133
|
|
- <text className='flex-item'>100元</text>
|
|
173
|
+ <view className='flex-h'>
|
|
174
|
+ <text>缴费方式</text>
|
|
175
|
+ <text className='flex-item'>微信支付</text>
|
134
|
176
|
</view>
|
135
|
|
- <view className='Line flex-h'>
|
136
|
|
- <text>绿地维护费:</text>
|
137
|
|
- <text className='flex-item'>100元</text>
|
|
177
|
+ <view className='flex-h'>
|
|
178
|
+ <text>交易流水</text>
|
|
179
|
+ <text className='flex-item'>{null}</text>
|
138
|
180
|
</view>
|
139
|
|
- <view className='Line flex-h'>
|
140
|
|
- <text>公摊电费:</text>
|
141
|
|
- <text className='flex-item'>100元</text>
|
|
181
|
+ <view className='flex-h'>
|
|
182
|
+ <text>缴费备注</text>
|
|
183
|
+ <text className='flex-item'>网上缴费</text>
|
142
|
184
|
</view>
|
143
|
185
|
</view>
|
|
186
|
+ <view className='InfoBottom'></view>
|
144
|
187
|
</view>
|
145
|
|
- <view className='InfoBottom'></view>
|
146
|
|
- </view>
|
|
188
|
+ }
|
147
|
189
|
<view className='BottomContainer'>
|
148
|
190
|
<text onClick={() => { setPopupType(2); setShowPopup(true) }}>对费用有疑问?</text>
|
149
|
|
- <text onClick={handleReadyPay}>立即缴费</text>
|
|
191
|
+ {
|
|
192
|
+ bill !== null && bill.billStatus - 0 !== 1 &&
|
|
193
|
+ <text onClick={handleReadyPay}>立即缴费</text>
|
|
194
|
+ }
|
150
|
195
|
</view>
|
151
|
|
-
|
152
|
196
|
{/* 弹窗 */}
|
153
|
197
|
<SlidePopup Close={handleCancelOrder} Show={ShowPopup}>
|
154
|
198
|
{
|
|
@@ -170,21 +214,15 @@ export default function JiaoFeiDetail () {
|
170
|
214
|
<view className='LianXiPopup'>
|
171
|
215
|
<text>联系物业</text>
|
172
|
216
|
<text>对此费用有疑问</text>
|
173
|
|
- <view className='flex-h'>
|
174
|
|
- <text className='flex-item'>物业电话</text>
|
175
|
|
- <text>17826982167</text>
|
176
|
|
- <text className='iconfont icondianhua'></text>
|
177
|
|
- </view>
|
178
|
|
- <view className='flex-h'>
|
179
|
|
- <text className='flex-item'>门卫电话</text>
|
180
|
|
- <text>17826982167</text>
|
181
|
|
- <text className='iconfont icondianhua'></text>
|
182
|
|
- </view>
|
183
|
|
- <view className='flex-h'>
|
184
|
|
- <text className='flex-item'>物业领导</text>
|
185
|
|
- <text>17826982167</text>
|
186
|
|
- <text className='iconfont icondianhua'></text>
|
187
|
|
- </view>
|
|
217
|
+ {
|
|
218
|
+ PhoneList.map((item, index) => (
|
|
219
|
+ <view className='flex-h' key={`PhoneList-${index}`} onClick={() => { Taro.makePhoneCall({ phoneNumber: item.tel }) }}>
|
|
220
|
+ <text className='flex-item'>{item.name}</text>
|
|
221
|
+ <text>{item.tel}</text>
|
|
222
|
+ <text className='iconfont icondianhua'></text>
|
|
223
|
+ </view>
|
|
224
|
+ ))
|
|
225
|
+ }
|
188
|
226
|
</view>
|
189
|
227
|
}
|
190
|
228
|
</SlidePopup>
|