|
@@ -1,19 +1,20 @@
|
1
|
1
|
import { useState, useEffect, useRef } from 'react'
|
2
|
2
|
import withLayout from '@/layout'
|
3
|
|
-import { ScrollView } from '@tarojs/components'
|
|
3
|
+import { ScrollView, Input } from '@tarojs/components'
|
4
|
4
|
import '@/assets/css/iconfont.css'
|
5
|
|
-import { useSelector } from 'react-redux'
|
6
|
5
|
import { fetch } from '@/utils/request'
|
7
|
6
|
import { API_CLIENT_LIST, API_CHANNEL_CLIENT_LIST } from '@/constants/api'
|
8
|
7
|
import { ROLE_CODE } from '@/constants/user'
|
9
|
8
|
import './index.scss'
|
10
|
9
|
import MyCustomerListItem from '../components/MyCustomerListItem/index'
|
|
10
|
+import DatePicker from './components/DatePicker/index'
|
11
|
11
|
import TypePicker from './TypePicker'
|
12
|
12
|
|
13
|
13
|
export default withLayout((props) => {
|
14
|
14
|
const { person } = props
|
15
|
15
|
const [PageList, setPageList] = useState([])
|
16
|
16
|
const [IsPull, setPull] = useState(false)
|
|
17
|
+ const [ShowDatePicker, setShowDatePicker] = useState(false)
|
17
|
18
|
const [pageNumber, setPageNumber] = useState(1)
|
18
|
19
|
const [HasNextPage, setHasNextPage] = useState(true)
|
19
|
20
|
const [bizType, setBizType] = useState('')
|
|
@@ -34,7 +35,7 @@ export default withLayout((props) => {
|
34
|
35
|
}
|
35
|
36
|
|
36
|
37
|
const PageLoadMore = () => { // 页面上拉加载更多
|
37
|
|
- if(HasNextPage) {
|
|
38
|
+ if (HasNextPage) {
|
38
|
39
|
setPageNumber(pageNumber + 1)
|
39
|
40
|
}
|
40
|
41
|
}
|
|
@@ -45,7 +46,7 @@ export default withLayout((props) => {
|
45
|
46
|
|
46
|
47
|
useEffect(() => { // 下拉刷新触发
|
47
|
48
|
if (IsPull) {
|
48
|
|
- if(pageNumber === 1) {
|
|
49
|
+ if (pageNumber === 1) {
|
49
|
50
|
GetPageList.current()
|
50
|
51
|
} else {
|
51
|
52
|
setPageNumber(1)
|
|
@@ -53,12 +54,17 @@ export default withLayout((props) => {
|
53
|
54
|
}
|
54
|
55
|
}, [IsPull])
|
55
|
56
|
|
|
57
|
+ const DateChange = (e) => {
|
|
58
|
+ console.log(e)
|
|
59
|
+ setShowDatePicker(false)
|
|
60
|
+ }
|
|
61
|
+
|
56
|
62
|
return (
|
57
|
63
|
<view className='Page myCustomer flex-v'>
|
58
|
64
|
|
59
|
65
|
<view className='Filter'>
|
60
|
66
|
<view className='flex-h'>
|
61
|
|
- <view className='Time'>
|
|
67
|
+ <view className='Time' onClick={() => { setShowDatePicker(true) }}>
|
62
|
68
|
<text>全部时间</text>
|
63
|
69
|
<text className='iconfont icon-sanjiaoxingdown'></text>
|
64
|
70
|
</view>
|
|
@@ -67,13 +73,18 @@ export default withLayout((props) => {
|
67
|
73
|
<text className='iconfont icon-sanjiaoxingdown'></text>
|
68
|
74
|
</view>
|
69
|
75
|
<view className='flex-item'></view>
|
70
|
|
- <text className='iconfont icon-sousuo'></text>
|
|
76
|
+ <view className='Search'>
|
|
77
|
+ <text className='iconfont icon-sousuo'></text>
|
|
78
|
+ <Input placeholder='请输入'></Input>
|
|
79
|
+ </view>
|
71
|
80
|
</view>
|
72
|
81
|
</view>
|
73
|
82
|
|
74
|
83
|
<view className='flex-item'>
|
75
|
84
|
<view>
|
76
|
85
|
|
|
86
|
+ <DatePicker visable={ShowDatePicker} close={() => { setShowDatePicker(false) }} change={DateChange}></DatePicker>
|
|
87
|
+
|
77
|
88
|
<ScrollView scroll-y refresher-enabled refresher-triggered={IsPull} onrefresherrefresh={PageRefresh} onscrolltolower={PageLoadMore} refresher-background='#fff'>
|
78
|
89
|
<view className='PageContent'>
|
79
|
90
|
<view className='List'>
|