1002884655 3 lat temu
rodzic
commit
e5db85b0a0

+ 2
- 2
project.config.json Wyświetl plik

@@ -2,7 +2,7 @@
2 2
 	"miniprogramRoot": "dist/",
3 3
 	"projectname": "miniapp",
4 4
 	"description": "",
5
-	"appid": "wxe44244d1a5ea3364",
5
+	"appid": "wxc96058d57e77f373",
6 6
 	"setting": {
7 7
 		"urlCheck": false,
8 8
 		"es6": false,
@@ -27,7 +27,7 @@
27 27
 			"outputPath": ""
28 28
 		},
29 29
 		"useIsolateContext": true,
30
-		"useCompilerModule": true,
30
+		"useCompilerModule": false,
31 31
 		"userConfirmedUseCompilerModuleSwitch": false
32 32
 	},
33 33
 	"compileType": "miniprogram",

+ 18
- 3
src/subpackages/pages/consultant/components/FollowCustomer/index.jsx Wyświetl plik

@@ -26,7 +26,8 @@ export default function FollowCustomer () {
26 26
     { name: '7天未成交', id: 7 },
27 27
     { name: '15天未成交', id: 15 }
28 28
   ])
29
-  const [FormData, setFormData] = useState({name: '', status: 0, day: 1})
29
+  const [TimeMenuId, setTimeMenuId] = useState(1)
30
+  const [FormData, setFormData] = useState({name: '', status: 0, startReportDate: '', endReportDate: ''})
30 31
 
31 32
   useEffect(() => {
32 33
     GetPageList()
@@ -59,9 +60,23 @@ export default function FollowCustomer () {
59 60
     }
60 61
   }
61 62
 
63
+  const DateFormat = (date) => {
64
+      const Year = new Date(date).getFullYear()
65
+      const Month = new Date(date).getMonth() + 1
66
+      const Day = new Date(date).getDate()
67
+      return `${Year}-${Month > 9 ? Month : `0${Month}`}-${Day > 9 ? Day : `0${Day}`}`
68
+  }
69
+
62 70
   const CutTime = (item) => {
63 71
     return () => {
64
-      setFormData({...FormData, day: item.id})
72
+      let params = {}
73
+      if(item.id - 0 !== 1) {
74
+        params = {...FormData, startReportDate: DateFormat(Date.now() - 1000 * 60 * 60 * 24 * (item.id - 0)), endReportDate: DateFormat(Date.now())}
75
+      } else {
76
+        params = {...FormData, startReportDate: '', endReportDate: ''}
77
+      }
78
+      setFormData(params)
79
+      setTimeMenuId(item.id)
65 80
     }
66 81
   }
67 82
 
@@ -120,7 +135,7 @@ export default function FollowCustomer () {
120 135
                 <view key={`TimeItem-${index}`} onClick={CutTime(item)}>
121 136
                   <text>{item.name}</text>
122 137
                   {
123
-                    FormData.day === item.id &&
138
+                    TimeMenuId === item.id &&
124 139
                     <Image mode='widthFix' src={require('@/assets/findHouse-icon1.png')}></Image>
125 140
                   }
126 141
                 </view>