@conecli/cone-render 0.9.1-shop2.19 → 0.9.1-shop2.20

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
  floorVideInfo: {},
3
2
  productVideInfo: {},
4
3
  isVipShop: false,
5
4
  isJdShowNativeImmersivePlayer: false,
6
5
  pageIdxHeightInfo: {
7
6
  list: []
8
7
  },
9
8
  jdBottomBarHeight: 0,
10
9
  jdNativeHeaderHeight: 0,
11
10
  openAppData: {}
12
11
  public config: {
13
12
  [key: string]: any
14
13
  }
15
14
  public lazyContainer: CommonInterFace.lazyContainer
16
15
  public renderedIsvComponents: CommonInterFace.renderedIsvComponents
17
16
  public loadJsSdkList: Array<any>
18
17
  this.config = {}
19
18
  this.loadJsSdkList = []
20
19
  this.renderedIsvComponents = {}
21
20
 
22
21
  taskTimeoutPromise(callBack, timeout = 2000){
23
22
  return new Promise((resolve) => {
24
23
  setTimeout(() => {
25
24
  const getCallBackRes = typeof callBack === 'function' && callBack()
26
25
  return resolve(getCallBackRes || false)
27
26
  }, timeout)
28
27
  })
29
28
  }
30
29
  removeJdAndroidRquestEventForTouchStart(){}
31
30
  this.info.sysInfo['wifiVideoAutoPlay'] = false
