Browse Source

Merge branch 'main' of http://git.ycjcjy.com/marketing/miniapp into main

张延森 3 years ago
parent
commit
79aa3c05e3

+ 1
- 0
src/pages/index/buildingDetail/index.jsx View File

53
         ...trackData,
53
         ...trackData,
54
         event: 'detail',
54
         event: 'detail',
55
         eventType: 'building',
55
         eventType: 'building',
56
+        buildingId: id,
56
         targetType: 'building'
57
         targetType: 'building'
57
       })
58
       })
58
       addItemUv(id)
59
       addItemUv(id)

+ 2
- 2
src/pages/mine/components/EditUserDetailBasicInfo/index.jsx View File

1
 import { useState, useEffect } from 'react'
1
 import { useState, useEffect } from 'react'
2
 import { ScrollView, Input, Picker } from '@tarojs/components'
2
 import { ScrollView, Input, Picker } from '@tarojs/components'
3
 import { fetch } from '@/utils/request'
3
 import { fetch } from '@/utils/request'
4
-import { API_RECOMMEND_EDIT } from '@/constants/api'
4
+import { API_RECOMMEND_EDIT, API_GET_CUSTOMER_INFO } from '@/constants/api'
5
 import Taro from '@tarojs/taro'
5
 import Taro from '@tarojs/taro'
6
 import './index.scss'
6
 import './index.scss'
7
 
7
 
37
 
37
 
38
   const ToSubmit = () => {
38
   const ToSubmit = () => {
39
     let params = { ...FormData, customerId: CustomerId }
39
     let params = { ...FormData, customerId: CustomerId }
40
-    let url = Data.customerId ? `${API_RECOMMEND_EDIT}/${Data.customerId}` : API_RECOMMEND_EDIT
40
+    let url = Data.customerId ? `${API_GET_CUSTOMER_INFO}/${Data.customerId}` : API_GET_CUSTOMER_INFO
41
     fetch({ url, method: Data.customerId ? 'put' : 'post', payload: params }).then(() => {
41
     fetch({ url, method: Data.customerId ? 'put' : 'post', payload: params }).then(() => {
42
       Taro.showToast({ title: '修改成功', icon: 'none', duration: 2000 })
42
       Taro.showToast({ title: '修改成功', icon: 'none', duration: 2000 })
43
       close()
43
       close()

+ 1
- 1
src/subpackages/pages/channel/partnerChannel/hooks/useReport.js View File

5
 const now = new Date()
5
 const now = new Date()
6
 
6
 
7
 export default function useReport() {
7
 export default function useReport() {
8
-  const [reportDateRange, setReportDateRange] = useState([now.toJSON().substring(0, 10), now.toJSON().substring(0, 10)])
8
+  const [reportDateRange, setReportDateRange] = useState([new Date(Date.now() - 6 * 24 * 60 * 60 * 1000).toJSON().substring(0, 10), now.toJSON().substring(0, 10)])
9
   const [reportInfo, setReportInfo] = useState({})
9
   const [reportInfo, setReportInfo] = useState({})
10
 
10
 
11
   useEffect(() => {
11
   useEffect(() => {

+ 10
- 1
src/subpackages/pages/channel/partnerChannel/index.jsx View File

11
 import useChart from './hooks/useChart'
11
 import useChart from './hooks/useChart'
12
 // import '@/assets/css/iconfont.css'
12
 // import '@/assets/css/iconfont.css'
13
 import './index.scss'
13
 import './index.scss'
14
+import { fillTime, cutDays, cutMonths } from './utils'
14
 
15
 
15
 const statTypeDicts = [
16
 const statTypeDicts = [
16
   {name: '按天', id: 'day'},
17
   {name: '按天', id: 'day'},
61
     }
62
     }
62
   }
63
   }
63
 
64
 
65
+  const SortChange = (e) => {
66
+    setStatType(e)
67
+    const num = e === 'month' ? 6 : 7
68
+    const now = new Date()
69
+    const startDate = e === 'month' ? cutMonths(now, num) : cutDays(now, num)
70
+    setReportDateRange([fillTime(startDate.toJSON().substring(0, 10), true), fillTime(now.toJSON().substring(0, 10), false)])
71
+  }
72
+
64
   const [tp1 = {}, tp2 = {}, tp3 = {}] = rankList||[]
73
   const [tp1 = {}, tp2 = {}, tp3 = {}] = rankList||[]
65
 
74
 
66
   return (
75
   return (
166
                 <text className='iconfont icon-sanjiaoxingdown'></text>
175
                 <text className='iconfont icon-sanjiaoxingdown'></text>
167
               </view>
176
               </view>
168
               <view className='Sort'>
177
               <view className='Sort'>
169
-                <Picker kv={['name', 'id']} dicts={statTypeDicts} value={statType} onChange={setStatType} />
178
+                <Picker kv={['name', 'id']} dicts={statTypeDicts} value={statType} onChange={SortChange} />
170
                 <text className='iconfont icon-sanjiaoxingdown'></text>
179
                 <text className='iconfont icon-sanjiaoxingdown'></text>
171
               </view>
180
               </view>
172
             </view>
181
             </view>