xiaoe_mp_npm 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,7 +5,7 @@ import {PARTICIPATION_CONDITION} from '../../constants'
5
5
  import remotePic from '../../remotePic'
6
6
  import eventBus from '../../eventBus'
7
7
  import {participateLottery} from '../../store/effect'
8
-
8
+ import {sensorLog} from 'live-mp-tools'
9
9
  const computedBehavior = require('miniprogram-computed').behavior
10
10
 
11
11
  const mapState = state => ({
@@ -75,11 +75,13 @@ Component(
75
75
  if (val) {
76
76
  this.setData({selectedIndex: 0})
77
77
  this.fetchPrizeInfo()
78
+ this.reportData();
78
79
  }
79
80
  }
80
81
  },
81
82
  lifetimes: {
82
- attached() {},
83
+ attached() {
84
+ },
83
85
  detached() {}
84
86
  },
85
87
  methods: {
@@ -150,6 +152,21 @@ Component(
150
152
  this.store.dispatch({type: 'hide_lottery_info'})
151
153
  }
152
154
  this.store.dispatch(participateLottery())
155
+ },
156
+ reportData(){
157
+ const data = {
158
+ page_id: 'raffle#raffle#raffle_window',
159
+ platform:'mini',
160
+ l_program: 'e_alive',
161
+ current_role: this.data.baseInfo.user_type === 0 ? 'C端用户' : '讲师',
162
+ type: this.data.baseInfo.alive_mode === 0 ? '横屏' : '竖屏',
163
+ h_live_state: this.data.baseInfo.alive_state,
164
+ c_user_id: this.data.baseInfo.user_id,
165
+ app_id: this.data.baseInfo.app_id,
166
+ user_channel:'',
167
+ union_id:wx.getStorageSync('unionId')
168
+ }
169
+ sensorLog.sensors.track('view_page', data)
153
170
  }
154
171
  }
155
172
  })
@@ -1,6 +1,7 @@
1
1
  import remotePic from '../../../remotePic'
2
2
  import {connect} from '../../../store/index'
3
3
 
4
+
4
5
  const computedBehavior = require('miniprogram-computed').behavior
5
6
 
6
7
  const mapState = state => ({lotteryInfo: state.lotteryInfo})
@@ -36,6 +36,24 @@ Component(
36
36
  type: visible ? 'show_lottery_result' : 'hide_lottery_result'
37
37
  })
38
38
  },
39
+ <<<<<<< HEAD
40
+ reportData() {
41
+ const data = {
42
+ page_id: 'raffle#raffle_result',
43
+ platform:'mini',
44
+ l_program: 'e_alive',
45
+ current_role: this.data.baseInfo.user_type === 0 ? 'C端用户' : '讲师',
46
+ type: this.data.baseInfo.alive_mode === 0 ? '横屏' : '竖屏',
47
+ h_live_state: this.data.baseInfo.alive_state,
48
+ c_user_id: this.data.baseInfo.user_id,
49
+ app_id: this.data.baseInfo.app_id,
50
+ user_channel:'',
51
+ union_id:wx.getStorageSync('unionId')
52
+ }
53
+ sensorLog.sensors.track('view_page', data)
54
+ console.log('reportData:', data)
55
+ }
56
+ =======
39
57
  // reportData() {
40
58
  // const data = {
41
59
  // page_id: 'e_alive#mini#first#alive_room',
@@ -51,6 +69,7 @@ Component(
51
69
  // sensorLog.sensors.track('view_page', data)
52
70
  // console.log('reportData:', data)
53
71
  // }
72
+ >>>>>>> master
54
73
  }
55
74
  })
56
75
  )
@@ -1,5 +1,5 @@
1
1
  import {connect} from '../../store/index'
2
-
2
+ import {sensorLog} from 'live-mp-tools'
3
3
  const computedBehavior = require('miniprogram-computed').behavior
4
4
 
5
5
  /**
@@ -7,7 +7,8 @@ const computedBehavior = require('miniprogram-computed').behavior
7
7
  */
