@conecli/cone-render 0.8.20-shop.64 → 0.8.20-shop.65

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.
package/dist/api/index.ts CHANGED
@@ -1 +1 @@
1
- import { protocol, isBetaServer, isH5 } from '../config/env'
2
1
  ? redirectDomainList.includes(location?.hostname)
3
2
  ? defaultDomain
4
3
  : location?.hostname
5
4
  : defaultDomain
6
5
  mobileLogin: `${protocol}//plogin.m.jd.com`,
7
6
  isLogin: `${domain.mobileLogin}/cgi-bin/ml/islogin`,
7
+ import { protocol, isBetaServer, isH5 } from '../config/env'
8
8
  ? redirectDomainList.includes(location?.hostname)
9
9
  ? defaultDomain
10
10
  : location?.hostname
11
11
  : defaultDomain
12
12
  pcCoupon: `${protocol}//conecli.com`,
13
13
  pcSo: `${protocol}//conecli.com`,
14
14
  mobileLogin: `${protocol}//plogin.m.jd.com`,
15
15
  isLogin: `${domain.mobileLogin}/cgi-bin/ml/islogin`,
@@ -1 +1 @@
1
- import Taro from '@tarojs/taro'
2
1
  urlCookie
3
2
  public config: {
4
3
  [key: string]: any
5
4
  }
6
5
  public lazyContainer: CommonInterFace.lazyContainer
7
6
  this.config = {}
8
7
  pin: cookie.get('pin') || ''
9
8
  })
10
9
  if(!this.checkStatusAndLoginPromise){
11
10
  this.checkStatusAndLoginPromise = new Promise(async (resolve, reject) => {
12
11
  try {
13
12
  const getLoginState = await this.doCheckLoginStateAndForApiCheck()
14
13
  if(getLoginState){
15
14
  resolve(true)
16
15
  }else {
17
16
  this.toLogin(options)
18
17
  reject(false)
19
18
  }
20
19
  }catch (e) {
21
20
  this.toLogin(options)
22
21
  reject(false)
23
22
  }
24
23
  })
25
24
  return this.checkStatusAndLoginPromise
26
25
  }else {
27
26
  return this.checkStatusAndLoginPromise.then(() => {
28
27
  return Promise.resolve(true)
29
28
  }).catch (() => {
30
29
  this.toLogin(options)
31
30
  return Promise.reject(true)
32
31
  })
33
32
  }
34
33
 
35
34
  doCheckLoginStateAndForApiCheck() {
36
35
  if(this.info.loginState){
37
36
  return Promise.resolve(true)
38
37
  }else {
39
38
  return new Promise((resolve, reject) => {
40
39
  if(this.info.isJingGouMiniViewState){
41
40
  const getWqAuthToken = cookie.get("wq_auth_token")
42
41
  if(getWqAuthToken){
43
42
  this.info.loginState = true
44
43
  resolve(true)
45
44
  }else {
46
45
  reject(false)
47
46
  }
48
47
  }else{
49
48
  Taro.request({
50
49
  url: api.isLogin,
51
50
  jsonp:true,
52
51
  timeout: 3000,
53
52
  success: (res) => {
54
53
  const {statusCode,data} = res
55
54
  if (statusCode === 200 && data?.islogin && Number(data.islogin) === 1) {
56
55
  this.info.loginState = true
57
56
  resolve(true);
58
57
  } else {
59
58
  reject(false)
60
59
  }
61
60
  },
62
61
  fail:(err) => {
63
62
  console.log("登录检查异常", err)
64
63
  reject(false)
65
64
  }
66
65
  })
67
66
  }
68
67
  })
69
68
  }
70
69
  }
71
70
 
72
71
  try {
73
72
  const getLoginState = await this.doCheckLoginStateAndForApiCheck()
74
73
  if(getLoginState){
75
74
  const { pin } = await this.getLoginCookie();
76
75
  this.info.userInfo = {
77
76
  pin,
78
77
  encodePin: encodeURIComponent(pin),
79
78
  ptkey: '',
80
79
  }
81
80
  resolve(true)
82
81
  }else {
83
82
  reject(false)
84
83
  }
85
84
  }catch (e) {
86
85
  reject(false)
87
86
  }
