|
@@ -1,31 +1,31 @@
|
1
|
1
|
import Taro from "@tarojs/taro"
|
2
|
2
|
import { View, ScrollView } from "@tarojs/components"
|
3
|
|
-import { useEffect,useState } from "react"
|
|
3
|
+import { useEffect, useState } from "react"
|
4
|
4
|
import withLayout from '@/layouts'
|
5
|
5
|
import CustomNav from "@/components/CustomNav"
|
6
|
6
|
import WalletCard from "@/components/walletCard"
|
7
|
7
|
import ListTitle from "@/components/ListTitle"
|
8
|
|
-import {getAccount,getLogList} from '@/services/account'
|
|
8
|
+import { getAccount, getLogList } from '@/services/account'
|
9
|
9
|
import './style.less'
|
10
|
10
|
|
11
|
11
|
|
12
|
12
|
export default withLayout((props) => {
|
13
|
|
- const [balance,setBlance]=useState(0)
|
14
|
|
- const [logList,setLogList]=useState([])
|
|
13
|
+ const [balance, setBlance] = useState(0)
|
|
14
|
+ const [logList, setLogList] = useState([])
|
15
|
15
|
const goWithdrawal = () => {
|
16
|
16
|
Taro.navigateTo({ url: `/pages/withdrawal/index?balance=${balance}` });
|
17
|
17
|
}
|
18
|
|
- const getList=()=>{
|
19
|
|
- getAccount().then(res=>{
|
20
|
|
- setBlance(res.amounts)
|
|
18
|
+ const getList = () => {
|
|
19
|
+ getAccount().then(res => {
|
|
20
|
+ setBlance(res.amounts / 100)
|
21
|
21
|
})
|
22
|
|
- getLogList().then(res=>{
|
|
22
|
+ getLogList().then(res => {
|
23
|
23
|
setLogList(res.records)
|
24
|
24
|
})
|
25
|
25
|
}
|
26
|
|
- useEffect(()=>{
|
|
26
|
+ useEffect(() => {
|
27
|
27
|
getList()
|
28
|
|
- },[])
|
|
28
|
+ }, [])
|
29
|
29
|
return (
|
30
|
30
|
<View className='page-index'>
|
31
|
31
|
<View className='index-navbar'>
|
|
@@ -35,34 +35,32 @@ export default withLayout((props) => {
|
35
|
35
|
<ScrollView scrollY style={{ height: '100%' }}>
|
36
|
36
|
<WalletCard onClick={goWithdrawal} value={balance} />
|
37
|
37
|
<ListTitle value='零钱明细' />
|
38
|
|
- <View className='walletCell'>
|
39
|
|
- <View className='flexTop'>
|
40
|
|
- <View className='content'>提现</View>
|
41
|
|
- <View className='money'>-9000</View>
|
42
|
|
- </View>
|
43
|
|
- <View className='withDrawalDetail'>2022-4-10 10:55</View>
|
44
|
|
- </View>
|
45
|
|
- <View className='walletCell'>
|
46
|
|
- <View className='flexTop'>
|
47
|
|
- <View className='content'>提现</View>
|
48
|
|
- <View className='money'>-9</View>
|
49
|
|
- </View>
|
50
|
|
- <View className='withDrawalDetail'>2022-4-8 10:55</View>
|
51
|
|
- </View>
|
52
|
|
- <View className='walletCell'>
|
53
|
|
- <View className='flexTop'>
|
54
|
|
- <View className='content'>收入</View>
|
55
|
|
- <View className='money revenue'>+200</View>
|
56
|
|
- </View>
|
57
|
|
- <View className='withDrawalDetail'>2022-2-10 10:55</View>
|
58
|
|
- </View>
|
59
|
|
- <View className='walletCell'>
|
60
|
|
- <View className='flexTop'>
|
61
|
|
- <View className='content'>提现</View>
|
62
|
|
- <View className='money'>-90</View>
|
63
|
|
- </View>
|
64
|
|
- <View className='withDrawalDetail'>2022-4-1 10:55</View>
|
65
|
|
- </View>
|
|
38
|
+ {
|
|
39
|
+ logList && logList.map(item => {
|
|
40
|
+ return <View key={item.accountId} className='walletCell'>
|
|
41
|
+ <View className='flexTop'>
|
|
42
|
+ <View className='content'>
|
|
43
|
+ {
|
|
44
|
+ item.chargeType == 'order_pay' ?
|
|
45
|
+ '订单收入' :
|
|
46
|
+ item.chargeType == 'order_refund' ?
|
|
47
|
+ '用户退款' :
|
|
48
|
+ item.chargeType == 'withdraw' ?
|
|
49
|
+ '提现' : ''
|
|
50
|
+ }
|
|
51
|
+ </View>
|
|
52
|
+ <View className={['money', item.chargeType == 'order_pay' ? '' : 'revenue']}>
|
|
53
|
+ {
|
|
54
|
+ item.chargeType == 'order_pay' ?
|
|
55
|
+ '+' + item.money / 100 :
|
|
56
|
+ '-' + item.money / 100
|
|
57
|
+ }
|
|
58
|
+ </View>
|
|
59
|
+ </View>
|
|
60
|
+ <View className='withDrawalDetail'>{item.createDate.substr(0, 16)}</View>
|
|
61
|
+ </View>
|
|
62
|
+ })
|
|
63
|
+ }
|
66
|
64
|
</ScrollView>
|
67
|
65
|
</View>
|
68
|
66
|
</View>
|