@conecli/cone-render 0.8.20 → 0.8.21-shop-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 (117) hide show
  1. package/dist/api/index.ts +1 -1
  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/common/isvStorage/index.h5.ts +1 -0
  8. package/dist/common/isvStorage/index.ts +1 -0
  9. package/dist/common/token/const.ts +1 -0
  10. package/dist/common/token/index.h5.ts +1 -0
  11. package/dist/common/token/index.ts +1 -0
  12. package/dist/common/token/token.jd.ts +1 -0
  13. package/dist/common/token/token.ts +1 -0
  14. package/dist/common/token/token.wxapp.ts +1 -0
  15. package/dist/components/ErrorBoundary.tsx +1 -1
  16. package/dist/components/base/CommonFloorHead/index.module.scss +1 -1
  17. package/dist/components/base/CommonFloorHead/index.tsx +1 -1
  18. package/dist/components/base/CustomScrollView/index.tsx +1 -1
  19. package/dist/components/base/CustomVideo/const.ts +1 -0
  20. package/dist/components/base/CustomVideo/index.module.scss +40 -64
  21. package/dist/components/base/CustomVideo/index.tsx +1 -1
  22. package/dist/components/base/Dialog/index.module.scss +6 -2
  23. package/dist/components/base/Dialog/index.tsx +1 -1
  24. package/dist/components/base/ExposureSmart/const.ts +1 -0
  25. package/dist/components/base/ExposureSmart/index.h5.module.scss +18 -4
  26. package/dist/components/base/ExposureSmart/index.h5.tsx +1 -1
  27. package/dist/components/base/ExposureSmart/index.module.scss +20 -9
  28. package/dist/components/base/ExposureSmart/index.tsx +1 -1
  29. package/dist/components/base/ExposureSmart/reporter.tsx +1 -1
  30. package/dist/components/base/InOrOutViewObserver/index.tsx +1 -1
  31. package/dist/components/base/InViewRender/index.tsx +1 -1
  32. package/dist/components/base/InViewRender/index.weapp.tsx +1 -1
  33. package/dist/components/base/ItemViewExposureSmart/index.module.scss +8 -0
  34. package/dist/components/base/ItemViewExposureSmart/index.tsx +1 -0
  35. package/dist/components/base/LazyLayoutLoad/index.tsx +1 -1
  36. package/dist/components/base/LazyLoadImage/index.h5.tsx +1 -1
  37. package/dist/components/base/NetworkDataError/const.ts +1 -1
  38. package/dist/components/base/NetworkDataError/index.module.scss +7 -1
  39. package/dist/components/base/NetworkDataError/index.tsx +1 -1
  40. package/dist/components/base/Price/{const.ts → Base/const.ts} +0 -0
  41. package/dist/components/base/Price/Base/index.module.scss +136 -0
  42. package/dist/components/base/Price/Base/index.tsx +1 -0
  43. package/dist/components/base/Price/Double/index.module.scss +158 -0
  44. package/dist/components/base/Price/Double/index.tsx +1 -0
  45. package/dist/components/base/Price/index.tsx +1 -1
  46. package/dist/components/decorate/DecorateFloorModule/index.tsx +1 -1
  47. package/dist/components/decorate/EmptyFloorModule/index.tsx +1 -1
  48. package/dist/components/decorate/PlaceHolder/index.tsx +1 -1
  49. package/dist/components/floorItem.jd.tsx +1 -0
  50. package/dist/components/floorItem.tsx +1 -1
  51. package/dist/components/isv/Floor/index.tsx +1 -1
  52. package/dist/components/remoteFloorItem.tsx +1 -0
  53. package/dist/interface/common.ts +1 -1
  54. package/dist/interface/component.ts +1 -1
  55. package/dist/interface/jumpEventReport.ts +1 -1
  56. package/dist/interface/service.ts +1 -1
  57. package/dist/jumpEventReport/base.ts +1 -1
  58. package/dist/jumpEventReport/const.ts +1 -1
  59. package/dist/jumpEventReport/createReportFloorData.ts +1 -1
  60. package/dist/jumpEventReport/index.h5.ts +1 -1
  61. package/dist/jumpEventReport/index.ts +1 -1
  62. package/dist/jumpEventReport/index.weapp.ts +1 -1
  63. package/dist/jumpEventReport/jdJumpJdApp.ts +1 -1
  64. package/dist/jumpEventReport/jumpUrlConfig/base.ts +1 -1
  65. package/dist/jumpEventReport/logEventConfig.ts +1 -1
  66. package/dist/jumpEventReport/web/report.ts +1 -1
  67. package/dist/jumpEventReport/web.base.ts +1 -1
  68. package/dist/jumpEventReport/web.jd.ts +1 -1
  69. package/dist/jumpEventReport/web.jdb.ts +1 -0
  70. package/dist/jumpEventReport/web.jdjch.ts +1 -0
  71. package/dist/jumpEventReport/web.wxapp.ts +1 -1
  72. package/dist/libs/taroAppReport.js +2 -2
  73. package/dist/modules/ContainerFloorList/index.h5.module.scss +10 -1
  74. package/dist/modules/ContainerFloorList/index.h5.tsx +1 -1
  75. package/dist/modules/ContainerFloorList/index.tsx +1 -1
  76. package/dist/open/api/device.ts +1 -1
  77. package/dist/open/api/index.ts +1 -1
  78. package/dist/open/api/jump/business.ts +1 -0
  79. package/dist/open/api/jump/index.ts +1 -0
  80. package/dist/open/api/jump/minPath.ts +1 -0
  81. package/dist/open/api/jump/side.ts +1 -0
  82. package/dist/open/api/jump/webUrl.ts +1 -0
  83. package/dist/open/api/jump copy.ts +1 -0
  84. package/dist/open/api/moduleUtil.ts +1 -1
  85. package/dist/open/api/request.ts +1 -0
  86. package/dist/open/api/shopMember.ts +1 -0
  87. package/dist/open/api/track.ts +1 -1
  88. package/dist/open/api/userToken.ts +1 -0
  89. package/dist/open/api/util.ts +1 -1
  90. package/dist/open/components/index.ts +1 -1
  91. package/dist/service/bMallConst.ts +1 -0
  92. package/dist/service/bMallConst.weapp.ts +1 -0
  93. package/dist/service/fetchGateway.ts +1 -0
  94. package/dist/service/fetchJsonp.ts +1 -0
  95. package/dist/service/http/colorSign.ts +1 -0
  96. package/dist/service/http/colorSign.weapp.ts +1 -0
  97. package/dist/service/http/const.ts +1 -0
  98. package/dist/service/http/http.ts +1 -0
  99. package/dist/service/http/httpInterceptors.jd.ts +1 -0
  100. package/dist/service/http/httpInterceptors.ts +1 -0
  101. package/dist/service/http/index.ts +1 -0
  102. package/dist/service/requestServer.ts +1 -0
  103. package/dist/utils/connectNativeJsBridge.ts +1 -1
  104. package/dist/utils/connectNativeJsBridge.weapp.ts +1 -1
  105. package/dist/utils/h5Utils.ts +1 -1
  106. package/dist/utils/index.h5.ts +1 -1
  107. package/dist/utils/index.ts +1 -1
  108. package/dist/utils/index.weapp.ts +1 -1
  109. package/dist/utils/intersectionObserver.ts +1 -1
  110. package/dist/utils/jm-common.js +1 -1
  111. package/dist/utils/memberFormatUtils.js +1 -0
  112. package/dist/utils/priceUtils.js +1 -0
  113. package/dist/utils/ready.ts +1 -0
  114. package/dist/utils/utils.ts +1 -1
  115. package/package.json +9 -5
  116. package/dist/components/base/Price/index.module.scss +0 -136
  117. package/dist/open/api/jump.ts +0 -1
