Commit e14d56c1 by Adarsh K

changes

parents 436f9118 d332cebb
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
"@angular/platform-browser": "~8.1.2", "@angular/platform-browser": "~8.1.2",
"@angular/platform-browser-dynamic": "~8.1.2", "@angular/platform-browser-dynamic": "~8.1.2",
"@angular/router": "~8.1.2", "@angular/router": "~8.1.2",
"@ionic-native/call-number": "^5.21.5",
"@ionic-native/core": "^5.19.1", "@ionic-native/core": "^5.19.1",
"@ionic-native/geolocation": "^5.19.1", "@ionic-native/geolocation": "^5.19.1",
"@ionic-native/google-plus": "^5.19.1", "@ionic-native/google-plus": "^5.19.1",
...@@ -34,6 +35,7 @@ ...@@ -34,6 +35,7 @@
"@ionic/storage": "^2.2.0", "@ionic/storage": "^2.2.0",
"@types/googlemaps": "^3.39.2", "@types/googlemaps": "^3.39.2",
"agm-direction": "^0.7.9", "agm-direction": "^0.7.9",
"call-number": "^1.0.1",
"cordova-android": "8.0.0", "cordova-android": "8.0.0",
"cordova-plugin-device": "^2.0.3", "cordova-plugin-device": "^2.0.3",
"cordova-plugin-geolocation": "^4.0.2", "cordova-plugin-geolocation": "^4.0.2",
...@@ -102,7 +104,8 @@ ...@@ -102,7 +104,8 @@
}, },
"cordova-plugin-x-socialsharing": { "cordova-plugin-x-socialsharing": {
"ANDROID_SUPPORT_V4_VERSION": "24.1.1+" "ANDROID_SUPPORT_V4_VERSION": "24.1.1+"
} },
"mx.ferreyra.callnumber": {}
}, },
"platforms": [ "platforms": [
"android" "android"
......
<div class="nav_header"> <div class="nav_header">
<button class="nav_btn nav_back floatLeft" (click)="goBack()"> <button class="nav_btn nav_back floatLeft" (click)="goBack()">
<img src="../assets/Group17_2.png"> <img src="../assets/Group17_2.png" />
</button> </button>
<div class="nav_title floatLeft"> <div class="nav_title floatLeft">
<h4>ADD ADDRESS</h4> <h4>ADD ADDRESS</h4>
...@@ -15,75 +15,209 @@ ...@@ -15,75 +15,209 @@
<ion-row> <ion-row>
<ion-col> <ion-col>
<h6> <h6>
<input class="styled-checkbox" id="styled-checkbox-1" type="radio" value="Work" [(ngModel)]="address.addressType" name="addressType" #addressType="ngModel" required> <input
<label for="styled-checkbox-1"><span>Work</span></label></h6> class="styled-checkbox"
id="styled-checkbox-1"
type="radio"
value="Work"
[(ngModel)]="address.addressType"
name="addressType"
#addressType="ngModel"
required
/>
<label for="styled-checkbox-1"><span>Work</span></label>
</h6>
</ion-col> </ion-col>
<ion-col> <ion-col>
<h6> <h6>
<input class="styled-checkbox" id="styled-checkbox-2" type="radio" value="Office" [(ngModel)]="address.addressType" name="addressType" #addressType="ngModel" required> <input
<label for="styled-checkbox-2"><span>Office</span></label></h6> class="styled-checkbox"
id="styled-checkbox-2"
type="radio"
value="Office"
[(ngModel)]="address.addressType"
name="addressType"
#addressType="ngModel"
required
/>
<label for="styled-checkbox-2"><span>Office</span></label>
</h6>
</ion-col> </ion-col>
<ion-col> <ion-col>
<h6> <h6>
<input class="styled-checkbox" id="styled-checkbox-3" type="radio" value="Other" [(ngModel)]="address.addressType" name="addressType" #addressType="ngModel" required> <input
<label for="styled-checkbox-3"><span>Others</span></label></h6> class="styled-checkbox"
id="styled-checkbox-3"
type="radio"
value="Other"
[(ngModel)]="address.addressType"
name="addressType"
#addressType="ngModel"
required
/>
<label for="styled-checkbox-3"><span>Others</span></label>
</h6>
</ion-col> </ion-col>
</ion-row> </ion-row>
<div class="md-errors-spacer" [hidden]="addressType.valid || submitted == false" class="ion-padding-start"> <div
class="md-errors-spacer"
[hidden]="addressType.valid || submitted == false"
class="ion-padding-start"
>
Address Type is required Address Type is required
</div> </div>
</ion-grid> </ion-grid>
<div class="row"> <div class="row">
<button class="btn btn-info" (click)="getGeolocation()">Get Current</button> <button class="btn btn-info" (click)="getGeolocation()">
Get Current
</button>
</div> </div>
<div class="row"> <div class="row">
<input class="" type="text" placeholder="Address 1" [(ngModel)]="address.firstAddress" name="firstAddress" #firstAddress="ngModel" required> <input
</div> class=""
<div class="md-errors-spacer" [hidden]="firstAddress.valid || submitted == false" class="ion-padding-start"> type="text"
placeholder="Address 1"
[(ngModel)]="address.firstAddress"
name="firstAddress"
#firstAddress="ngModel"
required
/>
</div>
<div
class="md-errors-spacer"
[hidden]="firstAddress.valid || submitted == false"
class="ion-padding-start"
>
Address 1 is required Address 1 is required
</div> </div>
<div class="row"> <div class="row">
<input class="" type="text" placeholder="Address 2" [(ngModel)]="address.secondAddress" name="secondAddress" #secondAddress="ngModel"> <input
class=""
type="text"
placeholder="Address 2"
[(ngModel)]="address.secondAddress"
name="secondAddress"
#secondAddress="ngModel"
/>
</div> </div>
<div class="row"> <div class="row">
<input class="" type="text" placeholder="Country" [(ngModel)]="address.country" name="country" #country="ngModel" required> <input
</div> class=""
<div class="md-errors-spacer" [hidden]="country.valid || submitted == false" class="ion-padding-start"> type="text"
placeholder="Country"
[(ngModel)]="address.country"
name="country"
#country="ngModel"
required
/>
</div>
<div
class="md-errors-spacer"
[hidden]="country.valid || submitted == false"
class="ion-padding-start"
>
Country is required Country is required
</div> </div>
<div class="row"> <div class="row">
<input class="" type="text" placeholder="State" [(ngModel)]="address.state" name="state" #state="ngModel" required> <input
</div> class=""
<div class="md-errors-spacer" [hidden]="state.valid || submitted == false" class="ion-padding-start"> type="text"
placeholder="State"
[(ngModel)]="address.state"
name="state"
#state="ngModel"
required
/>
</div>
<div
class="md-errors-spacer"
[hidden]="state.valid || submitted == false"
class="ion-padding-start"
>
State is required State is required
</div> </div>
<div class="row"> <div class="row">
<input class="" type="text" placeholder="District" [(ngModel)]="address.district" name="district" #district="ngModel" required> <input
</div> class=""
<div class="md-errors-spacer" [hidden]="district.valid || submitted == false" class="ion-padding-start"> type="text"
placeholder="District"
[(ngModel)]="address.district"
name="district"
#district="ngModel"
required
/>
</div>
<div
class="md-errors-spacer"
[hidden]="district.valid || submitted == false"
class="ion-padding-start"
>
District is required District is required
</div> </div>
<div class="row"> <div class="row">
<input class="" type="text" placeholder="City" [(ngModel)]="address.city" name="city" #city="ngModel" required> <input
</div> class=""
<div class="md-errors-spacer" [hidden]="city.valid || submitted == false" class="ion-padding-start"> type="text"
placeholder="City"
[(ngModel)]="address.city"
name="city"
#city="ngModel"
required
/>
</div>
<div
class="md-errors-spacer"
[hidden]="city.valid || submitted == false"
class="ion-padding-start"
>
City is required City is required
</div> </div>
<div class="row"> <div class="row">
<input class="" type="text" placeholder="Area" [(ngModel)]="address.area" name="area" #area="ngModel"> <input
class=""
type="text"
placeholder="Area"
[(ngModel)]="address.area"
name="area"
#area="ngModel"
/>
</div> </div>
<div class="row"> <div class="row">
<input class="" type="text" placeholder="Landmark" [(ngModel)]="address.landmark" name="landmark" #landmark="ngModel" required> <input
</div> class=""
<div class="md-errors-spacer" [hidden]="landmark.valid || submitted == false" class="ion-padding-start"> type="text"
placeholder="Landmark"
[(ngModel)]="address.landmark"
name="landmark"
#landmark="ngModel"
required
/>
</div>
<div
class="md-errors-spacer"
[hidden]="landmark.valid || submitted == false"
class="ion-padding-start"
>
Landmark is required Landmark is required
</div> </div>
<div class="row"> <div class="row">
<input class="" type="text" placeholder="ZipCode" [(ngModel)]="address.zip" name="zip" #zip="ngModel" required> <input
</div> class=""
<div class="md-errors-spacer" [hidden]="zip.valid || submitted == false" class="ion-padding-start"> type="text"
placeholder="ZipCode"
[(ngModel)]="address.zip"
name="zip"
#zip="ngModel"
required
/>
</div>
<div
class="md-errors-spacer"
[hidden]="zip.valid || submitted == false"
class="ion-padding-start"
>
ZipCode is required ZipCode is required
</div> </div>
<div class="row"> <div class="row">
......
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
input { input {
border: 1px solid rgba(215, 213, 228, 1); border: 1px solid rgba(215, 213, 228, 1);
background: transparent; background: transparent;
color: rgba(215, 213, 228, 1); color: #000;
width: 100%; width: 100%;
height: 45px; height: 45px;
text-align: left; text-align: left;
...@@ -86,6 +86,15 @@ ...@@ -86,6 +86,15 @@
font-size: 16px; font-size: 16px;
padding-left: 15px; padding-left: 15px;
padding-right: 15px; padding-right: 15px;
outline: none;
transition: all .4s ease-in-out;
&::placeholder {
color: rgba(215, 213, 228, 1);
}
&:focus {
border: 1px solid #f3d09f;
box-shadow: 3px 3px 6px 0px rgba(202, 154, 83, 0.11);
}
} }
.login_btn { .login_btn {
width: 100%; width: 100%;
......
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
input { input {
border: 1px solid rgba(215, 213, 228, 1); border: 1px solid rgba(215, 213, 228, 1);
background: transparent; background: transparent;
color: rgba(215, 213, 228, 1); color: #000;
width: 100%; width: 100%;
height: 45px; height: 45px;
text-align: left; text-align: left;
...@@ -87,6 +87,15 @@ ...@@ -87,6 +87,15 @@
padding-left: 15px; padding-left: 15px;
padding-right: 15px; padding-right: 15px;
text-align: center; text-align: center;
outline: none;
transition: all .4s ease-in-out;
&::placeholder {
color: rgba(215, 213, 228, 1);
}
&:focus {
border: 1px solid #f3d09f;
box-shadow: 3px 3px 6px 0px rgba(202, 154, 83, 0.11);
}
} }
.login_btn { .login_btn {
width: 100%; width: 100%;
......
...@@ -95,13 +95,36 @@ const routes: Routes = [ ...@@ -95,13 +95,36 @@ const routes: Routes = [
{ {
path: 'searchmodal', path: 'searchmodal',
loadChildren: './searchmodal/searchmodal.module#SearchmodalPageModule' loadChildren: './searchmodal/searchmodal.module#SearchmodalPageModule'
}, { path: 'noresult', loadChildren: './noresult/noresult.module#NoresultPageModule' }, },
{ path: 'feedback', loadChildren: './feedback/feedback.module#FeedbackPageModule' }, {
{ path: 'address', loadChildren: './address/address.module#AddressPageModule' }, path: 'noresult',
{ path: 'success', loadChildren: './success/success.module#SuccessPageModule' }, loadChildren: './noresult/noresult.module#NoresultPageModule'
},
{
path: 'feedback',
loadChildren: './feedback/feedback.module#FeedbackPageModule'
},
{
path: 'address',
loadChildren: './address/address.module#AddressPageModule'
},
{
path: 'success',
loadChildren: './success/success.module#SuccessPageModule'
},
{ path: 'failed', loadChildren: './failed/failed.module#FailedPageModule' }, { path: 'failed', loadChildren: './failed/failed.module#FailedPageModule' },
{ path: 'preference', loadChildren: './preference/preference.module#PreferencePageModule' } {
path: 'preference',
loadChildren: './preference/preference.module#PreferencePageModule'
},
{
path: 'contact',
loadChildren: './contact/contact.module#ContactPageModule'
},
{
path: 'changeaddress',
loadChildren: './changeaddress/changeaddress.module#ChangeaddressPageModule'
}
]; ];
@NgModule({ @NgModule({
imports: [ imports: [
......
...@@ -114,7 +114,10 @@ export class AppComponent { ...@@ -114,7 +114,10 @@ export class AppComponent {
'wishlist', 'wishlist',
'preference', 'preference',
'changedetails', 'changedetails',
'trackorder' 'trackorder',
'changeaddress',
'changedetails',
'contact'
]; ];
const currentUrl = this.router.url.split('/'); const currentUrl = this.router.url.split('/');
const index = restrictedUrl.findIndex(x => x === currentUrl[1]); const index = restrictedUrl.findIndex(x => x === currentUrl[1]);
......
...@@ -29,7 +29,7 @@ import { DeliverypopPageModule } from './deliverypop/deliverypop.module'; ...@@ -29,7 +29,7 @@ import { DeliverypopPageModule } from './deliverypop/deliverypop.module';
import { FormsModule } from '@angular/forms'; import { FormsModule } from '@angular/forms';
import { SearchmodalPageModule } from './searchmodal/searchmodal.module'; import { SearchmodalPageModule } from './searchmodal/searchmodal.module';
import { SocialSharing } from '@ionic-native/social-sharing/ngx'; import { SocialSharing } from '@ionic-native/social-sharing/ngx';
import { CallNumber } from '@ionic-native/call-number/ngx';
@NgModule({ @NgModule({
declarations: [AppComponent], declarations: [AppComponent],
entryComponents: [], entryComponents: [],
...@@ -48,6 +48,7 @@ import { SocialSharing } from '@ionic-native/social-sharing/ngx'; ...@@ -48,6 +48,7 @@ import { SocialSharing } from '@ionic-native/social-sharing/ngx';
FormsModule FormsModule
], ],
providers: [ providers: [
CallNumber,
StatusBar, StatusBar,
SplashScreen, SplashScreen,
Geolocation, Geolocation,
......
...@@ -206,27 +206,30 @@ ...@@ -206,27 +206,30 @@
.coupon_code { .coupon_code {
padding-top: 20px; padding-top: 20px;
padding-bottom: 50px; padding-bottom: 50px;
border-bottom: 1px solid rgba(176, 174, 199, 1); border-bottom: 1px solid #b0aec7;
display: flex;
justify-content: space-between;
input { input {
width: calc(100% - 50px); width: 75%;
border: 1px solid rgba(176, 174, 199, 1); border: 1px solid #b0aec7;
border-radius: 20px; border-radius: 20px;
height: 35px; height: 35px;
padding-left: 20px; padding-left: 20px;
font-weight: 900; font-weight: 900;
color: rgba(215, 213, 228, 1); color: #29285b;
outline: none;
transition: all .4s ease-in-out;
&::placeholder { &::placeholder {
color: rgba(215, 213, 228, 1); color: rgba(215, 213, 228, 1);
outline: none;
} }
&:focus { &:focus {
color: rgba(215, 213, 228, 1); border: 1px solid #f3d09f;
outline: none; box-shadow: 3px 3px 6px 0px rgba(202, 154, 83, 0.11);
} }
} }
.add_btn { .add_btn {
color: #29285b; color: #29285b;
width: 50px; width: 25%;
height: 35px; height: 35px;
background: transparent; background: transparent;
font-size: 17px; font-size: 17px;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<img src="../assets/Group22_2.png"> <img src="../assets/Group22_2.png">
</button> </button>
<div class="nav_title floatLeft"> <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)="searchModal()"> </div>
<button class="nav_btn nav_search floatRight"> <button class="nav_btn nav_search floatRight">
</button> </button>
<div class="clear"></div> <div class="clear"></div>
......
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { Routes, RouterModule } from '@angular/router';
import { IonicModule } from '@ionic/angular';
import { ChangeaddressPage } from './changeaddress.page';
import { AgmCoreModule } from '@agm/core';
import { AgmDirectionModule } from 'agm-direction';
const routes: Routes = [
{
path: '',
component: ChangeaddressPage
}
];
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
AgmDirectionModule,
AgmCoreModule.forRoot({
apiKey: 'AIzaSyBn6hOlr6YHcZAmbptlsmbhvH5iQllWflE'
}),
RouterModule.forChild(routes)
],
declarations: [ChangeaddressPage]
})
export class ChangeaddressPageModule {}
<div class="nav_header">
<button class="nav_btn nav_back floatLeft" (click)="goBack()">
<img src="../assets/Group17_2.png" />
</button>
<div class="nav_title floatLeft">
<h4>Change Address</h4>
</div>
<div class="clear"></div>
</div>
<ion-content>
<div class="nearby_map">
<agm-map [latitude]="latitude" [longitude]="longitude" [zoom]="8" [backgroundColor]="'rgba(29, 27, 130,0.2)'">
<agm-marker [latitude]="latitude" [longitude]="longitude" [markerDraggable]="true" (dragEnd)="markerDragEnd($event)"></agm-marker>
</agm-map>
<form (ngSubmit)="onSubmit(addressForm.value); addressForm.reset()" #addressForm="ngForm" method="post" class="form-horizontal">
<div class="add_address_wrapper">
<h5>DELIVERY</h5>
<p>{{address}}</p>
<input [(ngModel)]="addressForm.building" name="building" #building="ngModel" name="building" required placeholder="House No./ Building No" />
<div class="md-errors-spacer" [hidden]="building.valid || landmark.pristine" class="ion-padding-start">
Building Name is required
</div>
<input [(ngModel)]="addressForm.landmark" name="landmark" #landmark="ngModel" name="landmark" required placeholder="Landmark" />
<div class="md-errors-spacer" [hidden]="landmark.valid || landmark.pristine" class="ion-padding-start">
Landmark is required
</div>
<ion-grid>
<ion-row>
<ion-col>
<h6>
<input class="styled-checkbox" id="styled-check-1" type="radio" value="Home" [(ngModel)]="addressForm.addressType" name="addressType" #addressType="ngModel" required />
<label for="styled-check-1"><span>Home</span></label>
</h6>
</ion-col>
<ion-col>
<h6>
<input class="styled-checkbox" id="styled-check-2" type="radio" value="Work" [(ngModel)]="addressForm.addressType" name="addressType" #addressType="ngModel" required />
<label for="styled-check-2"><span>Office</span></label>
</h6>
</ion-col>
<ion-col>
<h6>
<input class="styled-checkbox" id="styled-check-3" type="radio" value="Other" [(ngModel)]="addressForm.addressType" name="addressType" #addressType="ngModel" required />
<label for="styled-check-3"><span>Others</span></label>
</h6>
</ion-col>
</ion-row>
<div class="md-errors-spacer" [hidden]="addressType.valid || addressType.pristine" class="ion-padding-start">
Address Type is required
</div>
</ion-grid>
<button class="add_btn" type="submit" [disabled]="!addressForm.form.valid">
ADD
</button>
</div>
</form>
</div>
<div class="loader" *ngIf="loader">
<div class="lds-ripple">
<div></div>
<div></div>
</div>
</div>
</ion-content>
\ No newline at end of file
.nearby_map {
width: 100%;
height: 100vh;
.overlay {
position: absolute;
top: 0px;
left: 0px;
right: 0px;
bottom: 0px;
background: rgba(29, 27, 130, 0.2);
}
agm-map {
width: 100%;
height: 100%;
position: relative;
}
.click_marker {
min-width: 200px;
padding: 10px;
h5 {
margin: 0px;
padding: 0px;
}
p {
margin: 0px;
padding: 0px;
}
}
}
.add_address_wrapper {
position: fixed;
bottom: 0px;
left: 0px;
right: 0px;
padding: 20px;
border-top-left-radius: 15px;
border-top-right-radius: 15px;
background: #fff;
-webkit-box-shadow: 0px -2px 5px 0px rgba(0, 0, 0, 0.2);
-moz-box-shadow: 0px -2px 5px 0px rgba(0, 0, 0, 0.2);
box-shadow: 0px -2px 5px 0px rgba(0, 0, 0, 0.2);
h5 {
color: rgba(41, 40, 91, 1);
margin: 0px;
padding: 0px;
font-weight: 800;
}
input {
width: 100%;
height: 45px;
border: 1px solid #e1e0eb;
border-radius: 4px;
padding-left: 10px;
padding-right: 10px;
margin-bottom: 20px;
}
.add_btn {
width: 100%;
height: 45px;
background-color: #29285b;
color: #fff;
border-radius: 4px;
}
}
.styled-checkbox {
position: absolute; // take it out of document flow
opacity: 0; // hide it
&+label {
position: relative;
cursor: pointer;
padding: 0;
}
// Box.
&+label:before {
content: '';
margin-right: 10px;
display: inline-block;
vertical-align: text-top;
width: 20px;
height: 20px;
border-radius: 10px;
background: white;
border: 1px solid rgba(215, 213, 228, 1);
}
// Box hover
// Box checked
&:checked+label:before {
background: #29285b;
}
// Disabled state label.
&:disabled+label {
color: #b8b8b8;
cursor: auto;
}
// Disabled box.
&:disabled+label:before {
box-shadow: none;
background: #ddd;
}
// Checkmark. Could be replaced with an image
&:checked+label:after {
content: '';
position: absolute;
left: 6px;
top: 11px;
background: white;
width: 2px;
height: 2px;
box-shadow: 2px 0 0 white, 4px 0 0 white, 4px -2px 0 white, 4px -4px 0 white, 4px -6px 0 white, 4px -8px 0 white;
transform: rotate(45deg);
}
}
\ No newline at end of file
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ChangeaddressPage } from './changeaddress.page';
describe('ChangeaddressPage', () => {
let component: ChangeaddressPage;
let fixture: ComponentFixture<ChangeaddressPage>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ChangeaddressPage ],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ChangeaddressPage);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import {
Component,
OnInit,
ViewChild,
ElementRef,
NgZone
} from '@angular/core';
import { Location } from '@angular/common';
import { Router, ActivatedRoute } from '@angular/router';
import { MapsAPILoader, MouseEvent } from '@agm/core';
import { Address } from './../../config/services/address';
import { AddressService } from './../../config/address.service';
import { ServiceService } from './../../config/service.service';
import { NgForm } from '@angular/forms';
import * as firebase from 'firebase';
@Component({
selector: 'app-changeaddress',
templateUrl: './changeaddress.page.html',
styleUrls: ['./changeaddress.page.scss']
})
export class ChangeaddressPage implements OnInit {
latitude: number;
longitude: number;
zoom: number;
address: string;
private geoCoder;
addressForm: NgForm;
addressData = new Address('', '', '', '', true, '', 0, '');
successState: boolean;
uid: string;
type: any;
loader: boolean;
public searchElementRef: ElementRef;
constructor(
private router: Router,
private route: ActivatedRoute,
private location: Location,
private mapsAPILoader: MapsAPILoader,
private ngZone: NgZone,
public addressService: AddressService,
public service: ServiceService
) {
this.successState = false;
this.type = 0;
const users = this.service.get('user').then(data => {
if (data) {
data = JSON.parse(data);
this.uid = data.uid;
}
});
this.service.get('type').then(data => {
this.type = data;
});
}
ngOnInit() {
// load Places Autocomplete
this.mapsAPILoader.load().then(() => {
this.setCurrentLocation();
this.geoCoder = new google.maps.Geocoder();
});
}
// google maps zoom level
private setCurrentLocation() {
if ('geolocation' in navigator) {
navigator.geolocation.getCurrentPosition(position => {
this.latitude = position.coords.latitude;
this.longitude = position.coords.longitude;
this.zoom = 8;
this.getAddress(this.latitude, this.longitude);
});
}
}
markerDragEnd($event: MouseEvent) {
console.log($event);
this.latitude = $event.coords.lat;
this.longitude = $event.coords.lng;
this.getAddress(this.latitude, this.longitude);
}
getAddress(latitude, longitude) {
this.geoCoder.geocode(
{ location: { lat: latitude, lng: longitude } },
(results, status) => {
console.log(results);
console.log(status);
if (status === 'OK') {
if (results[0]) {
this.zoom = 12;
this.address = results[0].formatted_address;
console.log(this.address);
} else {
window.alert('No results found');
}
} else {
window.alert('Geocoder failed due to: ' + status);
}
}
);
}
goToPage(path, data = null) {
this.router.navigateByUrl(path, { queryParams: data });
document.body.scrollTop = document.documentElement.scrollTop = 0;
}
goBack() {
window.history.back();
}
onSubmit(data: any) {
this.loader = true;
console.log(data);
const postData: Address = {
address: this.address,
addressType: data.addressType,
building: data.building,
landmark: data.landmark,
defaultVal: 0,
uid: this.uid,
latLng: new firebase.firestore.GeoPoint(this.latitude, this.longitude),
status: true
};
this.addressService.addressCreate(postData);
this.successState = true;
setTimeout(() => {
this.loader = false;
this.successState = false;
if (this.type === 1) {
this.service.set('type', 0);
this.router.navigateByUrl('home', { queryParams: null });
} else {
this.goBack();
}
}, 3000);
}
}
interface Marker {
lat: number;
lng: number;
label?: string;
draggable: boolean;
}
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
input { input {
border: 1px solid rgba(215, 213, 228, 1); border: 1px solid rgba(215, 213, 228, 1);
background: transparent; background: transparent;
color: rgba(215, 213, 228, 1); color: #000;
width: 100%; width: 100%;
height: 45px; height: 45px;
text-align: center; text-align: center;
...@@ -30,6 +30,15 @@ ...@@ -30,6 +30,15 @@
font-size: 16px; font-size: 16px;
padding-left: 15px; padding-left: 15px;
padding-right: 15px; padding-right: 15px;
outline: none;
transition: all .4s ease-in-out;
&::placeholder {
color: rgba(215, 213, 228, 1);
}
&:focus {
border: 1px solid #f3d09f;
box-shadow: 3px 3px 6px 0px rgba(202, 154, 83, 0.11);
}
} }
.login_btn { .login_btn {
width: 100%; width: 100%;
......
...@@ -8,12 +8,21 @@ ...@@ -8,12 +8,21 @@
input { input {
border: 1px solid rgba(215, 213, 228, 1); border: 1px solid rgba(215, 213, 228, 1);
background: transparent; background: transparent;
color: rgba(215, 213, 228, 1); color: #000;
width: 100%; width: 100%;
height: 45px; height: 45px;
text-align: center; text-align: center;
border-radius: 8px; border-radius: 8px;
font-size: 16px; font-size: 16px;
outline: none;
transition: all .4s ease-in-out;
&::placeholder {
color: rgba(215, 213, 228, 1);
}
&:focus {
border: 1px solid #f3d09f;
box-shadow: 3px 3px 6px 0px rgba(202, 154, 83, 0.11);
}
} }
.login_btn { .login_btn {
width: 100%; width: 100%;
......
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { Routes, RouterModule } from '@angular/router';
import { IonicModule } from '@ionic/angular';
import { ContactPage } from './contact.page';
const routes: Routes = [
{
path: '',
component: ContactPage
}
];
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
RouterModule.forChild(routes)
],
declarations: [ContactPage]
})
export class ContactPageModule {}
<div class="nav_header">
<button class="nav_btn nav_back floatLeft" (click)="goBack()">
<img src="../assets/Group17_2.png" />
</button>
<div class="nav_title floatLeft">
<h4>Send Us</h4>
</div>
<div class="clear"></div>
</div>
<ion-content>
<form novalidate #contactUsForm="ngForm" class="contact_wrapper" *ngIf="userData && contactData">
<div class="form_div">
<div class="row">
<p>Write Us</p>
<textarea required name="writeUs" [(ngModel)]="contactData.message" #writeUs="ngModel" class="form-control"
rows="8" placeholder="Type here.."></textarea>
<div class="md-errors-spacer" [hidden]="writeUs.valid || submitted == false" class="ion-padding-start">
This is required.
</div>
</div>
<div class="row">
<button (click)="onContactSubmit(contactUsForm)" class="login_btn">
SEND
</button>
</div>
<div class="row">
<span>or</span>
</div>
<div class="row">
<button (click)="callUs()" class="login_btn" [disabled]="submitted">
Call Us
</button>
</div>
</div>
</form>
</ion-content>
<div class="loader" *ngIf="contactService.loader">
<div class="lds-ripple">
<div></div>
<div></div>
</div>
</div>
\ No newline at end of file
.contact_wrapper {
width: 80%;
margin: 0 auto;
padding-top: 30px;
.form_div {
.row {
margin: 20px;
.form-control {
border: 1px solid rgba(215, 213, 228, 1);
background: transparent;
color: #333;
width: 100%;
border-radius: 8px;
font-size: 16px;
padding: 11px 15px;
resize: none;
&::placeholder {
color: rgba(215, 213, 228, 1);
}
}
.login_btn {
width: 100%;
background-color: #29285b;
color: #fff;
border-radius: 8px;
height: 45px;
font-size: 16px;
}
p {
text-align: left;
color: rgba(59, 57, 77, 1);
margin: 0px;
font-weight: bolder;
padding-bottom: 10px;
}
span {
opacity: 0.6;
text-align: center !important;
display: block;
}
}
}
}
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ContactPage } from './contact.page';
describe('ContactPage', () => {
let component: ContactPage;
let fixture: ComponentFixture<ContactPage>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ContactPage ],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ContactPage);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
import { Location } from '@angular/common';
import { ContactData } from 'src/config/services/contact';
import { SubjectService } from '../../config/subject.service';
import { NgForm } from '@angular/forms';
import { ContactService } from 'src/config/contact.service';
import { ServiceService } from '../../config/service.service';
import { CallNumber } from '@ionic-native/call-number/ngx';
@Component({
selector: 'app-contact',
templateUrl: './contact.page.html',
styleUrls: ['./contact.page.scss']
})
export class ContactPage implements OnInit {
submitted = false;
userData: any;
contactData: ContactData = {
from: '',
message: '',
contactId: ''
};
constructor(
private location: Location,
public subjectService: SubjectService,
public contactService: ContactService,
public service: ServiceService,
private callNumber: CallNumber
) {
// Gets userdata
this.subjectService.getUserData().subscribe(userData => {
if (userData) {
this.userData = JSON.parse(userData);
this.contactData.from = JSON.parse(userData).emailId;
console.log(userData);
} else {
console.log(userData);
}
});
}
ngOnInit() { }
callUs() {
this.callNumber
.callNumber('+61411622880', true)
.then(res => console.log('Launched dialer!', res))
.catch(err => console.log('Error launching dialer', err));
}
onContactSubmit(form: NgForm) {
this.submitted = true;
console.log(form.value);
if (form.valid && form.value.message !== '') {
const contData = { ...this.contactData, from: this.userData.emailId };
this.contactService.contactCreate(contData);
} else {
console.log('form not valid');
this.submitted = false;
this.service.showToast('Invalid request!', 'top', 'my-error', 1000);
}
}
goBack() {
this.location.back();
}
}
// +61 411 622 880
...@@ -8,15 +8,21 @@ ...@@ -8,15 +8,21 @@
.form-control { .form-control {
border: 1px solid rgba(215, 213, 228, 1); border: 1px solid rgba(215, 213, 228, 1);
background: transparent; background: transparent;
color: #333; color: #000;
width: 100%; width: 100%;
border-radius: 8px; border-radius: 8px;
font-size: 16px; font-size: 16px;
padding: 11px 15px; padding: 11px 15px;
resize: none; resize: none;
outline: none;
transition: all .4s ease-in-out;
&::placeholder { &::placeholder {
color: rgba(215, 213, 228, 1); color: rgba(215, 213, 228, 1);
} }
&:focus {
border: 1px solid #f3d09f;
box-shadow: 3px 3px 6px 0px rgba(202, 154, 83, 0.11);
}
} }
.login_btn { .login_btn {
width: 100%; width: 100%;
......
...@@ -8,12 +8,21 @@ ...@@ -8,12 +8,21 @@
input { input {
border: 1px solid rgba(215, 213, 228, 1); border: 1px solid rgba(215, 213, 228, 1);
background: transparent; background: transparent;
color: rgba(215, 213, 228, 1); color: #000;
width: 100%; width: 100%;
height: 45px; height: 45px;
text-align: center; text-align: center;
border-radius: 8px; border-radius: 8px;
font-size: 16px; font-size: 16px;
outline: none;
transition: all .4s ease-in-out;
&::placeholder {
color: rgba(215, 213, 228, 1);
}
&:focus {
border: 1px solid #f3d09f;
box-shadow: 3px 3px 6px 0px rgba(202, 154, 83, 0.11);
}
} }
.login_btn { .login_btn {
width: 100%; width: 100%;
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
p { p {
margin: 0px; margin: 0px;
text-align: right; text-align: right;
background-image: url('../../assets/Path 55_2.png'); background-image: url("../../assets/Path 55_2.png");
background-position: left; background-position: left;
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: 12px; background-size: 12px;
...@@ -91,7 +91,7 @@ ...@@ -91,7 +91,7 @@
.nearby_icon { .nearby_icon {
width: 25px; width: 25px;
height: 25px; height: 25px;
background-image: url('../../assets/location.png'); background-image: url("../../assets/location.png");
background-position: center; background-position: center;
background-size: contain; background-size: contain;
} }
...@@ -262,6 +262,9 @@ ...@@ -262,6 +262,9 @@
.add_address_wrapper { .add_address_wrapper {
position: fixed; position: fixed;
top: 40%;
overflow: scroll;
height: auto;
bottom: 0px; bottom: 0px;
left: 0px; left: 0px;
right: 0px; right: 0px;
...@@ -281,15 +284,15 @@ ...@@ -281,15 +284,15 @@
.styled-checkbox { .styled-checkbox {
position: absolute; // take it out of document flow position: absolute; // take it out of document flow
opacity: 0; // hide it opacity: 0; // hide it
&+label { & + label {
position: relative; position: relative;
cursor: pointer; cursor: pointer;
padding: 0; padding: 0;
width: 100%; width: 100%;
} }
// Box. // Box.
&+label:before { & + label:before {
content: ''; content: "";
margin-right: 10px; margin-right: 10px;
display: inline-block; display: inline-block;
vertical-align: text-top; vertical-align: text-top;
...@@ -299,29 +302,30 @@ ...@@ -299,29 +302,30 @@
background: white; background: white;
border: 1px solid rgba(215, 213, 228, 1); border: 1px solid rgba(215, 213, 228, 1);
} }
&:checked+label:before { &:checked + label:before {
background: #29285b; background: #29285b;
} }
// Disabled state label. // Disabled state label.
&:disabled+label { &:disabled + label {
color: #b8b8b8; color: #b8b8b8;
cursor: auto; cursor: auto;
} }
// Disabled box. // Disabled box.
&:disabled+label:before { &:disabled + label:before {
box-shadow: none; box-shadow: none;
background: #ddd; background: #ddd;
} }
// Checkmark. Could be replaced with an image // Checkmark. Could be replaced with an image
&:checked+label:after { &:checked + label:after {
content: ''; content: "";
position: absolute; position: absolute;
left: 6px; left: 6px;
top: 10px; top: 10px;
background: white; background: white;
width: 2px; width: 2px;
height: 2px; height: 2px;
box-shadow: 2px 0 0 white, 4px 0 0 white, 4px -2px 0 white, 4px -4px 0 white, 4px -6px 0 white, 4px -8px 0 white; box-shadow: 2px 0 0 white, 4px 0 0 white, 4px -2px 0 white,
4px -4px 0 white, 4px -6px 0 white, 4px -8px 0 white;
transform: rotate(45deg); transform: rotate(45deg);
} }
} }
......
<ion-content> <ion-content>
<div class="start_wizard_wrapper"> <div class="start_wizard_wrapper">
<ion-slides <ion-slides pager="true" [options]="landingOptions" (ionSlideDidChange)="slideChanged()">
pager="true"
[options]="landingOptions"
(ionSlideDidChange)="slideChanged()"
>
<ion-slide> <ion-slide>
<div class="wizard_inner_wrapper"> <div class="wizard_inner_wrapper">
<img src="../assets/Group 229_2.png" /> <img src="../assets/Group 229_2.png" />
<div class="wizard_textarea"> <div class="wizard_textarea">
<h3>EASY PURCHASE</h3> <h3>EASY PURCHASE</h3>
<p> <p>
Purchase your products from your<br /> Purchase your products from your<br /> favourite shops
favourite shops
</p> </p>
</div> </div>
</div> </div>
......
...@@ -46,7 +46,7 @@ export class LandingPage implements OnInit { ...@@ -46,7 +46,7 @@ export class LandingPage implements OnInit {
landingOptions = { landingOptions = {
initialSlide: 1, initialSlide: 1,
speed: 1000, speed: 1000,
allowTouchMove: false allowTouchMove: true
}; };
ngOnInit() {} ngOnInit() {}
......
...@@ -16,12 +16,21 @@ ...@@ -16,12 +16,21 @@
input { input {
border: 1px solid rgba(215, 213, 228, 1); border: 1px solid rgba(215, 213, 228, 1);
background: transparent; background: transparent;
color: rgba(215, 213, 228, 1); color: #000;
width: 100%; width: 100%;
height: 45px; height: 45px;
text-align: center; text-align: center;
border-radius: 8px; border-radius: 8px;
font-size: 16px; font-size: 16px;
outline: none;
transition: all .4s ease-in-out;
&::placeholder {
color: rgba(215, 213, 228, 1);
}
&:focus {
border: 1px solid #f3d09f;
box-shadow: 3px 3px 6px 0px rgba(202, 154, 83, 0.11);
}
} }
.login_btn { .login_btn {
width: 100%; width: 100%;
......
...@@ -46,8 +46,6 @@ ...@@ -46,8 +46,6 @@
padding: 0px; padding: 0px;
font-weight: 800; font-weight: 800;
} }
p {
}
input { input {
width: 100%; width: 100%;
height: 45px; height: 45px;
...@@ -56,6 +54,15 @@ ...@@ -56,6 +54,15 @@
padding-left: 10px; padding-left: 10px;
padding-right: 10px; padding-right: 10px;
margin-bottom: 20px; margin-bottom: 20px;
outline: none;
transition: all 0.4s ease-in-out;
&::placeholder {
color: rgba(215, 213, 228, 1);
}
&:focus {
border: 1px solid #f3d09f;
box-shadow: 3px 3px 6px 0px rgba(202, 154, 83, 0.11);
}
} }
.add_btn { .add_btn {
width: 100%; width: 100%;
......
...@@ -93,7 +93,17 @@ ...@@ -93,7 +93,17 @@
Delivery time : <span>{{deliveryTime}}</span> Delivery time : <span>{{deliveryTime}}</span>
</h5> </h5>
<h5>Order Status : <span>{{getStatus(data.orderStatus)}}</span></h5> <h5>Order Status : <span>{{getStatus(data.orderStatus)}}</span></h5>
<h4>DELIVERY</h4> <div class="delivery-wrap">
<h4 class="floatLeft">DELIVERY</h4>
<span class="floatRight"
><img
class="ng-tns-c3-0"
src="../../assets/edit.png"
(click)="goToPage('changeaddress')"
/></span>
<div class="clear"></div>
</div>
<h5 *ngIf="data.deliveryAddress"> <h5 *ngIf="data.deliveryAddress">
{{data.deliveryAddress.addressType}},<br />{{data.deliveryAddress.address}}, {{data.deliveryAddress.addressType}},<br />{{data.deliveryAddress.address}},
<br /> <br />
...@@ -102,7 +112,7 @@ ...@@ -102,7 +112,7 @@
</h5> </h5>
<button <button
class="cancel_btn" class="cancel_btn"
(click)="cancellOrder(data.orderId)" (click)="goToPage('contact')"
*ngIf="cancelDelivery > 0 && data.orderStatus != 0 && data.orderStatus != 8" *ngIf="cancelDelivery > 0 && data.orderStatus != 0 && data.orderStatus != 8"
> >
CANCEL THIS ORDER CANCEL THIS ORDER
......
...@@ -172,6 +172,12 @@ ...@@ -172,6 +172,12 @@
margin-bottom: 20px; margin-bottom: 20px;
margin-top: 20px; margin-top: 20px;
} }
.delivery-wrap {
img {
width: 20px;
margin-top: 20px;
}
}
} }
.related_product_slider { .related_product_slider {
h5 { h5 {
......
...@@ -283,7 +283,11 @@ ...@@ -283,7 +283,11 @@
[ngClass]="checkFavStatus(product.prodId)" [ngClass]="checkFavStatus(product.prodId)"
(click)="changeFav(product.prodId)" (click)="changeFav(product.prodId)"
></button> ></button>
<button class="cart" (click)="buyNow(product,0)"></button> <button
class="cart"
[disabled]="!disCart"
(click)="buyNow(product,0)"
></button>
</div> </div>
<div class="footer_btn" (click)="buyNow(product,1)">BUY NOW</div> <div class="footer_btn" (click)="buyNow(product,1)">BUY NOW</div>
</div> </div>
......
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from "@angular/core";
import { Location } from '@angular/common'; import { Location } from "@angular/common";
import { Router, ActivatedRoute } from '@angular/router'; import { Router, ActivatedRoute } from "@angular/router";
import { Products } from './../../config/services/product'; import { Products } from "./../../config/services/product";
import { Slides } from './../../config/services/slides'; import { Slides } from "./../../config/services/slides";
import { Order } from './../../config/services/order'; import { Order } from "./../../config/services/order";
import { CartsService } from './../../config/cart.service'; import { CartsService } from "./../../config/cart.service";
import { ProductsService } from './../../config/products.service'; import { ProductsService } from "./../../config/products.service";
import { ServiceService } from './../../config/service.service'; import { ServiceService } from "./../../config/service.service";
import { SocialSharing } from '@ionic-native/social-sharing/ngx'; import { SocialSharing } from "@ionic-native/social-sharing/ngx";
import { map } from 'rxjs/operators'; import { map } from "rxjs/operators";
@Component({ @Component({
selector: 'app-productdetail', selector: "app-productdetail",
templateUrl: './productdetail.page.html', templateUrl: "./productdetail.page.html",
styleUrls: ['./productdetail.page.scss'] styleUrls: ["./productdetail.page.scss"]
}) })
export class ProductdetailPage implements OnInit { export class ProductdetailPage implements OnInit {
disCart: boolean = true;
slide: Slides; slide: Slides;
product: Products; product: Products;
order: Order; order: Order;
...@@ -55,7 +56,7 @@ export class ProductdetailPage implements OnInit { ...@@ -55,7 +56,7 @@ export class ProductdetailPage implements OnInit {
params.subCate, params.subCate,
params.prodId params.prodId
); );
this.service.get('params').then(val => { this.service.get("params").then(val => {
this.data = val; this.data = val;
}); });
this.cartService.cartList(); this.cartService.cartList();
...@@ -132,9 +133,9 @@ export class ProductdetailPage implements OnInit { ...@@ -132,9 +133,9 @@ export class ProductdetailPage implements OnInit {
buyNow(product: any, type: number) { buyNow(product: any, type: number) {
this.cartService.buyNow(product).then(() => { this.cartService.buyNow(product).then(() => {
if (type === 1) { if (type === 1) {
this.router.navigateByUrl('cart'); this.router.navigateByUrl("cart");
} else { } else {
this.service.showToast('Added into cart', 'top', 'my-toast', 2000); this.service.showToast("Added into cart", "top", "my-toast", 2000);
} }
this.cartService.cartList(); this.cartService.cartList();
}); });
...@@ -146,32 +147,32 @@ export class ProductdetailPage implements OnInit { ...@@ -146,32 +147,32 @@ export class ProductdetailPage implements OnInit {
checkFavStatus(index) { checkFavStatus(index) {
const state = this.prodService.fav.findIndex(x => x === index); const state = this.prodService.fav.findIndex(x => x === index);
return state > -1 ? 'fav_active' : 'fav'; return state > -1 ? "fav_active" : "fav";
} }
changeFav(index) { changeFav(index) {
this.prodService.changeFav(index, 'yes'); this.prodService.changeFav(index, "yes");
const state = this.prodService.fav.findIndex(x => x === index); const state = this.prodService.fav.findIndex(x => x === index);
// console.log(state); // console.log(state);
// console.log(this.prodService.fav); // console.log(this.prodService.fav);
if (state > -1) { if (state > -1) {
this.prodService.fav.splice(state, 1); this.prodService.fav.splice(state, 1);
this.prodService.changeFav(index, 'yes'); this.prodService.changeFav(index, "yes");
} else { } else {
this.prodService.fav.push(index); this.prodService.fav.push(index);
this.prodService.changeFav(index, 'no'); this.prodService.changeFav(index, "no");
} }
return; return;
// console.log(this.prodService.fav); // console.log(this.prodService.fav);
} }
socialShare(prodName, category, subCate, price, image) { socialShare(prodName, category, subCate, price, image) {
const desc = category + ', ' + subCate + ', ' + price; const desc = category + ", " + subCate + ", " + price;
const content = { const content = {
message: desc, // not supported on some apps (Facebook, Instagram) message: desc, // not supported on some apps (Facebook, Instagram)
subject: prodName, // fi. for email subject: prodName, // fi. for email
files: image, files: image,
chooserTitle: 'GetMi' chooserTitle: "GetMi"
}; };
this.socialSharing.shareWithOptions(content); this.socialSharing.shareWithOptions(content);
} }
......
...@@ -192,14 +192,14 @@ ...@@ -192,14 +192,14 @@
.styled-checkbox { .styled-checkbox {
position: absolute; // take it out of document flow position: absolute; // take it out of document flow
opacity: 0; // hide it opacity: 0; // hide it
& + label { &+label {
position: relative; position: relative;
cursor: pointer; cursor: pointer;
padding: 0; padding: 0;
width: 100%; width: 100%;
} }
// Box. // Box.
& + label:before { &+label:before {
content: ''; content: '';
margin-right: 10px; margin-right: 10px;
display: inline-block; display: inline-block;
...@@ -210,21 +210,21 @@ ...@@ -210,21 +210,21 @@
background: white; background: white;
border: 1px solid rgba(215, 213, 228, 1); border: 1px solid rgba(215, 213, 228, 1);
} }
&:checked + label:before { &:checked+label:before {
background: #29285b; background: #29285b;
} }
// Disabled state label. // Disabled state label.
&:disabled + label { &:disabled+label {
color: #b8b8b8; color: #b8b8b8;
cursor: auto; cursor: auto;
} }
// Disabled box. // Disabled box.
&:disabled + label:before { &:disabled+label:before {
box-shadow: none; box-shadow: none;
background: #ddd; background: #ddd;
} }
// Checkmark. Could be replaced with an image // Checkmark. Could be replaced with an image
&:checked + label:after { &:checked+label:after {
content: ''; content: '';
position: absolute; position: absolute;
left: 6px; left: 6px;
...@@ -232,8 +232,7 @@ ...@@ -232,8 +232,7 @@
background: white; background: white;
width: 2px; width: 2px;
height: 2px; height: 2px;
box-shadow: 2px 0 0 white, 4px 0 0 white, 4px -2px 0 white, box-shadow: 2px 0 0 white, 4px 0 0 white, 4px -2px 0 white, 4px -4px 0 white, 4px -6px 0 white, 4px -8px 0 white;
4px -4px 0 white, 4px -6px 0 white, 4px -8px 0 white;
transform: rotate(45deg); transform: rotate(45deg);
} }
} }
......
...@@ -15,39 +15,14 @@ ...@@ -15,39 +15,14 @@
<div class="form_div"> <div class="form_div">
<form #signupForm="ngForm" novalidate> <form #signupForm="ngForm" novalidate>
<div class="row"> <div class="row">
<input <input class="" type="text" placeholder="Your name" [(ngModel)]="signup.name" name="name" #name="ngModel" required />
class="" <div class="md-errors-spacer" [hidden]="name.valid || submitted == false">
type="text"
placeholder="Your name"
[(ngModel)]="signup.name"
name="name"
#name="ngModel"
required
/>
<div
class="md-errors-spacer"
[hidden]="name.valid || submitted == false"
class="ion-padding-start"
>
Name is required Name is required
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<input <input class="" type="email" placeholder="Email Address" [(ngModel)]="signup.emailId" name="emailId" #emailId="ngModel" email pattern="[a-zA-Z0-9.-_]{1,}@[a-zA-Z.-]{2,}[.]{1}[a-zA-Z]{2,}" required />
class="" <div class="md-errors-spacer" [hidden]="emailId.valid || submitted == false">
type="email"
placeholder="Email Address"
[(ngModel)]="signup.emailId"
name="emailId"
#emailId="ngModel"
email
pattern="[a-zA-Z0-9.-_]{1,}@[a-zA-Z.-]{2,}[.]{1}[a-zA-Z]{2,}"
required
/>
<div
class="md-errors-spacer"
[hidden]="emailId.valid || submitted == false"
>
<div *ngIf="emailId.errors && emailId.errors.required"> <div *ngIf="emailId.errors && emailId.errors.required">
Email is required Email is required
</div> </div>
...@@ -57,21 +32,8 @@ ...@@ -57,21 +32,8 @@
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<input <input class="" type="text" placeholder="Phone number" [(ngModel)]="signup.phone" name="phone" #phone="ngModel" pattern="(\(+61\)|\+61|\(0[1-9]\)|0[1-9])?( ?-?[0-9]){6,9}" maxlength="10" required />
class="" <div class="md-errors-spacer" [hidden]="phone.valid || submitted == false">
type="text"
placeholder="Phone number"
[(ngModel)]="signup.phone"
name="phone"
#phone="ngModel"
pattern="(\(+61\)|\+61|\(0[1-9]\)|0[1-9])?( ?-?[0-9]){6,9}"
maxlength="10"
required
/>
<div
class="md-errors-spacer"
[hidden]="phone.valid || submitted == false"
>
<div *ngIf="phone.errors && phone.errors.required"> <div *ngIf="phone.errors && phone.errors.required">
Phone number is required Phone number is required
</div> </div>
...@@ -81,20 +43,8 @@ ...@@ -81,20 +43,8 @@
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<input <input class="" type="password" placeholder="Create A Password" [(ngModel)]="signup.password" name="password" #password="ngModel" minlength="6" required />
class="" <div class="md-errors-spacer" [hidden]="password.valid || submitted == false">
type="password"
placeholder="Create A Password"
[(ngModel)]="signup.password"
name="password"
#password="ngModel"
minlength="6"
required
/>
<div
class="md-errors-spacer"
[hidden]="password.valid || submitted == false"
>
<div *ngIf="password.errors && password.errors.required"> <div *ngIf="password.errors && password.errors.required">
Password is required Password is required
</div> </div>
...@@ -104,45 +54,18 @@ ...@@ -104,45 +54,18 @@
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<ion-datetime <ion-datetime displayFormat="DD-MM-YYYY" [(ngModel)]="signup.dob" name="dob" #dob="ngModel" placeholder="Date of Birth" max="{{minDate}}" required></ion-datetime>
displayFormat="DD-MM-YYYY" <div class="md-errors-spacer" [hidden]="dob.valid || submitted == false">
[(ngModel)]="signup.dob"
name="dob"
#dob="ngModel"
placeholder="Date of Birth"
max="{{minDate}}"
required
></ion-datetime>
<div
class="md-errors-spacer"
[hidden]="dob.valid || submitted == false"
>
<div *ngIf="dob.errors && dob.errors.required">DOB is required</div> <div *ngIf="dob.errors && dob.errors.required">DOB is required</div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<h6> <h6>
<input <input class="styled-checkbox" id="styled-checkbox-1" type="checkbox" value="true" [(ngModel)]="signup.terms" required name="terms" #terms="ngModel" />
class="styled-checkbox" <label for="styled-checkbox-1"><span>I agree with
id="styled-checkbox-1" <a (click)="menuToggle()">Terms and Conditions</a></span></label>
type="checkbox"
value="true"
[(ngModel)]="signup.terms"
required
name="terms"
#terms="ngModel"
/>
<label for="styled-checkbox-1"
><span
>I agree with
<a (click)="menuToggle()">Terms and Conditions</a></span
></label
>
</h6> </h6>
<div <div class="md-errors-spacer" [hidden]="terms.valid || submitted == false">
class="md-errors-spacer"
[hidden]="terms.valid || submitted == false"
>
<div *ngIf="terms.errors && terms.errors.required"> <div *ngIf="terms.errors && terms.errors.required">
Please accept Terms and Conditions Please accept Terms and Conditions
</div> </div>
...@@ -160,11 +83,7 @@ ...@@ -160,11 +83,7 @@
</div> </div>
<div class="row"> <div class="row">
<div class="social_div"> <div class="social_div">
<div <div class="social_btn" style="border-right:1px solid rgba(215, 213, 228, 1);" (click)="register.facebook()">
class="social_btn"
style="border-right:1px solid rgba(215, 213, 228, 1);"
(click)="register.facebook()"
>
Facebook Facebook
</div> </div>
<div class="social_btn" (click)="register.google(2)"> <div class="social_btn" (click)="register.google(2)">
...@@ -185,15 +104,9 @@ ...@@ -185,15 +104,9 @@
<div class="terms_inner"> <div class="terms_inner">
<h5>Terms & Conditions</h5> <h5>Terms & Conditions</h5>
<p> <p>
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has
Lorem Ipsum has been the industry's standard dummy text ever since the survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop
1500s, when an unknown printer took a galley of type and scrambled it to publishing software like Aldus PageMaker including versions of Lorem Ipsum.
make a type specimen book. It has survived not only five centuries, but
also the leap into electronic typesetting, remaining essentially
unchanged. It was popularised in the 1960s with the release of Letraset
sheets containing Lorem Ipsum passages, and more recently with desktop
publishing software like Aldus PageMaker including versions of Lorem
Ipsum.
</p> </p>
<button class="accept" (click)="menuToggle()">I Accept</button> <button class="accept" (click)="menuToggle()">I Accept</button>
</div> </div>
......
...@@ -16,23 +16,43 @@ ...@@ -16,23 +16,43 @@
input { input {
border: 1px solid rgba(215, 213, 228, 1); border: 1px solid rgba(215, 213, 228, 1);
background: transparent; background: transparent;
color: rgba(215, 213, 228, 1); color: #000;
width: 100%; width: 100%;
height: 45px; height: 45px;
text-align: center; text-align: center;
border-radius: 8px; border-radius: 8px;
font-size: 16px; font-size: 16px;
outline: none;
transition: all .4s ease-in-out;
&::placeholder {
color: rgba(215, 213, 228, 1);
}
&:focus {
border: 1px solid #f3d09f;
box-shadow: 3px 3px 6px 0px rgba(202, 154, 83, 0.11);
}
}
.md-errors-spacer {
color: #c76969;
font-size: 14px;
} }
ion-datetime { ion-datetime {
border: 1px solid rgba(215, 213, 228, 1); border: 1px solid rgba(215, 213, 228, 1);
background: transparent; background: transparent;
color: rgba(215, 213, 228, 1); color: #000;
width: 100%; width: 100%;
height: 45px; height: 45px;
text-align: center; text-align: center;
border-radius: 8px; border-radius: 8px;
font-size: 16px; font-size: 16px;
padding-left: 0px; padding-left: 0px;
&::placeholder {
color: rgba(215, 213, 228, 1) !important;
}
&:focus {
border: 1px solid #f3d09f;
box-shadow: 3px 3px 6px 0px rgba(202, 154, 83, 0.11);
}
} }
.login_btn { .login_btn {
width: 100%; width: 100%;
......
...@@ -8,12 +8,21 @@ ...@@ -8,12 +8,21 @@
input { input {
border: 1px solid rgba(215, 213, 228, 1); border: 1px solid rgba(215, 213, 228, 1);
background: transparent; background: transparent;
color: rgba(215, 213, 228, 1); color: #000;
width: 100%; width: 100%;
height: 45px; height: 45px;
text-align: center; text-align: center;
border-radius: 8px; border-radius: 8px;
font-size: 16px; font-size: 16px;
outline: none;
transition: all .4s ease-in-out;
&::placeholder {
color: rgba(215, 213, 228, 1);
}
&:focus {
border: 1px solid #f3d09f;
box-shadow: 3px 3px 6px 0px rgba(202, 154, 83, 0.11);
}
} }
.login_btn { .login_btn {
width: 100%; width: 100%;
......
import { Injectable } from '@angular/core';
import {
AngularFirestore,
AngularFirestoreCollection
} from '@angular/fire/firestore';
import { take } from 'rxjs/operators';
import { ContactData } from './services/contact';
import { ServiceService } from './service.service';
import { Router, ActivatedRoute } from '@angular/router';
@Injectable({
providedIn: 'root'
})
export class ContactService {
loader: boolean;
constructor(
public afs: AngularFirestore,
private router: Router,
private service: ServiceService
) {
this.loader = false;
}
contactCreate(data: ContactData) {
this.loader = true;
this.afs
.collection('contacts')
.add({})
.then(docRef => {
data.contactId = docRef.id;
this.afs
.collection('contacts')
.doc(data.contactId)
.set(data)
.then(() => {
this.service
.showToast('Thank you for your feedback!', 'top', 'my-toast', 500)
.then(() => {
this.loader = false;
console.log('redirected');
setTimeout(() => {
this.router.navigateByUrl('home');
}, 500);
})
.catch(err => {
this.loader = false;
});
});
});
}
}
export interface ContactData {
from: string;
contactId: string;
message: string;
}
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