Skip to content

Commit

Permalink
feat(module:theme): add page loading styles (#207)
Browse files Browse the repository at this point in the history
  • Loading branch information
cipchk authored Oct 11, 2018
1 parent ec0b0df commit ad43622
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,17 @@ export class StartupService {
});
}

private viaMockI18n(resolve: any, reject: any) {
this.httpClient
.get(`assets/tmp/i18n/${this.i18n.defaultLang}.json`)
.subscribe(langData => {
this.translate.setTranslation(this.i18n.defaultLang, langData);
this.translate.setDefaultLang(this.i18n.defaultLang);

this.viaMock(resolve, reject);
});
}

private viaMock(resolve: any, reject: any) {
// const tokenData = this.tokenService.get();
// if (!tokenData.token) {
Expand Down Expand Up @@ -117,7 +128,8 @@ export class StartupService {
// http
// this.viaHttp(resolve, reject);
// mock:请勿在生产环境中这么使用,viaMock 单纯只是为了模拟一些数据使脚手架一开始能正常运行
this.viaMock(resolve, reject);
<% if (i18n) { %>this.viaMockI18n(resolve, reject);<% } else { %>this.viaMock(resolve, reject);<% } %>

});
}
}
12 changes: 12 additions & 0 deletions packages/theme/styles/app/utils/other.less
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,15 @@
background-position: center center;
background-size: cover;
}

.page-loading {
background: @background-color-base;
z-index: 10000;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
padding-top: 200px;
text-align: center;
}
4 changes: 2 additions & 2 deletions scripts/ci/build-schematics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,10 @@ if [[ ${BUILD} == true ]]; then

if [[ ${COPY} == true ]]; then
if [[ ${TRAVIS} == true ]]; then
echo "== copy ng-alain files via travis mode"
echo "== copy delon/ng-alain files via travis mode"
copyFiles 'ng-alain/' ${DIST}/
else
echo "== copy ng-alain files via dev mode"
echo "== copy work/ng-alain files via dev mode"
copyFiles '../ng-alain/' ${DIST}/
fi
else
Expand Down

0 comments on commit ad43622

Please sign in to comment.