Commit 1c0a81d9 authored by xinglei's avatar xinglei

修改跳转方法

parent be5feb62
......@@ -28,7 +28,8 @@ class Scene extends Component {
mode: 'divider',
cardItems: [],
selectScene: categoryScene[0],
selectMiniSence: miniSences[0]
selectMiniSence: miniSences[0],
token: null
// mode2: 'line',
// mode3: 'bullet'
};
......@@ -84,14 +85,15 @@ class Scene extends Component {
};
handleClick = (templateLink) => {
const { token } = this.state;
if (!token){
getSceneLoginToken().then(d => {
window.open(templateLink + "&token=" + d);
})
.catch(e => {
window.open(templateLink);
this.setState({
token: d
});
});
}
window.open(templateLink + "&token=" + token);
}
renderListCards = (cardItems) => {
......@@ -99,7 +101,7 @@ class Scene extends Component {
for (let i = 0; i < cardItems.length; i += 4) {
const rowItems = cardItems.slice(i, i + 4);
const cols = rowItems.map((cardItems, index) => (
const cols = rowItems.map((item, index) => (
<Col span={6} key={index}>
<div style={{ margin: 15, display: 'flex', justifyContent: 'center' }}>
<button style={{ width: '100%', height: '100%', border: 0, padding: 0 }} onClick={() => this.handleClick(cardItems.templateLink)}>
......@@ -108,10 +110,10 @@ class Scene extends Component {
<img alt="example" width="100%" height="100%" style={{ objectFit: 'cover', borderRadius: 10 }} src={cardItems.sketch} />
</div>
<div style={{ padding: '10px 0px 10px 80px' }}>
<h2 style={{ textAlign: 'left', margin: 0 }}>{cardItems.templateName}</h2>
<h2 style={{ textAlign: 'left', margin: 0 }}>{item.templateName}</h2>
<div style={{ display: 'flex' }}>
<p style={{ textAlign: 'left', marginTop: '5px', fontSize: '16px' }}>
{cardItems.agencyName} | 热度指数:{cardItems.viewTimes}
{item.agencyName} | 热度指数:{item.viewTimes}
</p>
</div>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment