xujing преди 5 години
родител
ревизия
850566fac1

+ 1
- 0
src/pages/policy/index.js Целия файл

@@ -52,6 +52,7 @@ export default class Index extends Component {
52 52
       hasMore: list.length >= total ? false : true,
53 53
       pageIndex: 1
54 54
     })
55
+    this._$_dataReady()
55 56
     rest && rest()
56 57
   }
57 58
 

+ 3
- 0
src/pages/project/detail/map.js Целия файл

@@ -71,6 +71,9 @@ export default class Index extends Component {
71 71
                     })
72 72
                 }
73 73
             })
74
+
75
+            this._$_dataReady()
76
+
74 77
             Taro.hideToast()
75 78
         })
76 79
     }

+ 3
- 1
src/pages/project/floor/index.js Целия файл

@@ -25,7 +25,9 @@ export default class Index extends Component {
25 25
   state = {
26 26
     statusOpts: ['待定', '在建', '在售'],
27 27
   }
28
-
28
+  componentWillMount() {
29
+    this._$_dataReady()
30
+  }
29 31
 
30 32
   render() {
31 33
     const { projectDetail } = this.props

+ 1
- 0
src/pages/project/map/index.js Целия файл

@@ -95,6 +95,7 @@ export default class Index extends Component {
95 95
         longitude: curCity.lng
96 96
       })
97 97
     }
98
+    this._$_dataReady()
98 99
     return getItemList(payload)
99 100
   }
100 101
   onViewDetail(item) {

+ 1
- 0
src/pages/shop/detail/index.js Целия файл

@@ -47,6 +47,7 @@ export default class Index extends Component {
47 47
       // })
48 48
 
49 49
       WxParse.wxParse('article', 'html', res.goodsDescription || '<p></p>', this.$scope, 0)
50
+      this._$_dataReady()
50 51
       Taro.hideLoading()
51 52
     })
52 53
   }

+ 1
- 2
src/pages/shop/index.js Целия файл

@@ -8,12 +8,11 @@ import { transferImage } from '@/utils/tools'
8 8
 import Banner from './banner'
9 9
 import ready from '@/utils/ready'
10 10
 import { ROLE_CODE } from '@/constants/user'
11
-import { queryBanners } from '@/services/common'
11
+import { queryBanners, savePoint } from '@/services/common'
12 12
 import { getGoodsBuilding, getGoodsList } from '@/services/item'
13 13
 import { connect } from '@tarojs/redux'
14 14
 import * as actions from '@/actions/shop'
15 15
 import { queryUserInfo, doUserSignin } from '@/services/user'
16
-import { savePoint, } from '@/services/common'
17 16
 // import getUserPhone from '@/utils/getUserPhone'
18 17
 import Authorize from '@/components/authorize'
19 18
 

+ 1
- 0
src/pages/shop/integralDetail/index.js Целия файл

@@ -43,6 +43,7 @@ export default class Index extends Component {
43 43
     Taro.showLoading()
44 44
     this.props.dispatchPointsRecords().then(res => {
45 45
       this.checkChoose(res.records)
46
+      this._$_dataReady()
46 47
       Taro.hideLoading()
47 48
     })
48 49
   }

+ 1
- 0
src/pages/shop/rule/index.js Целия файл

@@ -56,6 +56,7 @@ export default class Shop extends Component {
56 56
           pointRule: res.records || []
57 57
         })
58 58
       }
59
+      this._$_dataReady()
59 60
       Taro.hideLoading()
60 61
     })
61 62
   }

+ 7
- 6
src/utils/page.js Целия файл

@@ -8,7 +8,7 @@ function isFunction(fn) {
8 8
 }
9 9
 
10 10
 export function withDetail(opts = {}) {
11
-  return function (OrigComp) {  
11
+  return function (OrigComp) {
12 12
     class WrapperComponent extends OrigComp {
13 13
       // 数据详情加载
14 14
       // _$_dataReady 被透传到父组件,  父组件加载完数据之后需要调用 this._$_dataReady()
@@ -27,7 +27,7 @@ export function withDetail(opts = {}) {
27 27
 
28 28
         // 执行埋点
29 29
         this._$_dataLoadPromise.then(this._track.bind(this))
30
-  
30
+
31 31
         if (super.componentWillMount) {
32 32
           super.componentWillMount();
33 33
         }
@@ -57,7 +57,8 @@ export function withDetail(opts = {}) {
57 57
         }
58 58
       }
59 59
 
60
-      async _track () {
60
+      async _track() {
61
+    
61 62
         // 埋点
62 63
         let trackPayload = opts.track || {}
63 64
 
@@ -66,10 +67,10 @@ export function withDetail(opts = {}) {
66 67
             ...trackPayload,
67 68
             ...this._$_track(),
68 69
           }
69
-          const { recordId } = await savePoint(trackPayload)
70
-
71
-          this._$_trackOverFn = () => updatePoint(recordId)
72 70
         }
71
+        const { recordId } = await savePoint(trackPayload)
72
+
73
+        this._$_trackOverFn = () => updatePoint(recordId)
73 74
       }
74 75
     }
75 76