Browse Source

dataready

xujing 5 years ago
parent
commit
850566fac1

+ 1
- 0
src/pages/policy/index.js View File

52
       hasMore: list.length >= total ? false : true,
52
       hasMore: list.length >= total ? false : true,
53
       pageIndex: 1
53
       pageIndex: 1
54
     })
54
     })
55
+    this._$_dataReady()
55
     rest && rest()
56
     rest && rest()
56
   }
57
   }
57
 
58
 

+ 3
- 0
src/pages/project/detail/map.js View File

71
                     })
71
                     })
72
                 }
72
                 }
73
             })
73
             })
74
+
75
+            this._$_dataReady()
76
+
74
             Taro.hideToast()
77
             Taro.hideToast()
75
         })
78
         })
76
     }
79
     }

+ 3
- 1
src/pages/project/floor/index.js View File

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

+ 1
- 0
src/pages/project/map/index.js View File

95
         longitude: curCity.lng
95
         longitude: curCity.lng
96
       })
96
       })
97
     }
97
     }
98
+    this._$_dataReady()
98
     return getItemList(payload)
99
     return getItemList(payload)
99
   }
100
   }
100
   onViewDetail(item) {
101
   onViewDetail(item) {

+ 1
- 0
src/pages/shop/detail/index.js View File

47
       // })
47
       // })
48
 
48
 
49
       WxParse.wxParse('article', 'html', res.goodsDescription || '<p></p>', this.$scope, 0)
49
       WxParse.wxParse('article', 'html', res.goodsDescription || '<p></p>', this.$scope, 0)
50
+      this._$_dataReady()
50
       Taro.hideLoading()
51
       Taro.hideLoading()
51
     })
52
     })
52
   }
53
   }

+ 1
- 2
src/pages/shop/index.js View File

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

+ 1
- 0
src/pages/shop/integralDetail/index.js View File

43
     Taro.showLoading()
43
     Taro.showLoading()
44
     this.props.dispatchPointsRecords().then(res => {
44
     this.props.dispatchPointsRecords().then(res => {
45
       this.checkChoose(res.records)
45
       this.checkChoose(res.records)
46
+      this._$_dataReady()
46
       Taro.hideLoading()
47
       Taro.hideLoading()
47
     })
48
     })
48
   }
49
   }

+ 1
- 0
src/pages/shop/rule/index.js View File

56
           pointRule: res.records || []
56
           pointRule: res.records || []
57
         })
57
         })
58
       }
58
       }
59
+      this._$_dataReady()
59
       Taro.hideLoading()
60
       Taro.hideLoading()
60
     })
61
     })
61
   }
62
   }

+ 7
- 6
src/utils/page.js View File

8
 }
8
 }
9
 
9
 
10
 export function withDetail(opts = {}) {
10
 export function withDetail(opts = {}) {
11
-  return function (OrigComp) {  
11
+  return function (OrigComp) {
12
     class WrapperComponent extends OrigComp {
12
     class WrapperComponent extends OrigComp {
13
       // 数据详情加载
13
       // 数据详情加载
14
       // _$_dataReady 被透传到父组件,  父组件加载完数据之后需要调用 this._$_dataReady()
14
       // _$_dataReady 被透传到父组件,  父组件加载完数据之后需要调用 this._$_dataReady()
27
 
27
 
28
         // 执行埋点
28
         // 执行埋点
29
         this._$_dataLoadPromise.then(this._track.bind(this))
29
         this._$_dataLoadPromise.then(this._track.bind(this))
30
-  
30
+
31
         if (super.componentWillMount) {
31
         if (super.componentWillMount) {
32
           super.componentWillMount();
32
           super.componentWillMount();
33
         }
33
         }
57
         }
57
         }
58
       }
58
       }
59
 
59
 
60
-      async _track () {
60
+      async _track() {
61
+    
61
         // 埋点
62
         // 埋点
62
         let trackPayload = opts.track || {}
63
         let trackPayload = opts.track || {}
63
 
64
 
66
             ...trackPayload,
67
             ...trackPayload,
67
             ...this._$_track(),
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