Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dcarfixers_angular
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
16
Issues
16
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tobin
dcarfixers_angular
Commits
af095a74
Commit
af095a74
authored
Jun 11, 2019
by
amalk
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into amal
parents
01b00457
c556e615
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
313 additions
and
63 deletions
+313
-63
dashboard.component.ts
src/app/home/dashboard/dashboard.component.ts
+1
-1
index.component.ts
src/app/home/index/index.component.ts
+1
-1
addaddress.component.ts
src/app/purchase/addaddress/addaddress.component.ts
+26
-9
address.component.html
src/app/purchase/address/address.component.html
+1
-1
address.component.ts
src/app/purchase/address/address.component.ts
+1
-1
cart.component.html
src/app/purchase/cart/cart.component.html
+0
-0
cart.component.scss
src/app/purchase/cart/cart.component.scss
+3
-0
cart.component.ts
src/app/purchase/cart/cart.component.ts
+156
-11
orders.component.html
src/app/purchase/orders/orders.component.html
+30
-5
orders.component.ts
src/app/purchase/orders/orders.component.ts
+45
-7
productdetails.component.html
...app/purchase/productdetails/productdetails.component.html
+11
-9
productdetails.component.ts
src/app/purchase/productdetails/productdetails.component.ts
+24
-2
productlist.component.html
src/app/purchase/productlist/productlist.component.html
+3
-3
productlist.component.ts
src/app/purchase/productlist/productlist.component.ts
+1
-1
purchase-home.component.html
src/app/purchase/purchase-home/purchase-home.component.html
+6
-6
purchase-home.component.scss
src/app/purchase/purchase-home/purchase-home.component.scss
+1
-1
summary.component.ts
src/app/purchase/summary/summary.component.ts
+0
-1
track.component.html
src/app/purchase/track/track.component.html
+2
-3
track.component.scss
src/app/purchase/track/track.component.scss
+1
-0
track.component.ts
src/app/purchase/track/track.component.ts
+0
-1
No files found.
src/app/home/dashboard/dashboard.component.ts
View file @
af095a74
...
@@ -742,7 +742,7 @@ export class DashboardComponent implements OnInit {
...
@@ -742,7 +742,7 @@ export class DashboardComponent implements OnInit {
}
}
scheduleNow
(
mechanic_id
,
cost
){
scheduleNow
(
mechanic_id
,
cost
){
this
.
wizardData
[
'mechanic_id'
]
=
mechanic_id
;
this
.
wizardData
[
'mechanic_id'
]
=
mechanic_id
+
':'
+
cost
;
if
(
!
this
.
loginDetails
){
if
(
!
this
.
loginDetails
){
this
.
routeToIndex
();
this
.
routeToIndex
();
...
...
src/app/home/index/index.component.ts
View file @
af095a74
...
@@ -445,7 +445,7 @@ export class IndexComponent implements OnInit {
...
@@ -445,7 +445,7 @@ export class IndexComponent implements OnInit {
}
}
scheduleNow
(
mechanic_id
,
cost
){
scheduleNow
(
mechanic_id
,
cost
){
this
.
wizardData
[
'mechanic_id'
]
=
mechanic_id
;
this
.
wizardData
[
'mechanic_id'
]
=
mechanic_id
+
':'
+
cost
;
if
(
!
this
.
loginDetails
){
if
(
!
this
.
loginDetails
){
this
.
autoSchedule
=
true
;
this
.
autoSchedule
=
true
;
...
...
src/app/purchase/addaddress/addaddress.component.ts
View file @
af095a74
...
@@ -42,12 +42,6 @@ export class AddaddressComponent implements OnInit {
...
@@ -42,12 +42,6 @@ export class AddaddressComponent implements OnInit {
}
}
ngOnInit
()
{
ngOnInit
()
{
this
.
prdtData
=
JSON
.
parse
(
this
.
webService
.
getLocalStorageItem
(
'productDetails'
));
this
.
subjectService
.
getLoginData
().
subscribe
(
loginData
=>
{
this
.
loginDetails
=
JSON
.
parse
(
this
.
webService
.
getLocalStorageItem
(
'userData'
));
});
this
.
checkProductId
(
this
.
prdtData
[
'product_id'
]);
this
.
route
.
params
.
subscribe
(
val
=>
{
this
.
route
.
params
.
subscribe
(
val
=>
{
this
.
route
.
queryParams
.
subscribe
(
params
=>
{
this
.
route
.
queryParams
.
subscribe
(
params
=>
{
this
.
address_id
=
params
[
'address_id'
];
this
.
address_id
=
params
[
'address_id'
];
...
@@ -56,6 +50,9 @@ export class AddaddressComponent implements OnInit {
...
@@ -56,6 +50,9 @@ export class AddaddressComponent implements OnInit {
if
(
this
.
address_id
!=
''
){
if
(
this
.
address_id
!=
''
){
this
.
getUserAddressById
(
this
.
address_id
);
this
.
getUserAddressById
(
this
.
address_id
);
}
}
this
.
checkUserLogin
();
this
.
checkProductId
();
this
.
buildAddressForm
();
this
.
buildAddressForm
();
}
}
...
@@ -72,14 +69,34 @@ export class AddaddressComponent implements OnInit {
...
@@ -72,14 +69,34 @@ export class AddaddressComponent implements OnInit {
});
});
}
}
checkProductId
(
product_id
){
// checkProductId(product_id){
if
(
product_id
>
0
){
// if(product_id > 0){
this
.
product_id
=
product_id
;
// this.product_id = product_id;
// }else{
// this.goToPage('purchaseHome','');
// }
// }
checkProductId
(){
this
.
prdtData
=
JSON
.
parse
(
this
.
webService
.
getLocalStorageItem
(
'productDetails'
));
if
(
this
.
prdtData
&&
this
.
prdtData
[
'product_id'
]
>
0
){
this
.
product_id
=
this
.
prdtData
[
'product_id'
];
}
else
{
}
else
{
this
.
goToPage
(
'purchaseHome'
,
''
);
this
.
goToPage
(
'purchaseHome'
,
''
);
}
}
}
}
checkUserLogin
(){
this
.
loginDetails
=
JSON
.
parse
(
this
.
webService
.
getLocalStorageItem
(
'userData'
));
if
(
!
this
.
loginDetails
){
this
.
goToPage
(
'purchaseHome'
,
''
);
}
this
.
subjectService
.
getLoginData
().
subscribe
(
loginData
=>
{
this
.
loginDetails
=
JSON
.
parse
(
this
.
webService
.
getLocalStorageItem
(
'userData'
));
});
}
addressFormSubmit
(
data
){
addressFormSubmit
(
data
){
if
(
this
.
addaddressForm
.
invalid
){
if
(
this
.
addaddressForm
.
invalid
){
return
false
;
return
false
;
...
...
src/app/purchase/address/address.component.html
View file @
af095a74
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
</ng-template>
</ng-template>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-md-6"
>
<div
class=
"col-md-6"
>
<h2>
$ {{prdtData.total_amount}}
</h2>
<h2
*
ngIf=
"prdtData"
>
$ {{prdtData.total_amount}}
</h2>
<!-- <h5>Delivery expected by Thur 1 May 2019</h5> -->
<!-- <h5>Delivery expected by Thur 1 May 2019</h5> -->
</div>
</div>
...
...
src/app/purchase/address/address.component.ts
View file @
af095a74
...
@@ -42,7 +42,7 @@ export class AddressComponent implements OnInit {
...
@@ -42,7 +42,7 @@ export class AddressComponent implements OnInit {
checkProductId
(){
checkProductId
(){
this
.
prdtData
=
JSON
.
parse
(
this
.
webService
.
getLocalStorageItem
(
'productDetails'
));
this
.
prdtData
=
JSON
.
parse
(
this
.
webService
.
getLocalStorageItem
(
'productDetails'
));
console
.
log
(
this
.
prdtData
)
if
(
this
.
prdtData
&&
this
.
prdtData
[
'product_id'
]
>
0
){
if
(
this
.
prdtData
&&
this
.
prdtData
[
'product_id'
]
>
0
){
this
.
product_id
=
this
.
prdtData
[
'product_id'
];
this
.
product_id
=
this
.
prdtData
[
'product_id'
];
}
else
{
}
else
{
...
...
src/app/purchase/cart/cart.component.html
View file @
af095a74
This diff is collapsed.
Click to expand it.
src/app/purchase/cart/cart.component.scss
View file @
af095a74
...
@@ -3,6 +3,9 @@
...
@@ -3,6 +3,9 @@
width
:
100%
;
width
:
100%
;
ul
{
ul
{
padding
:
0px
;
padding
:
0px
;
&
:
:-
webkit-scrollbar
{
display
:
none
;
}
li
{
li
{
list-style
:
none
;
list-style
:
none
;
background
:
#fff
;
background
:
#fff
;
...
...
src/app/purchase/cart/cart.component.ts
View file @
af095a74
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
Component
,
OnInit
,
ViewChild
,
ElementRef
}
from
'@angular/core'
;
import
{
NgxCarousel
}
from
'ngx-carousel'
;
import
{
NgxCarousel
}
from
'ngx-carousel'
;
import
{
WebService
}
from
'../../provider/web.service'
;
import
{
ImageStorage
}
from
'../../../environments/server.config'
;
import
{
Router
,
ActivatedRoute
}
from
'@angular/router'
;
import
{
Router
,
ActivatedRoute
}
from
'@angular/router'
;
@
Component
({
@
Component
({
...
@@ -9,32 +11,175 @@ import { Router,ActivatedRoute } from '@angular/router';
...
@@ -9,32 +11,175 @@ import { Router,ActivatedRoute } from '@angular/router';
})
})
export
class
CartComponent
implements
OnInit
{
export
class
CartComponent
implements
OnInit
{
count
:
any
;
count
:
any
;
loginDetails
:
any
;
loader
:
boolean
;
cartData
:
any
;
page
:
number
=
1
;
total_page
:
number
=
1
;
imageServer
:
any
;
trend_loader
:
boolean
;
trendingProductData
:
any
;
product_data
:
any
;
cartQuantity
:
any
[]
=
new
Array
();
confirmParam
:
string
=
''
;
confirmCallBak
:
string
=
''
;
@
ViewChild
(
"confirmModal"
)
public
confirmModalRef
:
ElementRef
;
public
carouselTile
:
NgxCarousel
;
public
carouselTile
:
NgxCarousel
;
constructor
(
constructor
(
private
router
:
Router
,
private
router
:
Router
,
private
route
:
ActivatedRoute
private
route
:
ActivatedRoute
,
public
webService
:
WebService
)
{
)
{
this
.
count
=
0
;
this
.
count
=
1
;
this
.
loader
=
true
;
this
.
imageServer
=
ImageStorage
;
this
.
trend_loader
=
true
;
}
}
add
(){
add
(
cart_id
:
number
){
this
.
count
=
this
.
count
+
1
;
if
(
this
.
cartQuantity
[
cart_id
]
&&
this
.
cartQuantity
[
cart_id
][
'quantity'
]
<
15
){
this
.
cartQuantity
[
cart_id
][
'quantity'
]
=
this
.
cartQuantity
[
cart_id
][
'quantity'
]
+
1
;
this
.
cartQuantity
[
cart_id
][
'total_amount'
]
=
this
.
cartQuantity
[
cart_id
][
'amount'
]
*
this
.
cartQuantity
[
cart_id
][
'quantity'
];
}
}
}
minus
(){
minus
(
cart_id
:
number
){
this
.
count
=
this
.
count
-
1
;
if
(
this
.
cartQuantity
[
cart_id
]
&&
this
.
cartQuantity
[
cart_id
][
'quantity'
]
>
1
){
if
(
this
.
count
<
0
){
this
.
cartQuantity
[
cart_id
][
'quantity'
]
=
this
.
cartQuantity
[
cart_id
][
'quantity'
]
-
1
;
this
.
c
ount
=
0
;
this
.
c
artQuantity
[
cart_id
][
'total_amount'
]
=
this
.
cartQuantity
[
cart_id
][
'amount'
]
*
this
.
cartQuantity
[
cart_id
][
'quantity'
]
;
}
}
}
}
ngOnInit
()
{
ngOnInit
()
{
this
.
checkUserLogin
();
this
.
getCartData
();
this
.
trendingProducts
();
this
.
carouselTile
=
{
grid
:
{
xs
:
1
,
sm
:
2
,
md
:
4
,
lg
:
8
,
all
:
0
},
slide
:
1
,
speed
:
400
,
point
:
{
visible
:
false
},
load
:
2
,
touch
:
true
,
easing
:
'ease'
}
this
.
carouselTile
=
{
grid
:
{
xs
:
1
,
sm
:
2
,
md
:
4
,
lg
:
8
,
all
:
0
},
slide
:
1
,
speed
:
400
,
point
:
{
visible
:
false
},
load
:
2
,
touch
:
true
,
easing
:
'ease'
}
}
}
checkUserLogin
(){
this
.
loginDetails
=
JSON
.
parse
(
this
.
webService
.
getLocalStorageItem
(
'userData'
));
if
(
!
this
.
loginDetails
){
this
.
goToPage
(
'purchaseHome'
,
''
);
}
}
getCartData
(){
if
(
!
this
.
loginDetails
||
!
this
.
loginDetails
.
customer_id
){
return
false
;
}
this
.
loader
=
true
;
this
.
webService
.
post_data
(
'getCartData'
,{
'customer_id'
:
this
.
loginDetails
.
customer_id
,
'page'
:
this
.
page
}).
subscribe
(
response
=>
{
if
(
response
.
status
==
'success'
){
this
.
cartData
=
response
.
data
;
const
thisObj
=
this
;
let
tempArr
:
any
=
Array
();
this
.
cartData
.
forEach
(
function
(
data
,
key
)
{
tempArr
[
data
.
cart_id
]
=
{
'quantity'
:
+
data
.
quantity
,
'amount'
:
data
.
amount
,
'total_amount'
:
data
.
quantity
*
data
.
amount
};
});
thisObj
.
cartQuantity
=
tempArr
;
}
else
{
this
.
cartData
=
false
;
}
this
.
loader
=
false
;
})
}
trendingProducts
(){
this
.
trend_loader
=
true
;
this
.
webService
.
post_data
(
'getTrendingPrdts'
,{
'page'
:
this
.
page
}).
subscribe
(
response
=>
{
if
(
response
.
status
==
'success'
){
this
.
trendingProductData
=
response
.
data
;
}
else
{
this
.
trendingProductData
=
false
;
}
this
.
trend_loader
=
false
;
});
}
removeProduct
(
params
){
this
.
page
=
1
;
this
.
loader
=
true
;
this
.
webService
.
post_data
(
'removeCartPrdt'
,
params
).
subscribe
(
response
=>
{
if
(
response
.
status
==
'success'
){
this
.
getCartData
();
}
this
.
trend_loader
=
false
;
});
}
cnfRemoveProduct
(
cartId
){
if
(
cartId
<
0
){
return
false
;
}
this
.
showConfirmPopUp
(
'removeProduct'
,{
'cart_id'
:
cartId
});
}
showConfirmPopUp
(
fn_name
:
string
,
param
:
any
){
if
(
fn_name
===
''
){
return
false
;
}
if
(
param
){
param
=
JSON
.
stringify
(
param
);
}
this
.
confirmParam
=
param
;
this
.
confirmCallBak
=
fn_name
;
this
.
confirmModalRef
.
nativeElement
.
click
();
}
confirmCallBack
(
fn_name
:
string
,
param
:
string
){
if
(
fn_name
===
''
||
!
this
[
fn_name
]){
return
false
;
}
if
(
param
!==
''
){
param
=
JSON
.
parse
(
param
);
this
[
fn_name
](
param
);
}
else
{
this
[
fn_name
]();
}
}
onScroll
(){
if
(
this
.
total_page
<
this
.
page
){
return
false
;
}
this
.
page
+=
1
;
this
.
loader
=
true
;
this
.
webService
.
post_data
(
'getCartData'
,{
'customer_id'
:
this
.
loginDetails
.
customer_id
,
'page'
:
this
.
page
}).
subscribe
(
response
=>
{
if
(
response
.
status
==
'success'
){
let
thisObj
=
this
;
response
.
data
.
forEach
(
function
(
cartData
,
key
)
{
thisObj
.
cartData
.
push
(
cartData
);
});
}
this
.
loader
=
false
;
});
}
latestPrdtDtls
(
prdt_id
){
this
.
goToPage
(
'productdetails'
,{
"product_id"
:
prdt_id
});
}
buyProduct
(
product_id
,
total_amount
,
cartId
,
quantity
,
amount
){
if
(
cartId
<=
0
||
product_id
<=
0
||
total_amount
<=
0
||
quantity
<=
0
||
amount
<=
0
){
return
false
;
}
this
.
loader
=
true
;
this
.
webService
.
post_data
(
'removeCartPrdt'
,{
'cart_id'
:
cartId
}).
subscribe
(
response
=>
{
if
(
response
.
status
==
'success'
){
this
.
product_data
=
{
amount
:
amount
,
product_id
:
product_id
,
quantity
:
quantity
,
total_amount
:
total_amount
};
this
.
webService
.
setLocalStorageItem
(
'productDetails'
,
JSON
.
stringify
(
this
.
product_data
));
this
.
goToPage
(
'address'
,
''
);
}
this
.
loader
=
false
;
});
}
goToPage
(
path
,
data
=
null
){
goToPage
(
path
,
data
=
null
){
this
.
router
.
navigate
ByUrl
(
path
,{
queryParams
:
data
});
this
.
router
.
navigate
([
path
],{
queryParams
:
data
});
document
.
body
.
scrollTop
=
document
.
documentElement
.
scrollTop
=
0
;
document
.
body
.
scrollTop
=
document
.
documentElement
.
scrollTop
=
0
;
}
}
...
...
src/app/purchase/orders/orders.component.html
View file @
af095a74
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
<!-- <h4><div>Color</div><span>Black</span></h4> -->
<!-- <h4><div>Color</div><span>Black</span></h4> -->
<h4><div>
Quantity
</div><span>
{{book.quantity}}
</span></h4>
<h4><div>
Quantity
</div><span>
{{book.quantity}}
</span></h4>
</div>
</div>
<h4><span>
{{book.format_order_id}}
</span><strong
(
click
)="
trackOrder
(
book
.
transId
)"
*
ngIf=
"(book.status == '2' || book.status == '3' || book.status == '4' || book.status == '5')"
>
Track Order
</strong></h4>
<h4
class=
"cpoint"
><span>
{{book.format_order_id}}
</span><strong
(
click
)="
trackOrder
(
book
.
transId
)"
*
ngIf=
"(book.status == '2' || book.status == '3' || book.status == '4' || book.status == '5')"
>
Track Order
</strong></h4>
<h4><div
style=
"width:auto !important;"
>
Ordered On
</div><span>
{{book.datetime | date: "EEE, MMMM dd, yyyy"}}
</span></h4>
<h4><div
style=
"width:auto !important;"
>
Ordered On
</div><span>
{{book.datetime | date: "EEE, MMMM dd, yyyy"}}
</span></h4>
</div>
</div>
<div
class=
"clear"
></div>
<div
class=
"clear"
></div>
...
@@ -38,7 +38,7 @@
...
@@ -38,7 +38,7 @@
<h4
*
ngIf =
"book.status == '7'"
>
<h4
*
ngIf =
"book.status == '7'"
>
<div
*
ngIf=
"book.status == '7'"
>
This item is Canceled
</div>
<div
*
ngIf=
"book.status == '7'"
>
This item is Canceled
</div>
</h4>
</h4>
<div
class=
"cancel
"
*
ngIf=
"(book.status == '2' || book.status == '3'|| book.status == '4')"
(
click
)="
c
ancelOrder
(
book
.
order_id
)"
>
Cancel Item
</div>
<div
class=
"cancel
cpoint"
*
ngIf=
"(book.status == '2' || book.status == '3'|| book.status == '4')"
(
click
)="
cnfC
ancelOrder
(
book
.
order_id
)"
>
Cancel Item
</div>
<div
class=
"clear"
></div>
<div
class=
"clear"
></div>
</div>
</div>
</div>
</div>
...
@@ -60,7 +60,7 @@
...
@@ -60,7 +60,7 @@
<h5>
{{prdt.product_name}}
</h5>
<h5>
{{prdt.product_name}}
</h5>
<p>
{{prdt.short_description}}
</p>
<p>
{{prdt.short_description}}
</p>
<div
class=
"star_ratting"
>
<div
class=
"star_ratting"
>
<fieldset
class=
"rating
"
*
ngIf=
"prdt.rating > 0
"
>
<fieldset
class=
"rating
prevent-click
"
>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 4.75) ? 'true':''" [attr.id]="'thirdStar_'+prdt.product_id+'_5'" [attr.name]="'thirdStarName_'+prdt.product_id" value="5" />
<label
class =
"full"
for=
"thirdStar5"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 4.75) ? 'true':''" [attr.id]="'thirdStar_'+prdt.product_id+'_5'" [attr.name]="'thirdStarName_'+prdt.product_id" value="5" />
<label
class =
"full"
for=
"thirdStar5"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 4.25
&&
prdt.rating
<
4
.
75
)
?
'
true
'
:
''"
[
attr
.
id
]="'
thirdStar_
'+
prdt
.
product_id
+'
_4half
'"
[
attr
.
name
]="'
thirdStarName_
'+
prdt
.
product_id
"
value=
"4.5"
/><label
class=
"half"
for=
"thirdStar4half"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 4.25
&&
prdt.rating
<
4
.
75
)
?
'
true
'
:
''"
[
attr
.
id
]="'
thirdStar_
'+
prdt
.
product_id
+'
_4half
'"
[
attr
.
name
]="'
thirdStarName_
'+
prdt
.
product_id
"
value=
"4.5"
/><label
class=
"half"
for=
"thirdStar4half"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 3.75
&&
prdt.rating
<
4
.
25
)
?
'
true
'
:
''"
[
attr
.
id
]="'
thirdStar_
'+
prdt
.
product_id
+'
_4
'"
[
attr
.
name
]="'
thirdStarName_
'+
prdt
.
product_id
"
value=
"4"
/><label
class =
"full"
for=
"thirdStar4"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 3.75
&&
prdt.rating
<
4
.
25
)
?
'
true
'
:
''"
[
attr
.
id
]="'
thirdStar_
'+
prdt
.
product_id
+'
_4
'"
[
attr
.
name
]="'
thirdStarName_
'+
prdt
.
product_id
"
value=
"4"
/><label
class =
"full"
for=
"thirdStar4"
></label>
...
@@ -70,11 +70,11 @@
...
@@ -70,11 +70,11 @@
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 1.75
&&
prdt.rating
<
2
.
25
)
?
'
true
'
:
''"
[
attr
.
id
]="'
thirdStar_
'+
prdt
.
product_id
+'
_2
'"
[
attr
.
name
]="'
thirdStarName_
'+
prdt
.
product_id
"
value=
"2"
/><label
class =
"full"
for=
"thirdStar2"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 1.75
&&
prdt.rating
<
2
.
25
)
?
'
true
'
:
''"
[
attr
.
id
]="'
thirdStar_
'+
prdt
.
product_id
+'
_2
'"
[
attr
.
name
]="'
thirdStarName_
'+
prdt
.
product_id
"
value=
"2"
/><label
class =
"full"
for=
"thirdStar2"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 1.25
&&
prdt.rating
<
1
.
75
)
?
'
true
'
:
''"
[
attr
.
id
]="'
thirdStar_
'+
prdt
.
product_id
+'
_1half
'"
[
attr
.
name
]="'
thirdStarName_
'+
prdt
.
product_id
"
value=
"1.5"
/><label
class=
"half"
for=
"thirdStar1half"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 1.25
&&
prdt.rating
<
1
.
75
)
?
'
true
'
:
''"
[
attr
.
id
]="'
thirdStar_
'+
prdt
.
product_id
+'
_1half
'"
[
attr
.
name
]="'
thirdStarName_
'+
prdt
.
product_id
"
value=
"1.5"
/><label
class=
"half"
for=
"thirdStar1half"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 0.75
&&
prdt.rating
<
1
.
25
)
?
'
true
'
:
''"
[
attr
.
id
]="'
thirdStar_
'+
prdt
.
product_id
+'
_1
'"
[
attr
.
name
]="'
thirdStarName_
'+
prdt
.
product_id
"
value=
"1"
/><label
class =
"full"
for=
"thirdStar1"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 0.75
&&
prdt.rating
<
1
.
25
)
?
'
true
'
:
''"
[
attr
.
id
]="'
thirdStar_
'+
prdt
.
product_id
+'
_1
'"
[
attr
.
name
]="'
thirdStarName_
'+
prdt
.
product_id
"
value=
"1"
/><label
class =
"full"
for=
"thirdStar1"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
<
0
.
75
)
?
'
true
'
:
''"
[
attr
.
id
]="'
thirdStar_
'+
prdt
.
product_id
+'
_half
'"
[
attr
.
name
]="'
thirdStarName_
'+
prdt
.
product_id
"
value=
"0.5"
/><label
class=
"half"
for=
"thirdStarhalf"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
<
0
.
75
&&
prdt
.
rating
>
= 0.25
) ? 'true':''" [attr.id]="'thirdStar_'+prdt.product_id+'_half'" [attr.name]="'thirdStarName_'+prdt.product_id" value="0.5" />
<label
class=
"half"
for=
"thirdStarhalf"
></label>
</fieldset>
</fieldset>
<span
class=
"floatRight"
>
$ {{prdt.amount}}
</span>
<span
class=
"floatRight"
>
$ {{prdt.amount}}
</span>
<div
class=
"clear"
></div>
<div
class=
"clear"
></div>
<p>
{{
prdt.reviews}} Reviews
</p>
<p>
{{
(prdt.reviews > 0)?prdt.reviews+' Reviews':'Be the first one to review.'}}
</p>
</div>
</div>
</div>
</div>
</li>
</li>
...
@@ -84,3 +84,27 @@
...
@@ -84,3 +84,27 @@
</ngx-carousel>
</ngx-carousel>
</div>
</div>
</div>
</div>
<!-- Confirm Modal PopUp-->
<button
#
confirmModal
class=
"hide"
data-toggle=
"modal"
data-target=
"#confirm"
>
Add Vehicle
</button>
<div
class=
"modal"
id=
"confirm"
>
<div
class=
"modal-dialog modal-full"
>
<div
class=
"modal-content background_transparent"
>
<div
class=
"modal-body quote_modal"
>
<div
class=
"confirm_modal_content"
>
<div
class=
"login_modal_inner"
>
<div
class=
"login_success"
>
<h4>
Do You Want to Confirm ?
</h4>
</div>
<div
class=
"row"
>
<div
class=
"col-md-12 textCenter"
>
<button
class=
"btn btn-success"
data-dismiss=
"modal"
(
click
)="
confirmCallBack
(
confirmCallBak
,
confirmParam
)"
>
Yes
</button>
<button
class=
"btn btn-danger"
data-dismiss=
"modal"
>
No
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
src/app/purchase/orders/orders.component.ts
View file @
af095a74
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
Component
,
OnInit
,
ViewChild
,
ElementRef
}
from
'@angular/core'
;
import
{
NgxCarousel
}
from
'ngx-carousel'
;
import
{
NgxCarousel
}
from
'ngx-carousel'
;
import
{
WebService
}
from
'../../provider/web.service'
;
import
{
WebService
}
from
'../../provider/web.service'
;
import
{
ImageStorage
}
from
'../../../environments/server.config'
;
import
{
ImageStorage
}
from
'../../../environments/server.config'
;
...
@@ -19,6 +19,10 @@ export class OrdersComponent implements OnInit {
...
@@ -19,6 +19,10 @@ export class OrdersComponent implements OnInit {
imageServer
:
string
;
imageServer
:
string
;
trend_loader
:
boolean
;
trend_loader
:
boolean
;
trendingProductData
:
any
;
trendingProductData
:
any
;
confirmParam
:
string
=
''
;
confirmCallBak
:
string
=
''
;
@
ViewChild
(
"confirmModal"
)
public
confirmModalRef
:
ElementRef
;
public
carouselTile
:
NgxCarousel
;
public
carouselTile
:
NgxCarousel
;
...
@@ -36,14 +40,20 @@ export class OrdersComponent implements OnInit {
...
@@ -36,14 +40,20 @@ export class OrdersComponent implements OnInit {
this
.
checkUserLogin
();
this
.
checkUserLogin
();
this
.
getMyOrders
();
this
.
getMyOrders
();
this
.
trendingProducts
();
this
.
trendingProducts
();
this
.
carouselTile
=
{
grid
:
{
xs
:
1
,
sm
:
2
,
md
:
4
,
lg
:
8
,
all
:
0
},
slide
:
1
,
speed
:
400
,
point
:
{
visible
:
false
},
load
:
2
,
touch
:
true
,
easing
:
'ease'
}
this
.
carouselTile
=
{
grid
:
{
xs
:
1
,
sm
:
2
,
md
:
4
,
lg
:
8
,
all
:
0
},
slide
:
1
,
speed
:
400
,
point
:
{
visible
:
false
},
load
:
2
,
touch
:
true
,
easing
:
'ease'
,
loop
:
true
}
}
}
checkUserLogin
(){
checkUserLogin
(){
this
.
loginDetails
=
JSON
.
parse
(
this
.
webService
.
getLocalStorageItem
(
'userData'
));
this
.
loginDetails
=
JSON
.
parse
(
this
.
webService
.
getLocalStorageItem
(
'userData'
));
if
(
!
this
.
loginDetails
){
this
.
goToPage
(
'purchaseHome'
,
''
);
}
}
}
getMyOrders
(){
getMyOrders
(){
if
(
!
this
.
loginDetails
){
this
.
goToPage
(
'purchaseHome'
,
''
);
}
this
.
loader
=
true
;
this
.
loader
=
true
;
this
.
webService
.
post_data
(
'getMyOrders'
,{
"customer_id"
:
this
.
loginDetails
.
customer_id
,
'page'
:
this
.
page
}).
subscribe
(
response
=>
{
this
.
webService
.
post_data
(
'getMyOrders'
,{
"customer_id"
:
this
.
loginDetails
.
customer_id
,
'page'
:
this
.
page
}).
subscribe
(
response
=>
{
if
(
response
.
status
==
'success'
){
if
(
response
.
status
==
'success'
){
...
@@ -78,12 +88,9 @@ export class OrdersComponent implements OnInit {
...
@@ -78,12 +88,9 @@ export class OrdersComponent implements OnInit {
});
});
}
}
cancelOrder
(
odrId
){
cancelOrder
(
params
){
if
(
odrId
<
0
){
return
false
;
}
this
.
loader
=
true
;
this
.
loader
=
true
;
this
.
webService
.
post_data
(
'cancelOrder'
,
{
"order_id"
:
odrId
}
).
subscribe
(
response
=>
{
this
.
webService
.
post_data
(
'cancelOrder'
,
params
).
subscribe
(
response
=>
{
if
(
response
.
status
==
'success'
){
if
(
response
.
status
==
'success'
){
this
.
getMyOrders
();
this
.
getMyOrders
();
}
}
...
@@ -91,6 +98,37 @@ export class OrdersComponent implements OnInit {
...
@@ -91,6 +98,37 @@ export class OrdersComponent implements OnInit {
})
})
}
}
cnfCancelOrder
(
odrId
){
if
(
odrId
<
0
){
return
false
;
}
this
.
showConfirmPopUp
(
'cancelOrder'
,{
"order_id"
:
odrId
});
}
showConfirmPopUp
(
fn_name
:
string
,
param
:
any
){
if
(
fn_name
===
''
){
return
false
;
}
if
(
param
){
param
=
JSON
.
stringify
(
param
);
}
this
.
confirmParam
=
param
;
this
.
confirmCallBak
=
fn_name
;
this
.
confirmModalRef
.
nativeElement
.
click
();
}
confirmCallBack
(
fn_name
:
string
,
param
:
string
){
if
(
fn_name
===
''
||
!
this
[
fn_name
]){
return
false
;
}
if
(
param
!==
''
){
param
=
JSON
.
parse
(
param
);
this
[
fn_name
](
param
);
}
else
{
this
[
fn_name
]();
}
}
trendingProducts
(){
trendingProducts
(){
this
.
trend_loader
=
true
;
this
.
trend_loader
=
true
;
this
.
webService
.
get_data
(
'getTrendingPrdts'
).
subscribe
(
response
=>
{
this
.
webService
.
get_data
(
'getTrendingPrdts'
).
subscribe
(
response
=>
{
...
...
src/app/purchase/productdetails/productdetails.component.html
View file @
af095a74
...
@@ -20,6 +20,8 @@
...
@@ -20,6 +20,8 @@
<div
class=
"product_details"
>
<div
class=
"product_details"
>
<h1>
{{productDetails.product_name}}
</h1>
<h1>
{{productDetails.product_name}}
</h1>
<h2>
{{productDetails.short_description}}
</h2>
<h2>
{{productDetails.short_description}}
</h2>
<h4><div>
Brand
</div><span>
{{productDetails.brand_name}}
</span></h4>
<h4><div>
Part ID
</div><span>
PRD152685425
</span></h4>
<h3>
$ {{productDetails.amount}}
</h3>
<h3>
$ {{productDetails.amount}}
</h3>
<div
class=
"rating_div"
*
ngIf=
"productDetails.rating"
>
<div
class=
"rating_div"
*
ngIf=
"productDetails.rating"
>
<fieldset
class=
"rating prevent-click"
>
<fieldset
class=
"rating prevent-click"
>
...
@@ -32,7 +34,7 @@
...
@@ -32,7 +34,7 @@
<input
type=
"radio"
[
checked
]="(
productDetails
.
rating
>
= 1.75
&&
productDetails.rating
<
2
.
25
)
?
'
true
'
:
''"
id=
"firstStar2"
name=
"firstRating"
value=
"2"
/><label
class =
"full"
for=
"firstStar2"
></label>
<input
type=
"radio"
[
checked
]="(
productDetails
.
rating
>
= 1.75
&&
productDetails.rating
<
2
.
25
)
?
'
true
'
:
''"
id=
"firstStar2"
name=
"firstRating"
value=
"2"
/><label
class =
"full"
for=
"firstStar2"
></label>
<input
type=
"radio"
[
checked
]="(
productDetails
.
rating
>
= 1.25
&&
productDetails.rating
<
1
.
75
)
?
'
true
'
:
''"
id=
"firstStar1half"
name=
"firstRating"
value=
"1.5"
/><label
class=
"half"
for=
"firstStar1half"
></label>
<input
type=
"radio"
[
checked
]="(
productDetails
.
rating
>
= 1.25
&&
productDetails.rating
<
1
.
75
)
?
'
true
'
:
''"
id=
"firstStar1half"
name=
"firstRating"
value=
"1.5"
/><label
class=
"half"
for=
"firstStar1half"
></label>
<input
type=
"radio"
[
checked
]="(
productDetails
.
rating
>
= 0.75
&&
productDetails.rating
<
1
.
25
)
?
'
true
'
:
''"
id=
"firstStar1"
name=
"firstRating"
value=
"1"
/><label
class =
"full"
for=
"firstStar1"
></label>
<input
type=
"radio"
[
checked
]="(
productDetails
.
rating
>
= 0.75
&&
productDetails.rating
<
1
.
25
)
?
'
true
'
:
''"
id=
"firstStar1"
name=
"firstRating"
value=
"1"
/><label
class =
"full"
for=
"firstStar1"
></label>
<input
type=
"radio"
[
checked
]="(
productDetails
.
rating
<
0
.
75
)
?
'
true
'
:
''"
id=
"firstStarhalf"
name=
"firstRating"
value=
"0.5"
/><label
class=
"half"
for=
"firstStarhalf"
></label>
<input
type=
"radio"
[
checked
]="(
productDetails
.
rating
<
0
.
75
&&
productDetails
.
rating
>
= 0.25
) ? 'true':''" id="firstStarhalf" name="firstRating" value="0.5" />
<label
class=
"half"
for=
"firstStarhalf"
></label>
</fieldset>
</fieldset>
<div
class=
"clear"
></div>
<div
class=
"clear"
></div>
</div>
</div>
...
@@ -46,8 +48,8 @@
...
@@ -46,8 +48,8 @@
<div
class=
"count_btn"
(
click
)="
add
()"
>
+
</div>
<div
class=
"count_btn"
(
click
)="
add
()"
>
+
</div>
</div>
</div>
<div
class=
"btn_bay"
>
<div
class=
"btn_bay"
>
<button
class=
"btn_cart btn"
>
Add to Cart
</button>
<button
class=
"btn_cart btn"
(
click
)="
addToCart
(
productDetails
.
amount
)"
*
ngIf=
"loginDetails && cartValue == '1'"
>
Add to Cart
</button>
<
!-- <button class="btn_buy btn" (click)="goToPage('address')">Buy Now</button> --
>
<
button
class=
"btn_cart btn"
(
click
)="
goCart
()"
*
ngIf=
"loginDetails && cartValue == '2'"
>
Go to Cart
</button
>
<button
class=
"btn_buy btn"
(
click
)="
buyProduct
(
productDetails
.
amount
)"
>
{{loginDetails?'Buy Now':'Login And Continue'}}
</button>
<button
class=
"btn_buy btn"
(
click
)="
buyProduct
(
productDetails
.
amount
)"
>
{{loginDetails?'Buy Now':'Login And Continue'}}
</button>
</div>
</div>
</div>
</div>
...
@@ -65,7 +67,7 @@
...
@@ -65,7 +67,7 @@
<input
type=
"radio"
[
checked
]="(
productDetails
.
rating
>
= 1.75
&&
productDetails.rating
<
2
.
25
)
?
'
true
'
:
''"
id=
"secondStar2"
name=
"secondRating"
value=
"2"
/><label
class =
"full"
for=
"secondStar2"
></label>
<input
type=
"radio"
[
checked
]="(
productDetails
.
rating
>
= 1.75
&&
productDetails.rating
<
2
.
25
)
?
'
true
'
:
''"
id=
"secondStar2"
name=
"secondRating"
value=
"2"
/><label
class =
"full"
for=
"secondStar2"
></label>
<input
type=
"radio"
[
checked
]="(
productDetails
.
rating
>
= 1.25
&&
productDetails.rating
<
1
.
75
)
?
'
true
'
:
''"
id=
"secondStar1half"
name=
"secondRating"
value=
"1.5"
/><label
class=
"half"
for=
"secondStar1half"
></label>
<input
type=
"radio"
[
checked
]="(
productDetails
.
rating
>
= 1.25
&&
productDetails.rating
<
1
.
75
)
?
'
true
'
:
''"
id=
"secondStar1half"
name=
"secondRating"
value=
"1.5"
/><label
class=
"half"
for=
"secondStar1half"
></label>
<input
type=
"radio"
[
checked
]="(
productDetails
.
rating
>
= 0.75
&&
productDetails.rating
<
1
.
25
)
?
'
true
'
:
''"
id=
"secondStar1"
name=
"secondRating"
value=
"1"
/><label
class =
"full"
for=
"secondStar1"
></label>
<input
type=
"radio"
[
checked
]="(
productDetails
.
rating
>
= 0.75
&&
productDetails.rating
<
1
.
25
)
?
'
true
'
:
''"
id=
"secondStar1"
name=
"secondRating"
value=
"1"
/><label
class =
"full"
for=
"secondStar1"
></label>
<input
type=
"radio"
[
checked
]="(
productDetails
.
rating
<
0
.
75
)
?
'
true
'
:
''"
id=
"secondStarhalf"
name=
"secondRating"
value=
"0.5"
/><label
class=
"half"
for=
"secondStarhalf"
></label>
<input
type=
"radio"
[
checked
]="(
productDetails
.
rating
<
0
.
75
&&
productDetails
.
rating
>
= 0.25
) ? 'true':''" id="secondStarhalf" name="secondRating" value="0.5" />
<label
class=
"half"
for=
"secondStarhalf"
></label>
</fieldset>
</fieldset>
<div
class=
"clear"
></div>
<div
class=
"clear"
></div>
</div>
</div>
...
@@ -90,7 +92,7 @@
...
@@ -90,7 +92,7 @@
<input
type=
"radio"
[
checked
]="(
revws
.
rating
>
= 1.75
&&
revws.rating
<
2
.
25
)
?
'
true
'
:
''"
[
attr
.
id
]="'
usrReviewId_
'+
revws
.
id
+'
_2
'"
[
attr
.
name
]="'
usrReviewName_
'+
revws
.
id
"
value=
"2"
/><label
class =
"full"
for=
"secondStar2"
></label>
<input
type=
"radio"
[
checked
]="(
revws
.
rating
>
= 1.75
&&
revws.rating
<
2
.
25
)
?
'
true
'
:
''"
[
attr
.
id
]="'
usrReviewId_
'+
revws
.
id
+'
_2
'"
[
attr
.
name
]="'
usrReviewName_
'+
revws
.
id
"
value=
"2"
/><label
class =
"full"
for=
"secondStar2"
></label>
<input
type=
"radio"
[
checked
]="(
revws
.
rating
>
= 1.25
&&
revws.rating
<
1
.
75
)
?
'
true
'
:
''"
[
attr
.
id
]="'
usrReviewId_
'+
revws
.
id
+'
_1half
'"
[
attr
.
name
]="'
usrReviewName_
'+
revws
.
id
"
value=
"1.5"
/><label
class=
"half"
for=
"secondStar1half"
></label>
<input
type=
"radio"
[
checked
]="(
revws
.
rating
>
= 1.25
&&
revws.rating
<
1
.
75
)
?
'
true
'
:
''"
[
attr
.
id
]="'
usrReviewId_
'+
revws
.
id
+'
_1half
'"
[
attr
.
name
]="'
usrReviewName_
'+
revws
.
id
"
value=
"1.5"
/><label
class=
"half"
for=
"secondStar1half"
></label>
<input
type=
"radio"
[
checked
]="(
revws
.
rating
>
= 0.75
&&
revws.rating
<
1
.
25
)
?
'
true
'
:
''"
[
attr
.
id
]="'
usrReviewId_
'+
revws
.
id
+'
_1
'"
[
attr
.
name
]="'
usrReviewName_
'+
revws
.
id
"
value=
"1"
/><label
class =
"full"
for=
"secondStar1"
></label>
<input
type=
"radio"
[
checked
]="(
revws
.
rating
>
= 0.75
&&
revws.rating
<
1
.
25
)
?
'
true
'
:
''"
[
attr
.
id
]="'
usrReviewId_
'+
revws
.
id
+'
_1
'"
[
attr
.
name
]="'
usrReviewName_
'+
revws
.
id
"
value=
"1"
/><label
class =
"full"
for=
"secondStar1"
></label>
<input
type=
"radio"
[
checked
]="(
revws
.
rating
<
0
.
75
)
?
'
true
'
:
''"
[
attr
.
id
]="'
usrReviewId_
'+
revws
.
id
+'
_half
'"
[
attr
.
name
]="'
usrReviewName_
'+
revws
.
id
"
value=
"0.5"
/><label
class=
"half"
for=
"secondStarhalf"
></label>
<input
type=
"radio"
[
checked
]="(
revws
.
rating
<
0
.
75
&&
revws
.
rating
>
= 0.25
) ? 'true':''" [attr.id]="'usrReviewId_'+revws.id+'_half'" [attr.name]="'usrReviewName_'+revws.id" value="0.5" />
<label
class=
"half"
for=
"secondStarhalf"
></label>
</fieldset>
</fieldset>
</div>
</div>
<div
class=
"clear"
></div>
<div
class=
"clear"
></div>
...
@@ -117,8 +119,8 @@
...
@@ -117,8 +119,8 @@
</div>
</div>
<h5>
{{prdt.product_name}}
</h5>
<h5>
{{prdt.product_name}}
</h5>
<p>
{{prdt.short_description}}
</p>
<p>
{{prdt.short_description}}
</p>
<div
class=
"star_ratting"
>
<div
class=
"star_ratting
prevent-click
"
>
<fieldset
class=
"rating"
*
ngIf=
"prdt.rating > 0"
>
<fieldset
class=
"rating"
>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 4.75) ? 'true':''" [attr.id]="'thirdStar_'+prdt.product_id+'_5'" [attr.name]="'thirdStarName_'+prdt.product_id" value="5" />
<label
class =
"full"
for=
"thirdStar5"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 4.75) ? 'true':''" [attr.id]="'thirdStar_'+prdt.product_id+'_5'" [attr.name]="'thirdStarName_'+prdt.product_id" value="5" />
<label
class =
"full"
for=
"thirdStar5"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 4.25
&&
prdt.rating
<
4
.
75
)
?
'
true
'
:
''"
[
attr
.
id
]="'
thirdStar_
'+
prdt
.
product_id
+'
_4half
'"
[
attr
.
name
]="'
thirdStarName_
'+
prdt
.
product_id
"
value=
"4.5"
/><label
class=
"half"
for=
"thirdStar4half"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 4.25
&&
prdt.rating
<
4
.
75
)
?
'
true
'
:
''"
[
attr
.
id
]="'
thirdStar_
'+
prdt
.
product_id
+'
_4half
'"
[
attr
.
name
]="'
thirdStarName_
'+
prdt
.
product_id
"
value=
"4.5"
/><label
class=
"half"
for=
"thirdStar4half"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 3.75
&&
prdt.rating
<
4
.
25
)
?
'
true
'
:
''"
[
attr
.
id
]="'
thirdStar_
'+
prdt
.
product_id
+'
_4
'"
[
attr
.
name
]="'
thirdStarName_
'+
prdt
.
product_id
"
value=
"4"
/><label
class =
"full"
for=
"thirdStar4"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 3.75
&&
prdt.rating
<
4
.
25
)
?
'
true
'
:
''"
[
attr
.
id
]="'
thirdStar_
'+
prdt
.
product_id
+'
_4
'"
[
attr
.
name
]="'
thirdStarName_
'+
prdt
.
product_id
"
value=
"4"
/><label
class =
"full"
for=
"thirdStar4"
></label>
...
@@ -128,11 +130,11 @@
...
@@ -128,11 +130,11 @@
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 1.75
&&
prdt.rating
<
2
.
25
)
?
'
true
'
:
''"
[
attr
.
id
]="'
thirdStar_
'+
prdt
.
product_id
+'
_2
'"
[
attr
.
name
]="'
thirdStarName_
'+
prdt
.
product_id
"
value=
"2"
/><label
class =
"full"
for=
"thirdStar2"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 1.75
&&
prdt.rating
<
2
.
25
)
?
'
true
'
:
''"
[
attr
.
id
]="'
thirdStar_
'+
prdt
.
product_id
+'
_2
'"
[
attr
.
name
]="'
thirdStarName_
'+
prdt
.
product_id
"
value=
"2"
/><label
class =
"full"
for=
"thirdStar2"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 1.25
&&
prdt.rating
<
1
.
75
)
?
'
true
'
:
''"
[
attr
.
id
]="'
thirdStar_
'+
prdt
.
product_id
+'
_1half
'"
[
attr
.
name
]="'
thirdStarName_
'+
prdt
.
product_id
"
value=
"1.5"
/><label
class=
"half"
for=
"thirdStar1half"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 1.25
&&
prdt.rating
<
1
.
75
)
?
'
true
'
:
''"
[
attr
.
id
]="'
thirdStar_
'+
prdt
.
product_id
+'
_1half
'"
[
attr
.
name
]="'
thirdStarName_
'+
prdt
.
product_id
"
value=
"1.5"
/><label
class=
"half"
for=
"thirdStar1half"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 0.75
&&
prdt.rating
<
1
.
25
)
?
'
true
'
:
''"
[
attr
.
id
]="'
thirdStar_
'+
prdt
.
product_id
+'
_1
'"
[
attr
.
name
]="'
thirdStarName_
'+
prdt
.
product_id
"
value=
"1"
/><label
class =
"full"
for=
"thirdStar1"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 0.75
&&
prdt.rating
<
1
.
25
)
?
'
true
'
:
''"
[
attr
.
id
]="'
thirdStar_
'+
prdt
.
product_id
+'
_1
'"
[
attr
.
name
]="'
thirdStarName_
'+
prdt
.
product_id
"
value=
"1"
/><label
class =
"full"
for=
"thirdStar1"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
<
0
.
75
)
?
'
true
'
:
''"
[
attr
.
id
]="'
thirdStar_
'+
prdt
.
product_id
+'
_half
'"
[
attr
.
name
]="'
thirdStarName_
'+
prdt
.
product_id
"
value=
"0.5"
/><label
class=
"half"
for=
"thirdStarhalf"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
<
0
.
75
&&
prdt
.
rating
>
= 0.25
) ? 'true':''" [attr.id]="'thirdStar_'+prdt.product_id+'_half'" [attr.name]="'thirdStarName_'+prdt.product_id" value="0.5" />
<label
class=
"half"
for=
"thirdStarhalf"
></label>
</fieldset>
</fieldset>
<span
class=
"floatRight"
>
$ {{prdt.amount}}
</span>
<span
class=
"floatRight"
>
$ {{prdt.amount}}
</span>
<div
class=
"clear"
></div>
<div
class=
"clear"
></div>
<p>
{{
prdt.reviews}} Reviews
</p>
<p>
{{
(prdt.reviews > 0)?prdt.reviews+' Reviews':'Be the first one to review.'}}
</p>
</div>
</div>
</div>
</div>
</li>
</li>
...
...
src/app/purchase/productdetails/productdetails.component.ts
View file @
af095a74
...
@@ -29,6 +29,7 @@ export class ProductdetailsComponent implements OnInit {
...
@@ -29,6 +29,7 @@ export class ProductdetailsComponent implements OnInit {
page
:
number
=
1
;
page
:
number
=
1
;
reviewArray
:
any
=
new
Array
();
reviewArray
:
any
=
new
Array
();
total_page
:
number
=
1
;
total_page
:
number
=
1
;
cartValue
:
number
=
1
;
@
ViewChild
(
"indexLoginModal"
)
loginModalRef
:
ElementRef
;
@
ViewChild
(
"indexLoginModal"
)
loginModalRef
:
ElementRef
;
...
@@ -88,7 +89,7 @@ export class ProductdetailsComponent implements OnInit {
...
@@ -88,7 +89,7 @@ export class ProductdetailsComponent implements OnInit {
this
.
productDetails
=
response
.
data
;
this
.
productDetails
=
response
.
data
;
this
.
reviewArray
=
response
.
data
.
reviews
.
data
;
this
.
reviewArray
=
response
.
data
.
reviews
.
data
;
this
.
total_page
=
response
.
data
.
reviews
.
meta
.
total_pages
;
this
.
total_page
=
response
.
data
.
reviews
.
meta
.
total_pages
;
console
.
log
(
response
.
data
)
this
.
cartValue
=
(
this
.
productDetails
.
cart_id
>
0
)
?
2
:
1
;
if
(
this
.
productDetails
.
images
.
length
>
0
){
if
(
this
.
productDetails
.
images
.
length
>
0
){
thisObj
.
productDetails
.
images
.
forEach
(
function
(
data
)
{
thisObj
.
productDetails
.
images
.
forEach
(
function
(
data
)
{
image
=
thisObj
.
imageServer
+
data
.
image
;
image
=
thisObj
.
imageServer
+
data
.
image
;
...
@@ -146,6 +147,27 @@ export class ProductdetailsComponent implements OnInit {
...
@@ -146,6 +147,27 @@ export class ProductdetailsComponent implements OnInit {
this
.
goToPage
(
'address'
,
''
);
this
.
goToPage
(
'address'
,
''
);
}
}
addToCart
(
amount
){
if
(
!
this
.
loginDetails
){
this
.
loginModalRef
.
nativeElement
.
click
();
return
false
;
}
this
.
loader
=
true
;
this
.
product_data
=
{
product_id
:
this
.
product_id
,
quantity
:
this
.
count
,
amount
:
this
.
count
*
amount
,
customer_id
:
this
.
loginDetails
.
customer_id
};
this
.
webService
.
post_data
(
'addToCart'
,
this
.
product_data
).
subscribe
(
response
=>
{
if
(
response
.
status
==
'success'
){
if
(
response
.
data
>
0
){
this
.
cartValue
=
2
;
}
}
this
.
loader
=
false
;
});
}
goCart
(){
this
.
goToPage
(
'cart'
,
''
);
}
latestPrdtDtls
(
prdt_id
){
latestPrdtDtls
(
prdt_id
){
this
.
goToPage
(
'productdetails'
,{
"product_id"
:
prdt_id
});
this
.
goToPage
(
'productdetails'
,{
"product_id"
:
prdt_id
});
}
}
...
@@ -156,7 +178,7 @@ export class ProductdetailsComponent implements OnInit {
...
@@ -156,7 +178,7 @@ export class ProductdetailsComponent implements OnInit {
}
}
designModules
(){
designModules
(){
this
.
carouselTile
=
{
grid
:
{
xs
:
1
,
sm
:
2
,
md
:
4
,
lg
:
8
,
all
:
0
},
slide
:
1
,
speed
:
400
,
point
:
{
visible
:
false
},
load
:
2
,
touch
:
true
,
easing
:
'ease'
}
this
.
carouselTile
=
{
grid
:
{
xs
:
1
,
sm
:
2
,
md
:
4
,
lg
:
8
,
all
:
0
},
slide
:
1
,
speed
:
400
,
point
:
{
visible
:
false
},
load
:
2
,
touch
:
true
,
easing
:
'ease'
,
loop
:
true
}
this
.
galleryOptions
=
[
this
.
galleryOptions
=
[
{
{
width
:
'100%'
,
width
:
'100%'
,
...
...
src/app/purchase/productlist/productlist.component.html
View file @
af095a74
...
@@ -54,7 +54,7 @@
...
@@ -54,7 +54,7 @@
<div
class=
"search_list_header"
>
<div
class=
"search_list_header"
>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-md-8"
>
<div
class=
"col-md-8"
>
<p>
S
howing 1 -40 of 202 results for "Audi tyres"
</p>
<p>
S
earch Results
</p>
</div>
</div>
<!-- <div class="col-md-4">
<!-- <div class="col-md-4">
<select class="floatRight">
<select class="floatRight">
...
@@ -76,7 +76,7 @@
...
@@ -76,7 +76,7 @@
<h5>
{{prdt.product_name}}
</h5>
<h5>
{{prdt.product_name}}
</h5>
<p>
{{prdt.short_description}}
</p>
<p>
{{prdt.short_description}}
</p>
<div
class=
"star_ratting"
>
<div
class=
"star_ratting"
>
<fieldset
class=
"rating
"
*
ngIf=
"prdt.rating > 0
"
>
<fieldset
class=
"rating
prevent-click hide
"
>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 4.75) ? 'true':''" [attr.id]="'usrReviewId_'+prdt.product_id+'_5'" [attr.name]="'usrReviewName_'+prdt.product_id" value="5" />
<label
class =
"full"
for=
"secondStar5"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 4.75) ? 'true':''" [attr.id]="'usrReviewId_'+prdt.product_id+'_5'" [attr.name]="'usrReviewName_'+prdt.product_id" value="5" />
<label
class =
"full"
for=
"secondStar5"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 4.25
&&
prdt.rating
<
4
.
75
)
?
'
true
'
:
''"
[
attr
.
id
]="'
usrReviewId_
'+
prdt
.
product_id
+'
_4half
'"
[
attr
.
name
]="'
usrReviewName_
'+
prdt
.
product_id
"
value=
"4.5"
/><label
class=
"half"
for=
"secondStar4half"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 4.25
&&
prdt.rating
<
4
.
75
)
?
'
true
'
:
''"
[
attr
.
id
]="'
usrReviewId_
'+
prdt
.
product_id
+'
_4half
'"
[
attr
.
name
]="'
usrReviewName_
'+
prdt
.
product_id
"
value=
"4.5"
/><label
class=
"half"
for=
"secondStar4half"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 3.75
&&
prdt.rating
<
4
.
25
)
?
'
true
'
:
''"
[
attr
.
id
]="'
usrReviewId_
'+
prdt
.
product_id
+'
_4
'"
[
attr
.
name
]="'
usrReviewName_
'+
prdt
.
product_id
"
value=
"4"
/><label
class =
"full"
for=
"secondStar4"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 3.75
&&
prdt.rating
<
4
.
25
)
?
'
true
'
:
''"
[
attr
.
id
]="'
usrReviewId_
'+
prdt
.
product_id
+'
_4
'"
[
attr
.
name
]="'
usrReviewName_
'+
prdt
.
product_id
"
value=
"4"
/><label
class =
"full"
for=
"secondStar4"
></label>
...
@@ -86,7 +86,7 @@
...
@@ -86,7 +86,7 @@
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 1.75
&&
prdt.rating
<
2
.
25
)
?
'
true
'
:
''"
[
attr
.
id
]="'
usrReviewId_
'+
prdt
.
product_id
+'
_2
'"
[
attr
.
name
]="'
usrReviewName_
'+
prdt
.
product_id
"
value=
"2"
/><label
class =
"full"
for=
"secondStar2"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 1.75
&&
prdt.rating
<
2
.
25
)
?
'
true
'
:
''"
[
attr
.
id
]="'
usrReviewId_
'+
prdt
.
product_id
+'
_2
'"
[
attr
.
name
]="'
usrReviewName_
'+
prdt
.
product_id
"
value=
"2"
/><label
class =
"full"
for=
"secondStar2"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 1.25
&&
prdt.rating
<
1
.
75
)
?
'
true
'
:
''"
[
attr
.
id
]="'
usrReviewId_
'+
prdt
.
product_id
+'
_1half
'"
[
attr
.
name
]="'
usrReviewName_
'+
prdt
.
product_id
"
value=
"1.5"
/><label
class=
"half"
for=
"secondStar1half"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 1.25
&&
prdt.rating
<
1
.
75
)
?
'
true
'
:
''"
[
attr
.
id
]="'
usrReviewId_
'+
prdt
.
product_id
+'
_1half
'"
[
attr
.
name
]="'
usrReviewName_
'+
prdt
.
product_id
"
value=
"1.5"
/><label
class=
"half"
for=
"secondStar1half"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 0.75
&&
prdt.rating
<
1
.
25
)
?
'
true
'
:
''"
[
attr
.
id
]="'
usrReviewId_
'+
prdt
.
product_id
+'
_1
'"
[
attr
.
name
]="'
usrReviewName_
'+
prdt
.
product_id
"
value=
"1"
/><label
class =
"full"
for=
"secondStar1"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 0.75
&&
prdt.rating
<
1
.
25
)
?
'
true
'
:
''"
[
attr
.
id
]="'
usrReviewId_
'+
prdt
.
product_id
+'
_1
'"
[
attr
.
name
]="'
usrReviewName_
'+
prdt
.
product_id
"
value=
"1"
/><label
class =
"full"
for=
"secondStar1"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
<
0
.
75
)
?
'
true
'
:
''"
[
attr
.
id
]="'
usrReviewId_
'+
prdt
.
product_id
+'
_half
'"
[
attr
.
name
]="'
usrReviewName_
'+
prdt
.
product_id
"
value=
"0.5"
/><label
class=
"half"
for=
"secondStarhalf"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
<
0
.
75
&&
prdt
.
rating
>
= 0.25
) ? 'true':''" [attr.id]="'usrReviewId_'+prdt.product_id+'_half'" [attr.name]="'usrReviewName_'+prdt.product_id" value="0.5" />
<label
class=
"half"
for=
"secondStarhalf"
></label>
</fieldset>
</fieldset>
<span
class=
"floatRight"
>
$ {{prdt.amount}}
</span>
<span
class=
"floatRight"
>
$ {{prdt.amount}}
</span>
<div
class=
"clear"
></div>
<div
class=
"clear"
></div>
...
...
src/app/purchase/productlist/productlist.component.ts
View file @
af095a74
...
@@ -31,8 +31,8 @@ export class ProductlistComponent implements OnInit {
...
@@ -31,8 +31,8 @@ export class ProductlistComponent implements OnInit {
this
.
loader
=
true
;
this
.
loader
=
true
;
this
.
productArray
=
[];
this
.
productArray
=
[];
this
.
filterParam
=
{
"key"
:
''
,
"brand_id"
:
Array
(),
"minPrice"
:
''
,
"maxPrice"
:
''
,
'page'
:
1
};
this
.
filterParam
=
{
"key"
:
''
,
"brand_id"
:
Array
(),
"minPrice"
:
''
,
"maxPrice"
:
''
,
'page'
:
1
};
this
.
imageServer
=
ImageStorage
;
this
.
imageServer
=
ImageStorage
;
route
.
params
.
subscribe
(
val
=>
{
route
.
params
.
subscribe
(
val
=>
{
this
.
route
.
queryParams
.
subscribe
(
params
=>
{
this
.
route
.
queryParams
.
subscribe
(
params
=>
{
this
.
searchKey
=
params
[
'key'
];
this
.
searchKey
=
params
[
'key'
];
...
...
src/app/purchase/purchase-home/purchase-home.component.html
View file @
af095a74
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
<h5>
{{prdt.product_name}}
</h5>
<h5>
{{prdt.product_name}}
</h5>
<p>
{{prdt.short_description}}
</p>
<p>
{{prdt.short_description}}
</p>
<div
class=
"star_ratting"
>
<div
class=
"star_ratting"
>
<fieldset
class=
"rating
"
*
ngIf=
"prdt.rating > 0
"
>
<fieldset
class=
"rating
prevent-click
"
>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 4.75) ? 'true':''" [attr.id]="'usrStar_'+prdt.product_id+'_5'" [attr.name]="'usrStarName_'+prdt.product_id" value="5" />
<label
class =
"full"
for=
"secondStar5"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 4.75) ? 'true':''" [attr.id]="'usrStar_'+prdt.product_id+'_5'" [attr.name]="'usrStarName_'+prdt.product_id" value="5" />
<label
class =
"full"
for=
"secondStar5"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 4.25
&&
prdt.rating
<
4
.
75
)
?
'
true
'
:
''"
[
attr
.
id
]="'
usrStar_
'+
prdt
.
product_id
+'
_4half
'"
[
attr
.
name
]="'
usrStarName_
'+
prdt
.
product_id
"
value=
"4.5"
/><label
class=
"half"
for=
"secondStar4half"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 4.25
&&
prdt.rating
<
4
.
75
)
?
'
true
'
:
''"
[
attr
.
id
]="'
usrStar_
'+
prdt
.
product_id
+'
_4half
'"
[
attr
.
name
]="'
usrStarName_
'+
prdt
.
product_id
"
value=
"4.5"
/><label
class=
"half"
for=
"secondStar4half"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 3.75
&&
prdt.rating
<
4
.
25
)
?
'
true
'
:
''"
[
attr
.
id
]="'
usrStar_
'+
prdt
.
product_id
+'
_4
'"
[
attr
.
name
]="'
usrStarName_
'+
prdt
.
product_id
"
value=
"4"
/><label
class =
"full"
for=
"secondStar4"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 3.75
&&
prdt.rating
<
4
.
25
)
?
'
true
'
:
''"
[
attr
.
id
]="'
usrStar_
'+
prdt
.
product_id
+'
_4
'"
[
attr
.
name
]="'
usrStarName_
'+
prdt
.
product_id
"
value=
"4"
/><label
class =
"full"
for=
"secondStar4"
></label>
...
@@ -29,11 +29,11 @@
...
@@ -29,11 +29,11 @@
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 1.75
&&
prdt.rating
<
2
.
25
)
?
'
true
'
:
''"
[
attr
.
id
]="'
usrStar_
'+
prdt
.
product_id
+'
_2
'"
[
attr
.
name
]="'
usrStarName_
'+
prdt
.
product_id
"
value=
"2"
/><label
class =
"full"
for=
"secondStar2"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 1.75
&&
prdt.rating
<
2
.
25
)
?
'
true
'
:
''"
[
attr
.
id
]="'
usrStar_
'+
prdt
.
product_id
+'
_2
'"
[
attr
.
name
]="'
usrStarName_
'+
prdt
.
product_id
"
value=
"2"
/><label
class =
"full"
for=
"secondStar2"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 1.25
&&
prdt.rating
<
1
.
75
)
?
'
true
'
:
''"
[
attr
.
id
]="'
usrStar_
'+
prdt
.
product_id
+'
_1half
'"
[
attr
.
name
]="'
usrStarName_
'+
prdt
.
product_id
"
value=
"1.5"
/><label
class=
"half"
for=
"secondStar1half"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 1.25
&&
prdt.rating
<
1
.
75
)
?
'
true
'
:
''"
[
attr
.
id
]="'
usrStar_
'+
prdt
.
product_id
+'
_1half
'"
[
attr
.
name
]="'
usrStarName_
'+
prdt
.
product_id
"
value=
"1.5"
/><label
class=
"half"
for=
"secondStar1half"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 0.75
&&
prdt.rating
<
1
.
25
)
?
'
true
'
:
''"
[
attr
.
id
]="'
usrStar_
'+
prdt
.
product_id
+'
_1
'"
[
attr
.
name
]="'
usrStarName_
'+
prdt
.
product_id
"
value=
"1"
/><label
class =
"full"
for=
"secondStar1"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 0.75
&&
prdt.rating
<
1
.
25
)
?
'
true
'
:
''"
[
attr
.
id
]="'
usrStar_
'+
prdt
.
product_id
+'
_1
'"
[
attr
.
name
]="'
usrStarName_
'+
prdt
.
product_id
"
value=
"1"
/><label
class =
"full"
for=
"secondStar1"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
<
0
.
75
)
?
'
true
'
:
''"
[
attr
.
id
]="'
usrStar_
'+
prdt
.
product_id
+'
_half
'"
[
attr
.
name
]="'
usrStarName_
'+
prdt
.
product_id
"
value=
"0.5"
/><label
class=
"half"
for=
"secondStarhalf"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
<
0
.
75
&&
prdt
.
rating
>
= 0.25
) ? 'true':''" [attr.id]="'usrStar_'+prdt.product_id+'_half'" [attr.name]="'usrStarName_'+prdt.product_id" value="0.5" />
<label
class=
"half"
for=
"secondStarhalf"
></label>
</fieldset>
</fieldset>
<span
class=
"floatRight"
>
$ {{prdt.amount}}
</span>
<span
class=
"floatRight"
>
$ {{prdt.amount}}
</span>
<div
class=
"clear"
></div>
<div
class=
"clear"
></div>
<p>
{{
prdt.reviews}} Reviews
</p>
<p>
{{
(prdt.reviews > 0)?prdt.reviews+' Reviews':'Be the first one to review.'}}
</p>
</div>
</div>
</div>
</div>
</li>
</li>
...
@@ -60,7 +60,7 @@
...
@@ -60,7 +60,7 @@
<h5>
{{prdt.product_name}}
</h5>
<h5>
{{prdt.product_name}}
</h5>
<p>
{{prdt.short_description}}
</p>
<p>
{{prdt.short_description}}
</p>
<div
class=
"star_ratting"
>
<div
class=
"star_ratting"
>
<fieldset
class=
"rating
"
*
ngIf=
"prdt.rating > 0
"
>
<fieldset
class=
"rating
prevent-click hide
"
>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 4.75) ? 'true':''" [attr.id]="'usrReviewId_'+prdt.product_id+'_5'" [attr.name]="'usrReviewName_'+prdt.product_id" value="5" />
<label
class =
"full"
for=
"secondStar5"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 4.75) ? 'true':''" [attr.id]="'usrReviewId_'+prdt.product_id+'_5'" [attr.name]="'usrReviewName_'+prdt.product_id" value="5" />
<label
class =
"full"
for=
"secondStar5"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 4.25
&&
prdt.rating
<
4
.
75
)
?
'
true
'
:
''"
[
attr
.
id
]="'
usrReviewId_
'+
prdt
.
product_id
+'
_4half
'"
[
attr
.
name
]="'
usrReviewName_
'+
prdt
.
product_id
"
value=
"4.5"
/><label
class=
"half"
for=
"secondStar4half"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 4.25
&&
prdt.rating
<
4
.
75
)
?
'
true
'
:
''"
[
attr
.
id
]="'
usrReviewId_
'+
prdt
.
product_id
+'
_4half
'"
[
attr
.
name
]="'
usrReviewName_
'+
prdt
.
product_id
"
value=
"4.5"
/><label
class=
"half"
for=
"secondStar4half"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 3.75
&&
prdt.rating
<
4
.
25
)
?
'
true
'
:
''"
[
attr
.
id
]="'
usrReviewId_
'+
prdt
.
product_id
+'
_4
'"
[
attr
.
name
]="'
usrReviewName_
'+
prdt
.
product_id
"
value=
"4"
/><label
class =
"full"
for=
"secondStar4"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 3.75
&&
prdt.rating
<
4
.
25
)
?
'
true
'
:
''"
[
attr
.
id
]="'
usrReviewId_
'+
prdt
.
product_id
+'
_4
'"
[
attr
.
name
]="'
usrReviewName_
'+
prdt
.
product_id
"
value=
"4"
/><label
class =
"full"
for=
"secondStar4"
></label>
...
@@ -70,11 +70,11 @@
...
@@ -70,11 +70,11 @@
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 1.75
&&
prdt.rating
<
2
.
25
)
?
'
true
'
:
''"
[
attr
.
id
]="'
usrReviewId_
'+
prdt
.
product_id
+'
_2
'"
[
attr
.
name
]="'
usrReviewName_
'+
prdt
.
product_id
"
value=
"2"
/><label
class =
"full"
for=
"secondStar2"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 1.75
&&
prdt.rating
<
2
.
25
)
?
'
true
'
:
''"
[
attr
.
id
]="'
usrReviewId_
'+
prdt
.
product_id
+'
_2
'"
[
attr
.
name
]="'
usrReviewName_
'+
prdt
.
product_id
"
value=
"2"
/><label
class =
"full"
for=
"secondStar2"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 1.25
&&
prdt.rating
<
1
.
75
)
?
'
true
'
:
''"
[
attr
.
id
]="'
usrReviewId_
'+
prdt
.
product_id
+'
_1half
'"
[
attr
.
name
]="'
usrReviewName_
'+
prdt
.
product_id
"
value=
"1.5"
/><label
class=
"half"
for=
"secondStar1half"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 1.25
&&
prdt.rating
<
1
.
75
)
?
'
true
'
:
''"
[
attr
.
id
]="'
usrReviewId_
'+
prdt
.
product_id
+'
_1half
'"
[
attr
.
name
]="'
usrReviewName_
'+
prdt
.
product_id
"
value=
"1.5"
/><label
class=
"half"
for=
"secondStar1half"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 0.75
&&
prdt.rating
<
1
.
25
)
?
'
true
'
:
''"
[
attr
.
id
]="'
usrReviewId_
'+
prdt
.
product_id
+'
_1
'"
[
attr
.
name
]="'
usrReviewName_
'+
prdt
.
product_id
"
value=
"1"
/><label
class =
"full"
for=
"secondStar1"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
>
= 0.75
&&
prdt.rating
<
1
.
25
)
?
'
true
'
:
''"
[
attr
.
id
]="'
usrReviewId_
'+
prdt
.
product_id
+'
_1
'"
[
attr
.
name
]="'
usrReviewName_
'+
prdt
.
product_id
"
value=
"1"
/><label
class =
"full"
for=
"secondStar1"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
<
0
.
75
)
?
'
true
'
:
''"
[
attr
.
id
]="'
usrReviewId_
'+
prdt
.
product_id
+'
_half
'"
[
attr
.
name
]="'
usrReviewName_
'+
prdt
.
product_id
"
value=
"0.5"
/><label
class=
"half"
for=
"secondStarhalf"
></label>
<input
type=
"radio"
[
checked
]="(
prdt
.
rating
<
0
.
75
&&
prdt
.
rating
>
= 0.25
) ? 'true':''" [attr.id]="'usrReviewId_'+prdt.product_id+'_half'" [attr.name]="'usrReviewName_'+prdt.product_id" value="0.5" />
<label
class=
"half"
for=
"secondStarhalf"
></label>
</fieldset>
</fieldset>
<span
class=
"floatRight"
>
$ {{prdt.amount}}
</span>
<span
class=
"floatRight"
>
$ {{prdt.amount}}
</span>
<div
class=
"clear"
></div>
<div
class=
"clear"
></div>
<p>
{{
prdt.reviews}} Reviews
</p>
<p>
{{
(prdt.reviews > 0)?prdt.reviews+' Reviews':'Be the first one to review.'}}
</p>
</div>
</div>
</div>
</div>
</li>
</li>
...
...
src/app/purchase/purchase-home/purchase-home.component.scss
View file @
af095a74
...
@@ -281,7 +281,7 @@
...
@@ -281,7 +281,7 @@
.star_ratting
{
.star_ratting
{
padding-top
:
2px
;
padding-top
:
2px
;
display
:
none
;
span
{
span
{
float
:
right
;
float
:
right
;
color
:
#000000
;
color
:
#000000
;
...
...
src/app/purchase/summary/summary.component.ts
View file @
af095a74
...
@@ -76,7 +76,6 @@ export class SummaryComponent implements OnInit {
...
@@ -76,7 +76,6 @@ export class SummaryComponent implements OnInit {
this
.
webService
.
post_data
(
'SingleProductSearch'
,{
'product_id'
:
this
.
product_id
}).
subscribe
(
response
=>
{
this
.
webService
.
post_data
(
'SingleProductSearch'
,{
'product_id'
:
this
.
product_id
}).
subscribe
(
response
=>
{
if
(
response
.
status
==
'success'
){
if
(
response
.
status
==
'success'
){
this
.
productDetails
=
response
.
data
;
this
.
productDetails
=
response
.
data
;
console
.
log
(
this
.
productDetails
)
}
else
{
}
else
{
this
.
productDetails
=
false
;
this
.
productDetails
=
false
;
}
}
...
...
src/app/purchase/track/track.component.html
View file @
af095a74
...
@@ -99,9 +99,8 @@
...
@@ -99,9 +99,8 @@
<div
class=
"modal-dialog modal-md"
>
<div
class=
"modal-dialog modal-md"
>
<div
class=
"modal-content"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
#
ratingModal
>
<div
class=
"modal-header"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
>
×
</button>
<button
type=
"button"
#
ratingModal
class=
"close"
data-dismiss=
"modal"
>
×
</button>
</div>
</div>
<div
class=
"ratting_inner"
>
<div
class=
"ratting_inner"
>
<div
class=
"loader_overlay"
*
ngIf=
"loader_review"
></div>
<div
class=
"loader_overlay"
*
ngIf=
"loader_review"
></div>
...
...
src/app/purchase/track/track.component.scss
View file @
af095a74
.purchase_wrapper
{
.purchase_wrapper
{
.purchase_content_wrapper
{
.purchase_content_wrapper
{
padding-top
:
115px
;
.product_gallery
{
.product_gallery
{
background
:
#ffff
;
background
:
#ffff
;
padding
:
20px
;
padding
:
20px
;
...
...
src/app/purchase/track/track.component.ts
View file @
af095a74
...
@@ -126,7 +126,6 @@ export class TrackComponent implements OnInit {
...
@@ -126,7 +126,6 @@ export class TrackComponent implements OnInit {
const
thisObj
=
this
;
const
thisObj
=
this
;
this
.
orderDetails
=
response
.
data
;
this
.
orderDetails
=
response
.
data
;
this
.
userReviewed
=
(
this
.
orderDetails
.
review_id
<=
0
&&
(
this
.
orderDetails
.
odr_status
==
'5'
||
this
.
orderDetails
.
odr_status
==
'6'
||
this
.
orderDetails
.
odr_status
==
'7'
))?
false
:
true
;
this
.
userReviewed
=
(
this
.
orderDetails
.
review_id
<=
0
&&
(
this
.
orderDetails
.
odr_status
==
'5'
||
this
.
orderDetails
.
odr_status
==
'6'
||
this
.
orderDetails
.
odr_status
==
'7'
))?
false
:
true
;
console
.
log
(
this
.
userReviewed
);
if
(
this
.
orderDetails
.
images
.
length
>
0
){
if
(
this
.
orderDetails
.
images
.
length
>
0
){
thisObj
.
orderDetails
.
images
.
forEach
(
function
(
data
)
{
thisObj
.
orderDetails
.
images
.
forEach
(
function
(
data
)
{
image
=
thisObj
.
imageServer
+
data
.
image
;
image
=
thisObj
.
imageServer
+
data
.
image
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment