@conecli/cone-render 0.10.1-shop-beta.9 → 0.10.1-shop-beta.10

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