32
31
  checkStatusAndLogin(options = {}) {
33
32
 
34
33
  checkJdStatusAndLogin(options){
35
34
  return this.checkStatusAndLogin(options)
36
35
  }
37
36
 
38
37
  doLoginForJdPin(options = {}) {
39
38
  return this.doLogin(options)
40
39
  }
41
40
 
42
41
  getLoginCookie(updateKey = 'wxapp') {
43
42
  return new Promise((resolve) => {
44
43
  console.log("开始获取更新wxapp中的cookie信息", updateKey)
45
44
  if(this.config.wqCookie && this.config.wqCookieStr && this.config.getWqCookieKey === updateKey){
46
45
  console.log("已有存储wxapp中的cookie信息,直接返回",this.config)
47
46
  resolve({
48
47
  wqCookie: this.config.wqCookie,
49
48
  wqCookieStr: this.config.wqCookieStr,
50
49
  })
51
50
  }else {
52
51
  if (isPublishToWxapp) {
53
52
  const getWxappCookieObj = getTaroStorageKeyValue('cookies') || null
54
53
  if (getWxappCookieObj) {
55
54
  const getCookieObj = getWxappCookieObj['_data']
56
55
  const { wqCookie, wqCookieStr } = getWxAppCookieStr(getCookieObj)
57
56
  const { pin = '', visitkey = '-1', wq_unionid = '', wxapp_openid = '' } = wqCookie
58
57
  this.info.loginState = true
59
58
  this.info.userInfo.wqCookie = wqCookieStr
60
59
  this.info.userInfo.wqVisitkey = visitkey
61
60
  console.log('获取用户完整cookie信息', getCookieObj)
62
61
  const getUserAddress = this.wxAppUserInfoInstance.getAddress()
63
62
  console.log('获取微信用户地址信息', getUserAddress)
64
63
  if (getUserAddress) {
65
64
  this.info.pageInfo.address = getUserAddress?.areaId
66
65
  this.info.pageInfo.addressCommaStr = this.info.pageInfo
67
66
  .address
68
67
  ? this.info.pageInfo.address.replace(/_/g, ',')
69
68
  : ''
70
69
  this.info.pageInfo.un_area = this.info.pageInfo.address
71
70
  Taro.eventCenter.trigger(
72
71
  TaroEventType.USER_AREA_UPDATE,
73
72
  this.info.pageInfo.address,
74
73
  )
75
74
  }
76
75
  if(this.miniAppLogInstance){
77
76
  this.miniAppLogInstance.set({
78
77
  account: pin,
79
78
  unionid: wq_unionid,
80
79
  openid: wxapp_openid,
81
80
  })
82
81
  }
83
82
  this.config.wqCookie = wqCookie
84
83
  this.config.wqCookieStr = wqCookieStr
85
84
  this.config.getWqCookieKey = updateKey
86
85
  console.log("解析wxapp中的cookie信息成功,返回后存储",this.config)
87
86
  resolve({
88
87
  wqCookie,
89
88
  wqCookieStr,
90
89
  })
91
90
  }else {
92
91
  console.log("解析wxapp中的cookie信息异常,返回异常结果",this.config)
93
92
  resolve({
94
93
  wqCookie: false,
95
94
  wqCookieStr: false,
96
95
  })
97
96
  }
98
97
  }else {
99
98
  resolve({
100
99
  wqCookie: false,
101
100
  wqCookieStr: false,
102
101
  })
103
102
  }
104
103
  }
105
104
  })
106
105
  }
107
106
  return this.getLoginCookie()
108
107
 
109
108
  getAddressCachePromise = () => {
110
109
  return Promise.reject("该方法只在APP内适用")
111
110
  }
112
111
 
113
112
  getDynamicConfig(key: string){
114
113
  console.warn('调用默认的 getDynamicConfig(),注意,此方法还未实现!')
115
114
  return null
116
115
  }
117
116
  renderNextTickLoadSdk(){
118
117
  console.warn("暂未实现 index.ts")
119
118
  }
120
119
  loadOtherSdk(){
121
120
  console.warn("暂未实现 index.ts")
122
121
  }
123
122
  loadItemSdkPromise() {
124
123
  console.warn('暂未实现 index.ts')
125
124
  }
125
+ import Taro from '@tarojs/taro'
126
126
  floorVideInfo: {},
127
127
  productVideInfo: {},
128
128
  isVipShop: false,
129
129
  isJdShowNativeImmersivePlayer: false,
130
130
  pageIdxHeightInfo: {
131
131
  list: []
132
132
  },
133
133
  jdBottomBarHeight: 0,
134
134
  jdNativeHeaderHeight: 0,
135
135
  openAppData: {}
136
136
  public config: {
137
137
  [key: string]: any
138
138
  }
139
139
  public lazyContainer: CommonInterFace.lazyContainer
140
140
  public renderedIsvComponents: CommonInterFace.renderedIsvComponents
141
141
  public loadJsSdkList: Array<any>
142
142
  public loadJsSdkListCachePromise: any
143
143
  this.config = {}
144
144
  this.loadJsSdkList = []
145
145
  this.loadJsSdkListCachePromise = {}
146
146
  this.renderedIsvComponents = {}
147
147
 
148
148
  taskTimeoutPromise(callBack, timeout = 2000){
149
149
  return new Promise((resolve) => {
150
150
  setTimeout(() => {
151
151
  const getCallBackRes = typeof callBack === 'function' && callBack()
152
152
  return resolve(getCallBackRes || false)
153
153
  }, timeout)
154
154
  })
155
155
  }
156
156
  removeJdAndroidRquestEventForTouchStart(){}
157
157
  this.info.sysInfo['wifiVideoAutoPlay'] = false
158
158
  checkStatusAndLogin(options = {}) {
159
159
 
160
160
  checkJdStatusAndLogin(options){
161
161
  return this.checkStatusAndLogin(options)
162
162
  }
163
163
 
164
164
  doLoginForJdPin(options = {}) {
165
165
  return this.doLogin(options)
166
166
  }
167
167
 
168
168
  getLoginCookie(updateKey = 'wxapp') {
169
169
  return new Promise((resolve) => {
170
170
  console.log("开始获取更新wxapp中的cookie信息", updateKey)
171
171
  if(this.config.wqCookie && this.config.wqCookieStr && this.config.getWqCookieKey === updateKey){
172
172
  console.log("已有存储wxapp中的cookie信息,直接返回",this.config)
173
173
  resolve({
174
174
  wqCookie: this.config.wqCookie,
175
175
  wqCookieStr: this.config.wqCookieStr,
176
176
  })
177
177
  }else {
178
178
  if (isPublishToWxapp) {
179
179
  const getWxappCookieObj = getTaroStorageKeyValue('cookies') || null
180
180
  if (getWxappCookieObj) {
181
181
  const getCookieObj = getWxappCookieObj['_data']
182
182
  const { wqCookie, wqCookieStr } = getWxAppCookieStr(getCookieObj)
183
183
  const { pin = '', visitkey = '-1', wq_unionid = '', wxapp_openid = '' } = wqCookie
184
184
  this.info.loginState = true
185
185
  this.info.userInfo.wqCookie = wqCookieStr
186
186
  this.info.userInfo.wqVisitkey = visitkey
187
187
  console.log('获取用户完整cookie信息', getCookieObj)
188
188
  const getUserAddress = this.wxAppUserInfoInstance.getAddress()
189
189
  console.log('获取微信用户地址信息', getUserAddress)
190
190
  if (getUserAddress) {
191
191
  this.info.pageInfo.address = getUserAddress?.areaId
192
192
  this.info.pageInfo.addressCommaStr = this.info.pageInfo
193
193
  .address
194
194
  ? this.info.pageInfo.address.replace(/_/g, ',')
195
195
  : ''
196
196
  this.info.pageInfo.un_area = this.info.pageInfo.address
197
197
  Taro.eventCenter.trigger(
198
198
  TaroEventType.USER_AREA_UPDATE,
199
199
  this.info.pageInfo.address,
200
200
  )
201
201
  }
202
202
  if(this.miniAppLogInstance){
203
203
  this.miniAppLogInstance.set({
204
204
  account: pin,
205
205
  unionid: wq_unionid,
206
206
  openid: wxapp_openid,
207
207
  })
208
208
  }
209
209
  this.config.wqCookie = wqCookie
210
210
  this.config.wqCookieStr = wqCookieStr
211
211
  this.config.getWqCookieKey = updateKey
212
212
  console.log("解析wxapp中的cookie信息成功,返回后存储",this.config)
213
213
  resolve({
214
214
  wqCookie,
215
215
  wqCookieStr,
216
216
  })
217
217
  }else {
218
218
  console.log("解析wxapp中的cookie信息异常,返回异常结果",this.config)
219
219
  resolve({
220
220
  wqCookie: false,
221
221
  wqCookieStr: false,
222
222
  })
223
223
  }
224
224
  }else {
225
225
  resolve({
226
226
  wqCookie: false,
227
227
  wqCookieStr: false,
228
228
  })
229
229
  }
230
230
  }
231
231
  })
232
232
  }
233
233
  return this.getLoginCookie()
234
234
 
235
235
  getAddressCachePromise = () => {
236
236
  return Promise.reject("该方法只在APP内适用")
237
237
  }
238
238
 
239
239
  getDynamicConfig(key: string){
240
240
  console.warn('调用默认的 getDynamicConfig(),注意,此方法还未实现!')
241
241
  return null
242
242
  }
243
243
  renderNextTickLoadSdk(){
244
244
  console.warn("暂未实现 index.ts")
245
245
  }
246
246
  loadOtherSdk(){
247
247
  console.warn("暂未实现 index.ts")
248
248
  }
249
249
  loadItemSdkPromise() {
250
250
  console.warn('暂未实现 index.ts')
251
251
  }