index.js
1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import React from 'react';
import yaSDK from 'yoho-activity-sdk';
import './index.scss';
export default class BottomButton extends React.Component {
constructor(props) {
super(props);
}
render() {
const linkArr = this.props.links;
if (!linkArr || !linkArr.length) {
return null;
}
let jump = e => {
let $el = e.currentTarget;
let url = $el.getAttribute('data-url');
if (!url) {
return;
}
yaSDK.link(e)
};
return (
<div className="comp-bottom-btns-wrap">
{
linkArr.map((link, idx) => {
return (
<a data-type='other' data-url={link.url}
className="button-item" key={idx} onClick={jump}>
<img className="btn-item-bg" src={link.bg}/>
</a>
)
})
}
</div>
)
}
}