Authored by 李奇

链接跳转修改

1 import React from 'react'; 1 import React from 'react';
  2 +import yaSDK from 'yoho-activity-sdk';
2 3
3 import './index.scss'; 4 import './index.scss';
4 export default class BottomButton extends React.Component { 5 export default class BottomButton extends React.Component {
@@ -13,12 +14,23 @@ export default class BottomButton extends React.Component { @@ -13,12 +14,23 @@ export default class BottomButton extends React.Component {
13 return null; 14 return null;
14 } 15 }
15 16
  17 + let jump = e => {
  18 + let $el = e.currentTarget;
  19 + let url = $el.getAttribute('data-url');
  20 +
  21 + if (!url) {
  22 + return;
  23 + }
  24 + yaSDK.link(e)
  25 + };
  26 +
16 return ( 27 return (
17 <div className="comp-bottom-btns-wrap"> 28 <div className="comp-bottom-btns-wrap">
18 { 29 {
19 linkArr.map((link, idx) => { 30 linkArr.map((link, idx) => {
20 return ( 31 return (
21 - <a href={link.url} className="button-item" key={idx}> 32 + <a data-type='other' data-url={link.url}
  33 + className="button-item" key={idx} onClick={jump}>
22 <img className="btn-item-bg" src={link.bg}/> 34 <img className="btn-item-bg" src={link.bg}/>
23 </a> 35 </a>
24 ) 36 )
1 import React from 'react'; 1 import React from 'react';
2 import {resource} from '../../../api'; 2 import {resource} from '../../../api';
3 import {image} from '../../../../../common/utils'; 3 import {image} from '../../../../../common/utils';
  4 +import yaSDK from 'yoho-activity-sdk';
4 5
5 import './index.scss'; 6 import './index.scss';
6 7
@@ -35,14 +36,24 @@ export default class Resource extends React.Component { @@ -35,14 +36,24 @@ export default class Resource extends React.Component {
35 if (!this.props.code) { 36 if (!this.props.code) {
36 return null; 37 return null;
37 } 38 }
  39 +
  40 + let jump = e => {
  41 + let $el = e.currentTarget;
  42 + let url = $el.getAttribute('data-url');
  43 +
  44 + if (!url) {
  45 + return;
  46 + }
  47 + yaSDK.link(e)
  48 + };
38 49
39 return ( 50 return (
40 <div className="comp-resource-wrap"> 51 <div className="comp-resource-wrap">
41 { 52 {
42 - floors.map((floor, idx) => { 53 + floors.map((floor) => {
43 return ( 54 return (
44 <div className="new-single-img-item" key={floor.template_id}> 55 <div className="new-single-img-item" key={floor.template_id}>
45 - <a> 56 + <a data-type='other' data-url={floor.data.list[0].url} onClick={jump}>
46 <img src={ 57 <img src={
47 image(floor.data.list[0].src, floor.data.imageWidth, floor.data.imageHeight) 58 image(floor.data.list[0].src, floor.data.imageWidth, floor.data.imageHeight)
48 } alt=""/> 59 } alt=""/>