@conecli/cone-render 0.9.1-shop2.8 → 0.10.1-beta.0
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/api/index.ts +1 -1
- package/dist/assets/icon_blue_info.svg +1 -0
- package/dist/common/const.ts +1 -1
- package/dist/common/environmentType.ts +1 -0
- 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.ts +1 -0
- package/dist/common/sgmCustomCode.ts +1 -0
- package/dist/common/wxappApi.jd.ts +1 -0
- package/dist/components/ErrorBoundary.tsx +1 -1
- package/dist/components/base/CustomScrollView/index.jd.tsx +1 -0
- package/dist/components/base/CustomScrollView/index.module.scss +7 -0
- package/dist/components/base/CustomVideo/index.tsx +1 -1
- package/dist/components/base/InOrOutViewObserver/index.tsx +1 -1
- package/dist/components/base/LazyLayoutLoad/index.tsx +1 -1
- package/dist/components/base/LazyLoadImage/index.h5.tsx +1 -1
- package/dist/components/base/NetworkDataError/index.tsx +1 -1
- package/dist/components/debug/DebugLayout/index.module.scss +67 -0
- package/dist/components/debug/DebugLayout/index.tsx +1 -0
- package/dist/components/debug/DebugLayout/utils.ts +1 -0
- package/dist/components/decorate/EmptyFloorModule/index.tsx +1 -1
- package/dist/components/floorItem.jd.tsx +1 -1
- package/dist/components/floorItem.weapp.tsx +1 -1
- package/dist/components/isv/Floor/index.tsx +1 -1
- package/dist/components/remoteFloorItem.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/interface/service.ts +1 -1
- package/dist/interface/utils.ts +1 -1
- package/dist/jumpEventReport/base.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/jumpUrlConfig/base.ts +1 -1
- package/dist/jumpEventReport/web.jxwxapp.ts +1 -0
- package/dist/jumpEventReport/web.tjapp.ts +1 -0
- package/dist/jumpEventReport/web.tjm.ts +1 -0
- package/dist/open/api/environment.ts +1 -1
- package/dist/open/api/index.ts +1 -1
- package/dist/open/api/track.ts +1 -1
- package/dist/sass/app.h5.scss +5 -0
- package/dist/service/requestServer.ts +1 -1
- package/dist/utils/connectNativeJsBridge.ts +1 -1
- package/dist/utils/draExceptionAndProfile.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/dist/utils/jm-common.js +1 -1
- package/dist/utils/sgmCodeUtils.ts +1 -0
- package/dist/utils/utils.ts +1 -1
- package/package.json +42 -39
- package/dist/customHooks/useDocumentVisibilitychange.ts +0 -1
|
@@ -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
|
searchCoupon: '/pages/search/subPackages/coupon/coupon',
|
|
5
4
|
h5: '/pages/h5/index',
|
|
6
5
|
jingGouHome: '/pages/index/index',
|
|
7
6
|
shopFans: '/pages/shopfans/pages/index/index',
|
|
8
7
|
shopLight: '/pages/shoplight/pages/index/index',
|
|
9
8
|
couponSearch: '/pages/search/subPackages/coupon/coupon',
|
|
10
9
|
shopx: '/pages/shopx/pages/index/index',
|
|
11
10
|
shopSearch: '/pages/shopx/pages/searchPanel/index',
|
|
12
11
|
mshop: domain.mshop,
|
|
13
12
|
pages: domain.pages,
|
|
14
13
|
couponSearch: `${domain.mobileSo}/list/couponSearch.action`,
|
|
15
14
|
pcCouponSearch:`${domain.pcSo}/Search`,
|
|
16
15
|
shopSecondActivity: `${domain.sale}/m/h5/`,
|
|
17
16
|
shopLight: `${domain.sale}/liteshop/index.html`,
|
|
18
17
|
detail: `${domain.mobileDetail}/product/`,
|
|
19
18
|
pcDetail: `https://item.jd.com/`,
|
|
20
19
|
pcCoupon: `${domain.pcCoupon}/ilink/couponActiveFront/linkKey/front_index.action`,
|
|
21
20
|
mobileHome: `${domain.mobileHome}`,
|
|
22
21
|
rank: `${domain.ranking}/comLandingPage/comLandingPage`,
|
|
23
22
|
wqShopMember: `${domain.wqshop}/mshop/QueryShopMemberInfo`,
|
|
24
23
|
wqShopDetail: `${domain.wqshop}/mshop/GetShopIntroduce`,
|
|
25
24
|
wqShopSearch: `${domain.wqshop}/mshop/SearchList`,
|
|
26
25
|
myCouponList: `${domain.wqs}/my/coupon/index.shtml`,
|
|
27
26
|
myRedPacketList: `${domain.wqs}/my/redpacket.shtml`,
|
|
28
27
|
memberHome: `${domain.pages}/member/home`,
|
|
29
28
|
memberCard: `${domain.pages}/member/card`,
|
|
30
29
|
memberPoints: `${domain.pages}/member/points`,
|
|
31
30
|
memberBenefit: `${domain.pages}/member/benefit`,
|
|
32
31
|
shopMember: `${domain.shopMember}/shopcard`,
|
|
33
32
|
shopMemberCardAgreement: `${domain.shopMember}/member/cardAgreement`,
|
|
34
33
|
shopMemberCardInstruction: `${domain.shopMember}/member/cardInstruction`,
|
|
35
34
|
shopMemberPointDetail: `${domain.shopMember}/member/membersPoint`,
|
|
36
35
|
shopMemberBenefit: `${domain.shopMember}/shopbenefit`,
|
|
37
36
|
shopMemberRule: `${domain.shopMember}/member/membersRule`,
|
|
38
37
|
shopSuperMemberRule: `${domain.shopMember}/member/memberWelfareRule`,
|
|
39
38
|
shopMemberEquityRule: `${domain.shopMember}/member/memberEquityRule`,
|
|
40
39
|
shopMemberWelfare: `${domain.shopMember}/member/memberWelfare`,
|
|
41
40
|
shopMemberCloseAccount: `${domain.shopMember}/member/memberCloseAccount`,
|
|
42
41
|
shopMemberPointExchange: `${domain.shopMember}/memberpoint`,
|
|
43
42
|
shopMemberBonusPurchase: `${domain.shopMember}/bonuspurchase`,
|
|
44
43
|
shopMemberGood: `${domain.shopMember}/member/membersGood`,
|
|
45
44
|
shopMemberCouponList: `${domain.shopMember}/couponList/index.html`,
|
|
46
45
|
shopMemberOpenCard: `${domain.shopMember}/openCard/index.html`,
|
|
47
46
|
shopMemberPayDescription: `${domain.shopMember}/brandSubscribeExplain/index.html`,
|
|
48
47
|
beanDetail: `${domain.bean}/beanDetail/index.action`,
|
|
49
48
|
totalPromotion: `${domain.mobileSo}/list/itemSearch.action`,
|
|
50
49
|
mLive: `${domain.lives}/#`,
|
|
51
50
|
shopHome: `${domain.pages}/shop/home`,
|
|
52
51
|
shopIntroduce: `${domain.pages}/shop/introduce`,
|
|
53
52
|
shopSearch: `${domain.pages}/shop/search`,
|
|
54
53
|
shopLottery: `${domain.pages}/shop/lottery`,
|
|
55
54
|
shopCoupon: `${domain.pages}/shop/coupon`,
|
|
56
55
|
shopWares: `${domain.pages}/shop/wares`,
|
|
57
56
|
shopFastShopping: `${domain.pages}/shop/fastShopping`,
|
|
58
57
|
shopSpeciSeckill: `${domain.pages}/shop/specialSeckill`,
|
|
59
58
|
shopVideos: `${domain.pages}/shop/videos`,
|
|
60
59
|
shopUseShareOrderUgcContent: `${domain.capturehomeshare}/aha/ugcShare.html`,
|
|
61
60
|
dongDongChat: `${domain.jdcs}/chat/index.action`,
|
|
62
61
|
samCenter: `${domain.pages}/shop/samCenter`,
|
|
63
62
|
samCard: `${domain.pages}/shop/samCard`,
|
|
64
63
|
shopH5MemberCardAPP: `${domain.pages}/member/shopcard`,
|
|
65
64
|
shopH5MemberCardM: `${domain.pages}/member/m/shopcard`,
|
|
65
|
+
import { domain } from '../../api'
|
|
66
66
|
shop: '/pages/shop/index/index',
|
|
67
67
|
detail: '/pages/gold/item/pages/detail/index',
|
|
68
68
|
jxDetail: '/pages/item/detail/detail',
|
|
69
69
|
searchCoupon: '/pages/search/subPackages/coupon/coupon',
|
|
70
70
|
h5: '/pages/h5/index',
|
|
71
71
|
jingGouHome: '/pages/index/index',
|
|
72
72
|
shopFans: '/pages/shopfans/pages/index/index',
|
|
73
73
|
shopLight: '/pages/shoplight/pages/index/index',
|
|
74
74
|
couponSearch: '/pages/search/subPackages/coupon/coupon',
|
|
75
75
|
jxCouponSearch:'/pages/search_copr/index',
|
|
76
76
|
shopx: '/pages/shopx/pages/index/index',
|
|
77
77
|
shopSearch: '/pages/shopx/pages/searchPanel/index',
|
|
78
78
|
mshop: domain.mshop,
|
|
79
79
|
pages: domain.pages,
|
|
80
80
|
couponSearch: `${domain.mobileSo}/list/couponSearch.action`,
|
|
81
81
|
jxCouponSearch:`${domain.jxDomain}/search/coupon.shtml`,
|
|
82
82
|
pcCouponSearch:`${domain.pcSo}/Search`,
|
|
83
83
|
shopSecondActivity: `${domain.sale}/m/h5/`,
|
|
84
84
|
shopLight: `${domain.sale}/liteshop/index.html`,
|
|
85
85
|
detail: `${domain.mobileDetail}/product/`,
|
|
86
86
|
jxDetail: `${domain.wqs}/item/view.html`,
|
|
87
87
|
tjDetail: `${domain.kpl}/product`,
|
|
88
88
|
pcDetail: `https://item.jd.com/`,
|
|
89
89
|
pcCoupon: `${domain.pcCoupon}/ilink/couponActiveFront/linkKey/front_index.action`,
|
|
90
90
|
mobileHome: `${domain.mobileHome}`,
|
|
91
91
|
rank: `${domain.ranking}/comLandingPage/comLandingPage`,
|
|
92
92
|
wqShopMember: `${domain.wqshop}/mshop/QueryShopMemberInfo`,
|
|
93
93
|
wqShopDetail: `${domain.wqshop}/mshop/GetShopIntroduce`,
|
|
94
94
|
wqShopSearch: `${domain.wqshop}/mshop/SearchList`,
|
|
95
95
|
myCouponList: `${domain.wqs}/my/coupon/index.shtml`,
|
|
96
96
|
myRedPacketList: `${domain.wqs}/my/redpacket.shtml`,
|
|
97
97
|
memberHome: `${domain.pages}/member/home`,
|
|
98
98
|
memberCard: `${domain.pages}/member/card`,
|
|
99
99
|
memberPoints: `${domain.pages}/member/points`,
|
|
100
100
|
memberBenefit: `${domain.pages}/member/benefit`,
|
|
101
101
|
shopMember: `${domain.shopMember}/shopcard`,
|
|
102
102
|
shopMemberCardAgreement: `${domain.shopMember}/member/cardAgreement`,
|
|
103
103
|
shopMemberCardInstruction: `${domain.shopMember}/member/cardInstruction`,
|
|
104
104
|
shopMemberPointDetail: `${domain.shopMember}/member/membersPoint`,
|
|
105
105
|
shopMemberBenefit: `${domain.shopMember}/shopbenefit`,
|
|
106
106
|
shopMemberRule: `${domain.shopMember}/member/membersRule`,
|
|
107
107
|
shopSuperMemberRule: `${domain.shopMember}/member/memberWelfareRule`,
|
|
108
108
|
shopMemberEquityRule: `${domain.shopMember}/member/memberEquityRule`,
|
|
109
109
|
shopMemberWelfare: `${domain.shopMember}/member/memberWelfare`,
|
|
110
110
|
shopMemberCloseAccount: `${domain.shopMember}/member/memberCloseAccount`,
|
|
111
111
|
shopMemberPointExchange: `${domain.shopMember}/memberpoint`,
|
|
112
112
|
shopMemberBonusPurchase: `${domain.shopMember}/bonuspurchase`,
|
|
113
113
|
shopMemberGood: `${domain.shopMember}/member/membersGood`,
|
|
114
114
|
shopMemberCouponList: `${domain.shopMember}/couponList/index.html`,
|
|
115
115
|
shopMemberOpenCard: `${domain.shopMember}/openCard/index.html`,
|
|
116
116
|
shopMemberPayDescription: `${domain.shopMember}/brandSubscribeExplain/index.html`,
|
|
117
117
|
beanDetail: `${domain.bean}/beanDetail/index.action`,
|
|
118
118
|
totalPromotion: `${domain.mobileSo}/list/itemSearch.action`,
|
|
119
119
|
mLive: `${domain.lives}/#`,
|
|
120
120
|
shopHome: `${domain.pages}/shop/home`,
|
|
121
121
|
shopIntroduce: `${domain.pages}/shop/introduce`,
|
|
122
122
|
shopSearch: `${domain.pages}/shop/search`,
|
|
123
123
|
shopLottery: `${domain.pages}/shop/lottery`,
|
|
124
124
|
shopCoupon: `${domain.pages}/shop/coupon`,
|
|
125
125
|
shopWares: `${domain.pages}/shop/wares`,
|
|
126
126
|
shopFastShopping: `${domain.pages}/shop/fastShopping`,
|
|
127
127
|
shopSpeciSeckill: `${domain.pages}/shop/specialSeckill`,
|
|
128
128
|
shopVideos: `${domain.pages}/shop/videos`,
|
|
129
129
|
shopUseShareOrderUgcContent: `${domain.capturehomeshare}/aha/ugcShare.html`,
|
|
130
130
|
dongDongChat: `${domain.jdcs}/chat/index.action`,
|
|
131
131
|
samCenter: `${domain.pages}/shop/samCenter`,
|
|
132
132
|
samCard: `${domain.pages}/shop/samCard`,
|
|
133
133
|
shopH5MemberCardAPP: `${domain.pages}/member/shopcard`,
|
|
134
134
|
shopH5MemberCardM: `${domain.pages}/member/m/shopcard`,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import global from '../common'
|
|
2
|
isH5AdnJxMini,
|
|
1
3
|
public jingXiMiniState: boolean
|
|
2
4
|
constructor(opt) {
|
|
3
5
|
super(opt)
|
|
4
6
|
this.jingXiMiniState = false
|
|
5
7
|
this.getConfig(opt)
|
|
6
8
|
console.log(
|
|
7
9
|
'window.shopGlobalSwitch:',
|
|
8
10
|
JSON.stringify(window.shopGlobalSwitch),
|
|
9
11
|
)
|
|
10
12
|
this.init()
|
|
11
13
|
}
|
|
12
14
|
getConfig(opt) {
|
|
13
15
|
return Object.assign(this, {}, defaultConfig, super.getConfig(opt), opt)
|
|
14
16
|
}
|
|
15
17
|
|
|
16
18
|
async init() {
|
|
17
19
|
if (window.isJingxiMiniViewState) {
|
|
18
20
|
this.jingXiMiniState = true
|
|
19
21
|
global.info.isJingxiMiniViewState = true
|
|
20
22
|
} else {
|
|
21
23
|
console.log(
|
|
22
24
|
'初始化进行小程序环境检查, 当前是否是京喜小程序',
|
|
23
25
|
isH5AdnJxMini
|
|
24
26
|
)
|
|
25
27
|
if (isH5AdnJxMini) {
|
|
26
28
|
console.log('进入了 isH5AdnJxMini 的 else if')
|
|
27
29
|
this.jingXiMiniState = true
|
|
28
30
|
global.info.isJingxiMiniViewState = true
|
|
29
31
|
window.isJingxiMiniViewState = true
|
|
30
32
|
} else {
|
|
31
33
|
console.log('进入了 this.isH5OpenToWxapp 的esle')
|
|
32
34
|
}
|
|
33
35
|
}
|
|
34
36
|
}
|
|
35
37
|
|
|
36
38
|
jdJumpToMiniPage(pageUrl, logEventInfo, type = 'navigateTo') {
|
|
37
39
|
this.jdNavigateToNative(
|
|
38
40
|
pageUrl,
|
|
39
41
|
logEventInfo,
|
|
40
42
|
() => {
|
|
41
43
|
console.log('JD.wxappext.goto',pageUrl)
|
|
42
44
|
wx?.miniProgram[type] &&
|
|
43
45
|
wx?.miniProgram[type]({
|
|
44
46
|
url: pageUrl,
|
|
45
47
|
})
|
|
46
48
|
},
|
|
47
49
|
() => {
|
|
48
50
|
console.log('JD.wxappext.goto2')
|
|
49
51
|
wx?.miniProgram[type] &&
|
|
50
52
|
wx?.miniProgram[type]({
|
|
51
53
|
url: pageUrl,
|
|
52
54
|
})
|
|
53
55
|
},
|
|
54
56
|
)
|
|
55
57
|
}
|
|
56
58
|
|
|
57
59
|
jdJumpToWebInner(url, logEventInfo) {
|
|
58
60
|
super.jdJumpToWeb(url, logEventInfo)
|
|
59
61
|
}
|
|
60
62
|
|
|
61
63
|
jdJumpToProduct(skuIds, logEventInfo) {
|
|
62
64
|
if (this.jingXiMiniState) {
|
|
63
65
|
const detailUrl = `${this.jumpMiniPath.jxDetail}?sku=${skuIds}`
|
|
64
66
|
this.jdJumpToMiniPage(detailUrl, logEventInfo)
|
|
65
67
|
} else {
|
|
66
68
|
super.jdJumpToProduct(skuIds, logEventInfo)
|
|
67
69
|
}
|
|
68
70
|
}
|
|
69
71
|
jdJumpToCouponSearchProductList(couponId, logEventInfo = {}) {
|
|
70
72
|
if (this.jingXiMiniState) {
|
|
71
73
|
const batchParam = `coupon_batch=${couponId}`
|
|
72
74
|
const detailUrl = `${this.jumpMiniPath.jxCouponSearch}?${batchParam}`
|
|
73
75
|
this.jdJumpToMiniPage(detailUrl, logEventInfo)
|
|
74
76
|
} else {
|
|
75
77
|
super.jdJumpToCouponSearchProductList(couponId, logEventInfo)
|
|
76
78
|
}
|
|
77
79
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { JumpEventTJWebReport } from './web.tjm'
|
|
2
|
routerInfo: {
|
|
1
3
|
params: {},
|
|
2
4
|
},
|
|
3
5
|
nativeEvent: null,
|
|
4
6
|
jumpConfig: {
|
|
5
7
|
venderId: null,
|
|
6
8
|
shopId: null,
|
|
7
9
|
sourceValue: '',
|
|
8
10
|
sourceType: 'App-H5',
|
|
9
11
|
activityType: 'shopx',
|
|
10
12
|
moduleId: 'none',
|
|
11
13
|
entrance: 'none',
|
|
12
14
|
},
|
|
13
15
|
logPageParamStr: '',
|
|
14
16
|
public logPageId: string
|
|
15
17
|
public jumpConfig: JumpEventReportInterFace.JumpH5ReportConfig
|
|
16
18
|
constructor(opt = {}) {
|
|
17
19
|
console.log('jdlite加载==========')
|
|
18
20
|
super(opt)
|
|
19
21
|
this.getConfig(opt)
|
|
20
22
|
}
|
|
21
23
|
tjOpenAppParams(openAppUrl): Object | boolean {
|
|
22
24
|
let getParams: boolean | Object = false
|
|
23
25
|
if (this.isOpenTjAppUrl(openAppUrl)) {
|
|
24
26
|
try {
|
|
25
27
|
getParams = openAppUrl.replace(
|
|
26
28
|
/openApp\.jdlite:\/\/virtual\?params=/i,
|
|
27
29
|
'',
|
|
28
30
|
)
|
|
29
31
|
getParams = JSON.parse(String(getParams))
|
|
30
32
|
} catch (e) {
|
|
31
33
|
console.log(e)
|
|
32
34
|
}
|
|
33
35
|
}
|
|
34
36
|
return getParams
|
|
35
37
|
}
|
|
36
38
|
isOpenTjAppUrl(openAppUrl) {
|
|
37
39
|
return /openApp\.jdlite:\/\/virtual\?params=/i.test(openAppUrl)
|
|
38
40
|
}
|
|
39
41
|
|
|
40
42
|
async jdJumpConfigUrl(detail, logEventInfo = {}) {
|
|
41
43
|
const { configDataType, configDataValue } = detail
|
|
42
44
|
console.log("测试tj app",detail)
|
|
43
45
|
switch (configDataType) {
|
|
44
46
|
case LinkConfigType.CONFIG_TYPE_SKU_LIST:
|
|
45
47
|
this.jdJumpToProduct( configDataValue.skuIds, logEventInfo)
|
|
46
48
|
break
|
|
47
49
|
case LinkConfigType.CONFIG_TYPE_CUSTOM_LINK: {
|
|
48
50
|
const _url = configDataValue.linkUrl
|
|
49
51
|
this.jdJumpToWeb(_url, logEventInfo)
|
|
50
52
|
break
|
|
51
53
|
}
|
|
52
54
|
default:
|
|
53
55
|
}
|
|
54
56
|
}
|
|
55
57
|
|
|
56
58
|
jdJumpToProduct(skuIds, logEventInfo) {
|
|
57
59
|
skuIds = skuIds.toString().trim()
|
|
58
60
|
const getSkuId = skuIds.indexOf(',') !== -1 ? skuIds.split(',')[0] : skuIds
|
|
59
61
|
this.jdNavigateToNative({
|
|
60
62
|
category: "jump",
|
|
61
63
|
des: "productDetail",
|
|
62
64
|
skuId: getSkuId,
|
|
63
65
|
logEventInfo,
|
|
64
66
|
})
|
|
65
67
|
}
|
|
66
68
|
|
|
67
69
|
jdJumpToCouponSearchProductList(couponId, logEventInfo = {}) {
|
|
68
70
|
this.jdNavigateToNative(
|
|
69
71
|
Object.assign(
|
|
70
72
|
{},
|
|
71
73
|
{
|
|
72
74
|
category: "jump",
|
|
73
75
|
des: "productList",
|
|
74
76
|
from: "couponBatch",
|
|
75
77
|
couponId: `${couponId}`,
|
|
76
78
|
tip: "1",
|
|
77
79
|
inlet: 0,
|
|
78
80
|
quangoufrom: 2
|
|
79
81
|
},
|
|
80
82
|
logEventInfo,
|
|
81
83
|
),
|
|
82
84
|
)
|
|
83
85
|
}
|
|
84
86
|
|
|
85
87
|
jdJumpToWeb(
|
|
86
88
|
url,
|
|
87
89
|
logEventInfo,
|
|
88
90
|
successBack?: Function | undefined,
|
|
89
91
|
failBack?: Function | undefined,
|
|
90
92
|
) {
|
|
91
93
|
if (this.isOpenTjAppUrl(url)) {
|
|
92
94
|
const getOpenAppParams = this.tjOpenAppParams(url)
|
|
93
95
|
console.log(
|
|
94
96
|
'tj web 获取自定义openApp链接解析后的参数结果',
|
|
95
97
|
getOpenAppParams,
|
|
96
98
|
)
|
|
97
99
|
if (getOpenAppParams) {
|
|
98
100
|
this.jdNavigateToNative(
|
|
99
101
|
Object.assign({}, getOpenAppParams, {
|
|
100
102
|
logEventInfo,
|
|
101
103
|
}),
|
|
102
104
|
)
|
|
103
105
|
}
|
|
104
106
|
} else {
|
|
105
107
|
if(url.indexOf('tjshop') == -1) {
|
|
106
108
|
url = url + this.getTjShopParam()
|
|
107
109
|
}
|
|
108
110
|
const changeUrl = /^\/\//.test(url) ? `https:${url}` : url
|
|
109
111
|
this.jdNavigateToNative(
|
|
110
112
|
{
|
|
111
113
|
category: 'jump',
|
|
112
114
|
des: 'm',
|
|
113
115
|
url: changeUrl,
|
|
114
116
|
logEventInfo,
|
|
115
117
|
},
|
|
116
118
|
OpenAppHost,
|
|
117
119
|
successBack,
|
|
118
120
|
failBack,
|
|
119
121
|
)
|
|
120
122
|
}
|
|
121
123
|
}
|
|
122
124
|
jdJumpToShopSearch(shopInfo) {
|
|
123
125
|
const getInfo = Object.assign(
|
|
124
126
|
{},
|
|
125
127
|
{
|
|
126
128
|
shopId: global.info.queryInfo.shopId,
|
|
127
129
|
venderId: global.info.queryInfo.venderId,
|
|
128
130
|
},
|
|
129
131
|
shopInfo,
|
|
130
132
|
)
|
|
131
133
|
const { shopId, categoryId, keyword, pageId, description, shopName } =
|
|
132
134
|
getInfo
|
|
133
135
|
const cateId = categoryId ? `&cateId=${typeof categoryId === 'string' ? categoryId?.trim() : categoryId}` : ''
|
|
134
136
|
const addKeyWord = keyword ? `&keyword=${keyword}` : ''
|
|
135
137
|
const addPageId = pageId ? `&pageId=${pageId}` : ''
|
|
136
138
|
const searchDes = description ? `&description=${description}` : ''
|
|
137
139
|
const shopNameDes = shopName ? `&shopName=${shopName}` : ''
|
|
138
140
|
const searchType = categoryId ? 5 : keyword ? 4 : 3
|
|
139
141
|
super.jdNavigateToNative(
|
|
140
142
|
`${this.jumpWebUrl.shopSearch}?shopId=${shopId}&searchType=${searchType}${cateId}${addKeyWord}${addPageId}${searchDes}${shopNameDes}`,
|
|
141
143
|
getInfo,
|
|
142
144
|
)
|
|
143
145
|
}
|
|
144
146
|
|
|
145
147
|
jdNavigateToNative(
|
|
146
148
|
params,
|
|
147
149
|
url = OpenAppHost,
|
|
148
150
|
successBack?: Function | null,
|
|
149
151
|
failBack?: Function | null,
|
|
150
152
|
) {
|
|
151
153
|
console.log('tj web', params)
|
|
152
154
|
const { logEventInfo , ...otherParams } = params
|
|
153
155
|
console.log('tj web 获取open协议参数 jdNavigateToNative params: ',otherParams)
|
|
154
156
|
console.log('logEventInfo params: ', logEventInfo)
|
|
155
157
|
console.log('otherParams', otherParams)
|
|
156
158
|
const paramsStr = JSON.stringify(otherParams)
|
|
157
159
|
console.log('跳转web tj open协议', `${url}?params=${paramsStr}`)
|
|
158
160
|
global.info.pageInfo.dataType === BUSINESS_TYPE.ONLINE &&
|
|
159
161
|
this.clickEventLog(logEventInfo || params)
|
|
160
162
|
.then(() => {
|
|
161
163
|
if (typeof successBack == 'function') {
|
|
162
164
|
successBack(params)
|
|
163
165
|
} else {
|
|
164
166
|
try {
|
|
165
167
|
const paramsStr = encodeURIComponent(JSON.stringify(otherParams))
|
|
166
168
|
console.log(
|
|
167
169
|
'success: 跳转web tj open协议',
|
|
168
170
|
`${url}?params=${paramsStr}`,
|
|
169
171
|
)
|
|
170
172
|
window.location.href = `${url}?params=${paramsStr}`
|
|
171
173
|
} catch (e) {
|
|
172
174
|
console.log('跳转异常', e)
|
|
173
175
|
}
|
|
174
176
|
}
|
|
175
177
|
})
|
|
176
178
|
.catch((e) => {
|
|
177
179
|
console.log('catch', e)
|
|
178
180
|
typeof failBack == 'function' && failBack(params)
|
|
179
181
|
})
|
|
180
182
|
}
|
|
181
183
|
|
|
182
184
|
clickEventLog(
|
|
183
185
|
opts: JumpEventReportInterFace.OptEventLogParams = {},
|
|
184
186
|
reportKey = 'click',
|
|
185
187
|
) {
|
|
186
188
|
const { eventId, jsonParam, eventLevel = 3, ...otherParams } = opts
|
|
187
189
|
if (eventId && jsonParam) {
|
|
188
190
|
const { etModelInfo, logBaseInfo } = jsonParam
|
|
189
191
|
const webLogParams = {
|
|
190
192
|
eid: eventId,
|
|
191
193
|
elevel: eventLevel,
|
|
192
194
|
eparam:JSON.stringify(logBaseInfo || jsonParam),
|
|
193
195
|
jsonParam: JSON.stringify(logBaseInfo || jsonParam),
|
|
194
196
|
etModel: JSON.stringify(etModelInfo || {}),
|
|
195
197
|
pageId: this.logPageId,
|
|
196
198
|
pageParam: this.logPageParamStr,
|
|
197
199
|
...otherParams,
|
|
198
200
|
}
|
|
199
201
|
return /click|exposure/.test(reportKey)
|
|
200
202
|
? reportClick(webLogParams)
|
|
201
203
|
: reportToCart(opts,webLogParams)
|
|
202
204
|
} else {
|
|
203
205
|
console.log('暂无埋点参数eventId和eventParam')
|
|
204
206
|
return Promise.resolve(false)
|
|
205
207
|
}
|
|
206
208
|
}
|
|
207
209
|
getConfig(opt = {}) {
|
|
208
210
|
return Object.assign(this, {}, defaultConfig, opt)
|
|
209
211
|
}
|