@conecli/cone-render 0.8.19 → 0.8.20-beta.2

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 (183) hide show
  1. package/README.md +7 -1
  2. package/dist/api/index.ts +1 -1
  3. package/dist/assets/icon_blue_info.svg +1 -0
  4. package/dist/common/const.ts +1 -1
  5. package/dist/common/environmentType.ts +1 -0
  6. package/dist/common/index.h5.ts +1 -1
  7. package/dist/common/index.jd.ts +1 -1
  8. package/dist/common/index.ts +1 -1
  9. package/dist/common/index.weapp.ts +1 -1
  10. package/dist/common/isvStorage/index.h5.ts +1 -0
  11. package/dist/common/isvStorage/index.ts +1 -0
  12. package/dist/common/jdplayerSdk.ts +1 -0
  13. package/dist/common/jssdk.ts +1 -0
  14. package/dist/common/pageType.ts +1 -0
  15. package/dist/common/sgmCustomCode.ts +1 -0
  16. package/dist/common/token/const.ts +1 -0
  17. package/dist/common/token/index.h5.ts +1 -0
  18. package/dist/common/token/index.ts +1 -0
  19. package/dist/common/token/token.jd.ts +1 -0
  20. package/dist/common/token/token.ts +1 -0
  21. package/dist/common/token/token.wxapp.ts +1 -0
  22. package/dist/common/wxappApi.jd.ts +1 -0
  23. package/dist/common/wxappApi.ts +1 -1
  24. package/dist/components/ErrorBoundary.tsx +1 -1
  25. package/dist/components/base/CommonFloorHead/index.module.scss +126 -111
  26. package/dist/components/base/CommonFloorHead/index.tsx +1 -1
  27. package/dist/components/base/CountDown/index.module.scss +49 -44
  28. package/dist/components/base/CountDown/index.tsx +1 -1
  29. package/dist/components/base/CustomScrollView/index.jd.tsx +1 -0
  30. package/dist/components/base/CustomScrollView/index.module.scss +7 -0
  31. package/dist/components/base/CustomScrollView/index.tsx +1 -1
  32. package/dist/components/base/CustomVideo/common.ts +1 -0
  33. package/dist/components/base/CustomVideo/const.ts +1 -0
  34. package/dist/components/base/CustomVideo/index.module.scss +40 -64
  35. package/dist/components/base/CustomVideo/index.tsx +1 -1
  36. package/dist/components/base/Dialog/index.module.scss +22 -2
  37. package/dist/components/base/Dialog/index.tsx +1 -1
  38. package/dist/components/base/Exposure/index.h5.tsx +1 -1
  39. package/dist/components/base/ExposureSmart/const.ts +1 -0
  40. package/dist/components/base/ExposureSmart/index.h5.module.scss +30 -6
  41. package/dist/components/base/ExposureSmart/index.h5.tsx +1 -1
  42. package/dist/components/base/ExposureSmart/index.module.scss +20 -9
  43. package/dist/components/base/ExposureSmart/index.tsx +1 -1
  44. package/dist/components/base/ExposureSmart/reporter.tsx +1 -1
  45. package/dist/components/base/InOrOutViewObserver/index.tsx +1 -1
  46. package/dist/components/base/InViewRender/index.tsx +1 -1
  47. package/dist/components/base/InViewRender/index.weapp.tsx +1 -1
  48. package/dist/components/base/ItemViewExposureSmart/index.module.scss +8 -0
  49. package/dist/components/base/ItemViewExposureSmart/index.tsx +1 -0
  50. package/dist/components/base/LazyLayoutLoad/index.tsx +1 -1
  51. package/dist/components/base/LazyLayoutLoad/index.weapp.tsx +1 -1
  52. package/dist/components/base/LazyLoadImage/const.ts +1 -1
  53. package/dist/components/base/LazyLoadImage/index.h5.module.scss +24 -20
  54. package/dist/components/base/LazyLoadImage/index.h5.tsx +1 -1
  55. package/dist/components/base/MobileCommonHeader/index.module.scss +17 -0
  56. package/dist/components/base/MobileCommonHeader/index.tsx +1 -0
  57. package/dist/components/base/NetworkDataError/const.ts +1 -1
  58. package/dist/components/base/NetworkDataError/index.module.scss +128 -69
  59. package/dist/components/base/NetworkDataError/index.tsx +1 -1
  60. package/dist/components/base/Price/{const.ts → Base/const.ts} +0 -0
  61. package/dist/components/base/Price/Base/index.module.scss +148 -0
  62. package/dist/components/base/Price/Base/index.tsx +1 -0
  63. package/dist/components/base/Price/Double/index.module.scss +190 -0
  64. package/dist/components/base/Price/Double/index.tsx +1 -0
  65. package/dist/components/base/Price/index.tsx +1 -1
  66. package/dist/components/base/ShopLeGaoTag/index.h5.module.scss +35 -0
  67. package/dist/components/base/ShopLeGaoTag/index.h5.tsx +1 -0
  68. package/dist/components/base/ShopLeGaoTag/index.module.scss +33 -0
  69. package/dist/components/base/ShopLeGaoTag/index.tsx +1 -0
  70. package/dist/components/base/Skeleton/index.tsx +1 -1
  71. package/dist/components/debug/DebugLayout/index.module.scss +67 -0
  72. package/dist/components/debug/DebugLayout/index.tsx +1 -0
  73. package/dist/components/debug/DebugLayout/utils.ts +1 -0
  74. package/dist/components/decorate/DecorateFloorModule/index.module.scss +32 -2
  75. package/dist/components/decorate/DecorateFloorModule/index.tsx +1 -1
  76. package/dist/components/decorate/EmptyFloorModule/index.tsx +1 -1
  77. package/dist/components/decorate/PlaceHolder/index.tsx +1 -1
  78. package/dist/components/floorItem.jd.tsx +1 -0
  79. package/dist/components/floorItem.tsx +1 -1
  80. package/dist/components/floorItem.weapp.tsx +1 -1
  81. package/dist/components/isv/Floor/index.tsx +1 -1
  82. package/dist/components/remoteFloorItem.tsx +1 -0
  83. package/dist/interface/common.ts +1 -1
  84. package/dist/interface/component.ts +1 -1
  85. package/dist/interface/jumpEventReport.ts +1 -1
  86. package/dist/interface/service.ts +1 -1
  87. package/dist/interface/utils.ts +1 -1
  88. package/dist/jumpEventReport/base.ts +1 -1
  89. package/dist/jumpEventReport/const.ts +1 -1
  90. package/dist/jumpEventReport/createReportFloorData.ts +1 -1
  91. package/dist/jumpEventReport/index.h5.ts +1 -1
  92. package/dist/jumpEventReport/index.jd.ts +1 -1
  93. package/dist/jumpEventReport/index.ts +1 -1
  94. package/dist/jumpEventReport/index.weapp.ts +1 -1
  95. package/dist/jumpEventReport/jdJumpJdApp.ts +1 -1
  96. package/dist/jumpEventReport/jumpUrlConfig/base.ts +1 -1
  97. package/dist/jumpEventReport/logEventConfig.ts +1 -1
  98. package/dist/jumpEventReport/web/report.ts +1 -1
  99. package/dist/jumpEventReport/web.base.ts +1 -1
  100. package/dist/jumpEventReport/web.jd.ts +1 -1
  101. package/dist/jumpEventReport/web.jdb.ts +1 -0
  102. package/dist/jumpEventReport/web.jdjch.ts +1 -0
  103. package/dist/jumpEventReport/web.jxwxapp.ts +1 -0
  104. package/dist/jumpEventReport/web.pc.ts +1 -0
  105. package/dist/jumpEventReport/web.tjapp.ts +1 -0
  106. package/dist/jumpEventReport/web.tjm.ts +1 -0
  107. package/dist/jumpEventReport/web.wxapp.ts +1 -1
  108. package/dist/language/en_US.json +231 -0
  109. package/dist/language/zh_CN.json +231 -0
  110. package/dist/language/zh_HK.json +231 -0
  111. package/dist/libs/taroAppReport.js +2 -2
  112. package/dist/modules/ContainerFloorList/index.h5.module.scss +66 -27
  113. package/dist/modules/ContainerFloorList/index.h5.tsx +1 -1
  114. package/dist/modules/ContainerFloorList/index.tsx +1 -1
  115. package/dist/open/api/device.ts +1 -1
  116. package/dist/open/api/environment.ts +1 -1
  117. package/dist/open/api/index.ts +1 -1
  118. package/dist/open/api/jump/business.ts +1 -0
  119. package/dist/open/api/jump/index.ts +1 -0
  120. package/dist/open/api/jump/minPath.ts +1 -0
  121. package/dist/open/api/jump/side.ts +1 -0
  122. package/dist/open/api/jump/webUrl.ts +1 -0
  123. package/dist/open/api/jump copy.ts +1 -0
  124. package/dist/open/api/moduleUtil.ts +1 -1
  125. package/dist/open/api/request.ts +1 -0
  126. package/dist/open/api/shopMember.ts +1 -0
  127. package/dist/open/api/track.ts +1 -1
  128. package/dist/open/api/userToken.ts +1 -0
  129. package/dist/open/api/util.ts +1 -1
  130. package/dist/open/components/index.ts +1 -1
  131. package/dist/sass/app.h5.scss +294 -212
  132. package/dist/sass/base.scss +195 -137
  133. package/dist/service/bMallConst.ts +1 -0
  134. package/dist/service/bMallConst.weapp.ts +1 -0
  135. package/dist/service/fetchGateway.ts +1 -0
  136. package/dist/service/fetchGateway.weapp.ts +1 -0
  137. package/dist/service/fetchJsonp.ts +1 -0
  138. package/dist/service/http/colorSign.ts +1 -0
  139. package/dist/service/http/colorSign.weapp.ts +1 -0
  140. package/dist/service/http/const.ts +1 -0
  141. package/dist/service/http/h5Http.ts +1 -0
  142. package/dist/service/http/http.ts +1 -0
  143. package/dist/service/http/httpInterceptors.jd.ts +1 -0
  144. package/dist/service/http/httpInterceptors.ts +1 -0
  145. package/dist/service/http/index.h5.ts +1 -0
  146. package/dist/service/http/index.ts +1 -0
  147. package/dist/service/requestServer.h5.ts +1 -0
  148. package/dist/service/requestServer.ts +1 -0
  149. package/dist/service/requestServer.weapp.ts +1 -0
  150. package/dist/utils/connectNativeJsBridge.ts +1 -1
  151. package/dist/utils/connectNativeJsBridge.weapp.ts +1 -1
  152. package/dist/utils/draExceptionAndProfile.ts +1 -1
  153. package/dist/utils/h5Utils.ts +1 -1
  154. package/dist/utils/index.h5.ts +1 -1
  155. package/dist/utils/index.ts +1 -1
  156. package/dist/utils/index.weapp.ts +1 -1
  157. package/dist/utils/intersectionObserver.ts +1 -1
  158. package/dist/utils/jm-common.js +1 -1
  159. package/dist/utils/jumpExtMapUtil.h5.ts +1 -0
  160. package/dist/utils/jumpExtMapUtil.ts +1 -0
  161. package/dist/utils/priceUtils.js +1 -0
  162. package/dist/utils/ready.ts +1 -0
  163. package/dist/utils/sColor.js +1 -0
  164. package/dist/utils/sgmCodeUtils.ts +1 -0
  165. package/dist/utils/taroRenderUtil.ts +1 -0
  166. package/dist/utils/utils.ts +1 -1
  167. package/dist/wxapp/api/helper.js +1 -0
  168. package/dist/wxapp/common/address_api/address_api_v2.js +1 -0
  169. package/dist/wxapp/common/user_info.js +1 -1
  170. package/dist/wxapp/components/launch-app/index.js +1 -0
  171. package/dist/wxapp/components/launch-app/index.json +5 -0
  172. package/dist/wxapp/components/launch-app/index.wxml +0 -0
  173. package/dist/wxapp/components/launch-app/index.wxss +0 -0
  174. package/dist/wxapp/components/subscribe-guider/helper.js +1 -0
  175. package/dist/wxapp/components/subscribe-guider/index.js +1 -0
  176. package/dist/wxapp/components/subscribe-guider/index.json +5 -0
  177. package/dist/wxapp/components/subscribe-guider/index.wxml +0 -0
  178. package/dist/wxapp/components/subscribe-guider/index.wxss +0 -0
  179. package/package.json +145 -114
  180. package/dist/components/base/Price/index.module.scss +0 -136
  181. package/dist/components/base/Skeleton/old.tsx +0 -1
  182. package/dist/customHooks/useDocumentVisibilitychange.ts +0 -1
  183. package/dist/open/api/jump.ts +0 -1
