@conecli/cone-render 0.8.31 → 0.8.32

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.
@@ -1 +1 @@
1
- import Taro from '@tarojs/taro'
2
1
  public config: object
3
2
  this.config = {}
4
3
  return new Promise((resolve, reject) => {
5
4
  if (typeof jd !== 'undefined' && jd.requestWebCookie) {
6
5
  jd.requestWebCookie({
7
6
  needpin: 1,
8
7
  success: (res) => {
9
8
  console.log(res)
10
9
  const { ticket, pt_pin } = res
11
10
  console.log('requestWebCookie.success', res)
12
11
  this.info.userInfo = {
13
12
  pin: pt_pin,
14
13
  encodePin: encodeURIComponent(pt_pin),
15
14
  ptkey: ticket,
16
15
  }
17
16
  this.miniAppLogInstance &&
18
17
  this.miniAppLogInstance.set({
19
18
  account: pt_pin,
20
19
  })
21
20
  this.info.loginState = true
22
21
  resolve(res)
23
22
  },
24
23
  fail(res) {
25
24
  console.log('requestWebCookie.fail', res)
26
25
  reject(res)
27
26
  },
28
27
  })
29
28
  } else {
30
29
  resolve({
31
30
  pin: '',
32
31
  ptkey: '',
33
32
  mock: true
34
33
  })
35
34
  }
36
35
  })
37
36
  this.checkLoginStatus().then(res => {
38
37
  console.log(
39
38
  'jdLoadCheckStatusAndLogin hasUserLogined.success: ',
40
39
  res,
41
40
  )
42
41
  resolve(res)
43
42
  }).catch(err => {
44
43
  console.warn(
45
44
  'jdLoadCheckStatusAndLogin hasUserLogined.fail: ',
46
45
  err,
47
46
  )
48
47
  this.toLogin().then(res => {
49
48
  resolve(res)
50
49
  }).catch(err => {
51
50
  reject(err)
52
51
  })
53
52
  })
54
53
  return new Promise((resolve,reject) => {
55
54
  if (typeof jd !== 'undefined' && jd.hasUserLogined) {
56
55
  jd.hasUserLogined({
57
56
  success: (res) => {
58
57
  console.log('hasUserLogined.success: ', res)
59
58
  if (res.status === 1) {
60
59
  this.getLoginCookie()
61
60
  resolve(res)
62
61
  }else {
63
62
  reject(res)
64
63
  }
65
64
  },
66
65
  fail: (res) => {
67
66
  console.warn('hasUserLogined.fail: ', res)
68
67
  reject(res)
69
68
  },
70
69
  })
71
70
  } else {
72
71
  reject(false)
73
72
  }
74
73
  })
74
+ import Taro from '@tarojs/taro'
75
75
  public config: object
76
76
  this.config = {}
77
77
  return new Promise((resolve, reject) => {
78
78
  if (typeof jd !== 'undefined' && jd.requestWebCookie) {
79
79
  jd.requestWebCookie({
80
80
  needpin: 1,
81
81
  success: (res) => {
82
82
  console.log(res)
83
83
  const { ticket, pt_pin } = res
84
84
  console.log('requestWebCookie.success', res)
85
85
  this.info.userInfo = {
86
86
  pin: pt_pin,
87
87
  encodePin: encodeURIComponent(pt_pin),
88
88
  ptkey: ticket,
89
89
  }
90
90
  this.miniAppLogInstance &&
91
91
  this.miniAppLogInstance.set({
92
92
  account: pt_pin,
93
93
  })
94
94
  this.info.loginState = true
95
95
  resolve(res)
96
96
  },
97
97
  fail(res) {
98
98
  console.log('requestWebCookie.fail', res)
99
99
  reject(res)
100
100
  },
101
101
  })
102
102
  } else {
103
103
  resolve({
104
104
  pin: '',
105
105
  ptkey: '',
106
106
  mock: true
107
107
  })
108
108
  }
109
109
  })