@@ -1 +1 @@
1
- import Taro from '@tarojs/taro'
2
1
  public config: object
3
2
  this.config = {}
4
3
  return new Promise((resolve, reject) => {
5
4
  if (typeof jd !== 'undefined' && jd.requestWebCookie) {
6
5
  jd.requestWebCookie({
7
6
  needpin: 1,
8
7
  success: (res) => {
9
8
  console.log(res)
10
9
  const { ticket, pt_pin } = res
11
10
  console.log('requestWebCookie.success', res)
12
11
  this.info.userInfo = {
13
12
  pin: pt_pin,
14
13
  encodePin: encodeURIComponent(pt_pin),
15
14
  ptkey: ticket,
16
15
  }
17
16
  this.miniAppLogInstance &&
18
17
  this.miniAppLogInstance.set({
19
18
  account: pt_pin,
20
19
  })
21
20
  this.info.loginState = true
22
21
  resolve(res)
23
22
  },
24
23
  fail(res) {
25
24
  console.log('requestWebCookie.fail', res)
26
25
  reject(res)
27
26
  },
28
27
  })
29
28
  } else {
30
29
  resolve({
31
30
  pin: '',
32
31
  ptkey: '',
33
32
  mock: true
34
33
  })
35
34
  }
36
35
  })