@@ -0,0 +1 @@
1
+ import { dateFormat, getRandom, JSONParse } from '../utils/utils'
2
  const dateStr = dateFormat(new Date(), 'yyyyMMddHHmmss')
1
3
  const randomStr = getRandom(100000, 999999)
2
4
  const callbackName = `${prefix}_CallBack_${dateStr}_${randomStr}`
3
5
  return callbackName
4
6
  return new Promise((resolve, reject) => {
5
7
  if (window.XWebView && window.XWebView.callNative) {
6
8
  const callbackName = getCallBackName('hasBgAudio')
7
9
  window[callbackName] = function(result: any) {
8
10
  const parsedData = JSONParse(result)
9
11
  if (parsedData && parsedData.hasOwnProperty('data')) {
10
12
  resolve(parsedData.data)
11
13
  } else {
12
14
  console.log('hasBgAudio error result:', result)
13
15
  reject({
14
16
  code: -2,
15
17
  message: 'hasBgAudio error: result is not available',
16
18
  })
17
19
  }
18
20
  window[callbackName] = null
19
21
  delete window[callbackName]
20
22
  }
21
23
  let jsonStr = {}
22
24
  window.XWebView.callNative(
23
25
  'JDPlayerJSPlugin',
24
26
  'hasBgAudio',
25
27
  JSON.stringify(jsonStr),
26
28
  callbackName,
27
29
  '',
28
30
  )
29
31
  } else {
30
32
  reject({
31
33
  code: -1,
32
34
  message: 'hasBgAudio error: XWebView.callNative is not defined',
33
35
  })
34
36
  }
35
37
  })
