@conecli/cone-render 0.10.1-shop3.14 → 0.10.1-shop3.15

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 { domain } from '../../api';
2
1
  shop: '/pages/shop/index/index',
3
2
  detail: '/pages/gold/item/pages/detail/index',
4
3
  jxDetail: '/pages/item/detail/detail',
5
4
  searchCoupon: '/pages/search/subPackages/coupon/coupon',
6
5
  h5: '/pages/h5/index',
7
6
  jingGouHome: '/pages/index/index',
8
7
  shopFans: '/pages/shopfans/pages/index/index',
9
8
  shopLight: '/pages/shoplight/pages/index/index',
10
9
  couponSearch: '/pages/search/subPackages/coupon/coupon',
11
10
  jxCouponSearch: '/pages/search_copr/index',
12
11
  shopx: '/pages/shopx/pages/index/index',
13
12
  shopSearch: '/pages/shopx/pages/searchPanel/index',
14
13
  mshop: domain.mshop,
15
14
  pages: domain.pages,
16
15
  couponSearch: `${domain.mobileSo}/list/couponSearch.action`,
17
16
  jxCouponSearch: `${domain.jxDomain}/search/coupon.shtml`,
18
17
  pcCouponSearch: `${domain.pcSo}/Search`,
19
18
  shopSecondActivity: `${domain.sale}/m/h5/`,
20
19
  shopLight: `${domain.sale}/liteshop/index.html`,
21
20
  detail: `${domain.mobileDetail}/product/`,
22
21
  jxDetail: `${domain.wqs}/item/view.html`,
23
22
  tjDetail: `${domain.kpl}/product`,
24
23
  pcDetail: `https://item.jd.com/`,
25
24
  pcCoupon: `${domain.pcCoupon}/ilink/couponActiveFront/linkKey/front_index.action`,
26
25
  mobileHome: `${domain.mobileHome}`,
27
26
  rank: `${domain.ranking}/comLandingPage/comLandingPage`,
28
27
  wqShopMember: `${domain.wqshop}/mshop/QueryShopMemberInfo`,
29
28
  wqShopDetail: `${domain.wqshop}/mshop/GetShopIntroduce`,
30
29
  wqShopSearch: `${domain.wqshop}/mshop/SearchList`,
31
30
  myCouponList: `${domain.wqs}/my/coupon/index.shtml`,
32
31
  myRedPacketList: `${domain.wqs}/my/redpacket.shtml`,
33
32
  memberHome: `${domain.pages}/member/home`,
34
33
  memberCard: `${domain.pages}/member/card`,
35
34
  memberPoints: `${domain.pages}/member/points`,
36
35
  memberBenefit: `${domain.pages}/member/benefit`,
37
36
  memberScores: `${domain.pages}/member/scores`,
38
37
  memberScoreRule: `${domain.pages}/member/scoreRule`,
39
38
  memberProduct: `${domain.pages}/member/product`,
40
39
  shopMember: `${domain.shopMember}/shopcard`,
41
40
  shopMemberCardAgreement: `${domain.shopMember}/member/cardAgreement`,
42
41
  shopMemberCardInstruction: `${domain.shopMember}/member/cardInstruction`,
43
42
  shopMemberPointDetail: `${domain.shopMember}/member/membersPoint`,
44
43
  shopMemberBenefit: `${domain.shopMember}/shopbenefit`,
45
44
  shopMemberRule: `${domain.shopMember}/member/membersRule`,
46
45
  shopSuperMemberRule: `${domain.shopMember}/member/memberWelfareRule`,
47
46
  shopMemberEquityRule: `${domain.shopMember}/member/memberEquityRule`,
48
47
  shopMemberWelfare: `${domain.shopMember}/member/memberWelfare`,
49
48
  shopMemberCloseAccount: `${domain.shopMember}/member/memberCloseAccount`,
50
49
  shopMemberPointExchange: `${domain.shopMember}/memberpoint`,
51
50
  shopMemberBonusPurchase: `${domain.shopMember}/bonuspurchase`,
52
51
  shopMemberGood: `${domain.shopMember}/member/membersGood`,
53
52
  shopMemberCouponList: `${domain.shopMember}/couponList/index.html`,
