import {
  okOptions
} from '../../settings/ok';
// import {
//   alpulOptions
// } from '../../settings/alpul';
// import {
//   couponOptions
// } from '../../settings/coupon';
// import {
//   hiOptions
// } from '../../settings/hi';
// import {
//   jdOptions
// } from '../../settings/jd';
// import {
//   koubeiOptions
// } from '../../settings/koubei';
// import {
//   laobiOptions
// } from '../../settings/laobi';
// import {
//   weixinOptions
// } from '../../settings/weixin';

export class IntroCouponActivityController {
  constructor($http, $log, $state, toastr, globalVar, $scope, introService) {
    'ngInject';

    this.$http = $http;
    this.$log = $log;
    this.$state = $state;
    this.toastr = toastr;
    this.globalVar = globalVar;
    this.$scope = $scope;
    this.introService = introService;


    this.$onInit = this.onInit.bind(this);
    this.$onChanges = this.onChanges.bind(this);
  }

  onInit() {
  }

  onChanges(changes) {
    if (changes) {

    }
  }

  confirm() {
    this.modalInstance.result.then(res => {
      if (res) {
        this.introService.showIntros(okOptions);
      }
    });

    this.closeModal('confirm');
  }

  back() {
    _laq.push(['send', 'click', 'btn-type', 'help-coupon-return']);

    this.closeModal('reopen');
    this.introService.openModal('introOption', 'modal-650');
  }

  goToIntroQuestion() {
    _laq.push(['send', 'click', 'btn-type', 'help-coupon-select']);

    this.closeModal('reopen');
    this.introService.openModal('introQuestion', 'modal-650');
  }

  closeModal(value) {
    return this.close({
      $value: value
    });
  }

  // #region channel's click 
  showIntros(channel) {
    this.introService.goToChannel(channel, false);
    
    this.closeModal('reopen');
  }
  // #endregion
}

export const introCouponActivityComponent = {
  bindings: {
    // For uibModal
    resolve: '<',
    modalInstance: '<',
    close: '&',
    dismiss: '&'
  },
  templateUrl: 'app/modules/intros/components/intro-couponActivity/intro-couponActivity.html',
  controller: IntroCouponActivityController
};