@conecli/cone-render 0.8.19-beta.1 → 0.8.19-beta.3

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.
Files changed (32) hide show
  1. package/dist/assets/networkError.png +0 -0
  2. package/dist/common/const.ts +1 -1
  3. package/dist/common/index.h5.ts +1 -1
  4. package/dist/common/index.jd.ts +1 -1
  5. package/dist/common/index.ts +1 -1
  6. package/dist/common/index.weapp.ts +1 -1
  7. package/dist/components/base/CustomVideo/index.tsx +1 -1
  8. package/dist/components/base/InOrOutViewObserver/index.tsx +1 -1
  9. package/dist/components/base/InViewRender/index.tsx +1 -1
  10. package/dist/components/base/LazyLayoutLoad/index.tsx +1 -1
  11. package/dist/components/base/LazyLoadImage/index.h5.tsx +1 -1
  12. package/dist/components/base/NetworkDataError/const.ts +1 -1
  13. package/dist/components/base/NetworkDataError/index.module.scss +19 -14
  14. package/dist/components/base/NetworkDataError/index.tsx +1 -1
  15. package/dist/interface/component.ts +1 -1
  16. package/dist/interface/utils.ts +1 -1
  17. package/dist/jumpEventReport/index.h5.ts +1 -1
  18. package/dist/jumpEventReport/index.weapp.ts +1 -1
  19. package/dist/libs/taroAppReport.js +2 -4
  20. package/dist/open/api/index.ts +1 -1
  21. package/dist/utils/connectNativeJsBridge.ts +1 -1
  22. package/dist/utils/jm-common.js +1 -1
  23. package/dist/utils/utils.ts +1 -1
  24. package/package.json +1 -1
  25. package/dist/jumpEventReport/web.jdb.ts +0 -1
  26. package/dist/service/IsvRequestServer.ts +0 -1
  27. package/dist/service/http/const.ts +0 -1
  28. package/dist/service/http/http.jd.ts +0 -1
  29. package/dist/service/http/http.ts +0 -1
  30. package/dist/service/http/httpInterceptors.jd.ts +0 -1
  31. package/dist/service/http/httpInterceptors.ts +0 -1
  32. package/dist/service/http/index.ts +0 -1
@@ -1 +1 @@
1
- import Taro from '@tarojs/taro'
2
1
  pinStatus,
3
2
  visitkey,
4
3
  unionid,
5
4
  skey,
6
5
  __jda,
7
6
  __jdv,
8
7
  __wga,
9
8
  wxapp_type
10
9
  } = cookie
11
10
  pin,
12
11
  pinStatus,
13
12
  visitkey,
14
13
  unionid,
15
14
  skey,
16
15
  __jda,
17
16
  __jdv,
18
17
  __wga,
19
18
  wid,
20
19
  wq_skey,
21
20
  wq_uin,
22
21
  wq_auth_token,
23
22
  wxapp_scene,
24
23
  wq_unionid,
25
24
  wxapp_openid,
26
25
  wxapp_version,
27
26
  wxapp_type
28
27
  exceptionReportFn
29
28
  exceptionReportFn(
30
29
  `店铺首页isv h5楼层隐藏不显示。原因:modularPackResult数据不完备。页面类型-buildType: ${buildType}。楼层顺序-floorIdx: ${floorData?.floorIdx}`,
31
30
  )
32
31
  const isIsvContainer = (containerId, floorListData, containerListData) => {
33
32
  const objContainer = containerListData.find(item => item.containerId === containerId)
34
33
  (itemUid) => {
35
34
  const objectFloor = floorListData.find(floorItem => itemUid === floorItem.uid)
36
35
  return RemoteLoadFloorList.includes(objectFloor?.floorExtInfo?.moduleFlag)
37
36
  }
38
37
  )?? false
38
+ import Taro from '@tarojs/taro'
39
39
  pin?: string
40
40
  visitkey?: string
41
41
  [key: string]: any
42
42
  }
43
43
  jdpin,
44
44
  pinStatus,
45
45
  visitkey,
46
46
  unionid,
47
47
  skey,
48
48
  __jda,
49
49
  __jdv,
50
50
  __wga,
51
51
  wxapp_type