54
53
  shopMemberOpenCard: `${domain.shopMember}/openCard/index.html`,
55
54
  shopMemberPayDescription: `${domain.shopMember}/brandSubscribeExplain/index.html`,
56
55
  beanDetail: `${domain.bean}/beanDetail/index.action`,
57
56
  totalPromotion: `${domain.mobileSo}/list/itemSearch.action`,
58
57
  mLive: `${domain.lives}/#`,
59
58
  shopHome: `${domain.pages}/shop/home`,
60
59
  shopIntroduce: `${domain.pages}/shop/introduce`,
61
60
  shopSearch: `${domain.pages}/shop/search`,
62
61
  shopLottery: `${domain.pages}/shop/lottery`,
63
62
  shopCoupon: `${domain.pages}/shop/coupon`,
64
63
  shopWares: `${domain.pages}/shop/wares`,
65
64
  shopFastShopping: `${domain.pages}/shop/fastShopping`,
66
65
  shopSpeciSeckill: `${domain.pages}/shop/specialSeckill`,
67
66
  shopVideos: `${domain.pages}/shop/videos`,
68
67
  shopMoreGoods: `${domain.pages}/shop/moreGoods`,
69
68
  shopUseShareOrderUgcContent: `${domain.capturehomeshare}/aha/ugcShare.html`,
70
69
  dongDongChat: `${domain.jdcs}/chat/index.action`,
71
70
  samCenter: `${domain.pages}/shop/samCenter`,
72
71
  samCard: `${domain.pages}/shop/samCard`,
73
72
  shopH5MemberCardAPP: `${domain.pages}/member/shopcard`,
74
73
  shopH5MemberCardM: `${domain.pages}/member/m/shopcard`,
75
74
  sageAuthorHome: `${domain.ecoDomain}/content/dr_home/index.html`,
76
75
  sageShopInteract: `${domain.pages}/app/interact`,
76
+ import { domain } from '../../api';
77
77
  shop: '/pages/shop/index/index',
78
78
  detail: '/pages/gold/item/pages/detail/index',
79
79
  jxDetail: '/pages/item/detail/detail',
80
80
  searchCoupon: '/pages/search/subPackages/coupon/coupon',
81
81
  h5: '/pages/h5/index',
82
82
  jingGouHome: '/pages/index/index',
83
83
  shopFans: '/pages/shopfans/pages/index/index',
84
84
  shopLight: '/pages/shoplight/pages/index/index',
85
85
  couponSearch: '/pages/search/subPackages/coupon/coupon',
86
86
  jxCouponSearch: '/pages/search_copr/index',
87
87
  shopx: '/pages/shopx/pages/index/index',
88
88
  shopSearch: '/pages/shopx/pages/searchPanel/index',
89
89
  jdLive: '/pages/jd_live/pages/liveRoom/index',
90
90
  mshop: domain.mshop,
91
91
  pages: domain.pages,
92
92
  couponSearch: `${domain.mobileSo}/list/couponSearch.action`,
93
93
  jxCouponSearch: `${domain.jxDomain}/search/coupon.shtml`,
94
94
  pcCouponSearch: `${domain.pcSo}/Search`,
95
95
  shopSecondActivity: `${domain.sale}/m/h5/`,
96
96
  shopLight: `${domain.sale}/liteshop/index.html`,
97
97
  detail: `${domain.mobileDetail}/product/`,
98
98
  jxDetail: `${domain.wqs}/item/view.html`,
99
99
  tjDetail: `${domain.kpl}/product`,
100
100
  pcDetail: `https://item.jd.com/`,
101
101
  pcCoupon: `${domain.pcCoupon}/ilink/couponActiveFront/linkKey/front_index.action`,
102
102
  mobileHome: `${domain.mobileHome}`,
103
103
  rank: `${domain.ranking}/comLandingPage/comLandingPage`,
104
104
  wqShopMember: `${domain.wqshop}/mshop/QueryShopMemberInfo`,
105
105
  wqShopDetail: `${domain.wqshop}/mshop/GetShopIntroduce`,
106
106
  wqShopSearch: `${domain.wqshop}/mshop/SearchList`,