8
8
  const mapState = state => ({
9
9
  visible: state.merchantContactInfoVisible,
10
- contactInfo: state.merchantContactInfo
10
+ contactInfo: state.merchantContactInfo,
11
+ baseInfo: state.baseInfo
11
12
  })
12
13
  Component(
13
14
  connect(mapState)({
@@ -21,6 +22,16 @@ Component(
21
22
  return String(data.contactInfo.is_qrcode) === '1'
22
23
  }
23
24
  },
25
+ observers: {
26
+ visible(val) {
27
+ if (val) {
28
+ this.reportData()
29
+ }
30
+ }
31
+ },
32
+ lifetimes: {
33
+ attached() {}
34
+ },
24
35
  methods: {
25
36
  onVisibleChange({detail: visible}) {
26
37
  this.store.dispatch({
@@ -34,6 +45,22 @@ Component(
34
45
  this.store.dispatch({type: 'hide_merchant_contact_info'})
35
46
  }
36
47
  })
48
+ },
49
+ reportData(){
50
+ const data = {
51
+ page_id: 'raffle#redeem',
52
+ platform:'mini',
53
+ l_program: 'e_alive',
54
+ current_role: this.data.baseInfo.user_type === 0 ? 'C端用户' : '讲师',
55
+ type: this.data.baseInfo.alive_mode === 0 ? '横屏' : '竖屏',
56
+ h_live_state: this.data.baseInfo.alive_state,
57
+ c_user_id: this.data.baseInfo.user_id,
58
+ app_id: this.data.baseInfo.app_id,
59
+ user_channel:'',
60
+ union_id:wx.getStorageSync('unionId')
61
+ }
62
+ sensorLog.sensors.track('view_page', data)
63
+ console.log('reportData:', data)
37
64
  }
38
65
  }
39
66
  })
@@ -1,12 +1,13 @@
1
1
  import remotePic from '../../remotePic'
2
2
  import {connect} from '../../store/index'
3
3
  import {MY_LOTTERY_CONTENT_TYPE} from '../../constants'
4
-
4
+ import {sensorLog} from 'live-mp-tools'
5
5
  const computedBehavior = require('miniprogram-computed').behavior
6
6
 
7
7
  const mapState = state => ({
8
8
  visible: state.myLotteryVisible,
9
- content: state.myLotteryContent
9
+ content: state.myLotteryContent,
10
+ baseInfo: state.baseInfo
10
11
  })
11
12
  Component(
12
13
  connect(mapState)({
@@ -30,9 +31,16 @@ Component(
30
31
  return data.content === MY_LOTTERY_CONTENT_TYPE.ADDRESS_COLLECTION
31
32
  }
32
33
  },
33
- observers: {},
34
+ observers: {
35
+ visible(val) {
36
+ if (val) {
37
+ this.reportData()
38
+ }
39
+ }
40
+ },
34
41
  lifetimes: {
35
- attached() {}
42
+ attached() {
43
+ }
36
44
  },
37
45
  methods: {
38
46
  onVisibleChange({detail: visible}) {
@@ -46,6 +54,22 @@ Component(
46
54
  this.store.dispatch({type: 'set_my_lottery_content', payload: ''})
47
55
  }, POPUP_SLIDE_DURATION)
48
56
  }
57
+ },
58
+ reportData(){
59
+ const data = {
60
+ page_id: 'raffle#my_raffle',
61
+ platform:'mini',
62
+ l_program: 'e_alive',
63
+ current_role: this.data.baseInfo.user_type === 0 ? 'C端用户' : '讲师',
64
+ type: this.data.baseInfo.alive_mode === 0 ? '横屏' : '竖屏',
65
+ h_live_state: this.data.baseInfo.alive_state,
66
+ c_user_id: this.data.baseInfo.user_id,
67
+ app_id: this.data.baseInfo.app_id,
68
+ user_channel:'',
69
+ union_id:wx.getStorageSync('unionId')
70
+ }
71
+ sensorLog.sensors.track('view_page', data)
72
+ console.log('reportData:', data)
49
73
  }
50
74
  }
51
75
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xiaoe_mp_npm",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "",
5
5
  "main": "miniprogram_dist/index.js",