110
110
  this.checkLoginStatus().then(res => {
111
111
  console.log(
112
112
  'jdLoadCheckStatusAndLogin hasUserLogined.success: ',
113
113
  res,
114
114
  )
115
115
  resolve(res)
116
116
  }).catch(err => {
117
117
  console.warn(
118
118
  'jdLoadCheckStatusAndLogin hasUserLogined.fail: ',
119
119
  err,
120
120
  )
121
121
  this.toLogin().then(res => {
122
122
  resolve(res)
123
123
  }).catch(err => {
124
124
  reject(err)
125
125
  })
126
126
  })
127
127
  return this.checkStatusAndLoginPromise
128
128
  return new Promise((resolve,reject) => {
129
129
  if (typeof jd !== 'undefined' && jd.hasUserLogined) {
130
130
  jd.hasUserLogined({
131
131
  success: (res) => {
132
132
  console.log('hasUserLogined.success: ', res)
133
133
  if (res.status === 1) {
134
134
  this.getLoginCookie()
135
135
  resolve(res)
136
136
  }else {
137
137
  reject(res)
138
138
  }
139
139
  },
140
140
  fail: (res) => {
141
141
  console.warn('hasUserLogined.fail: ', res)
142
142
  reject(res)
143
143
  },
144
144
  })
145
145
  } else {
146
146
  reject(false)
147
147
  }
148
148
  })
@@ -19,7 +19,7 @@
19
19
  background-repeat: no-repeat;
20
20
  background-position: center center;
21
21
  background-size: 100%;
22
- // z-index: 20;
22
+ z-index: 20;
23
23
  transform: translateZ(20px);
24
24
  width: 24px;
25
25
  height: 24px;
@@ -1 +1 @@
1
- import Taro from '@tarojs/taro'
2
1
  const inViewCallback = () => {
3
2
  console.log('埋点收到进入可视区域的回到啦!', reportData)
4
3
  addReportData(reportData)
5
4
  }
6
5
  exposureStyle.root,
7
6
  className,
8
7
  )} height={'100%'} inViewCallback={inViewCallback}></InViewRender>
8
+ import Taro from '@tarojs/taro'
9
9
  const inViewCallback = () => {
10
10
  console.log('埋点收到进入可视区域的回到啦!', reportData)
11
11
  addReportData(reportData)
12
12
  }
13
13
  exposureStyle.root,
14
14
  className,
15
15
  )} height={'100%'} inViewCallback={inViewCallback}></InViewRender>
@@ -1 +1 @@
1
- import track from '../../../open/api/track'
2
1
  const {arr : arrTask, startWaitTime} = floorTask
3
2
  const isTimeout = startWaitTime != 0 && (Date.now() - startWaitTime >= 1000)
4
3
  const isOverMax = arrTask.length >= 10
5
4
  const hasData = arrTask.length > 0
6
5
  if(hasData && (isTimeout || isOverMax)){
7
6
  const reduceData = connactData(arrTask)
8
7
  track.reportExposureEventLog(reduceData)
9
8
  floorTask.arr = []
10
9
  floorTask.startWaitTime = 0
11
10
  clearTimeout(floorTask.timer)
12
11
  }
13
12
  const initData = JSON.parse(JSON.stringify(arr[0]))
14
13
  initData.jsonParam.logBaseInfo = []
15
14
  initData.jsonParam.etModelInfo.lstms = []
16
15
  return arr.reduce((acc, cur) => {
17
16
  cur.jsonParam.etModelInfo.lstms[0].la_p = cur.jsonParam.logBaseInfo.mInfo?.pos
18
17
  acc.jsonParam.logBaseInfo.push(cur.jsonParam.logBaseInfo)
19
18
  acc.jsonParam.etModelInfo.lstms.push(cur.jsonParam.etModelInfo.lstms)
20
19
  return acc
21
20
  }, initData)
22
21
  if(!Array.isArray(data)){
23
22
  console.log('坑位曝光埋点原始数据参类型错误,期望是数组,实际是:', data)
24
23
  return
25
24
  }
26
25
  const [floorData, mInfo, etModelInfo] = data