107
107
  myCouponList: `${domain.wqs}/my/coupon/index.shtml`,
108
108
  myRedPacketList: `${domain.wqs}/my/redpacket.shtml`,
109
109
  memberHome: `${domain.pages}/member/home`,
110
110
  memberCard: `${domain.pages}/member/card`,
111
111
  memberPoints: `${domain.pages}/member/points`,
112
112
  memberBenefit: `${domain.pages}/member/benefit`,
113
113
  memberScores: `${domain.pages}/member/scores`,
114
114
  memberScoreRule: `${domain.pages}/member/scoreRule`,
115
115
  memberProduct: `${domain.pages}/member/product`,
116
116
  shopMember: `${domain.shopMember}/shopcard`,
117
117
  shopMemberCardAgreement: `${domain.shopMember}/member/cardAgreement`,
118
118
  shopMemberCardInstruction: `${domain.shopMember}/member/cardInstruction`,
119
119
  shopMemberPointDetail: `${domain.shopMember}/member/membersPoint`,
120
120
  shopMemberBenefit: `${domain.shopMember}/shopbenefit`,
121
121
  shopMemberRule: `${domain.shopMember}/member/membersRule`,
122
122
  shopSuperMemberRule: `${domain.shopMember}/member/memberWelfareRule`,
123
123
  shopMemberEquityRule: `${domain.shopMember}/member/memberEquityRule`,
124
124
  shopMemberWelfare: `${domain.shopMember}/member/memberWelfare`,
125
125
  shopMemberCloseAccount: `${domain.shopMember}/member/memberCloseAccount`,
126
126
  shopMemberPointExchange: `${domain.shopMember}/memberpoint`,
127
127
  shopMemberBonusPurchase: `${domain.shopMember}/bonuspurchase`,
128
128
  shopMemberGood: `${domain.shopMember}/member/membersGood`,
129
129
  shopMemberCouponList: `${domain.shopMember}/couponList/index.html`,
130
130
  shopMemberOpenCard: `${domain.shopMember}/openCard/index.html`,
131
131
  shopMemberPayDescription: `${domain.shopMember}/brandSubscribeExplain/index.html`,
132
132
  beanDetail: `${domain.bean}/beanDetail/index.action`,
133
133
  totalPromotion: `${domain.mobileSo}/list/itemSearch.action`,
134
134
  mLive: `${domain.lives}/#`,
135
135
  shopHome: `${domain.pages}/shop/home`,
136
136
  shopIntroduce: `${domain.pages}/shop/introduce`,
137
137
  shopSearch: `${domain.pages}/shop/search`,
138
138
  shopLottery: `${domain.pages}/shop/lottery`,
139
139
  shopCoupon: `${domain.pages}/shop/coupon`,
140
140
  shopWares: `${domain.pages}/shop/wares`,
141
141
  shopFastShopping: `${domain.pages}/shop/fastShopping`,
142
142
  shopSpeciSeckill: `${domain.pages}/shop/specialSeckill`,
143
143
  shopVideos: `${domain.pages}/shop/videos`,
144
144
  shopMoreGoods: `${domain.pages}/shop/moreGoods`,
145
145
  shopUseShareOrderUgcContent: `${domain.capturehomeshare}/aha/ugcShare.html`,
146
146
  dongDongChat: `${domain.jdcs}/chat/index.action`,
147
147
  samCenter: `${domain.pages}/shop/samCenter`,
148
148
  samCard: `${domain.pages}/shop/samCard`,
149
149
  shopH5MemberCardAPP: `${domain.pages}/member/shopcard`,
150
150
  shopH5MemberCardM: `${domain.pages}/member/m/shopcard`,
151
151
  sageAuthorHome: `${domain.ecoDomain}/content/dr_home/index.html`,
152
152
  sageShopInteract: `${domain.pages}/app/interact`,
@@ -1 +1 @@
1
- import global from '../common'
2
1
  objectToUrlEncode,
3
2
  isH5AndJingGouMini,
4
3
  SECTION_HOME_TAB_TYPE,
5
4
  SECTION_HOME_TAB_NAME_TYPE,
6
5
  public jingGouMiniState: boolean
7
6
  private isH5OpenToWxapp: boolean
