diff --git a/src/app/login/login.page.ts b/src/app/login/login.page.ts index 34ec813..c4e1357 100644 --- a/src/app/login/login.page.ts +++ b/src/app/login/login.page.ts @@ -10,7 +10,7 @@ import { ToastService } from '../services/toast.service'; }) export class LoginPage implements OnInit { credentials = { - username: 'rakeshsrh', + username: 'geethu', password: '123456789', login_type: 'user' }; diff --git a/src/app/mall-details/mall-details.page.html b/src/app/mall-details/mall-details.page.html index 5a0958a..92964e9 100644 --- a/src/app/mall-details/mall-details.page.html +++ b/src/app/mall-details/mall-details.page.html @@ -12,7 +12,7 @@
- + @@ -29,7 +29,7 @@ - + @@ -61,10 +61,10 @@
- + -

+

{{ outlet.outlet_name }}
{{ outlet.rating }} @@ -72,8 +72,9 @@

- {{ outlet.description }} -

diff --git a/src/app/mall-details/mall-details.page.ts b/src/app/mall-details/mall-details.page.ts index c6e42a9..41d257e 100644 --- a/src/app/mall-details/mall-details.page.ts +++ b/src/app/mall-details/mall-details.page.ts @@ -28,6 +28,31 @@ export class MallDetailsPage implements OnInit { this.location.back(); } + shareMallDetails(mallData) { + if (window.navigator && window.navigator['share']) { + const shareData = { + title: mallData.mall.mall_name, + text: mallData.mall.description, + url: 'https://maps.google.com/?q=' + mallData.latitude + ',' + mallData.longitude + } + + window.navigator['share'](shareData); + } + } + + + shareOutletDetails(outlet) { + if (window.navigator && window.navigator['share']) { + const shareData = { + title: this.mallDetails.mall.mall_name + ',' + outlet.outlet_name, + text: outlet.description, + url: 'https://maps.google.com/?q=' + this.mallDetails.latitude + ',' + this.mallDetails.longitude + } + + window.navigator['share'](shareData); + } + } + onScroll(event: any) { if (event.detail.scrollTop > 100) { this.show_top_bar = true; @@ -39,7 +64,12 @@ export class MallDetailsPage implements OnInit { outletDetails(outlet: any) { this.router.navigate(['/outlet-details', { outlet: JSON.stringify(outlet), - mallId: this.mallDetails.mall.mall_id + mallId: this.mallDetails.mall.mall_id, + mallData: JSON.stringify({ + title: this.mallDetails.mall.mall_name, + text: this.mallDetails.mall.description, + url: 'https://maps.google.com/?q=' + this.mallDetails.latitude + ',' + this.mallDetails.longitude + }) }]); } diff --git a/src/app/malls/malls.page.html b/src/app/malls/malls.page.html index 2357c7f..06876dc 100644 --- a/src/app/malls/malls.page.html +++ b/src/app/malls/malls.page.html @@ -46,11 +46,11 @@ - + -

{{ mallData.mall.mall_name }}

-

{{ mallData.mall.description }}

+

{{ mallData.mall.mall_name }}

+

{{ mallData.mall.description }}

@@ -68,7 +68,7 @@
- -
@@ -35,7 +35,7 @@ -
diff --git a/src/app/outlet-details/outlet-details.page.ts b/src/app/outlet-details/outlet-details.page.ts index 7819a9b..0431f40 100644 --- a/src/app/outlet-details/outlet-details.page.ts +++ b/src/app/outlet-details/outlet-details.page.ts @@ -32,6 +32,18 @@ export class OutletDetailsPage implements OnInit { ngOnInit() { } + shareOutletDetails() { + if (window.navigator && window.navigator['share']) { + const shareData = { + title: JSON.parse(this.route.snapshot.paramMap.get('mallData')).title + ',' + this.outlet_details.outlet_name, + text: this.outlet_details.description, + url: JSON.parse(this.route.snapshot.paramMap.get('mallData')).url + } + + window.navigator['share'](shareData); + } + } + getFormatterDateTime(date: any, format: string) { return moment(date).format(format); }