37
36
  this.checkLoginStatus().then(res => {
38
37
  console.log(
39
38
  'jdLoadCheckStatusAndLogin hasUserLogined.success: ',
40
39
  res,
41
40
  )
42
41
  resolve(res)
43
42
  }).catch(err => {
44
43
  console.warn(
45
44
  'jdLoadCheckStatusAndLogin hasUserLogined.fail: ',
46
45
  err,
47
46
  )
48
47
  this.toLogin().then(res => {
49
48
  resolve(res)
50
49
  }).catch(err => {
51
50
  reject(err)
52
51
  })
53
52
  })
54
53
  return new Promise((resolve,reject) => {
55
54
  if (typeof jd !== 'undefined' && jd.hasUserLogined) {
56
55
  jd.hasUserLogined({
57
56
  success: (res) => {
58
57
  console.log('hasUserLogined.success: ', res)
59
58
  if (res.status === 1) {
60
59
  this.getLoginCookie()
61
60
  resolve(res)
62
61
  }else {
63
62
  reject(res)
64
63
  }
65
64
  },
66
65
  fail: (res) => {
67
66
  console.warn('hasUserLogined.fail: ', res)
68
67
  reject(res)
69
68
  },
70
69
  })
71
70
  } else {
72
71
  reject(false)
73
72
  }
74
73
  })
74
+ import Taro from '@tarojs/taro'
75
75
  public config: object
76
76
  this.config = {}
77
77
  return new Promise((resolve, reject) => {
78
78
  if (typeof jd !== 'undefined' && jd.requestWebCookie) {
79
79
  jd.requestWebCookie({
80
80
  needpin: 1,
81
81
  success: (res) => {
82
82
  console.log(res)
83
83
  const { ticket, pt_pin } = res
84
84
  console.log('requestWebCookie.success', res)
85
85
  this.info.userInfo = {
86
86
  pin: pt_pin,
87
87
  encodePin: encodeURIComponent(pt_pin),
88
88
  ptkey: ticket,
89
89
  }
90
90
  this.miniAppLogInstance &&
91
91
  this.miniAppLogInstance.set({
92
92
  account: pt_pin,
93
93
  })
94
94
  this.info.loginState = true
95
95
  resolve(res)
96
96
  },
97
97
  fail(res) {
98
98
  console.log('requestWebCookie.fail', res)
99
99
  reject(res)
100
100
  },
101
101
  })
102
102
  } else {
103
103
  resolve({
104
104
  pin: '',
105
105
  ptkey: '',
106
106
  mock: true
107
107
  })
108
108
  }
109
109
  })
110
110
  this.checkLoginStatus().then(res => {
111
111
  console.log(
112
112
  'jdLoadCheckStatusAndLogin hasUserLogined.success: ',
113
113
  res,
114
114
  )
115
115
  resolve(res)
116
116
  }).catch(err => {
117
117
  console.warn(
118
118
  'jdLoadCheckStatusAndLogin hasUserLogined.fail: ',
119
119
  err,
120
120
  )
121
121
  this.toLogin().then(res => {
122
122
  resolve(res)
123
123
  }).catch(err => {
124
124
  reject(err)
125
125
  })
126
126
  })
127
127
  return this.checkStatusAndLoginPromise
128
128
  return new Promise((resolve,reject) => {
129
129
  if (typeof jd !== 'undefined' && jd.hasUserLogined) {
130
130
  jd.hasUserLogined({
131
131
  success: (res) => {
132
132
  console.log('hasUserLogined.success: ', res)
133
133
  if (res.status === 1) {
134
134
  this.getLoginCookie()
135
135
  resolve(res)
136
136
  }else {
137
137
  reject(res)
138
138
  }
139
139
  },
140
140
  fail: (res) => {
141
141
  console.warn('hasUserLogined.fail: ', res)
142
142
  reject(res)
143
143
  },
144
144
  })
145
145
  } else {
146
146
  reject(false)
147
147
  }
148
148
  })