8
7
  constructor(opt) {
9
8
  super(opt)
10
9
  this.jingGouMiniState = false
11
10
  this.getConfig(opt)
12
11
  console.log(
13
12
  'window.shopGlobalSwitch:',
14
13
  JSON.stringify(window.shopGlobalSwitch),
15
14
  )
16
15
  this.isH5OpenToWxapp =
17
16
  window.shopGlobalSwitch?.openMobileShopToWxApp == 'true'
18
17
  this.init()
19
18
  }
20
19
  getConfig(opt) {
21
20
  return Object.assign(this, {}, defaultConfig, super.getConfig(opt), opt)
22
21
  }
23
22
 
24
23
 
25
24
  async init() {
26
25
  if (window.isJingGouMiniViewState) {
27
26
  this.jingGouMiniState = true
28
27
  } else {
29
28
  console.log(
30
29
  '初始化进行小程序环境检查, 当前是否是京购小程序里的H5',
31
30
  isH5AndJingGouMini,
32
31
  )
33
32
  if (isH5AndJingGouMini && this.isH5OpenToWxapp) {
34
33
  console.log('进入了 isH5AndJingGouMini && this.isH5OpenToWxapp 的if')
35
34
  this.jingGouMiniState = true
36
35
  window.isJingGouMiniViewState = true
37
36
  console.log('进入了 iwx?.miniProgram then 但是没有继续跳转的逻辑 ')
38
37
  global.info.isJingGouMiniViewState = true
39
38
  } else {
40
39
  console.log('进入了 isH5AndJingGouMini && this.isH5OpenToWxapp 的esle')
41
40
  }
42
41
  }
43
42
  }
44
43
 
45
44
  jdJumpToMiniPage(pageUrl, logEventInfo, type = 'navigateTo') {
46
45
  this.jdNavigateToNative(
47
46
  pageUrl,
48
47
  logEventInfo,
49
48
  () => {
50
49
  console.log('JD.wxappext.goto')
51
50
  wx?.miniProgram[type] &&
52
51
  wx?.miniProgram[type]({
53
52
  url: pageUrl,
54
53
  })
55
54
  },
56
55
  () => {
57
56
  console.log('JD.wxappext.goto2')
58
57
  wx?.miniProgram[type] &&
59
58
  wx?.miniProgram[type]({
60
59
  url: pageUrl,
61
60
  })
62
61
  },
63
62
  )
64
63
  }
65
64
 
66
65
  jdJumpToTabAllProduct(shopId, venderId, logEventInfo = {}) {
67
66
  console.log('web.wxapp.ts - jdJumpToTabAllProduct')
68
67
  if(typeof shopId === 'undefined') shopId = global.info.queryInfo.shopId
69
68
  if(typeof venderId === 'undefined') venderId = global.info.queryInfo.venderId
70
69
  if (this.jingGouMiniState) {
71
70
  const param = {
72
71
  shopId,
73
72
  venderId,
74
73
  tabActive: SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_PRODUCT],
75
74
  }
76
75
  const url = `${this.jumpMiniPath.shopx}?${objectToUrlEncode(param)}`
77
76
  this.jdJumpToMiniPage(url, logEventInfo)
78
77
  } else {
79
78
  super.jdJumpToTabAllProduct(shopId, venderId, logEventInfo)
80
79
  }
81
80
  }
82
81
 
83
82
  jdJumpToTopTabBase(type, shopInfo = {}) {
84
83
  const getInfo = Object.assign(
85
84
  {},
86
85
  {
87
86
  shopId: global.info.queryInfo.shopId,
88
87
  venderId: global.info.queryInfo.venderId,
89
88
  },
90
89
  shopInfo,
91
90
  )
92
91
  if (this.jingGouMiniState) {
93
92
  const {shopId, venderId, ...otherInfo} = getInfo
94
93
  const param = {
95
94
  shopId,
96
95
  venderId,
97
96
  tabActive: type,
98
97
  }
99
98
  const url = `${this.jumpMiniPath.shopx}?${objectToUrlEncode(param)}`
100
99
  this.jdJumpToMiniPage(url, otherInfo)
101
100
  } else {
102
101
  super.jdJumpToTopTabBase(type, shopInfo)
103
102
  }
104
103
  }
