added instant delivery to gui / added RUC as abbr tag and details tag on mobile
This commit is contained in:
@@ -46,8 +46,8 @@ var CartPage = React.createClass({
|
|||||||
<div className="col-lg-6 text-right">
|
<div className="col-lg-6 text-right">
|
||||||
|
|
||||||
<CartTotal items={this.state.items} itemCounts={this.state.itemCounts} /><br />
|
<CartTotal items={this.state.items} itemCounts={this.state.itemCounts} /><br />
|
||||||
<CartTotal deliveryCosts={this.state.deliveryCosts}/><br />
|
<CartTotal deliveryCosts={this.state.deliveryCosts} instantDelivery={this.state.deliveryDestination.get('instant_delivery')}/><br />
|
||||||
<CartTotal items={this.state.items} itemCounts={this.state.itemCounts} deliveryCosts={this.state.deliveryCosts}/>
|
<CartTotal items={this.state.items} itemCounts={this.state.itemCounts} deliveryCosts={this.state.deliveryCosts} instantDelivery={this.state.deliveryDestination.get('instant_delivery')}/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -60,6 +60,12 @@ var CartPage = React.createClass({
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
var instantDelivery = (<div className="text-center">
|
||||||
|
<input type="checkbox"
|
||||||
|
checked={this.state.deliveryDestination.get('instant_delivery')} onChange={this._onInstantDeliveryChange}/>
|
||||||
|
{" Hitna dostava (ako naručite toku radnog dana do 16h) ili ujutru (ako naručite poslije 16h)"}
|
||||||
|
</div>);
|
||||||
|
|
||||||
var buySomethingMessage = (<div></div>);
|
var buySomethingMessage = (<div></div>);
|
||||||
var content;
|
var content;
|
||||||
|
|
||||||
@@ -91,6 +97,7 @@ var CartPage = React.createClass({
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
{buySomethingMessage}
|
{buySomethingMessage}
|
||||||
|
{instantDelivery}
|
||||||
{cartTotal}
|
{cartTotal}
|
||||||
</div>)
|
</div>)
|
||||||
}
|
}
|
||||||
@@ -133,9 +140,7 @@ var CartPage = React.createClass({
|
|||||||
{i.get('name')}
|
{i.get('name')}
|
||||||
</p>
|
</p>
|
||||||
</td>
|
</td>
|
||||||
<td className="cart-price-bigger text-center">{ Globals.FormatCurrency(price) }
|
<td className="cart-price-bigger text-center"> <abbr title={ Globals.FormatPercentage(commission) + " RUC"}>{ Globals.FormatCurrency(price) } </abbr>
|
||||||
<div className="cart-commision-tiny text-center">{ Globals.FormatPercentage(commission) } RUC</div>
|
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
<td >
|
<td >
|
||||||
<select style={{textAlign: 'center'}} value={count} className="form-control"
|
<select style={{textAlign: 'center'}} value={count} className="form-control"
|
||||||
@@ -179,9 +184,12 @@ var CartPage = React.createClass({
|
|||||||
{i.get('name')}
|
{i.get('name')}
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
|
<details>
|
||||||
|
<summary>
|
||||||
{ Globals.FormatCurrency(price) }
|
{ Globals.FormatCurrency(price) }
|
||||||
|
</summary>
|
||||||
<div className="cart-commision-tiny text-left">{ Globals.FormatPercentage(commission) } RUC</div>
|
<div className="cart-commision-tiny text-left">{ Globals.FormatPercentage(commission) } RUC</div>
|
||||||
|
</details>
|
||||||
</p>
|
</p>
|
||||||
</td>
|
</td>
|
||||||
<td className="col-sm-2 col-xs-2 col-md-2">
|
<td className="col-sm-2 col-xs-2 col-md-2">
|
||||||
@@ -223,6 +231,10 @@ var CartPage = React.createClass({
|
|||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_onInstantDeliveryChange: function () {
|
||||||
|
CartActions.changeDeliveryDestinationProperty("instant_delivery", !this.state.deliveryDestination.get('instant_delivery'));
|
||||||
|
},
|
||||||
_onOrderClick: function () {
|
_onOrderClick: function () {
|
||||||
NavigationActions.goToCheckout();
|
NavigationActions.goToCheckout();
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -9,11 +9,11 @@ var CartTotal = React.createClass({
|
|||||||
|
|
||||||
render: function() {
|
render: function() {
|
||||||
var counts = this.props.itemCounts;
|
var counts = this.props.itemCounts;
|
||||||
|
|
||||||
var total = 0;
|
var total = 0;
|
||||||
|
|
||||||
if (counts && this.props.items) {
|
if (counts && this.props.items) {
|
||||||
var items = this.props.items.models;
|
var items = this.props.items.models;
|
||||||
for (var i = 0; i < items.length; i++) {
|
for (var i = 0; i < items.length; i++) {
|
||||||
var item = items[i];
|
var item = items[i];
|
||||||
var count = counts[item.get('id')].get('count');
|
var count = counts[item.get('id')].get('count');
|
||||||
@@ -22,7 +22,11 @@ var CartTotal = React.createClass({
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
if (this.props.deliveryCosts) {
|
if (this.props.deliveryCosts) {
|
||||||
total += Number(this.props.deliveryCosts.get('delivery_price'))
|
if (this.props.instantDelivery) {
|
||||||
|
total += Number(this.props.deliveryCosts.get('instant_delivery_price'))
|
||||||
|
} else {
|
||||||
|
total += Number(this.props.deliveryCosts.get('delivery_price'))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ( < span > {
|
return ( < span > {
|
||||||
|
|||||||
@@ -6,16 +6,15 @@ var FREE_SHIPPING_LIMIT = 50;
|
|||||||
|
|
||||||
var Place = Backbone.Model.extend({
|
var Place = Backbone.Model.extend({
|
||||||
|
|
||||||
initialize: function(options) {
|
initialize: function(options) {
|
||||||
options || (options = {});
|
options || (options = {});
|
||||||
this.postalCode = options.postalCode;
|
this.postalCode = options.postalCode;
|
||||||
},
|
},
|
||||||
|
|
||||||
url: function() {
|
url: function() {
|
||||||
var postalCode = this.postalCode || "00000";
|
var postalCode = this.postalCode || "00000";
|
||||||
return Globals.ApiUrl + '/place/' + postalCode.trim();
|
return Globals.ApiUrl + '/place/' + postalCode.trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user