Skip to content

Commit 2d7ec4d

Browse files
author
zhangzj4
committed
init
0 parents  commit 2d7ec4d

File tree

99 files changed

+8990
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+8990
-0
lines changed

.editorconfig

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# EditorConfig helps developers define and maintain consistent coding styles between different editors and IDEs
2+
# editorconfig.org
3+
4+
root = true
5+
6+
[*]
7+
indent_style = space
8+
indent_size = 2
9+
10+
# We recommend you to keep these unchanged
11+
end_of_line = lf
12+
charset = utf-8
13+
trim_trailing_whitespace = true
14+
insert_final_newline = true
15+
16+
[*.md]
17+
trim_trailing_whitespace = false

.gitignore

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Specifies intentionally untracked files to ignore when using Git
2+
# http://git-scm.com/docs/gitignore
3+
4+
*~
5+
*.sw[mnpcod]
6+
*.log
7+
*.tmp
8+
*.tmp.*
9+
log.txt
10+
*.sublime-project
11+
*.sublime-workspace
12+
.vscode/
13+
npm-debug.log*
14+
15+
.idea/
16+
.sass-cache/
17+
.tmp/
18+
.versions/
19+
coverage/
20+
dist/
21+
node_modules/
22+
tmp/
23+
temp/
24+
hooks/
25+
platforms/
26+
plugins/
27+
plugins/android.json
28+
plugins/ios.json
29+
www/
30+
$RECYCLE.BIN/
31+
32+
.DS_Store
33+
Thumbs.db
34+
UserInterfaceState.xcuserstate

config.xml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2+
<widget id="com.ionicframework.smarthome511542" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
3+
<name>smartHome</name>
4+
<description>An awesome Ionic/Cordova app.</description>
5+
<author email="hi@ionicframework" href="http://ionicframework.com/">Ionic Framework Team</author>
6+
<content src="index.html"/>
7+
<access origin="*"/>
8+
<allow-intent href="http://*/*"/>
9+
<allow-intent href="https://*/*"/>
10+
<allow-intent href="tel:*"/>
11+
<allow-intent href="sms:*"/>
12+
<allow-intent href="mailto:*"/>
13+
<allow-intent href="geo:*"/>
14+
<platform name="android">
15+
<allow-intent href="market:*"/>
16+
</platform>
17+
<platform name="ios">
18+
<allow-intent href="itms:*"/>
19+
<allow-intent href="itms-apps:*"/>
20+
</platform>
21+
<preference name="webviewbounce" value="false"/>
22+
<preference name="UIWebViewBounce" value="false"/>
23+
<preference name="DisallowOverscroll" value="true"/>
24+
<preference name="android-minSdkVersion" value="16"/>
25+
<preference name="BackupWebStorage" value="none"/>
26+
<preference name="SplashMaintainAspectRatio" value="true"/>
27+
<preference name="FadeSplashScreenDuration" value="300"/>
28+
<feature name="StatusBar">
29+
<param name="ios-package" onload="true" value="CDVStatusBar"/>
30+
</feature>
31+
<plugin name="ionic-plugin-keyboard" spec="~2.2.1"/>
32+
<plugin name="cordova-plugin-whitelist" spec="1.3.1"/>
33+
<plugin name="cordova-plugin-console" spec="1.0.5"/>
34+
<plugin name="cordova-plugin-statusbar" spec="2.2.1"/>
35+
<plugin name="cordova-plugin-device" spec="1.1.4"/>
36+
<plugin name="cordova-plugin-splashscreen" spec="~4.0.1"/>
37+
</widget>

ionic.config.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"name": "smartHome",
3+
"app_id": "",
4+
"v2": true,
5+
"typescript": true
6+
}