105
104
 
106
105
  jdJumpToWeb(url, logEventInfo) {
107
106
  console.log('web.wxapp.ts - jdJumpToWeb', url)
108
107
  console.log('jingGouMiniState', this.jingGouMiniState)
109
108
  if (this.jingGouMiniState) {
110
109
  const encodeUrl = `${
111
110
  this.jumpMiniPath.h5
112
111
  }?encode_url=${encodeURIComponent(url)}`
113
112
  this.jdJumpToMiniPage(encodeUrl, logEventInfo)
114
113
  } else {
115
114
  super.jdJumpToWeb(url, logEventInfo)
116
115
  }
117
116
  }
118
117
 
119
118
  jdJumpToWebInner(url, logEventInfo) {
120
119
  super.jdJumpToWeb(url, logEventInfo)
121
120
  }
122
121
 
123
122
  jdJumpToProduct(skuIds, logEventInfo) {
124
123
  if (this.jingGouMiniState) {
125
124
  const detailUrl = `${this.jumpMiniPath.detail}?sku=${skuIds}`
126
125
  this.jdJumpToMiniPage(detailUrl, logEventInfo)
127
126
  } else {
128
127
  super.jdJumpToProduct(skuIds, logEventInfo)
129
128
  }
130
129
  }
131
130
 
132
131
  jdJumpSkuInfoToProduct(skuInfo: any = {}, logEventInfo) {
133
132
  const getSkuId = skuInfo?.skuId;
134
133
  this.jdJumpToProduct(getSkuId, logEventInfo)
135
134
  }
136
135
 
137
136
  jdJumpToShopHome(params) {
138
137
  console.log('[降级H5] jdJumpToShopHome web.wxapp', params)
139
138
  console.log('global.info.queryInfo.shopId', global.info.queryInfo.shopId, global.info.queryInfo.venderId)
140
139
  const getInfo = Object.assign(
141
140
  {},
142
141
  {
143
142
  shopId: global.info.queryInfo.shopId,
144
143
  venderId: global.info.queryInfo.venderId,
145
144
  },
146
145
  params,
147
146
  )
148
147
  const { type = 'navigateTo', ...otherShopInfo } = getInfo
149
148
  if (this.jingGouMiniState) {
150
149
  let shopUrl = `${this.jumpMiniPath.shopx}${window.location.search}`
151
150
  if (/(\/shop\/(samCenter|samCard))|(\/sale\/home)|(\/favorite)/.test(window.location.pathname)) {
152
151
  shopUrl = `${this.jumpMiniPath.shopx}?${objectToUrlEncode(
153
152
  this.getShopIdsInfo(otherShopInfo),
154
153
  )}`
155
154
  }
156
155
  this.jdJumpToMiniPage(shopUrl, otherShopInfo, type)
157
156
  } else {
158
157
  super.jdJumpToShopHome(otherShopInfo)
159
158
  }
160
159
  }
161
160
 
162
161
  jdJumpToShopCategory(params) {
163
162
  console.log('[降级H5] jdJumpToShopCategory web.wxapp')
164
163
  const { type = 'navigateTo', ...otherShopInfo } = params
165
164
  console.log("获取分类跳转参数", params)
166
165
  if (this.jingGouMiniState) {
167
166
  this.jdJumpToTopTabBase('classify',otherShopInfo)
168
167
  } else {
169
168
  super.jdJumpToShopCategory(otherShopInfo)
170
169
  }
171
170
  }
172
171
 
173
172
  jdJumpToLive(liveInfo, logEventInfo = {}) {
174
173
  if (liveInfo?.liveId) {
175
174
  this.jdJumpToWeb(
176
175
  `${this.jumpWebUrl.mLive}/${liveInfo?.liveId}?${
177
176
  this.jingGouMiniState ? 'origin=0&appid=jdgw' : 'origin=30'
178
177
  }`,
179
178
  logEventInfo,
180
179
  )
181
180
  }
182
181
  }
183
182
 
