item for sale udated

sultan-q3
Sultan Khan 4 years ago
parent 9568ecedcd
commit a59adb2107

@ -242,7 +242,7 @@ export class ConfirmLoginComponent implements OnInit {
const request = new SendActivationByType(); const request = new SendActivationByType();
this.authService.setPublicFields(request); this.authService.setPublicFields(request);
request.OTP_SendType = type; request.OTP_SendType = type;
request.MobileNumber = this.loginData.MobileNumber; request.MobileNumber = '0543841742';//this.loginData.MobileNumber;
request.smsSignature = this.signature; request.smsSignature = this.signature;
request.IsMobileFingerPrint = 0; request.IsMobileFingerPrint = 0;

@ -629,7 +629,7 @@ export class SmsPageComponent implements OnInit {
if (key === undefined && this.platform.is('ios')) { if (key === undefined && (this.platform.is('ios') && !this.platform.is('mobileweb'))) {
this.checkActivation(e.target.value, false); this.checkActivation(e.target.value, false);

@ -18,57 +18,56 @@ import { AlertController } from '@ionic/angular';
styleUrls: ['./smsdialog.page.scss'], styleUrls: ['./smsdialog.page.scss'],
}) })
export class SmsdialogPage implements OnInit { export class SmsdialogPage implements OnInit {
public timeInSeconds : number ; public timeInSeconds: number;
public time : number; public time: number;
public runTimer : boolean; public runTimer: boolean;
public static SHARED_DATA = 'h2o-login-details'; public static SHARED_DATA = 'h2o-login-details';
public hasStarted : boolean; public hasStarted: boolean;
public countryCode: CountryCode; public countryCode: CountryCode;
public hasFinished : boolean; public hasFinished: boolean;
public remainingTime : number; public remainingTime: number;
public displayTime : string = ""; public displayTime: string = "";
// public userData: UserDetailsModel; // public userData: UserDetailsModel;
public mobile : string; public mobile: string;
public country_code : string; public country_code: string;
public id : string; public id: string;
public MobileNumber : string; public MobileNumber: string;
public token : string; public token: string;
public resend : boolean = false; public resend: boolean = false;
public smc_code : any; public smc_code: any;
constructor(public cs: CommonService, constructor(public cs: CommonService,
public ts: TranslatorService, public ts: TranslatorService,
public alertController: AlertController, public alertController: AlertController,
public smsService: SmsReaderService, public smsService: SmsReaderService,
public sharedData: SharedDataService, public sharedData: SharedDataService,
private modalCtrl:ModalController, private modalCtrl: ModalController,
// private navParams: NavParams, // private navParams: NavParams,
public smsservice: SMSDialogService) { public smsservice: SMSDialogService) {
// this.country_code = this.navParams.get("c_code"); // this.country_code = this.navParams.get("c_code");
// this.MobileNumber = this.navParams.get('mobile'); // this.MobileNumber = this.navParams.get('mobile');
// this.mobile = this.navParams.get('mobile'); // this.mobile = this.navParams.get('mobile');
// this.id = this.navParams.get('id'); // this.id = this.navParams.get('id');
// this.smsservice.sendActivationCode(this.id, this.mobile, // this.smsservice.sendActivationCode(this.id, this.mobile,
// this.country_code, () => { }, // this.country_code, () => { },
// this.ts.trPK('general', 'ok')).subscribe((result: SendValidationResponse) => { // this.ts.trPK('general', 'ok')).subscribe((result: SendValidationResponse) => {
// if (this.cs.validResponse(result)) { // if (this.cs.validResponse(result)) {
// if (result.isSMSSent) { // if (result.isSMSSent) {
// this.token = result.LogInTokenID; // this.token = result.LogInTokenID;
// this.initTimer(); // this.initTimer();
// this.startTimer(); // this.startTimer();
// } else { // } else {
// this.stopSMSMonitoring(); // this.stopSMSMonitoring();
// } // }
// } else { // } else {
// this.stopSMSMonitoring(); // this.stopSMSMonitoring();
// } // }
// }); // });
} }
ngOnInit() { ngOnInit() {
} }
closeModal() closeModal() {
{
this.modalCtrl.dismiss(); this.modalCtrl.dismiss();
} }
@ -77,8 +76,8 @@ export class SmsdialogPage implements OnInit {
} }
initTimer() { initTimer() {
if (!this.timeInSeconds) { if (!this.timeInSeconds) {
this.timeInSeconds = 60; this.timeInSeconds = 60;
} }
this.time = this.timeInSeconds; this.time = this.timeInSeconds;
this.runTimer = false; this.runTimer = false;
@ -87,22 +86,22 @@ export class SmsdialogPage implements OnInit {
this.remainingTime = this.timeInSeconds; this.remainingTime = this.timeInSeconds;
this.displayTime = this.getSecondsAsDigitalClock(this.remainingTime); this.displayTime = this.getSecondsAsDigitalClock(this.remainingTime);
} }
startTimer() { startTimer() {
this.runTimer = true; this.runTimer = true;
this.hasStarted = true; this.hasStarted = true;
this.resend = false; this.resend = false;
this.timerTick(); this.timerTick();
} }
pauseTimer() { pauseTimer() {
this.runTimer = false; this.runTimer = false;
} }
resumeTimer() { resumeTimer() {
this.startTimer(); this.startTimer();
} }
timerTick() { timerTick() {
setTimeout(() => { setTimeout(() => {
if (!this.runTimer) { return; } if (!this.runTimer) { return; }
@ -117,7 +116,7 @@ export class SmsdialogPage implements OnInit {
} }
}, 1000); }, 1000);
} }
getSecondsAsDigitalClock(inputSeconds: number) { getSecondsAsDigitalClock(inputSeconds: number) {
var sec_num = parseInt(inputSeconds.toString(), 10); // don't forget the second param var sec_num = parseInt(inputSeconds.toString(), 10); // don't forget the second param
var hours = Math.floor(sec_num / 3600); var hours = Math.floor(sec_num / 3600);
@ -132,13 +131,12 @@ export class SmsdialogPage implements OnInit {
return minutesString + ':' + secondsString; return minutesString + ':' + secondsString;
} }
validate() validate() {
{
this.checkSMSActivationCode(this.smc_code); this.checkSMSActivationCode(this.smc_code);
} }
public presentSMSPasswordDialog() { public presentSMSPasswordDialog() {
} }
async presentAlert() { async presentAlert() {
@ -153,21 +151,20 @@ export class SmsdialogPage implements OnInit {
private checkSMSActivationCode(smsCode: string) { private checkSMSActivationCode(smsCode: string) {
this.smsservice.validateActivationCode(this.token, smsCode, this.smsservice.validateActivationCode(this.token, smsCode,
() => {}, this.ts.trPK('settings', 'incorrect_otp')).subscribe((result: Response) => { () => { }, this.ts.trPK('settings', 'incorrect_otp')).subscribe((result: Response) => {
if (this.cs.validResponse(result)) { if (this.cs.validResponse(result)) {
this.stopSMSMonitoring(); //this.stopSMSMonitoring();
this.modalCtrl.dismiss(); this.modalCtrl.dismiss();
SMSDialogService.modal_success = true; SMSDialogService.modal_success = true;
} }
}); });
} }
public stopSMSMonitoring() { public stopSMSMonitoring() {
this.smsService.stopSMSMonitoring(); this.smsService.stopSMSMonitoring();
} }
public ResendOTP() public ResendOTP() {
{
// this.smsservice.sendActivationCode(this.id, this.mobile, // this.smsservice.sendActivationCode(this.id, this.mobile,
// this.country_code, () => { }, // this.country_code, () => { },
// this.ts.trPK('general', 'ok')).subscribe((result: SendValidationResponse) => { // this.ts.trPK('general', 'ok')).subscribe((result: SendValidationResponse) => {

@ -58,12 +58,15 @@
</div> </div>
<div class="grid-row"> <div class="grid-row">
<div class="loader" *ngIf="!items ">
<img src="../assets/icon/progress-loading.gif" />
</div>
<ion-row *ngIf="items"> <ion-row *ngIf="items">
<ion-col size="6" (click)="openDetails(item)" *ngFor="let item of items"> <ion-col size="6" (click)="openDetails(item)" *ngFor="let item of items">
<ion-card> <ion-card>
<ion-card-header> <ion-card-header>
<img *ngIf="item.itemAttachments[0]" [src]="getImgContent('data:image/png;base64, ' +item.itemAttachments[0].content)" /> <img *ngIf="item.itemAttachments[0] && item.itemAttachments[0].content" [src]="getImgContent('data:image/png;base64, ' +item.itemAttachments[0].content)" />
<img *ngIf="!item.itemAttachments[0]" src="/assets/imgs/no-images.png" /> <img *ngIf="!item.itemAttachments[0] || !item.itemAttachments[0].content" src="/assets/imgs/no-images.png" />
<ion-card-title *ngIf="direction == 'ltr'">{{item.title}}</ion-card-title> <ion-card-title *ngIf="direction == 'ltr'">{{item.title}}</ion-card-title>
<ion-card-title *ngIf="direction =='rtl'">{{item.title_Ar}}</ion-card-title> <ion-card-title *ngIf="direction =='rtl'">{{item.title_Ar}}</ion-card-title>
@ -110,8 +113,8 @@
<ion-row> <ion-row>
<ion-item button detail="false" *ngFor="let item of itemsByEmployee"> <ion-item button detail="false" *ngFor="let item of itemsByEmployee">
<ion-thumbnail slot="start"> <ion-thumbnail slot="start">
<img *ngIf="item.itemAttachments[0]" [src]="getImgContent('data:image/png;base64, ' +item.itemAttachments[0].content)" /> <img *ngIf="item.itemAttachments[0] && item.itemAttachments[0].content" [src]="getImgContent('data:image/png;base64, ' +item.itemAttachments[0].content)" />
<img *ngIf="!item.itemAttachments[0]" src="assets/imgs/no-images.png" /> <img *ngIf="!item.itemAttachments[0] || !item.itemAttachments[0].content" src="assets/imgs/no-images.png" />
</ion-thumbnail> </ion-thumbnail>
<ion-label class="label-thumb"> <ion-label class="label-thumb">

@ -101,9 +101,9 @@ ion-card-content p{
font-weight: bold; font-weight: bold;
} }
.my-ads ion-item{ .my-ads ion-item{
margin: 10px; margin:0px 10px;
--border-radius: 10px; --border-radius: 10px;
padding: 15px 10px 0px 10px; padding: 10px 10px 0px 10px;
width: 100%; width: 100%;
} }
.my-ads ion-thumbnail img{ .my-ads ion-thumbnail img{
@ -257,4 +257,17 @@ ion-fab-button{
} }
.space{ .space{
height:100px; height:100px;
}
.loader{
display: block;
position: absolute;
margin: auto;
text-align: center;
width: 100%;
}
.loader img{
display: inline-block;
margin: auto;
width: 25px;
} }

@ -48,6 +48,7 @@ export class ItemsComponent implements OnInit {
this.items = []; this.items = [];
this.items = this.itemService.parser(result); this.items = this.itemService.parser(result);
this.tempSearch = deepCopy(this.items); this.tempSearch = deepCopy(this.items);
console.log(this.tempSearch);
this.cs.stopLoading(); this.cs.stopLoading();
}) })
} }
@ -64,6 +65,7 @@ export class ItemsComponent implements OnInit {
selectCategory(item) { selectCategory(item) {
this.cs.startLoading(); this.cs.startLoading();
this.activeClass = item.categoryID; this.activeClass = item.categoryID;
this.pageNo = 1;
this.itemService.getItems({ pageNo: this.pageNo, ItgCategoryID: item.categoryID }, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => { this.itemService.getItems({ pageNo: this.pageNo, ItgCategoryID: item.categoryID }, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
this.items = []; this.items = [];
this.items = this.itemService.parser(result); this.items = this.itemService.parser(result);

Loading…
Cancel
Save