offers and discount and annoucement changes

MOHEMM-Q3-DEV-LATEST
Sultan Khan 3 years ago
parent fabc043de0
commit 9ad53b9857

@ -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": {

@ -60,18 +60,18 @@
<ion-card *ngIf="item.isOpen" (click)="closeAnnouncement(item)" style="margin: 0px;">
<ion-card-header style="background: transparent;">
<ion-card-title style="font-size: 20px; margin: 5px;" *ngIf="direction === 'en'">{{detialData.title_EN}} <br>
<p style="font-size: 12px; color: gray;">{{detialData.date}}</p>
<ion-card-title style="font-size: 20px; margin: 10px;" *ngIf="direction === 'en'">{{detailData.title_EN}} <br>
<p style="font-size: 12px; color: gray;">{{detailData.date}}</p>
</ion-card-title>
<ion-card-title style="font-size: 20px; margin: 5px;" *ngIf="direction === 'ar'">{{detialData.title_AR}} <br>
<p style="font-size: 12px; color: gray;">{{detialData.date}}</p>
<ion-card-title style="font-size: 20px; margin:10px;" *ngIf="direction === 'ar'">{{detailData.title_AR}} <br>
<p style="font-size: 12px; color: gray;">{{detailData.date}}</p>
</ion-card-title>
<img *ngIf='detialData.img' [src]="detialData.img" class="image-center">
<div *ngIf='!detialData.img'></div>
<img *ngIf='detailData.img' [src]="detailData.img" class="image-center">
<div *ngIf='!detailData.img'></div>
</ion-card-header>
<ion-card-content>
<p *ngIf="direction === 'en'"><span [innerHTML]="detialData.body_EN"></span></p>
<p *ngIf="direction === 'ar'"><span [innerHTML]="detialData.body_AR"></span></p>
<p *ngIf="direction === 'en'"><span [innerHTML]="detailData.body_EN"></span></p>
<p *ngIf="direction === 'ar'"><span [innerHTML]="detailData.body_AR"></span></p>
</ion-card-content>
</ion-card>
</div>

@ -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 {

@ -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]);

@ -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,

@ -54,22 +54,22 @@
<ion-card class="offers-discount-card">
<ion-card-header>
<!-- <img [src]="item.Banner_Image" /> -->
<div class="header-img" [ngStyle]="{'background-image': 'url(' + item.Banner_Image + ')'}"></div>
<ion-card-title *ngIf='direction === "ltr"'>{{item.Title}}</ion-card-title>
<ion-card-title *ngIf='direction === "rtl"'>{{item.Title_AR}}</ion-card-title>
<div class="header-img" [ngStyle]="{'background-image': 'url(' + item.banner_Image + ')'}"></div>
<ion-card-title *ngIf='direction === "ltr"'>{{item.titleEn}}</ion-card-title>
<ion-card-title *ngIf='direction === "rtl"'>{{item.titleAr}}</ion-card-title>
</ion-card-header>
<ion-card-content>
<div *ngIf='direction === "ltr"' style="min-height: 60px; max-height: 100%;" [innerHTML]="getDotted(item.Description)"></div>
<div *ngIf='direction === "rtl"' style="min-height: 60px; max-height: 100%;" [innerHTML]="getDotted(item.Description_AR)"></div>
<div *ngIf='direction === "ltr"' style="min-height: 60px; max-height: 100%;" [innerHTML]="getDotted(item.descriptionEn)"></div>
<div *ngIf='direction === "rtl"' style="min-height: 60px; max-height: 100%;" [innerHTML]="getDotted(item.descriptionAr)"></div>
<div class="dark offers-title">
{{item.Discount}}
{{item.discountDescription}}
</div>
<ion-row [class]="checkDate(item['End Date']) ==true ? 'green' : 'red'">
<ion-col size="10" *ngIf="checkDate(item['End Date']) ==true">
<ion-row [class]="checkDate(item.endDate) ==true ? 'green' : 'red'">
<ion-col size="10" *ngIf="checkDate(item.endDate) ==true">
<p class="offer-valid">{{ts.trPK('general','offer-valid')}}</p>
</ion-col>
<ion-col size="10" *ngIf="checkDate(item['End Date']) ==false">
<ion-col size="10" *ngIf="checkDate(item.endDate) ==false">
<p class="offer-valid"> {{ts.trPK('general','expired')}}</p>
</ion-col>
<ion-col size="2">