184
183
  jdJumpToShopLight(shopInfo) {
185
184
  if (this.jingGouMiniState) {
186
185
  this.jdJumpToMiniPage(
187
186
  `${this.jumpMiniPath.shopLight}?${objectToUrlEncode(
188
187
  this.getShopIdOrVenderIdParams(shopInfo),
189
188
  )}`,
190
189
  {
191
190
  ...shopInfo,
192
191
  },
193
192
  )
194
193
  } else {
195
194
  this.jdNavigateToNative(
196
195
  `${this.jumpWebUrl.shopLight}?${objectToUrlEncode(
197
196
  this.getShopIdOrVenderIdParams(shopInfo),
198
197
  )}`,
199
198
  {
200
199
  ...shopInfo,
201
200
  },
202
201
  )
203
202
  }
204
203
  }
205
204
  jdJumpToCouponSearchProductList(couponId, logEventInfo = {}) {
206
205
  if (this.jingGouMiniState) {
207
206
  const detailUrl = `${this.jumpMiniPath.searchCoupon}?batch=${couponId}`
208
207
  this.jdJumpToMiniPage(detailUrl, logEventInfo)
209
208
  } else {
210
209
  super.jdJumpToCouponSearchProductList(couponId, logEventInfo)
211
210
  }
212
211
  }
212
+ import global from '../common';
213
213
  objectToUrlEncode,
214
214
  isH5AndJingGouMini,
215
215
  public jingGouMiniState: boolean;
216
216
  private isH5OpenToWxapp: boolean;
217
217
  constructor(opt) {
218
218
  super(opt);
219
219
  this.jingGouMiniState = false;
220
220
  this.getConfig(opt);
221
221
  console.log('window.shopGlobalSwitch:', JSON.stringify(window.shopGlobalSwitch));
222
222
  this.isH5OpenToWxapp = window.shopGlobalSwitch?.openMobileShopToWxApp == 'true';
223
223
  this.init();
224
224
  }
225
225
  getConfig(opt) {
226
226
  return Object.assign(this, {}, defaultConfig, super.getConfig(opt), opt);
227
227
  }
228
228
 
229
229
 
230
230
  async init() {
231
231
  if (window.isJingGouMiniViewState) {
232
232
  this.jingGouMiniState = true;
233
233
  } else {
234
234
  console.log('初始化进行小程序环境检查, 当前是否是京购小程序里的H5', isH5AndJingGouMini);
235
235
  if (isH5AndJingGouMini && this.isH5OpenToWxapp) {
236
236
  console.log('进入了 isH5AndJingGouMini && this.isH5OpenToWxapp 的if');
237
237
  this.jingGouMiniState = true;
238
238
  window.isJingGouMiniViewState = true;
239
239
  console.log('进入了 iwx?.miniProgram then 但是没有继续跳转的逻辑 ');
240
240
  global.info.isJingGouMiniViewState = true;
241
241
  } else {
242
242
  console.log('进入了 isH5AndJingGouMini && this.isH5OpenToWxapp 的esle');
243
243
  }
244
244
  }
245
245
  }
246
246
 
247
247
  jdJumpToMiniPage(pageUrl, logEventInfo, type = 'navigateTo') {
248
248
  this.jdNavigateToNative(
249
249
  pageUrl,
250
250
  logEventInfo,
251
251
  () => {
252
252
  console.log('JD.wxappext.goto');
253
253
  wx?.miniProgram[type] &&
254
254
  wx?.miniProgram[type]({
255
255
  url: pageUrl,
256
256
  });
257
257
  },
258
258
  () => {
259
259
  console.log('JD.wxappext.goto2');
260
260
  wx?.miniProgram[type] &&
261
261
  wx?.miniProgram[type]({
262
262
  url: pageUrl,
263
263
  });
264
264
  },
265
265
  );
266
266
  }
267
267
 
268
268
  jdJumpToTabAllProduct(shopId, venderId, logEventInfo = {}) {
269
269
  console.log('web.wxapp.ts - jdJumpToTabAllProduct');
270
270
  if (typeof shopId === 'undefined') shopId = global.info.queryInfo.shopId;
271
271
  if (typeof venderId === 'undefined') venderId = global.info.queryInfo.venderId;
272
272
  if (this.jingGouMiniState) {
273
273
  const param = {
274
274
  shopId,
275
275
  venderId,
276
276
  tabActive: SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_PRODUCT],
277
277
  };
278
278
  const url = `${this.jumpMiniPath.shopx}?${objectToUrlEncode(param)}`;
279
279
  this.jdJumpToMiniPage(url, logEventInfo);
280
280
  } else {
281
281
  super.jdJumpToTabAllProduct(shopId, venderId, logEventInfo);
282
282
  }
