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