diff --git a/Mohem/package.json b/Mohem/package.json index aab0bf8d..eca4aeb3 100644 --- a/Mohem/package.json +++ b/Mohem/package.json @@ -114,7 +114,7 @@ "ionic4-rating": "^1.0.9", "ng-circle-progress": "^1.5.1", "ng2-file-upload": "^1.3.0", - "ng2-pdf-viewer": "^5.3.2", + "ng2-pdf-viewer": "^3.0.8", "ngx-gauge": "^1.0.0-beta.10", "npm": "^6.14.11", "phonegap-nfc": "^1.2.0", @@ -127,6 +127,7 @@ "tslib": "^1.10.0", "uk.co.workingedge.phonegap.plugin.launchnavigator": "^3.2.2", "xlsx": "^0.14.3", + "xml-js": "^1.6.11", "zone.js": "~0.8.29" }, "devDependencies": { diff --git a/Mohem/src/app/backend-integrations/announcement/announcement.component.html b/Mohem/src/app/backend-integrations/announcement/announcement.component.html index 7402c007..8ee0f724 100644 --- a/Mohem/src/app/backend-integrations/announcement/announcement.component.html +++ b/Mohem/src/app/backend-integrations/announcement/announcement.component.html @@ -60,18 +60,18 @@ - {{detialData.title_EN}}
-

{{detialData.date}}

+ {{detailData.title_EN}}
+

{{detailData.date}}

- {{detialData.title_AR}}
-

{{detialData.date}}

+ {{detailData.title_AR}}
+

{{detailData.date}}

- -
+ +
-

-

+

+

diff --git a/Mohem/src/app/backend-integrations/announcement/announcement.component.scss b/Mohem/src/app/backend-integrations/announcement/announcement.component.scss index 6e104364..8a030fb1 100644 --- a/Mohem/src/app/backend-integrations/announcement/announcement.component.scss +++ b/Mohem/src/app/backend-integrations/announcement/announcement.component.scss @@ -5,6 +5,7 @@ margin-right: auto; height: 190px; } + .main-card-image { width: 100%; display: block; @@ -13,6 +14,7 @@ position: absolute; height: 100%; } + .text-style { margin: 5px; } @@ -21,19 +23,19 @@ // border: 1px solid lightgray; // border-radius: 30px; } -.class-dev-open { -} + +.class-dev-open {} .class-item-open { border: 1px solid lightgray; border-radius: 30px; height: 100px; } -.class-item-close { -} + +.class-item-close {} .image-item-en { - padding-left: 5px; + padding: 5px; width: 100px; min-height: 100px; border: 5px solid white; @@ -42,8 +44,9 @@ border-right: 0px; object-fit: cover; } + .image-item-ar { - padding-right: 5px; + padding: 5px; width: 100px; min-height: 100px; border: 5px solid white; @@ -66,11 +69,13 @@ opacity: 1; padding-bottom: 5px; } + .item-list-p-title { font: normal normal medium 11px/16px Poppins; letter-spacing: -0.44px; color: #535353; } + .item-list-date-title { font: normal normal 600 10px/16px Poppins; letter-spacing: -0.4px; @@ -83,11 +88,13 @@ color: #ffffff; white-space: break-spaces; } + .item-list-first-p { font: normal normal normal 12px/17px Poppins; letter-spacing: -0.12px; color: #ffffff; } + .item-list-first-date { text-align: left; font: normal normal bold 8px/23px Poppins; @@ -101,6 +108,7 @@ color: #2b353e; margin-bottom: -34px; } + .card-style-p { font: normal normal medium 13px/18px Poppins; letter-spacing: -0.52px; @@ -118,21 +126,23 @@ position: relative; min-height: 283px; } + .main-card-item-list-style { position: absolute; bottom: 0px; --background: transparent; } -.main-card-label-stle{ - margin: 0px; - padding: 0px; - width: 237px; + +.main-card-label-stle { + margin: 0px; + padding: 0px; + width: 237px; } -.main-card-label-style-all{ - padding: 0px; - margin: 0px; - width: 200px; +.main-card-label-style-all { + padding: 0px; + margin: 0px; + width: 200px; } .item-native { diff --git a/Mohem/src/app/backend-integrations/announcement/announcement.component.ts b/Mohem/src/app/backend-integrations/announcement/announcement.component.ts index 464b73af..8d0e6022 100644 --- a/Mohem/src/app/backend-integrations/announcement/announcement.component.ts +++ b/Mohem/src/app/backend-integrations/announcement/announcement.component.ts @@ -22,14 +22,15 @@ export class AnnouncementComponent implements OnInit { public pageSize = 1; public pageLength = 0; public lengthCounter = 5; - public detialData: { - id: number, - title_EN: string, - title_AR: string, - body_EN: string, - body_AR: string, - img?: string, - date: Date}; + public detailData: { + id: number, + title_EN: string, + title_AR: string, + body_EN: string, + body_AR: string, + img?: string, + date: Date + }; constructor( public announcementService: AnnouncementService, @@ -63,21 +64,21 @@ export class AnnouncementComponent implements OnInit { this.common.stopLoading(); if (this.common.validResponse(result)) { holdData = JSON.parse(result.Mohemm_ITG_ResponseItem); - data = JSON.parse(holdData.result.data)[0]; + data = holdData.result.data[0]; console.log(data); - this.detialData = { + this.detailData = { id: data.rowID, - title_EN: data.Title_EN, - title_AR: data.Title_AR, - body_EN: data.Body_EN, - body_AR: data.Body_AR, + title_EN: data.titleEn, + title_AR: data.titleAr, + body_EN: data.descriptionEn, + body_AR: data.descriptionAr, date: data.created, - img: data.Banner_Image + img: data.imageContent }; element.isOpen = !element.isOpen; // this.common.stopLoading(); } - console.log(this.detialData); + console.log(this.detailData); }); } else { element.isOpen = false; @@ -86,7 +87,7 @@ export class AnnouncementComponent implements OnInit { } - closeAnnouncement(item){ + closeAnnouncement(item) { item.isOpen = false; } @@ -97,24 +98,24 @@ export class AnnouncementComponent implements OnInit { this.common.stopLoading(); if (this.common.validResponse(result)) { holdData = JSON.parse(result.Mohemm_ITG_ResponseItem); - this.listOfAnnouncement = JSON.parse(holdData.result.data); + this.listOfAnnouncement = holdData.result.data; this.pageLength = this.listOfAnnouncement[0].TotalItems; for (let i = 0; i < this.listOfAnnouncement.length; i++) { - this.listOfAnnouncement[i].Title_EN = this.listOfAnnouncement[i].Title_EN; - this.listOfAnnouncement[i].Title_AR = this.listOfAnnouncement[i].Title_AR; - this.listOfAnnouncement[i].EmailBody_EN = this.listOfAnnouncement[i].EmailBody_EN; - this.listOfAnnouncement[i].EmailBody_AR = this.listOfAnnouncement[i].EmailBody_AR; + this.listOfAnnouncement[i].Title_EN = this.listOfAnnouncement[i].titleEn; + this.listOfAnnouncement[i].Title_AR = this.listOfAnnouncement[i].titleAr; + this.listOfAnnouncement[i].EmailBody_EN = this.listOfAnnouncement[i].descriptionEn; + this.listOfAnnouncement[i].EmailBody_AR = this.listOfAnnouncement[i].descriptionAr; this.arr[i] = { id: this.listOfAnnouncement[i].rowID, - title_EN: this.listOfAnnouncement[i].Title_EN, - title_AR: this.listOfAnnouncement[i].Title_AR, - body_EN: this.listOfAnnouncement[i].EmailBody_EN, - body_AR: this.listOfAnnouncement[i].EmailBody_AR, + title_EN: this.listOfAnnouncement[i].titleEn, + title_AR: this.listOfAnnouncement[i].titleAr, + body_EN: this.listOfAnnouncement[i].descriptionEn, + body_AR: this.listOfAnnouncement[i].descriptionAr, date: this.listOfAnnouncement[i].created, - img: this.listOfAnnouncement[i].Banner_Image, + img: this.listOfAnnouncement[i].imageContent, isopen: false }; - if ( i < this.numberOfListLength){ + if (i < this.numberOfListLength) { this.announcementList.push(this.arr[i]); } this.arrList.push(this.arr[i]); diff --git a/Mohem/src/app/hmg-common/services/connector/connector.service.ts b/Mohem/src/app/hmg-common/services/connector/connector.service.ts index 5a1959c6..f472cb49 100644 --- a/Mohem/src/app/hmg-common/services/connector/connector.service.ts +++ b/Mohem/src/app/hmg-common/services/connector/connector.service.ts @@ -27,8 +27,8 @@ export class ConnectorService { public static retryTimes = 0; public static timeOut = 180 * 1000; - // public static host = 'https://uat.hmgwebservices.com/'; - public static host = 'https://hmgwebservices.com/'; + public static host = 'https://uat.hmgwebservices.com/'; + // public static host = 'https://hmgwebservices.com/'; constructor(public httpClient: HttpClient, public cs: CommonService, diff --git a/Mohem/src/app/offersdiscount/home/home.component.html b/Mohem/src/app/offersdiscount/home/home.component.html index b84354f8..cfab7d6d 100644 --- a/Mohem/src/app/offersdiscount/home/home.component.html +++ b/Mohem/src/app/offersdiscount/home/home.component.html @@ -54,22 +54,22 @@ -
- {{item.Title}} - {{item.Title_AR}} +
+ {{item.titleEn}} + {{item.titleAr}}
-
-
+
+
- {{item.Discount}} + {{item.discountDescription}}
- - + +