6
6
  "scripts": {
@@ -5,7 +5,7 @@ import {PARTICIPATION_CONDITION} from '../../constants'
5
5
  import remotePic from '../../remotePic'
6
6
  import eventBus from '../../eventBus'
7
7
  import {participateLottery} from '../../store/effect'
8
-
8
+ import {sensorLog} from 'live-mp-tools'
9
9
  const computedBehavior = require('miniprogram-computed').behavior
10
10
 
11
11
  const mapState = state => ({
@@ -75,11 +75,13 @@ Component(
75
75
  if (val) {
76
76
  this.setData({selectedIndex: 0})
77
77
  this.fetchPrizeInfo()
78
+ this.reportData();
78
79
  }
79
80
  }
80
81
  },
81
82
  lifetimes: {
82
- attached() {},
83
+ attached() {
84
+ },
83
85
  detached() {}
84
86
  },
85
87
  methods: {
@@ -150,6 +152,21 @@ Component(
150
152
  this.store.dispatch({type: 'hide_lottery_info'})
151
153
  }
152
154
  this.store.dispatch(participateLottery())
155
+ },
156
+ reportData(){
157
+ const data = {
158
+ page_id: 'raffle#raffle#raffle_window',
159
+ platform:'mini',
160
+ l_program: 'e_alive',
161
+ current_role: this.data.baseInfo.user_type === 0 ? 'C端用户' : '讲师',
162
+ type: this.data.baseInfo.alive_mode === 0 ? '横屏' : '竖屏',
163
+ h_live_state: this.data.baseInfo.alive_state,
164
+ c_user_id: this.data.baseInfo.user_id,
165
+ app_id: this.data.baseInfo.app_id,
166
+ user_channel:'',
167
+ union_id:wx.getStorageSync('unionId')
168
+ }
169
+ sensorLog.sensors.track('view_page', data)
153
170
  }
154
171
  }
155
172
  })
@@ -1,6 +1,7 @@
1
1
  import remotePic from '../../../remotePic'
2
2
  import {connect} from '../../../store/index'
3
3
 
4
+
4
5
  const computedBehavior = require('miniprogram-computed').behavior
5
6
 
6
7
  const mapState = state => ({lotteryInfo: state.lotteryInfo})
@@ -36,6 +36,24 @@ Component(
36
36
  type: visible ? 'show_lottery_result' : 'hide_lottery_result'
37
37
  })
38
38
  },
39
+ <<<<<<< HEAD
40
+ reportData() {
41
+ const data = {
42
+ page_id: 'raffle#raffle_result',
43
+ platform:'mini',
44
+ l_program: 'e_alive',
45
+ current_role: this.data.baseInfo.user_type === 0 ? 'C端用户' : '讲师',
46
+ type: this.data.baseInfo.alive_mode === 0 ? '横屏' : '竖屏',
47
+ h_live_state: this.data.baseInfo.alive_state,
48
+ c_user_id: this.data.baseInfo.user_id,
49
+ app_id: this.data.baseInfo.app_id,
50
+ user_channel:'',
51
+ union_id:wx.getStorageSync('unionId')
52
+ }
53
+ sensorLog.sensors.track('view_page', data)
54
+ console.log('reportData:', data)
55
+ }
56
+ =======
39
57
  // reportData() {
40
58
  // const data = {
41
59
  // page_id: 'e_alive#mini#first#alive_room',
@@ -51,6 +69,7 @@ Component(
51
69
  // sensorLog.sensors.track('view_page', data)
52
70
  // console.log('reportData:', data)
53
71
  // }
72
+ >>>>>>> master
54
73
  }
55
74
  })
56
75
  )
@@ -1,5 +1,5 @@
1
1
  import {connect} from '../../store/index'
2
-
2
+ import {sensorLog} from 'live-mp-tools'
3
3
  const computedBehavior = require('miniprogram-computed').behavior
4
4
 
5
5
  /**
@@ -7,7 +7,8 @@ const computedBehavior = require('miniprogram-computed').behavior
7
7
  */