36
38
  return new Promise((resolve, reject) => {
37
39
  if (window.XWebView && window.XWebView.callNative) {
38
40
  const callbackName = getCallBackName('pauseBgAudio')
39
41
  window[callbackName] = function(result: any) {
40
42
  const parsedData = JSONParse(result)
41
43
  if (parsedData && parsedData.hasOwnProperty('data')) {
42
44
  resolve(parsedData.data)
43
45
  } else {
44
46
  console.log('pauseBgAudio error result:', result)
45
47
  reject({
46
48
  code: -2,
47
49
  message: 'pauseBgAudio error: result is not available',
48
50
  })
49
51
  }
50
52
  window[callbackName] = null
51
53
  delete window[callbackName]
52
54
  }
53
55
  let jsonStr = {}
54
56
  window.XWebView.callNative(
55
57
  'JDPlayerJSPlugin',
56
58
  'pauseBgAudio',
57
59
  JSON.stringify(jsonStr),
58
60
  callbackName,
59
61
  '',
60
62
  )
61
63
  } else {
62
64
  reject({
63
65
  code: -1,
64
66
  message: 'pauseBgAudio error: XWebView.callNative is not defined',
65
67
  })
66
68
  }
67
69
  })
68
70
  return new Promise((resolve, reject) => {
69
71
  if (window.XWebView && window.XWebView.callNative) {
70
72
  const callbackName = getCallBackName('resumeBgAudio')
71
73
  window[callbackName] = function(result: any) {
72
74
  const parsedData = JSONParse(result)
73
75
  if (parsedData && parsedData.hasOwnProperty('data')) {
74
76
  resolve(parsedData.data)
75
77
  } else {
76
78
  console.log('resumeBgAudio error result:', result)
77
79
  reject({
78
80
  code: -2,
79
81
  message: 'resumeBgAudio error: result is not available',
80
82
  })
81
83
  }
82
84
  window[callbackName] = null
83
85
  delete window[callbackName]
84
86
  }
85
87
  let jsonStr = {}
86
88
  window.XWebView.callNative(
87
89
  'JDPlayerJSPlugin',
88
90
  'resumeBgAudio',
89
91
  JSON.stringify(jsonStr),
90
92
  callbackName,
91
93
  '',
92
94
  )
93
95
  } else {
94
96
  reject({
95
97
  code: -1,
96
98
  message: 'resumeBgAudio error: XWebView.callNative is not defined',
97
99
  })
98
100
  }
99
101
  })
100
102
  return new Promise((resolve, reject) => {
101
103
  if (window.XWebView && window.XWebView.callNative) {
102
104
  const callbackName = getCallBackName('getWifiVideoAutoPlay')
103
105
  window[callbackName] = function(result: any) {
104
106
  const parsedData = JSONParse(result)
105
107
  if (parsedData && parsedData.hasOwnProperty('data')) {
106
108
  resolve(parsedData.data)
107
109
  } else {
108
110
  console.log('getWifiVideoAutoPlay error result:', result)
109
111
  reject({
110
112
  code: -2,
111
113
  message: 'getWifiVideoAutoPlay error: result is not available',
112
114
  })
113
115
  }
114
116
  window[callbackName] = null
115
117
  delete window[callbackName]
116
118
  }
117
119
  let jsonStr = {}
118
120
  window.XWebView.callNative(
119
121
  'JDPlayerJSPlugin',
120
122
  'actionIsWifiVideoAutoPlay',
121
123
  JSON.stringify(jsonStr),
122
124
  callbackName,
123
125
  '',
124
126
  )
125
127
  } else {
126
128
  reject({
127
129
  code: -1,
128
130
  message:
129
131
  'getWifiVideoAutoPlay error: XWebView.callNative is not defined',
130
132
  })
131
133
  }
132
134
  })
@@ -0,0 +1 @@
1
+ import ready from '../utils/ready'
2
  return new Promise((resolve, reject) => {
1
3
  ready('jmfe', timeout)
2
4
  .then(() => {
3
5
  registerCode(JSSDK_APP_WEBVIEW_CODE)
4
6
  resolve(window['jmfe'])
5
7
  })
6
8
  .catch(() => {
7
9
  console.log('window.jmfe不存在')
8
10
  reject(null)
9
11
  })
10
12
  })
11
13
  if (window['jmfe']) {
12
14
  console.log('registerCode:', code)
13
15
  window['jmfe'].registerCode(code)
14
16
  } else {
15
17
  console.warn('jmfe对象不存在,可能没有提前引入jd-jssdk.js')
16
18
  }