@@ -1 +1 @@
1
- import Taro from '@tarojs/taro'
2
1
  public config: {
3
2
  [key: string]: any
4
3
  }
5
4
  public lazyContainer: CommonInterFace.lazyContainer
6
5
  this.config = {}
7
6
 
8
7
  getLoginCookie(updateKey = 'wxapp') {
9
8
  return new Promise((resolve) => {
10
9
  console.log("开始获取更新wxapp中的cookie信息", updateKey)
11
10
  if(this.config.wqCookie && this.config.wqCookieStr && this.config.getWqCookieKey === updateKey){
12
11
  console.log("已有存储wxapp中的cookie信息,直接返回",this.config)
13
12
  resolve({
14
13
  wqCookie: this.config.wqCookie,
15
14
  wqCookieStr: this.config.wqCookieStr,
16
15
  })
17
16
  }else {
18
17
  if (isPublishToWxapp) {
19
18
  const getWxappCookieObj = getTaroStorageKeyValue('cookies') || null
20
19
  if (getWxappCookieObj) {
21
20
  const getCookieObj = getWxappCookieObj['_data']
22
21
  const { wqCookie, wqCookieStr } = getWxAppCookieStr(getCookieObj)
23
22
  const { pin = '', visitkey = '-1', wq_unionid = '', wxapp_openid = '' } = wqCookie
24
23
  this.info.loginState = true
25
24
  this.info.userInfo.wqCookie = wqCookieStr
26
25
  this.info.userInfo.wqVisitkey = visitkey
27
26
  console.log('获取用户完整cookie信息', getCookieObj)
28
27
  const getUserAddress = this.wxAppUserInfoInstance.getAddress()
29
28
  console.log('获取微信用户地址信息', getUserAddress)
30
29
  if (getUserAddress) {
31
30
  this.info.pageInfo.address = getUserAddress?.areaId
32
31
  this.info.pageInfo.addressCommaStr = this.info.pageInfo
33
32
  .address
34
33
  ? this.info.pageInfo.address.replace(/_/g, ',')
35
34
  : ''
36
35
  this.info.pageInfo.un_area = this.info.pageInfo.address
37
36
  Taro.eventCenter.trigger(
38
37
  TaroEventType.USER_AREA_UPDATE,
39
38
  this.info.pageInfo.address,
40
39
  )
41
40
  }
42
41
  if(this.miniAppLogInstance){
43
42
  this.miniAppLogInstance.set({
44
43
  account: pin,
45
44
  unionid: wq_unionid,
46
45
  openid: wxapp_openid,
47
46
  })
48
47
  }
49
48
  this.config.wqCookie = wqCookie
50
49
  this.config.wqCookieStr = wqCookieStr
51
50
  this.config.getWqCookieKey = updateKey
52
51
  console.log("解析wxapp中的cookie信息成功,返回后存储",this.config)
53
52
  resolve({
54
53
  wqCookie,
55
54
  wqCookieStr,
56
55
  })
57
56
  }else {
58
57
  console.log("解析wxapp中的cookie信息异常,返回异常结果",this.config)
59
58
  resolve({
60
59
  wqCookie: false,
61
60
  wqCookieStr: false,
62
61
  })
63
62
  }
64
63
  }else {
65
64
  resolve({
66
65
  wqCookie: false,
67
66
  wqCookieStr: false,
68
67
  })
69
68
  }
70
69
  }
71
70
  })
72
71
  }
73
72
  return this.getLoginCookie()
73
+ import Taro from '@tarojs/taro'
74
74
  public config: {
75
75
  [key: string]: any
76
76
  }
77
77
  public lazyContainer: CommonInterFace.lazyContainer
78
78
  this.config = {}
79
79
 
