Toggle navigation
Toggle navigation
This project
Loading...
Sign in
mobile
/
YH_RNComponent
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
QC-L
7 years ago
Commit
24636d9bd3430c0eaac5c6f44d44f133c7d352fb
1 parent
889be196
添加了新埋点,Review 传参代码 review by sunkai
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
79 additions
and
36 deletions
js/alliance/components/cell/EditorTalk.js
js/alliance/components/cell/ImageFour.js
js/alliance/components/cell/ImageSingle.js
js/alliance/components/cell/ImageSlider.js
js/alliance/components/cell/ImageTwo.js
js/alliance/containers/HomeContainer.js
js/alliance/components/cell/EditorTalk.js
View file @
24636d9
...
...
@@ -16,6 +16,7 @@ export default class EditorTalk extends Component {
constructor
(
props
)
{
super
(
props
);
this
.
_handleData
=
this
.
_handleData
.
bind
(
this
);
this
.
_handleParamsJumpWithUrl
=
this
.
_handleParamsJumpWithUrl
.
bind
(
this
);
}
shouldComponentUpdate
(
nextProps
)
{
...
...
@@ -40,6 +41,18 @@ export default class EditorTalk extends Component {
}
}
_handleParamsJumpWithUrl
(
id
,
name
,
url
)
{
// 为埋点提供参数组装
// 后期请将所有的点击事件由 resourceJumpWithUrl 修改为自己独有的事件
// 由于多数组件都使用的 resourceJumpWithUrl ,埋点传参无法正常进行
let
params
=
{
F_ID
:
id
,
F_NAME
:
name
,
F_URL
:
url
};
this
.
props
.
resourceJumpWithUrl
&&
this
.
props
.
resourceJumpWithUrl
(
url
,
'talk'
,
params
);
}
render
()
{
let
{
mainTitlelist
,
subTitlelist
,
contextlist
,
url
}
=
this
.
_handleData
();
let
image
=
this
.
props
.
image
;
...
...
@@ -53,12 +66,7 @@ export default class EditorTalk extends Component {
activeOpacity
=
{
1
}
style
=
{{
width
:
width
,
height
:
sliderHeight
}}
onPress
=
{()
=>
{
let
params
=
{
F_ID
:
resource
.
get
(
'template_id'
),
F_NAME
:
resource
.
get
(
'template_name'
),
F_URL
:
url
};
this
.
props
.
resourceJumpWithUrl
&&
this
.
props
.
resourceJumpWithUrl
(
url
,
'talk'
,
params
);
this
.
_handleParamsJumpWithUrl
(
resource
.
get
(
'template_id'
),
resource
.
get
(
'template_name'
),
url
);
}}
>
<
Image
...
...
js/alliance/components/cell/ImageFour.js
View file @
24636d9
...
...
@@ -14,6 +14,7 @@ export default class ImageFour extends React.Component {
constructor
(
props
)
{
super
(
props
);
this
.
_handleParamsJumpWithUrl
=
this
.
_handleParamsJumpWithUrl
.
bind
(
this
);
}
shouldComponentUpdate
(
nextProps
)
{
...
...
@@ -24,6 +25,16 @@ export default class ImageFour extends React.Component {
}
}
_handleParamsJumpWithUrl
(
id
,
url
)
{
// 为埋点提供参数组装
// 后期请将所有的点击事件由 resourceJumpWithUrl 修改为自己独有的事件
// 由于多数组件都使用的 resourceJumpWithUrl ,埋点传参无法正常进行
let
params
=
{
ID
:
id
};
this
.
props
.
resourceJumpWithUrl
&&
this
.
props
.
resourceJumpWithUrl
(
url
,
'icon'
,
params
);
}
render
()
{
let
{
resource
}
=
this
.
props
;
...
...
@@ -51,10 +62,7 @@ export default class ImageFour extends React.Component {
// if (i === 2) {
// this.props.jumpWithUrl && this.props.jumpWithUrl('达人排行', 'talentRank');
// } else {
let
params
=
{
ID
:
i
+
1
};
this
.
props
.
resourceJumpWithUrl
&&
this
.
props
.
resourceJumpWithUrl
(
item
.
url
,
'icon'
,
params
);
this
.
_handleParamsJumpWithUrl
(
i
+
1
,
item
.
url
);
// }
// this.props.jumpWithUrl && this.props.jumpWithUrl('商品详情', 'shareDetail');
...
...
js/alliance/components/cell/ImageSingle.js
View file @
24636d9
...
...
@@ -14,6 +14,7 @@ export default class ImageSingle extends React.Component {
constructor
(
props
)
{
super
(
props
);
this
.
_handleParamsJumpWithUrl
=
this
.
_handleParamsJumpWithUrl
.
bind
(
this
);
}
shouldComponentUpdate
(
nextProps
)
{
...
...
@@ -24,6 +25,23 @@ export default class ImageSingle extends React.Component {
}
}
_handleParamsJumpWithUrl
(
id
,
name
,
url
)
{
// 为埋点提供参数组装
// 后期请将所有的点击事件由 resourceJumpWithUrl 修改为自己独有的事件
// 由于多数组件都使用的 resourceJumpWithUrl ,埋点传参无法正常进行
let
params
=
{
F_ID
:
id
,
F_NAME
:
name
,
F_URL
:
url
};
if
(
this
.
props
.
messageResourceInfo
)
{
params
=
{
ID
:
id
,
};
}
this
.
props
.
resourceJumpWithUrl
&&
this
.
props
.
resourceJumpWithUrl
(
url
,
'one'
,
params
);
}
render
()
{
let
{
resource
}
=
this
.
props
;
...
...
@@ -46,17 +64,7 @@ export default class ImageSingle extends React.Component {
yh_exposureData
=
{
list
[
0
].
yh_exposureData
}
style
=
{[{
width
:
sliderWidth
,
height
:
sliderHeight
},
this
.
props
.
style
]}
onPress
=
{()
=>
{
let
params
=
{
F_ID
:
resource
.
get
(
'template_id'
),
F_NAME
:
resource
.
get
(
'template_name'
),
F_URL
:
list
[
0
].
url
};
if
(
this
.
props
.
messageResourceInfo
)
{
params
=
{
ID
:
resource
.
get
(
'template_id'
),
};
}
this
.
props
.
resourceJumpWithUrl
&&
this
.
props
.
resourceJumpWithUrl
(
list
[
0
].
url
,
'one'
,
params
);
this
.
_handleParamsJumpWithUrl
(
resource
.
get
(
'template_id'
),
resource
.
get
(
'template_name'
),
list
[
0
].
url
);
}}
>
<
YH_Image
...
...
js/alliance/components/cell/ImageSlider.js
View file @
24636d9
...
...
@@ -19,6 +19,7 @@ export default class ImageSlider extends React.Component {
constructor
(
props
)
{
super
(
props
);
this
.
_handleParamsJumpWithUrl
=
this
.
_handleParamsJumpWithUrl
.
bind
(
this
);
}
shouldComponentUpdate
(
nextProps
)
{
...
...
@@ -31,6 +32,17 @@ export default class ImageSlider extends React.Component {
}
}
_handleParamsJumpWithUrl
(
index
,
url
)
{
// 为埋点提供参数组装
// 后期请将所有的点击事件由 resourceJumpWithUrl 修改为自己独有的事件
// 由于多数组件都使用的 resourceJumpWithUrl ,埋点传参无法正常进行
let
params
=
{
I_INDEX
:
index
,
F_URL
:
url
};
this
.
props
.
resourceJumpWithUrl
&&
this
.
props
.
resourceJumpWithUrl
(
url
,
'banner'
,
params
);
}
render
()
{
let
{
resource
,
sliderWidth
,
sliderHeight
}
=
this
.
props
;
...
...
@@ -47,7 +59,7 @@ export default class ImageSlider extends React.Component {
yh_exposureData
=
{
data
[
0
].
yh_exposureData
}
style
=
{{
width
:
sliderWidth
,
height
:
sliderHeight
}}
onPress
=
{()
=>
{
this
.
props
.
resourceJumpWithUrl
&&
this
.
props
.
resourceJumpWithUrl
(
data
[
0
].
url
);
this
.
_handleParamsJumpWithUrl
(
1
,
data
[
0
].
url
)
}}
>
<
YH_Image
...
...
@@ -83,7 +95,7 @@ export default class ImageSlider extends React.Component {
activeOpacity
=
{
1
}
yh_exposureData
=
{
item
.
yh_exposureData
}
onPress
=
{()
=>
{
this
.
props
.
resourceJumpWithUrl
&&
this
.
props
.
resourceJumpWithUrl
(
item
.
url
);
this
.
_handleParamsJumpWithUrl
(
i
+
1
,
item
.
url
);
}}
>
<
YH_Image
...
...
js/alliance/components/cell/ImageTwo.js
View file @
24636d9
...
...
@@ -15,6 +15,7 @@ export default class ImageTwo extends React.Component {
constructor
(
props
)
{
super
(
props
);
this
.
_handleParamsJumpWithUrl
=
this
.
_handleParamsJumpWithUrl
.
bind
(
this
);
}
shouldComponentUpdate
(
nextProps
)
{
...
...
@@ -25,6 +26,19 @@ export default class ImageTwo extends React.Component {
}
}
_handleParamsJumpWithUrl
(
id
,
name
,
url
,
i_index
)
{
// 为埋点提供参数组装
// 后期请将所有的点击事件由 resourceJumpWithUrl 修改为自己独有的事件
// 由于多数组件都使用的 resourceJumpWithUrl ,埋点传参无法正常进行
let
params
=
{
F_ID
:
id
,
F_NAME
:
name
,
F_URL
:
url
,
I_INDEX
:
i_index
};
this
.
props
.
resourceJumpWithUrl
&&
this
.
props
.
resourceJumpWithUrl
(
url
,
'two'
,
params
);
}
render
()
{
let
{
resource
}
=
this
.
props
;
...
...
@@ -52,13 +66,7 @@ export default class ImageTwo extends React.Component {
yh_exposureData
=
{
item
.
yh_exposureData
}
style
=
{{
width
:
sliderWidth
,
height
:
sliderHeight
,
marginRight
:
15
}}
onPress
=
{()
=>
{
let
params
=
{
F_ID
:
resource
.
get
(
'template_id'
),
F_NAME
:
resource
.
get
(
'template_name'
),
F_URL
:
item
.
url
,
I_INDEX
:
i
+
1
};
this
.
props
.
resourceJumpWithUrl
&&
this
.
props
.
resourceJumpWithUrl
(
item
.
url
,
'two'
,
params
);
this
.
_handleParamsJumpWithUrl
(
resource
.
get
(
'template_id'
),
resource
.
get
(
'template_name'
),
item
.
url
,
i
+
1
);
}}
>
<
YH_Image
...
...
js/alliance/containers/HomeContainer.js
View file @
24636d9
...
...
@@ -114,10 +114,12 @@ class HomeContainer extends Component {
if
(
!
url
)
{
return
;
}
if
(
type
&&
type
!==
'icon'
&&
params
)
{
ReactNative
.
NativeModules
.
YH_CommonHelper
.
logEvent
(
'YB_CPS_MAIN_ACTIVITY_C'
,
params
);
}
else
if
(
type
===
'icon'
&&
params
)
{
if
(
type
===
'icon'
&&
params
)
{
ReactNative
.
NativeModules
.
YH_CommonHelper
.
logEvent
(
'YB_CPS_MAIN_ICON_C'
,
params
);
}
else
if
(
type
===
'banner'
&&
params
)
{
ReactNative
.
NativeModules
.
YH_CommonHelper
.
logEvent
(
'YB_CPS_MAIN_BANNER_C'
,
params
);
}
else
if
(
type
&&
params
)
{
ReactNative
.
NativeModules
.
YH_CommonHelper
.
logEvent
(
'YB_CPS_MAIN_ACTIVITY_C'
,
params
);
}
ReactNative
.
NativeModules
.
YH_CommonHelper
.
jumpWithUrl
(
url
);
}
...
...
@@ -153,9 +155,6 @@ class HomeContainer extends Component {
productPool
,
skns
,
}
=
this
.
props
.
app
;
console
.
log
(
data
.
get
(
'sort_id'
));
console
.
log
(
'------->Skns'
)
console
.
log
(
skns
);
this
.
props
.
actions
.
setAppSelectedCategory
(
productPool
,
skns
,
data
.
get
(
'sort_id'
),
data
.
get
(
'sort_name'
),
index
);
let
params
=
{
...
...
Please
register
or
login
to post a comment