@conecli/cone-render 0.8.19 → 0.8.21

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 { JumpEventReport, JumpEventReportPromise } from '../../jumpEventReport'
1
+ import { JumpEventReport, JumpEventReportPromise } from '../../jumpEventReport'
2
2
  jdJumpToShopHome: (info: object) => void
3
3
  jdJumpToProduct: (skuId: string | null, logEventInfo: object) => void
4
4
  jdJumpConfigUrl: (detail: object, logEventInfo: object) => void
5
5
  jdJumpToShopMemberInfo: (logEventInfo: object) => void
6
6
  jdJumpToShopMemberPointDetail: (logEventInfo: object) => void
7
7
  jdJumpToShopMemberBenefit: (logEventInfo: object) => void
8
8
  jdJumpToShopMemberRule: (logEventInfo: object) => void
9
9
  jdJumpToShopMemberCloseAccount: (
10
10
  venderType: number,
11
11
  logEventInfo: object,
12
12
  ) => void
13
13
  jdJumpToShopMemberPointExchange: (
14
14
  venderType: number,
15
15
  channel: number,
16
16
  levelZeroMenuUrl: string,
17
17
  logEventInfo: object,
18
18
  ) => void
19
19
  jdJumpToShopMemberBonusPurchase: (
20
20
  customerLevel: number,
21
21
  logEventInfo: object,
22
22
  ) => void
23
23
  jdJumpToShopMemberGood: (customerLevel: number, logEventInfo: object) => void
24
24
  jdJumpToBeanDetail: (logEventInfo: object) => void
25
25
  jdJumpToMyRedEnvelope: (logEventInfo: object) => void
26
26
  jdJumpToMyCoupon: (logEventInfo: object) => void
27
27
  jdJumpToShopHome: () => {},
28
28
  jdJumpToProduct: () => {},
29
29
  jdJumpConfigUrl: () => {},
30
30
  jdJumpToShopMemberInfo: () => {},
31
31
  jdJumpToShopMemberPointDetail: () => {},
32
32
  jdJumpToShopMemberBenefit: () => {},
33
33
  jdJumpToShopMemberRule: () => {},
34
34
  jdJumpToShopMemberCloseAccount: () => {},
35
35
  jdJumpToShopMemberPointExchange: () => {},
36
36
  jdJumpToShopMemberBonusPurchase: () => {},
37
37
  jdJumpToShopMemberGood: () => {},
38
38
  jdJumpToBeanDetail: () => {},
39
39
  jdJumpToMyRedEnvelope: () => {},
40
40
  jdJumpToMyCoupon: () => {},
41
41
  jdJumpToWeb: (url: string, logEventInfo: object) => void
42
42
  jdJumpToAppMiniProgram: (path: string, logEventInfo: object) => void
43
43
  jdJumpToShopLight: (detail: object) => void
44
44
  jdJumpToAppMiniProgram: () => {},
45
45
  jdJumpToShopLight: () => {},
46
46
  jdJumpToWeb: () => {},
47
47
  [key: string]: any
48
48
  [key: string]: any
49
49
  const {
50
50
  jdJumpToTabAllProduct,
51
51
  jdJumpToShopHome,
52
52
  jdJumpToProduct,
53
53
  jdJumpToShopSearch,
54
54
  jdJumpConfigUrl,
55
55
  jdJumpToShopMemberInfo,
56
56
  jdJumpToShopMemberPointDetail,
57
57
  jdJumpToShopMemberBenefit,
58
58
  jdJumpToShopMemberRule,
59
59
  jdJumpToShopMemberCloseAccount,
60
60
  jdJumpToShopMemberPointExchange,
61
61
  jdJumpToShopMemberBonusPurchase,
62
62
  jdJumpToShopMemberGood,
63
63
  jdJumpToBeanDetail,
64
64
  jdJumpToMyRedEnvelope,
65
65
  jdJumpToMyCoupon,
66
66
  } = JumpEventReport
67
67
  const {
68
68
  jdJumpToAppMiniProgram,
69
69
  jdJumpToShopLight,
70
70
  jdJumpToWeb,
71
71
  jumpWebUrl,
72
72
  jumpMiniPath,
73
73
  } = JumpEventReport
74
74
  Object.assign(business, {
75
75
  jdJumpToShopHome: jdJumpToShopHome.bind(JumpEventReport),
76
76
  jdJumpToProduct: jdJumpToProduct.bind(JumpEventReport),
77
77
  jdJumpConfigUrl: jdJumpConfigUrl.bind(JumpEventReport),
78
78
  jdJumpToShopMemberInfo: jdJumpToShopMemberInfo.bind(JumpEventReport),
79
79
  jdJumpToShopMemberPointDetail:
80
80
  jdJumpToShopMemberPointDetail.bind(JumpEventReport),
81
81
  jdJumpToShopMemberBenefit: jdJumpToShopMemberBenefit.bind(JumpEventReport),
82
82
  jdJumpToShopMemberRule: jdJumpToShopMemberRule.bind(JumpEventReport),
83
83
  jdJumpToShopMemberCloseAccount:
84
84
  jdJumpToShopMemberCloseAccount.bind(JumpEventReport),
85
85
  jdJumpToShopMemberPointExchange:
86
86
  jdJumpToShopMemberPointExchange.bind(JumpEventReport),
87
87
  jdJumpToShopMemberBonusPurchase:
88
88
  jdJumpToShopMemberBonusPurchase.bind(JumpEventReport),
89
89
  jdJumpToShopMemberGood: jdJumpToShopMemberGood.bind(JumpEventReport),
90
90
  jdJumpToBeanDetail: jdJumpToBeanDetail.bind(JumpEventReport),
91
91
  jdJumpToMyRedEnvelope: jdJumpToMyRedEnvelope.bind(JumpEventReport),
92
92
  jdJumpToMyCoupon: jdJumpToMyCoupon.bind(JumpEventReport),
93
93
  })