80
80
  getLoginCookie(updateKey = 'wxapp') {
81
81
  return new Promise((resolve) => {
82
82
  console.log("开始获取更新wxapp中的cookie信息", updateKey)
83
83
  if(this.config.wqCookie && this.config.wqCookieStr && this.config.getWqCookieKey === updateKey){
84
84
  console.log("已有存储wxapp中的cookie信息,直接返回",this.config)
85
85
  resolve({
86
86
  wqCookie: this.config.wqCookie,
87
87
  wqCookieStr: this.config.wqCookieStr,
88
88
  })
89
89
  }else {
90
90
  if (isPublishToWxapp) {
91
91
  const getWxappCookieObj = getTaroStorageKeyValue('cookies') || null
92
92
  if (getWxappCookieObj) {
93
93
  const getCookieObj = getWxappCookieObj['_data']
94
94
  const { wqCookie, wqCookieStr } = getWxAppCookieStr(getCookieObj)
95
95
  const { pin = '', visitkey = '-1', wq_unionid = '', wxapp_openid = '' } = wqCookie
96
96
  this.info.loginState = true
97
97
  this.info.userInfo.wqCookie = wqCookieStr
98
98
  this.info.userInfo.wqVisitkey = visitkey
99
99
  console.log('获取用户完整cookie信息', getCookieObj)
100
100
  const getUserAddress = this.wxAppUserInfoInstance.getAddress()
101
101
  console.log('获取微信用户地址信息', getUserAddress)
102
102
  if (getUserAddress) {
103
103
  this.info.pageInfo.address = getUserAddress?.areaId
104
104
  this.info.pageInfo.addressCommaStr = this.info.pageInfo
105
105
  .address
106
106
  ? this.info.pageInfo.address.replace(/_/g, ',')
107
107
  : ''
108
108
  this.info.pageInfo.un_area = this.info.pageInfo.address
109
109
  Taro.eventCenter.trigger(
110
110
  TaroEventType.USER_AREA_UPDATE,
111
111
  this.info.pageInfo.address,
112
112
  )
113
113
  }
114
114
  if(this.miniAppLogInstance){
115
115
  this.miniAppLogInstance.set({
116
116
  account: pin,
117
117
  unionid: wq_unionid,
118
118
  openid: wxapp_openid,
119
119
  })
120
120
  }
121
121
  this.config.wqCookie = wqCookie
122
122
  this.config.wqCookieStr = wqCookieStr
123
123
  this.config.getWqCookieKey = updateKey
124
124
  console.log("解析wxapp中的cookie信息成功,返回后存储",this.config)
125
125
  resolve({
126
126
  wqCookie,
127
127
  wqCookieStr,
128
128
  })
129
129
  }else {
130
130
  console.log("解析wxapp中的cookie信息异常,返回异常结果",this.config)
131
131
  resolve({
132
132
  wqCookie: false,
133
133
  wqCookieStr: false,
134
134
  })
135
135
  }
136
136
  }else {
137
137
  resolve({
138
138
  wqCookie: false,
139
139
  wqCookieStr: false,
140
140
  })
141
141
  }
142
142
  }
143
143
  })
144
144
  }
145
145
  return this.getLoginCookie()
@@ -1 +1 @@
1
- import Taro from '@tarojs/taro'
2
1
  public config: {
3
2
  [key: string]: any
4
3
  }
5
4
  this.config = {}
6
5
  console.log('=================>', 'updateBusinessDomainAndApi')
7
6
 
8
7
  setTimeout(() => {
9
8
  console.log("微信app登录返回成功后,后台会写入cookie,有延迟,这里延迟500ms去获取最新cookie")
10
9
  this.getLoginCookie(`${Date.now()}`)
11
10
  },500)
12
11
  this.getLoginCookie(`${Date.now()}`)
13
12
  setTimeout(() => {
14
13
  console.log("微信强制登录后,后台会写入cookie,有延迟,这里延迟500ms去获取最新cookie")
15
14
  this.getLoginCookie(`${Date.now()}`)
16
15
  },500)