{{ts.trPK('general','offer-valid')}}

- +

{{ts.trPK('general','expired')}}

diff --git a/Mohem/src/app/offersdiscount/home/home.component.ts b/Mohem/src/app/offersdiscount/home/home.component.ts index 8ee773ac..ac88296a 100644 --- a/Mohem/src/app/offersdiscount/home/home.component.ts +++ b/Mohem/src/app/offersdiscount/home/home.component.ts @@ -113,8 +113,7 @@ export class HomeComponent implements AfterViewInit { displayOffers(data) { if (data['data']) { - var parseJSON = data['data']; - var offers = JSON.parse(parseJSON); + var offers = data['data']; console.log(offers); this.offersData = this.filterActiveItems(offers); console.log(this.offersData); @@ -123,7 +122,7 @@ export class HomeComponent implements AfterViewInit { } filterActiveItems(offers) { return offers.filter((res) => { - return res['IsActive'] == 'True'; + return res.isActive == true; }); } filterOffers(key) { diff --git a/Mohem/src/app/offersdiscount/offer-details/offer-details.component.html b/Mohem/src/app/offersdiscount/offer-details/offer-details.component.html index 1d9c3d44..831659ad 100644 --- a/Mohem/src/app/offersdiscount/offer-details/offer-details.component.html +++ b/Mohem/src/app/offersdiscount/offer-details/offer-details.component.html @@ -14,22 +14,22 @@ + [src]="details.banner_Image"> - {{details.Title}} - {{details.Title_AR}} + {{details.titleEn}} + {{details.titleAr}} -
-
+
+
- - + +

{{ts.trPK('general','offer-valid')}}

- +

{{ts.trPK('general','expired')}}

@@ -69,23 +69,25 @@ -
+
- {{item.Title}} + {{item.titleEn}} + {{item.titleAr}}
-
+
+
- {{item.Discount}} + {{item.discountDescription}}
- - + +

{{ts.trPK('general','offer-valid')}}

- +

{{ts.trPK('general','expired')}}

diff --git a/Mohem/src/app/offersdiscount/offer-details/offer-details.component.ts b/Mohem/src/app/offersdiscount/offer-details/offer-details.component.ts index ee364abe..ac8ef5fb 100644 --- a/Mohem/src/app/offersdiscount/offer-details/offer-details.component.ts +++ b/Mohem/src/app/offersdiscount/offer-details/offer-details.component.ts @@ -25,7 +25,7 @@ export class OfferDetailsComponent implements OnInit { } getDotted(temp) { temp = this.stripHtml(temp); - return temp.substring(0, 100) + " ..."; + return temp.substring(0, 40) + " ..."; } stripHtml(html) { var temporalDivElement = document.createElement("div"); diff --git a/Mohem/src/app/offersdiscount/services/service.ts b/Mohem/src/app/offersdiscount/services/service.ts index 2a838807..17a39e77 100644 --- a/Mohem/src/app/offersdiscount/services/service.ts +++ b/Mohem/src/app/offersdiscount/services/service.ts @@ -32,7 +32,7 @@ export class OfferDiscountService { request['EmployeeNumber'] = request.UserName; request['ItgIsActive'] = true; request['ItgPageSize'] = 10; - request['ItgPageNo'] = pageNo; + request['ItgPageNo'] = pageNo ? pageNo : 1; if (catId) { request['ItgCategoryID'] = categoryId; }