李志伟 3 年前
父节点
当前提交
f8224516c5

+ 6
- 5
src/components/BossCard/index.jsx 查看文件

@@ -11,7 +11,7 @@ import starOff from '@/assets/icons/housemantj/景点爆赞.png'
11 11
 import food from '@/assets/icons/ProCard/food.png'
12 12
 import ProCard_hot from '@/assets/icons/ProCard/ProCard_hot.png'
13 13
 
14
-
14
+import { getQueryString} from '@/utils/index'
15 15
 //入住指引--老板推荐
16 16
 
17 17
 
@@ -19,16 +19,17 @@ import ProCard_hot from '@/assets/icons/ProCard/ProCard_hot.png'
19 19
 import './style.less'
20 20
 
21 21
 export default (props) => {
22
-  const { item, cardNavigateTo } = props
23
-  const { shopId } = props.item
22
+  const { item, cardNavigateTo,taRoomContent,trackClick } = props
23
+  const { shopId, packageId } = props.item
24 24
   const [isSaved, toggleSave] = useSave(item.isSaved, 'shop_package', item.packageId)
25 25
   const [city, setCity] = useState({})
26 26
   const [detail, setDetail] = useState({})
27 27
 
28
+    
28 29
 
29
-
30
-
30
+  
31 31
   const goFood = () => {
32
+     trackClick({ eventType: 'hotel_recommend_package', eventParams: getQueryString({ hotelId:taRoomContent.hotelId,shopId:shopId,packageId:packageId})  })
32 33
     Taro.navigateTo({ url: `/pages/details/foodDetails/foodDetails?id=${shopId}` })
33 34
   }
34 35
 

+ 0
- 3
src/components/ShopCommission/index.jsx 查看文件

@@ -1,7 +1,4 @@
1
-import Taro from '@tarojs/taro'
2
-import { useEffect } from 'react'
3 1
 
4
-import { getAccount } from '@/services/shopBoss'
5 2
 
6 3
 import formatTimes from '@/utils/formatTime'
7 4
 

+ 13
- 13
src/hotel/components/HouseManage/houseManage.jsx 查看文件

@@ -37,12 +37,12 @@ export default React.forwardRef((props, ref) => {
37 37
             getRoomList({ hotelId: hotel.hotelId }).then((res) => {
38 38
               setDetail(res.records || [])
39 39
             })
40
-          })       
41
-        } 
40
+          })
41
+        }
42 42
       }
43
-    })   
43
+    })
44 44
   }
