@wjya/ngx-webapp-icpc.group.pms
Version:
angular webapp : icpc.group.pms
102 lines • 8.23 kB
JavaScript
"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 BindingComponent = /** @class */ (function () {
function BindingComponent(dataSourceHelper, router) {
this.dataSourceHelper = dataSourceHelper;
this.router = router;
this.next = new core_1.EventEmitter();
this.status = {};
this.hasAuthOffical = false;
this.hasAuthTinyApp = false;
this.isDisabled = true;
this.t = null;
this.dataSource = this.dataSourceHelper.accountStep;
this.bindOfficalDataSource = this.dataSourceHelper.bindOfficalAuthUrl;
this.bindTinyAppDataSource = this.dataSourceHelper.bindTinyAppAuthUrl;
this.completeRegisterStepDataSource = this.dataSourceHelper.completeRegisterStep;
}
BindingComponent.prototype.ngOnInit = function () {
this.checkBindingStatus();
};
BindingComponent.prototype.checkBindingStatus = function () {
var _this = this;
if (this.status.hasAuthOffical) {
this.hasAuthOffical = true;
}
if (this.status.hasAuthTinyApp) {
this.hasAuthTinyApp = true;
}
if (this.status.hasAuthOffical && this.status.hasAuthTinyApp) {
this.isDisabled = false;
}
else {
this.t = setInterval(function () {
_this.dataSource.findList().subscribe(function (res) {
if (res.body.hasAuthOffical) {
_this.hasAuthOffical = true;
}
if (res.body.hasAuthTinyApp) {
_this.hasAuthTinyApp = true;
}
if (res.body.hasAuthOffical && res.body.hasAuthTinyApp) {
_this.isDisabled = false;
clearInterval(_this.t);
_this.t = null;
}
});
}, 1000);
}
};
BindingComponent.prototype.bindOffical = function () {
this.bindOfficalDataSource.findList().subscribe(function (res) {
window.open(res.body.url);
});
};
BindingComponent.prototype.bindTinyApp = function () {
if (!this.hasAuthOffical) {
return;
}
this.bindTinyAppDataSource.findList().subscribe(function (res) {
window.open(res.body.url);
});
};
BindingComponent.prototype.nextStep = function () {
var _this = this;
this.completeRegisterStepDataSource.create(null, {
registerStep: 'AUTH'
}).subscribe(function (success) {
_this.next.emit();
});
};
BindingComponent.prototype.ngOnDestroy = function () {
clearInterval(this.t);
this.t = null;
};
BindingComponent.prototype.back = function () {
this.router.navigate(['/login']);
};
BindingComponent.decorators = [
{ type: core_1.Component, args: [{
selector: 'zx-binding',
template: "<div class=\"box\"><div class=\"title\">\u6309\u4EE5\u4E0B\u6B65\u9AA4\u5B8C\u6210\u5E73\u53F0\u7ED1\u5B9A</div><div class=\"row\"><div><span>1\u3001\u6CE8\u518C\u5FAE\u4FE1\u516C\u4F17\u53F7\u5E76\u4E14\u8BA4\u8BC1\u3002</span> <a href=\"https://mp.weixin.qq.com\" target=\"_blank\">\u524D\u5F80\u6CE8\u518C</a> <a href=\"/docs/aaa.html\" target=\"_blank\">\u64CD\u4F5C\u6307\u5357</a></div><div class=\"tip\">\u8BF7\u6309\u4EE5\u4E0A\u6307\u5357\u5B8C\u6210\u516C\u4F17\u53F7\u6CE8\u518C\u4EE5\u53CA\u8BA4\u8BC1</div><div class=\"tip\">\u5DF2\u5B8C\u6210\u4EE5\u4E0A\u64CD\u4F5C\u7684\u7528\u6237\u53EF\u4EE5\u76F4\u63A5\u8DF3\u8FC7\u6B64\u6B65\u9AA4</div></div><div class=\"row\"><div><span>2\u3001\u5F00\u901A\u516C\u4F17\u53F7\u5FAE\u4FE1\u652F\u4ED8\u670D\u52A1\u3002</span> <a href=\"/docs/bbb.html\" target=\"_blank\">\u64CD\u4F5C\u6307\u5357</a></div><div class=\"tip\">\u5F00\u901A\u516C\u4F17\u53F7\u5FAE\u4FE1\u652F\u4ED8\u540E\u5B98\u65B9\u4F1A\u53D1\u9001\u5FAE\u4FE1\u5546\u6237\u8D26\u53F7\u81F3\u7533\u8BF7\u90AE\u7BB1\uFF0C\u8BF7\u59A5\u5584\u4FDD\u5B58\u597D\u5FAE\u4FE1\u5546\u6237\u8D26\u53F7\u6743\u9650\u3002</div></div><div class=\"row\"><div><span>3\u3001\u7ED1\u5B9A\u516C\u4F17\u53F7\u3002<span style=\"color: red\">{{hasAuthOffical ? '\uFF08\u5F53\u524D\u8D26\u53F7\u5DF2\u7ED1\u5B9A\u516C\u4F17\u53F7\uFF09': '\uFF08\u5F53\u524D\u8D26\u53F7\u672A\u7ED1\u5B9A\u516C\u4F17\u53F7\uFF09'}}</span></span> <a (click)=\"bindOffical()\" *ngIf=\"!hasAuthOffical\">\u524D\u5F80\u7ED1\u5B9A</a></div><div class=\"tip\">\u70B9\u51FB\u53F3\u4FA7\u94FE\u63A5\uFF0C\u7136\u540E\u7528\u516C\u4F17\u53F7\u7BA1\u7406\u5458\u5FAE\u4FE1\u626B\u7801\u540C\u610F\u7ED1\u5B9A</div></div><div class=\"row\"><div><span>4\u3001\u6CE8\u518C\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F\u5E76\u4E14\u8BA4\u8BC1\u3001\u5F00\u901A\u5FAE\u4FE1\u652F\u4ED8\u3002</span> <a href=\"https://mp.weixin.qq.com\" target=\"_blank\">\u524D\u5F80\u6CE8\u518C</a> <a href=\"/docs/ccc.html\" target=\"_blank\">\u64CD\u4F5C\u6307\u5357</a></div><div class=\"tip\">\u8BF7\u6309\u4EE5\u4E0A\u6307\u5357\u5B8C\u6210\u5C0F\u7A0B\u5E8F\u6CE8\u518C\u4EE5\u53CA\u8BA4\u8BC1\u3001\u5FAE\u4FE1\u652F\u4ED8\u7684\u5F00\u901A</div><div class=\"tip\">\u5DF2\u5B8C\u6210\u4EE5\u4E0A\u64CD\u4F5C\u7684\u7528\u6237\u53EF\u4EE5\u76F4\u63A5\u8DF3\u8FC7\u6B64\u6B65\u9AA4</div></div><div class=\"row\"><div><span>5\u3001\u7ED1\u5B9A\u5C0F\u7A0B\u5E8F\u3002<span style=\"color: red\">{{hasAuthTinyApp ? '\uFF08\u5F53\u524D\u8D26\u53F7\u5DF2\u7ED1\u5B9A\u5C0F\u7A0B\u5E8F\uFF09': '\uFF08\u5F53\u524D\u8D26\u53F7\u672A\u7ED1\u5B9A\u5C0F\u7A0B\u5E8F\uFF09'}}</span></span> <a (click)=\"bindTinyApp()\" *ngIf=\"!hasAuthTinyApp\" [ngStyle]=\"{'color':!hasAuthOffical ? '#c0c0c0' : '', 'cursor':!hasAuthOffical ? 'not-allowed' : ''}\">\u524D\u5F80\u7ED1\u5B9A</a></div><div class=\"tip\">\u70B9\u51FB\u53F3\u4FA7\u94FE\u63A5\uFF0C\u7136\u540E\u7528\u516C\u4F17\u53F7\u7BA1\u7406\u5458\u5FAE\u4FE1\u626B\u7801\u540C\u610F\u7ED1\u5B9A\uFF08\u9700\u5148\u7ED1\u5B9A\u516C\u4F17\u53F7\uFF09</div></div><div class=\"br\"></div><div><button nz-button class=\"login-form-button\" [nzType]=\"'primary'\" (click)=\"nextStep()\" [disabled]=\"isDisabled\">\u4E0B\u4E00\u6B65</button> <button nz-button class=\"login-form-button\" [nzType]=\"'default'\" (click)=\"back()\">\u8FD4 \u56DE</button></div></div>",
styles: [
"\n :host .br {\n height: 1px;\n width: 100%;\n margin: 30px 0;\n border-top: 1px dashed #ddd;\n }\n :host .title{\n font-size: 16px;\n font-weight: bold;\n margin-bottom: 12px;\n }\n :host .tip{\n color:#c0c0c0;\n padding-left: 21px;\n margin:4px 0 !important;\n }\n :host .row{\n margin:35px 0;\n }\n :host .row:nth-child(4) > div > span::before, :host .row:nth-child(6) > div > span::before{\n content:\"*\";\n color:red;\n margin-right:3px;\n }\n :host .box > .row:nth-child(2) {\n margin-top:25px;\n }\n :host .row > div {\n margin:10px 0;\n }\n :host .row > div > span:nth-child(1) {\n width: 297px;\n display: inline-block;\n }\n :host .row > div > a{\n margin-right:20px;\n }\n "
]
},] },
];
/** @nocollapse */
BindingComponent.ctorParameters = function () { return [
{ type: data_source_helper_1.DataSourceHelper, },
{ type: router_1.Router, },
]; };
BindingComponent.propDecorators = {
"next": [{ type: core_1.Output },],
"status": [{ type: core_1.Input },],
};
return BindingComponent;
}());
exports.BindingComponent = BindingComponent;
//# sourceMappingURL=binding.component.js.map