94
94
  Object.assign(side, {
95
95
  jdJumpToAppMiniProgram: jdJumpToAppMiniProgram.bind(JumpEventReport),
96
96
  jdJumpToShopLight: jdJumpToShopLight.bind(JumpEventReport),
97
97
  jdJumpToWeb: jdJumpToWeb.bind(JumpEventReport),
98
98
  jumpWebUrl,
99
99
  jumpMiniPath,
100
100
  })
101
101
  Object.assign(webUrl, jumpWebUrl)
102
102
  Object.assign(minPath, jumpMiniPath)
@@ -0,0 +1 @@
1
+ export enum ShopMemberCardNodeType {
2
 
1
3
  CARD_BANNER = "shopMemberCardVenderCardBanner",
2
4
 
3
5
  CARD_NAME = "shopMemberCardVenderCardName",
4
6
 
5
7
  MEMBERSHIP_LEVEL = "shopMemberCardMembershipLevel",
6
8
 
7
9
  MEMBERSHIP_RULE_ENTRANCE = "shopMemberCardMembershipRuleEntrance",
8
10
 
9
11
  MEMBERSHIP_POINT = "shopMemberCardMembershipPoint"
@@ -0,0 +1 @@
1
+ export const HttpStatus = {
2
  SUCCESS: 200,
1
3
  CREATED: 201,
2
4
  ACCEPTED: 202,
3
5
  CLIENT_ERROR: 400,
4
6
  AUTHENTICATE: 401,
5
7
  FORBIDDEN: 403,
6
8
  NOT_FOUND: 404,
7
9
  SERVER_ERROR: 500,
8
10
  BAD_GATEWAY: 502,
9
11
  SERVICE_UNAVAILABLE: 503,
10
12
  GATEWAY_TIMEOUT: 504
11
13
  [HttpStatus.NOT_FOUND]: "请求资源不存在",
12
14
  [HttpStatus.BAD_GATEWAY]: "服务端异常,请稍后重试",
13
15
  [HttpStatus.FORBIDDEN]: "没有权限访问",
14
16
  [HttpStatus.AUTHENTICATE]: "需要鉴权",
15
17
  [HttpStatus.SUCCESS]: "成功"
@@ -0,0 +1 @@
1
+ import Taro, { RequestTask } from "@tarojs/taro";
2
  jsonHeader = "application/json;charset=utf-8",
1
3
  formDataHeader = "application/x-www-form-urlencoded"
2
4
  constructor() {
3
5
  this._init()
4
6
  }
5
7
  _init(): void {
6
8
  httpInterceptors.forEach((item) => {
7
9
  Taro.addInterceptor((chain) => item(chain))
8
10
  })
9
11
  }
10
12
 
11
13
  get(url: string, data: any = null, otherOptions = {}): Taro.RequestTask<any> {
12
14
  return this.request({url, data, method:"GET", ...otherOptions})
13
15
  }
14
16
 
15
17
  post(
16
18
  url: string,
17
19
  data: any = null,
18
20
  otherOptions = {}
19
21
  ): Taro.RequestTask<any> {
20
22
  return this.request({url, data, method:"POST", ...otherOptions})
21
23
  }
22
24
 
23
25
  request({url, method = "POST", timeout = 7000, ...otherOptions}): RequestTask<any> {
24
26
  const header = {
25
27
  "content-type": method === "POST" ? RequestHeaderContentType.formDataHeader : RequestHeaderContentType.jsonHeader
26
28
  }
27
29
  const requestTask = Taro.request({
28
30
  url,
29
31
  method,
30
32
  timeout,
31
33
  header,
32
34
  credentials: 'include',
33
35
  ...otherOptions,
34
36
  })
35
37
  const requestTimeoutPromise =
36
38
  new Promise<ServiceInterFace.RequestPromiseRes>((resolve) => {
37
39
  setTimeout(() => {
38
40
  resolve({
39
41
  statusCode: 500,
40
42
  resTimeoutState: true,
41
43
  errMsg: 'request timeout',
42
44
  })
43
45
  }, timeout)
44
46
  })
45
47
  return Promise.race([requestTask, requestTimeoutPromise]).then(
46
48
  (res: any) => {
47
49
  if (res && res.statusCode === 500 && res.resTimeoutState) {
48
50
  console.log('request 请求超时 url:' + url)
49
51
  requestTask.abort && requestTask.abort()
50
52
  }
51
53
  return res
52
54
  }
53
55
  )
54
56
  }
@@ -0,0 +1 @@
1
+ import Taro from '@tarojs/taro'
@@ -0,0 +1 @@
1
+ import Taro from '@tarojs/taro'
@@ -0,0 +1 @@
1
+ import Http from './http'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@conecli/cone-render",
3
- "version": "0.8.19",
3
+ "version": "0.8.21",
4
4
  "private": false,
5
5
  "files": [
6
6
  "dist/"