40 |
地址: 安阳市滑县万古镇棘马林村
41 |
电话:
42 | 13140415408
43 |
44 |
时间:农历22,阳历2月7号!
45 |
--------------------------------------------------------------------------------
/src/app/lazyload-background/lazyload-background.ts:
--------------------------------------------------------------------------------
1 | import {
2 | Directive, Input, AfterViewInit,
3 | ElementRef, Renderer2, OnInit,
4 | InjectionToken, Injector, OnDestroy
5 | } from '@angular/core';
6 | export const BASE_SRC = new InjectionToken('BASE_SRC');
7 | @Directive({ selector: '[lazyBackground]' })
8 | export class LazyBackgroundDirective implements OnInit, OnDestroy {
9 | private _imageSrc: string;
10 | private _imageLazySrc: string;
11 | private _imageIndex: number;
12 | private _isLoaded: boolean = false;
13 | private _subser: any;
14 | @Input()
15 | set lazyBackground(index: number) {
16 | this._imageIndex = index;
17 | this._imageSrc = `${this.src}assets/images/${index}.png`;
18 | this._imageLazySrc = `${this.src}assets/images/${index}.lazy.png`;
19 | }
20 | @Input()
21 | set nowIndex(index: any) {
22 | if (index) {
23 | this._subser = index.subscribe(res => {
24 | if (res === this._imageIndex) {
25 | !this._isLoaded && this.createLazy(this._imageSrc);
26 | }
27 | });
28 | }
29 | }
30 | defaultImage: any;
31 | src: string;
32 | constructor(
33 | private render: Renderer2,
34 | private ele: ElementRef,
35 | private injector: Injector
36 | ) {
37 | this.src = this.injector.get(BASE_SRC, './') as string;
38 | }
39 |
40 | ngOnDestroy() {
41 | this._subser && this._subser.unsubscribe();
42 | }
43 |
44 | ngOnInit() {
45 | this.render.setStyle(this.ele.nativeElement, 'background-image', `url(${this._imageLazySrc})`);
46 | }
47 |
48 | createLazy(image: string) {
49 | setTimeout(() => {
50 | const img = new Image();
51 | img.src = image;
52 | img.onload = () => {
53 | this.render.setStyle(this.ele.nativeElement, 'background-image', `url(${image})`);
54 | this._isLoaded = true;
55 | };
56 | }, 1000);
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "meepo-hunli-worker",
3 | "version": "0.0.0",
4 | "license": "MIT",
5 | "scripts": {
6 | "ng": "ng",
7 | "start": "ng serve --open",
8 | "build": "ng build --prod --deploy-url ../addons/meepo_hunli/template/mobile/",
9 | "test": "ng test",
10 | "lint": "ng lint",
11 | "e2e": "ng e2e",
12 | "git": "git add . && git commit -m 'update to save' && git push origin master"
13 | },
14 | "private": true,
15 | "dependencies": {
16 | "@angular-devkit/core": "^0.0.28",
17 | "@angular/animations": "^5.0.0",
18 | "@angular/cdk": "^5.1.0",
19 | "@angular/common": "^5.0.0",
20 | "@angular/compiler": "^5.0.0",
21 | "@angular/core": "^5.0.0",
22 | "@angular/forms": "^5.0.0",
23 | "@angular/http": "^5.0.0",
24 | "@angular/platform-browser": "^5.0.0",
25 | "@angular/platform-browser-dynamic": "^5.0.0",
26 | "@angular/router": "^5.0.0",
27 | "@angular/service-worker": "^5.0.0",
28 | "@types/socket.io-client": "^1.4.32",
29 | "classlist.js": "^1.1.20150312",
30 | "classnames": "^2.2.5",
31 | "core-js": "^2.4.1",
32 | "fullpage.js": "^2.9.5",
33 | "jquery": "^3.3.1",
34 | "meepo-axios": "^1.3.8",
35 | "meepo-common": "^1.1.5",
36 | "meepo-debuger": "^1.1.6",
37 | "meepo-utils": "^1.0.0-alpha.0",
38 | "meepo-we7-router": "^1.3.0",
39 | "ng-antd-mobile": "^1.0.5",
40 | "ng-antd-mobile-notice-bar": "^1.0.0-alpha.0",
41 | "normalize.css": "^7.0.0",
42 | "rxjs": "^5.5.2",
43 | "socket.io": "^2.0.4",
44 | "weui": "^1.1.2",
45 | "zone.js": "^0.8.14"
46 | },
47 | "devDependencies": {
48 | "@angular/cli": "1.6.3",
49 | "@angular/compiler-cli": "^5.0.0",
50 | "@angular/language-service": "^5.0.0",
51 | "@types/jasmine": "~2.5.53",
52 | "@types/jasminewd2": "~2.0.2",
53 | "@types/node": "~6.0.60",
54 | "codelyzer": "^4.0.1",
55 | "jasmine-core": "~2.6.2",
56 | "jasmine-spec-reporter": "~4.1.0",
57 | "karma": "~1.7.0",
58 | "karma-chrome-launcher": "~2.1.1",
59 | "karma-cli": "~1.0.1",
60 | "karma-coverage-istanbul-reporter": "^1.2.1",
61 | "karma-jasmine": "~1.1.0",
62 | "karma-jasmine-html-reporter": "^0.2.2",
63 | "protractor": "~5.1.2",
64 | "ts-node": "~3.2.0",
65 | "tslint": "~5.7.0",
66 | "typescript": "~2.4.2"
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/src/polyfills.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * This file includes polyfills needed by Angular and is loaded before the app.
3 | * You can add your own extra polyfills to this file.
4 | *
5 | * This file is divided into 2 sections:
6 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
7 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main
8 | * file.
9 | *
10 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that
11 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
12 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
13 | *
14 | * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html
15 | */
16 |
17 | /***************************************************************************************************
18 | * BROWSER POLYFILLS
19 | */
20 |
21 | /** IE9, IE10 and IE11 requires all of the following polyfills. **/
22 | import 'core-js/es6/symbol';
23 | import 'core-js/es6/object';
24 | import 'core-js/es6/function';
25 | import 'core-js/es6/parse-int';
26 | import 'core-js/es6/parse-float';
27 | import 'core-js/es6/number';
28 | import 'core-js/es6/math';
29 | import 'core-js/es6/string';
30 | import 'core-js/es6/date';
31 | import 'core-js/es6/array';
32 | import 'core-js/es6/regexp';
33 | import 'core-js/es6/map';
34 | import 'core-js/es6/weak-map';
35 | import 'core-js/es6/set';
36 |
37 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */
38 | import 'classlist.js'; // Run `npm install --save classlist.js`.
39 |
40 | /** IE10 and IE11 requires the following for the Reflect API. */
41 | import 'core-js/es6/reflect';
42 |
43 |
44 | /** Evergreen browsers require these. **/
45 | // Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove.
46 | import 'core-js/es7/reflect';
47 |
48 |
49 | /**
50 | * Required to support Web Animations `@angular/platform-browser/animations`.
51 | * Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation
52 | **/
53 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`.
54 |
55 |
56 |
57 | /***************************************************************************************************
58 | * Zone JS is required by default for Angular itself.
59 | */
60 | import 'zone.js/dist/zone'; // Included with Angular CLI.
61 |
62 |
63 |
64 | /***************************************************************************************************
65 | * APPLICATION IMPORTS
66 | */
67 |
--------------------------------------------------------------------------------
/src/app/danmus/danmu-item.ts:
--------------------------------------------------------------------------------
1 | import {
2 | Component, OnInit, ElementRef,
3 | Renderer2, AfterViewInit, OnDestroy, Input
4 | } from '@angular/core';
5 | import { HostBinding } from '@angular/core';
6 | import { ViewEncapsulation } from '@angular/core';
7 | import { EventEmitter, Output } from '@angular/core';
8 |
9 | @Component({
10 | selector: 'danmu-item',
11 | templateUrl: './danmu-item.html',
12 | styleUrls: ['./danmu-item.scss'],
13 | encapsulation: ViewEncapsulation.None
14 | })
15 | export class DanmuItemComponent implements OnInit, AfterViewInit, OnDestroy {
16 | @HostBinding('class.danmu-item') _item: boolean = true;
17 | @HostBinding('style.top.px') _top: number = 0;
18 | // @HostBinding('style.left.px') _left: number = 0;
19 | @HostBinding('style.right.px') _right: number = 0;
20 |
21 | @HostBinding('style.min-width.em') _minWidth: number = 0;
22 | @HostBinding('style.max-width.em') _maxWidth: number = 0;
23 |
24 | @Input() avatar: string;
25 | @Input() item: any;
26 |
27 | @Output() onNext: EventEmitter