Commit ad03acf5 by amal

Merge branch 'amal' into 'master'

Amal See merge request !33
parents d464cc0a cb183ff9
import { NgModule } from '@angular/core';
import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
const routes: Routes = [
{
path: '', loadChildren: './landing/landing.module#LandingPageModule'
},
{ path: 'tabs',loadChildren: './tabs/tabs.module#TabsPageModule' },
{ path: 'login', loadChildren: './login/login.module#LoginPageModule' },
{ path: 'signup', loadChildren: './signup/signup.module#SignupPageModule' },
{ path: 'verification', loadChildren: './verification/verification.module#VerificationPageModule' },
{ path: 'forgot', loadChildren: './forgot/forgot.module#ForgotPageModule' },
{ path: 'changepass', loadChildren: './changepass/changepass.module#ChangepassPageModule' },
{ path: 'orderdelivered', loadChildren: './orderdelivered/orderdelivered.module#OrderdeliveredPageModule' },
{ path: 'orderplaced', loadChildren: './orderplaced/orderplaced.module#OrderplacedPageModule' },
{ path: 'ordercancelled', loadChildren: './ordercancelled/ordercancelled.module#OrdercancelledPageModule' },
{ path: 'myorder', loadChildren: './myorder/myorder.module#MyorderPageModule' },
{ path: 'cart', loadChildren: './cart/cart.module#CartPageModule' },
{ path: 'changedetails', loadChildren: './changedetails/changedetails.module#ChangedetailsPageModule' },
{ path: 'wishlist', loadChildren: './wishlist/wishlist.module#WishlistPageModule' },
{ path: 'addaddresss', loadChildren: './addaddresss/addaddresss.module#AddaddresssPageModule' },
{ path: 'profile', loadChildren: './profile/profile.module#ProfilePageModule' },
{ path: 'home', loadChildren: './home/home.module#HomePageModule' },
{ path: 'productlist', loadChildren: './productlist/productlist.module#ProductlistPageModule' },
{ path: 'productdetail', loadChildren: './productdetail/productdetail.module#ProductdetailPageModule' },
{ path: 'reviewlist', loadChildren: './reviewlist/reviewlist.module#ReviewlistPageModule' },
{ path: 'catagory', loadChildren: './catagory/catagory.module#CatagoryPageModule' },
{ path: 'trackorder', loadChildren: './trackorder/trackorder.module#TrackorderPageModule' },
{ path: 'storelist', loadChildren: './storelist/storelist.module#StorelistPageModule' },
{ path: 'catstorelist', loadChildren: './catstorelist/catstorelist.module#CatStorelistPageModule' },
{ path: 'nearby', loadChildren: './nearby/nearby.module#NearbyPageModule' },
{ path: 'review', loadChildren: './review/review.module#ReviewPageModule' },
{ path: 'delivery', loadChildren: './delivery/delivery.module#DeliveryPageModule' },
{ path: 'addcard', loadChildren: './addcard/addcard.module#AddcardPageModule' }, { path: 'searchmodal', loadChildren: './searchmodal/searchmodal.module#SearchmodalPageModule' }
import { NgModule } from "@angular/core";
import { PreloadAllModules, RouterModule, Routes } from "@angular/router";
];
@NgModule({
imports: [
RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })
],
exports: [RouterModule]
})
export class AppRoutingModule {}
const routes: Routes = [
{
path: "",
loadChildren: "./landing/landing.module#LandingPageModule"
},
{ path: "tabs", loadChildren: "./tabs/tabs.module#TabsPageModule" },
{ path: "login", loadChildren: "./login/login.module#LoginPageModule" },
{ path: "signup", loadChildren: "./signup/signup.module#SignupPageModule" },
{
path: "verification",
loadChildren: "./verification/verification.module#VerificationPageModule"
},
{ path: "forgot", loadChildren: "./forgot/forgot.module#ForgotPageModule" },
{
path: "changepass",
loadChildren: "./changepass/changepass.module#ChangepassPageModule"
},
{
path: "orderdelivered",
loadChildren:
"./orderdelivered/orderdelivered.module#OrderdeliveredPageModule"
},
{
path: "orderplaced",
loadChildren: "./orderplaced/orderplaced.module#OrderplacedPageModule"
},
{
path: "ordercancelled",
loadChildren:
"./ordercancelled/ordercancelled.module#OrdercancelledPageModule"
},
{
path: "myorder",
loadChildren: "./myorder/myorder.module#MyorderPageModule"
},
{ path: "cart", loadChildren: "./cart/cart.module#CartPageModule" },
{
path: "changedetails",
loadChildren: "./changedetails/changedetails.module#ChangedetailsPageModule"
},
{
path: "wishlist",
loadChildren: "./wishlist/wishlist.module#WishlistPageModule"
},
{
path: "addaddresss",
loadChildren: "./addaddresss/addaddresss.module#AddaddresssPageModule"
},
{
path: "profile",
loadChildren: "./profile/profile.module#ProfilePageModule"
},
{ path: "home", loadChildren: "./home/home.module#HomePageModule" },
{
path: "productlist",
loadChildren: "./productlist/productlist.module#ProductlistPageModule"
},
{
path: "productdetail",
loadChildren: "./productdetail/productdetail.module#ProductdetailPageModule"
},
{
path: "reviewlist",
loadChildren: "./reviewlist/reviewlist.module#ReviewlistPageModule"
},
{
path: "catagory",
loadChildren: "./catagory/catagory.module#CatagoryPageModule"
},
{
path: "trackorder",
loadChildren: "./trackorder/trackorder.module#TrackorderPageModule"
},
{
path: "storelist",
loadChildren: "./storelist/storelist.module#StorelistPageModule"
},
{
path: "catstorelist",
loadChildren: "./catstorelist/catstorelist.module#CatStorelistPageModule"
},
{ path: "nearby", loadChildren: "./nearby/nearby.module#NearbyPageModule" },
{ path: "review", loadChildren: "./review/review.module#ReviewPageModule" },
{
path: "delivery",
loadChildren: "./delivery/delivery.module#DeliveryPageModule"
},
{
path: "addcard",
loadChildren: "./addcard/addcard.module#AddcardPageModule"
},
{
path: "searchmodal",
loadChildren: "./searchmodal/searchmodal.module#SearchmodalPageModule"
}
];
@NgModule({
imports: [
RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })
],
exports: [RouterModule]
})
export class AppRoutingModule {}
......@@ -2,7 +2,8 @@
<button class="nav_btn nav_back floatLeft" (click)="goBack()">
</button>
<div class="nav_title floatLeft">
<input class="search_bar" placeholder="Search here.. eg:shirts, retailers etc..."> </div>
<input class="search_bar" placeholder="Search here.. eg:shirts, retailers etc..." (click)="clickSearch()">
</div>
<button class="nav_btn nav_search floatRight">
</button>
<div class="clear"></div>
......@@ -38,8 +39,8 @@
<h5>
<span class="floatLeft">{{shopper.name}}</span>
<span class="floatRight">0
<img src="../assets/Path61_2.png">
</span>
<img src="../assets/Path61_2.png">
</span>
<div class="clear"></div>
</h5>
<p>{{shopper.caption}}</p>
......@@ -50,4 +51,10 @@
</div>
</div>
</ion-content>
\ No newline at end of file
</ion-content>
<div class="search_item_list" *ngIf="searchShow" [@slideInOut]>
<ul>
<li>sample</li>
</ul>
</div>
\ No newline at end of file
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { Location } from '@angular/common';
import { ServiceService } from './../../config/service.service';
import { ShoppersService } from './../../config/shopper.service';
import { Component, OnInit } from "@angular/core";
import { Router } from "@angular/router";
import { Location } from "@angular/common";
import { ServiceService } from "./../../config/service.service";
import { ShoppersService } from "./../../config/shopper.service";
import { trigger, transition, animate, style } from "@angular/animations";
@Component({
selector: 'app-catstorelist',
templateUrl: './catstorelist.page.html',
styleUrls: ['./catstorelist.page.scss'],
selector: "app-catstorelist",
templateUrl: "./catstorelist.page.html",
styleUrls: ["./catstorelist.page.scss"],
animations: [
trigger("slideInOut", [
transition(":enter", [
style({ transform: "translateY(100%)" }),
animate("200ms ease-in", style({ transform: "translateY(0%)" }))
]),
transition(":leave", [
animate("200ms ease-out", style({ transform: "translateY(100%)" }))
])
])
]
})
export class CatStorelistPage implements OnInit {
searchShow = false;
slideOpts = {
slidesPerView: 1.5
};
data: any;
clickSearch() {
this.searchShow = true;
}
searchClose() {
this.searchShow = false;
}
constructor(
public router: Router,
public location: Location,
public service: ServiceService,
public shopperService: ShoppersService,
public shopperService: ShoppersService
) {
this.service.get('params').then((val) => {
this.service.get("params").then(val => {
this.data = val;
this.shopperService.shopperList(this.data.catId, 'catId');
this.shopperService.shopperList(this.data.catId, "catId");
});
}
ngOnInit() {}
goToPage(path, data = null) {
this.service.set('params', data);
this.service.set("params", data);
this.router.navigateByUrl(path, { queryParams: data });
document.body.scrollTop = document.documentElement.scrollTop = 0;
}
......@@ -39,5 +59,4 @@ export class CatStorelistPage implements OnInit {
goBack() {
this.location.back();
}
}
......@@ -267,7 +267,7 @@
margin: 0px;
padding: 0px;
color: rgba(176, 174, 199, 1);
padding-top:5px;
padding-top: 5px;
padding-bottom: 5px;
}
.styled-checkbox {
......@@ -320,36 +320,4 @@
}
}
}
}
.search_item_list {
position: absolute;
background-color: #fff;
left: 0px;
right: 0px;
width: 100%;
margin: 0px;
top: 50px;
bottom: 0px;
z-index: 99;
ul {
margin: 0px;
padding: 0px;
li {
list-style: none;
color: rgba(59, 57, 77, 1);
text-align: left;
list-style: none;
padding: 10px;
border-bottom: 1px solid #ddd;
&:hover {
background-color: rgba(59, 57, 77, 1);
color: #fff;
}
&:focus {
background-color: rgba(59, 57, 77, 1);
color: #fff;
}
}
}
}
\ No newline at end of file
import { Component, OnInit } from '@angular/core';
import { Location } from '@angular/common';
import { trigger, transition, animate, style } from '@angular/animations';
import { MapsAPILoader, MouseEvent } from '@agm/core';
import { Router, ActivatedRoute } from '@angular/router';
import { MenuController } from '@ionic/angular';
import { CenterService } from './../../config/center.service';
import { ShoppersService } from './../../config/shopper.service';
import { CategoriesService } from './../../config/category.service';
import { ServiceService } from './../../config/service.service';
import { AddressService } from './../../config/address.service';
import { SearchService } from './../../config/search.service';
import { ProductsService } from './../../config/products.service';
import { from } from 'rxjs';
import { ModalController } from '@ionic/angular';
import { Component, OnInit } from "@angular/core";
import { Location } from "@angular/common";
import { trigger, transition, animate, style } from "@angular/animations";
import { MapsAPILoader, MouseEvent } from "@agm/core";
import { Router, ActivatedRoute } from "@angular/router";
import { MenuController } from "@ionic/angular";
import { CenterService } from "./../../config/center.service";
import { ShoppersService } from "./../../config/shopper.service";
import { CategoriesService } from "./../../config/category.service";
import { ServiceService } from "./../../config/service.service";
import { AddressService } from "./../../config/address.service";
import { SearchService } from "./../../config/search.service";
import { ProductsService } from "./../../config/products.service";
import { from } from "rxjs";
import { ModalController } from "@ionic/angular";
@Component({
selector: 'app-home',
templateUrl: './home.page.html',
styleUrls: ['./home.page.scss'],
selector: "app-home",
templateUrl: "./home.page.html",
styleUrls: ["./home.page.scss"],
animations: [
trigger('slideInOut', [
transition(':enter', [
style({ transform: 'translateY(100%)' }),
animate('200ms ease-in', style({ transform: 'translateY(0%)' }))
trigger("slideInOut", [
transition(":enter", [
style({ transform: "translateY(100%)" }),
animate("200ms ease-in", style({ transform: "translateY(0%)" }))
]),
transition(':leave', [
animate('200ms ease-out', style({ transform: 'translateY(100%)' }))
transition(":leave", [
animate("200ms ease-out", style({ transform: "translateY(100%)" }))
])
])
]
})
export class HomePage implements OnInit {
isShow = false;
searchShow = false;
......@@ -58,8 +56,7 @@ export class HomePage implements OnInit {
private mapsAPILoader: MapsAPILoader,
private searchService: SearchService,
private productsService: ProductsService
) {
}
) {}
ngOnInit() {
this.mapsAPILoader.load().then(() => {
......@@ -67,7 +64,7 @@ export class HomePage implements OnInit {
this.geoCoder = new google.maps.Geocoder();
});
this.menuCtrl.enable(true);
const users = this.service.get('user').then((data) => {
const users = this.service.get("user").then(data => {
if (data) {
data = JSON.parse(data);
this.custId = data.uid;
......@@ -77,7 +74,7 @@ export class HomePage implements OnInit {
}
private setCurrentLocation() {
if ('geolocation' in navigator) {
if ("geolocation" in navigator) {
navigator.geolocation.getCurrentPosition(position => {
this.lat = position.coords.latitude;
this.lng = position.coords.longitude;
......@@ -92,16 +89,16 @@ export class HomePage implements OnInit {
(results, status) => {
console.log(results);
console.log(status);
if (status === 'OK') {
if (status === "OK") {
if (results[0]) {
const addressData = results[0].formatted_address.split(', ');
this.address = addressData[0] + ', ' + addressData[1];
const addressData = results[0].formatted_address.split(", ");
this.address = addressData[0] + ", " + addressData[1];
console.log(this.address);
} else {
window.alert('No results found');
window.alert("No results found");
}
} else {
window.alert('Geocoder failed due to: ' + status);
window.alert("Geocoder failed due to: " + status);
}
}
);
......@@ -120,15 +117,13 @@ export class HomePage implements OnInit {
this.searchShow = false;
}
ionViewWillEnter() {
this.menuCtrl.enable(true);
}
goToPage(path, data = null) {
console.log(data);
this.service.set('params', data);
this.service.set("params", data);
this.router.navigateByUrl(path, { queryParams: data });
document.body.scrollTop = document.documentElement.scrollTop = 0;
}
......@@ -145,24 +140,23 @@ export class HomePage implements OnInit {
console.log(datas);
let data;
let url;
if (datas.type === 'shopper') {
if (datas.type === "shopper") {
data = datas.data;
this.service.set('params', data);
url = 'productlist';
} else if (datas.type === 'category') {
this.service.set("params", data);
url = "productlist";
} else if (datas.type === "category") {
data = datas.data;
this.service.set('params', data);
url = 'catstorelist';
this.service.set("params", data);
url = "catstorelist";
} else {
data = datas.data;
data.size = this.service.splitSep(data.size);
data.tag = this.service.splitSep(data.tag);
data.color = this.service.splitSep(data.color),
url = 'productdetail';
data.tag = this.service.splitSep(data.tag);
(data.color = this.service.splitSep(data.color)), (url = "productdetail");
this.productsService.setProd(data);
}
this.searchClose();
this.router.navigateByUrl(url, { queryParams: data});
this.router.navigateByUrl(url, { queryParams: data });
document.body.scrollTop = document.documentElement.scrollTop = 0;
}
......@@ -170,4 +164,3 @@ export class HomePage implements OnInit {
this.searchService.search(data);
}
}
......@@ -3,7 +3,8 @@
<img src="../assets/Group17_2.png">
</button>
<div class="nav_title floatLeft">
<input class="search_bar" placeholder="Search here.. eg:shirts, retailers etc..."> </div>
<input class="search_bar" placeholder="Search here.. eg:shirts, retailers etc..." (click)="clickSearch()">
</div>
<button class="nav_btn nav_search floatRight">
<img src="../assets/search_2.png">
</button>
......@@ -72,4 +73,11 @@
</div>
</div>
</ion-content>
\ No newline at end of file
</ion-content>
<div class="search_item_list" *ngIf="searchShow" [@slideInOut]>
<ul>
<li>sample</li>
</ul>
</div>
\ No newline at end of file
import { Component, OnInit } from '@angular/core';
import { Location } from '@angular/common';
import { trigger, transition, animate, style } from '@angular/animations';
import { Router, ActivatedRoute, NavigationExtras } from '@angular/router';
import { ProductsService } from './../../config/products.service';
import { ServiceService } from './../../config/service.service';
import { Component, OnInit } from "@angular/core";
import { Location } from "@angular/common";
import { trigger, transition, animate, style } from "@angular/animations";
import { Router, ActivatedRoute, NavigationExtras } from "@angular/router";
import { ProductsService } from "./../../config/products.service";
import { ServiceService } from "./../../config/service.service";
@Component({
selector: 'app-productlist',
templateUrl: './productlist.page.html',
styleUrls: ['./productlist.page.scss'],
selector: "app-productlist",
templateUrl: "./productlist.page.html",
styleUrls: ["./productlist.page.scss"],
animations: [
trigger('slideInOut', [
transition(':enter', [
style({ transform: 'translateY(100%)' }),
animate('200ms ease-in', style({ transform: 'translateY(0%)' }))
trigger("slideInOut", [
transition(":enter", [
style({ transform: "translateY(100%)" }),
animate("200ms ease-in", style({ transform: "translateY(0%)" }))
]),
transition(':leave', [
animate('200ms ease-out', style({ transform: 'translateY(100%)' }))
transition(":leave", [
animate("200ms ease-out", style({ transform: "translateY(100%)" }))
])
])
]
})
export class ProductlistPage implements OnInit {
onGrid = false;
isShow = false;
data: any;
searchShow = false;
sortValue: string;
constructor(
......@@ -35,7 +35,7 @@ export class ProductlistPage implements OnInit {
public prodService: ProductsService,
public service: ServiceService
) {
this.service.get('params').then((val) => {
this.service.get("params").then(val => {
this.data = val;
console.log(this.data);
this.prodService.prodList(this.data.uid);
......@@ -62,9 +62,17 @@ export class ProductlistPage implements OnInit {
this.onGrid = !this.onGrid;
}
clickSearch() {
this.searchShow = true;
}
searchClose() {
this.searchShow = false;
}
prodDetails(index: number) {
this.prodService.setProd(this.prodService.product[index]);
this.router.navigateByUrl('productdetail');
this.router.navigateByUrl("productdetail");
document.body.scrollTop = document.documentElement.scrollTop = 0;
}
......@@ -74,10 +82,10 @@ export class ProductlistPage implements OnInit {
console.log(this.prodService.fav);
if (state > -1) {
this.prodService.fav.splice(state, 1);
this.prodService.changeFav(index, 'yes');
this.prodService.changeFav(index, "yes");
} else {
this.prodService.fav.push(index);
this.prodService.changeFav(index, 'no');
this.prodService.changeFav(index, "no");
}
return;
console.log(this.prodService.fav);
......@@ -95,6 +103,6 @@ export class ProductlistPage implements OnInit {
checkFavStatus(index) {
const state = this.prodService.fav.findIndex(x => x === index);
return state > -1 ? 'fav_fill' : 'fav_icon';
return state > -1 ? "fav_fill" : "fav_icon";
}
}
<h1>Search modal</h1>
\ No newline at end of file
......@@ -621,4 +621,36 @@ ion-header {
font-weight: 900;
}
}
}
.search_item_list {
position: absolute;
background-color: #fff;
left: 0px;
right: 0px;
width: 100%;
margin: 0px;
top: 50px;
bottom: 0px;
z-index: 99;
ul {
margin: 0px;
padding: 0px;
li {
list-style: none;
color: rgba(59, 57, 77, 1);
text-align: left;
list-style: none;
padding: 10px;
border-bottom: 1px solid #ddd;
&:hover {
background-color: rgba(59, 57, 77, 1);
color: #fff;
}
&:focus {
background-color: rgba(59, 57, 77, 1);
color: #fff;
}
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment