UNPKG

@wjya/ngx-webapp-icpc.group.pms

Version:

angular webapp : icpc.group.pms

53 lines 4.71 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var data_source_helper_1 = require("./../../service/data-source.helper"); var core_1 = require("@angular/core"); var router_1 = require("@angular/router"); var SmsRechargeModalComponent = /** @class */ (function () { function SmsRechargeModalComponent(router, activatedRoute, dataSourceHelper) { this.router = router; this.activatedRoute = activatedRoute; this.dataSourceHelper = dataSourceHelper; this.data = []; this.modalIsVisible = false; this.dataSource = this.dataSourceHelper.smsPackages; } SmsRechargeModalComponent.prototype.ngOnInit = function () { this.loadAll(); }; SmsRechargeModalComponent.prototype.loadAll = function () { var _this = this; this.dataSource.findList({ size: 3 }).subscribe(function (res) { _this.data = res.body; }); }; SmsRechargeModalComponent.prototype.selectPackage = function (_package) { this.currentPackageId = _package.id; }; SmsRechargeModalComponent.prototype.handleCancel = function () { this.modalIsVisible = false; }; SmsRechargeModalComponent.prototype.buy = function () { this.router.navigate(['../sms-recharge/wait-pay'], { queryParams: { packageId: this.currentPackageId }, relativeTo: this.activatedRoute }); }; SmsRechargeModalComponent.decorators = [ { type: core_1.Component, args: [{ selector: 'zx-sms-recharge-modal', template: "<nz-modal [nzVisible]=\"modalIsVisible\" [nzWidth]=\"600\" [nzTitle]=\"modalTitle\" [nzContent]=\"modalContent\" [nzFooter]=\"null\" (nzOnCancel)=\"handleCancel()\"><ng-template #modalTitle><i class=\"anticon anticon-pay-circle-o\"></i> <span>\u8D2D\u4E70\u77ED\u4FE1\u5305</span></ng-template><ng-template #modalContent><p style=\"margin-bottom: 15px;text-align: center;\">\u77ED\u4FE1\u5305\u4E0D\u652F\u6301\u9000\u6B3E\uFF0C\u8BF7\u786E\u8BA4\u540E\u8D2D\u4E70</p><div nz-row [nzGutter]=\"12\" class=\"row\"><div nz-col [nzSpan]=\"8\" *ngFor=\"let item of data; let i = index\" (click)=\"index = i;selectPackage(item)\"><div [ngStyle]=\"{'border-color':index === i ? '#1890FF' : '#000' }\"><div><span>{{item.name}}</span></div><div><span>{{item.rowNumber}}</span> <b>\u6761</b></div><div><span>\uFFE5{{item.sellPrice}}</span> <s>\uFFE5{{item.originalPrice}}\u5143</s></div><div>{{item.sellPrice/item.rowNumber}}\u5143/\u6761</div><span class=\"hot\" *ngIf=\"item.hotFlag\">HOT</span></div></div></div><div style=\"margin-top: 15px;text-align: center;\"><button nz-button [nzType]=\"'primary'\" (click)=\"buy()\" [disabled]=\"!currentPackageId\"><span>\u7ACB\u5373\u8D2D\u4E70</span></button></div></ng-template></nz-modal>", styles: [ "\n :host .row > div > div{\n text-align:center;\n border:1px solid #000;\n border-radius: 5px;\n cursor: pointer;\n position: relative;\n }\n :host .row > div > div > div:nth-child(1) {\n margin-top: 30px;\n }\n :host .row > div > div > div:nth-child(1) > span{\n background: #eee;\n padding: 4px 12px;\n }\n :host .row > div > div > div:nth-child(2) {\n margin: 40px 0;\n color: #000;\n }\n :host .row > div > div > div:nth-child(2) > span{\n font-size: 20px;\n font-weight: bold;\n }\n :host .row > div > div > div:nth-child(3) > span{\n font-size: 20px;\n color: #1890FF\n }\n :host .row > div > div > div:nth-child(4) {\n margin: 10px 0 30px 0;\n }\n :host .hot {\n position: absolute;\n top: 2px;\n right: -20px;\n transform: rotate(45deg) scale(0.8);\n height: 0px;\n border-bottom: 20px solid #ec9314;\n border-left: 20px solid transparent;\n border-right: 20px solid transparent;\n font-size: 12px;\n color: #fff;\n }\n " ] },] }, ]; /** @nocollapse */ SmsRechargeModalComponent.ctorParameters = function () { return [ { type: router_1.Router, }, { type: router_1.ActivatedRoute, }, { type: data_source_helper_1.DataSourceHelper, }, ]; }; return SmsRechargeModalComponent; }()); exports.SmsRechargeModalComponent = SmsRechargeModalComponent; //# sourceMappingURL=sms-recharge-modal.component.js.map