45
-  const handelDetail=(val)=>{
45
+  const handelDetail = (val) => {
46 46
     Taro.navigateTo({ url: `/hotel/pages/landlord/addRoom/addRoom?hotelId=${hotel.hotelId}&hotelName=${hotel.hotelName}&roomId=${val.roomId}` });
47 47
   }
48 48
 
@@ -100,29 +100,29 @@ export default React.forwardRef((props, ref) => {
100 100
     Taro.navigateTo({ url: `/hotel/pages/landlord/roomOrder/roomOrder?roomId=${val.roomId}&roomName=${val.roomName}` });
101 101
   }
102 102
 
103
-  const onSearch=(e)=>{
104
-    if(e.detail.value==''){
103
+  const onSearch = (e) => {
104
+    if (e.detail.value == '') {
105 105
       getRoomList({ hotelId: hotel.hotelId }).then((res) => {
106 106
         setDetail(res.records || [])
107 107
       })
108 108
     }
109
-    else{
110
-      getRoomList({ hotelId: hotel.hotelId,roomName:e.detail.value }).then((res) => {
111
-      setDetail(res.records || [])
112
-    })
113
-    }    
109
+    else {
110
+      getRoomList({ hotelId: hotel.hotelId, roomName: e.detail.value }).then((res) => {
111
+        setDetail(res.records || [])
112
+      })
113
+    }
114 114
   }
115 115
   return (
116 116
     <view>
117 117
       <view style={{ padding: '0 30rpx', height: '100%' }}>
118
-        <SearchBar placeholder='请输入房源名搜索' onBlur={onSearch}/>
118
+        <SearchBar placeholder='请输入房源名搜索' onBlur={onSearch} />
119 119
         <ShareRoom showCutover={showCutover} onClose={onClose} room={room} onFinish={handleFinish} />
120 120
         <ShareCard showCutover={showCard} onClose={onClose2} />
121 121
         <scroll-view scroll-y="true" scroll-view='true' bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll" style={{ height: 'calc(100vh - 244px)' }}>
122 122
           {
123 123
             (detail || []).map((item) =>
124 124
               <view className='houseCard'>
125
-                <view className='houseName' onClick={()=>{handelDetail(item)}}>{item.roomName||''}</view>
125
+                <view className='houseName' onClick={() => { handelDetail(item) }} >{item.roomName || ''}</view>
126 126
                 <view className='operation'>
127 127
                   <view onClick={() => handelOrder(item)}><image src={see} />查看入住人</view>
128 128
                   <view onClick={() => ShowMoldeOn(item)}><image src={share} />分享链接</view>

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

@@ -33,7 +33,7 @@ export default withLayout((props) => {
33 33
       </view>
34 34
       <view className='index-container'>
35 35
         {currentTab === 0 && <Recommend location={location} />}
36
-        {currentTab === 1 && <Guide person={person} router={router} />}
36
+        {currentTab === 1 && <Guide person={person} router={router} location={location} />}
37 37
         {/* {currentTab === 2 && <Strategy />} */}
38 38
         {currentTab === 2 && <Mine person={person} />}
39 39
       </view>

+ 6
- 4
src/pages/index/tabs/Guide.jsx 查看文件

@@ -10,6 +10,7 @@ import BlackSpot from '@/assets/icons/GuideCheck/BlackSpot.png'
10 10
 import { getRecommendList, getExtendContent } from '@/services/home'
11 11
 import sleep from '@/assets/icons/GuideCheck/sleep_logo.png'
12 12
 import { getTaRoom, goToRoomForm } from '@/services/taRoom​'
13
+import  useTrackClick from '@/utils/hooks/useTrackClick'
13 14
 import showMore from '../../../assets/icons/housemantj/查看更多.png'
14 15
 
15 16
 import './GuideCss/style.less'
@@ -20,14 +21,15 @@ import './GuideCss/style.less'
20 21
 
21 22
 
22 23
 export default (props) => {
23
-  const { router, person, iflocation } = props
24
+  const { router, person, location } = props
24 25
   const { roomId, roomOrderId } = router.params
25 26
   const [extend, setExtend] = useState([])
26 27
   const [ifroomId, setIfroomId] = useState('havenot')
27 28
   const [spackage, setPackage] = useState([])
28 29
 
29 30
   const cardNavigateTo = undefined
30
-
31
+  
32
+  const trackClick = useTrackClick(router)
31 33
 
32 34
   // 住宿经纬度
33 35
   const Roomlog = useRef('')
@@ -97,7 +99,7 @@ export default (props) => {
97 99
 
98 100
 
99 101
     } else {
100
-      getRecommendList({ location: iflocation }).then((res) => {
102
+      getRecommendList({ location: location }).then((res) => {
101 103
         setPackage(res || [])
102 104
       })
103 105
 
@@ -261,7 +263,7 @@ export default (props) => {
261 263
             <text className='title-title-boss' >老板推荐好吃的</text>
262 264
           </view>
263 265
         </view>
264
-        {(spackage || []).map((item, index) => <BossCard cardNavigateTo={cardNavigateTo} key={(index)} item={item} />)}
266
+        {(spackage || []).map((item, index) => <BossCard cardNavigateTo={cardNavigateTo} key={(index)} trackClick={trackClick} taRoomContent={taRoomContent} item={item} />)}
265 267
         {/* 卡片------------- */}
266 268
         {/* <view className='Guide-Content-box-two'>
267 269
           <view className='title-image-two'>

+ 7
- 0
src/services/track.js 查看文件

@@ -13,3 +13,10 @@ export const trackPage = (data) => request('/track/page', { data, method: 'post'
13 13
  * @returns 
14 14
  */
15 15
 export const updateTrackPage = (id) => request(`/track/page/${id}`, { method: 'put', skipError: true })
16
+
17
+/**
18
+ * 埋点页面访问
19
+ * @param {*} data 
20
+ * @returns 
21
+ */
22
+export const trackClick = (data) => request('/track/click', { data, method: 'post', skipError: true })

+ 3
- 2
src/shop/components/ShopKeeper/shopKeeper.jsx 查看文件

@@ -143,7 +143,7 @@ export default (props) => {
143 143
             {activeTab === 0 &&
144 144
               <>
145 145
                 <List
146
-                  style={{ height: 'calc(100% - 145px)' }}
146
+                  style={{ height: '50%' }}
147 147
                   request={getVerifiedOrder}
148 148
                   params={queryParams}
149 149
                   onDataChange={setAllList}
@@ -157,7 +157,8 @@ export default (props) => {
157 157
             {activeTab === 1 &&
158 158
               <>
159 159
                 <List
160
-                  style={{ height: 'calc(100% - 145px)' }}
160
+                  style={{ height: '50%' }}
161
+
161 162
                   request={getVerifiedOrder}
162 163
                   params={queryParams}
163 164
                   onDataChange={setAllList}

+ 9
- 3
src/shop/components/Sparead/spreadMoney.jsx 查看文件

@@ -1,4 +1,4 @@
1
-import { useState, useEffect } from 'react'
1
+import { useState, useEffect, useMemo } from 'react'
2 2
 import Taro from '@tarojs/taro'
3 3
 import CustomNav from '@/components/CustomNav'
4 4
 import Popup from '@/components/Popup'
@@ -26,9 +26,13 @@ export default (props) => {
26 26
   const [isMomth, setMonth] = useState(false)
27 27
   const acc = shopMoney?.acc
28 28
   const { accountId } = acc
29
-  const [accId, setaccId] = useState(accountId)
30 29
 
31
-  const reqestAPI = getList(accId)
30
+  const queryParams = useMemo(() => ({
31
+
32
+  }), [])
33
+
34
+
35
+  const reqestAPI = getList(shopMoney?.acc?.accountId)
32 36
 
33 37
 
34 38
 
@@ -89,6 +93,8 @@ export default (props) => {
89 93
           <List
90 94
             style={{ height: 'calc(100% - 145px)' }}
91 95
             request={reqestAPI}
96
+            params={queryParams}
97
+
92 98
             render={({ item, index }) => <ShopCommission key={(index)} item={item} />}
93 99
           >
94 100
           </List>

+ 0
- 1
src/shop/pages/spread/spreadIndex.jsx 查看文件

@@ -2,7 +2,6 @@ import React, { useState, useEffect } from 'react'
2 2
 import CustomNav from '@/components/CustomNav'
3 3
 import { useRouter } from '@tarojs/taro'
4 4
 import { getShopList, getShopMoney, getAccount, getVerifiedOrder, setGetVerifiedOrder } from '@/services/shopBoss'
5
-import { getHotelManage, getAccountLogList, getNowShopManage } from '@/services/landlord'
6 5
 
7 6
 import TabBar from '@/components/CustTabBar'
8 7
 import shopImg from '@/assets/icons/shopKeeper/订单收入.png'

+ 9
- 0
src/utils/hooks/useTrackClick.js 查看文件

@@ -0,0 +1,9 @@
1
+
2
+import { useCallback } from 'react'
3
+import { trackClick } from '@/services/track'
4
+
5
+export default (router) => {
6
+  return useCallback(({ eventType, eventParams }) => {
7
+    trackClick({ page: router.path, eventType, eventParams })
8
+  }, [router.path])
9
+}

+ 1
- 1
src/utils/hooks/useTrackPage.js 查看文件

@@ -1,6 +1,6 @@
1 1
 
2 2
 import { useRef } from 'react'
3
-import { useDidShow, useDidHide, nextTick } from '@tarojs/taro'
3
+import { useDidShow, useDidHide } from '@tarojs/taro'
4 4
 import { trackPage, updateTrackPage } from '@/services/track'
5 5
 
6 6
 export default (payload) => {