浏览代码

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

张延森 3 年前
父节点
当前提交
79aa3c05e3

+ 1
- 0
src/pages/index/buildingDetail/index.jsx 查看文件

@@ -53,6 +53,7 @@ export default withLayout((props) => {
53 53
         ...trackData,
54 54
         event: 'detail',
55 55
         eventType: 'building',
56
+        buildingId: id,
56 57
         targetType: 'building'
57 58
       })
58 59
       addItemUv(id)

+ 2
- 2
src/pages/mine/components/EditUserDetailBasicInfo/index.jsx 查看文件

@@ -1,7 +1,7 @@
1 1
 import { useState, useEffect } from 'react'
2 2
 import { ScrollView, Input, Picker } from '@tarojs/components'
3 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 5
 import Taro from '@tarojs/taro'
6 6
 import './index.scss'
7 7
 
@@ -37,7 +37,7 @@ export default function EditUserDetailBasicInfo (props) {
37 37
 
38 38
   const ToSubmit = () => {
39 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 41
     fetch({ url, method: Data.customerId ? 'put' : 'post', payload: params }).then(() => {
42 42
       Taro.showToast({ title: '修改成功', icon: 'none', duration: 2000 })
43 43
       close()

+ 1
- 1
src/subpackages/pages/channel/partnerChannel/hooks/useReport.js 查看文件

@@ -5,7 +5,7 @@ import { fillTime } from '../utils'
5 5
 const now = new Date()
6 6
 
7 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 9
   const [reportInfo, setReportInfo] = useState({})
10 10
 
11 11
   useEffect(() => {

+ 10
- 1
src/subpackages/pages/channel/partnerChannel/index.jsx 查看文件

@@ -11,6 +11,7 @@ import useReport from './hooks/useReport'
11 11
 import useChart from './hooks/useChart'
12 12
 // import '@/assets/css/iconfont.css'
13 13
 import './index.scss'
14
+import { fillTime, cutDays, cutMonths } from './utils'
14 15
 
15 16
 const statTypeDicts = [
16 17
   {name: '按天', id: 'day'},
@@ -61,6 +62,14 @@ export default withLayout((props) => {
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 73
   const [tp1 = {}, tp2 = {}, tp3 = {}] = rankList||[]
65 74
 
66 75
   return (
@@ -166,7 +175,7 @@ export default withLayout((props) => {
166 175
                 <text className='iconfont icon-sanjiaoxingdown'></text>
167 176
               </view>
168 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 179
                 <text className='iconfont icon-sanjiaoxingdown'></text>
171 180
               </view>
172 181
             </view>