Skip to content

Commit

Permalink
上传玩具图片 大小修复,
Browse files Browse the repository at this point in the history
首页chart库更换
  • Loading branch information
dsaco committed Oct 17, 2017
1 parent 159e7e9 commit 35b216b
Show file tree
Hide file tree
Showing 11 changed files with 109 additions and 232 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"react-select": "^1.0.0-rc.1",
"react-sortable-hoc": "^0.6.7",
"react-tagsinput": "^3.17.0",
"react-vis": "^1.7.2",
"recharts": "^1.0.0-alpha.6",
"redux": "^3.7.2",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.1.0",
Expand Down
24 changes: 12 additions & 12 deletions src/sass/metronic/customize.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@
padding: 0.5rem 0.75rem;
margin-left: -1px;
line-height: 1.25;
color: #007bff;
color: #337ab7;
background-color: #fff;
border: 1px solid #ddd;
text-decoration: none;
cursor: pointer;
&:focus,&:hover{
color: #0056b3;
text-decoration: none;
background-color: #e9ecef;
color: #23527c;
background-color: #eee;
border-color: #ddd;
}
}
Expand All @@ -56,18 +56,18 @@
}
&.active{
a{
z-index: 2;
color: #fff;
background-color: #007bff;
border-color: #007bff;
color: #fff;
cursor: default;
background-color: #337ab7;
border-color: #337ab7;
}
}
&.disabled {
a{
color: #868e96;
pointer-events: none;
background-color: #fff;
border-color: #ddd;
color: #777;
cursor: not-allowed;
background-color: #fff;
border-color: #ddd;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/components/Common/PlayToyPanel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default class PlayToyPanel extends Component {
<div key={`catalog_${toy.id}`} className="d-flex p-2 justify-content-between align-items-center">
<div className="d-flex">
<img style={{width:50,height:50}} className="play-img-cover" src={CDN.show(toy.cover)} alt=""/>
<h5 className="pl-2">{toy.name}</h5>
<h5 className="pl-2" style={{flex:1}}>{toy.name}</h5>
</div>
{this.props.children}
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/scripts/components/EditToy/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React,{ Component } from 'react'
import Request from 'superagent'
import Dropzone from 'react-dropzone'
import CDN from '../../widgets/cdn'
import { uploadImageWithWH,uploadFiles } from '../../widgets/upload'
import { uploadImageWithWH,uploadFiles,uploadImagesWithWH } from '../../widgets/upload'
import PlaySwitch from '../Common/playSwitch'
import Select from 'react-select'
// import PlayHtmlEditor from '../Common/PlayHtmlEditor'
Expand Down Expand Up @@ -75,7 +75,7 @@ export default class EditToy extends Component {
this.addOtherInfo = this._addOtherInfo.bind(this)
this.changeNewKey = (e) => this.setState({newKey:e.target.value})
this.changeNewValue = (e) => this.setState({newValue:e.target.value})
this.onDropOfficialImage = (files) => uploadFiles(files,`toy/img/${this.props.match.params.id}_`).then(keys => this.setState(prevState => ({images:prevState.images.concat(...keys)})))
this.onDropOfficialImage = (files) => uploadImagesWithWH(files,`toy/img/${this.props.match.params.id}_`).then(keys => this.setState(prevState => ({images:prevState.images.concat(...keys)})))
this.onDropCover = (files) => uploadImageWithWH(files[0],'toy/cover/').then(cover => this.setState({cover}))

this.submit = this._submit.bind(this)
Expand Down
160 changes: 2 additions & 158 deletions src/scripts/components/ExplorePage/ExplorePage.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React,{ Component } from 'react'
import { Row, Col, Button } from 'react-bootstrap'
import { Link } from 'react-router-dom'
import Request from 'superagent'
export default class ExplorePage extends Component{
Expand Down Expand Up @@ -28,7 +27,7 @@ export default class ExplorePage extends Component{
render() {
return(
<div>
<Row>
<div className="row">
<div className="m-portlet w-100">
<div className="m-portlet__body">
<div className="d-flex justify-content-between align-items-center">
Expand Down Expand Up @@ -189,162 +188,7 @@ export default class ExplorePage extends Component{
</div>
</div>
</div>
{/* <Col xs={12}>
<div className="portlet light ">
<div className="portlet-title tabbable-line">
<div className="caption caption-md">
<button onClick={this.addDraft} className="btn green btn-outline">创建草稿</button>
</div>
<ul className="nav nav-tabs">
<li className="active">
<a href="#explore_1" data-toggle="tab">发现页banner</a>
</li>
<li>
<a href="#explore_2" data-toggle="tab">发现页主题</a>
</li>
<li>
<a href="#explore_3" data-toggle="tab">玩具页Banner</a>
</li>
<li>
<a href="#explore_4" data-toggle="tab">草稿</a>
</li>
</ul>
</div>
<div className="portlet-body">
<div className="tab-content">
<div className="tab-pane active" id="explore_1">
{
this.props.banners ?
<table className="table table-striped">
<tbody>
{
this.props.banners.map((banner,index) =>{
return(
<tr key={'b_'+banner.id+index}>
<td>
<img src={banner.image} style={{width:150}} />
</td>
<td>
<span>{banner.title}</span>
</td>
<td style={{textAlign:'right'}}>
<Link className="btn btn-circle btn-icon-only btn-default" to={`/recommend/${banner.id}`}>
<i className="fa fa-edit"></i>
</Link>
<a className="btn btn-circle btn-icon-only btn-default" onClick={() => this.deleteBanner(banner.id)}>
<i className="fa fa-trash"></i>
</a>
</td>
</tr>
)
})
}
</tbody>
</table>
:null
}
</div>
<div className="tab-pane" id="explore_2">
{
this.props.themes ?
<table className="table table-striped">
<tbody>
{
this.props.themes.map((topic,index) =>{
return(
<tr key={'b_'+topic.id+index}>
<td>
<img src={topic.image} style={{width:150}} />
</td>
<td>
<span>{topic.title}</span>
</td>
<td style={{textAlign:'right'}}>
<Link className="btn btn-circle btn-icon-only btn-default" to={`/recommend/${topic.id}`}>
<i className="fa fa-edit"></i>
</Link>
<a className="btn btn-circle btn-icon-only btn-default" onClick={() => this.deleteTopic(topic.id)}>
<i className="fa fa-trash"></i>
</a>
</td>
</tr>
)
})
}
</tbody>
</table>
:null
}
</div>
<div className="tab-pane" id="explore_3">
{
this.props.toys?
<table className="table table-striped">
<tbody>
{
this.props.toys.map((toy,index) =>{
return(
<tr key={'b_'+toy.id+index}>
<td>
<img src={toy.image} style={{width:150}} />
</td>
<td>
<span>{toy.title}</span>
</td>
<td style={{textAlign:'right'}}>
<Link className="btn btn-circle btn-icon-only btn-default" to={`/recommend/${toy.id}`}>
<i className="fa fa-edit"></i>
</Link>
<a className="btn btn-circle btn-icon-only btn-default" onClick={() => this.deleteToy(toy.id)}>
<i className="fa fa-trash"></i>
</a>
</td>
</tr>
)
})
}
</tbody>
</table>
:null
}
</div>
<div className="tab-pane" id="explore_4">
{
this.props.drafts ?
<table className="table table-striped">
<tbody>
{
this.props.drafts.map((draft,index) =>{
return(
<tr key={'b_'+draft.id+index}>
<td>
<img src={draft.image} style={{width:150}} />
</td>
<td>
<span>{draft.title}</span>
</td>
<td style={{textAlign:'right'}}>
<Link className="btn btn-circle btn-icon-only btn-default" to={`/recommend/${draft.id}`}>
<i className="fa fa-edit"></i>
</Link>
<a className="btn btn-circle btn-icon-only btn-default" onClick={() => this.deleteDraft(draft.id)}>
<i className="fa fa-trash"></i>
</a>
</td>
</tr>
)
})
}
</tbody>
</table>
:null
}
</div>
</div>
</div>
</div>
</Col> */}
</Row>
</div>
</div>
)
}
Expand Down
Loading

0 comments on commit 35b216b

Please sign in to comment.