Browse Source

静态页面

1002884655 3 years ago
parent
commit
6a2c5f36aa

+ 55
- 0
src/pages/mine/myCustomer/components/DatePicker/index.jsx View File

1
+import { useState } from 'react'
2
+import { Picker } from '@tarojs/components'
3
+import '@/assets/css/iconfont.css'
4
+import './index.scss'
5
+
6
+export default function DatePicker (props) {
7
+
8
+  const { change = () => { }, close = () => { }, visable = false } = props
9
+
10
+  const [StartDate, setStartDate] = useState(null)
11
+  const [EndDate, setEndDate] = useState(null)
12
+
13
+  const StartDateChange = (e) => {
14
+    setStartDate(e.detail.value)
15
+  }
16
+
17
+  const EndDateChange = (e) => {
18
+    setEndDate(e.detail.value)
19
+  }
20
+
21
+  const Sure = () => {
22
+    change([StartDate, EndDate])
23
+  }
24
+
25
+  return (
26
+    <view className='components DatePicker' style={{display: visable ? 'block' : 'none'}}>
27
+      <view>
28
+
29
+        <view className='DateInput flex-h'>
30
+          <view className='flex-item'>
31
+            <Picker mode='date' value={null} onChange={StartDateChange}>
32
+              <text className='DateText'>{StartDate || '请选择开始日期'}</text>
33
+            </Picker>
34
+          </view>
35
+          <text>-</text>
36
+          <view className='flex-item'>
37
+            <Picker mode='date' value={null} onChange={EndDateChange}>
38
+              <text className='DateText'>{EndDate || '请选择结束日期'}</text>
39
+            </Picker>
40
+          </view>
41
+        </view>
42
+
43
+        <view className='Btn flex-h'>
44
+          <view className='flex-item'>
45
+            <text onClick={close}>取消</text>
46
+          </view>
47
+          <view className='flex-item'>
48
+            <text onClick={Sure}>确定</text>
49
+          </view>
50
+        </view>
51
+
52
+      </view>
53
+    </view>
54
+  )
55
+}

+ 59
- 0
src/pages/mine/myCustomer/components/DatePicker/index.scss View File

1
+.components.DatePicker {
2
+  width: 100%;
3
+  position: absolute;
4
+  left: 0;
5
+  top: 0;
6
+  bottom: 0;
7
+  z-index: 2;
8
+  background: rgba(0, 0, 0, 0.6);
9
+  >view {
10
+    position: relative;
11
+    overflow: hidden;
12
+    background: #fff;
13
+    padding: 30px;
14
+    >.DateInput {
15
+      align-items: center;
16
+      position: relative;
17
+      overflow: hidden;
18
+      box-sizing: border-box;
19
+      border: 2px solid rgba(0, 0, 0, 0.1);
20
+      border-radius: 8px;
21
+      >view {
22
+        position: relative;
23
+        text-align: center;
24
+        .DateText {
25
+          display: block;
26
+          text-align: center;
27
+          font-size: 28px;
28
+          line-height: 80px;
29
+        }
30
+      }
31
+    }
32
+    >.Btn {
33
+      align-items: center;
34
+      padding: 0 60px;
35
+      margin-top: 100px;
36
+      >.flex-item {
37
+        margin-left: 80px;
38
+        &:first-child {
39
+          margin-left: 0;
40
+          >text {
41
+            color: #193C83;
42
+            background: none;
43
+          }
44
+        }
45
+        >text {
46
+          display: block;
47
+          font-size: 30px;
48
+          color: #fff;
49
+          line-height: 80px;
50
+          text-align: center;
51
+          background: #193C83;
52
+          border-radius: 80px;
53
+          box-sizing: border-box;
54
+          border: 2px solid #193C83;
55
+        }
56
+      }
57
+    }
58
+  }
59
+}

+ 17
- 6
src/pages/mine/myCustomer/index.jsx View File

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

+ 25
- 3
src/pages/mine/myCustomer/index.scss View File

1
 .Page.myCustomer {
1
 .Page.myCustomer {
2
   background: #fff;
2
   background: #fff;
3
+  position: relative;
4
+  overflow: hidden;
3
   > .Filter {
5
   > .Filter {
4
     position: relative;
6
     position: relative;
5
     overflow: hidden;
7
     overflow: hidden;
6
     padding: 0 30px;
8
     padding: 0 30px;
9
+    z-index: 2;
7
     > view {
10
     > view {
8
       align-items: center;
11
       align-items: center;
9
       border-bottom: 2px solid rgba(0, 0, 0, 0.12);
12
       border-bottom: 2px solid rgba(0, 0, 0, 0.12);
48
           }
51
           }
49
         }
52
         }
50
       }
53
       }
51
-      >text {
52
-        font-size: 40px;
53
-        color: #666;
54
+      >.Search {
55
+        font-size: 0;
56
+        white-space: nowrap;
57
+        background: rgba(0, 0, 0, 0.1);
58
+        border-radius: 60px;
59
+        padding-left: 20px;
60
+        >text {
61
+          font-size: 30px;
62
+          color: #666;
63
+          display: inline-block;
64
+          vertical-align: middle;
65
+        }
66
+        >input {
67
+          display: inline-block;
68
+          vertical-align: middle;
69
+          font-size: 28px;
70
+          height: 60px;
71
+          width: 300px;
72
+        }
54
       }
73
       }
55
     }
74
     }
56
   }
75
   }
57
   > .flex-item {
76
   > .flex-item {
58
     position: relative;
77
     position: relative;
59
     overflow: hidden;
78
     overflow: hidden;
79
+    z-index: 1;
60
     > view {
80
     > view {
61
       width: 100%;
81
       width: 100%;
62
       position: absolute;
82
       position: absolute;
67
       > scroll-view {
87
       > scroll-view {
68
         width: 100%;
88
         width: 100%;
69
         height: 100%;
89
         height: 100%;
90
+        position: relative;
91
+        z-index: 1;
70
         .PageContent {
92
         .PageContent {
71
           position: relative;
93
           position: relative;
72
           overflow: hidden;
94
           overflow: hidden;

+ 6
- 6
src/routes.js View File

4
   /**********************************
4
   /**********************************
5
    *  Tab 页面
5
    *  Tab 页面
6
    *********************************/
6
    *********************************/
7
+  {
8
+    name: '我的客户',
9
+    page: 'pages/mine/myCustomer/index',
10
+    pkg: 'main',
11
+    type: 'mine',
12
+  },
7
   {
13
   {
8
     name: '首页',
14
     name: '首页',
9
     page: 'pages/index/index',
15
     page: 'pages/index/index',
307
     pkg: 'main',
313
     pkg: 'main',
308
     type: 'mine',
314
     type: 'mine',
309
   },
315
   },
310
-  {
311
-    name: '我的客户',
312
-    page: 'pages/mine/myCustomer/index',
313
-    pkg: 'main',
314
-    type: 'mine',
315
-  },
316
   {
316
   {
317
     name: '客户详情',
317
     name: '客户详情',
318
     page: 'pages/mine/myCustomerDetail/index',
318
     page: 'pages/mine/myCustomerDetail/index',