52
52
  } = cookie
53
53
  const getUserCookieObj = {}
54
54
  jdpin,
55
55
  pinStatus,
56
56
  visitkey,
57
57
  unionid,
58
58
  skey,
59
59
  __jda,
60
60
  __jdv,
61
61
  __wga,
62
62
  wid,
63
63
  wq_skey,
64
64
  wq_uin,
65
65
  wq_auth_token,
66
66
  wxapp_scene,
67
67
  wq_unionid,
68
68
  wxapp_openid,
69
69
  wxapp_version,
70
70
  wxapp_type
71
71
  name = name === 'jdpin' ? 'pin' : name;
72
72
  name === 'pin' && (ret.push(`pt_pin=${encodeURIComponent(value)}`))
73
73
  ret.push(`${name}=${encodeURIComponent(value)}`)
74
74
  getUserCookieObj[name] = value
75
75
  }
76
76
  wqCookie: getUserCookieObj
77
77
  exceptionReportFn
78
78
  exceptionReportFn(
79
79
  `店铺首页isv h5楼层隐藏不显示。原因:modularPackResult数据不完备。页面类型-buildType: ${buildType}。楼层顺序-floorIdx: ${floorData?.floorIdx}`,
80
80
  )
81
81
  const isIsvContainer = (containerId, floorListData, containerListData) => {
82
82
  const objContainer = containerListData.find(item => item.containerId === containerId)
83
83
  (itemUid) => {
84
84
  const objectFloor = floorListData.find(floorItem => itemUid === floorItem.uid)
85
85
  return RemoteLoadFloorList.includes(objectFloor?.floorExtInfo?.moduleFlag)
86
86
  }
87
87
  )?? false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@conecli/cone-render",
3
- "version": "0.8.19-beta.1",
3
+ "version": "0.8.19-beta.3",
4
4
  "private": false,
