@conecli/cone-render 0.8.20-shop.231 → 0.8.20-shop.232
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
import global from '../common';
|
|
2
1
|
BUSINESS_TYPE,
|
|
3
2
|
SHOP_MENU_ID_TYPE,
|
|
4
3
|
SHOP_MENU_ID_NAME,
|
|
5
4
|
SECTION_HOME_TAB_TYPE,
|
|
6
5
|
SECTION_HOME_TAB_NAME_TYPE,
|
|
7
6
|
routerInfo: {
|
|
8
7
|
params: {},
|
|
9
8
|
},
|
|
10
9
|
nativeEvent: null,
|
|
11
10
|
jumpConfig: {
|
|
12
11
|
venderId: null,
|
|
13
12
|
shopId: null,
|
|
14
13
|
sourceValue: '',
|
|
15
14
|
sourceType: 'M-H5',
|
|
16
15
|
activityType: 'shopx',
|
|
17
16
|
moduleId: 'none',
|
|
18
17
|
entrance: 'none',
|
|
19
18
|
},
|
|
20
19
|
logPageParamStr: '',
|
|
21
20
|
public logPageId: string;
|
|
22
21
|
public jumpConfig: JumpEventReportInterFace.JumpH5ReportConfig;
|
|
23
22
|
getConfig(opt) {
|
|
24
23
|
return Object.assign(this, {}, defaultConfig, opt);
|
|
25
24
|
}
|
|
26
25
|
updateInfo(routerInfo, logPname = LogPnameInfo.HOME, pageId = LogPageIdInfo.APP) {
|
|
27
26
|
this.routerInfo = routerInfo;
|
|
28
27
|
this.logPname = logPname;
|
|
29
28
|
this.jumpConfig = Object.assign(
|
|
30
29
|
{},
|
|
31
30
|
this.jumpConfig,
|
|
32
31
|
filterUrlQueryData(routerInfo?.params || {}),
|
|
33
32
|
);
|
|
34
33
|
this.logPageId = pageId;
|
|
35
34
|
}
|
|
36
35
|
|
|
37
36
|
jdJumpToProduct(skuIds, logEventInfo) {
|
|
38
37
|
skuIds = skuIds.toString().trim();
|
|
39
38
|
const getSkuId = skuIds.indexOf(',') !== -1 ? skuIds.split(',')[0] : skuIds;
|
|
40
39
|
let url = `${this.jumpWebUrl.pcDetail}${getSkuId}.html`;
|
|
41
40
|
this.jdNavigateToNative(url, logEventInfo);
|
|
42
41
|
}
|
|
43
42
|
|
|
44
43
|
jdJumpSkuInfoToProduct(skuInfo: any = {}, logEventInfo) {
|
|
45
44
|
const getSkuId = skuInfo?.skuId;
|
|
46
45
|
this.jdJumpToProduct(getSkuId, logEventInfo);
|
|
47
46
|
}
|
|
48
47
|
|
|
49
48
|
jdJumpToShopHome(shopInfo: JumpEventReportInterFace.ShopIdsInfo = {}) {
|
|
50
49
|
const currentShopInfo = {
|
|
51
50
|
shopId: global.info.queryInfo.shopId,
|
|
52
51
|
venderId: global.info.queryInfo.venderId,
|
|
53
52
|
};
|
|
54
53
|
const restParams =
|
|
55
54
|
(shopInfo?.shopId && shopInfo.shopId !== currentShopInfo.shopId) ||
|
|
56
55
|
(shopInfo?.venderId && shopInfo.venderId !== currentShopInfo.venderId)
|
|
57
56
|
? {}
|
|
58
57
|
: currentShopInfo;
|
|
59
58
|
const getInfo = Object.assign({}, restParams, shopInfo);
|
|
60
59
|
let url = `${this.jumpWebUrl.pages}/index-${getInfo.shopId}.html`;
|
|
61
60
|
this.jdNavigateToNative(url, {
|
|
62
61
|
...getInfo,
|
|
63
62
|
});
|
|
64
63
|
}
|
|
65
64
|
|
|
66
65
|
getPcSearchUrl = (searchInfo: { categoryId: string; keyWord: string }) => {
|
|
67
66
|
const { categoryId, keyWord } = searchInfo;
|
|
68
67
|
const flag = document.querySelector('#JSHOP_CHANNEL_FLAG')?.value;
|
|
69
68
|
const appId =
|
|
70
69
|
document.querySelector('#J_AppId')?.value ||
|
|
71
70
|
document.querySelector('#pageInstance_appId')?.value;
|
|
72
71
|
const searchUrl = categoryId
|
|
73
72
|
? this.jumpWebUrl.pages + '/view_search-' + appId + '-' + categoryId + '-99-1-20-1.html'
|
|
74
73
|
: `${this.jumpWebUrl.pages}/view_search-${appId}.html?keyword=${keyWord}`;
|
|
75
74
|
return flag === 'yao'
|
|
76
75
|
? this.jumpWebUrl.pages + '/view_shop_search-' + appId + '.html'
|
|
77
76
|
: searchUrl;
|
|
78
77
|
};
|
|
79
78
|
|
|
80
79
|
jdJumpToShopSearch(shopInfo) {
|
|
81
80
|
const getInfo = Object.assign(
|
|
82
81
|
{},
|
|
83
82
|
{
|
|
84
83
|
shopId: global.info.queryInfo.shopId,
|
|
85
84
|
venderId: global.info.queryInfo.venderId,
|
|
86
85
|
},
|
|
87
86
|
shopInfo,
|
|
88
87
|
);
|
|
89
88
|
const { categoryId = '', keyWord = '' } = getInfo;
|
|
90
89
|
const url = `${this.getPcSearchUrl({ categoryId, keyWord })}`;
|
|
91
90
|
this.jdJumpToWeb(url, getInfo);
|
|
92
91
|
}
|
|
93
92
|
|
|
94
93
|
jdJumpToTabAllProduct(shopId, venderId, logEventInfo = {}) {
|
|
95
94
|
console.log('web.base.ts - jdJumpToTabAllProduct');
|
|
96
95
|
if (typeof shopId === 'undefined') shopId = global.info.queryInfo.shopId;
|
|
97
96
|
if (typeof venderId === 'undefined') venderId = global.info.queryInfo.venderId;
|
|
98
97
|
const url = `${this.jumpWebUrl.pages}/index-${shopId}.html`;
|
|
99
98
|
this.jdJumpToWeb(url, logEventInfo);
|
|
100
99
|
}
|
|
101
100
|
|
|
102
101
|
jdJumpToCouponSearchProductList(couponId, logEventInfo = {}) {
|
|
103
102
|
const url = `${this.jumpWebUrl.couponSearch}?couponbatch=${couponId}&sceneval=2`;
|
|
104
103
|
this.jdJumpToWeb(url, logEventInfo);
|
|
105
104
|
}
|
|
105
|
+
import global from '../common';
|
|
106
106
|
BUSINESS_TYPE,
|
|
107
107
|
SHOP_MENU_ID_TYPE,
|
|
108
108
|
SHOP_MENU_ID_NAME,
|
|
109
109
|
SECTION_HOME_TAB_TYPE,
|
|
110
110
|
SECTION_HOME_TAB_NAME_TYPE,
|
|
111
111
|
routerInfo: {
|
|
112
112
|
params: {},
|
|
113
113
|
},
|
|
114
114
|
nativeEvent: null,
|
|
115
115
|
jumpConfig: {
|
|
116
116
|
venderId: null,
|
|
117
117
|
shopId: null,
|
|
118
118
|
sourceValue: '',
|
|
119
119
|
sourceType: 'M-H5',
|
|
120
120
|
activityType: 'shopx',
|
|
121
121
|
moduleId: 'none',
|
|
122
122
|
entrance: 'none',
|
|
123
123
|
},
|
|
124
124
|
logPageParamStr: '',
|
|
125
125
|
public logPageId: string;
|
|
126
126
|
public jumpConfig: JumpEventReportInterFace.JumpH5ReportConfig;
|
|
127
127
|
getConfig(opt) {
|
|
128
128
|
return Object.assign(this, {}, defaultConfig, opt);
|
|
129
129
|
}
|
|
130
130
|
updateInfo(routerInfo, logPname = LogPnameInfo.HOME, pageId = LogPageIdInfo.APP) {
|
|
131
131
|
this.routerInfo = routerInfo;
|
|
132
132
|
this.logPname = logPname;
|
|
133
133
|
this.jumpConfig = Object.assign(
|
|
134
134
|
{},
|
|
135
135
|
this.jumpConfig,
|
|
136
136
|
filterUrlQueryData(routerInfo?.params || {}),
|
|
137
137
|
);
|
|
138
138
|
this.logPageId = pageId;
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
jdJumpToProduct(skuIds, logEventInfo) {
|
|
142
142
|
skuIds = skuIds.toString().trim();
|
|
143
143
|
const getSkuId = skuIds.indexOf(',') !== -1 ? skuIds.split(',')[0] : skuIds;
|
|
144
144
|
let url = `${this.jumpWebUrl.pcDetail}${getSkuId}.html`;
|
|
145
145
|
this.jdNavigateToNative(url, logEventInfo);
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
jdJumpSkuInfoToProduct(skuInfo: any = {}, logEventInfo) {
|
|
149
149
|
const getSkuId = skuInfo?.skuId;
|
|
150
150
|
this.jdJumpToProduct(getSkuId, logEventInfo);
|
|
151
151
|
}
|
|
152
152
|
|
|
153
153
|
jdJumpToShopHome(shopInfo: JumpEventReportInterFace.ShopIdsInfo = {}) {
|
|
154
154
|
const currentShopInfo = {
|
|
155
155
|
shopId: global.info.queryInfo.shopId,
|
|
156
156
|
venderId: global.info.queryInfo.venderId,
|
|
157
157
|
};
|
|
158
158
|
const restParams =
|
|
159
159
|
(shopInfo?.shopId && shopInfo.shopId !== currentShopInfo.shopId) ||
|
|
160
160
|
(shopInfo?.venderId && shopInfo.venderId !== currentShopInfo.venderId)
|
|
161
161
|
? {}
|
|
162
162
|
: currentShopInfo;
|
|
163
163
|
const getInfo = Object.assign({}, restParams, shopInfo);
|
|
164
164
|
let url = `${this.jumpWebUrl.pages}/index-${getInfo.shopId}.html`;
|
|
165
165
|
this.jdNavigateToNative(url, {
|
|
166
166
|
...getInfo,
|
|
167
167
|
});
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
getPcSearchUrl = (searchInfo: { categoryId: string; keyWord: string }) => {
|
|
171
171
|
const { categoryId, keyWord } = searchInfo;
|
|
172
172
|
const flag = document.querySelector('#JSHOP_CHANNEL_FLAG')?.value;
|
|
173
173
|
const appId =
|
|
174
174
|
document.querySelector('#J_AppId')?.value ||
|
|
175
175
|
document.querySelector('#pageInstance_appId')?.value;
|
|
176
176
|
const keywordStr = keyWord && keyWord !== "" ? `?keyword=${keyWord}` : ''
|
|
177
177
|
const searchUrl = categoryId
|
|
178
178
|
? this.jumpWebUrl.pages + '/view_search-' + appId + '-' + categoryId + '-99-1-20-1.html'
|
|
179
179
|
: `${this.jumpWebUrl.pages}/view_search-${appId}.html${keywordStr}`;
|
|
180
180
|
return flag === 'yao'
|
|
181
181
|
? this.jumpWebUrl.pages + '/view_shop_search-' + appId + '.html'
|
|
182
182
|
: searchUrl;
|
|
183
183
|
};
|
|
184
184
|
|
|
185
185
|
jdJumpToShopSearch(shopInfo) {
|
|
186
186
|
const getInfo = Object.assign(
|
|
187
187
|
{},
|
|
188
188
|
{
|
|
189
189
|
shopId: global.info.queryInfo.shopId,
|
|
190
190
|
venderId: global.info.queryInfo.venderId,
|
|
191
191
|
},
|
|
192
192
|
shopInfo,
|
|
193
193
|
);
|
|
194
194
|
const { categoryId = '', keyWord = '' } = getInfo;
|
|
195
195
|
const url = `${this.getPcSearchUrl({ categoryId, keyWord })}`;
|
|
196
196
|
this.jdJumpToWeb(url, getInfo);
|
|
197
197
|
}
|
|
198
198
|
|
|
199
199
|
jdJumpToShopCategory(shopInfo) {
|
|
200
200
|
this.jdJumpToShopSearch(shopInfo)
|
|
201
201
|
}
|
|
202
202
|
|
|
203
203
|
jdJumpToTabAllProduct(shopId, venderId, logEventInfo = {}) {
|
|
204
204
|
console.log('web.base.ts - jdJumpToTabAllProduct');
|
|
205
205
|
if (typeof shopId === 'undefined') shopId = global.info.queryInfo.shopId;
|
|
206
206
|
if (typeof venderId === 'undefined') venderId = global.info.queryInfo.venderId;
|
|
207
207
|
const url = `${this.jumpWebUrl.pages}/index-${shopId}.html`;
|
|
208
208
|
this.jdJumpToWeb(url, logEventInfo);
|
|
209
209
|
}
|
|
210
210
|
|
|
211
211
|
jdJumpToCouponSearchProductList(couponId, logEventInfo = {}) {
|
|
212
212
|
const url = `${this.jumpWebUrl.couponSearch}?couponbatch=${couponId}&sceneval=2`;
|
|
213
213
|
this.jdJumpToWeb(url, logEventInfo);
|
|
214
214
|
}
|