17
16
  return new Promise((resolve) => {
18
17
  console.log("开始获取更新wxapp中的cookie信息", updateKey)
19
18
  if(this.config.wqCookie && this.config.wqCookieStr && this.config.getWqCookieKey === updateKey){
20
19
  console.log("已有存储wxapp中的cookie信息,直接返回",this.config)
21
20
  resolve({
22
21
  wqCookie: this.config.wqCookie,
23
22
  wqCookieStr: this.config.wqCookieStr,
24
23
  })
25
24
  }else {
26
25
  if (isPublishToWxapp) {
27
26
  const getWxappCookieObj = getTaroStorageKeyValue('cookies') || null
28
27
  if (getWxappCookieObj) {
29
28
  const getCookieObj = getWxappCookieObj['_data']
30
29
  const { wqCookie, wqCookieStr } = getWxAppCookieStr(getCookieObj)
31
30
  const { pin = '', visitkey = '-1', wq_unionid = '', wxapp_openid = '' } = wqCookie
32
31
  this.info.loginState = true
33
32
  this.info.userInfo.wqCookie = wqCookieStr
34
33
  this.info.userInfo.wqVisitkey = visitkey
35
34
  console.log('获取用户完整cookie信息', getCookieObj)
36
35
  const getUserAddress = this.wxAppUserInfoInstance.getAddress()
37
36
  console.log('获取微信用户地址信息', getUserAddress)
38
37
  if (getUserAddress) {
39
38
  this.info.pageInfo.address = getUserAddress?.areaId
40
39
  this.info.pageInfo.addressCommaStr = this.info.pageInfo
41
40
  .address
42
41
  ? this.info.pageInfo.address.replace(/_/g, ',')
43
42
  : ''
44
43
  this.info.pageInfo.un_area = this.info.pageInfo.address
45
44
  Taro.eventCenter.trigger(
46
45
  TaroEventType.USER_AREA_UPDATE,
47
46
  this.info.pageInfo.address,
48
47
  )
49
48
  }
50
49
  if(this.miniAppLogInstance){
51
50
  this.miniAppLogInstance.set({
52
51
  account: pin,
53
52
  unionid: wq_unionid,
54
53
  openid: wxapp_openid,
55
54
  })
56
55
  }
57
56
  this.config.wqCookie = wqCookie
58
57
  this.config.wqCookieStr = wqCookieStr
59
58
  this.config.getWqCookieKey = updateKey
60
59
  console.log("解析wxapp中的cookie信息成功,返回后存储",this.config)
61
60
  resolve({
62
61
  wqCookie,
63
62
  wqCookieStr,
64
63
  })
65
64
  }else {
66
65
  console.log("解析wxapp中的cookie信息异常,返回异常结果",this.config)
67
66
  resolve({
68
67
  wqCookie: false,
69
68
  wqCookieStr: false,
70
69
  })
71
70
  }
72
71
  }else {
73
72
  resolve({
74
73
  wqCookie: false,
75
74
  wqCookieStr: false,
76
75
  })
77
76
  }
78
77
  }
79
78
  })
79
+ import Taro from '@tarojs/taro'
80
80
  public config: {
81
81
  [key: string]: any
82
82
  }
83
83
  this.config = {}
84
84
  console.log('=================>', 'updateBusinessDomainAndApi')
85
85
 
86
86
  setTimeout(() => {
87
87
  console.log("微信app登录返回成功后,后台会写入cookie,有延迟,这里延迟500ms去获取最新cookie")
88
88
  this.getLoginCookie(`${Date.now()}`)
89
89
  },500)
90
90
  this.getLoginCookie(`${Date.now()}`)
91
91
  setTimeout(() => {
92
92
  console.log("微信强制登录后,后台会写入cookie,有延迟,这里延迟500ms去获取最新cookie")
93
93
  this.getLoginCookie(`${Date.now()}`)
94
94
  },500)
