瀏覽代碼

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

张延森 3 年之前
父節點
當前提交
c15e594384

+ 7
- 0
project.config.json 查看文件

@@ -77,6 +77,13 @@
77 77
 					"pathName": "pages/chat/chatDetail/index",
78 78
 					"query": "friend=d060bba5d66221200d8b19e7fa8b020b",
79 79
 					"scene": null
80
+				},
81
+				{
82
+					"id": -1,
83
+					"name": "pages/index/activityDetail/index",
84
+					"pathName": "pages/index/activityDetail/index",
85
+					"query": "id=5e1e226d71d7774ba8166440aed78a11&eventType=dymic",
86
+					"scene": null
80 87
 				}
81 88
 			]
82 89
 		}

+ 2
- 2
src/components/ProjectListItem/index.jsx 查看文件

@@ -11,9 +11,9 @@ export default function ProjectListItem (props) {
11 11
 
12 12
   const LinkTo = () => {
13 13
     if(Data.eventType === 'news') { // 资讯
14
-      Taro.navigateTo({ url: `/pages/index/newsDetail/index?id=${Data.targetId}` })
14
+      Taro.navigateTo({ url: `/pages/index/newsDetail/index?id=${Data.targetId}&eventType=${Data.type}` })
15 15
     } else if(Data.eventType === 'activity') { // 活动
16
-      Taro.navigateTo({ url: `/pages/index/activityDetail/index?id=${Data.targetId}` })
16
+      Taro.navigateTo({ url: `/pages/index/activityDetail/index?id=${Data.targetId}&eventType=${Data.type}` })
17 17
     } else { // 楼盘
18 18
       Taro.navigateTo({ url: `/pages/index/buildingDetail/index?id=${Data.buildingId || Data.targetId}` })
19 19
     }

+ 2
- 2
src/layout/index.js 查看文件

@@ -32,7 +32,7 @@ export default (ChildComponent) => (props) => {
32 32
   const [shareTimelineVisible, setShareTimelineVisible] = useState(false)
33 33
   const consultant = useSelector(s => s.system.consultant)
34 34
 
35
-  const { id, scene, qrInited } = router.params
35
+  const { id, scene, qrInited, type } = router.params
36 36
 
37 37
   const showConsultant = page.shortcut && page.shortcut.consultant
38 38
 
@@ -76,7 +76,7 @@ export default (ChildComponent) => (props) => {
76 76
     const consultantId = person?.personType === ROLE_CODE.CONSULTANT ? person.personId : undefined
77 77
 
78 78
     setTrackData({
79
-      eventType: page.type,
79
+      eventType: type || page.type,
80 80
       propertyName: page.name,
81 81
       consultantId,
82 82
       sharePersonId: person?.personId,

+ 145
- 128
src/pages/index/activityDetail/index.jsx 查看文件

@@ -1,6 +1,7 @@
1
-import { useState, useEffect } from 'react';
2
-import Taro from '@tarojs/taro';
3
-import withLayout from '@/layout';
1
+import { useState, useEffect } from "react";
2
+import Taro from "@tarojs/taro";
3
+import withLayout from "@/layout";
4
+import { savePoint } from "@/services/common";
4 5
 import {
5 6
   ScrollView,
6 7
   Image,
@@ -9,77 +10,70 @@ import {
9 10
   Text,
10 11
   Input,
11 12
   Picker,
12
-  Button
13
-} from '@tarojs/components';
14
-import Disclaimer from '@/components/Disclaimer';
15
-import { useSelector } from 'react-redux';
16
-import {
17
-  signupActivity,
18
-  queryActivityDetail,
19
-} from "@/services/activity";
13
+  Button,
14
+} from "@tarojs/components";
15
+import Disclaimer from "@/components/Disclaimer";
16
+import { useSelector } from "react-redux";
17
+import { signupActivity, queryActivityDetail } from "@/services/activity";
20 18
 import { getImgURL } from "@/utils/image";
21 19
 import { formatDate } from "@/utils/chatDate";
22 20
 import useParams from "@/utils/hooks/useParams";
23 21
 import useShare from "@/utils/hooks/useShare";
24 22
 import useFavor from "@/utils/hooks/useFavor";
25 23
 import { times } from "@/utils/tools";
26
-import useStatus from './useStatus'
27
-import CountDown from './CountDown'
24
+import useStatus from "./useStatus";
25
+import CountDown from "./CountDown";
28 26
 
29 27
 import "./index.scss";
30 28
 
31
-const activityStatusDict = {
32
-  0: {
33
-    text: '立即参与',
34
-    text1: '立即参团',
35
-    className: 'yellow',
36
-  },
37
-  1: {
38
-    text: '未开始',
39
-    text1: '未开始',
40
-    className: 'blue',
41
-  },
42
-  2: {
43
-    text: '已结束',
44
-    text1: '已结束',
45
-    className: 'grey',
46
-  },
47
-  3: {
48
-    text: '已参与',
49
-    text1: '已结束',
50
-    className: 'yellow',
51
-  },
52
-};
53
-
54 29
 export default withLayout((props) => {
55
-  const { router, shareContent, trackData, person, page, showShareTimeline, setNavigationBarTitle } = props;
56
-  const { id } = router.params;
30
+  const {
31
+    router,
32
+    shareContent,
33
+    trackData,
34
+    person,
35
+    page,
36
+    showShareTimeline,
37
+    setNavigationBarTitle,
38
+  } = props;
39
+  const { id, eventType = "dymic" } = router.params;
57 40
 
58 41
   const user = useSelector((state) => state.user);
59 42
 
60
-  const [detail, setDetail] = useState({})
61
-  const [canChoose, setCanChoose] = useState('none');
62
-  const [inputName, setInputName] = useState('');
63
-  const [selectorChecked, setSelectorChecked] = useState('1');
64
-  const [selector, setSelector] = useState('');
43
+  const [detail, setDetail] = useState({});
44
+  const [canChoose, setCanChoose] = useState("none");
45
+  const [inputName, setInputName] = useState("");
46
+  const [selectorChecked, setSelectorChecked] = useState("1");
47
+  const [selector, setSelector] = useState("");
65 48
 
66 49
   const buildingId = detail?.buildingId;
67 50
 
68
-  const [btnText, btnDisabled] = useStatus(detail)
51
+  const [btnText, btnDisabled] = useStatus(detail);
69 52
 
70 53
   const getDetail = (params) => {
71 54
     Taro.showLoading();
72 55
 
73 56
     queryActivityDetail(params).then((res) => {
74
-      const maxperson = 10
57
+      const maxperson = 10;
75 58
       setSelector(times(maxperson).map((_, i) => `${i + 1}`));
76 59
 
77
-      setDetail(res ||{});
78
-      setNavigationBarTitle(res?.title)
60
+      setDetail(res || {});
61
+      setNavigationBarTitle(res?.title);
79 62
       Taro.hideLoading();
80 63
     });
81 64
   };
82 65
 
66
+  useEffect(() => {
67
+    if (trackData.eventType && detail.dynamicId) {
68
+      savePoint({
69
+        ...trackData,
70
+        event: "detail",
71
+        eventType: detail.type || "dymic",
72
+        targetType: detail.type || "dymic",
73
+      });
74
+    }
75
+  }, [trackData, detail]);
76
+
83 77
   // 本页面分享或者海报参数
84 78
   const paramsRef = useParams({
85 79
     id,
@@ -99,32 +93,38 @@ export default withLayout((props) => {
99 93
   useShare(
100 94
     {
101 95
       title: shareContent.shareContentTitle || detail?.title,
102
-      path: `${router.path}?${paramsRef.current}`,
96
+      path: `${router.path}?${paramsRef.current}&type=${
97
+        detail.type || "dymic"
98
+      }`,
103 99
       // image: shareContent.shareContentImg || getImgURL(detail?.imgUrl),
104
-      image: '',
100
+      image: "",
105 101
     },
106
-    fullTrackData
102
+    { ...fullTrackData, eventType: detail.type || "dymic" }
107 103
   );
108 104
 
109 105
   useEffect(() => {
110 106
     if (id) {
111 107
       getDetail(id);
112 108
     }
113
-  }, [id])
109
+  }, [id]);
114 110
 
115 111
   const handleSignup = () => {
116 112
     setCanChoose("block");
117 113
   };
118 114
 
119 115
   const comfire = () => {
120
-    const { dynamicId } = detail
121
-    const { userInfo: { person: { phone, tel } } } = user
122
-    if (inputName === '') {
116
+    const { dynamicId } = detail;
117
+    const {
118
+      userInfo: {
119
+        person: { phone, tel },
120
+      },
121
+    } = user;
122
+    if (inputName === "") {
123 123
       Taro.showToast({
124
-        title: '请输入姓名',
125
-        icon: 'none'
126
-      })
127
-      return
124
+        title: "请输入姓名",
125
+        icon: "none",
126
+      });
127
+      return;
128 128
     }
129 129
 
130 130
     const payload = {
@@ -139,15 +139,15 @@ export default withLayout((props) => {
139 139
       Taro.showToast({
140 140
         title: "报名成功",
141 141
       });
142
-      setCanChoose('none')
142
+      setCanChoose("none");
143 143
       setTimeout(() => {
144
-        getDetail(id)
145
-      }, 500)
144
+        getDetail(id);
145
+      }, 500);
146 146
     });
147 147
   };
148 148
 
149
-  function hideModal () {
150
-    setCanChoose('none');
149
+  function hideModal() {
150
+    setCanChoose("none");
151 151
   }
152 152
 
153 153
   const onInputText = (e) => {
@@ -155,35 +155,38 @@ export default withLayout((props) => {
155 155
   };
156 156
 
157 157
   const dymic = () => (
158
-    <view className='Info'>
158
+    <view className="Info">
159 159
       <view>
160
-        <view className='Title flex-h'>
161
-          <view className='flex-item'>
160
+        <view className="Title flex-h">
161
+          <view className="flex-item">
162 162
             <text>{detail.halfTitle}</text>
163 163
           </view>
164
-          <text className='Tips'>{detail.enlisted || 0}人已报名</text>
164
+          <text className="Tips">{detail.enlisted || 0}人已报名</text>
165 165
         </view>
166
-        <text className='Time'>
166
+        <text className="Time">
167 167
           报名截止时间:
168
-          {formatDate(detail.enlistEnd, 'yyyy/MM/dd')}
168
+          {formatDate(detail.enlistEnd, "yyyy/MM/dd")}
169 169
         </text>
170
-        <text className='Name'>{detail.title}</text>
171
-        <view className='flex-h Address'>
170
+        <text className="Name">{detail.title}</text>
171
+        <view className="flex-h Address">
172 172
           <text>活动地址:</text>
173
-          <view className='flex-item'>
173
+          <view className="flex-item">
174 174
             <text>{detail.address}</text>
175 175
           </view>
176 176
         </view>
177
-        <view className='flex-h Date'>
177
+        <view className="flex-h Date">
178 178
           <text>活动时间:</text>
179
-          <view className='flex-item'>
179
+          <view className="flex-item">
180 180
             <text>
181
-              {`${formatDate(detail.startDate, 'yyyy/MM/dd')} - ${formatDate(detail.endDate, 'yyyy/MM/dd')}`}
181
+              {`${formatDate(detail.startDate, "yyyy/MM/dd")} - ${formatDate(
182
+                detail.endDate,
183
+                "yyyy/MM/dd"
184
+              )}`}
182 185
             </text>
183 186
           </view>
184 187
         </view>
185
-        <view className='Btn'>
186
-          <Button open-type='share'>
188
+        <view className="Btn">
189
+          <Button open-type="share">
187 190
             <text>分享好友</text>
188 191
           </Button>
189 192
         </view>
@@ -192,29 +195,35 @@ export default withLayout((props) => {
192 195
   );
193 196
 
194 197
   const house = () => (
195
-
196
-    <view className='BuildingInfo'>
197
-
198
-      <view className='flex-h Title'>
199
-        <view className='flex-item'>
200
-          <text className='Name'>{detail.title}</text>
201
-          <view className='Address flex-h'>
202
-            <text className='iconfont icon-dingwei'></text>
203
-            <view className='flex-item'>
198
+    <view className="BuildingInfo">
199
+      <view className="flex-h Title">
200
+        <view className="flex-item">
201
+          <text className="Name">{detail.title}</text>
202
+          <view className="Address flex-h">
203
+            <text className="iconfont icon-dingwei"></text>
204
+            <view className="flex-item">
204 205
               <text>{detail.address}</text>
205 206
             </view>
206 207
           </view>
207
-          <text className='Price'>{detail.groupBuyPrice || '价格待定'}</text>
208
-          <text className='Time'>活动时间:{formatDate(detail.startDate, 'yyyy/MM/dd')} - {formatDate(detail.endDate, 'yyyy/MM/dd')}</text>
208
+          <text className="Price">{detail.groupBuyPrice || "价格待定"}</text>
209
+          <text className="Time">
210
+            活动时间:{formatDate(detail.startDate, "yyyy/MM/dd")} -{" "}
211
+            {formatDate(detail.endDate, "yyyy/MM/dd")}
212
+          </text>
209 213
         </view>
210
-        <view className='Option'>
214
+        <view className="Option">
211 215
           <view>
212
-            <text className='iconfont icon-fenxiang1'></text>
216
+            <text className="iconfont icon-fenxiang1"></text>
213 217
             <text>分享</text>
214
-            <Button open-type='share' className='ShareBtn'>分享</Button>
218
+            <Button open-type="share" className="ShareBtn">
219
+              分享
220
+            </Button>
215 221
           </view>
216 222
           <view onClick={() => showShareTimeline(true)}>
217
-            <text className='iconfont icon-pengyouquan1' style='font-size: 32rpx'></text>
223
+            <text
224
+              className="iconfont icon-pengyouquan1"
225
+              style="font-size: 32rpx"
226
+            ></text>
218 227
             <text>朋友圈</text>
219 228
           </view>
220 229
         </view>
@@ -222,41 +231,45 @@ export default withLayout((props) => {
222 231
 
223 232
       <CountDown endTime={detail?.enlistEnd} />
224 233
 
225
-      <view className='Apply flex-h'>
226
-        <view className='Collect' onClick={handleFavor}>
227
-          <text className='iconfont icon-shoucang' style={isSaved ? { color: 'red' } : undefined}></text>
228
-          <text>{isSaved ? '已收藏' : '收藏'}</text>
234
+      <view className="Apply flex-h">
235
+        <view className="Collect" onClick={handleFavor}>
236
+          <text
237
+            className="iconfont icon-shoucang"
238
+            style={isSaved ? { color: "red" } : undefined}
239
+          ></text>
240
+          <text>{isSaved ? "已收藏" : "收藏"}</text>
229 241
         </view>
230
-        <text className='iconfont icon-baoming'></text>
231
-        <view className='flex-item'>
242
+        <text className="iconfont icon-baoming"></text>
243
+        <view className="flex-item">
232 244
           <text>{detail.enlisted || 0}人已报名</text>
233 245
         </view>
234
-        <button className='Btn' disabled={btnDisabled} onClick={handleSignup}>{btnText}</button>
246
+        <Button className="Btn" disabled={btnDisabled} onClick={handleSignup}>
247
+          {btnText}
248
+        </Button>
235 249
       </view>
236
-
237 250
     </view>
238 251
   );
239 252
 
240 253
   return (
241 254
     <>
242 255
       {detail && (
243
-        <view className='Page activityDetail flex-v'>
244
-          <view className='flex-item'>
256
+        <view className="Page activityDetail flex-v">
257
+          <view className="flex-item">
245 258
             <view>
246 259
               <ScrollView scroll-y>
247
-                <view className='PageContent'>
248
-                  <view className='Top'>
260
+                <view className="PageContent">
261
+                  <view className="Top">
249 262
                     <Image
250
-                      mode='aspectFill'
263
+                      mode="aspectFill"
251 264
                       src={getImgURL(detail.imgUrl)}
252
-                      className='centerLabel'
265
+                      className="centerLabel"
253 266
                     ></Image>
254 267
                   </view>
255 268
 
256 269
                   {detail.type == "dymic" && dymic()}
257 270
                   {detail.type !== "dymic" && house()}
258
-                  <view className='ActivityIntro'>
259
-                    <view className='Title'>
271
+                  <view className="ActivityIntro">
272
+                    <view className="Title">
260 273
                       <text>活动介绍</text>
261 274
                     </view>
262 275
                     <RichText nodes={detail.desc} />
@@ -268,21 +281,25 @@ export default withLayout((props) => {
268 281
             </view>
269 282
           </view>
270 283
           {detail.type == "dymic" && (
271
-            <view className='PageBottom flex-h'>
272
-              <Button className='Share' open-type='share'>
273
-                <text className='iconfont icon-fenxiang'></text>
284
+            <view className="PageBottom flex-h">
285
+              <Button className="Share" open-type="share">
286
+                <text className="iconfont icon-fenxiang"></text>
274 287
                 <text>分享</text>
275 288
               </Button>
276
-              <view className='Collect' onClick={handleFavor}>
289
+              <view className="Collect" onClick={handleFavor}>
277 290
                 <text
278
-                  className='iconfont icon-shoucang'
291
+                  className="iconfont icon-shoucang"
279 292
                   style={isSaved ? { color: "red" } : undefined}
280 293
                 ></text>
281
-                <text>{isSaved ? '已收藏' : '收藏'}</text>
294
+                <text>{isSaved ? "已收藏" : "收藏"}</text>
282 295
               </view>
283
-              <view className='flex-item'></view>
296
+              <view className="flex-item"></view>
284 297
 
285
-              <Button disabled={btnDisabled} className='Post' onClick={handleSignup}>
298
+              <Button
299
+                disabled={btnDisabled}
300
+                className="Post"
301
+                onClick={handleSignup}
302
+              >
286 303
                 {btnText}
287 304
               </Button>
288 305
             </view>
@@ -290,29 +307,29 @@ export default withLayout((props) => {
290 307
         </view>
291 308
       )}
292 309
 
293
-      <View className='page-body' style={{ display: canChoose }}>
294
-        <View className='mask' onClick={() => hideModal()}></View>
295
-        <View className='page-section'>
296
-          <Text className='page-section__title'>报名信息</Text>
297
-          <View className='page-content'>
310
+      <View className="page-body" style={{ display: canChoose }}>
311
+        <View className="mask" onClick={() => hideModal()}></View>
312
+        <View className="page-section">
313
+          <Text className="page-section__title">报名信息</Text>
314
+          <View className="page-content">
298 315
             <Input
299
-              className='inputName'
316
+              className="inputName"
300 317
               onInput={onInputText}
301
-              type='text'
302
-              placeholder='请输入姓名'
318
+              type="text"
319
+              placeholder="请输入姓名"
303 320
             />
304 321
             <Picker
305
-              mode='selector'
322
+              mode="selector"
306 323
               range={selector}
307 324
               onChange={(e) => setSelectorChecked(selector[e.detail.value])}
308 325
             >
309
-              <View className='picker'>
326
+              <View className="picker">
310 327
                 <Text>参加人数</Text>
311
-                <Text className='content'>{selectorChecked}</Text>
328
+                <Text className="content">{selectorChecked}</Text>
312 329
                 <Text>人</Text>
313 330
               </View>
314 331
             </Picker>
315
-            <View onClick={comfire} className='comfire'>
332
+            <View onClick={comfire} className="comfire">
316 333
               确认
317 334
             </View>
318 335
           </View>

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

@@ -58,7 +58,7 @@ export default function DetailBottom (props) {
58 58
       const id = actList[0].dynamicId
59 59
 
60 60
       Taro.navigateTo({
61
-        url: `/pages/index/activityDetail/index?id=${id}`
61
+        url: `/pages/index/activityDetail/index?id=${id}&eventType=${actList[0].type || 'dymic'}`
62 62
       })
63 63
     } else {
64 64
       Taro.showToast({ title: '该功能暂不能为您提供服务', icon: 'none', duration: 2000 })

+ 2
- 2
src/pages/index/buildingDetail/components/MarketingActivity/index.jsx 查看文件

@@ -13,7 +13,7 @@ export default function MarketingActivity (props) {
13 13
   const [dataList, setDataList] = useState([])
14 14
 
15 15
   const goMore = () => Taro.navigateTo({ url: `/pages/index/activityList/index?type=house&buildingId=${buildingId}` })
16
-  const goDetail = (id) => Taro.navigateTo({ url: `/pages/index/activityDetail/index?id=${id}` })
16
+  const goDetail = (id, type) => Taro.navigateTo({ url: `/pages/index/activityDetail/index?id=${id}&eventType=${type || 'dymic'}` })
17 17
 
18 18
   useEffect(() => {
19 19
     if (buildingId) {
@@ -43,7 +43,7 @@ export default function MarketingActivity (props) {
43 43
             {
44 44
               dataList.map((item, index) => (
45 45
                 <SwiperItem key={`Banner-${index}`}>
46
-                  <view className='swiper-item' onClick={() => goDetail(item.dynamicId)}>
46
+                  <view className='swiper-item' onClick={() => goDetail(item.dynamicId, item.type)}>
47 47
                     <Image mode='aspectFill' className='centerLabel' src={getImgURL(item.bannerListImg || item.imgUrl || item.image || item.url || item.img || item.imgUrl || item.detailImg)} />
48 48
                   </view>
49 49
                 </SwiperItem>

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

@@ -8,6 +8,8 @@ import { API_ITEMS_DETAIL } from '@/constants/api'
8 8
 import useParams from '@/utils/hooks/useParams'
9 9
 import useShare from '@/utils/hooks/useShare'
10 10
 import usePoster from '@/utils/hooks/usePoster'
11
+import { savePoint } from '@/services/common'
12
+import { addItemUv } from '@/services/item'
11 13
 import DetailBottom from './components/DetailBottom/index'
12 14
 import BuildingDetailBanner from './components/BuildingDetailBanner/index'
13 15
 import BasicInfo from './components/BasicInfo/index'
@@ -45,6 +47,18 @@ export default withLayout((props) => {
45 47
     fullTrackData,
46 48
   )
47 49
 
50
+  useEffect(() => {
51
+    if(trackData.eventType && DetailInfo.buildingId) {
52
+      savePoint({
53
+        ...trackData,
54
+        event: 'detail',
55
+        eventType: 'building',
56
+        targetType: 'building'
57
+      })
58
+      addItemUv(id)
59
+    }
60
+  }, [trackData, DetailInfo])
61
+
48 62
   // 海报
49 63
   const posterData = usePoster(person, DetailInfo?.poster, router, paramsRef)
50 64
 

+ 3
- 3
src/pages/index/components/ActivityListItem/index.jsx 查看文件

@@ -1,9 +1,9 @@
1
-import React, { useState, useEffect } from 'react'
2
-import './index.scss'
1
+
3 2
 import { Image } from '@tarojs/components'
4 3
 import Taro from '@tarojs/taro'
5 4
 import { getImgURL } from '@/utils/image'
6 5
 import { formatDate } from '@/utils/chatDate'
6
+import './index.scss'
7 7
 
8 8
 const activityStatusDict={
9 9
   0:{
@@ -26,7 +26,7 @@ const activityStatusDict={
26 26
 export default function ActivityListItem (props) {
27 27
   const { data = {} } = props
28 28
   return (
29
-    <view className='components ActivityListItem' onClick={() => { Taro.navigateTo({ url: `/pages/index/activityDetail/index?id=${data.dynamicId}` }) }}>
29
+    <view className='components ActivityListItem' onClick={() => { Taro.navigateTo({ url: `/pages/index/activityDetail/index?id=${data.dynamicId}&eventType=${data.type || 'dymic'}` }) }}>
30 30
       <view className='Img'>
31 31
         <Image mode='aspectFill' src={getImgURL(data.listImgUrl || data.imgUrl)} className='centerLabel'></Image>
32 32
       </view>

+ 0
- 40
src/pages/index/components/Banner/index.jsx 查看文件

@@ -1,51 +1,11 @@
1 1
 
2 2
 import { Swiper, SwiperItem, Image } from '@tarojs/components'
3
-import Taro from '@tarojs/taro'
4 3
 import { getImgURL } from '@/utils/image'
5 4
 import nav2Target from '@/utils/nav2Target'
6 5
 import './index.scss'
7 6
 
8 7
 export default function Banner (props) {
9 8
   const { List = [] } = props
10
-  
11
-  const redirectTo = ({ targetId, contentType, buildingId } = {})=> {
12
-    switch (contentType) {
13
-      // 项目
14
-      case 'project':
15
-        Taro.navigateTo({
16
-          url: '/pages/index/buildingDetail/index?id=' + buildingId
17
-        })
18
-        return;
19
-
20
-      // 活动
21
-      case 'activity':
22
-        Taro.navigateTo({
23
-          url: '/pages/index/activityDetail/index?id=' + targetId
24
-        })
25
-        return;
26
-
27
-      // 资讯
28
-      case 'news':
29
-        Taro.navigateTo({
30
-          url: '/pages/index/newsDetail/index?id=' + targetId
31
-        })
32
-        return;
33
-
34
-      // live
35
-      case 'live':
36
-        Taro.navigateTo({
37
-          url: '/pages/video/liveDetail/index?id=' + targetId
38
-        })
39
-        return;
40
-
41
-
42
-      // 其他
43
-      case 'others':
44
-      default:
45
-        
46
-        return;
47
-    }
48
-  }
49 9
 
50 10
   const handleBannerClick = (item) => {
51 11
     if (item.contentType && item.contentType != "nothing") {

+ 1
- 1
src/pages/index/components/HotRecommend/index.jsx 查看文件

@@ -50,7 +50,7 @@ export default function HotRecommend (props) {
50 50
   const toDetail = (item) => {
51 51
     return () => {
52 52
       if (item.dynamicId) {
53
-        Taro.navigateTo({ url: `/pages/index/activityDetail/index?id=${item.dynamicId}` })
53
+        Taro.navigateTo({ url: `/pages/index/activityDetail/index?id=${item.dynamicId}&eventType=${item.type || 'dymic'}` })
54 54
       }
55 55
     }
56 56
   }

+ 2
- 2
src/pages/index/helpToFindHouse/index.jsx 查看文件

@@ -54,8 +54,8 @@ export default withLayout((props) => {
54 54
         // 用户选择 200, 则区间为 [100, 300]
55 55
         // 用户选择 300, 则区间为 [200, 400]
56 56
         const price = item.result === '' ? 300 : item.result - 0;
57
-        const min = price < 100 ? 100 : price - 100;
58
-        const max = price + 100;
57
+        const min = item.options[0]
58
+        const max = price
59 59
 
60 60
         params.push({ ...item, key: 'minPrice', result: CurrentDemandId === 2 ? min : min * 10000 })
61 61
         params.push({ ...item, key: 'maxPrice', result: CurrentDemandId === 2 ? max : max * 10000 })

+ 13
- 1
src/pages/index/newsDetail/index.jsx 查看文件

@@ -1,12 +1,13 @@
1 1
 import { useState, useEffect } from "react";
2 2
 import Taro from "@tarojs/taro";
3 3
 import withLayout from "@/layout";
4
-import { ScrollView, Image, RichText, WebView } from "@tarojs/components";
4
+import { ScrollView, RichText, WebView } from "@tarojs/components";
5 5
 import useParams from '@/utils/hooks/useParams'
6 6
 import useFavor from "@/utils/hooks/useFavor";
7 7
 import { queryNewsDetail } from "@/services/news";
8 8
 import { formatDate } from "@/utils/chatDate";
9 9
 import useShare from "@/utils/hooks/useShare";
10
+import { savePoint } from '@/services/common'
10 11
 import "@/assets/css/iconfont.css";
11 12
 import "./index.scss";
12 13
 
@@ -35,6 +36,17 @@ export default withLayout((props) => {
35 36
     fullTrackData
36 37
   );
37 38
 
39
+  useEffect(() => {
40
+    if(trackData.eventType && (data || {}).newsId) {
41
+      savePoint({
42
+        ...trackData,
43
+        event: 'detail',
44
+        eventType: 'news',
45
+        targetType: 'news'
46
+      })
47
+    }
48
+  }, [trackData, data])
49
+
38 50
   const getData = (params) => {
39 51
     Taro.showLoading();
40 52
     queryNewsDetail(params).then((res) => {

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

@@ -1,4 +1,4 @@
1
-import React, { useState, useEffect } from 'react'
1
+
2 2
 import { getImgURL } from '@/utils/image'
3 3
 import Taro from '@tarojs/taro'
4 4
 import { Image } from '@tarojs/components'
@@ -9,7 +9,7 @@ export default function MyActivityListItem (props) {
9 9
   const { Data = {} } = props
10 10
 
11 11
   return (
12
-    <view className='components MyActivityListItem' onClick={() => { Taro.navigateTo({ url: `/pages/index/activityDetail/index?id=${Data.id}` }) }}>
12
+    <view className='components MyActivityListItem' onClick={() => { Taro.navigateTo({ url: `/pages/index/activityDetail/index?id=${Data.id}&eventType=${Data.type || 'dymic'}` }) }}>
13 13
       <view className='Img'>
14 14
         <Image mode='aspectFill' className='centerLabel' src={getImgURL(Data.listImgUrl) || null} />
15 15
       </view>

+ 3
- 0
src/pages/mine/myCustomerForEditRecord/index.config.js 查看文件

@@ -0,0 +1,3 @@
1
+export default {
2
+  navigationBarTitleText: '修改记录'
3
+}

+ 89
- 0
src/pages/mine/myCustomerForEditRecord/index.jsx 查看文件

@@ -0,0 +1,89 @@
1
+import { useState, useEffect } from 'react'
2
+import withLayout from '@/layout'
3
+import { ScrollView } from '@tarojs/components'
4
+import '@/assets/css/iconfont.css'
5
+import { useSelector } from 'react-redux'
6
+import { fetch } from '@/utils/request'
7
+import { API_ACTIVITY_LIST } from '@/constants/api'
8
+import './index.scss'
9
+
10
+export default withLayout(() => {
11
+
12
+  const user = useSelector(state => state.user)
13
+  const [PageList, setPageList] = useState([])
14
+  const [IsPull, setPull] = useState(false)
15
+  const [PersonId, setPersonId] = useState(null)
16
+  const [pageNumber, setPageNumber] = useState(1)
17
+  const [HasNextPage, setHasNextPage] = useState(true)
18
+
19
+  useEffect(() => {
20
+    if (user?.userInfo?.person?.personId) {
21
+      setPersonId(user.userInfo.person.personId)
22
+    }
23
+  }, [user])
24
+
25
+  useEffect(() => {
26
+    GetPageList()
27
+  }, [pageNumber])
28
+
29
+  const PageRefresh = () => { // 页面下拉刷新回调
30
+    setPull(true)
31
+  }
32
+
33
+  const GetPageList = () => {
34
+    setHasNextPage(false)
35
+    fetch({ url: API_ACTIVITY_LIST, method: 'get', payload: { mine: true, pageNumber, pageSize: 10 } }).then((res) => {
36
+      setPageList(pageNumber === 1 ? res.records || [] : PageList.concat(res.records || []))
37
+      setHasNextPage(res.current < res.pages)
38
+      setPull(false)
39
+    })
40
+  }
41
+
42
+  const PageLoadMore = () => { // 页面上拉加载更多
43
+    if (HasNextPage) {
44
+      setPageNumber(pageNumber + 1)
45
+    }
46
+  }
47
+
48
+  useEffect(() => { // 下拉刷新触发
49
+    if (IsPull) {
50
+      if (pageNumber === 1) {
51
+        GetPageList()
52
+      } else {
53
+        setPageNumber(1)
54
+      }
55
+    }
56
+  }, [IsPull])
57
+
58
+  return (
59
+    <view className='Page myActivity'>
60
+
61
+      <ScrollView scroll-y refresher-enabled refresher-triggered={IsPull} onrefresherrefresh={PageRefresh} onscrolltolower={PageLoadMore} refresher-background='#fff'>
62
+        <view className='PageContent'>
63
+          <view className='List'>
64
+            {
65
+              PageList.map((item, index) => (
66
+                <view className='ListItem' key={`ListItem-${index}`}>
67
+                  <view className='flex-h'>
68
+                    <view className='flex-item'>
69
+                      <text>跟进人</text>
70
+                    </view>
71
+                    <text>2021-05-21 12:00</text>
72
+                  </view>
73
+                  <text>跟进内容</text>
74
+                </view>
75
+              ))
76
+            }
77
+          </view>
78
+
79
+          {/* bottom */}
80
+          <view className='PageBottom'>
81
+            <text>已经到底了~</text>
82
+          </view>
83
+
84
+        </view>
85
+      </ScrollView>
86
+
87
+    </view>
88
+  )
89
+})

+ 62
- 0
src/pages/mine/myCustomerForEditRecord/index.scss 查看文件

@@ -0,0 +1,62 @@
1
+.Page.myActivity {
2
+  background: #fff;
3
+  width: 100%;
4
+  height: 100%;
5
+  position: relative;
6
+  overflow: hidden;
7
+  > scroll-view {
8
+    width: 100%;
9
+    height: 100vh;
10
+    .PageContent {
11
+      position: relative;
12
+      overflow: hidden;
13
+      min-height: 100vh;
14
+      >.List {
15
+        padding: 0 30px;
16
+        position: relative;
17
+        overflow: hidden;
18
+        >.ListItem {
19
+          position: relative;
20
+          overflow: hidden;
21
+          border-bottom: 2px solid rgba(0, 0, 0, 0.08);
22
+          padding: 40px 0;
23
+          >.flex-h {
24
+            align-items: center;
25
+            >.flex-item {
26
+              >text {
27
+                display: block;
28
+                font-size: 32px;
29
+                color: #333;
30
+                line-height: 1;
31
+              }
32
+            }
33
+            >text {
34
+              font-size: 24px;
35
+              color: #999;
36
+              line-height: 1;
37
+            }
38
+          }
39
+          >text {
40
+            font-size: 28px;
41
+            color: 666;
42
+            line-height: 36px;
43
+            display: block;
44
+            margin-top: 38px;
45
+          }
46
+        }
47
+      }
48
+      > .PageBottom {
49
+        text-align: center;
50
+        font-size: 0;
51
+        white-space: nowrap;
52
+        > text {
53
+          display: inline-block;
54
+          font-size: 28px;
55
+          color: #666;
56
+          line-height: 40px;
57
+          margin: 20px auto;
58
+        }
59
+      }
60
+    }
61
+  }
62
+}

+ 13
- 1
src/pages/video/liveDetail/index.jsx 查看文件

@@ -1,5 +1,6 @@
1 1
 import { useState, useEffect, useRef } from "react";
2
-import Taro, { useDidShow, useReady } from "@tarojs/taro";
2
+import Taro from "@tarojs/taro";
3
+import { savePoint } from '@/services/common'
3 4
 import withLayout from "@/layout";
4 5
 import { Image } from "@tarojs/components";
5 6
 import { queryLiveDetail } from "@/services/item";
@@ -49,6 +50,17 @@ export default withLayout((props) => {
49 50
     })
50 51
   };
51 52
 
53
+  useEffect(() => {
54
+    if(trackData.eventType && data.liveActivityId) {
55
+      savePoint({
56
+        ...trackData,
57
+        event: 'detail',
58
+        eventType: 'live',
59
+        targetType: 'live'
60
+      })
61
+    }
62
+  }, [trackData, data])
63
+
52 64
   const handleLive = () => {
53 65
     if (!livingRef.current) {
54 66
       Taro.showToast({

+ 29
- 29
src/routes.js 查看文件

@@ -21,14 +21,14 @@ const routes = [
21 21
     page: 'pages/video/index',
22 22
     pkg: 'main',
23 23
     isTab: true,
24
-    type: 'video',
24
+    type: 'other',
25 25
   },
26 26
   {
27 27
     name: '消息',
28 28
     page: 'pages/chat/index',
29 29
     pkg: 'main',
30 30
     isTab: true,
31
-    type: 'chat',
31
+    type: 'other',
32 32
     auth: ['page', 'avatar'],
33 33
   },
34 34
   {
@@ -36,7 +36,7 @@ const routes = [
36 36
     page: 'pages/mine/index',
37 37
     pkg: 'main',
38 38
     isTab: true,
39
-    type: 'mine',
39
+    type: 'center',
40 40
     auth: ['page', 'avatar'],
41 41
   },
42 42
 
@@ -45,7 +45,7 @@ const routes = [
45 45
     name: '聊天',
46 46
     page: 'pages/chat/chatDetail/index',
47 47
     pkg: 'main',
48
-    type: 'chat',
48
+    type: 'other',
49 49
     auth: ['phone', 'avatar'],
50 50
   },
51 51
 
@@ -170,14 +170,14 @@ const routes = [
170 170
     name: '活动列表',
171 171
     page: 'pages/index/activityList/index',
172 172
     pkg: 'main',
173
-    type: 'activity',
173
+    type: 'dymic',
174 174
     // auth: ['phone', 'avatar'],
175 175
   },
176 176
   {
177 177
     name: '活动详情',
178 178
     page: 'pages/index/activityDetail/index',
179 179
     pkg: 'main',
180
-    type: 'activity',
180
+    type: 'dymic',
181 181
     auth: ['phone', 'avatar'],
182 182
   },
183 183
   {
@@ -233,7 +233,7 @@ const routes = [
233 233
     name: '课程详情',
234 234
     page: 'pages/index/courseDetail/index',
235 235
     pkg: 'main',
236
-    type: 'curriculum',
236
+    type: 'other',
237 237
   },
238 238
 
239 239
   //视频
@@ -241,13 +241,13 @@ const routes = [
241 241
     name: '直播活动',
242 242
     page: 'pages/video/liveDetail/index',
243 243
     pkg: 'main',
244
-    type: 'video',
244
+    type: 'live',
245 245
   },
246 246
   {
247 247
     name: '视频详情',
248 248
     page: 'pages/video/videoDetail/index',
249 249
     pkg: 'main',
250
-    type: 'video',
250
+    type: 'live',
251 251
   },
252 252
 
253 253
   // 我的
@@ -268,130 +268,130 @@ const routes = [
268 268
     name: '基本信息',
269 269
     page: 'pages/mine/userInfo/index',
270 270
     pkg: 'main',
271
-    type: 'mine',
271
+    type: 'center',
272 272
     auth: ['phone', 'avatar'],
273 273
   },
274 274
   {
275 275
     name: '成为驻场管理',
276 276
     page: 'pages/mine/toBeManager/index',
277 277
     pkg: 'main',
278
-    type: 'mine',
278
+    type: 'center',
279 279
     // auth: ['phone'],
280 280
   },
281 281
   {
282 282
     name: '成为合伙人',
283 283
     page: 'pages/mine/toBeAgent/index',
284 284
     pkg: 'main',
285
-    type: 'mine',
285
+    type: 'center',
286 286
     // auth: ['phone'],
287 287
   },
288 288
   {
289 289
     name: '我的分享',
290 290
     page: 'pages/mine/myShare/index',
291 291
     pkg: 'main',
292
-    type: 'mine',
292
+    type: 'center',
293 293
   },
294 294
   {
295 295
     name: '我的课堂',
296 296
     page: 'pages/mine/myCourse/index',
297 297
     pkg: 'main',
298
-    type: 'curriculum',
298
+    type: 'center',
299 299
     // auth: ['phone'],
300 300
   },
301 301
   {
302 302
     name: '我的活动',
303 303
     page: 'pages/mine/myActivity/index',
304 304
     pkg: 'main',
305
-    type: 'activity',
305
+    type: 'center',
306 306
   },
307 307
   {
308 308
     name: '我的客户',
309 309
     page: 'pages/mine/myCustomer/index',
310 310
     pkg: 'main',
311
-    type: 'mine',
311
+    type: 'center',
312 312
     // auth: ['phone'],
313 313
   },
314 314
   {
315 315
     name: '客户详情',
316 316
     page: 'pages/mine/myCustomerDetail/index',
317 317
     pkg: 'main',
318
-    type: 'mine',
318
+    type: 'other',
319 319
     // auth: ['phone'],
320 320
   },
321 321
   {
322 322
     name: '操作人员',
323 323
     page: 'pages/mine/myCustomerForOperator/index',
324 324
     pkg: 'main',
325
-    type: 'mine',
325
+    type: 'other',
326 326
     // auth: ['phone'],
327 327
   },
328 328
   {
329 329
     name: '跟进记录',
330 330
     page: 'pages/mine/myCustomerForRecord/index',
331 331
     pkg: 'main',
332
-    type: 'mine',
332
+    type: 'other',
333 333
     // auth: ['phone'],
334 334
   },
335 335
   {
336 336
     name: '我的收藏',
337 337
     page: 'pages/mine/myCollect/index',
338 338
     pkg: 'main',
339
-    type: 'mine',
339
+    type: 'other',
340 340
   },
341 341
   {
342 342
     name: '合作渠道',
343 343
     page: 'pages/channel/partnerChannel/index',
344 344
     pkg: 'subpackages',
345
-    type: 'mine',
345
+    type: 'other',
346 346
     // auth: ['phone'],
347 347
   },
348 348
   {
349 349
     name: '添加客户',
350 350
     page: 'pages/mine/addCustomer/index',
351 351
     pkg: 'main',
352
-    type: 'mine',
352
+    type: 'other',
353 353
     // auth: ['phone'],
354 354
   },
355 355
   {
356 356
     name: '驻场管理',
357 357
     page: 'pages/marketing/residentManager/index',
358 358
     pkg: 'subpackages',
359
-    type: 'mine',
359
+    type: 'other',
360 360
     // auth: ['phone'],
361 361
   },
362 362
   {
363 363
     name: '确认到访',
364 364
     page: 'pages/marketing/sureVisit/index',
365 365
     pkg: 'subpackages',
366
-    type: 'mine',
366
+    type: 'other',
367 367
     // auth: ['phone'],
368 368
   },
369 369
   {
370 370
     name: '变更交易节点',
371 371
     page: 'pages/marketing/changeVisit/index',
372 372
     pkg: 'subpackages',
373
-    type: 'mine',
373
+    type: 'other',
374 374
     // auth: ['phone'],
375 375
   },
376 376
   {
377 377
     name: '盘客工具',
378 378
     page: 'pages/consultant/statCustomer/index',
379 379
     pkg: 'subpackages',
380
-    type: 'mine',
380
+    type: 'other',
381 381
     // auth: ['phone'],
382 382
   },
383 383
   {
384 384
     name: '客户信息',
385 385
     page: 'pages/mine/customerDetail/index',
386 386
     pkg: 'main',
387
-    type: 'mine',
387
+    type: 'other',
388 388
     // auth: ['phone'],
389 389
   },
390 390
   {
391 391
     name: '客户分析',
392 392
     page: 'pages/consultant/customerAnalyse/index',
393 393
     pkg: 'subpackages',
394
-    type: 'mine',
394
+    type: 'other',
395 395
     // auth: ['phone'],
396 396
   },
397 397
   {
@@ -405,7 +405,7 @@ const routes = [
405 405
     name: '意见反馈',
406 406
     page: 'pages/mine/feedBack/index',
407 407
     pkg: 'main',
408
-    type: 'mine',
408
+    type: 'other',
409 409
   },
410 410
   {
411 411
     name: '全景图',

+ 7
- 0
src/subpackages/pages/consultant/myHomepage/index.jsx 查看文件

@@ -8,6 +8,7 @@ import { fetch } from '@/utils/request'
8 8
 import { API_CARDS_UV, API_ITEMS_DETAIL, API_CARDS_LIST } from '@/constants/api'
9 9
 import { getImgURL } from '@/utils/image'
10 10
 import useLike from "@/utils/hooks/useLike";
11
+import { savePoint } from '@/services/common'
11 12
 import '@/assets/css/iconfont.css'
12 13
 import './index.scss'
13 14
 
@@ -47,6 +48,12 @@ export default withLayout((props) => {
47 48
       if(id) {
48 49
         fetch({ url: `${API_CARDS_LIST}/${id}`, method: 'get' }).then((res) => {
49 50
           setUserInfo(res)
51
+          savePoint({
52
+            ...trackData,
53
+            event: 'detail',
54
+            eventType: 'card',
55
+            targetType: 'card'
56
+          })
50 57
         })
51 58
       } else {
52 59
         setPersonId(user.userInfo.person.personId)

+ 2
- 2
src/utils/nav2Target.js 查看文件

@@ -1,6 +1,6 @@
1 1
 import Taro from '@tarojs/taro'
2 2
 
3
-export default ({ targetId, contentType, buildingId } = {})=> {
3
+export default ({ targetId, contentType, buildingId, type = 'dymic' } = {})=> {
4 4
   if (!targetId && !buildingId) return;
5 5
 
6 6
   switch (contentType) {
@@ -14,7 +14,7 @@ export default ({ targetId, contentType, buildingId } = {})=> {
14 14
     // 活动
15 15
     case 'activity':
16 16
       Taro.navigateTo({
17
-        url: '/pages/index/activityDetail/index?id=' + targetId
17
+        url: '/pages/index/activityDetail/index?id=' + targetId + '&eventType=' + type
18 18
       })
19 19
       return;
20 20
 

+ 2
- 2
src/utils/tracking/userSource.js 查看文件

@@ -3,13 +3,13 @@ import { routes } from '../../routes'
3 3
 
4 4
 export default async (router) => {
5 5
   const { path, query, scene } = router || {}
6
-  const { id, buildingId, recommender } = query || {}
6
+  const { id, buildingId, recommender, eventType } = query || {}
7 7
 
8 8
   const pageInfo = routes.filter(x => path.indexOf(x.page) > -1)[0] || { type: 'other', name: '其他' }
9 9
 
10 10
   const trackPayload = {
11 11
     event: 'start',
12
-    eventType: pageInfo.type,
12
+    eventType: eventType || pageInfo.type,
13 13
     propertyName: pageInfo.name,
14 14
     data: '{}',
15 15
     id,