88
87
  })
89
88
  if(un_area && un_area.length > 0){
90
89
  this.info.pageInfo.address = un_area
91
90
  this.info.pageInfo.un_area = un_area
92
91
  this.info.pageInfo.addressCommaStr = un_area.replace(/_/g, ',')
93
92
  }
93
+ import Taro from '@tarojs/taro'
94
94
  urlCookie
95
95
  public config: {
96
96
  [key: string]: any
97
97
  }
98
98
  public lazyContainer: CommonInterFace.lazyContainer
99
99
  this.config = {}
100
100
  ...info,
101
101
  pin: cookie.get('pin') || ''
102
102
  })
103
103
  if(!this.checkStatusAndLoginPromise){
104
104
  this.checkStatusAndLoginPromise = new Promise(async (resolve, reject) => {
105
105
  try {
106
106
  const getLoginState = await this.doCheckLoginStateAndForApiCheck()
107
107
  if(getLoginState){
108
108
  resolve(true)
109
109
  }else {
110
110
  this.toLogin(options)
111
111
  reject(false)
112
112
  }
113
113
  }catch (e) {
114
114
  this.toLogin(options)
115
115
  reject(false)
116
116
  }
117
117
  })
118
118
  return this.checkStatusAndLoginPromise
119
119
  }else {
120
120
  return this.checkStatusAndLoginPromise.then(() => {
121
121
  return Promise.resolve(true)
122
122
  }).catch (() => {
123
123
  this.toLogin(options)
124
124
  return Promise.reject(true)
125
125
  })
126
126
  }
127
127
 
128
128
  doCheckLoginStateAndForApiCheck() {
129
129
  if(this.info.loginState){
130
130
  return Promise.resolve(true)
131
131
  }else {
132
132
  return new Promise((resolve, reject) => {
133
133
  if(this.info.isJingGouMiniViewState){
134
134
  const getWqAuthToken = cookie.get("wq_auth_token")
135
135
  if(getWqAuthToken){
136
136
  this.info.loginState = true
137
137
  resolve(true)
138
138
  }else {
139
139
  reject(false)
140
140
  }
141
141
  }else{
142
142
  Taro.request({
143
143
  url: api.isLogin,
144
144
  jsonp:true,
145
145
  timeout: 3000,
146
146
  success: (res) => {
147
147
  const {statusCode,data} = res
148
148
  if (statusCode === 200 && data?.islogin && Number(data.islogin) === 1) {
149
149
  this.info.loginState = true
150
150
  resolve(true);
151
151
  } else {
152
152
  reject(false)
153
153
  }
154
154
  },
155
155
  fail:(err) => {
156
156
  console.log("登录检查异常", err)
157
157
  reject(false)
158
158
  }
159
159
  })
160
160
  }
161
161
  })
162
162
  }
163
163
  }
164
164
 
165
165
  try {
166
166
  const getLoginState = await this.doCheckLoginStateAndForApiCheck()
167
167
  if(getLoginState){
168
168
  const { pin } = await this.getLoginCookie();
169
169
  this.info.userInfo = {
170
170
  pin,
171
171
  encodePin: encodeURIComponent(pin),
172
172
  ptkey: '',
173
173
  }
174
174
  resolve(true)
175
175
  }else {
176
176
  reject(false)
177
177
  }
178
178
  }catch (e) {
179
179
  reject(false)
180
180
  }
181
181
  })
182
182
  if(un_area && un_area.length > 0){
183
183
  this.info.pageInfo.address = un_area
184
184
  this.info.pageInfo.un_area = un_area
185
185
  this.info.pageInfo.addressCommaStr = un_area.replace(/_/g, ',')
186
186
  }
