- import { Component } from '@angular/core';
- import { App, IonicPage, ModalController, NavController, NavParams } from 'ionic-angular';
- import { PromoProvider } from '../../providers/promo/promo';
- import { GlobalProvider } from '../../providers/global/global';
- import { LoginProvider } from '../../providers/login/login';
- import { sha256 } from 'js-sha256';
- import * as moment from 'moment';
- import { AppsFlyerProvider } from '../../providers/apps-flyer/apps-flyer';
- /**
- * Generated class for the LandingPromoPage page.
- *
- * See https://ionicframework.com/docs/components/#navigation for more info on
- * Ionic pages and navigation.
- */
- moment.locale('id');
- @IonicPage()
- @Component({
- selector: 'page-landing-promo',
- templateUrl: 'landing-promo.html',
- })
- export class LandingPromoPage {
- dataNih: any;
- promo_category: any;
- promo_category_all: any;
- conditionalDivider = false;
- promo_category_child: any = [];
- group_data_date: any = [];
- dateConvertArray: any = [];
- filteredItems: any = [];
- dataList: any;
- dataContent: any;
- dataEmpty: any = '';
- tabsActive: any;
- filter: any = {
- category: '',
- sort: [],
- brand: [],
- };
- page: number = 1;
- limit: number = 10; // Set your desired limit
- defaultCustName: string = "Bunga";
- paginationSearch: any;
- custName: any;
- resultName: any;
- loading: boolean = true;
- tabsRekomendasi = true;
- tampil = true;
- floatingButtonShow = false;
- emptyData: string;
- tampilErrorEmptyData = true;
- dataRekomendasi = [
- {
- category_id: 0,
- category_name: "Rekomendasi"
- }
- ];
- constructor(public navCtrl: NavController,
- public navParams: NavParams,
- public promoprov: PromoProvider,
- public global: GlobalProvider,
- public modal: ModalController,
- public app: App,
- public loginProv: LoginProvider,
- public appsFlyerProv: AppsFlyerProvider,
- ) {
- if (this.global.isLogin) {
- this.setCustName();
- }
- }
- ionViewDidLoad() {
- console.log('ionViewDidLoad LandingPromoPage');
- // this.dataRekomendasi
- if (this.global.isLogin) {
- this.loadPromo()
- }
- }
- ionViewDidEnter() {
- if (this.global.isLogin) {
- this.getListDataPromo()
- } else {
- this.global.getAlertBasic("Silahkan Login terlebih dahulu", "OK").onWillDismiss(() => {
- this.global.app.getRootNav().push("LockscreenNewPage");
- })
- }
- }
- ionViewWillEnter() {
- if (this.global.isLogin) {
- this.getListDataPromo()
- }
- }
- back() {
- this.app.getRootNav().push("TabsPage");
- }
- loadPromo(alias?) {
- this.promoprov.checkUpdatePromo((isUpdate) => {
- this.getBrgMega(isUpdate);
- // if (this.global.isLogin) {
- // this.getListDataPromo();
- // } else {
- // this.global.getAlertBasic("Silahkan Login terlebih dahulu","OK").onWillDismiss(()=>{
- // this.global.app.getRootNav().push("LockscreenNewPage");
- // })
- // }
- });
- // this.getListDataPromo();
- }
- setCustName() {
- if (this.global.isLogin) {
- this.defaultCustName = "";
- this.custName = "";
- this.global
- .getSecureData(this.global.LOCAL_CUSTNAME)
- .then((cust_name) => {
- this.defaultCustName = this.global.SecureStorage.decrypt(
- cust_name,
- this.global.keys.secretKey
- );
- // this.global.log(this.defaultCustName,'name nih');
- this.custName = this.defaultCustName.split(" ");
- this.resultName = this.custName[0];
- // const resultName = this.custName[0]
- this.global.log(this.resultName, 'result name nih');
- return this.resultName
- });
- }
- }
- getBrgMega(isUpdate) {
- this.promoprov
- .getBrgMega(isUpdate)
- .then((result: any) => {
- // this.promo_category = result.data;
- this.loading = true
- console.log(result, 'result nih');
- let temp = result.data;
- this.promo_category = [];
- // let temp_category = {
- // category_id: "0",
- // category_image: "https://ibank.bankmega.com/payget/imagepromo/dining.png",
- // category_name: "YOUR COUPON",
- // category_url: "https://msmiledev.bankmega.com/service/getpromobm?idcategory=13",
- // display_image: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAM4AAADOCAYAAAB2Hz3EAAAACXBIWXMAAAsSAAALEgHS3X78AAARfklEQVR42u2dS2wbxx2Hf5Yth2ZeK1gIKCRVxJPJoEVNAj7YERBLqA3YCGJb6cUKWjixWyAy8kCCAH0AiZMemiJtkSaQDm2dx6HOJZXliwPIheUASpyihSmjRUmfpCgOxKIKxLxkKpatHoaTXS53lrPkkuIufx9AWBaplTjcb/+Pmd3dsLa2hpo4PmIAOAhge+nxAIiajRuBSATo7BR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hOIQEhpx5jgMhHji/Q6MjlEcQrwxJ1O19zkWhGgzI8WZ4FgQos0ExSHEG5cxOlZK1USdw3SNkOq8BZS3o09wTAhx5fNKcUbHLjDqEOLKqxgdK9gjDgA8zbEhxJGPMTr2bVZWLs7o2AyAFzlGhFRw0PqfDWtra5UvOT5yAcADHCtCAACPYnTsLes3OlzsuszxIgRv26VRiyMKoN2Uh7Q5f8Do2BGnJ9Sro0153ub4kTZNz5TNMucap7LmOQjRv76T40lCzmUAR0qNMtQnjpDHgJgkfYpjS0LIxwBOONUz9YlTLtARiDmfezneJOCcATChK0zt4pRL1Feqg7aXHoQEgQsAZgBckCsBvPJ/WX56s1Vul80AAAAASUVORK5CYII=",
- // file_name: "dining.png",
- // file_type: "png",
- // dummy:true,
- // }
- // this.promo_category.push(temp_category);
- temp.forEach((item, index) => {
- this.promo_category.push(item);
- });
- this.promo_category.forEach((item, index) => {
- if (index == 0) {
- if (item.dummy) {
- this.getApi_PromoNew(item.category_url, index, true, item.dummy);
- } else {
- this.getApi_PromoNew(item.category_url, index);
- }
- } else {
- this.getApi_PromoNew(item.category_url, index, false);
- }
- });
- // this.search(this.promo_category[0], 0);
- this.searchRekomendasi(this.dataRekomendasi[0], 0);
- // if(this.dataRekomendasi[0]) {
- // this.appsFlyerProv.logAppsFlyer('af_promo_rekomendasi_screen', {});
- // }
- this.tabsRekomendasi = true;
- })
- .catch((err) => {
- this.global.log("brgmega_err", err);
- });
- }
- getApi_PromoNew(url, index, pushdata = true, dummy = false) {
- this.tabsRekomendasi = true;
- if (url && dummy == false) {
- this.promoprov.getBrgMegaDetailNew(url, (data) => {
- // this.promo_category_child = [];
- if (data) {
- if (data.RC == "00") {
- // this.tabsRekomendasi = false
- this.loading = true;
- var temp: any = data.data;
- var array: any = [];
- this.global.log(url, 'data detail');
- this.global.log(temp, 'data detail berhasil');
- temp.forEach((item, index) => {
- array.push(item);
- });
- this.promo_category[index]["child"] = array;
- if (pushdata) {
- this.promo_category_child = array;
- }
- }
- }
- });
- } else {
- this.promo_category_child = [];
- if (dummy) {
- let temp_dummy = {
- colour: "putih",
- front_banner: "assets/dashboard2/kupon.png",
- id: 2590,
- id_category: 15,
- language: "id",
- // link_id: "www.bankmega.com/promo/samsung-po-galaxy-tab-s8-5g",
- link_id: "",
- name_category: "E-Commerce",
- title: "Pre Order Samsung Galaxy Tab S8 Series 5G",
- dummy: true,
- };
- var array: any = [];
- array.push(temp_dummy);
- array.push(temp_dummy);
- array.push(temp_dummy);
- this.promo_category[index]["child"] = array;
- this.tabsRekomendasi = false
- this.loading = true;
- if (pushdata) {
- this.promo_category_child = array;
- }
- }
- }
- }
- searchRekomendasi(data, index) {
- this.global.log(data);
- this.appsFlyerProv.logAppsFlyer('af_promo_rekomendasi', {});
- this.tabsRekomendasi = true
- this.floatingButtonShow = false;
- this.filter.category = data.category_id;
- // this.search(data,index);
- // this.promo_category_child = []
- this.getListDataPromo();
- this.promo_category_child = [];
- this.dateConvertArray = [];
- }
- handlePromoAll() {
- if (this.promo_category_all.category_url) {
- this.app.getRootNav().push('PromoPage', {
- cat_id: this.promo_category_all.category_id,
- cat_name: this.promo_category_all.category_name,
- cat_url: this.promo_category_all.category_url,
- list_kategori: this.promo_category
- });
- }
- }
- formatDate(date) {
- return moment(date).format('dddd, DD MMMM YYYY')
- }
- formatTime(time) {
- return moment(time).format('HH:mm')
- }
- search(data, index) {
- this.filter.category = data.category_id;
- this.promo_category_all = data;
- this.global.log(data, 'data');
- // this.tabsActive = data.category_name;
- this.tabsActive = data.category_name;
- this.global.log(this.tabsActive, 'data tabs appsflyer');
- if (data.category_name == "Dining") {
- this.appsFlyerProv.logAppsFlyer('af_promo_dining', {});
- this.appsFlyerProv.logAppsFlyer('af_promo_dining_screen', {});
- } else if (data.category_name == "Travel & Entertainment") {
- this.appsFlyerProv.logAppsFlyer('af_promo_travel', {});
- this.appsFlyerProv.logAppsFlyer('af_promo_travel_screen', {});
- } else if (data.category_name == "E-commerce") {
- this.appsFlyerProv.logAppsFlyer('af_promo_ecommerce', {});
- this.appsFlyerProv.logAppsFlyer('af_promo_ecommerce_screen', {});
- } else if (data.category_name == "Lifestyle") {
- this.appsFlyerProv.logAppsFlyer('af_promo_lifestyle', {});
- this.appsFlyerProv.logAppsFlyer('af_promo_lifestyle_screen', {});
- } else if (data.category_name == "CT Corp Lifetime Benefit") {
- this.appsFlyerProv.logAppsFlyer('af_promo_ctcorp', {});
- this.appsFlyerProv.logAppsFlyer('af_promo_ctcorp_screen', {});
- } else if (data.category_name == "Telecommunication & Utilities") {
- this.appsFlyerProv.logAppsFlyer('af_promo_telco', {});
- this.appsFlyerProv.logAppsFlyer('af_promo_telco_screen', {});
- } else if (data.category_name == "Lainnya") {
- this.appsFlyerProv.logAppsFlyer('af_promo_lainnya', {});
- this.appsFlyerProv.logAppsFlyer('af_promo_lainnya_screen', {});
- }
- this.tabsRekomendasi = false
- this.floatingButtonShow = true;
- this.loading = true;
- if (data.child) {
- // this.promo_category_child = data.child;
- this.global.log(this.promo_category_child,'promo category child');
- const newGroup = [];
- data.child.forEach((item) => {
- const date = item.publishing_date;
- const existingGroup = newGroup.findIndex(
- (group) => group.date === date
- );
- if (existingGroup > -1) {
- newGroup[existingGroup].items.push(item);
- } else {
- newGroup.push({ date: date, items: [item] });
- }
- })
- this.promo_category_child = newGroup
- // this.promo_category_child.forEach((item) => {
- // this.global.log(item,'item data nih');
- // const date = item.publishing_date;
- // const existingGroup = this.group_data_date.find(
- // (group) => group.date === date
- // );
- // this.global.log(existingGroup,'grup existing');
- // if (existingGroup) {
- // existingGroup.items.push(item);
- // } else {
- // this.group_data_date.push({ date: date, items: [item] });
- // }
- // this.global.log(existingGroup,'grup existing');
- // this.global.log(this.group_data_date,'group_data_date existing');
- // })
- } else {
- this.loading = true;
- this.getApi_PromoNew(data.category_url, index);
- }
- }
- getListDataPromo() {
- if (this.global.isLogin) {
- // let loader = this.global.loading();
- // loader.present();
- // this.loading = true;
- let resultNumber = sha256(this.loginProv.mobile);
- this.global.newRequestWs('api/v1/promo-recommendation', {
- uuid: resultNumber,
- page: this.page,
- limit: this.limit,
- SimInfo: {
- simSerialNumber: this.global.AESNEW.encrypt(this.global.rsltSim.simSerialNumber, this.global.keys),
- countryCode: this.global.rsltSim.countryCode,
- subscriberId: this.global.rsltSim.subscriberId,
- carrierName: this.global.rsltSim.carrierName,
- deviceId: this.global.rsltSim.deviceId
- },
- DeviceInfo: {
- model: this.global.devInfo.model,
- platform: this.global.devInfo.platform,
- uuid: this.global.devInfo.uuid,
- version: this.global.devInfo.version
- },
- Latlon: this.global.rsltGps
- }).then((res: any) => {
- this.global.log('promo-recommendation res', res.data);
- this.global.log('promo-recommendation res1', res.data.data);
- this.dataContent = res.data.map((item, index) => {
- return item.data.map((content, index) => {
- return content
- })
- })
- // loader.dismiss();
- this.loading = false;
- // this.dataList = [];
- this.dataList = res.data;
- this.promo_category_child = [];
- // Increment the page for the next API call
- // this.page++;
- // Complete the infinite scroll event
- // if (event) {
- // this.loading = false;
- // event.complete();
- // }
- }).catch(err => {
- this.global.log('recomendasi list', err);
- // loader.dismiss();
- this.emptyData = err.RCDesc
- this.tampilErrorEmptyData = true
- this.loading = true;
- this.tampil = false;
- this.dataList = [];
- })
- } else {
- this.global.getAlertBasic("Silahkan Login terlebih dahulu", "OK").onWillDismiss(() => {
- this.global.app.getRootNav().push("LockscreenNewPage");
- })
- }
- }
- getListDataPromoDetail(link, title, message) {
- this.global.log(link, 'campaign_id');
- let loader = this.global.loading();
- loader.present();
- let resultNumber = sha256(this.loginProv.mobile);
- this.global.newRequestWs('api/v1/promo-recommendation/detail', {
- uuid: resultNumber,
- link: link,
- SimInfo: {
- simSerialNumber: this.global.AESNEW.encrypt(this.global.rsltSim.simSerialNumber, this.global.keys),
- countryCode: this.global.rsltSim.countryCode,
- subscriberId: this.global.rsltSim.subscriberId,
- carrierName: this.global.rsltSim.carrierName,
- deviceId: this.global.rsltSim.deviceId
- },
- DeviceInfo: {
- model: this.global.devInfo.model,
- platform: this.global.devInfo.platform,
- uuid: this.global.devInfo.uuid,
- version: this.global.devInfo.version
- },
- Latlon: this.global.rsltGps
- }).then((res: any) => {
- this.global.log('promo-recommendation detail res', res);
- loader.dismiss();
- if (res.RC == "00") {
- this.global.app.getRootNav().push('LandingPromoIframePage', {
- data_url: link,
- title: title,
- message: message
- })
- } else {
- this.global.httpErrorHandler(res);
- }
- }).catch(err => {
- this.global.log('listMasuk_err detail', err);
- loader.dismiss();
- // this.global.httpErrorHandler(err);
- })
- }
- getDetailCategory(link_id, title, message) {
- this.global.log(link_id, 'link_id detail');
- this.global.log(title, 'title detail');
- this.global.log(message, 'message detail');
- this.global.log(this.tabsActive, 'tabs active');
- if (this.tabsActive == "Dining") {
- this.appsFlyerProv.logAppsFlyer('af_promo_dining_message', {
- promo_title: title
- });
- } else if (this.tabsActive == "Travel & Entertainment") {
- this.appsFlyerProv.logAppsFlyer('af_promo_travel_message', {
- promo_title: title
- });
- } else if (this.tabsActive == "E-commerce") {
- this.appsFlyerProv.logAppsFlyer('af_promo_ecommerce_message', {
- promo_title: title
- });
- } else if (this.tabsActive == "Lifestyle") {
- this.appsFlyerProv.logAppsFlyer('af_promo_lifestyle_message', {
- promo_title: title
- });
- } else if (this.tabsActive == "CT Corp Lifetime Benefit") {
- this.appsFlyerProv.logAppsFlyer('af_promo_ctcorp_message', {
- promo_title: title
- });
- } else if (this.tabsActive == "Telecommunication & Utilities") {
- this.appsFlyerProv.logAppsFlyer('af_promo_telco_message', {
- promo_title: title
- });
- } else if (this.tabsActive == "Lainnya") {
- this.appsFlyerProv.logAppsFlyer('af_promo_lainnya_message', {
- promo_title: title
- });
- }
- this.global.app.getRootNav().push('LandingPromoIframePage', {
- data_url: link_id,
- title: title,
- message: message ? message.replace(/<[^>]*>/g, '') : null,
- })
- }
- }
[text] promo ts
Viewer
*** This page was generated with the meta tag "noindex, nofollow". This happened because you selected this option before saving or the system detected it as spam. This means that this page will never get into the search engines and the search bot will not crawl it. There is nothing to worry about, you can still share it with anyone.
Editor
You can edit this paste and save as new: