|
@@ -1,4 +1,4 @@
|
1
|
|
-import { useState } from 'react'
|
|
1
|
+import { useState, useMemo } from 'react'
|
2
|
2
|
import eyes from '@/assets/icons/shopKeeper/小眼睛.png'
|
3
|
3
|
import ceyes from '@/assets/icons/shopKeeper/小眼睛-闭上.png'
|
4
|
4
|
import sImg from '@/assets/icons/landlord/我的收入2.png'
|
|
@@ -6,25 +6,25 @@ import cutoverUser from '@/assets/icons/UserCenter/cutoverUser.png'
|
6
|
6
|
import ToggleRole from '@/components/toggleRole/ToggleRole'
|
7
|
7
|
import Picker from '@/components/Picker'
|
8
|
8
|
import formatTime from "@/utils/formatTime";
|
9
|
|
-import {getAccountLogList} from '@/services/landlord'
|
|
9
|
+import { getAccountLogList } from '@/services/landlord'
|
10
|
10
|
|
11
|
11
|
import List from '@/components/List';
|
12
|
12
|
import './income.less'
|
13
|
13
|
|
14
|
14
|
|
|
15
|
+const getList = id => params => getAccountLogList(id, params)
|
15
|
16
|
|
16
|
17
|
export default (props) => {
|
17
|
|
- const { hotelList, hotel, account, onHotelChange, accountlog } = props
|
|
18
|
+ const { hotelList, hotel, account, onHotelChange } = props
|
18
|
19
|
|
19
|
|
- // const [accountLog,setAccountLog]=useState(accountlog)
|
|
20
|
+ const queryParams = useMemo(() => ({}), [])
|
20
|
21
|
|
21
|
|
-
|
22
|
|
- // const [queryParams, setQueryParams] = useState({pageNum: 1, pageSize: 10})
|
23
|
|
- // setQueryParams(hotel.hotelId)
|
|
22
|
+ const fetchAPI = useMemo(()=>account.accountId ? getList(account.accountId) : undefined, [account?.accountId])
|
24
|
23
|
|
25
|
24
|
const handleHotelChange = (hotelId, current) => {
|
26
|
25
|
onHotelChange(current)
|
27
|
26
|
}
|
|
27
|
+ const [accountlog, setAccountlog] = useState([])
|
28
|
28
|
|
29
|
29
|
const [isyear, setYear] = useState(true)
|
30
|
30
|
const [isMomth, setMonth] = useState(false)
|
|
@@ -68,44 +68,44 @@ export default (props) => {
|
68
|
68
|
</view>
|
69
|
69
|
</view>
|
70
|
70
|
|
71
|
|
- <view className='title' >{accountlog.length != '' ? '推广收入记录' : '暂无推广收入'}</view>
|
72
|
|
-
|
73
|
|
- {/* <List
|
74
|
|
- style={{ height: '50vh' }}
|
75
|
|
- request={getAccountLogList}
|
76
|
|
- params={queryParams}
|
77
|
|
- onDataChange={setAccountLog}
|
78
|
|
- >
|
79
|
|
- {
|
80
|
|
- (accountLog || []).map((item) =>
|
81
|
|
- <view className='spreadCard'>
|
82
|
|
- <view className='card'>
|
83
|
|
- <view className='spreadTime'>时 间:<text>{formatTime(item.createDate, 'yyyy/MM/dd hh:mm:ss')}</text></view>
|
84
|
|
- <view className='spreadMoney'>收入金额:<text>{parseFloat((item.amount / 100).toFixed(2))}</text>元</view>
|
85
|
|
- <image className='spreadImg' src={sImg} />
|
86
|
|
- </view>
|
87
|
|
- </view>
|
88
|
|
- )
|
89
|
|
- }
|
90
|
|
- </List> */}
|
91
|
|
-
|
92
|
|
-
|
93
|
|
-
|
94
|
|
- <scroll-view scroll-y="true" scroll-view='true' bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll" style={{ height: '50vh' }}>
|
|
71
|
+ <view className='title' >推广收入记录</view>
|
95
|
72
|
|
96
|
|
- {
|
97
|
|
- (accountlog || []).map((item) =>
|
98
|
|
- <view className='spreadCard'>
|
|
73
|
+ <List
|
|
74
|
+ style={{ height: 'calc(100vh - 390px)' }}
|
|
75
|
+ request={fetchAPI}
|
|
76
|
+ params={queryParams}
|
|
77
|
+ noData={<view className='title' >暂无</view>}
|
|
78
|
+ render={({item, index}) => (
|
|
79
|
+ <view className='spreadCard' key={index}>
|
|
80
|
+ <view className='card'>
|
|
81
|
+ <view className='spreadTime'>时 间:<text>{formatTime(item.createDate, 'yyyy/MM/dd hh:mm:ss')}</text></view>
|
|
82
|
+ <view className='spreadMoney'>收入金额:<text>{parseFloat((item.amount / 100).toFixed(2))}</text>元</view>
|
|
83
|
+ <image className='spreadImg' src={sImg} />
|
|
84
|
+ </view>
|
|
85
|
+ </view>
|
|
86
|
+ )}
|
|
87
|
+ >
|
|
88
|
+ </List>
|
|
89
|
+ {/*<view className='title' >{accountlog.length==0?'推广收入记录':'暂无推广收入'}</view>
|
|
90
|
+ <List
|
|
91
|
+ style={{ height: '50vh' }}
|
|
92
|
+ request={fetchAPI}
|
|
93
|
+ params={queryParams}
|
|
94
|
+ onDataChange={setAccountlog}
|
|
95
|
+ noData="暂无推广收入"
|
|
96
|
+ >
|
|
97
|
+ <view className='waterfall'>
|
|
98
|
+ {
|
|
99
|
+ accountlog.map((item,index) => <view className='spreadCard' key={index}>
|
99
|
100
|
<view className='card'>
|
100
|
101
|
<view className='spreadTime'>时 间:<text>{formatTime(item.createDate, 'yyyy/MM/dd hh:mm:ss')}</text></view>
|
101
|
102
|
<view className='spreadMoney'>收入金额:<text>{parseFloat((item.amount / 100).toFixed(2))}</text>元</view>
|
102
|
103
|
<image className='spreadImg' src={sImg} />
|
103
|
104
|
</view>
|
104
|
|
- </view>
|
105
|
|
- )
|
106
|
|
- }
|
107
|
|
- <view className='botton' >已经到底了~</view>
|
108
|
|
- </scroll-view>
|
|
105
|
+ </view>)
|
|
106
|
+ }
|
|
107
|
+ </view>
|
|
108
|
+ </List> */}
|
109
|
109
|
</view>
|
110
|
110
|
</view>
|
111
|
111
|
)
|