@@ -1 +1 @@
1
- export declare namespace JumpEventReportInterFace {
2
1
  export interface ShopIdsInfo {
3
2
  shopId?: number | string
4
3
  venderId?: number | string
5
4
  logEventInfo?: object
6
5
  type?: string
7
6
  }
8
7
  export interface RouterInfo {
9
8
  params: any
10
9
  pageParamStr?: string
11
10
  [key: string]: any
12
11
  }
13
12
  export interface JumpMiniPath {
14
13
  shop: string
15
14
  shopx: string
16
15
  detail: string
17
16
  searchCoupon: string
18
17
  h5: string
19
18
  jingGouHome: string
20
19
  shopFans: string
21
20
  shopLight: string
22
21
  couponSearch: string
23
22
  shopSearch: string
24
23
  }
25
24
  export interface jumpWebUrl {
26
25
  mshop: string
27
26
  pages: string
28
27
  couponSearch: string
29
28
  shopSecondActivity: string
30
29
  shopLight: string
31
30
  detail: string
32
31
  mobileHome: string
33
32
  rank: string
34
33
  wqShopMember: string
35
34
  wqShopDetail: string
36
35
  wqShopSearch: string
37
36
  shopMember: string
38
37
  shopMemberPointDetail: string
39
38
  shopMemberBenefit: string
40
39
  shopMemberRule: string
41
40
  shopMemberCloseAccount: string
42
41
  shopMemberPointExchange: string
43
42
  shopMemberBonusPurchase: string
44
43
  shopMemberGood: string
45
44
  beanDetail: string
46
45
  totalPromotion: string
47
46
  mLive: string
48
47
  shopHome: string
49
48
  shopIntroduce: string
50
49
  shopSearch: string
51
50
  shopLottery: string
52
51
  shopCoupon: string
53
52
  shopWares: string
54
53
  shopFastShopping: string
55
54
  shopSpeciSeckill: string
56
55
  shopVideos: string
57
56
  shopUseShareOrderUgcContent: string
58
57
  dongDongChat: string
59
58
  samCenter: string
60
59
  samCard: string
61
60
  shopH5MemberCardAPP: string
62
61
  shopH5MemberCardM: string
63
62
  }
64
63
  export interface EventReportConfig {
65
64
  routerInfo: RouterInfo
66
65
  nativeEvent: any
67
66
  }
68
67
  export interface OptEventLogParams {
69
68
  eventId?: string
70
69
  eventParam?: string | object
71
70
  pTag?: string
72
71
  jsonParam?: {
73
72
  [key: string]: any
74
73
  }
75
74
  skuId?: string | number
76
75
  eventLevel?: string
77
76
  exposureState?: boolean
78
77
  otherParams?: object
79
78
  }
80
79
 
81
80
  export interface JumpH5ReportConfig {
82
81
  shopId?: number | string
83
82
  venderId?: number | string
84
83
  sourceValue?: string
85
84
  sourceType?: string
86
85
  }
87
86
  export interface JumpEventReportInit extends EventReportConfig {
88
87
  getConfig(opt): EventReportConfig
89
88
  updateInfo(routerInfo, logPname): void
90
89
  }
91
90
  export interface CouponUrlParams {
92
91
  batchId: number
93
92
  bindType: number
94
93
  startTime?: number
95
94
  endTime?: number
96
95
  quangoufrom?: number
97
96
  sceneId?: number
98
97
  }
99
98
  export interface JdMiniJumpParams {
100
99
  param: string | object
101
100
  sourceValue: string
102
101
  sourceType: string
103
102
  des?: any
104
103
  logEventInfo?: object
105
104
  }
106
105
  export interface LinkMiniParams {
107
106
  param?: {
108
107
  pageType?: string
109
108
  }
110
109
  appId?: string | number
111
110
  path?: string
112
111
  }
113
112
  export interface JdJumpWxappReportConfig {
114
113
  wxApiVersion: string
115
114
  wxApiUrl: string
116
115
  wqReportUrl: string
117
116
  }
117
+ export declare namespace JumpEventReportInterFace {
118
118
  export interface ShopIdsInfo {
119
119
  shopId?: number | string
120
120
  venderId?: number | string
121
121
  logEventInfo?: object
122
122
  type?: string
123
123
  }
124
124
  export interface RouterInfo {
125
125
  params: any
126
126
  pageParamStr?: string
127
127
  [key: string]: any
128
128
  }
129
129
  export interface JumpMiniPath {
130
130
  shop: string
131
131
  shopx: string
132
132
  detail: string
133
133
  searchCoupon: string
134
134
  h5: string
135
135
  jingGouHome: string
136
136
  shopFans: string
137
137
  shopLight: string
138
138
  couponSearch: string
139
139
  shopSearch: string
140
140
  }
141
141
  export interface jumpWebUrl {
142
142
  mshop: string
143
143
  pages: string
144
144
  pcCoupon: string
145
145
  couponSearch: string
146
146
  pcCouponSearch: string
147
147
  shopSecondActivity: string
148
148
  shopLight: string
149
149
  detail: string
150
150
  pcDetail: string
151
151
  mobileHome: string
152
152
  rank: string
153
153
  wqShopMember: string
154
154
  wqShopDetail: string
155
155
  wqShopSearch: string
156
156
  shopMember: string
157
157
  shopMemberPointDetail: string
158
158
  shopMemberBenefit: string
159
159
  shopMemberRule: string
160
160
  shopMemberCloseAccount: string
161
161
  shopMemberPointExchange: string
162
162
  shopMemberBonusPurchase: string
163
163
  shopMemberGood: string
164
164
  beanDetail: string
165
165
  totalPromotion: string
166
166
  mLive: string
167
167
  shopHome: string
168
168
  shopIntroduce: string
169
169
  shopSearch: string
170
170
  shopLottery: string
171
171
  shopCoupon: string
172
172
  shopWares: string
173
173
  shopFastShopping: string
174
174
  shopSpeciSeckill: string
175
175
  shopVideos: string
176
176
  shopUseShareOrderUgcContent: string
177
177
  dongDongChat: string
178
178
  samCenter: string
179
179
  samCard: string
180
180
  shopH5MemberCardAPP: string
181
181
  shopH5MemberCardM: string
182
182
  }
183
183
  export interface EventReportConfig {
184
184
  routerInfo: RouterInfo
185
185
  nativeEvent: any
186
186
  }
187
187
  export interface OptEventLogParams {
188
188
  eventId?: string
189
189
  eventParam?: string | object
190
190
  pTag?: string
191
191
  jsonParam?: {
192
192
  [key: string]: any
193
193
  }
194
194
  skuId?: string | number
195
195
  eventLevel?: string
196
196
  exposureState?: boolean
197
197
  otherParams?: object
198
198
  }
199
199
 
200
200
  export interface JumpH5ReportConfig {
201
201
  shopId?: number | string
202
202
  venderId?: number | string
203
203
  sourceValue?: string
204
204
  sourceType?: string
205
205
  }
206
206
  export interface JumpEventReportInit extends EventReportConfig {
207
207
  getConfig(opt): EventReportConfig
208
208
  updateInfo(routerInfo, logPname): void
209
209
  }
210
210
  export interface CouponUrlParams {
211
211
  batchId: number
212
212
  bindType: number
213
213
  startTime?: number
214
214
  endTime?: number
215
215
  quangoufrom?: number
216
216
  sceneId?: number
217
217
  }
218
218
  export interface JdMiniJumpParams {
219
219
  param: string | object
220
220
  sourceValue: string
221
221
  sourceType: string
222
222
  des?: any
223
223
  logEventInfo?: object
224
224
  }
225
225
  export interface LinkMiniParams {
226
226
  param?: {
227
227
  pageType?: string
228
228
  }
229
229
  appId?: string | number
230
230
  path?: string
231
231
  }
232
232
  export interface JdJumpWxappReportConfig {
233
233
  wxApiVersion: string
234
234
  wxApiUrl: string
235
235
  wqReportUrl: string
236
236
  }
@@ -1 +1 @@
1
- import { ComponentInterFace } from './component'
2
1
  mobileLogin: string
3
2
  isLogin: string
3
+ import { ComponentInterFace } from './component'
4
4
  pcCoupon: string
5
5
  pcSo: string
6
6
  mobileLogin: string
7
7
  isLogin: string