8
8
  const mapState = state => ({
9
9
  visible: state.merchantContactInfoVisible,
10
- contactInfo: state.merchantContactInfo
10
+ contactInfo: state.merchantContactInfo,
11
+ baseInfo: state.baseInfo
11
12
  })
12
13
  Component(
13
14
  connect(mapState)({
@@ -21,6 +22,16 @@ Component(
21
22
  return String(data.contactInfo.is_qrcode) === '1'
22
23
  }
23
24
  },
25
+ observers: {
26
+ visible(val) {
27
+ if (val) {
28
+ this.reportData()
29
+ }
30
+ }
31
+ },
32
+ lifetimes: {
33
+ attached() {}
34
+ },
24
35
  methods: {
25
36
  onVisibleChange({detail: visible}) {
26
37
  this.store.dispatch({
@@ -34,6 +45,22 @@ Component(
34
45
  this.store.dispatch({type: 'hide_merchant_contact_info'})
35
46
  }
36
47
  })
48
+ },
49
+ reportData(){
50
+ const data = {
51
+ page_id: 'raffle#redeem',
52
+ platform:'mini',
53
+ l_program: 'e_alive',
54
+ current_role: this.data.baseInfo.user_type === 0 ? 'C端用户' : '讲师',
55
+ type: this.data.baseInfo.alive_mode === 0 ? '横屏' : '竖屏',
56
+ h_live_state: this.data.baseInfo.alive_state,
57
+ c_user_id: this.data.baseInfo.user_id,
58
+ app_id: this.data.baseInfo.app_id,
59
+ user_channel:'',
60
+ union_id:wx.getStorageSync('unionId')
61
+ }
62
+ sensorLog.sensors.track('view_page', data)
63
+ console.log('reportData:', data)
37
64
  }
38
65
  }
39
66
  })
@@ -1,12 +1,13 @@
1
1
  import remotePic from '../../remotePic'
2
2
  import {connect} from '../../store/index'
3
3
  import {MY_LOTTERY_CONTENT_TYPE} from '../../constants'
4
-
4
+ import {sensorLog} from 'live-mp-tools'
5
5
  const computedBehavior = require('miniprogram-computed').behavior
6
6
 
7
7
  const mapState = state => ({
8
8
  visible: state.myLotteryVisible,
9
- content: state.myLotteryContent
9
+ content: state.myLotteryContent,
10
+ baseInfo: state.baseInfo
10
11
  })
11
12
  Component(
12
13
  connect(mapState)({
@@ -30,9 +31,16 @@ Component(
30
31
  return data.content === MY_LOTTERY_CONTENT_TYPE.ADDRESS_COLLECTION
31
32
  }
32
33
  },
33
- observers: {},
34
+ observers: {
35
+ visible(val) {
36
+ if (val) {
37
+ this.reportData()
38
+ }
39
+ }
40
+ },
34
41
  lifetimes: {
35
- attached() {}
42
+ attached() {
43
+ }
36
44
  },
37
45
  methods: {
38
46
  onVisibleChange({detail: visible}) {
@@ -46,6 +54,22 @@ Component(
46
54
  this.store.dispatch({type: 'set_my_lottery_content', payload: ''})
47
55
  }, POPUP_SLIDE_DURATION)
48
56
  }
57
+ },
58
+ reportData(){
59
+ const data = {
60
+ page_id: 'raffle#my_raffle',
61
+ platform:'mini',
62
+ l_program: 'e_alive',
63
+ current_role: this.data.baseInfo.user_type === 0 ? 'C端用户' : '讲师',
64
+ type: this.data.baseInfo.alive_mode === 0 ? '横屏' : '竖屏',
65
+ h_live_state: this.data.baseInfo.alive_state,
66
+ c_user_id: this.data.baseInfo.user_id,
67
+ app_id: this.data.baseInfo.app_id,
68
+ user_channel:'',
69
+ union_id:wx.getStorageSync('unionId')
70
+ }
71
+ sensorLog.sensors.track('view_page', data)
72
+ console.log('reportData:', data)
49
73
  }
50
74
  }
51
75
  })