package.json

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"name": "smart-home",
3+
"author": "Freedom",
4+
"homepage": "",
5+
"private": true,
6+
"scripts": {
7+
"clean": "ionic-app-scripts clean",
8+
"build": "ionic-app-scripts build --prod",
9+
"ionic:build": "ionic-app-scripts build",
10+
"ionic:serve": "ionic-app-scripts serve"
11+
},
12+
"dependencies": {
13+
"@angular/common": "2.2.1",
14+
"@angular/compiler": "2.2.1",
15+
"@angular/compiler-cli": "2.2.1",
16+
"@angular/core": "2.2.1",
17+
"@angular/forms": "2.2.1",
18+
"@angular/http": "2.2.1",
19+
"@angular/platform-browser": "2.2.1",
20+
"@angular/platform-browser-dynamic": "2.2.1",
21+
"@angular/platform-server": "2.2.1",
22+
"@ionic/storage": "1.1.7",
23+
"ionic-angular": "2.0.0-rc.4",
24+
"ionic-native": "2.2.11",
25+
"ionicons": "3.0.0",
26+
"rxjs": "5.0.0-beta.12",
27+
"zone.js": "0.6.26"
28+
},
29+
"devDependencies": {
30+
"@ionic/app-scripts": "0.0.47",
31+
"typescript": "2.0.9"
32+
},
33+
"cordovaPlugins": [
34+
"cordova-plugin-device",
35+
"cordova-plugin-statusbar",
36+
"cordova-plugin-whitelist",
37+
"cordova-plugin-console",
38+
"cordova-plugin-splashscreen",
39+
"ionic-plugin-keyboard"
40+
],
41+
"cordovaPlatforms": [],
42+
"description": "smartHome: An Ionic project"
43+
}
2.81 KB
1.13 KB
1.76 KB
4.22 KB
7.61 KB
11.5 KB

resources/icon.png

59.4 KB

resources/ios/icon/icon-40.png

1.22 KB

resources/ios/icon/[email protected]

3.48 KB

resources/ios/icon/[email protected]

5.87 KB

resources/ios/icon/icon-50.png

1.86 KB

resources/ios/icon/[email protected]

4.58 KB

resources/ios/icon/icon-60.png

2.39 KB

resources/ios/icon/[email protected]

5.9 KB

resources/ios/icon/[email protected]

10.6 KB

resources/ios/icon/icon-72.png

2.8 KB

resources/ios/icon/[email protected]

7.61 KB

resources/ios/icon/icon-76.png

3.24 KB

resources/ios/icon/[email protected]

8.11 KB

resources/ios/icon/[email protected]

9.34 KB

resources/ios/icon/icon-small.png

818 Bytes

resources/ios/icon/[email protected]

2.23 KB

resources/ios/icon/[email protected]

3.77 KB

resources/ios/icon/icon.png

2.06 KB

resources/ios/icon/[email protected]

5.58 KB
31.2 KB

resources/ios/splash/Default-667h.png

39.5 KB

resources/ios/splash/Default-736h.png

44 KB
43.9 KB
22.1 KB
22.2 KB
18.4 KB
7.04 KB

resources/splash.png

60.8 KB

src/app/app.component.ts

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
import { Component, ViewChild } from '@angular/core';
2+
import { Platform, Nav } from 'ionic-angular';
3+
import { StatusBar, Splashscreen } from 'ionic-native';
4+
5+
import { SocketService } from '../service/socket.service';
6+
import { HttpService } from '../service/http.service';
7+
import { DataService } from '../service/data.service';
8+
9+
import { IndexPage } from '../pages/index/index';
10+
11+
12+
@Component({
13+
templateUrl: 'app.html'
14+
})
15+
export class MyApp {
16+
@ViewChild(Nav) nav: Nav;
17+
rootPage = IndexPage;
18+
19+
constructor(private socketService: SocketService, private httpService: HttpService, private dataService: DataService, platform: Platform) {
20+
platform.ready().then(() => {
21+
// Okay, so the platform is ready and our plugins are available.
22+
// Here you can do any higher level native things you might need.
23+
StatusBar.styleDefault();
24+
Splashscreen.hide();
25+
26+
// Registration of push in Android and Windows Phone
27+
window.addEventListener('popstate', () => {
28+
if(dataService.runTimeCache.openedModal){
29+
dataService.runTimeCache.openedModal.dismiss();
30+
delete dataService.runTimeCache.openedModal;
31+
history.pushState(null, null, document.URL);
32+
return;
33+
}
34+
if (this.nav.canGoBack()) { //Can we go back?
35+
if(this.nav.length()>2){history.pushState(null, null, document.URL);}
36+
this.nav.pop();
37+
}
38+
});
39+
40+
41+
});
42+
43+
44+
45+
//get weather data
46+
httpService.getWeather().then(weather => {
47+
if (weather.status != 'ok') {
48+
alert('failed to get weather info');
49+
return;
50+
}
51+
console.log(weather);
52+
dataService.weather = weather;
53+
54+
console.log(dataService.weather)
55+
});
56+
57+
}
58+
59+
60+
61+
62+
}