@ -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) {

@ -14,22 +14,22 @@
<!-- <div class="header-img-main" [ngStyle]="{'background-image': 'url(' + details.Banner_Image + ')'}" ></div>
-->
<image-modal size="big" fontsize="1cm"
[src]="details.Banner_Image">
[src]="details.banner_Image">
</image-modal>
<ion-card-title *ngIf="direction =='ltr'">{{details.Title}}</ion-card-title>
<ion-card-title *ngIf="direction =='rtl'">{{details.Title_AR}}</ion-card-title>
<ion-card-title *ngIf="direction =='ltr'">{{details.titleEn}}</ion-card-title>
<ion-card-title *ngIf="direction =='rtl'">{{details.titleAr}}</ion-card-title>
</ion-card-header>
<ion-card-content>
<div *ngIf="direction =='ltr'" [innerHTML]="details.Description"> </div>
<div *ngIf="direction =='rtl'" [innerHTML]="details.Description_AR"> </div>
<div *ngIf="direction =='ltr'" [innerHTML]="details.descriptionEn"> </div>
<div *ngIf="direction =='rtl'" [innerHTML]="details.descriptionAr"> </div>
<div class="content-bottom">
<ion-row [class]="checkDate(details['End Date']) ==true ? 'green' : 'red'">
<ion-col size="10" *ngIf="checkDate(details['End Date']) ==true">
<ion-row [class]="checkDate(details.endDate) ==true ? 'green' : 'red'">
<ion-col size="10" *ngIf="checkDate(details.endDate) ==true">
<p class="offer-valid">{{ts.trPK('general','offer-valid')}}</p>
</ion-col>
<ion-col size="10" *ngIf="checkDate(details['End Date']) ==false">
<ion-col size="10" *ngIf="checkDate(details.endDate) ==false">
<p class="offer-valid"> {{ts.trPK('general','expired')}}</p>
</ion-col>
@ -69,23 +69,25 @@
<ion-col size="6" *ngFor="let item of related" (click)="openRelated(item)">
<ion-card class="related-card">
<ion-card-header>
<div class="header-img" [ngStyle]="{'background-image': 'url(' + item.Banner_Image + ')'}" ></div>
<div class="header-img" [ngStyle]="{'background-image': 'url(' + item.banner_Image + ')'}" ></div>
<ion-card-title>{{item.Title}}</ion-card-title>
<ion-card-title *ngIf="direction =='ltr'">{{item.titleEn}}</ion-card-title>
<ion-card-title *ngIf="direction =='rtl'">{{item.titleAr}}</ion-card-title>
</ion-card-header>
<ion-card-content>
<div [innerHTML]="getDotted(item.Description)" class='description'></div>
<div *ngIf="direction =='ltr'" [innerHTML]="getDotted(item.descriptionEn)"> </div>
<div *ngIf="direction =='rtl'" [innerHTML]="getDotted(item.descriptionAr)"> </div>
<div class="dark offers-title">
{{item.Discount}}
{{item.discountDescription}}
</div>
<ion-row [class]="checkDate(item['End Date']) ==true ? 'green' : 'red'">
<ion-col size="10" *ngIf="checkDate(item['End Date']) ==true">
<ion-row [class]="checkDate(item.endDate) ==true ? 'green' : 'red'">
<ion-col size="10" *ngIf="checkDate(item.endDate) ==true">
<p class="offer-valid">{{ts.trPK('general','offer-valid')}}</p>
</ion-col>
<ion-col size="10" *ngIf="checkDate(item['End Date']) ==false">
<ion-col size="10" *ngIf="checkDate(item.endDate) ==false">
<p class="offer-valid"> {{ts.trPK('general','expired')}}</p>
</ion-col>
<ion-col size="2" >

@ -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");

@ -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;
}

Loading…
Cancel
Save