5
5
  "files": [
6
6
  "dist/"
@@ -1 +0,0 @@
1
- import { JdJumpJdApp } from './jdJumpJdApp'
2
  reportClick,
3
1
  reportToCart,
4
2
  routerInfo: {
5
3
  params: {},
6
4
  },
7
5
  nativeEvent: null,
8
6
  jumpConfig: {
9
7
  venderId: null,
10
8
  shopId: null,
11
9
  sourceValue: '',
12
10
  sourceType: 'App-H5',
13
11
  activityType: 'shopx',
14
12
  moduleId: 'none',
15
13
  entrance: 'none',
16
14
  },
17
15
  logPageParamStr: '',
18
16
  public logPageId: string
19
17
  public jumpConfig: JumpEventReportInterFace.JumpH5ReportConfig
20
18
  constructor(opt = {}) {
21
19
  console.log("jdb加载==========")
22
20
  super(opt)
23
21
  this.getConfig(opt)
24
22
  }
25
23
 
26
24
  jdJumpToProduct(skuParams, logEventInfo) {
27
25
  if(typeof skuParams !== 'object') {
28
26
  console.error('万商app跳转商品详情参数需要对象,详情请查看文档')
29
27
  return
30
28
  }
31
29
 
32
30
  let { skuId, bMallTag, skuUniformBizInfo } = skuParams
33
31
  skuId = skuId.toString().trim()
34
32
  this.jdNavigateToNative({
35
33
  category: 'jump',
36
34
  des: 'skudetail',
37
35
  param: {
38
36
  skuId: skuId,
39
37
  bMallTag: bMallTag,
40
38
  skuUniformBizInfo
41
39
  },
42
40
  logEventInfo,
43
41
  })
44
42
  }
45
43
  jdNavigateToNative(
46
44
  console.log("otherParams", otherParams)
47
45
  const paramsStr = JSON.stringify(otherParams)
48
46
  console.log(
49
47
  '跳转web jd open协议',
50
48
  `${url}?params=${paramsStr}`,
51
49
  )
52
50
  console.log('catch', e)
53
51
  clickEventLog(
54
52
  getConfig(opt = {}) {
55
53
  return Object.assign(this, {}, defaultConfig, opt)
56
54
  }
@@ -1 +0,0 @@
1
- import Taro, { RequestTask } from '@tarojs/taro'
2
  SHOP_COLOR_APPID,
3
1
  JshopxColorFunctionIdList,
4
2
  PagesColorFunctionIdList,
5
3
  JSHOPX_COLOR_APPID,
6
4
  PAGES_COLOR_APPID,
7
5
  PAGES_DOMAIN,
8
6
  cookiesStr: '',
9
7
  requestHeaderContentType: {
10
8
  jsonHeader: {
11
9
  'content-type': 'application/json;charset=utf-8',
12
10
  },
13
11
  formDataHeader: {
14
12
  'content-type': 'application/x-www-form-urlencoded',
15
13
  },
16
14
  },
17
15
  requestBaseParam: {
18
16
  data: null,
19
17
  header: {
20
18
  'content-type': 'application/json;charset=utf-8',
21
19
  },
22
20
  },
23
21
  timeOut: 7000,
24
22
  apiClientParams: {
25
23
  appid: SHOP_COLOR_APPID,
26
24
  clientVersion:
27
25
  isH5AndJdShopView && jdAppVersionStr !== '' ? jdAppVersionStr : '11.0.0',
28
26
  client: isH5AndJdShopView ? (isIosDevice ? 'apple' : 'android') : 'wh5',
29
27
  area: '1_72_2799_0',
30
28
  uuid: UUID,
31
29
  loginType: "11",
32
30
  },
33
31
  public addressFetchInfo: {
34
32
  reqState: boolean
35
33
  promiseInstance: null | Promise<any>
36
34
  }
37
35
  public getPromotionConfig: {
38
36
  projectId: null | string | number
39
37
  pageId: null | string | number
40
38
  }
41
39
  public resInfo: ServiceInterFace.HttpRequestInfo
42
40
  public api: ServiceInterFace.HttpApi
43
41
  public isPageDomain: boolean
44
42
  constructor(opt) {
45
43
  this._init()
46
44
  this.addressFetchInfo = {
47
45
  reqState: false,
48
46
  promiseInstance: null,
49
47
  }
50
48
  this.getPromotionConfig = {
51
49
  projectId: null,
52
50
  pageId: null,
53
51
  }
54
52
  this._userAreaUpdateListen()
55
53
  this.resInfo = this._getResConfig(opt)
56
54
  this.api = api
57
55
  this.isPageDomain = window.location.hostname === PAGES_DOMAIN
58
56
  }
59
57
  _init(): void {
60
58
  httpInterceptors.forEach((item) => {
61
59
  Taro.addInterceptor((chain) => item(chain))
62
60
  })
63
61
  }
64
62
  _getResConfig(opt = {}): ServiceInterFace.HttpRequestInfo {
65
63
  return Object.assign({}, DefaultConfig, opt)
66
64
  }
67
65
 
68
66
  _userAreaUpdateListen() {
69
67
  Taro.eventCenter.on(TaroEventType.USER_AREA_UPDATE, (area) => {
70
68
  this.updateApiClientParamsResInfo({
71
69
  area,
72
70
  })
73
71
  })
74
72
  }
75
73
  updateApiClientParamsResInfo(opt = {}) {
76
74
  this.resInfo.apiClientParams = {
77
75
  ...this.resInfo.apiClientParams,
78
76
  ...opt,
79
77
  }
80
78
  }
81
79
 
82
80
  _paramsSign(data) {
83
81
  return Promise.resolve(data)
84
82
  }
85
83
 
86
84
  checkFunctionIdToReturnAppId(functionId) {
87
85
  return JshopxColorFunctionIdList.includes(functionId)
88
86
  ? JSHOPX_COLOR_APPID
89
87
  : this.isPageDomain && PagesColorFunctionIdList.includes(functionId)
90
88
  ? PAGES_COLOR_APPID
91
89
  : SHOP_COLOR_APPID
92
90
  }
93
91
 
94
92
  apiReq(functionId: string, bodyParams = {}, clientParams = {}): Promise<any> {
95
93
  if (
96
94
  functionId === 'receiveShopCoupon' &&
97
95
  ((isH5 && window.isJingGouMiniViewState) || isWxMinAndWxapp)
98
96
  ) {
99
97
  clientParams = Object.assign(
100
98
  {},
101
99
  {
102
100
  loginType: '1',
103
101
  loginWQBiz: WXAPP_BIZ_KEY,
104
102
  },
105
103
  clientParams,
106
104
  )
107
105
  }
108
106
  const apiClientParams = Object.assign(
109
107
  {},
110
108
  this.resInfo.apiClientParams,
111
109
  clientParams,
112
110
  )
113
111
  const getReqData = {
114
112
  functionId: functionId,
115
113
  body: JSON.stringify(bodyParams),
116
114
  t: Date.now(),
117
115
  ...apiClientParams,
118
116
  }
119
117
  console.log(`apiReq:${this.api.apiFunc}`)
120
118
  return this.request(this.api.apiFunc, getReqData, {}, 'GET')
121
119
  .then((res: ServiceInterFace.RequestPromiseRes) => {
122
120
  const { statusCode, data } = res
123
121
  let changeRes: ServiceInterFace.RequestResponseFormatRes = {
124
122
  ok: true,
125
123
  }
126
124
  if (statusCode === 200 && data) {
127
125
  const resCode = Object.prototype.hasOwnProperty.call(res.data, 'code')
128
126
  ? Number(res.data.code)
129
127
  : -1
130
128
  const subCode = Object.prototype.hasOwnProperty.call(
131
129
  res.data,
132
130
  'subCode',
133
131
  )
134
132
  ? Number(res.data.subCode)
135
133
  : -1
136
134
  if (
137
135
  data.success === true ||
138
136
  data.isSuccess ||
139
137
  resCode === 0 ||
140
138
  resCode === 200 ||
141
139
  subCode === 0
142
140
  ) {
143
141
  changeRes = {
144
142
  result: Object.prototype.hasOwnProperty.call(data, 'result')
145
143
  ? data.result
146
144
  : Object.prototype.hasOwnProperty.call(data, 'data')
147
145
  ? data.data
148
146
  : data,
149
147
  code: data.code || 200,
150
148
  ok: true,
151
149
  source: data,
152
150
  }
153
151
  return changeRes
154
152
  } else {
155
153
  changeRes = {
156
154
  ...data,
157
155
  ok: false,
158
156
  statusCode: res.statusCode,
159
157
  }
160
158
  return changeRes
161
159
  }
162
160
  } else {
163
161
  changeRes = {
164
162
  ...data,
165
163
  ok: false,
166
164
  statusCode: res.statusCode,
167
165
  }
168
166
  return changeRes
169
167
  }
170
168
  })
171
169
  .catch((res) => {
172
170
  return {
173
171
  ...res,
174
172
  ok: false,
175
173
  } as ServiceInterFace.RequestResponseFormatRes
176
174
  })
177
175
  }
178
176
 
179
177
  request(
180
178
  url: string,
181
179
  data: string | object,
182
180
  otherOptions = {},
183
181
  method: keyof ServiceInterFace.Method = 'POST',
184
182
  ): RequestTask<any> {
185
183
  const header =
186
184
  method === 'POST'
187
185
  ? this.resInfo.requestHeaderContentType.formDataHeader
188
186
  : {}
189
187
  return Taro.request({
190
188
  ...this.resInfo.requestBaseParam,
191
189
  url,
192
190
  data,
193
191
  method,
194
192
  timeout: this.resInfo.timeOut,
195
193
  header,
196
194
  ...otherOptions,
197
195
  })
198
196
  }
199
197
 
200
198
  async receiveCoupon(param = {}, clientParams) {
201
199
  console.log(process.env.NODE_ENV)
202
200
  if(process.env.NODE_ENV === 'development'){
203
201
  return Promise.reject('本地环境不能领券')
204
202
  }
205
203
  return await this.apiReq(
206
204
  'receiveShopCoupon',
207
205
  {
208
206
  operation: '3',
209
207
  ...param,
210
208
  },
211
209
  clientParams,
212
210
  )
213
211
  }
@@ -1 +0,0 @@
1
- export const HttpStatus = {
2
  SUCCESS: 200,
3
1
  CREATED: 201,
4
2
  ACCEPTED: 202,
5
3
  CLIENT_ERROR: 400,
6
4
  AUTHENTICATE: 401,
7
5
  FORBIDDEN: 403,
8
6
  NOT_FOUND: 404,
9
7
  SERVER_ERROR: 500,
10
8
  BAD_GATEWAY: 502,
11
9
  SERVICE_UNAVAILABLE: 503,
12
10
  GATEWAY_TIMEOUT: 504
13
11
  [HttpStatus.NOT_FOUND]: "请求资源不存在",
14
12
  [HttpStatus.BAD_GATEWAY]: "服务端异常,请稍后重试",
15
13
  [HttpStatus.FORBIDDEN]: "没有权限访问",
16
14
  [HttpStatus.AUTHENTICATE]: "需要鉴权",
17
15
  [HttpStatus.SUCCESS]: "成功"
18
16
  "getPagePreview"
19
17
  "getShopHomeFloorInfo",
20
18
  "getShopCategory",
21
19
  "getShopNavigationCategory",
22
20
  "receiveShopCoupon",
23
21
  "getShopHomePromotionWebPage",
24
22
  "shopGuessYouLike",
25
23
  "addRemind",
26
24
  "cancelRemind",
27
25
  "getVipDetail",
28
26
  "shopDetail",
29
27
  "address_queryAddress",
30
28
  "shopMemberSprintJoinActivity",
31
29
  "shopMemberSprintReceivePrize"
@@ -1 +0,0 @@
1
- import HttpBase from './http'
2
  constructor() {
3
1
  super()
4
2
  }
5
3
 
6
4
  request({url, timeout = 7000, ...otherOptions}): any {
7
5
  const requestTask = super.request({url, timeout, ...otherOptions})
8
6
  const requestTimeoutPromise =
9
7
  new Promise<ServiceInterFace.RequestPromiseRes>((resolve) => {
10
8
  setTimeout(() => {
11
9
  resolve({
12
10
  statusCode: 500,
13
11
  resTimeoutState: true,
14
12
  errMsg: 'request timeout',
15
13
  })
16
14
  }, timeout)
17
15
  })
18
16
  return Promise.race([requestTask, requestTimeoutPromise]).then(
19
17
  (res: ServiceInterFace.RequestPromiseRes) => {
20
18
  if (res && res.statusCode === 500 && res.resTimeoutState) {
21
19
  console.log('request 请求超时 url:' + url)
22
20
  requestTask.abort()
23
21
  }
24
22
  return res
25
23
  }
26
24
  )
27
25
  }
@@ -1 +0,0 @@
1
- import Taro, { RequestTask } from "@tarojs/taro";
2
  jsonHeader = "application/json;charset=utf-8",
3
1
  formDataHeader = "application/x-www-form-urlencoded"
4
2
  constructor() {
5
3
  this._init()
6
4
  }
7
5
  _init(): void {
8
6
  httpInterceptors.forEach((item) => {
9
7
  Taro.addInterceptor((chain) => item(chain))
10
8
  })
11
9
  }
12
10
 
13
11
  get(url: string, data: any = null, otherOptions = {}): Taro.RequestTask<any> {
14
12
  return this.request({url, data, method:"GET", ...otherOptions})
15
13
  }
16
14
 
17
15
  post(
18
16
  url: string,
19
17
  data: any = null,
20
18
  otherOptions = {}
21
19
  ): Taro.RequestTask<any> {
22
20
  return this.request({url, data, method:"POST", ...otherOptions})
23
21
  }
24
22
 
25
23
  request({url, method = "POST", timeout = 7000, ...otherOptions}): RequestTask<any> {
26
24
  const header = {
27
25
  "content-type": method === "POST" ? RequestHeaderContentType.formDataHeader : RequestHeaderContentType.jsonHeader
28
26
  }
29
27
  return Taro.request({
30
28
  url,
31
29
  method,
32
30
  timeout,
33
31
  header,
34
32
  credentials: 'include',
35
33
  ...otherOptions,
36
34
  })
37
35
  }
@@ -1 +0,0 @@
1
- import Taro from '@tarojs/taro'
@@ -1 +0,0 @@
1
- import Taro from '@tarojs/taro'
@@ -1 +0,0 @@
1
- import Http from './http'