@conecli/cone-render 0.10.1-shop3.5 → 0.10.1-shop3.50
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/README.md +1 -1
- package/dist/common/accessibility.h5.ts +1 -0
- package/dist/common/accessibility.ts +0 -0
- package/dist/common/const.ts +1 -1
- package/dist/common/index.h5.ts +1 -1
- package/dist/common/index.jd.ts +1 -1
- package/dist/common/index.ts +1 -1
- package/dist/common/index.weapp.ts +1 -1
- package/dist/common/jdplayerSdk.weapp.tsx +1 -0
- package/dist/common/jssdk.ts +1 -1
- package/dist/common/jssdk.weapp.ts +1 -0
- package/dist/common/pageType.ts +1 -1
- package/dist/common/token/index.h5.ts +1 -1
- package/dist/common/token/token.jd.ts +1 -1
- package/dist/common/wxappApi.ts +1 -1
- package/dist/components/ErrorBoundary.tsx +1 -1
- package/dist/components/base/CommonFloorHead/index.module.scss +126 -111
- package/dist/components/base/CommonFloorHead/index.tsx +1 -1
- package/dist/components/base/CountDown/index.tsx +1 -1
- package/dist/components/base/CustomScrollView/index-back.tsx +1 -0
- package/dist/components/base/CustomScrollView/index.tsx +1 -1
- package/dist/components/base/CustomVideo/index.tsx +1 -1
- package/dist/components/base/CustomVideo/index.weapp.tsx +1 -0
- package/dist/components/base/Dialog/index.module.scss +11 -0
- package/dist/components/base/InOrOutViewObserver/index.weapp.tsx +1 -0
- package/dist/components/base/InViewRender/index.tsx +1 -1
- package/dist/components/base/ItemViewExposureSmart/index.tsx +1 -1
- package/dist/components/base/LazyLayoutLoad/index.tsx +1 -1
- package/dist/components/base/MobileCommonHeader/index.weapp.tsx +1 -0
- package/dist/components/base/NetworkDataError/const.ts +1 -1
- package/dist/components/base/NetworkDataError/index.module.scss +118 -72
- package/dist/components/base/NetworkDataError/index.tsx +1 -1
- package/dist/components/base/Price/Base/index.module.scss +12 -0
- package/dist/components/base/Price/Base/index.tsx +1 -1
- package/dist/components/base/Price/Double/index.module.scss +24 -0
- package/dist/components/base/Price/Double/index.tsx +1 -1
- package/dist/components/debug/DebugLayout/index.module.scss +2 -2
- package/dist/components/floorItem.weapp.tsx +1 -1
- package/dist/interface/common.ts +1 -1
- package/dist/interface/component.ts +1 -1
- package/dist/interface/jumpEventReport.ts +1 -1
- package/dist/jumpEventReport/base.ts +1 -1
- package/dist/jumpEventReport/const.ts +1 -1
- package/dist/jumpEventReport/createReportFloorData.ts +1 -1
- package/dist/jumpEventReport/index.h5.ts +1 -1
- package/dist/jumpEventReport/index.jd.ts +1 -1
- package/dist/jumpEventReport/index.weapp.ts +1 -1
- package/dist/jumpEventReport/jdJumpJdApp.ts +1 -1
- package/dist/jumpEventReport/jumpUrlConfig/base.ts +1 -1
- package/dist/jumpEventReport/logEventConfig.h5.ts +1 -0
- package/dist/jumpEventReport/logEventConfig.ts +1 -1
- package/dist/jumpEventReport/web/report.ts +1 -1
- package/dist/jumpEventReport/web.base.ts +1 -1
- package/dist/jumpEventReport/web.jd.ts +1 -1
- package/dist/jumpEventReport/web.pc.ts +1 -1
- package/dist/jumpEventReport/web.tjm.ts +1 -1
- package/dist/jumpEventReport/web.wxapp.ts +1 -1
- package/dist/language/en_US.json +231 -0
- package/dist/language/zh_CN.json +231 -0
- package/dist/language/zh_HK.json +231 -0
- package/dist/libs/taroAppReport.js +2 -2
- package/dist/modules/ContainerFloorList/index.h5.module.scss +66 -56
- package/dist/modules/ContainerFloorList/index.h5.tsx +1 -1
- package/dist/modules/ContainerFloorList/index.tsx +1 -1
- package/dist/modules/DecorateContainerFloorList/index.weapp.tsx +1 -0
- package/dist/open/api/environment.ts +1 -1
- package/dist/open/api/shopMember.ts +1 -1
- package/dist/open/api/shopMember.weapp.ts +1 -0
- package/dist/open/api/util.ts +1 -1
- package/dist/open/index.ts +1 -1
- package/dist/sass/app.h5.scss +278 -224
- package/dist/service/fetchGateway.ts +1 -1
- package/dist/service/fetchGateway.weapp.ts +1 -0
- package/dist/service/fetchJsonp.weapp.ts +1 -0
- package/dist/service/http/colorSign.ts +1 -1
- package/dist/service/http/const.ts +1 -1
- package/dist/service/http/h5Http.ts +1 -1
- package/dist/service/http/httpInterceptors.weapp.ts +1 -0
- package/dist/service/requestServer.h5.ts +1 -1
- package/dist/service/requestServer.ts +1 -1
- package/dist/service/requestServer.weapp.ts +1 -0
- package/dist/utils/connectNativeJsBridge.ts +1 -1
- package/dist/utils/h5Utils.ts +1 -1
- package/dist/utils/harmonyCallRouter.h5.ts +1 -0
- package/dist/utils/harmonyCallRouter.ts +0 -0
- package/dist/utils/index.h5.ts +1 -1
- package/dist/utils/index.ts +1 -1
- package/dist/utils/index.weapp.ts +1 -1
- package/dist/utils/jumpExtMapUtil.h5.ts +1 -0
- package/dist/utils/jumpExtMapUtil.ts +1 -0
- package/dist/utils/log.ts +1 -0
- package/dist/utils/{sColor.js → sColor.ts} +1 -1
- package/dist/utils/sColor.weapp.ts +1 -0
- package/dist/utils/utils.ts +1 -1
- package/dist/wxapp/common/address_api/address_api_v2.js +1 -0
- package/dist/wxapp/common/user_info.js +1 -1
- package/package.json +160 -141
- package/dist/jumpEventReport/web/wqshop.report.ts +0 -1
- package/dist/utils/priceUtils.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import Taro from '@tarojs/taro';
|
|
2
|
WxappVerifyColorList,
|
|
1
3
|
isLanguageForEn,
|
|
2
4
|
isJdApp,
|
|
3
5
|
showSuccessToast,
|
|
4
6
|
showFailToast,
|
|
5
7
|
isMin,
|
|
6
8
|
cookiesStr: '',
|
|
7
9
|
requestHeaderContentType: {
|
|
8
10
|
jsonHeader: {
|
|
9
11
|
'content-type': 'application/json;charset=utf-8',
|
|
10
12
|
},
|
|
11
13
|
formDataHeader: {
|
|
12
14
|
'content-type': 'application/x-www-form-urlencoded',
|
|
13
15
|
},
|
|
14
16
|
},
|
|
15
17
|
requestBaseParam: {
|
|
16
18
|
data: null,
|
|
17
19
|
header: {
|
|
18
20
|
'content-type': 'application/json;charset=utf-8',
|
|
19
21
|
},
|
|
20
22
|
},
|
|
21
23
|
timeOut: 7000,
|
|
22
24
|
apiClientParams: {
|
|
23
25
|
appid: 'wx_mini_app',
|
|
24
26
|
clientVersion: '11.0.0',
|
|
25
27
|
client: 'wh5',
|
|
26
28
|
area: '1_72_2799_0',
|
|
27
29
|
screen: `${Math.ceil(getSystemInfo?.screenWidth * devicePixelRatio)}*${Math.ceil(
|
|
28
30
|
getSystemInfo?.screenHeight * devicePixelRatio,
|
|
29
31
|
)}`,
|
|
30
32
|
uuid: '-1',
|
|
31
33
|
loginType: '11',
|
|
32
34
|
},
|
|
33
35
|
public addressFetchInfo: {
|
|
34
36
|
reqState: boolean;
|
|
35
37
|
promiseInstance: null | Promise<any>;
|
|
36
38
|
};
|
|
37
39
|
public getPromotionConfig: {
|
|
38
40
|
projectId: null | string | number;
|
|
39
41
|
pageId: null | string | number;
|
|
40
42
|
};
|
|
41
43
|
public resInfo: ServiceInterFace.HttpRequestInfo;
|
|
42
44
|
public api: ServiceInterFace.HttpApi;
|
|
43
45
|
public verifyColorList: string[];
|
|
44
46
|
constructor(opt) {
|
|
45
47
|
this._init();
|
|
46
48
|
this.addressFetchInfo = {
|
|
47
49
|
reqState: false,
|
|
48
50
|
promiseInstance: null,
|
|
49
51
|
};
|
|
50
52
|
this.getPromotionConfig = {
|
|
51
53
|
projectId: null,
|
|
52
54
|
pageId: null,
|
|
53
55
|
};
|
|
54
56
|
this._userAreaUpdateListen();
|
|
55
57
|
this.resInfo = this._getResConfig(opt);
|
|
56
58
|
this.api = api;
|
|
57
59
|
this.verifyColorList = [
|
|
58
60
|
...WxappVerifyColorList,
|
|
59
61
|
];
|
|
60
62
|
}
|
|
61
63
|
_init(): void {
|
|
62
64
|
httpInterceptors.forEach((item) => {
|
|
63
65
|
Taro.addInterceptor((chain) => item(chain));
|
|
64
66
|
});
|
|
65
67
|
}
|
|
66
68
|
_getResConfig(opt = {}): ServiceInterFace.HttpRequestInfo {
|
|
67
69
|
return Object.assign({}, DefaultConfig, opt);
|
|
68
70
|
}
|
|
69
71
|
|
|
70
72
|
_userAreaUpdateListen() {
|
|
71
73
|
Taro.eventCenter.on(TaroEventType.USER_AREA_UPDATE, (areaInfo) => {
|
|
72
74
|
this.updateApiClientParamsResInfo(areaInfo);
|
|
73
75
|
});
|
|
74
76
|
}
|
|
75
77
|
updateApiClientParamsResInfo(opt = {}) {
|
|
76
78
|
const { area, realTimeArea, ...others } = opt;
|
|
77
79
|
this.resInfo.apiClientParams = {
|
|
78
80
|
...this.resInfo.apiClientParams,
|
|
79
81
|
...others,
|
|
80
82
|
};
|
|
81
83
|
area && area !== '' && (this.resInfo.apiClientParams.area = area);
|
|
82
84
|
realTimeArea &&
|
|
83
85
|
realTimeArea !== '' &&
|
|
84
86
|
(this.resInfo.apiClientParams.realTimeArea = realTimeArea);
|
|
85
87
|
}
|
|
86
88
|
|
|
87
89
|
gatewayReq(functionId: string, bodyParams = {}, clientParams = {}): Promise<any> {
|
|
88
90
|
if (functionId === 'receiveShopCoupon') {
|
|
89
91
|
clientParams = Object.assign(
|
|
90
92
|
{},
|
|
91
93
|
{
|
|
92
94
|
loginType: '1',
|
|
93
95
|
loginWQBiz: WXAPP_BIZ_KEY,
|
|
94
96
|
},
|
|
95
97
|
clientParams,
|
|
96
98
|
);
|
|
97
99
|
}
|
|
98
100
|
const apiClientParams = Object.assign({}, this.resInfo.apiClientParams, clientParams);
|
|
99
101
|
const isColorVerify = this.verifyColorList.includes(functionId);
|
|
100
102
|
const getReqData = {
|
|
101
103
|
functionId: functionId,
|
|
102
104
|
body: JSON.stringify(bodyParams),
|
|
103
105
|
t: Date.now(),
|
|
104
106
|
...apiClientParams,
|
|
105
107
|
};
|
|
106
108
|
return http
|
|
107
109
|
.request({
|
|
108
110
|
url: this.api.apiFunc,
|
|
109
111
|
data: getReqData,
|
|
110
112
|
isColorVerify,
|
|
111
113
|
})
|
|
112
114
|
.then((res: ServiceInterFace.RequestPromiseRes) => {
|
|
113
115
|
const { statusCode, data } = res;
|
|
114
116
|
let changeRes: ServiceInterFace.RequestResponseFormatRes = {
|
|
115
117
|
ok: true,
|
|
116
118
|
};
|
|
117
119
|
if (statusCode === 200 && data) {
|
|
118
120
|
const resCode = Object.prototype.hasOwnProperty.call(res.data, 'code')
|
|
119
121
|
? Number(res.data.code)
|
|
120
122
|
: -1;
|
|
121
123
|
const subCode = Object.prototype.hasOwnProperty.call(res.data, 'subCode')
|
|
122
124
|
? Number(res.data.subCode)
|
|
123
125
|
: -1;
|
|
124
126
|
if (
|
|
125
127
|
data.success === true ||
|
|
126
128
|
data.isSuccess ||
|
|
127
129
|
resCode === 0 ||
|
|
128
130
|
resCode === 200 ||
|
|
129
131
|
subCode === 0
|
|
130
132
|
) {
|
|
131
133
|
changeRes = {
|
|
132
134
|
result: Object.prototype.hasOwnProperty.call(data, 'result')
|
|
133
135
|
? data.result
|
|
134
136
|
: Object.prototype.hasOwnProperty.call(data, 'data')
|
|
135
137
|
? data.data
|
|
136
138
|
: data,
|
|
137
139
|
code: data.code || 200,
|
|
138
140
|
ok: true,
|
|
139
141
|
source: data,
|
|
140
142
|
};
|
|
141
143
|
return changeRes;
|
|
142
144
|
} else {
|
|
143
145
|
changeRes = {
|
|
144
146
|
...data,
|
|
145
147
|
ok: false,
|
|
146
148
|
statusCode: res.statusCode,
|
|
147
149
|
};
|
|
148
150
|
return changeRes;
|
|
149
151
|
}
|
|
150
152
|
} else {
|
|
151
153
|
changeRes = {
|
|
152
154
|
...data,
|
|
153
155
|
ok: false,
|
|
154
156
|
statusCode: res.statusCode,
|
|
155
157
|
};
|
|
156
158
|
return changeRes;
|
|
157
159
|
}
|
|
158
160
|
})
|
|
159
161
|
.catch((res) => {
|
|
160
162
|
return {
|
|
161
163
|
...res,
|
|
162
164
|
ok: false,
|
|
163
165
|
} as ServiceInterFace.RequestResponseFormatRes;
|
|
164
166
|
});
|
|
165
167
|
}
|
|
166
168
|
|
|
167
169
|
async receiveCoupon(param = {}, clientParams) {
|
|
168
170
|
console.warn('receiveCoupon 方法在微信京购小程序环境未经验证,请不要使用!');
|
|
169
171
|
return await this.gatewayReq(
|
|
170
172
|
'receiveShopCoupon',
|
|
171
173
|
{
|
|
172
174
|
operation: '3',
|
|
173
175
|
...param,
|
|
174
176
|
},
|
|
175
177
|
{ ...clientParams },
|
|
176
178
|
);
|
|
177
179
|
}
|
|
178
180
|
|
|
179
181
|
getCustomerCenterDispatch(params = {}) {
|
|
180
182
|
return this.gatewayReq('customerCenterDispatch', params, {
|
|
181
183
|
clientVersion: '9.2.0',
|
|
182
184
|
client: 'H5',
|
|
183
185
|
uuid: 88888,
|
|
184
186
|
appid: 'shopmember_m_jd_com',
|
|
185
187
|
});
|
|
186
188
|
}
|
|
187
189
|
|
|
188
190
|
batchAddCart(...args) {
|
|
189
191
|
let skuIds, num, showToast, giftCard;
|
|
190
192
|
if (['number', 'string'].includes(typeof args[0])) {
|
|
191
193
|
[skuIds, num = 1, showToast = true, giftCard = false] = args;
|
|
192
194
|
} else if (typeof args[0] === 'object' && args[0] !== null) {
|
|
193
195
|
const params = args[0];
|
|
194
196
|
skuIds = params.skuIds;
|
|
195
197
|
num = params.num || 1;
|
|
196
198
|
showToast = params.showToast !== undefined ? params.showToast : true;
|
|
197
199
|
giftCard = params.giftCard !== undefined ? params.giftCard : false;
|
|
198
200
|
} else {
|
|
199
201
|
console.error('batchAddCart() Invalid arguments!', args);
|
|
200
202
|
const msg = isLanguageForEn ? 'Please retry later' : '加入购物车失败,请稍后重试!';
|
|
201
203
|
showFailToast({
|
|
202
204
|
title: msg,
|
|
203
205
|
});
|
|
204
206
|
return Promise.resolve({
|
|
205
207
|
ok: false,
|
|
206
208
|
msg,
|
|
207
209
|
});
|
|
208
210
|
}
|
|
209
211
|
const addToWhereText = giftCard ? '购物清单' : '购物车';
|
|
210
212
|
const successMsg = isLanguageForEn ? 'Success' : `加入${addToWhereText}成功`;
|
|
211
213
|
const failMsg = isLanguageForEn
|
|
212
214
|
? 'Please retry later'
|
|
213
215
|
: `加入${addToWhereText}失败,请稍后重试!`;
|
|
214
216
|
if (skuIds) {
|
|
215
217
|
return this._addShopGoodCart(`${skuIds}`, `${num}`, { giftCard })
|
|
216
218
|
.then((res: ServiceInterFace.SkuToCartDataRes) => {
|
|
217
219
|
if (res?.ok) {
|
|
218
220
|
if (showToast && !res?.isOpenApp)
|
|
219
221
|
showSuccessToast({
|
|
220
222
|
title: successMsg,
|
|
221
223
|
});
|
|
222
224
|
} else {
|
|
223
225
|
showToast &&
|
|
224
226
|
showFailToast({
|
|
225
227
|
title: res?.errMsg || failMsg,
|
|
226
228
|
});
|
|
227
229
|
}
|
|
228
230
|
return Promise.resolve(res);
|
|
229
231
|
})
|
|
230
232
|
.catch((e) => {
|
|
231
233
|
console.log('调用加购方法异常=======>', e);
|
|
232
234
|
return Promise.resolve({
|
|
233
235
|
ok: false,
|
|
234
236
|
msg: failMsg,
|
|
235
237
|
});
|
|
236
238
|
});
|
|
237
239
|
} else {
|
|
238
240
|
return Promise.resolve({
|
|
239
241
|
ok: false,
|
|
240
242
|
msg: failMsg,
|
|
241
243
|
});
|
|
242
244
|
}
|
|
243
245
|
}
|
|
244
246
|
|
|
245
247
|
async giftCardAddCart(skuList, num) {
|
|
246
248
|
return this.gatewayReq('giftCardAddCart', {
|
|
247
249
|
skuList,
|
|
248
250
|
num: Number(num),
|
|
249
251
|
});
|
|
250
252
|
}
|
|
251
253
|
|
|
252
254
|
_addShopGoodCart(skuIdsStr, addCardNum = '1', { giftCard }) {
|
|
253
255
|
return new Promise((resolve) => {
|
|
254
256
|
const productIdsArr = skuIdsStr ? `${skuIdsStr}`.split(',') : [];
|
|
255
257
|
if (productIdsArr.length > 0) {
|
|
256
258
|
if (giftCard) {
|
|
257
259
|
this.giftCardAddCart(productIdsArr, addCardNum)
|
|
258
260
|
.then((res) => {
|
|
259
261
|
if (res?.code === '0' && res?.result?.value) {
|
|
260
262
|
resolve({
|
|
261
263
|
ok: true,
|
|
262
264
|
});
|
|
263
265
|
} else {
|
|
264
266
|
resolve({
|
|
265
267
|
ok: false,
|
|
266
268
|
msg: '加购失败,请稍后重试',
|
|
267
269
|
});
|
|
268
270
|
}
|
|
269
271
|
})
|
|
270
272
|
.catch((e) => {
|
|
271
273
|
console.error('礼品卡加车失败: ', e);
|
|
272
274
|
resolve({
|
|
273
275
|
ok: false,
|
|
274
276
|
msg: '加购失败,请稍后重试',
|
|
275
277
|
});
|
|
276
278
|
});
|
|
277
279
|
} else if (isJdApp) {
|
|
278
280
|
console.log('==========>', 'app原生批量加车!,小程序端暂不涉及');
|
|
279
281
|
} else if (isMin) {
|
|
280
282
|
console.log('==========>', '京购批量加车!');
|
|
281
283
|
const productsAddCartList = productIdsArr.map((skuItem) => {
|
|
282
284
|
return {
|
|
283
285
|
skuId: skuItem,
|
|
284
286
|
buyNum: addCardNum,
|
|
285
287
|
};
|
|
286
288
|
});
|
|
287
289
|
global.wxAppBizInstance
|
|
288
290
|
.addCart({ commArr: productsAddCartList })
|
|
289
291
|
.then((res) => {
|
|
290
292
|
console.log('dealCartSuccess: ', res);
|
|
291
293
|
resolve({
|
|
292
294
|
ok: true,
|
|
293
295
|
msg: '已加入购物车!',
|
|
294
296
|
data: res,
|
|
295
297
|
});
|
|
296
298
|
})
|
|
297
299
|
.catch((e) => {
|
|
298
300
|
console.log('京购小程序批量加车失败dealCartFail: ', e);
|
|
299
301
|
resolve({
|
|
300
302
|
ok: false,
|
|
301
303
|
msg: '加购失败,请稍后重试',
|
|
302
304
|
});
|
|
303
305
|
});
|
|
304
306
|
} else {
|
|
305
307
|
console.log('==========>', 'M站批量加车!');
|
|
306
308
|
return this.productAddToCart(skuIdsStr, addCardNum).then((res) => resolve(res));
|
|
307
309
|
}
|
|
308
310
|
} else {
|
|
309
311
|
resolve({
|
|
310
312
|
ok: false,
|
|
311
313
|
msg: '加购sku不能为空',
|
|
312
314
|
});
|
|
313
315
|
}
|
|
314
316
|
});
|
|
315
317
|
}
|
|
316
318
|
|
|
317
319
|
productAddToCart() {
|
|
318
320
|
return Promise.resolve({
|
|
319
321
|
ok: false,
|
|
320
322
|
msg: 'productAddToCart暂不支持小程序',
|
|
321
323
|
});
|
|
322
324
|
}
|
|
323
325
|
bMallGetUserInfo(){
|
|
324
326
|
return Promise.resolve({
|
|
325
327
|
ok: false,
|
|
326
328
|
msg: 'productAddToCart暂不支持小程序',
|
|
327
329
|
});
|
|
328
330
|
}
|
|
329
331
|
bMallGetSkuNumApi(){
|
|
330
332
|
return Promise.resolve({
|
|
331
333
|
ok: false,
|
|
332
334
|
msg: 'productAddToCart暂不支持小程序',
|
|
333
335
|
});
|
|
334
336
|
}
|
|
335
337
|
bMallCartHandle(){
|
|
336
338
|
return Promise.resolve({
|
|
337
339
|
ok: false,
|
|
338
340
|
msg: 'productAddToCart暂不支持小程序',
|
|
339
341
|
});
|
|
340
342
|
}
|