283
283
  }
284
284
 
285
285
  jdJumpToTopTabBase(type, shopInfo = {}) {
286
286
  const getInfo = Object.assign(
287
287
  {},
288
288
  {
289
289
  shopId: global.info.queryInfo.shopId,
290
290
  venderId: global.info.queryInfo.venderId,
291
291
  },
292
292
  shopInfo,
293
293
  );
294
294
  if (this.jingGouMiniState) {
295
295
  const { shopId, venderId, ...otherInfo } = getInfo;
296
296
  const param = {
297
297
  shopId,
298
298
  venderId,
299
299
  tabActive: type,
300
300
  };
301
301
  const url = `${this.jumpMiniPath.shopx}?${objectToUrlEncode(param)}`;
302
302
  this.jdJumpToMiniPage(url, otherInfo);
303
303
  } else {
304
304
  super.jdJumpToTopTabBase(type, shopInfo);
305
305
  }
306
306
  }
307
307
 
308
308
  jdJumpToWeb(url, logEventInfo) {
309
309
  console.log('web.wxapp.ts - jdJumpToWeb', url);
310
310
  console.log('jingGouMiniState', this.jingGouMiniState);
311
311
  if (this.jingGouMiniState) {
312
312
  const encodeUrl = `${this.jumpMiniPath.h5}?encode_url=${encodeURIComponent(url)}`;
313
313
  this.jdJumpToMiniPage(encodeUrl, logEventInfo);
314
314
  } else {
315
315
  super.jdJumpToWeb(url, logEventInfo);
316
316
  }
317
317
  }
318
318
 
319
319
  jdJumpToWebInner(url, logEventInfo) {
320
320
  super.jdJumpToWeb(url, logEventInfo);
321
321
  }
322
322
 
323
323
  jdJumpToProduct(skuIds, logEventInfo) {
324
324
  if (this.jingGouMiniState) {
325
325
  const detailUrl = `${this.jumpMiniPath.detail}?sku=${skuIds}`;
326
326
  this.jdJumpToMiniPage(detailUrl, logEventInfo);
327
327
  } else {
328
328
  super.jdJumpToProduct(skuIds, logEventInfo);
329
329
  }
330
330
  }
331
331
 
332
332
  jdJumpSkuInfoToProduct(skuInfo: any = {}, logEventInfo) {
333
333
  const getSkuId = skuInfo?.skuId;
334
334
  this.jdJumpToProduct(getSkuId, logEventInfo);
335
335
  }
336
336
 
337
337
  jdJumpToShopHome(params) {
338
338
  console.log('[降级H5] jdJumpToShopHome web.wxapp', params);
339
339
  console.log(
340
340
  'global.info.queryInfo.shopId',
341
341
  global.info.queryInfo.shopId,
342
342
  global.info.queryInfo.venderId,
343
343
  );
344
344
  const getInfo = Object.assign(
345
345
  {},
346
346
  {
347
347
  shopId: global.info.queryInfo.shopId,
348
348
  venderId: global.info.queryInfo.venderId,
349
349
  },
350
350
  params,
351
351
  );
352
352
  const { type = 'navigateTo', ...otherShopInfo } = getInfo;
353
353
  if (this.jingGouMiniState) {
354
354
  let shopUrl = `${this.jumpMiniPath.shopx}${window.location.search}`;
355
355
  if (
356
356
  /(\/shop\/(samCenter|samCard))|(\/sale\/home)|(\/favorite)/.test(window.location.pathname)
357
357
  ) {
358
358
  shopUrl = `${this.jumpMiniPath.shopx}?${objectToUrlEncode(
359
359
  this.getShopIdsInfo(otherShopInfo),
360
360
  )}`;
361
361
  }
362
362
  this.jdJumpToMiniPage(shopUrl, otherShopInfo, type);
363
363
  } else {
364
364
  super.jdJumpToShopHome(otherShopInfo);
365
365
  }
366
366
  }
