server side for getting items from cart
This commit is contained in:
47
front-ui/app/components/cart/cartPage.js
Normal file
47
front-ui/app/components/cart/cartPage.js
Normal file
@@ -0,0 +1,47 @@
|
||||
var React = require('react'),
|
||||
CartStore = require('../../stores/cartStore'),
|
||||
AddToCart = require('../cart/addToCart');
|
||||
|
||||
var Router = require('react-router');
|
||||
|
||||
|
||||
var ItemWithDetailsPage = React.createClass({
|
||||
|
||||
render: function() {
|
||||
|
||||
return (
|
||||
|
||||
<div className="cart-page row-fluid center">
|
||||
This is the cart page!
|
||||
|
||||
</div>
|
||||
);
|
||||
|
||||
},
|
||||
|
||||
// Add change listeners to stores
|
||||
componentDidMount: function() {
|
||||
CartStore.addChangeListener(this._onChange);
|
||||
|
||||
},
|
||||
|
||||
componentWillUnmount: function () {
|
||||
CartStore.removeChangeListener(this._onChange);
|
||||
},
|
||||
|
||||
_onChange: function () {
|
||||
|
||||
if (this.isMounted()) {
|
||||
this.setState(ItemDetailsStore.getState());
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
getInitialState: function () {
|
||||
return CartStore.getState();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
module.exports = ItemWithDetailsPage;
|
||||
@@ -10,7 +10,7 @@ var SingleItem = React.createClass({
|
||||
var self = this;
|
||||
var itemClick = this.itemClick;
|
||||
var firstImage = this.props.item.get('multi_media_descriptions')[0];
|
||||
firstImage = firstImage || { url: "http://res.cloudinary.com/lfvt7ps2n/image/upload/c_crop,g_center,w_300/v1421732950/http_www.asms.ru_bitrix_templates_main_images_nophoto_irnofq.png" } ;
|
||||
firstImage = firstImage || { url: "https://res.cloudinary.com/lfvt7ps2n/image/upload/c_crop,g_center,w_300/v1421732950/http_www.asms.ru_bitrix_templates_main_images_nophoto_irnofq.png" } ;
|
||||
return (
|
||||
<div className="single_item" onClick={itemClick}>
|
||||
<img src={firstImage.url} className="item_list_image" />
|
||||
|
||||
Reference in New Issue
Block a user