95
95
  return new Promise((resolve) => {
96
96
  console.log("开始获取更新wxapp中的cookie信息", updateKey)
97
97
  if(this.config.wqCookie && this.config.wqCookieStr && this.config.getWqCookieKey === updateKey){
98
98
  console.log("已有存储wxapp中的cookie信息,直接返回",this.config)
99
99
  resolve({
100
100
  wqCookie: this.config.wqCookie,
101
101
  wqCookieStr: this.config.wqCookieStr,
102
102
  })
103
103
  }else {
104
104
  if (isPublishToWxapp) {
105
105
  const getWxappCookieObj = getTaroStorageKeyValue('cookies') || null
106
106
  if (getWxappCookieObj) {
107
107
  const getCookieObj = getWxappCookieObj['_data']
108
108
  const { wqCookie, wqCookieStr } = getWxAppCookieStr(getCookieObj)
109
109
  const { pin = '', visitkey = '-1', wq_unionid = '', wxapp_openid = '' } = wqCookie
110
110
  this.info.loginState = true
111
111
  this.info.userInfo.wqCookie = wqCookieStr
112
112
  this.info.userInfo.wqVisitkey = visitkey
113
113
  console.log('获取用户完整cookie信息', getCookieObj)
114
114
  const getUserAddress = this.wxAppUserInfoInstance.getAddress()
115
115
  console.log('获取微信用户地址信息', getUserAddress)
116
116
  if (getUserAddress) {
117
117
  this.info.pageInfo.address = getUserAddress?.areaId
118
118
  this.info.pageInfo.addressCommaStr = this.info.pageInfo
119
119
  .address
120
120
  ? this.info.pageInfo.address.replace(/_/g, ',')
121
121
  : ''
122
122
  this.info.pageInfo.un_area = this.info.pageInfo.address
123
123
  Taro.eventCenter.trigger(
124
124
  TaroEventType.USER_AREA_UPDATE,
125
125
  this.info.pageInfo.address,
126
126
  )
127
127
  }
128
128
  if(this.miniAppLogInstance){
129
129
  this.miniAppLogInstance.set({
130
130
  account: pin,
131
131
  unionid: wq_unionid,
132
132
  openid: wxapp_openid,
133
133
  })
134
134
  }
135
135
  this.config.wqCookie = wqCookie
136
136
  this.config.wqCookieStr = wqCookieStr
137
137
  this.config.getWqCookieKey = updateKey
138
138
  console.log("解析wxapp中的cookie信息成功,返回后存储",this.config)
139
139
  resolve({
140
140
  wqCookie,
141
141
  wqCookieStr,
142
142
  })
143
143
  }else {
144
144
  console.log("解析wxapp中的cookie信息异常,返回异常结果",this.config)
145
145
  resolve({
146
146
  wqCookie: false,
147
147
  wqCookieStr: false,
148
148
  })
149
149
  }
150
150
  }else {
151
151
  resolve({
152
152
  wqCookie: false,
153
153
  wqCookieStr: false,
154
154
  })
155
155
  }
156
156
  }
157
157
  })
@@ -0,0 +1 @@
1
+ const ISV_GLOBAL_CACHE_KEY = '_isvGlobalStorage'
2
  if (!key) {
1
3
  console.error('setItem key cannot be empty or null')
2
4
  return
3
5
  }
4
6
  console.log('setItem key:', key, value)
5
7
  let globalCache = window[ISV_GLOBAL_CACHE_KEY]
6
8
  if (!globalCache) {
7
9
  globalCache = {}
8
10
  window[ISV_GLOBAL_CACHE_KEY] = globalCache
9
11
  }
10
12
  globalCache[key] = value
11
13
  if (!key) {
12
14
  console.error('getItem key cannot be empty or null')
13
15
  return
14
16
  }
15
17
  console.log('getItem key:', key)
16
18
  let globalCache = window[ISV_GLOBAL_CACHE_KEY] || {}
17
19
  const value: any = globalCache[key]
18
20
  return value
19
21
  if (!key) {
20
22
  console.error('removeItem key cannot be empty or null')
21
23
  return
22
24
  }
23
25
  console.log('removeItem key:', key)
24
26
  let globalCache = window[ISV_GLOBAL_CACHE_KEY]
25
27
  if (globalCache) {
26
28
  delete globalCache[key]
27
29
  }
@@ -0,0 +1 @@
1
+ export function setItem(key: string, value: any): void {
2
  console.log('setItem 暂未实现')
1
3
  console.log('getItem 暂未实现')
2
4
  console.log('removeItem 暂未实现')
@@ -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 { isApp } from '../../utils/jm-common'
2
  return new Promise((resolve, reject) => {
1
3
  let platform: string = getPlatform()
2
4
  if (platform === TokenPlatform.TYPE_JDAPP) {
3
5
  ready('jmfe', 3000)
4
6
  .then(() => {
5
7
  console.log('window.jmfe已经存在:', jmfe)
6
8
  import('./token.jd')
7
9
  .then((data) => {
8
10
  console.log('data:', data)
9
11
  resolve(data)
10
12
  })
11
13
  .catch((err) => {
12
14
  reject(err)
13
15
  })
14
16
  })
15
17
  .catch((e) => {
16
18
  console.log('window.jmfe不存在')
17
19
  reject(e)
18
20
  })
19
21
  }
20
22
  else if (platform === TokenPlatform.TYPE_WQ) {
21
23
  import('./token.wxapp')
22
24
  .then((data) => {
23
25
  console.log('data:', data)
24
26
  resolve(data)
25
27
  })
26
28
  .catch((err) => {
27
29
  reject(err)
28
30
  })
29
31
  } else {
30
32
  import('./token')
31
33
  .then((data) => {
32
34
  console.log('data:', data)
33
35
  resolve(data)
34
36
  })
35
37
  .catch((err) => {
36
38
  reject(err)
37
39
  })
38
40
  }
39
41
  })
40
42
  console.log(e);
41
43
  return {}
42
44
  return new Promise((resolve) => {
43
45
  loadTokenPromise
44
46
  .then((proxy: any) => {
45
47
  if (proxy?.isLogin) {
46
48
  proxy?.isLogin().then((data: boolean) => {
47
49
  resolve(data)
48
50
  })
49
51
  } else {
50
52
  resolve(false)
51
53
  }
52
54
  })
53
55
  .catch((err) => {
54
56
  resolve(false)
55
57
  })
56
58
  })
57
59
  return new Promise((resolve) => {
58
60
  loadTokenPromise
59
61
  .then((proxy: any) => {
60
62
  if (proxy?.getIsvToken) {
61
63
  proxy?.getIsvToken().then((data: string) => {
62
64
  resolve(data)
63
65
  })
64
66
  } else {
65
67
  resolve('')
66
68
  }
67
69
  })
68
70
  .catch((err) => {
69
71
  resolve('')
70
72
  })
71
73
  })
72
74
  return new Promise((resolve) => {
73
75
  loadTokenPromise
74
76
  .then((proxy: any) => {
75
77
  if (proxy?.toLogin) {
76
78
  proxy?.toLogin(options)
77
79
  resolve(true)
78
80
  } else {
79
81
  resolve(false)
80
82
  }
81
83
  })
82
84
  .catch((err) => {
83
85
  resolve(false)
84
86
  })
85
87
  })
86
88
  let platform = TokenPlatform.TYPE_M
87
89
  if (isApp('jd')) {
88
90
  platform = TokenPlatform.TYPE_JDAPP
89
91
  }
90
92
  else if (isApp('wx') && isApp('mp')) {
91
93
  platform = TokenPlatform.TYPE_WQ
92
94
  }
93
95
  return platform
94
96
  let platform = getPlatform()
95
97
  let source = platform
96
98
  if (platform === TokenPlatform.TYPE_M || platform === TokenPlatform.TYPE_WQ) {
97
99
  source = TokenPlatform.TYPE_JDAPP
98
100
  }
99
101
  return source
100
102
  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
+ console.log('load token.jd')
2
  return new Promise((resolve) => {
1
3
  if (jmfe) {
2
4
  jmfe.isJDAppLogin().then(({ data }) => {
3
5
  if (data === '1') {
4
6
  resolve(true)
5
7
  } else if (data === '0') {
6
8
  resolve(false)
7
9
  }
8
10
  })
9
11
  } else {
10
12
  console.warn('jmfe对象不存在,可能没有提前动态引入jd-jssdk.js')
11
13
  resolve(false)
12
14
  }
13
15
  })
14
16
  return requestIsvToken(window.location.href)
15
17
  if (jmfe) {
16
18
  jmfe.toLogin(options)
17
19
  } else {
18
20
  console.warn('jmfe对象不存在,可能没有提前动态引入jd-jssdk.js')
19
21
  }
20
22
  if (jmfe) {
21
23
  console.log('registerCode:', code)
22
24
  jmfe.registerCode(code)
23
25
  } else {
24
26
  console.warn('jmfe对象不存在,可能没有提前引入jd-jssdk.js')
25
27
  }
26
28
  return new Promise((resolve) => {
27
29
  console.log('requestIsvToken:', url)
28
30
  if (jmfe) {
29
31
  jmfe
30
32
  .requestIsvToken(url)
31
33
  .then((result: any) => {
32
34
  console.log('requestIsvToken result:' + JSON.stringify(result))
33
35
  const { status, data, msg } = result
34
36
  if (status === '0') {
35
37
  resolve(data || '')
36
38
  } else {
37
39
  resolve('')
38
40
  }
39
41
  })
40
42
  .catch((e: any) => {
41
43
  console.log('requestIsvToken error:' + JSON.stringify(e))
42
44
  resolve('')
43
45
  })
44
46
  } else {
45
47
  console.warn('jmfe对象不存在,可能没有提前引入jd-jssdk.js')
46
48
  resolve('')
47
49
  }
48
50
  })