Merge branch 'master' of https://github.com/senaduka/ribica
This commit is contained in:
@@ -65,6 +65,13 @@ var NavigationActions = {
|
||||
actionType: NavigationConstants.CHANGE_URL,
|
||||
url: '/korpa'
|
||||
});
|
||||
},
|
||||
|
||||
goToCheckout: function() {
|
||||
AppDispatcher.handleAction({
|
||||
actionType: NavigationConstants.CHANGE_URL,
|
||||
url: '/dostava'
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ var CartPage = React.createClass({
|
||||
<div className="row cart-total">
|
||||
<CartTotal items={this.state.items} itemCounts={this.state.itemCounts} />
|
||||
<div className="col-md-1 span1">
|
||||
<button className="btn btn-warning" onClick={this._onOrderClick}>Naruči</button>
|
||||
<button className="btn btn-warning" onClick={this._onOrderClick}>Izgleda OK</button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
@@ -72,7 +72,7 @@ var CartPage = React.createClass({
|
||||
|
||||
},
|
||||
_onOrderClick: function () {
|
||||
//NavigationActions.goToCheckout();
|
||||
NavigationActions.goToCheckout();
|
||||
},
|
||||
|
||||
getInitialState: function () {
|
||||
|
||||
132
front-ui/app/components/cart/checkoutPage.js
Normal file
132
front-ui/app/components/cart/checkoutPage.js
Normal file
@@ -0,0 +1,132 @@
|
||||
var React = require('react'),
|
||||
CartStore = require('../../stores/cartStore'),
|
||||
AddToCart = require('../cart/addToCart'),
|
||||
CartActions = require('../../actions/cartActions'),
|
||||
NavigationActions = require('../../actions/navigationActions'),
|
||||
SingleItem = require('../items/singleItem'),
|
||||
Globals = require('../../globals'),
|
||||
CartTotal = require('./cartTotal');
|
||||
|
||||
|
||||
var Router = require('react-router');
|
||||
|
||||
|
||||
var CheckoutPage = React.createClass({
|
||||
|
||||
render: function() {
|
||||
|
||||
return (
|
||||
|
||||
<div className="checkout-page center">
|
||||
<form className="form-horizontal">
|
||||
<fieldset>
|
||||
|
||||
|
||||
<legend>Dostava</legend>
|
||||
|
||||
|
||||
<div className="form-group">
|
||||
<label className="col-md-4 control-label" htmlFor="name">Prezime i Ime</label>
|
||||
<div className="col-md-4">
|
||||
<input id="name" name="name" type="text" placeholder="Prezime Ime" className="form-control input-md" required="" />
|
||||
<span className="help-block">ime osobe koja prima pošiljku</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div className="form-group">
|
||||
<label className="col-md-4 control-label" htmlFor="address">Adresa</label>
|
||||
<div className="col-md-4">
|
||||
<input id="address" name="address" type="text" placeholder="Ulica i broj" className="form-control input-md" required="" />
|
||||
<span className="help-block">adresa na koju će roba biti isporučena</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div className="form-group">
|
||||
<label className="col-md-4 control-label" htmlFor="place">Mjesto</label>
|
||||
<div className="col-md-4">
|
||||
<select id="place" name="place" className="form-control">
|
||||
<option value="1">Sarajevo</option>
|
||||
<option value="2">Zenica</option>
|
||||
<option value="3">Tuzla</option>
|
||||
<option value="4">Mostar</option>
|
||||
<option value="5">Banja Luka</option>
|
||||
<option value="6">Bihać</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div className="form-group">
|
||||
<label className="col-md-4 control-label" htmlFor="phone">Telefon</label>
|
||||
<div className="col-md-4">
|
||||
<div className="input-group">
|
||||
<span className="input-group-addon">06</span>
|
||||
<input id="phone" name="phone" className="form-control" placeholder="1 222 333" type="text" required="" />
|
||||
</div>
|
||||
<p className="help-block">broj mobitela - mora biti sa jedne od mreža u BiH</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div className="form-group">
|
||||
<label className="col-md-4 control-label" htmlFor="email">E - mail</label>
|
||||
<div className="col-md-4">
|
||||
<input id="email" name="email" type="text" placeholder="ime@nekimail.com" className="form-control input-md" required="" />
|
||||
<span className="help-block">E - mail adresa na koju će vam biti poslano obavještenje o narudžbi</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div className="form-group">
|
||||
<label className="col-md-4 control-label" htmlFor="note">Napomena</label>
|
||||
<div className="col-md-4">
|
||||
<textarea className="form-control" id="note" name="note"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="form-group">
|
||||
<label className="col-md-4 control-label" htmlFor="order"></label>
|
||||
<div className="col-md-8">
|
||||
<CartTotal items={this.state.items} itemCounts={this.state.itemCounts} /> <button id="order" name="order" className="btn btn-success">Naruči</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</fieldset>
|
||||
</form>
|
||||
|
||||
|
||||
</div>
|
||||
);
|
||||
|
||||
},
|
||||
|
||||
// Add change listeners to stores
|
||||
componentDidMount: function() {
|
||||
CartStore.addChangeListener(this._onChange);
|
||||
CartActions.load();
|
||||
},
|
||||
|
||||
componentWillUnmount: function () {
|
||||
CartStore.removeChangeListener(this._onChange);
|
||||
},
|
||||
|
||||
_onChange: function () {
|
||||
if (this.isMounted()) {
|
||||
this.setState(CartStore.getWholeCartState());
|
||||
}
|
||||
|
||||
},
|
||||
_onOrderClick: function () {
|
||||
//NavigationActions.goToCheckout();
|
||||
},
|
||||
|
||||
getInitialState: function () {
|
||||
return CartStore.getWholeCartState();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
module.exports = CheckoutPage;
|
||||
@@ -9,6 +9,7 @@ var ItemList = require('./components/items/itemList');
|
||||
var SectionsListComponent = require('./components/shared/sectionsListComponent');
|
||||
var AllItems = require('./components/items/allItems');
|
||||
var CartPage = require('./components/cart/cartPage');
|
||||
var CheckoutPage = require('./components/cart/checkoutPage');
|
||||
var RootApp = require('./components/rootApp');
|
||||
var StartPage = require('./components/startPage/startPage');
|
||||
var ByCategory = require('./components/browsing/byCategory');
|
||||
@@ -23,6 +24,7 @@ var routes = (
|
||||
<Route name='sekcija' path='sekcija/:id/:name' handler={BySection} />
|
||||
<Route name='artikal' path="artikal/:id/*" handler={ItemWithDetailsPage} />
|
||||
<Route name='korpa' path="/korpa" handler={CartPage} />
|
||||
<Route name='dostava' path="/dostava" handler={CheckoutPage} />
|
||||
<Route name='registracija' path="/registracija" handler={Register} />
|
||||
<Route name='login' path="/login" handler={Login} />
|
||||
<Route name='byCat' path="sekcija/:sekcijaName/kategorija/:id/*" handler={ByCategory} />
|
||||
|
||||
Reference in New Issue
Block a user