├── .editorconfig ├── .gitignore ├── README.md ├── config.xml ├── ionic.config.json ├── package.json ├── resources ├── android │ ├── icon │ │ ├── drawable-hdpi-icon.png │ │ ├── drawable-ldpi-icon.png │ │ ├── drawable-mdpi-icon.png │ │ ├── drawable-xhdpi-icon.png │ │ ├── drawable-xxhdpi-icon.png │ │ └── drawable-xxxhdpi-icon.png │ └── splash │ │ ├── drawable-land-hdpi-screen.png │ │ ├── drawable-land-ldpi-screen.png │ │ ├── drawable-land-mdpi-screen.png │ │ ├── drawable-land-xhdpi-screen.png │ │ ├── drawable-land-xxhdpi-screen.png │ │ ├── drawable-land-xxxhdpi-screen.png │ │ ├── drawable-port-hdpi-screen.png │ │ ├── drawable-port-ldpi-screen.png │ │ ├── drawable-port-mdpi-screen.png │ │ ├── drawable-port-xhdpi-screen.png │ │ ├── drawable-port-xxhdpi-screen.png │ │ └── drawable-port-xxxhdpi-screen.png ├── icon.png ├── ios │ ├── icon │ │ ├── icon-40.png │ │ ├── icon-40@2x.png │ │ ├── icon-40@3x.png │ │ ├── icon-50.png │ │ ├── icon-50@2x.png │ │ ├── icon-60.png │ │ ├── icon-60@2x.png │ │ ├── icon-60@3x.png │ │ ├── icon-72.png │ │ ├── icon-72@2x.png │ │ ├── icon-76.png │ │ ├── icon-76@2x.png │ │ ├── icon-83.5@2x.png │ │ ├── icon-small.png │ │ ├── icon-small@2x.png │ │ ├── icon-small@3x.png │ │ ├── icon.png │ │ └── icon@2x.png │ └── splash │ │ ├── Default-568h@2x~iphone.png │ │ ├── Default-667h.png │ │ ├── Default-736h.png │ │ ├── Default-Landscape-736h.png │ │ ├── Default-Landscape@2x~ipad.png │ │ ├── Default-Landscape@~ipadpro.png │ │ ├── Default-Landscape~ipad.png │ │ ├── Default-Portrait@2x~ipad.png │ │ ├── Default-Portrait@~ipadpro.png │ │ ├── Default-Portrait~ipad.png │ │ ├── Default@2x~iphone.png │ │ └── Default~iphone.png └── splash.png ├── src ├── app │ ├── app.component.ts │ ├── app.html │ ├── app.module.ts │ ├── app.scss │ └── main.ts ├── assets │ └── icon │ │ ├── favicon.ico │ │ └── user.jpg ├── declarations.d.ts ├── index.html ├── manifest.json ├── pages │ ├── home │ │ ├── home.html │ │ ├── home.scss │ │ └── home.ts │ ├── login │ │ ├── login.html │ │ ├── login.module.ts │ │ ├── login.scss │ │ └── login.ts │ ├── setting │ │ ├── setting.html │ │ ├── setting.module.ts │ │ ├── setting.scss │ │ └── setting.ts │ └── tabs │ │ ├── tabs.html │ │ └── tabs.ts ├── service-worker.js ├── services │ └── backButton.service.ts └── theme │ └── variables.scss ├── tsconfig.json └── tslint.json /.editorconfig: -------------------------------------------------------------------------------- 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: -------------------------------------------------------------------------------- 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 35 | 36 | package-lock\.json 37 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ionic DEMO 2 | --- 3 | 4 | ![Ionic v3.9.2](https://img.shields.io/badge/Ionic-v3.9.2-green.svg) 5 | ![Angular v5.2.9](https://img.shields.io/badge/Angular-v5.2.9-green.svg) 6 | ![License MIT](https://img.shields.io/badge/license-MIT-blue.svg) 7 | ![Author Lym](https://img.shields.io/badge/author-Lym-blue.svg) 8 | 9 | 从安装搭建环境,到页面制作再到网络请求,让你顺利入门。 10 | 如果对你有帮助,可以点个 Star 11 | 12 | >为了防止多余代码的干扰,我把每次更新的模块分在的不同的分支,下载Demo的朋友,请从下面的关联博客地址,选择对应的分支。 13 | 14 | 项目运行方式: 15 | --- 16 | 17 | $ npm install 18 | $ ionic serve 19 | 20 | 关联博客地址: 21 | --- 22 | 23 | 项目最新代码 24 | 对应分支:[demo1](https://github.com/2015lym/ionicDemo/tree/demo1) 25 | 26 | [Angular 4.0 架构详解](http://www.jianshu.com/p/3c06260e6015) 27 | 对应分支:无,理论教学 28 | 29 | [Angular 4.0 内置指令全攻略](http://www.jianshu.com/p/4cc3a04ca83a) 30 | 对应分支:无,理论教学 31 | 32 | --- 33 | 34 | [ionic3 教程(一)安装和配置](http://www.jianshu.com/p/1baf40713c1c) 35 | 对应分支:无,理论教学 36 | 37 | [ionic3 教程(二)登录页制作](http://www.jianshu.com/p/0f024a62ba14) 38 | 对应分支:[demo2](https://github.com/2015lym/ionic3Demo/tree/demo2) 39 | 40 | [ionic3 教程(三)设置页制作](http://www.jianshu.com/p/7ea502ef2e49) 41 | 对应分支:[demo3](https://github.com/2015lym/ionic3Demo/tree/demo3) 42 | 43 | [ionic3 教程(四)安卓硬件返回键处理](http://www.jianshu.com/p/02f190059aaa) 44 | 对应分支:[demo4](https://github.com/2015lym/ionic3Demo/tree/demo4) 45 | 46 | [ionic3 教程(五)基本的网络请求](http://www.jianshu.com/p/3ad54d7d1077) 47 | 对应分支:[demo5](https://github.com/2015lym/ionic3Demo/tree/demo5) 48 | 49 | 50 | -------------------------------------------------------------------------------- /config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | ionic3Demo 4 | An awesome Ionic/Cordova app. 5 | Ionic Framework Team 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /ionic.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ionic3Demo", 3 | "app_id": "", 4 | "type": "ionic-angular" 5 | } 6 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ionic3Demo", 3 | "version": "0.0.1", 4 | "author": "Ionic Framework", 5 | "homepage": "http://ionicframework.com/", 6 | "private": true, 7 | "scripts": { 8 | "clean": "ionic-app-scripts clean", 9 | "build": "ionic-app-scripts build", 10 | "lint": "ionic-app-scripts lint", 11 | "ionic:build": "ionic-app-scripts build", 12 | "ionic:serve": "ionic-app-scripts serve" 13 | }, 14 | "dependencies": { 15 | "@angular/common": "5.2.9", 16 | "@angular/compiler": "5.2.9", 17 | "@angular/compiler-cli": "5.2.9", 18 | "@angular/core": "5.2.9", 19 | "@angular/forms": "5.2.9", 20 | "@angular/http": "5.2.9", 21 | "@angular/platform-browser": "5.2.9", 22 | "@angular/platform-browser-dynamic": "5.2.9", 23 | "@ionic-native/core": "4.6.0", 24 | "@ionic-native/splash-screen": "4.6.0", 25 | "@ionic-native/status-bar": "4.6.0", 26 | "@ionic/storage": "2.1.3", 27 | "ionic-angular": "3.9.2", 28 | "ionicons": "3.0.0", 29 | "rxjs": "5.5.8", 30 | "sw-toolbox": "3.6.0", 31 | "zone.js": "0.8.18" 32 | }, 33 | "devDependencies": { 34 | "@ionic/app-scripts": "3.1.8", 35 | "typescript": "2.8.1" 36 | }, 37 | "description": "An Ionic project" 38 | } 39 | -------------------------------------------------------------------------------- /resources/android/icon/drawable-hdpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2015lym/ionic3Demo/68eb7acaeb588c13ef8e9ef4cf47514afdc9f54a/resources/android/icon/drawable-hdpi-icon.png -------------------------------------------------------------------------------- /resources/android/icon/drawable-ldpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2015lym/ionic3Demo/68eb7acaeb588c13ef8e9ef4cf47514afdc9f54a/resources/android/icon/drawable-ldpi-icon.png -------------------------------------------------------------------------------- /resources/android/icon/drawable-mdpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2015lym/ionic3Demo/68eb7acaeb588c13ef8e9ef4cf47514afdc9f54a/resources/android/icon/drawable-mdpi-icon.png -------------------------------------------------------------------------------- /resources/android/icon/drawable-xhdpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2015lym/ionic3Demo/68eb7acaeb588c13ef8e9ef4cf47514afdc9f54a/resources/android/icon/drawable-xhdpi-icon.png -------------------------------------------------------------------------------- /resources/android/icon/drawable-xxhdpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2015lym/ionic3Demo/68eb7acaeb588c13ef8e9ef4cf47514afdc9f54a/resources/android/icon/drawable-xxhdpi-icon.png -------------------------------------------------------------------------------- /resources/android/icon/drawable-xxxhdpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2015lym/ionic3Demo/68eb7acaeb588c13ef8e9ef4cf47514afdc9f54a/resources/android/icon/drawable-xxxhdpi-icon.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-land-hdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2015lym/ionic3Demo/68eb7acaeb588c13ef8e9ef4cf47514afdc9f54a/resources/android/splash/drawable-land-hdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-land-ldpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2015lym/ionic3Demo/68eb7acaeb588c13ef8e9ef4cf47514afdc9f54a/resources/android/splash/drawable-land-ldpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-land-mdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2015lym/ionic3Demo/68eb7acaeb588c13ef8e9ef4cf47514afdc9f54a/resources/android/splash/drawable-land-mdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-land-xhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2015lym/ionic3Demo/68eb7acaeb588c13ef8e9ef4cf47514afdc9f54a/resources/android/splash/drawable-land-xhdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-land-xxhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2015lym/ionic3Demo/68eb7acaeb588c13ef8e9ef4cf47514afdc9f54a/resources/android/splash/drawable-land-xxhdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-land-xxxhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2015lym/ionic3Demo/68eb7acaeb588c13ef8e9ef4cf47514afdc9f54a/resources/android/splash/drawable-land-xxxhdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-port-hdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2015lym/ionic3Demo/68eb7acaeb588c13ef8e9ef4cf47514afdc9f54a/resources/android/splash/drawable-port-hdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-port-ldpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2015lym/ionic3Demo/68eb7acaeb588c13ef8e9ef4cf47514afdc9f54a/resources/android/splash/drawable-port-ldpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-port-mdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2015lym/ionic3Demo/68eb7acaeb588c13ef8e9ef4cf47514afdc9f54a/resources/android/splash/drawable-port-mdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-port-xhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2015lym/ionic3Demo/68eb7acaeb588c13ef8e9ef4cf47514afdc9f54a/resources/android/splash/drawable-port-xhdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-port-xxhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2015lym/ionic3Demo/68eb7acaeb588c13ef8e9ef4cf47514afdc9f54a/resources/android/splash/drawable-port-xxhdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-port-xxxhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2015lym/ionic3Demo/68eb7acaeb588c13ef8e9ef4cf47514afdc9f54a/resources/android/splash/drawable-port-xxxhdpi-screen.png -------------------------------------------------------------------------------- /resources/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2015lym/ionic3Demo/68eb7acaeb588c13ef8e9ef4cf47514afdc9f54a/resources/icon.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2015lym/ionic3Demo/68eb7acaeb588c13ef8e9ef4cf47514afdc9f54a/resources/ios/icon/icon-40.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2015lym/ionic3Demo/68eb7acaeb588c13ef8e9ef4cf47514afdc9f54a/resources/ios/icon/icon-40@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2015lym/ionic3Demo/68eb7acaeb588c13ef8e9ef4cf47514afdc9f54a/resources/ios/icon/icon-40@3x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2015lym/ionic3Demo/68eb7acaeb588c13ef8e9ef4cf47514afdc9f54a/resources/ios/icon/icon-50.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-50@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2015lym/ionic3Demo/68eb7acaeb588c13ef8e9ef4cf47514afdc9f54a/resources/ios/icon/icon-50@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2015lym/ionic3Demo/68eb7acaeb588c13ef8e9ef4cf47514afdc9f54a/resources/ios/icon/icon-60.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2015lym/ionic3Demo/68eb7acaeb588c13ef8e9ef4cf47514afdc9f54a/resources/ios/icon/icon-60@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2015lym/ionic3Demo/68eb7acaeb588c13ef8e9ef4cf47514afdc9f54a/resources/ios/icon/icon-60@3x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2015lym/ionic3Demo/68eb7acaeb588c13ef8e9ef4cf47514afdc9f54a/resources/ios/icon/icon-72.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-72@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2015lym/ionic3Demo/68eb7acaeb588c13ef8e9ef4cf47514afdc9f54a/resources/ios/icon/icon-72@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2015lym/ionic3Demo/68eb7acaeb588c13ef8e9ef4cf47514afdc9f54a/resources/ios/icon/icon-76.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2015lym/ionic3Demo/68eb7acaeb588c13ef8e9ef4cf47514afdc9f54a/resources/ios/icon/icon-76@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2015lym/ionic3Demo/68eb7acaeb588c13ef8e9ef4cf47514afdc9f54a/resources/ios/icon/icon-83.5@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2015lym/ionic3Demo/68eb7acaeb588c13ef8e9ef4cf47514afdc9f54a/resources/ios/icon/icon-small.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-small@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2015lym/ionic3Demo/68eb7acaeb588c13ef8e9ef4cf47514afdc9f54a/resources/ios/icon/icon-small@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-small@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2015lym/ionic3Demo/68eb7acaeb588c13ef8e9ef4cf47514afdc9f54a/resources/ios/icon/icon-small@3x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2015lym/ionic3Demo/68eb7acaeb588c13ef8e9ef4cf47514afdc9f54a/resources/ios/icon/icon.png -------------------------------------------------------------------------------- /resources/ios/icon/icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2015lym/ionic3Demo/68eb7acaeb588c13ef8e9ef4cf47514afdc9f54a/resources/ios/icon/icon@2x.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-568h@2x~iphone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2015lym/ionic3Demo/68eb7acaeb588c13ef8e9ef4cf47514afdc9f54a/resources/ios/splash/Default-568h@2x~iphone.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-667h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2015lym/ionic3Demo/68eb7acaeb588c13ef8e9ef4cf47514afdc9f54a/resources/ios/splash/Default-667h.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-736h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2015lym/ionic3Demo/68eb7acaeb588c13ef8e9ef4cf47514afdc9f54a/resources/ios/splash/Default-736h.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-Landscape-736h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2015lym/ionic3Demo/68eb7acaeb588c13ef8e9ef4cf47514afdc9f54a/resources/ios/splash/Default-Landscape-736h.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-Landscape@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2015lym/ionic3Demo/68eb7acaeb588c13ef8e9ef4cf47514afdc9f54a/resources/ios/splash/Default-Landscape@2x~ipad.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-Landscape@~ipadpro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2015lym/ionic3Demo/68eb7acaeb588c13ef8e9ef4cf47514afdc9f54a/resources/ios/splash/Default-Landscape@~ipadpro.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-Landscape~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2015lym/ionic3Demo/68eb7acaeb588c13ef8e9ef4cf47514afdc9f54a/resources/ios/splash/Default-Landscape~ipad.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-Portrait@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2015lym/ionic3Demo/68eb7acaeb588c13ef8e9ef4cf47514afdc9f54a/resources/ios/splash/Default-Portrait@2x~ipad.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-Portrait@~ipadpro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2015lym/ionic3Demo/68eb7acaeb588c13ef8e9ef4cf47514afdc9f54a/resources/ios/splash/Default-Portrait@~ipadpro.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-Portrait~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2015lym/ionic3Demo/68eb7acaeb588c13ef8e9ef4cf47514afdc9f54a/resources/ios/splash/Default-Portrait~ipad.png -------------------------------------------------------------------------------- /resources/ios/splash/Default@2x~iphone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2015lym/ionic3Demo/68eb7acaeb588c13ef8e9ef4cf47514afdc9f54a/resources/ios/splash/Default@2x~iphone.png -------------------------------------------------------------------------------- /resources/ios/splash/Default~iphone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2015lym/ionic3Demo/68eb7acaeb588c13ef8e9ef4cf47514afdc9f54a/resources/ios/splash/Default~iphone.png -------------------------------------------------------------------------------- /resources/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2015lym/ionic3Demo/68eb7acaeb588c13ef8e9ef4cf47514afdc9f54a/resources/splash.png -------------------------------------------------------------------------------- /src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { Platform } from 'ionic-angular'; 3 | import { StatusBar } from '@ionic-native/status-bar'; 4 | import { SplashScreen } from '@ionic-native/splash-screen'; 5 | 6 | import { LoginPage } from '../pages/login/login'; 7 | 8 | @Component({ 9 | templateUrl: 'app.html' 10 | }) 11 | export class MyApp { 12 | rootPage:any = LoginPage; 13 | 14 | constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen) { 15 | platform.ready().then(() => { 16 | // Okay, so the platform is ready and our plugins are available. 17 | // Here you can do any higher level native things you might need. 18 | statusBar.styleDefault(); 19 | splashScreen.hide(); 20 | }); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/app/app.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule, ErrorHandler } from '@angular/core'; 2 | import { BrowserModule } from '@angular/platform-browser'; 3 | import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular'; 4 | import { HttpModule } from '@angular/http'; 5 | import { MyApp } from './app.component'; 6 | 7 | import { HomePage } from '../pages/home/home'; 8 | import { TabsPage } from '../pages/tabs/tabs'; 9 | import { LoginPage } from '../pages/login/login'; 10 | 11 | import { StatusBar } from '@ionic-native/status-bar'; 12 | import { SplashScreen } from '@ionic-native/splash-screen'; 13 | import { SettingPage } from "../pages/setting/setting"; 14 | import { BackButtonService } from "../services/backButton.service"; 15 | 16 | @NgModule({ 17 | declarations: [ 18 | MyApp, 19 | HomePage, 20 | TabsPage, 21 | LoginPage, 22 | SettingPage 23 | ], 24 | imports: [ 25 | BrowserModule, 26 | HttpModule, 27 | IonicModule.forRoot(MyApp) 28 | ], 29 | bootstrap: [IonicApp], 30 | entryComponents: [ 31 | MyApp, 32 | HomePage, 33 | TabsPage, 34 | LoginPage, 35 | SettingPage 36 | ], 37 | providers: [ 38 | StatusBar, 39 | SplashScreen, 40 | {provide: ErrorHandler, useClass: IonicErrorHandler}, 41 | BackButtonService 42 | ] 43 | }) 44 | export class AppModule {} 45 | -------------------------------------------------------------------------------- /src/app/app.scss: -------------------------------------------------------------------------------- 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 element in the app. 17 | -------------------------------------------------------------------------------- /src/app/main.ts: -------------------------------------------------------------------------------- 1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 2 | 3 | import { AppModule } from './app.module'; 4 | 5 | platformBrowserDynamic().bootstrapModule(AppModule); 6 | -------------------------------------------------------------------------------- /src/assets/icon/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2015lym/ionic3Demo/68eb7acaeb588c13ef8e9ef4cf47514afdc9f54a/src/assets/icon/favicon.ico -------------------------------------------------------------------------------- /src/assets/icon/user.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2015lym/ionic3Demo/68eb7acaeb588c13ef8e9ef4cf47514afdc9f54a/src/assets/icon/user.jpg -------------------------------------------------------------------------------- /src/declarations.d.ts: -------------------------------------------------------------------------------- 1 | /* 2 | Declaration files are how the Typescript compiler knows about the type information(or shape) of an object. 3 | They're what make intellisense work and make Typescript know all about your code. 4 | 5 | A wildcard module is declared below to allow third party libraries to be used in an app even if they don't 6 | provide their own type declarations. 7 | 8 | To learn more about using third party libraries in an Ionic app, check out the docs here: 9 | http://ionicframework.com/docs/v2/resources/third-party-libs/ 10 | 11 | For more info on type definition files, check out the Typescript docs here: 12 | https://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html 13 | */ 14 | declare module '*'; -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | mobileOA 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /src/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Ionic", 3 | "short_name": "Ionic", 4 | "start_url": "index.html", 5 | "display": "standalone", 6 | "icons": [{ 7 | "src": "assets/imgs/logo.png", 8 | "sizes": "512x512", 9 | "type": "image/png" 10 | }], 11 | "background_color": "#4e8ef7", 12 | "theme_color": "#4e8ef7" 13 | } -------------------------------------------------------------------------------- /src/pages/home/home.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 首页 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | {{item?.title}} 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/pages/home/home.scss: -------------------------------------------------------------------------------- 1 | page-home { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /src/pages/home/home.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { NavController } from 'ionic-angular'; 3 | import { Http, Response } from '@angular/http'; 4 | // import 'rxjs/add/operator/toPromise'; 5 | 6 | @Component({ 7 | selector: 'page-home', 8 | templateUrl: 'home.html' 9 | }) 10 | export class HomePage { 11 | // 接收数据用 12 | listData: Object; 13 | // 依赖注入 14 | constructor(public navCtrl: NavController, private http: Http) { 15 | 16 | } 17 | 18 | ionViewDidLoad() { 19 | // 网络请求 20 | this.http.request('http://jsonplaceholder.typicode.com/photos') 21 | .subscribe((res: Response) => { 22 | this.listData = res.json(); 23 | }); 24 | 25 | // this.http.request('http://jsonplaceholder.typicode.com/photos') 26 | // .toPromise() 27 | // .then(res => { this.listData = res.json(); }) 28 | // .catch(err => { console.error(err) }); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/pages/login/login.html: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 登录 10 | 11 | 12 | 13 | 14 | 15 | 账号 16 | 17 | 18 | 19 | 密码 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 31 |
32 |
33 | -------------------------------------------------------------------------------- /src/pages/login/login.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { IonicPageModule } from 'ionic-angular'; 3 | import { LoginPage } from './login'; 4 | 5 | @NgModule({ 6 | declarations: [ 7 | LoginPage, 8 | ], 9 | imports: [ 10 | IonicPageModule.forChild(LoginPage), 11 | ], 12 | exports: [ 13 | LoginPage 14 | ] 15 | }) 16 | export class LoginPageModule {} 17 | -------------------------------------------------------------------------------- /src/pages/login/login.scss: -------------------------------------------------------------------------------- 1 | page-login { 2 | .toolbar-title-md { 3 | text-align: center; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /src/pages/login/login.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { IonicPage, ModalController} from 'ionic-angular'; 3 | import { TabsPage } from "../tabs/tabs"; 4 | import { Platform } from 'ionic-angular'; 5 | import { BackButtonService } from "../../services/backButton.service"; 6 | 7 | @IonicPage() 8 | @Component({ 9 | selector: 'page-login', 10 | templateUrl: 'login.html', 11 | }) 12 | export class LoginPage { 13 | 14 | constructor(public modalCtrl: ModalController, 15 | private backButtonService: BackButtonService, 16 | private platform: Platform) { 17 | this.platform.ready().then(() => { 18 | this.backButtonService.registerBackButtonAction(null); 19 | }); 20 | } 21 | 22 | ionViewDidLoad() { 23 | console.log('ionViewDidLoad LoginPage'); 24 | } 25 | 26 | logIn(username: HTMLInputElement, password: HTMLInputElement) { 27 | if (username.value.length == 0) { 28 | alert("请输入账号"); 29 | } else if (password.value.length == 0) { 30 | alert("请输入密码"); 31 | } else { 32 | let userinfo: string = '用户名:' + username.value + '密码:' + password.value; 33 | alert(userinfo); 34 | let modal = this.modalCtrl.create(TabsPage); 35 | modal.present(); 36 | } 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/pages/setting/setting.html: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 更多 11 | 12 | 13 | 14 | 15 | 16 | 17 | 24 | 25 | 26 | 27 | 28 | 控件1 29 | 30 | 33 | 39 | 40 | 41 | 42 | 46 | 49 | 50 | 51 |
52 | 55 |
56 |
-------------------------------------------------------------------------------- /src/pages/setting/setting.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { IonicPageModule } from 'ionic-angular'; 3 | import { SettingPage } from './setting'; 4 | 5 | @NgModule({ 6 | declarations: [ 7 | SettingPage, 8 | ], 9 | imports: [ 10 | IonicPageModule.forChild(SettingPage), 11 | ], 12 | exports: [ 13 | SettingPage 14 | ] 15 | }) 16 | export class SettingPageModule {} 17 | -------------------------------------------------------------------------------- /src/pages/setting/setting.scss: -------------------------------------------------------------------------------- 1 | page-setting { 2 | .toolbar-title-md{ 3 | text-align: center; 4 | } 5 | 6 | .scroll-content{ 7 | overflow: hidden; 8 | } 9 | 10 | .bg-color{ 11 | background-color: #efeeee; 12 | } 13 | 14 | .top-list{ 15 | margin-top: 15px; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/pages/setting/setting.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { IonicPage, ModalController } from 'ionic-angular'; 3 | import { LoginPage } from "../login/login"; 4 | 5 | @IonicPage() 6 | @Component({ 7 | selector: 'page-setting', 8 | templateUrl: 'setting.html', 9 | }) 10 | export class SettingPage { 11 | 12 | constructor(public modalCtrl: ModalController) { 13 | } 14 | 15 | 16 | ionViewDidLoad() { 17 | console.log('ionViewDidLoad SettingPage'); 18 | } 19 | 20 | logOut() { 21 | let modal = this.modalCtrl.create(LoginPage); 22 | modal.present(); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/pages/tabs/tabs.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/pages/tabs/tabs.ts: -------------------------------------------------------------------------------- 1 | import { Component, ViewChild } from '@angular/core'; 2 | import { Platform, Tabs } from 'ionic-angular'; 3 | 4 | import { HomePage } from '../home/home'; 5 | import { SettingPage } from "../setting/setting"; 6 | import { BackButtonService } from "../../services/backButton.service"; 7 | 8 | @Component({ 9 | templateUrl: 'tabs.html' 10 | }) 11 | export class TabsPage { 12 | tabRoots: Object[]; 13 | @ViewChild('myTabs') tabRef: Tabs; 14 | 15 | constructor(public backButtonService: BackButtonService, 16 | private platform: Platform) { 17 | this.tabRoots = [ 18 | { 19 | root: HomePage, 20 | tabTitle: 'Home', 21 | tabIcon: 'home' 22 | }, 23 | { 24 | root: SettingPage, 25 | tabTitle: '设置', 26 | tabIcon: 'person' 27 | } 28 | ]; 29 | 30 | this.platform.ready().then(() => { 31 | this.backButtonService.registerBackButtonAction(this.tabRef); 32 | }); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/service-worker.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Check out https://googlechrome.github.io/sw-toolbox/ for 3 | * more info on how to use sw-toolbox to custom configure your service worker. 4 | */ 5 | 6 | 7 | 'use strict'; 8 | importScripts('./build/sw-toolbox.js'); 9 | 10 | self.toolbox.options.cache = { 11 | name: 'ionic-cache' 12 | }; 13 | 14 | // pre-cache our key assets 15 | self.toolbox.precache( 16 | [ 17 | './build/main.js', 18 | './build/main.css', 19 | './build/polyfills.js', 20 | 'index.html', 21 | 'manifest.json' 22 | ] 23 | ); 24 | 25 | // dynamically cache any other local assets 26 | self.toolbox.router.any('/*', self.toolbox.cacheFirst); 27 | 28 | // for any other requests go to the network, cache, 29 | // and then only use that cached resource if your user goes offline 30 | self.toolbox.router.default = self.toolbox.networkFirst; 31 | -------------------------------------------------------------------------------- /src/services/backButton.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { Platform, ToastController, App, NavController, Tabs } from 'ionic-angular'; 3 | 4 | @Injectable() 5 | export class BackButtonService { 6 | 7 | //控制硬件返回按钮是否触发,默认false 8 | backButtonPressed: boolean = false; 9 | 10 | //构造函数 依赖注入 11 | constructor(public platform: Platform, 12 | public appCtrl: App, 13 | public toastCtrl: ToastController) { } 14 | 15 | //注册方法 16 | registerBackButtonAction(tabRef: Tabs): void { 17 | 18 | //registerBackButtonAction是系统自带的方法 19 | this.platform.registerBackButtonAction(() => { 20 | //获取NavController 21 | let activeNav: NavController = this.appCtrl.getActiveNavs()[0]; 22 | //如果可以返回上一页,则执行pop 23 | if (activeNav.canGoBack()) { 24 | activeNav.pop(); 25 | } else { 26 | if (tabRef == null || tabRef._selectHistory[tabRef._selectHistory.length - 1] === tabRef.getByIndex(0).id) { 27 | //执行退出 28 | this.showExit(); 29 | } else { 30 | //选择首页第一个的标签 31 | tabRef.select(0); 32 | } 33 | } 34 | }); 35 | } 36 | 37 | //退出应用方法 38 | private showExit(): void { 39 | //如果为true,退出 40 | if (this.backButtonPressed) { 41 | this.platform.exitApp(); 42 | } else { 43 | //第一次按,弹出Toast 44 | this.toastCtrl.create({ 45 | message: '再按一次退出应用', 46 | duration: 2000, 47 | position: 'top' 48 | }).present(); 49 | //标记为true 50 | this.backButtonPressed = true; 51 | //两秒后标记为false,如果退出的话,就不会执行了 52 | setTimeout(() => this.backButtonPressed = false, 2000); 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/theme/variables.scss: -------------------------------------------------------------------------------- 1 | // Ionic Variables and Theming. For more info, please see: 2 | // http://ionicframework.com/docs/v2/theming/ 3 | $font-path: "../assets/fonts"; 4 | 5 | @import "ionic.globals"; 6 | 7 | 8 | // Shared Variables 9 | // -------------------------------------------------- 10 | // To customize the look and feel of this app, you can override 11 | // the Sass variables found in Ionic's source scss files. 12 | // To view all the possible Ionic variables, see: 13 | // http://ionicframework.com/docs/v2/theming/overriding-ionic-variables/ 14 | 15 | 16 | 17 | 18 | // Named Color Variables 19 | // -------------------------------------------------- 20 | // Named colors makes it easy to reuse colors on various components. 21 | // It's highly recommended to change the default colors 22 | // to match your app's branding. Ionic uses a Sass map of 23 | // colors so you can add, rename and remove colors as needed. 24 | // The "primary" color is the only required color in the map. 25 | 26 | $colors: ( 27 | primary: #488aff, 28 | secondary: #32db64, 29 | danger: #f53d3d, 30 | light: #f4f4f4, 31 | dark: #222 32 | ); 33 | 34 | 35 | // App iOS Variables 36 | // -------------------------------------------------- 37 | // iOS only Sass variables can go here 38 | 39 | 40 | 41 | 42 | // App Material Design Variables 43 | // -------------------------------------------------- 44 | // Material Design only Sass variables can go here 45 | 46 | 47 | 48 | 49 | // App Windows Variables 50 | // -------------------------------------------------- 51 | // Windows only Sass variables can go here 52 | 53 | 54 | 55 | 56 | // App Theme 57 | // -------------------------------------------------- 58 | // Ionic apps can have different themes applied, which can 59 | // then be future customized. This import comes last 60 | // so that the above variables are used and Ionic's 61 | // default are overridden. 62 | 63 | @import "ionic.theme.default"; 64 | 65 | 66 | // Ionicons 67 | // -------------------------------------------------- 68 | // The premium icon font for Ionic. For more info, please see: 69 | // http://ionicframework.com/docs/v2/ionicons/ 70 | 71 | @import "ionic.ionicons"; 72 | 73 | 74 | // Fonts 75 | // -------------------------------------------------- 76 | 77 | @import "roboto"; 78 | @import "noto-sans"; 79 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "allowSyntheticDefaultImports": true, 4 | "declaration": false, 5 | "emitDecoratorMetadata": true, 6 | "experimentalDecorators": true, 7 | "lib": [ 8 | "dom", 9 | "es2015" 10 | ], 11 | "module": "es2015", 12 | "moduleResolution": "node", 13 | "sourceMap": true, 14 | "target": "es5" 15 | }, 16 | "include": [ 17 | "src/**/*.ts" 18 | ], 19 | "exclude": [ 20 | "node_modules" 21 | ], 22 | "compileOnSave": false, 23 | "atom": { 24 | "rewriteTsconfig": false 25 | } 26 | } -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "no-duplicate-variable": true, 4 | "no-unused-variable": [ 5 | true 6 | ] 7 | }, 8 | "rulesDirectory": [ 9 | "node_modules/tslint-eslint-rules/dist/rules" 10 | ] 11 | } 12 | --------------------------------------------------------------------------------