27
26
  if(floorData && mInfo && etModelInfo){
28
27
  const reportJson = track.getIsvExposureInfo(floorData, mInfo, etModelInfo)
29
28
  const { floorIdx } = floorData
30
29
  if(!task[floorIdx]){
31
30
  task[floorIdx] = {
32
31
  arr: [],
33
32
  startWaitTime: 0,
34
33
  timer : 0
35
34
  }
36
35
  }
37
36
  const floorTask = task[floorIdx]
38
37
  if(floorTask.arr.length === 0){
39
38
  floorTask.startWaitTime = Date.now()
40
39
  }
41
40
  if(reportJson){
42
41
  floorTask.arr.push(reportJson)
43
42
  clearTimeout(floorTask.timer)
44
43
  floorTask.timer = setTimeout(() => {
45
44
  check(floorTask)
46
45
  }, 1000)
47
46
  check(floorTask)
48
47
  }
49
48
  }else{
50
49
  console.log('坑位曝光埋点原始数据参数缺失,期望是[floorData, mInfo, etModelInfo],实际是:', data)
51
50
  }
51
+ import track from '../../../open/api/track'
52
52
  const {arr : arrTask, startWaitTime} = floorTask
53
53
  const isTimeout = startWaitTime != 0 && (Date.now() - startWaitTime >= 1000)
54
54
  const isOverMax = arrTask.length >= 10
55
55
  const hasData = arrTask.length > 0
56
56
  if(hasData && (isTimeout || isOverMax)){
57
57
  const reduceData = connactData(arrTask)
58
58
  track.reportExposureEventLog(reduceData)
59
59
  floorTask.arr = []
60
60
  floorTask.startWaitTime = 0
61
61
  clearTimeout(floorTask.timer)
62
62
  }
63
63
  const initData = JSON.parse(JSON.stringify(arr[0]))
64
64
  if(initData.jsonParam.etModelInfo) {
65
65
  initData.jsonParam.logBaseInfo = []
66
66
  initData.jsonParam.etModelInfo.lstms = []
67
67
  return arr.reduce((acc, cur) => {
68
68
  cur.jsonParam.etModelInfo.lstms[0].la_p = cur.jsonParam.logBaseInfo.mInfo?.pos
69
69
  acc.jsonParam.logBaseInfo.push(cur.jsonParam.logBaseInfo)
70
70
  acc.jsonParam.etModelInfo.lstms.push(cur.jsonParam.etModelInfo.lstms)
71
71
  return acc
72
72
  }, initData)
73
73
  } else {
74
74
  return arr.reduce((acc) => {
75
75
  return acc
76
76
  })
77
77
  }
78
78
  if(!Array.isArray(data)){
79
79
  console.log('坑位曝光埋点原始数据参类型错误,期望是数组,实际是:', data)
80
80
  return
81
81
  }
82
82
  const [floorData, mInfo, etModelInfo] = data
83
83
  if(floorData && mInfo && etModelInfo){
84
84
  try {
85
85
  const reportJson = track.getIsvExposureInfo(floorData, mInfo, etModelInfo)
86
86
  console.log('reportJson',reportJson)
87
87
  const { floorIdx } = floorData
88
88
  if(!task[floorIdx]){
89
89
  task[floorIdx] = {
90
90
  arr: [],
91
91
  startWaitTime: 0,
92
92
  timer : 0
93
93
  }
94
94
  }
95
95
  const floorTask = task[floorIdx]
96
96
  if(floorTask.arr.length === 0){
97
97
  floorTask.startWaitTime = Date.now()
98
98
  }
99
99
  if(reportJson){
100
100
  floorTask.arr.push(reportJson)
101
101
  clearTimeout(floorTask.timer)
102
102
  floorTask.timer = setTimeout(() => {
103
103
  check(floorTask)
104
104
  }, 1000)
105
105
  check(floorTask)
106
106
  }
107
107
  }catch (e) {
108
108
  {
109
109
  console.log('坑位曝光埋点出错啦',e)
110
110
  }
111
111
  }
112
112
  }else{
113
113
  console.log('坑位曝光埋点原始数据参数缺失,期望是[floorData, mInfo, etModelInfo],实际是:', data)
114
114
  }