@conecli/cone-render 0.8.20-shop.224 → 0.8.20-shop.225

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-${global.info.queryInfo.shopId}.html`;
61
60
  this.jdNavigateToNative(url, {
62
61
  ...getInfo,
63
62
  });
64
63
  }
65
64
 
66
65
  getPcSearchUrl = (cateId) => {
67
66
  const flag = document.querySelector('#JSHOP_CHANNEL_FLAG')?.value;
68
67
  const appId =
69
68
  document.querySelector('#J_AppId')?.value ||
70
69
  document.querySelector('#pageInstance_appId')?.value;
71
70
  return flag === 'yao'
72
71
  ? this.jumpWebUrl.pages + '/view_shop_search-' + appId + '.html'
73
72
  : this.jumpWebUrl.pages + '/view_search-' + appId + '-' + cateId + '-99-1-20-1.html';
74
73
  };
75
74
 
76
75
  jdJumpToShopSearch(shopInfo) {
77
76
  const getInfo = Object.assign(
78
77
  {},
79
78
  {
80
79
  shopId: global.info.queryInfo.shopId,
81
80
  venderId: global.info.queryInfo.venderId,
82
81
  },
83
82
  shopInfo,
84
83
  );
85
84
  const { categoryId } = getInfo;
86
85
  const url = `${this.getPcSearchUrl(categoryId)}`;
87
86
  this.jdJumpToWeb(url, getInfo);
88
87
  }
89
88
 
90
89
  jdJumpToTabAllProduct(shopId, venderId, logEventInfo = {}) {
91
90
  console.log('web.base.ts - jdJumpToTabAllProduct');
92
91
  if (typeof shopId === 'undefined') shopId = global.info.queryInfo.shopId;
93
92
  if (typeof venderId === 'undefined') venderId = global.info.queryInfo.venderId;
94
93
  const url = `${this.jumpWebUrl.pages}/index-${shopId}.html`;
95
94
  this.jdJumpToWeb(url, logEventInfo);
96
95
  }
97
96
 
98
97
  jdJumpToCouponSearchProductList(couponId, logEventInfo = {}) {
99
98
  const url = `${this.jumpWebUrl.couponSearch}?couponbatch=${couponId}&sceneval=2`;
100
99
  this.jdJumpToWeb(url, logEventInfo);
101
100
  }
101
+ import global from '../common';
102
102
  BUSINESS_TYPE,
103
103
  SHOP_MENU_ID_TYPE,
104
104
  SHOP_MENU_ID_NAME,
105
105
  SECTION_HOME_TAB_TYPE,
106
106
  SECTION_HOME_TAB_NAME_TYPE,
107
107
  routerInfo: {
108
108
  params: {},
109
109
  },
110
110
  nativeEvent: null,
111
111
  jumpConfig: {
112
112
  venderId: null,
113
113
  shopId: null,
114
114
  sourceValue: '',
115
115
  sourceType: 'M-H5',
116
116
  activityType: 'shopx',
117
117
  moduleId: 'none',
118
118
  entrance: 'none',
119
119
  },
120
120
  logPageParamStr: '',
121
121
  public logPageId: string;
122
122
  public jumpConfig: JumpEventReportInterFace.JumpH5ReportConfig;
123
123
  getConfig(opt) {
124
124
  return Object.assign(this, {}, defaultConfig, opt);
125
125
  }
126
126
  updateInfo(routerInfo, logPname = LogPnameInfo.HOME, pageId = LogPageIdInfo.APP) {
127
127
  this.routerInfo = routerInfo;
128
128
  this.logPname = logPname;
129
129
  this.jumpConfig = Object.assign(
130
130
  {},
131
131
  this.jumpConfig,
132
132
  filterUrlQueryData(routerInfo?.params || {}),
133
133
  );
134
134
  this.logPageId = pageId;
135
135
  }
136
136
 
137
137
  jdJumpToProduct(skuIds, logEventInfo) {
138
138
  skuIds = skuIds.toString().trim();
139
139
  const getSkuId = skuIds.indexOf(',') !== -1 ? skuIds.split(',')[0] : skuIds;
140
140
  let url = `${this.jumpWebUrl.pcDetail}${getSkuId}.html`;
141
141
  this.jdNavigateToNative(url, logEventInfo);
142
142
  }
143
143
 
144
144
  jdJumpSkuInfoToProduct(skuInfo: any = {}, logEventInfo) {
145
145
  const getSkuId = skuInfo?.skuId;
146
146
  this.jdJumpToProduct(getSkuId, logEventInfo);
147
147
  }
148
148
 
149
149
  jdJumpToShopHome(shopInfo: JumpEventReportInterFace.ShopIdsInfo = {}) {
150
150
  const currentShopInfo = {
151
151
  shopId: global.info.queryInfo.shopId,
152
152
  venderId: global.info.queryInfo.venderId,
153
153
  };
154
154
  const restParams =
155
155
  (shopInfo?.shopId && shopInfo.shopId !== currentShopInfo.shopId) ||
156
156
  (shopInfo?.venderId && shopInfo.venderId !== currentShopInfo.venderId)
157
157
  ? {}
158
158
  : currentShopInfo;
159
159
  const getInfo = Object.assign({}, restParams, shopInfo);
160
160
  let url = `${this.jumpWebUrl.pages}/index-${getInfo.shopId}.html`;
161
161
  this.jdNavigateToNative(url, {
162
162
  ...getInfo,
163
163
  });
164
164
  }
165
165
 
166
166
  getPcSearchUrl = (cateId) => {
167
167
  const flag = document.querySelector('#JSHOP_CHANNEL_FLAG')?.value;
168
168
  const appId =
169
169
  document.querySelector('#J_AppId')?.value ||
170
170
  document.querySelector('#pageInstance_appId')?.value;
171
171
  return flag === 'yao'
172
172
  ? this.jumpWebUrl.pages + '/view_shop_search-' + appId + '.html'
173
173
  : this.jumpWebUrl.pages + '/view_search-' + appId + '-' + cateId + '-99-1-20-1.html';
174
174
  };
175
175
 
176
176
  jdJumpToShopSearch(shopInfo) {
177
177
  const getInfo = Object.assign(
178
178
  {},
179
179
  {
180
180
  shopId: global.info.queryInfo.shopId,
181
181
  venderId: global.info.queryInfo.venderId,
182
182
  },
183
183
  shopInfo,
184
184
  );
185
185
  const { categoryId } = getInfo;
186
186
  const url = `${this.getPcSearchUrl(categoryId)}`;
187
187
  this.jdJumpToWeb(url, getInfo);
188
188
  }
189
189
 
190
190
  jdJumpToTabAllProduct(shopId, venderId, logEventInfo = {}) {
191
191
  console.log('web.base.ts - jdJumpToTabAllProduct');
192
192
  if (typeof shopId === 'undefined') shopId = global.info.queryInfo.shopId;
193
193
  if (typeof venderId === 'undefined') venderId = global.info.queryInfo.venderId;
194
194
  const url = `${this.jumpWebUrl.pages}/index-${shopId}.html`;
195
195
  this.jdJumpToWeb(url, logEventInfo);
196
196
  }
197
197
 
198
198
  jdJumpToCouponSearchProductList(couponId, logEventInfo = {}) {
199
199
  const url = `${this.jumpWebUrl.couponSearch}?couponbatch=${couponId}&sceneval=2`;
200
200
  this.jdJumpToWeb(url, logEventInfo);
201
201
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@conecli/cone-render",
3
- "version": "0.8.20-shop.224",
3
+ "version": "0.8.20-shop.225",
4
4
  "private": false,
5
5
  "files": [
6
6
  "dist/"