src/app/app.html

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<ion-nav [root]="rootPage"></ion-nav>

src/app/app.module.ts

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import { NgModule, ErrorHandler } from '@angular/core';
2+
import { HttpModule } from '@angular/http';
3+
import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular';
4+
import { MyApp } from './app.component';
5+
import { AirPage } from '../pages/air/air';
6+
import { AirConditionRemoteCtrlPage } from '../pages/airConditionRemoteCtrl/airConditionRemoteCtrl';
7+
import { MusicPage } from '../pages/music/music';
8+
import { MusicMenusModalsPage } from '../pages/music/musicMenusModals';
9+
import { LightPage } from '../pages/light/light';
10+
11+
import { IndexPage } from '../pages/index/index';
12+
import { SocketService } from '../service/socket.service';
13+
import { HttpService } from '../service/http.service';
14+
import { DataService } from '../service/data.service';
15+
16+
import { SplitMusicNamePipe } from '../pipe/split-music-name.pip';
17+
import { FilterPipe } from '../pipe/filter.pip';
18+
19+
@NgModule({
20+
declarations: [
21+
MyApp,
22+
AirPage,
23+
AirConditionRemoteCtrlPage,
24+
MusicPage,
25+
MusicMenusModalsPage,
26+
IndexPage,
27+
LightPage,
28+
SplitMusicNamePipe,
29+
FilterPipe
30+
],
31+
imports: [
32+
HttpModule,
33+
IonicModule.forRoot(MyApp)
34+
],
35+
bootstrap: [IonicApp],
36+
entryComponents: [
37+
MyApp,
38+
AirPage,
39+
AirConditionRemoteCtrlPage,
40+
MusicPage,
41+
MusicMenusModalsPage,
42+
IndexPage,
43+
LightPage
44+
],
45+
providers: [DataService,SocketService,HttpService,{provide: ErrorHandler, useClass: IonicErrorHandler}]
46+
})
47+
export class AppModule {}

src/app/app.scss

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// http://ionicframework.com/docs/v2/theming/
2+
3+
4+
// App Global Sass
5+
// --------------------------------------------------
6+
// Put style rules here that you want to apply globally. These
7+
// styles are for the entire app and not just one component.
8+
// Additionally, this file can be also used as an entry point
9+
// to import other Sass files to be included in the output CSS.
10+
//
11+
// Shared Sass variables, which can be used to adjust Ionic's
12+
// default Sass variables, belong in "theme/variables.scss".
13+
//
14+
// To declare rules for a specific mode, create a child rule
15+
// for the .md, .ios, or .wp mode classes. The mode class is
16+
// automatically applied to the <body> element in the app.
17+
18+
p {
19+
margin: 0
20+
}

src/app/main.ts

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
2+
3+
import { AppModule } from './app.module';
4+
5+
platformBrowserDynamic().bootstrapModule(AppModule);

src/assets/icon/favicon.ico

1.93 KB
Binary file not shown.

src/assets/images/air.jpg

30.9 KB

src/assets/images/airControllerBg.jpg

24.9 KB

src/assets/images/indexBg.jpg

85.1 KB

src/assets/images/light.jpg

49.6 KB

src/assets/images/lightBackground.jpg

10.9 KB

src/assets/images/music.jpg

39.2 KB

src/assets/images/off.jpg

13.3 KB

src/assets/images/on.jpg

20.4 KB

0 commit comments

Comments
 (0)