@@ -0,0 +1 @@
1
+ export const getPageType = () => {
2
  return process.env.BUILD_TYPE || '';
1
3
 
2
4
  M_DECORATE = 'm-decorate',
3
5
  M_RENDER_MODULE = 'm-render-module',
4
6
  M_PREVIEW = 'm-preview',
5
7
  M_ISV_PREVIEW = 'm-isv-preview',
6
8
  MARKETING_PREVIEW = 'marketing-preview',
7
9
 
8
10
  APP_VIEW = 'app-view',
9
11
  APP_MEMBER = 'app-member',
10
12
  APP_INTRODUCE = 'app-introduce',
11
13
  APP_PROMOTION = 'app-promotion',
12
14
  APP_CLASSIFY = 'app-classify',
13
15
  APP_PRODUCT = 'app-product',
14
16
  MEMBER_HOME = 'member-home',
15
17
 
16
18
 
17
19
  PC_VIEW = 'pc-view',
18
20
  PC_VIEW1 = 'pc-view1',
19
21
  PC_VIEW2 = 'pc-view2',
20
22
  M_VIEW = 'm-view',
21
23
  M_BSC_VIEW = 'm-bsc-view',
22
24
  SALE_VIEW = 'sale-view',
23
25
  VIP_VIEW = 'vip-view',
24
26
  M_SEARCH = 'm-search',
25
27
  M_INTRODUCE = 'm-introduce',
26
28
 
27
29
  MEMBER_SHOPCARD = 'member-shopcard',
28
30
  M_MEMBER = 'm-member',
29
31
  M_MEMBER_SAM_BIND_CARD = 'm-member-sam-bind-card',
30
32
  M_MEMBER_WATSONS_BIND_CARD = 'm-member-watsons-bind-card',
31
33
  M_SAM_CARD = 'm-sam-card',
32
34
  M_SAM_CENTER = 'm-sam-center',
33
35
  M_WATSONS_CARD = 'm-watsons-card',
34
36
 
35
37
  M_LOTTERY = 'm-lottery',
36
38
  M_COUPON = 'm-coupon',
37
39
  M_WARES = 'm-wares',
38
40
  M_FAST_SHOPPING = 'm-fast-shopping',
39
41
  M_SPECIAL_SECKILL = 'm-special-seckill',
40
42
  WEAPP_SHOP = 'weapp-shop',
41
43
  WEAPP_PROMOTION = 'weapp-promotion',
42
44
  M_VIDEOS = 'm-videos',
@@ -0,0 +1 @@
1
+ export const NO_ENVIRONMENT_AND_PAGE_TYPE_FLAG = 'noType_'
2
  IMAGE_LOAD = 'imageLazyLoadError',
1
3
  PRICE_RENDER = 'priceRenderError',
2
4
  GRAYSCALE = 'grayscale',
3
5
  REMOTEMODULE_DATA = 'remoteModule_interface_dataError',
4
6
  REMOTEMODULE_JS = 'remoteModule_render_jsError',
5
7
  SYSTEMMODULE_JS = 'systemModule_render_jsError',
6
8
  SYSTEMPDCMODULE_DATA = 'systemPdcModule_interface_dataError',
7
9
  SYSTEMPDCMODULE_JS = 'systemPdcModule_render_jsError',
8
10
  FLOORLAZYLOAD_DATA = 'floorLazyLoad_render_dataError',
@@ -0,0 +1 @@
1
+ export const TokenPlatform = {
2
  TYPE_JDAPP: '01',
1
3
  TYPE_WQ: '02',
2
4
  TYPE_M: '03',
3
5
  TYPE_OTHER: '-1',
4
6
  TYPE_ISVDEV: 'isvdev',
5
7
  TYPE_ISV_PACK_SAMPLE: 'isvPackSample',
6
8
  TYPE_ZXDESIGNER: 'zxdesigner',
7
9
  TYPE_JSHOPX: 'jshopx',
8
10
  TYPE_PAGES: 'pages',
@@ -0,0 +1 @@
1
+ import global from '../../common';
2
  return new Promise((resolve, reject) => {
1
3
  let platform: string = getPlatform();
2
4
  if (platform === TokenPlatform.TYPE_JDAPP) {
3
5
  global
4
6
  .jmfeReayPromise()
5
7
  .then(() => {
6
8
  console.log(
7
9
  'loadTokenAsync window.jmfe已经存在:',
8
10
  window?.jmfe,
9
11
  '当前版本',
10
12
  window?.jmfe?.VERSION,
11
13
  );
12
14
  import('./token.jd')
13
15
  .then((data) => {
14
16
  console.log('data:', data);
15
17
  resolve(data);
16
18
  })
17
19
  .catch((err) => {
18
20
  reject(err);
19
21
  });
20
22
  })
21
23
  .catch((e) => {
22
24
  console.log('window.jmfe不存在');
23
25
  reject(e);
24
26
  });
25
27
  }
26
28
  else if (platform === TokenPlatform.TYPE_WQ) {
27
29
  import('./token.wxapp')
28
30
  .then((data) => {
29
31
  console.log('data:', data);
30
32
  resolve(data);
31
33
  })
32
34
  .catch((err) => {
33
35
  reject(err);
34
36
  });
35
37
  } else {
36
38
  import('./token')
37
39
  .then((data) => {
38
40
  console.log('data:', data);
39
41
  resolve(data);
40
42
  })
41
43
  .catch((err) => {
42
44
  reject(err);
43
45
  });
44
46
  }
45
47
  });
46
48
  console.log(e);
47
49
  return {};
48
50
  return new Promise((resolve) => {
49
51
  loadTokenPromise
50
52
  .then((proxy: any) => {
51
53
  if (proxy?.isLogin) {
52
54
  proxy?.isLogin().then((data: boolean) => {
53
55
  resolve(data);
54
56
  });
55
57
  } else {
56
58
  resolve(false);
57
59
  }
58
60
  })
59
61
  .catch((err) => {
60
62
  console.log(err);
61
63
  resolve(false);
62
64
  });
63
65
  });
64
66
  return new Promise((resolve) => {
65
67
  loadTokenPromise
66
68
  .then((proxy: any) => {
67
69
  if (proxy?.getIsvToken) {
68
70
  proxy?.getIsvToken().then((data: string) => {
69
71
  resolve(data);
70
72
  });
71
73
  } else {
72
74
  resolve('');
73
75
  }
74
76
  })
75
77
  .catch((err) => {
76
78
  console.log(err);
77
79
  resolve('');
78
80
  });
79
81
  });
80
82
  return new Promise((resolve) => {
81
83
  loadTokenPromise
82
84
  .then((proxy: any) => {
83
85
  if (proxy?.toLogin) {
84
86
  proxy?.toLogin(options);
85
87
  resolve(true);
86
88
  } else {
87
89
  resolve(false);
88
90
  }
89
91
  })
90
92
  .catch((err) => {
91
93
  console.log(err);
92
94
  resolve(false);
93
95
  });
94
96
  });
95
97
  let platform = TokenPlatform.TYPE_M;
96
98
  if (isApp('jd')) {
97
99
  platform = TokenPlatform.TYPE_JDAPP;
98
100
  }
99
101
  else if (isApp('wx') && isApp('mp')) {
100
102
  platform = TokenPlatform.TYPE_WQ;
101
103
  }
102
104
  return platform;
103
105
  let platform = getPlatform();
104
106
  let source = platform;
105
107
  if (platform === TokenPlatform.TYPE_M || platform === TokenPlatform.TYPE_WQ) {
106
108
  source = TokenPlatform.TYPE_JDAPP;
107
109
  }
108
110
  return source;
109
111
  return window?.page_data?.pageChannel || '';
@@ -0,0 +1 @@
1
+ import { TokenPlatform } from './const'
2
  return new Promise((resolve) => {
1
3
  console.log('isLogin暂未实现')
2
4
  resolve(false)
3
5
  })
4
6
  return new Promise((resolve) => {
5
7
  console.log('getIsvToken暂未实现')
6
8
  resolve('')
7
9
  })
8
10
  return new Promise((resolve) => {
9
11
  console.log('toLogin暂未实现')
10
12
  resolve(false)
11
13
  })
12
14
  return TokenPlatform.TYPE_OTHER
13
15
  return ''
14
16
  return ''
@@ -0,0 +1 @@
1
+ import {isJdAndHarmonyDevice, draBusinessCustomReport} from '../../utils/h5Utils'
2
  draBusinessCustomReport({
1
3
  type,
2
4
  errMsg,
3
5
  data,
4
6
  });
5
7
  return new Promise(resolve => {
6
8
  if (window['jmfe']) {
7
9
  window['jmfe'].isJDAppLogin().then(({ data }) => {
8
10
  if (data === '1') {
9
11
  resolve(true)
10
12
  } else if (data === '0') {
11
13
  resolve(false)
12
14
  }
13
15
  })
14
16
  } else {
15
17
  console.warn('jmfe对象不存在,可能没有提前动态引入jd-jssdk.js')
16
18
  resolve(false)
17
19
  }
18
20
  })
19
21
  return requestIsvToken(window.location.href)
20
22
  if (window['jmfe']) {
21
23
  window['jmfe'].toLogin(options)
22
24
  } else {
23
25
  console.warn('jmfe对象不存在,可能没有提前动态引入jd-jssdk.js')
24
26
  }
25
27
  if (window['jmfe']) {
26
28
  console.log('registerCode:', code)
27
29
  window['jmfe'].registerCode(code)
28
30
  } else {
29
31
  console.warn('jmfe对象不存在,可能没有提前引入jd-jssdk.js')
30
32
  }
31
33
  const plugin = 'JDHybridLoginPlugin';
32
34
  const action = 'requestIsvToken';
33
35
  const params = {url};
34
36
  return jmfe.callNative(plugin, action, params)
35
37
  return new Promise(resolve => {
36
38
  console.log('requestIsvToken:', url)
37
39
  if (window['jmfe']) {
38
40
  const jmfeVersion = window['jmfe'].VERSION || 'unknow';
39
41
  try{
40
42
  (isJdAndHarmonyDevice? requestIsvTokenHarmony(url): window['jmfe'].requestIsvToken(url))
41
43
  .then((result: any) => {
42
44
  console.log('requestIsvToken result:' + JSON.stringify(result))
43
45
  const { status, data } = result
44
46
  if (status === '0') {
45
47
  resolve(data || '')
46
48
  } else {
47
49
  resolve('')
48
50
  }
49
51
  if(!data){
50
52
  exceptionReport({
51
53
  data: {
52
54
  desc: '调用API有返回,但token值为空',
53
55
  jmfeVersion,
54
56
  originResult: result,
55
57
  url,
56
58
  }
57
59
  })
58
60
  }
59
61
  })
60
62
  }catch(error){
61
63
  resolve('')
62
64
  const errorInfo = {
63
65
  name: error?.name,
64
66
  message: error?.message,
65
67
  stack: error?.stack,
66
68
  };
67
69
  exceptionReport({
68
70
  data: {
69
71
  desc: '调用API发生异常',
70
72
  jmfeVersion,
71
73
  error: errorInfo,
72
74
  url
73
75
  }
74
76
  })
75
77
  }
76
78
  } else {
77
79
  resolve('')
78
80
  exceptionReport({
79
81
  data: {
80
82
  desc: '前置依赖window.jmfe不存在',
81
83
  }
82
84
  })
83
85
  }
84
86
  })
@@ -0,0 +1 @@
1
+ import global from '../../common'
2
  return window?.page_data?.pageChannel || ''
1
3
  return new Promise((resolve) => {
2
4
  const channel = getPageChannel()
3
5
  if (
4
6
  channel === PageChannel.TYPE_ISVDEV ||
5
7
  channel === PageChannel.TYPE_ISV_PACK_SAMPLE
6
8
  ) {
7
9
  getIsvToken().then((token) => {
8
10
  console.log('isLogin token:' + token)
9
11
  if (token) {
10
12
  resolve(true)
11
13
  } else {
12
14
  resolve(false)
13
15
  }
14
16
  })
15
17
  } else {
16
18
  global.checkLoginStatus().then(res => {
17
19
  resolve(res)
18
20
  }).catch(() => {
19
21
  resolve(false)
20
22
  })
21
23
  }
22
24
  })
23
25
  let token = ''
24
26
  const result: any = await getIsvTokenInner()
25
27
  if (!result.success) {
26
28
  const channel = getPageChannel()
27
29
  if (channel === PageChannel.TYPE_ISV_PACK_SAMPLE) {
28
30
  console.log('getIsvToken打包校验中获取token失败')
29
31
  if (window['isvTokenFailCallback']) {
30
32
  window['isvTokenFailCallback'](result.error)
31
33
  console.log('浏览器中调用isvTokenFailCallback结束')
32
34
  }
33
35
  }
34
36
  } else {
35
37
  token = result.data
36
38
  }
37
39
  return token
38
40
  return new Promise((resolve) => {
39
41
  fetchGateway(
40
42
  'isvObfuscator',
41
43
  {
42
44
  url: window.location.href,
43
45
  id: 'shopisv',
44
46
  },
45
47
  {},
46
48
  )
47
49
  .then((data: any) => {
48
50
  console.log('fetchGateway isvObfuscator data:' + JSON.stringify(data))
49
51
  if (
50
52
  data?.statusCode == 200 &&
51
53
  data?.data?.errcode === 0 &&
52
54
  data?.data?.token
53
55
  ) {
54
56
  resolve({
55
57
  success: true,
56
58
  data: data?.data?.token,
57
59
  })
58
60
  } else {
59
61
  resolve({
60
62
  success: false,
61
63
  error: data,
62
64
  })
63
65
  }
64
66
  })
65
67
  .catch((error: { message: any }) => {
66
68
  console.log('fetchGateway isvObfuscator error:' + error.message)
67
69
  resolve({
68
70
  success: false,
69
71
  error,
70
72
  })
71
73
  })
72
74
  })
73
75
  const defaultParams = {
74
76
  appid: '100',
75
77
  returnurl: window.location.href,
76
78
  }
77
79
  const params = Object.assign({}, defaultParams, options)
78
80
  params.returnurl = encodeURIComponent(params.returnurl)
79
81
  const loginUrl = `${domain.mobileLogin}/user/login.action?${serialize(
80
82
  params,
81
83
  )}`
82
84
  console.log('loginUrl:', loginUrl)
83
85
  window.location.href = loginUrl
@@ -0,0 +1 @@
1
+ import cookie from '../../utils/jm-cookie'
2
  return new Promise((resolve) => {
1
3
  const token = cookie.get('wq_auth_token')
2
4
  resolve(!!token)
3
5
  })
4
6
  return new Promise((resolve) => {
5
7
  const token = cookie.get('wq_auth_token') || ''
6
8
  resolve(token)
7
9
  })
8
10
  return new Promise((resolve) => {
9
11
  fetchGateway(
10
12
  'isvObfuscator',
11
13
  {
12
14
  url: window.location.href,
13
15
  id: 'shopisv',
14
16
  },
15
17
  { loginType: 1, loginWQBiz: WXAPP_BIZ_KEY },
16
18
  )
17
19
  .then((data: any) => {
18
20
  console.warn('fetchGateway isvObfuscator data:' + JSON.stringify(data))
19
21
  if (
20
22
  data?.statusCode == 200 &&
21
23
  data?.data?.errcode === 0 &&
22
24
  data?.data?.token
23
25
  ) {
24
26
  resolve(data?.data?.token)
25
27
  } else {
26
28
  resolve('')
27
29
  }
28
30
  })
29
31
  .catch((e: { message: any }) => {
30
32
  console.warn('fetchGateway isvObfuscator error:' + e.message)
31
33
  resolve('')
32
34
  })
33
35
  })
34
36
  const returnurl = options?.returnurl || window.location.href
35
37
  pinTokenRedirect(WXAPP_BIZ_KEY, returnurl)
36
38
  const url = `
37
39
  ${domain.wq}/pinbind/pintokenredirect?biz=${biz}&url=${encodeURIComponent(
38
40
  targetUrl,
39
41
  )}`
40
42
  console.log('pinTokenRedirect:', url)
41
43
  window.location.href = url
@@ -0,0 +1 @@
1
+ import * as WXAPP_LOGIN from '../wxapp/common/login/login.js'
@@ -1 +1 @@
1
- import * as WXAPP_LOGIN from '../wxapp/common/login/login.js'
1
+ import * as WXAPP_LOGIN from '../wxapp/common/login/login.js';
2
2
  WXAPP_LOGIN,
3
3
  WXAPP_BIZ,
4
4
  WXAPP_USER_INFO,
5
5
  WXAPP_NAVIGATOR,
6
6
  WXAPP_REPORT_GDT,
7
7
  WXAPP_PARAMS_SIGN,
8
8
  WXAPP_FINGER_REPORT,
9
9
  WXAPP_REPORT_MANAGE,
10
10
  WXAPP_SUBS_GUIDER,
11
11
  WXAPP_ADDRESS_V2_API,
@@ -1 +1 @@
1
- import React from 'react'
2
1
  if(this.props.customErrorIsvFloorModule){
3
2
  return this.props.customErrorIsvFloorModule
4
3
  }
4
+ import React from 'react'
5
5
  getBundleUrl,
6
6
  formatPackResult,
7
7
  getTaroVersion
8
8
  const floorLoadWay = floorData?.floorExtInfo?.floorLoadWay
9
9
  const floorKind = floorData?.floorExtInfo?.floorKind
10
10
  const isRemoteLoadFloor = floorLoadWay === 2
11
11
  const modularPackResult = floorData?.floorExtInfo?.modularPackResult
12
12
  const modularPackResultObj = formatPackResult(modularPackResult)
13
13
  const bundleUrl = getBundleUrl(modularPackResultObj)
14
14
  const taroVersion = getTaroVersion(modularPackResultObj)
15
15
  msg: `店铺h5楼层隐藏不显示。原因:模块js执行异常,楼层过滤。`,
16
16
  floorIdx: floorData?.floorIdx,
17
17
  moduleDesignerType: floorData?.floorExtInfo?.moduleDesignerType,
18
18
  floorLoadWay,
19
19
  floorKind,
20
20
  modularPackResult: {
21
21
  bundleUrl,
22
22
  taroVersion
23
23
  },
24
24
  }
25
25
  const sgmCode = isRemoteLoadFloor ? (floorKind === FLOOR_KIND.PDC_SYSTEM_MODULE ? SgmCustomCode.SYSTEMPDCMODULE_JS : SgmCustomCode.REMOTEMODULE_JS) : SgmCustomCode.SYSTEMMODULE_JS
26
26
  code: getSgmCustomCode(handleSgmCodeTaroVersion(sgmCode)),
27
27
  msg: opt,
28
28
  })
29
29
  if(this.props.customErrorIsvFloorModule){
30
30
  return this.props.customErrorIsvFloorModule
31
31
  }