367
367
 
368
368
  jdJumpToShopCategory(params) {
369
369
  console.log('[降级H5] jdJumpToShopCategory web.wxapp');
370
370
  const { type = 'navigateTo', ...otherShopInfo } = params;
371
371
  console.log('获取分类跳转参数', params);
372
372
  if (this.jingGouMiniState) {
373
373
  this.jdJumpToTopTabBase('classify', otherShopInfo);
374
374
  } else {
375
375
  super.jdJumpToShopCategory(otherShopInfo);
376
376
  }
377
377
  }
378
378
 
379
379
  jdJumpToLive(liveInfo, logEventInfo = {}) {
380
380
  if (liveInfo?.liveId) {
381
381
  if (this.jingGouMiniState && liveInfo?.openWxappToLiveRoom) {
382
382
  this.jdJumpToMiniPage(`${this.jumpMiniPath.jdLive}?liveId=${liveInfo.liveId}&origin=473`, {
383
383
  logEventInfo,
384
384
  });
385
385
  } else {
386
386
  this.jdJumpToWeb(
387
387
  `${this.jumpWebUrl.mLive}/${liveInfo.liveId}?${
388
388
  this.jingGouMiniState ? 'origin=0&appid=jdgw' : 'origin=30'
389
389
  }`,
390
390
  logEventInfo,
391
391
  );
392
392
  }
393
393
  }
394
394
  }
395
395
 
396
396
  jdJumpToShopLight(shopInfo) {
397
397
  if (this.jingGouMiniState) {
398
398
  this.jdJumpToMiniPage(
399
399
  `${this.jumpMiniPath.shopLight}?${objectToUrlEncode(
400
400
  this.getShopIdOrVenderIdParams(shopInfo),
401
401
  )}`,
402
402
  {
403
403
  ...shopInfo,
404
404
  },
405
405
  );
406
406
  } else {
407
407
  this.jdNavigateToNative(
408
408
  `${this.jumpWebUrl.shopLight}?${objectToUrlEncode(
409
409
  this.getShopIdOrVenderIdParams(shopInfo),
410
410
  )}`,
411
411
  {
412
412
  ...shopInfo,
413
413
  },
414
414
  );
415
415
  }
416
416
  }
417
417
  jdJumpToCouponSearchProductList(couponId, logEventInfo = {}) {
418
418
  if (this.jingGouMiniState) {
419
419
  const detailUrl = `${this.jumpMiniPath.searchCoupon}?batch=${couponId}`;
420
420
  this.jdJumpToMiniPage(detailUrl, logEventInfo);
421
421
  } else {
422
422
  super.jdJumpToCouponSearchProductList(couponId, logEventInfo);
423
423
  }
424
424
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@conecli/cone-render",
3
- "version": "0.10.1-shop3.14",
3
+ "version": "0.10.1-shop3.15",
4
4
  "private": false,
5
5
  "files": [
6
6
  "dist/"
@@ -62,6 +62,23 @@
62
62
  "ios >= 8"
63
63
  ]
64
64
  },
65
+ "husky": {
66
+ "hooks": {
67
+ "pre-commit": "lint-staged",
68
+ "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
69
+ }
70
+ },
71
+ "lint-staged": {
72
+ "*.{js,ts}": [
73
+ "eslint",
74
+ "eslint --fix",
75
+ "git add"
76
+ ],
77
+ "*.{scss}": [
78
+ "prettier --write",
79
+ "git add"
80
+ ]
81
+ },
65
82
  "keywords": [
66
83
  "conecli",
67
84
  "render"
@@ -108,6 +125,7 @@
108
125
  "sass": "^1.75.0",
109
126
  "babel-preset-taro": "4.0.9",
110
127
  "eslint-config-taro": "4.0.9",
128
+ "eslint-config-prettier": "^8.3.0",
111
129
  "eslint": "^8.57.0",
112
130
  "@pmmmwh/react-refresh-webpack-plugin": "^0.5.7",
113
131
  "react-refresh": "^0.14.0",