@conecli/cone-render 0.10.1-shop-beta.43 → 0.10.1-shop-beta.45
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/components/base/CustomScrollView/index.tsx +1 -1
- package/dist/jumpEventReport/base.ts +1 -1
- package/dist/jumpEventReport/jdJumpJdApp.ts +1 -1
- package/dist/jumpEventReport/web.wxapp.ts +1 -1
- package/dist/modules/ContainerFloorList/index.h5.tsx +1 -1
- package/dist/open/api/shopMember.ts +1 -1
- package/dist/utils/h5Utils.ts +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import Taro from '@tarojs/taro';
|
|
2
1
|
TaroEventType,
|
|
3
2
|
JUMP_MEMBER_CHANNEL,
|
|
4
3
|
CENTERDISPATCH_JUMPPAGE_VALUE,
|
|
5
4
|
|
|
6
5
|
CARD_BANNER = 'shopMemberCardVenderCardBanner',
|
|
7
6
|
|
|
8
7
|
CARD_NAME = 'shopMemberCardVenderCardName',
|
|
9
8
|
|
|
10
9
|
MEMBERSHIP_LEVEL = 'shopMemberCardMembershipLevel',
|
|
11
10
|
|
|
12
11
|
MEMBERSHIP_RULE_ENTRANCE = 'shopMemberCardMembershipRuleEntrance',
|
|
13
12
|
|
|
14
13
|
MEMBERSHIP_POINT = 'shopMemberCardMembershipPoint',
|
|
15
14
|
return new Promise((resolve) => {
|
|
16
15
|
requestServer
|
|
17
16
|
.getCustomerCenterDispatch(params)
|
|
18
17
|
.then((response) => {
|
|
19
18
|
if (response.result && response.code === '0') {
|
|
20
19
|
resolve(response.result);
|
|
21
20
|
} else {
|
|
22
21
|
resolve({
|
|
23
22
|
jumpPage:
|
|
24
23
|
response.code === '1'
|
|
25
24
|
? CENTERDISPATCH_JUMPPAGE_VALUE.NOT_LOGGED_IN
|
|
26
25
|
: CENTERDISPATCH_JUMPPAGE_VALUE.SYSTEM_ERROR,
|
|
27
26
|
});
|
|
28
27
|
}
|
|
29
28
|
})
|
|
30
29
|
.catch((err) => {
|
|
31
30
|
resolve({ jumpPage: CENTERDISPATCH_JUMPPAGE_VALUE.NETWORK_ERROR });
|
|
32
31
|
console.log('oneKeyJoinMember getcustomerCenterDispatch err', err);
|
|
33
32
|
});
|
|
34
33
|
});
|
|
35
34
|
const currentVenderId = global.info.queryInfo.venderId;
|
|
36
35
|
const currentShopId = global.info.queryInfo.shopId;
|
|
37
36
|
const channel = JUMP_MEMBER_CHANNEL.POP_WEBVIEW;
|
|
38
37
|
const forceMemberCardPopup = options?.forceMemberCardPopup;
|
|
39
38
|
const toastOpt = {
|
|
40
39
|
duration: 3000,
|
|
41
40
|
image:
|
|
42
41
|
'https://img13.360buyimg.com/img/jfs/t1/196933/39/19850/1479/61b059aaEe969b8db/acb37a47b9034333.png',
|
|
43
42
|
};
|
|
44
43
|
if (forceMemberCardPopup) {
|
|
45
44
|
showFailToast({
|
|
46
45
|
title: '临时调试模拟入会成功43',
|
|
47
46
|
});
|
|
48
47
|
return new Promise((resolve, reject) => {
|
|
49
48
|
resolve(true);
|
|
50
49
|
});
|
|
51
50
|
}
|
|
52
51
|
if (isAppHomeForMarketPage) {
|
|
53
52
|
JumpEventReport.jdJumpToBottomTabBrandMember({
|
|
54
53
|
shopId: currentShopId,
|
|
55
54
|
venderId: currentVenderId,
|
|
56
55
|
});
|
|
57
56
|
return;
|
|
58
57
|
}
|
|
59
58
|
const params = {
|
|
60
59
|
venderId: currentVenderId,
|
|
61
60
|
channel,
|
|
62
61
|
queryVersion: isH5AndJdShopView && jdAppVersionStr !== '' ? jdAppVersionStr : '9.2.0',
|
|
63
62
|
};
|
|
64
63
|
const centerDispatchResult = await getCenterDispatchResult(params);
|
|
65
64
|
console.log('oneKeyJoinMember getcustomerCenterDispatch 接口返回值', centerDispatchResult);
|
|
66
65
|
const { jumpPage } = centerDispatchResult;
|
|
67
66
|
if (typeof jumpPage !== 'number') {
|
|
68
67
|
console.log('oneKeyJoinMember getcustomerCenterDispatch 接口返回 jumpPage 值类型异常,非数字');
|
|
69
68
|
showFailToast({
|
|
70
69
|
title: '网络繁忙,稍后再试吧~',
|
|
71
70
|
...toastOpt,
|
|
72
71
|
});
|
|
73
72
|
return;
|
|
74
73
|
}
|
|
75
74
|
const centerDispatchJumpPageValue = Number(jumpPage);
|
|
76
75
|
if (
|
|
77
76
|
centerDispatchJumpPageValue === CENTERDISPATCH_JUMPPAGE_VALUE.NETWORK_ERROR ||
|
|
78
77
|
centerDispatchJumpPageValue === CENTERDISPATCH_JUMPPAGE_VALUE.SYSTEM_ERROR
|
|
79
78
|
) {
|
|
80
79
|
console.log('oneKeyJoinMember getcustomerCenterDispatch 接口网络异常或接口异常', jumpPage);
|
|
81
80
|
showFailToast({
|
|
82
81
|
title: '网络繁忙,稍后再试吧~',
|
|
83
82
|
...toastOpt,
|
|
84
83
|
});
|
|
85
84
|
return;
|
|
86
85
|
}
|
|
87
86
|
if (centerDispatchJumpPageValue === CENTERDISPATCH_JUMPPAGE_VALUE.NOT_LOGGED_IN) {
|
|
88
87
|
console.log('oneKeyJoinMember getcustomerCenterDispatch 接口返回未登录,跳登录页');
|
|
89
88
|
global
|
|
90
89
|
.doLogin()
|
|
91
90
|
.then((res) => {
|
|
92
91
|
console.log('登录成功', res);
|
|
93
92
|
})
|
|
94
93
|
.catch((err) => {
|
|
95
94
|
console.log('登录失败', err);
|
|
96
95
|
});
|
|
97
96
|
return;
|
|
98
97
|
}
|
|
99
98
|
const memberRoleJumpPageValueArr = [
|
|
100
99
|
CENTERDISPATCH_JUMPPAGE_VALUE.MEMBER_CENTER,
|
|
101
100
|
CENTERDISPATCH_JUMPPAGE_VALUE.ISV_MEMBER,
|
|
102
101
|
CENTERDISPATCH_JUMPPAGE_VALUE.JSHOP_ISV_PAGE,
|
|
103
102
|
];
|
|
104
103
|
const isMemberRole = memberRoleJumpPageValueArr.includes(centerDispatchJumpPageValue);
|
|
105
104
|
if (isMemberRole) {
|
|
106
105
|
showFailToast({
|
|
107
106
|
title: '您已是本店会员,无需再次入会',
|
|
108
107
|
...toastOpt,
|
|
109
108
|
});
|
|
110
109
|
return;
|
|
111
110
|
}
|
|
112
111
|
if (!isH5AndJdShopView && !forceMemberCardPopup) {
|
|
113
112
|
JumpEventReport.jdJumpToNewH5MemberCard();
|
|
114
113
|
return;
|
|
115
114
|
}
|
|
116
115
|
const { isDegrade = true, isLowVersion = true } = centerDispatchResult;
|
|
117
116
|
console.log('一键入会,是否已降级', isDegrade);
|
|
118
117
|
console.log('一键入会,是否低版本', isLowVersion);
|
|
119
118
|
if (isDegrade) {
|
|
120
119
|
console.log('一键入会,已降级');
|
|
121
120
|
showFailToast({
|
|
122
121
|
title: '网络繁忙,稍后再试吧~',
|
|
123
122
|
...toastOpt,
|
|
124
123
|
});
|
|
125
124
|
return;
|
|
126
125
|
}
|
|
127
126
|
if (isLowVersion && !forceMemberCardPopup) {
|
|
128
127
|
console.log('一键入会,低版本');
|
|
129
128
|
JumpEventReport.jdJumpToMemberTab();
|
|
130
129
|
return;
|
|
131
130
|
}
|
|
132
131
|
return new Promise((resolve) => {
|
|
133
132
|
const getOpenCardUrlParams = {
|
|
134
133
|
venderId: currentVenderId,
|
|
135
134
|
shopId: currentShopId,
|
|
136
135
|
channel: JUMP_MEMBER_CHANNEL.POP_WEBVIEW,
|
|
137
136
|
device: global.info.sysInfo?.isJdTabletDevice ? 'tablet' : 'all',
|
|
138
137
|
memberSceneType: 'view',
|
|
139
138
|
...options,
|
|
140
139
|
};
|
|
141
140
|
const memberCardurl =
|
|
142
141
|
window?.shopGlobalSwitch?.openNewMemberEntry === 'true'
|
|
143
142
|
? `${JumpWebUrl.memberCard}?${objectToUrlEncode(getOpenCardUrlParams)}`
|
|
144
143
|
: `${JumpWebUrl.shopH5MemberCardAPP}?${objectToUrlEncode(getOpenCardUrlParams)}`;
|
|
145
144
|
const sourceUrl = encodeURIComponent(window.location.href || '');
|
|
146
145
|
let url =
|
|
147
146
|
sourceUrl && sourceUrl !== '' ? `${memberCardurl}&sourceUrl=${sourceUrl}` : memberCardurl;
|
|
148
147
|
if (!url.includes('http')) {
|
|
149
148
|
url = 'https:' + url;
|
|
150
149
|
}
|
|
151
150
|
console.log('openPopWebview url', url);
|
|
152
151
|
nativeOpenPopWebView({
|
|
153
152
|
url,
|
|
154
153
|
});
|
|
155
154
|
Taro.eventCenter.off(TaroEventType.JOIN_MEMBER_SUCCESS);
|
|
156
155
|
Taro.eventCenter.on(TaroEventType.JOIN_MEMBER_SUCCESS, (res) => {
|
|
157
156
|
console.log('TaroEventType.JOIN_MEMBER_SUCCESS res', res);
|
|
158
157
|
const { shopId, venderId } = res;
|
|
159
158
|
if (shopId === currentShopId && venderId === currentVenderId) {
|
|
160
159
|
resolve(true);
|
|
161
160
|
} else {
|
|
162
161
|
console.log(
|
|
163
162
|
'TaroEventType.JOIN_MEMBER_SUCCESS shopId venderId 不匹配,currentShopId, currentVenderId',
|
|
164
163
|
currentShopId,
|
|
165
164
|
currentVenderId,
|
|
166
165
|
);
|
|
167
166
|
resolve(false);
|
|
168
167
|
}
|
|
169
168
|
});
|
|
170
169
|
});
|
|
170
|
+
import Taro from '@tarojs/taro';
|
|
171
171
|
TaroEventType,
|
|
172
172
|
JUMP_MEMBER_CHANNEL,
|
|
173
173
|
CENTERDISPATCH_JUMPPAGE_VALUE,
|
|
174
174
|
|
|
175
175
|
CARD_BANNER = 'shopMemberCardVenderCardBanner',
|
|
176
176
|
|
|
177
177
|
CARD_NAME = 'shopMemberCardVenderCardName',
|
|
178
178
|
|
|
179
179
|
MEMBERSHIP_LEVEL = 'shopMemberCardMembershipLevel',
|
|
180
180
|
|
|
181
181
|
MEMBERSHIP_RULE_ENTRANCE = 'shopMemberCardMembershipRuleEntrance',
|
|
182
182
|
|
|
183
183
|
MEMBERSHIP_POINT = 'shopMemberCardMembershipPoint',
|
|
184
184
|
return new Promise((resolve) => {
|
|
185
185
|
requestServer
|
|
186
186
|
.getCustomerCenterDispatch(params)
|
|
187
187
|
.then((response) => {
|
|
188
188
|
if (response.result && response.code === '0') {
|
|
189
189
|
resolve(response.result);
|
|
190
190
|
} else {
|
|
191
191
|
resolve({
|
|
192
192
|
jumpPage:
|
|
193
193
|
response.code === '1'
|
|
194
194
|
? CENTERDISPATCH_JUMPPAGE_VALUE.NOT_LOGGED_IN
|
|
195
195
|
: CENTERDISPATCH_JUMPPAGE_VALUE.SYSTEM_ERROR,
|
|
196
196
|
});
|
|
197
197
|
}
|
|
198
198
|
})
|
|
199
199
|
.catch((err) => {
|
|
200
200
|
resolve({ jumpPage: CENTERDISPATCH_JUMPPAGE_VALUE.NETWORK_ERROR });
|
|
201
201
|
console.log('oneKeyJoinMember getcustomerCenterDispatch err', err);
|
|
202
202
|
});
|
|
203
203
|
});
|
|
204
204
|
const currentVenderId = global.info.queryInfo.venderId;
|
|
205
205
|
const currentShopId = global.info.queryInfo.shopId;
|
|
206
206
|
const channel = JUMP_MEMBER_CHANNEL.POP_WEBVIEW;
|
|
207
207
|
const forceMemberCardPopup = options?.forceMemberCardPopup;
|
|
208
208
|
const toastOpt = {
|
|
209
209
|
duration: 3000,
|
|
210
210
|
image:
|
|
211
211
|
'https://img13.360buyimg.com/img/jfs/t1/196933/39/19850/1479/61b059aaEe969b8db/acb37a47b9034333.png',
|
|
212
212
|
};
|
|
213
213
|
if (isAppHomeForMarketPage) {
|
|
214
214
|
JumpEventReport.jdJumpToBottomTabBrandMember({
|
|
215
215
|
shopId: currentShopId,
|
|
216
216
|
venderId: currentVenderId,
|
|
217
217
|
});
|
|
218
218
|
return;
|
|
219
219
|
}
|
|
220
220
|
const params = {
|
|
221
221
|
venderId: currentVenderId,
|
|
222
222
|
channel,
|
|
223
223
|
queryVersion: isH5AndJdShopView && jdAppVersionStr !== '' ? jdAppVersionStr : '9.2.0',
|
|
224
224
|
};
|
|
225
225
|
const centerDispatchResult = await getCenterDispatchResult(params);
|
|
226
226
|
console.log('oneKeyJoinMember getcustomerCenterDispatch 接口返回值', centerDispatchResult);
|
|
227
227
|
const { jumpPage } = centerDispatchResult;
|
|
228
228
|
if (typeof jumpPage !== 'number') {
|
|
229
229
|
console.log('oneKeyJoinMember getcustomerCenterDispatch 接口返回 jumpPage 值类型异常,非数字');
|
|
230
230
|
showFailToast({
|
|
231
231
|
title: '网络繁忙,稍后再试吧~',
|
|
232
232
|
...toastOpt,
|
|
233
233
|
});
|
|
234
234
|
return;
|
|
235
235
|
}
|
|
236
236
|
const centerDispatchJumpPageValue = Number(jumpPage);
|
|
237
237
|
if (
|
|
238
238
|
centerDispatchJumpPageValue === CENTERDISPATCH_JUMPPAGE_VALUE.NETWORK_ERROR ||
|
|
239
239
|
centerDispatchJumpPageValue === CENTERDISPATCH_JUMPPAGE_VALUE.SYSTEM_ERROR
|
|
240
240
|
) {
|
|
241
241
|
console.log('oneKeyJoinMember getcustomerCenterDispatch 接口网络异常或接口异常', jumpPage);
|
|
242
242
|
showFailToast({
|
|
243
243
|
title: '网络繁忙,稍后再试吧~',
|
|
244
244
|
...toastOpt,
|
|
245
245
|
});
|
|
246
246
|
return;
|
|
247
247
|
}
|
|
248
248
|
if (centerDispatchJumpPageValue === CENTERDISPATCH_JUMPPAGE_VALUE.NOT_LOGGED_IN) {
|
|
249
249
|
console.log('oneKeyJoinMember getcustomerCenterDispatch 接口返回未登录,跳登录页');
|
|
250
250
|
global
|
|
251
251
|
.doLogin()
|
|
252
252
|
.then((res) => {
|
|
253
253
|
console.log('登录成功', res);
|
|
254
254
|
})
|
|
255
255
|
.catch((err) => {
|
|
256
256
|
console.log('登录失败', err);
|
|
257
257
|
});
|
|
258
258
|
return;
|
|
259
259
|
}
|
|
260
260
|
const memberRoleJumpPageValueArr = [
|
|
261
261
|
CENTERDISPATCH_JUMPPAGE_VALUE.MEMBER_CENTER,
|
|
262
262
|
CENTERDISPATCH_JUMPPAGE_VALUE.ISV_MEMBER,
|
|
263
263
|
CENTERDISPATCH_JUMPPAGE_VALUE.JSHOP_ISV_PAGE,
|
|
264
264
|
];
|
|
265
265
|
const isMemberRole = memberRoleJumpPageValueArr.includes(centerDispatchJumpPageValue);
|
|
266
266
|
if (isMemberRole) {
|
|
267
267
|
showFailToast({
|
|
268
268
|
title: '您已是本店会员,无需再次入会',
|
|
269
269
|
...toastOpt,
|
|
270
270
|
});
|
|
271
271
|
return;
|
|
272
272
|
}
|
|
273
273
|
if (!isH5AndJdShopView && !forceMemberCardPopup) {
|
|
274
274
|
JumpEventReport.jdJumpToNewH5MemberCard();
|
|
275
275
|
return;
|
|
276
276
|
}
|
|
277
277
|
const { isDegrade = true, isLowVersion = true } = centerDispatchResult;
|
|
278
278
|
console.log('一键入会,是否已降级', isDegrade);
|
|
279
279
|
console.log('一键入会,是否低版本', isLowVersion);
|
|
280
280
|
if (isDegrade) {
|
|
281
281
|
console.log('一键入会,已降级');
|
|
282
282
|
showFailToast({
|
|
283
283
|
title: '网络繁忙,稍后再试吧~',
|
|
284
284
|
...toastOpt,
|
|
285
285
|
});
|
|
286
286
|
return;
|
|
287
287
|
}
|
|
288
288
|
if (isLowVersion && !forceMemberCardPopup) {
|
|
289
289
|
console.log('一键入会,低版本');
|
|
290
290
|
JumpEventReport.jdJumpToMemberTab();
|
|
291
291
|
return;
|
|
292
292
|
}
|
|
293
293
|
return new Promise((resolve) => {
|
|
294
294
|
const getOpenCardUrlParams = {
|
|
295
295
|
venderId: currentVenderId,
|
|
296
296
|
shopId: currentShopId,
|
|
297
297
|
channel: JUMP_MEMBER_CHANNEL.POP_WEBVIEW,
|
|
298
298
|
device: global.info.sysInfo?.isJdTabletDevice ? 'tablet' : 'all',
|
|
299
299
|
memberSceneType: 'view',
|
|
300
300
|
...options,
|
|
301
301
|
};
|
|
302
302
|
const memberCardurl =
|
|
303
303
|
window?.shopGlobalSwitch?.openNewMemberEntry === 'true'
|
|
304
304
|
? `${JumpWebUrl.memberCard}?${objectToUrlEncode(getOpenCardUrlParams)}`
|
|
305
305
|
: `${JumpWebUrl.shopH5MemberCardAPP}?${objectToUrlEncode(getOpenCardUrlParams)}`;
|
|
306
306
|
const sourceUrl = encodeURIComponent(window.location.href || '');
|
|
307
307
|
let url =
|
|
308
308
|
sourceUrl && sourceUrl !== '' ? `${memberCardurl}&sourceUrl=${sourceUrl}` : memberCardurl;
|
|
309
309
|
if (!url.includes('http')) {
|
|
310
310
|
url = 'https:' + url;
|
|
311
311
|
}
|
|
312
312
|
console.log('openPopWebview url', url);
|
|
313
313
|
nativeOpenPopWebView({
|
|
314
314
|
url,
|
|
315
315
|
});
|
|
316
316
|
Taro.eventCenter.off(TaroEventType.JOIN_MEMBER_SUCCESS);
|
|
317
317
|
Taro.eventCenter.on(TaroEventType.JOIN_MEMBER_SUCCESS, (res) => {
|
|
318
318
|
console.log('TaroEventType.JOIN_MEMBER_SUCCESS res', res);
|
|
319
319
|
const { shopId, venderId } = res;
|
|
320
320
|
if (shopId === currentShopId && venderId === currentVenderId) {
|
|
321
321
|
resolve(true);
|
|
322
322
|
} else {
|
|
323
323
|
console.log(
|
|
324
324
|
'TaroEventType.JOIN_MEMBER_SUCCESS shopId venderId 不匹配,currentShopId, currentVenderId',
|
|
325
325
|
currentShopId,
|
|
326
326
|
currentVenderId,
|
|
327
327
|
);
|
|
328
328
|
resolve(false);
|
|
329
329
|
}
|
|
330
330
|
});
|
|
331
331
|
});
|