├── .editorconfig
├── .gitignore
├── LICENSE
├── README.md
├── build.json
├── config.xml
├── ionic.config.json
├── package-lock.json
├── package.json
├── resources
├── README.md
├── 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
├── icon.png.md5
├── ios
│ ├── icon
│ │ ├── icon-1024.png
│ │ ├── 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@2x~universal~anyany.png
│ │ └── Default~iphone.png
├── splash.png
└── splash.png.md5
├── src
├── app
│ ├── app.component.ts
│ ├── app.html
│ ├── app.module.ts
│ ├── app.scss
│ └── main.ts
├── assets
│ └── icon
│ │ └── favicon.ico
├── index.html
├── manifest.json
├── pages
│ ├── about
│ │ ├── about.html
│ │ ├── about.scss
│ │ └── about.ts
│ ├── content
│ │ ├── content.html
│ │ ├── content.module.ts
│ │ ├── content.scss
│ │ └── content.ts
│ ├── detail
│ │ ├── detail.html
│ │ ├── detail.module.ts
│ │ ├── detail.scss
│ │ └── detail.ts
│ ├── home
│ │ ├── home.html
│ │ ├── home.scss
│ │ └── home.ts
│ ├── login
│ │ ├── login.html
│ │ ├── login.module.ts
│ │ ├── login.scss
│ │ └── login.ts
│ ├── search
│ │ ├── search.html
│ │ ├── search.module.ts
│ │ ├── search.scss
│ │ └── search.ts
│ ├── tabs
│ │ ├── tabs.html
│ │ └── tabs.ts
│ └── user
│ │ ├── user.html
│ │ ├── user.scss
│ │ └── user.ts
├── service-worker.js
└── 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 | .sourcemaps/
17 | .sass-cache/
18 | .tmp/
19 | .versions/
20 | coverage/
21 | dist/
22 | node_modules/
23 | tmp/
24 | temp/
25 | hooks/
26 | platforms/
27 | plugins/
28 | plugins/android.json
29 | plugins/ios.json
30 | www/
31 | $RECYCLE.BIN/
32 |
33 | .DS_Store
34 | Thumbs.db
35 | UserInterfaceState.xcuserstate
36 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017 nurdun
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | This is a starter template for [Ionic](http://ionicframework.com/docs/) projects.
2 |
3 | ## How to use this template
4 |
5 | *This template does not work on its own*. The shared files for each starter are found in the [ionic2-app-base repo](https://github.com/ionic-team/ionic2-app-base).
6 |
7 | To use this template, either create a new ionic project using the ionic node.js utility, or copy the files from this repository into the [Starter App Base](https://github.com/ionic-team/ionic2-app-base).
8 |
9 | ### With the Ionic CLI:
10 |
11 | Take the name after `ionic2-starter-`, and that is the name of the template to be used when using the `ionic start` command below:
12 |
13 | ```bash
14 | $ sudo npm install -g ionic cordova
15 | $ ionic start myTabs tabs
16 | ```
17 |
18 | Then, to run it, cd into `myTabs` and run:
19 |
20 | ```bash
21 | $ ionic cordova platform add ios
22 | $ ionic cordova run ios
23 | ```
24 |
25 | Substitute ios for android if not on a Mac.
26 |
27 | # ionic3-App
28 |
29 |
30 | # 安装并启动
31 | 首先在电脑上安装好ionic3,Android SDk,xcode等需要的环境
32 | 用 git clone 的方式拉项目到本地
33 | 先到package.json中删掉jpush-phonegap-plugin(注意dependencies和cordova中都删掉)
34 | jpush-phonegap-plugin 需要先删掉,等安装完其他依赖之后再单独安装,因为这里的消息推送插件需要配置自己的appkey
35 | 不需要消息推送功能的话,删掉这个插件和之后app.component.ts中的消息推送相关代码就可以
36 | 用 npm install 的方式 安装node_modules
37 | 用ionic serve 命令可以启动项目并在浏览器中查看(此功能需要删掉消息推送相关代码)
38 | # Android
39 | ios的消息推送功能用到了phonegap-plugin-push插件,本插件在安卓上需要使用google services通过firebase来推送消息。
40 | 因为我们用不了google services,所以Android端用了极光的jpush-phonegap-plugin来实现了消息推送。
41 | 要打包成Android时需要用 ionic cordova plugin remove phonegap-plugin-push命令来删除phonegap-plugin-push插件
42 | 否则的话因为获取不到google services配置文件,打包会失败。这个问题之后会解决
43 |
44 | ionic cordova platform add android 打包安卓项目
45 | ionic cordova emulate android -lc 启动安卓模拟器并查看项目
46 | ionic cordova run android -lc 真机调试
47 |
48 | # IOS
49 | ionic cordova platform add ios
50 | ionic cordova emulate ios -lc
51 | ionic cordova run ios -lc
52 |
53 | # 注意
54 | config.xml中的widget id="ionic.App" 需要替换成自己的App id
55 |
56 | # 建议
57 | 安装npm package时可能会报错
58 | 建议自己ionic start xxx新建一个ionic3项目然后把代码复制进去运行
59 | 创建新项目并复制我的代码的时候需要单独安装几个插件和npm包
60 | $ ionic cordova plugin add phonegap-plugin-push
61 | $ npm install --save @ionic-native/push
62 | ionic plugin add jpush-phonegap-plugin --variable APP_KEY=your_jpush_appkey
63 | $ npm install --save ionic3-jpush
64 | 上面四个是消息推送相关的插件和包,如果不需要消息推送功能的话可以不安装,记得注释掉app.component.ts中的相关代码就好
65 | $ npm install --save cordova-sqlite-storage
66 |
67 |
68 |
69 |
70 |
71 |
72 |
--------------------------------------------------------------------------------
/build.json:
--------------------------------------------------------------------------------
1 | {
2 | "ios": {
3 | "debug": {
4 | "codeSignIdentity": "iPhone Developer",
5 | "developmentTeam": "T6B252GRK6",
6 | "packageType": "development",
7 | "buildFlag": [
8 | "EMBEDDED_CONTENT_CONTAINS_SWIFT = YES",
9 | "ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES=NO",
10 | "LD_RUNPATH_SEARCH_PATHS = \"@executable_path/Frameworks\""
11 | ]
12 | },
13 | "release": {
14 |
15 | }
16 | },
17 | "android": {
18 |
19 | }
20 | }
--------------------------------------------------------------------------------
/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | MyApp
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 |
89 |
90 |
91 |
92 |
93 |
94 |
--------------------------------------------------------------------------------
/ionic.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "JZWApp",
3 | "app_id": "",
4 | "type": "ionic-angular",
5 | "integrations": {
6 | "cordova": {}
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "JZWApp",
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": "4.1.3",
16 | "@angular/compiler": "4.1.3",
17 | "@angular/compiler-cli": "4.1.3",
18 | "@angular/core": "4.1.3",
19 | "@angular/forms": "4.1.3",
20 | "@angular/http": "4.1.3",
21 | "@angular/platform-browser": "4.1.3",
22 | "@angular/platform-browser-dynamic": "4.1.3",
23 | "@ionic-native/core": "3.12.1",
24 | "@ionic-native/push": "^4.3.0",
25 | "@ionic-native/splash-screen": "3.12.1",
26 | "@ionic-native/status-bar": "3.12.1",
27 | "@ionic/storage": "2.0.1",
28 | "cordova-android": "^6.2.3",
29 | "cordova-ios": "^4.4.0",
30 | "cordova-plugin-device": "1.1.4",
31 | "cordova-plugin-jcore": "^1.1.9",
32 | "cordova-plugin-splashscreen": "^4.0.3",
33 | "cordova-plugin-statusbar": "^2.2.2",
34 | "cordova-plugin-whitelist": "^1.3.1",
35 | "cordova-sqlite-storage": "^2.0.4",
36 | "ionic-angular": "3.6.1",
37 | "ionic-plugin-keyboard": "^2.2.1",
38 | "ionic3-jpush": "^1.1.0",
39 | "ionicons": "3.0.0",
40 | "jpush-phonegap-plugin": "^3.2.6",
41 | "phonegap-plugin-push": "^2.0.0",
42 | "rxjs": "5.4.0",
43 | "sw-toolbox": "3.6.0",
44 | "zone.js": "0.8.12"
45 | },
46 | "devDependencies": {
47 | "@ionic/app-scripts": "2.1.4",
48 | "typescript": "2.3.4"
49 | },
50 | "description": "An Ionic project",
51 | "cordova": {
52 | "plugins": {
53 | "jpush-phonegap-plugin": {
54 | //这个插件需要重新安装
55 | //插件url地址为https://github.com/lh4111/ionic-jpush
56 | //安装的时候注意配置appkey
57 | "APP_KEY": ""
58 | },
59 | "phonegap-plugin-push": {},
60 | "cordova-plugin-device": {},
61 | "cordova-plugin-splashscreen": {},
62 | "cordova-plugin-statusbar": {},
63 | "cordova-plugin-whitelist": {},
64 | "ionic-plugin-keyboard": {}
65 | },
66 | "platforms": [
67 | "android",
68 | "ios"
69 | ]
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/resources/README.md:
--------------------------------------------------------------------------------
1 | These are Cordova resources. You can replace icon.png and splash.png and run
2 | `ionic cordova resources` to generate custom icons and splash screens for your
3 | app. See `ionic cordova resources --help` for details.
4 |
5 | Cordova reference documentation:
6 |
7 | - Icons: https://cordova.apache.org/docs/en/latest/config_ref/images.html
8 | - Splash Screens: https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-splashscreen/
9 |
--------------------------------------------------------------------------------
/resources/android/icon/drawable-hdpi-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nurdun/ionic3-App/ec2e3ec8de368f89b5497325f1ac11463c2158c6/resources/android/icon/drawable-hdpi-icon.png
--------------------------------------------------------------------------------
/resources/android/icon/drawable-ldpi-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nurdun/ionic3-App/ec2e3ec8de368f89b5497325f1ac11463c2158c6/resources/android/icon/drawable-ldpi-icon.png
--------------------------------------------------------------------------------
/resources/android/icon/drawable-mdpi-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nurdun/ionic3-App/ec2e3ec8de368f89b5497325f1ac11463c2158c6/resources/android/icon/drawable-mdpi-icon.png
--------------------------------------------------------------------------------
/resources/android/icon/drawable-xhdpi-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nurdun/ionic3-App/ec2e3ec8de368f89b5497325f1ac11463c2158c6/resources/android/icon/drawable-xhdpi-icon.png
--------------------------------------------------------------------------------
/resources/android/icon/drawable-xxhdpi-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nurdun/ionic3-App/ec2e3ec8de368f89b5497325f1ac11463c2158c6/resources/android/icon/drawable-xxhdpi-icon.png
--------------------------------------------------------------------------------
/resources/android/icon/drawable-xxxhdpi-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nurdun/ionic3-App/ec2e3ec8de368f89b5497325f1ac11463c2158c6/resources/android/icon/drawable-xxxhdpi-icon.png
--------------------------------------------------------------------------------
/resources/android/splash/drawable-land-hdpi-screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nurdun/ionic3-App/ec2e3ec8de368f89b5497325f1ac11463c2158c6/resources/android/splash/drawable-land-hdpi-screen.png
--------------------------------------------------------------------------------
/resources/android/splash/drawable-land-ldpi-screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nurdun/ionic3-App/ec2e3ec8de368f89b5497325f1ac11463c2158c6/resources/android/splash/drawable-land-ldpi-screen.png
--------------------------------------------------------------------------------
/resources/android/splash/drawable-land-mdpi-screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nurdun/ionic3-App/ec2e3ec8de368f89b5497325f1ac11463c2158c6/resources/android/splash/drawable-land-mdpi-screen.png
--------------------------------------------------------------------------------
/resources/android/splash/drawable-land-xhdpi-screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nurdun/ionic3-App/ec2e3ec8de368f89b5497325f1ac11463c2158c6/resources/android/splash/drawable-land-xhdpi-screen.png
--------------------------------------------------------------------------------
/resources/android/splash/drawable-land-xxhdpi-screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nurdun/ionic3-App/ec2e3ec8de368f89b5497325f1ac11463c2158c6/resources/android/splash/drawable-land-xxhdpi-screen.png
--------------------------------------------------------------------------------
/resources/android/splash/drawable-land-xxxhdpi-screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nurdun/ionic3-App/ec2e3ec8de368f89b5497325f1ac11463c2158c6/resources/android/splash/drawable-land-xxxhdpi-screen.png
--------------------------------------------------------------------------------
/resources/android/splash/drawable-port-hdpi-screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nurdun/ionic3-App/ec2e3ec8de368f89b5497325f1ac11463c2158c6/resources/android/splash/drawable-port-hdpi-screen.png
--------------------------------------------------------------------------------
/resources/android/splash/drawable-port-ldpi-screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nurdun/ionic3-App/ec2e3ec8de368f89b5497325f1ac11463c2158c6/resources/android/splash/drawable-port-ldpi-screen.png
--------------------------------------------------------------------------------
/resources/android/splash/drawable-port-mdpi-screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nurdun/ionic3-App/ec2e3ec8de368f89b5497325f1ac11463c2158c6/resources/android/splash/drawable-port-mdpi-screen.png
--------------------------------------------------------------------------------
/resources/android/splash/drawable-port-xhdpi-screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nurdun/ionic3-App/ec2e3ec8de368f89b5497325f1ac11463c2158c6/resources/android/splash/drawable-port-xhdpi-screen.png
--------------------------------------------------------------------------------
/resources/android/splash/drawable-port-xxhdpi-screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nurdun/ionic3-App/ec2e3ec8de368f89b5497325f1ac11463c2158c6/resources/android/splash/drawable-port-xxhdpi-screen.png
--------------------------------------------------------------------------------
/resources/android/splash/drawable-port-xxxhdpi-screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nurdun/ionic3-App/ec2e3ec8de368f89b5497325f1ac11463c2158c6/resources/android/splash/drawable-port-xxxhdpi-screen.png
--------------------------------------------------------------------------------
/resources/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nurdun/ionic3-App/ec2e3ec8de368f89b5497325f1ac11463c2158c6/resources/icon.png
--------------------------------------------------------------------------------
/resources/icon.png.md5:
--------------------------------------------------------------------------------
1 | 3f1bbdf1aefcb5ce7b60770ce907c68f
--------------------------------------------------------------------------------
/resources/ios/icon/icon-1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nurdun/ionic3-App/ec2e3ec8de368f89b5497325f1ac11463c2158c6/resources/ios/icon/icon-1024.png
--------------------------------------------------------------------------------
/resources/ios/icon/icon-40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nurdun/ionic3-App/ec2e3ec8de368f89b5497325f1ac11463c2158c6/resources/ios/icon/icon-40.png
--------------------------------------------------------------------------------
/resources/ios/icon/icon-40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nurdun/ionic3-App/ec2e3ec8de368f89b5497325f1ac11463c2158c6/resources/ios/icon/icon-40@2x.png
--------------------------------------------------------------------------------
/resources/ios/icon/icon-40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nurdun/ionic3-App/ec2e3ec8de368f89b5497325f1ac11463c2158c6/resources/ios/icon/icon-40@3x.png
--------------------------------------------------------------------------------
/resources/ios/icon/icon-50.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nurdun/ionic3-App/ec2e3ec8de368f89b5497325f1ac11463c2158c6/resources/ios/icon/icon-50.png
--------------------------------------------------------------------------------
/resources/ios/icon/icon-50@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nurdun/ionic3-App/ec2e3ec8de368f89b5497325f1ac11463c2158c6/resources/ios/icon/icon-50@2x.png
--------------------------------------------------------------------------------
/resources/ios/icon/icon-60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nurdun/ionic3-App/ec2e3ec8de368f89b5497325f1ac11463c2158c6/resources/ios/icon/icon-60.png
--------------------------------------------------------------------------------
/resources/ios/icon/icon-60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nurdun/ionic3-App/ec2e3ec8de368f89b5497325f1ac11463c2158c6/resources/ios/icon/icon-60@2x.png
--------------------------------------------------------------------------------
/resources/ios/icon/icon-60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nurdun/ionic3-App/ec2e3ec8de368f89b5497325f1ac11463c2158c6/resources/ios/icon/icon-60@3x.png
--------------------------------------------------------------------------------
/resources/ios/icon/icon-72.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nurdun/ionic3-App/ec2e3ec8de368f89b5497325f1ac11463c2158c6/resources/ios/icon/icon-72.png
--------------------------------------------------------------------------------
/resources/ios/icon/icon-72@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nurdun/ionic3-App/ec2e3ec8de368f89b5497325f1ac11463c2158c6/resources/ios/icon/icon-72@2x.png
--------------------------------------------------------------------------------
/resources/ios/icon/icon-76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nurdun/ionic3-App/ec2e3ec8de368f89b5497325f1ac11463c2158c6/resources/ios/icon/icon-76.png
--------------------------------------------------------------------------------
/resources/ios/icon/icon-76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nurdun/ionic3-App/ec2e3ec8de368f89b5497325f1ac11463c2158c6/resources/ios/icon/icon-76@2x.png
--------------------------------------------------------------------------------
/resources/ios/icon/icon-83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nurdun/ionic3-App/ec2e3ec8de368f89b5497325f1ac11463c2158c6/resources/ios/icon/icon-83.5@2x.png
--------------------------------------------------------------------------------
/resources/ios/icon/icon-small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nurdun/ionic3-App/ec2e3ec8de368f89b5497325f1ac11463c2158c6/resources/ios/icon/icon-small.png
--------------------------------------------------------------------------------
/resources/ios/icon/icon-small@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nurdun/ionic3-App/ec2e3ec8de368f89b5497325f1ac11463c2158c6/resources/ios/icon/icon-small@2x.png
--------------------------------------------------------------------------------
/resources/ios/icon/icon-small@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nurdun/ionic3-App/ec2e3ec8de368f89b5497325f1ac11463c2158c6/resources/ios/icon/icon-small@3x.png
--------------------------------------------------------------------------------
/resources/ios/icon/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nurdun/ionic3-App/ec2e3ec8de368f89b5497325f1ac11463c2158c6/resources/ios/icon/icon.png
--------------------------------------------------------------------------------
/resources/ios/icon/icon@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nurdun/ionic3-App/ec2e3ec8de368f89b5497325f1ac11463c2158c6/resources/ios/icon/icon@2x.png
--------------------------------------------------------------------------------
/resources/ios/splash/Default-568h@2x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nurdun/ionic3-App/ec2e3ec8de368f89b5497325f1ac11463c2158c6/resources/ios/splash/Default-568h@2x~iphone.png
--------------------------------------------------------------------------------
/resources/ios/splash/Default-667h.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nurdun/ionic3-App/ec2e3ec8de368f89b5497325f1ac11463c2158c6/resources/ios/splash/Default-667h.png
--------------------------------------------------------------------------------
/resources/ios/splash/Default-736h.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nurdun/ionic3-App/ec2e3ec8de368f89b5497325f1ac11463c2158c6/resources/ios/splash/Default-736h.png
--------------------------------------------------------------------------------
/resources/ios/splash/Default-Landscape-736h.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nurdun/ionic3-App/ec2e3ec8de368f89b5497325f1ac11463c2158c6/resources/ios/splash/Default-Landscape-736h.png
--------------------------------------------------------------------------------
/resources/ios/splash/Default-Landscape@2x~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nurdun/ionic3-App/ec2e3ec8de368f89b5497325f1ac11463c2158c6/resources/ios/splash/Default-Landscape@2x~ipad.png
--------------------------------------------------------------------------------
/resources/ios/splash/Default-Landscape@~ipadpro.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nurdun/ionic3-App/ec2e3ec8de368f89b5497325f1ac11463c2158c6/resources/ios/splash/Default-Landscape@~ipadpro.png
--------------------------------------------------------------------------------
/resources/ios/splash/Default-Landscape~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nurdun/ionic3-App/ec2e3ec8de368f89b5497325f1ac11463c2158c6/resources/ios/splash/Default-Landscape~ipad.png
--------------------------------------------------------------------------------
/resources/ios/splash/Default-Portrait@2x~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nurdun/ionic3-App/ec2e3ec8de368f89b5497325f1ac11463c2158c6/resources/ios/splash/Default-Portrait@2x~ipad.png
--------------------------------------------------------------------------------
/resources/ios/splash/Default-Portrait@~ipadpro.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nurdun/ionic3-App/ec2e3ec8de368f89b5497325f1ac11463c2158c6/resources/ios/splash/Default-Portrait@~ipadpro.png
--------------------------------------------------------------------------------
/resources/ios/splash/Default-Portrait~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nurdun/ionic3-App/ec2e3ec8de368f89b5497325f1ac11463c2158c6/resources/ios/splash/Default-Portrait~ipad.png
--------------------------------------------------------------------------------
/resources/ios/splash/Default@2x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nurdun/ionic3-App/ec2e3ec8de368f89b5497325f1ac11463c2158c6/resources/ios/splash/Default@2x~iphone.png
--------------------------------------------------------------------------------
/resources/ios/splash/Default@2x~universal~anyany.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nurdun/ionic3-App/ec2e3ec8de368f89b5497325f1ac11463c2158c6/resources/ios/splash/Default@2x~universal~anyany.png
--------------------------------------------------------------------------------
/resources/ios/splash/Default~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nurdun/ionic3-App/ec2e3ec8de368f89b5497325f1ac11463c2158c6/resources/ios/splash/Default~iphone.png
--------------------------------------------------------------------------------
/resources/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nurdun/ionic3-App/ec2e3ec8de368f89b5497325f1ac11463c2158c6/resources/splash.png
--------------------------------------------------------------------------------
/resources/splash.png.md5:
--------------------------------------------------------------------------------
1 | 0dcf1df8c92c1ece4382d3357d9f8562
--------------------------------------------------------------------------------
/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 | import { Storage } from '@ionic/storage';
6 | import { Events } from 'ionic-angular';
7 | import { JPush } from 'ionic3-jpush';
8 | import { Push, PushObject, PushOptions } from '@ionic-native/push';
9 |
10 | import { TabsPage } from '../pages/tabs/tabs';
11 | import { LoginPage } from '../pages/login/login'
12 |
13 | @Component({
14 | templateUrl: 'app.html'
15 | })
16 | export class MyApp {
17 | rootPage:any;
18 | token:string;
19 |
20 | constructor(
21 | public platform: Platform,
22 | public push:Push,
23 | public jPush: JPush,
24 | public storage:Storage,
25 | public events:Events,
26 | statusBar: StatusBar,
27 | splashScreen: SplashScreen
28 | ){
29 | //当storage准备就绪之后,从storage中读取token
30 | //如果token存在的话直接跳到主页面中
31 | //如果token不存在的话进入登录页面
32 | storage.ready().then(()=>{
33 | storage.get('token').then(
34 | (token:string)=>{
35 | if(token!=null){
36 | console.log('token:'+token);
37 | this.rootPage = TabsPage;
38 | }else{
39 | console.log('token undefined');
40 | this.rootPage = LoginPage;
41 | }
42 | }
43 | );
44 | });
45 |
46 | platform.ready().then(() => {
47 | // Okay, so the platform is ready and our plugins are available.
48 | // Here you can do any higher level native things you might need.
49 | statusBar.styleDefault();
50 | splashScreen.hide();
51 |
52 | //根据不同平台实现消息推送功能
53 | if(this.platform.is('ios')){
54 | this.initPushNotification();
55 | }else if(this.platform.is('android')){
56 | this.jPush.init();
57 | this.androidGetRegId();
58 |
59 | this.jPush.openNotification()
60 | .subscribe( res => {
61 | console.log('收到推送');
62 | console.log(res)
63 | });
64 |
65 | this.jPush.receiveNotification()
66 | .subscribe( res => {
67 | console.log('收到推送');
68 | console.log(res)
69 | });
70 |
71 | this.jPush.receiveMessage()
72 | .subscribe( res => {
73 | console.log('收到推送');
74 | console.log(res)
75 | });
76 | }else{
77 | //...
78 | }
79 | });
80 |
81 | //当用户的操作为user:login时rootPage的取值为TabsPage
82 | this.events.subscribe('user:login', (params) => {
83 | console.log('User logged in - Changing to tabs page');
84 | this.rootPage = TabsPage;
85 | });
86 | //当用户的操作为user:logout时rootPage的取值为LoginPage
87 | this.events.subscribe('user:logout', (params) => {
88 | console.log('User logout');
89 | this.rootPage = LoginPage;
90 | });
91 | }
92 |
93 | //Android端获取RegestrationId,用于消息推送
94 | androidGetRegId(){
95 | this.jPush.getRegistrationID()
96 | .then(regId => {
97 | console.log(regId)
98 | this.storage.set('regId', regId);
99 | })
100 | .catch(err => alert(err))
101 | }
102 |
103 | //IOS端消息推送函数
104 | initPushNotification() {
105 | if(!this.platform.is('cordova')) {
106 | console.warn('Push notifications only work on a real device');
107 | return;
108 | }
109 |
110 | const options: PushOptions = {
111 | ios: {
112 | alert: true,
113 | badge: true,
114 | sound: true
115 | }
116 | };
117 |
118 | const pushObject: PushObject = this.push.init(options);
119 |
120 | pushObject.on('registration').subscribe((data: any) => {
121 | console.log('device token: ' + data.registrationId);
122 | this.storage.set('device token', data.registrationId);
123 | });
124 | pushObject.on('error').subscribe(error => {
125 | console.error('Error with Push plugin' + error);
126 | });
127 | pushObject.on('notification').subscribe((data: any) => {
128 | // log message
129 | console.log('Got a message: ' + data.message);
130 | // if user using app and push notification comes
131 | if(data.additionalData.foreground) {
132 | // for example show some alert in the app
133 | console.log('Notification received while App was in foreground');
134 | } else {
135 | // do something on push notification click
136 | console.log('Push notification clicked');
137 | }
138 | });
139 | }
140 | }
141 |
--------------------------------------------------------------------------------
/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 { FormsModule, ReactiveFormsModule } from '@angular/forms';
5 | import { MyApp } from './app.component';
6 |
7 | import { AboutPage } from '../pages/about/about';
8 | import { UserPage } from '../pages/user/user';
9 | import { HomePage } from '../pages/home/home';
10 | import { TabsPage } from '../pages/tabs/tabs';
11 | import { LoginPage } from '../pages/login/login';
12 | import { DetailPageModule } from '../pages/detail/detail.module';
13 | import { ContentPageModule } from '../pages/content/content.module';
14 | import { SearchPageModule } from '../pages/search/search.module';
15 |
16 | import { StatusBar } from '@ionic-native/status-bar';
17 | import { SplashScreen } from '@ionic-native/splash-screen';
18 | import {IonicStorageModule} from '@ionic/storage';
19 | import { JPush } from 'ionic3-jpush';
20 | import { Push } from '@ionic-native/push';
21 |
22 | @NgModule({
23 | declarations: [
24 | MyApp,
25 | AboutPage,
26 | UserPage,
27 | HomePage,
28 | TabsPage,
29 | LoginPage,
30 | ],
31 | imports: [
32 | BrowserModule,
33 | FormsModule,
34 | IonicModule.forRoot(MyApp,{
35 | //mode:"ios"
36 | }),
37 | IonicStorageModule.forRoot(),
38 | DetailPageModule,
39 | ContentPageModule,
40 | SearchPageModule,
41 | ],
42 | bootstrap: [IonicApp],
43 | entryComponents: [
44 | MyApp,
45 | AboutPage,
46 | UserPage,
47 | HomePage,
48 | TabsPage,
49 | LoginPage,
50 | ],
51 | providers: [
52 | StatusBar,
53 | SplashScreen,
54 | JPush,
55 | Push,
56 | {provide: ErrorHandler, useClass: IonicErrorHandler}
57 | ]
58 | })
59 | export class AppModule {}
60 |
--------------------------------------------------------------------------------
/src/app/app.scss:
--------------------------------------------------------------------------------
1 | // http://ionicframework.com/docs/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/nurdun/ionic3-App/ec2e3ec8de368f89b5497325f1ac11463c2158c6/src/assets/icon/favicon.ico
--------------------------------------------------------------------------------
/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Ionic App
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/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/about/about.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | About
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/src/pages/about/about.scss:
--------------------------------------------------------------------------------
1 | page-about {
2 |
3 | }
4 |
--------------------------------------------------------------------------------
/src/pages/about/about.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { NavController } from 'ionic-angular';
3 |
4 | @Component({
5 | selector: 'page-about',
6 | templateUrl: 'about.html'
7 | })
8 | export class AboutPage {
9 |
10 | constructor(public navCtrl: NavController) {
11 |
12 | }
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/src/pages/content/content.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 | Home
8 |
11 |
12 |
13 |
14 |
15 |
18 |
19 |
20 |
21 | carA
22 |
23 |
24 |
25 | carB
26 |
27 |
28 |
29 | carC
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 | A种车
41 | 这是车俩概述
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 | B种车
51 | 这是车俩概述
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 | C种车
61 | 这是车俩概述
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
--------------------------------------------------------------------------------
/src/pages/content/content.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { IonicPageModule } from 'ionic-angular';
3 | import { ContentPage } from './content';
4 |
5 | @NgModule({
6 | declarations: [
7 | ContentPage,
8 | ],
9 | imports: [
10 | IonicPageModule.forChild(ContentPage),
11 | ],
12 | })
13 | export class ContentPageModule {}
14 |
--------------------------------------------------------------------------------
/src/pages/content/content.scss:
--------------------------------------------------------------------------------
1 | page-content {
2 | .left-menu{
3 | //margin-left: -20px;
4 | font-size: 32px;
5 | color: #488aff;
6 | }
7 | .search-menu{
8 | float: right;
9 | font-size: 24px;
10 | color: #488aff;
11 | }
12 |
13 | button{
14 | background: rgba(0,0,0,0);
15 | }
16 | .title-md{
17 | position: absolute;
18 | left: 50%;
19 | transform: translate(-50%);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/pages/content/content.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import {
3 | IonicPage,
4 | NavController,
5 | NavParams,
6 | App,
7 | MenuController,
8 | Platform,
9 | Nav
10 | } from 'ionic-angular';
11 | import { JPush } from 'ionic3-jpush';
12 | import { Observable } from 'rxjs/Observable';
13 |
14 | import { DetailPage } from '../detail/detail';
15 | import { SearchPage } from '../search/search';
16 |
17 | /**
18 | * Generated class for the ContentPage page.
19 | *
20 | * See https://ionicframework.com/docs/components/#navigation for more info on
21 | * Ionic pages and navigation.
22 | */
23 |
24 | @IonicPage()
25 | @Component({
26 | selector: 'page-content',
27 | templateUrl: 'content.html',
28 | })
29 | export class ContentPage {
30 | //设置默认segment的值
31 | cars: string = "carA";
32 | isAndroid: boolean = false;
33 | alias: string = "";
34 | msgList: Array = [];
35 |
36 | constructor(
37 | public navCtrl: NavController,
38 | public navParams: NavParams,
39 | public nav: Nav,
40 | public jPush: JPush,
41 | platform: Platform,
42 | ){
43 | this.isAndroid = platform.is('android');
44 |
45 | // this.jPush.startJPushSDK()
46 | // .then(()=>{
47 | // this.jPush.init();
48 | // })
49 | // .then(()=>{
50 | // this.jPush.getRegistrationID().then(regid => {
51 | // console.log("regid:"+regid)
52 | // })
53 | // })
54 | this.jPush.init().then(()=>{
55 | this.jPush.getRegistrationID().then(regid => {
56 | console.log("regid:"+regid)
57 | })
58 | })
59 | }
60 |
61 |
62 |
63 | ionViewDidLoad() {
64 | console.log('ionViewDidLoad ContentPage');
65 | }
66 |
67 | //当显示该视图层时
68 | // ionViewWillEnter(){
69 | // this.navCtrl.push(SegmentPage);
70 | // }
71 | toDetail(){
72 | this.navCtrl.push(DetailPage,{
73 | //这里可以给detail页面传参数
74 | //key1:value,
75 | //key2:value
76 | });
77 | }
78 | toSearch(){
79 | this.navCtrl.push(SearchPage,{
80 | //这里可以给search页面传参数
81 | //key1:value,
82 | //key2:value
83 | });
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/src/pages/detail/detail.html:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 | detail
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/src/pages/detail/detail.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { IonicPageModule } from 'ionic-angular';
3 | import { DetailPage } from './detail';
4 |
5 | @NgModule({
6 | declarations: [
7 | DetailPage,
8 | ],
9 | imports: [
10 | IonicPageModule.forChild(DetailPage),
11 | ],
12 | })
13 | export class DetailPageModule {}
14 |
--------------------------------------------------------------------------------
/src/pages/detail/detail.scss:
--------------------------------------------------------------------------------
1 | page-detail {
2 |
3 | }
4 |
--------------------------------------------------------------------------------
/src/pages/detail/detail.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { IonicPage, NavController, NavParams } from 'ionic-angular';
3 |
4 | /**
5 | * Generated class for the DetailPage page.
6 | *
7 | * See https://ionicframework.com/docs/components/#navigation for more info on
8 | * Ionic pages and navigation.
9 | */
10 |
11 | @IonicPage()
12 | @Component({
13 | selector: 'page-detail',
14 | templateUrl: 'detail.html',
15 | })
16 | export class DetailPage {
17 |
18 | // constructor(public navCtrl: NavController, public navParams: NavParams) {
19 | // }
20 | constructor(public navCtrl: NavController, public navParams: NavParams) {
21 | //这里可以接受参数
22 | // const data = this.navParams.data;
23 | // const value1 = this.navParams.get('key1');
24 | // const value2 = this.navParams.get('key2');
25 | }
26 |
27 | ionViewDidLoad() {
28 | console.log('ionViewDidLoad DetailPage');
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/src/pages/home/home.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Menu
5 |
6 |
7 |
8 |
9 |
10 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/pages/home/home.scss:
--------------------------------------------------------------------------------
1 | page-home {
2 |
3 | }
4 |
--------------------------------------------------------------------------------
/src/pages/home/home.ts:
--------------------------------------------------------------------------------
1 | import { Component,ViewChild} from '@angular/core';
2 | import { NavController,Nav} from 'ionic-angular';
3 | import { App,MenuController,Platform } from 'ionic-angular';
4 |
5 | import { ContentPage } from '../content/content'
6 |
7 | @Component({
8 | selector: 'page-home',
9 | templateUrl: 'home.html'
10 | })
11 | export class HomePage {
12 | @ViewChild(Nav) nav: Nav;
13 | rootPage: any = ContentPage;
14 |
15 | pages: Array<{title: string,Component: any}>;
16 |
17 | isAndroid: boolean = false;
18 | constructor(
19 | public navCtrl: NavController,
20 | platform: Platform
21 | ){
22 | this.pages = [
23 | {title:'page one',Component: ContentPage}
24 | ]
25 | //this.isAndroid = platform.is('android');
26 | //menuCtrl.enable(true);
27 | }
28 |
29 | //当显示该视图层时
30 | // ionViewWillEnter(){
31 | // this.navCtrl.push(SegmentPage);
32 | // }
33 |
34 | //定义左侧菜单点击打开页面的函数
35 | openPage(page){
36 | this.nav.setRoot(page.Component);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/pages/login/login.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
29 |
--------------------------------------------------------------------------------
/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 | })
13 | export class LoginPageModule {}
14 |
--------------------------------------------------------------------------------
/src/pages/login/login.scss:
--------------------------------------------------------------------------------
1 | page-login {
2 | //类名后面家-md的是针对Android端的样式
3 | //例如.item-md等
4 |
5 | form{
6 | text-align:center;
7 | margin: auto;
8 | margin-top: 130px;
9 | }
10 | .has-focus{
11 | border-bottom: none;
12 | }
13 | .item{
14 | margin-top: 20px;
15 | border:1px solid #cccccc;
16 | border-radius: 5px;
17 | }
18 | .item:last-child{
19 | margin-top: 20px;
20 | border:0 !important;
21 | }
22 | div .input-wrapper{
23 | // margin: 20px auto;
24 | text-align:center;
25 | }
26 | .item-ios.item-block .item-inner{
27 | border: 0;
28 | }
29 | .input-cover {
30 | position: static;
31 | }
32 | button{
33 | width: 200px;
34 | height: 40px !important;
35 | }
36 |
37 | .item-md.item-input.item-input-has-focus .item-inner,
38 | .item-md.item-input.input-has-focus .item-inner{
39 | border-bottom: 0 !important;
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/src/pages/login/login.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import {
3 | IonicPage,
4 | NavController,
5 | LoadingController,
6 | ToastController,
7 | NavParams } from 'ionic-angular';
8 | import { Events } from 'ionic-angular';
9 | import { Storage } from '@ionic/storage';
10 |
11 | @Component({
12 | selector: 'page-login',
13 | templateUrl: 'login.html'
14 | })
15 | export class LoginPage {
16 | userName: string = '';
17 | passWord: string = '';
18 | isShow: boolean = false;
19 |
20 | constructor(
21 | public navCtrl: NavController,
22 | public events: Events,
23 | public storage: Storage
24 | ){
25 | // this.invalidate();
26 | }
27 | // login:{
28 | // userName:'' ,
29 | // passWord:''
30 | // }
31 |
32 | // invalidate(){
33 | // let validator:RegExp = /^[A-Za-z0-9]{6,32}$/;
34 | // let userValid = validator.test(this.userName);
35 | // let pasValid = validator.test(this.passWord);
36 | // if(userValid&&pasValid){
37 | // this.isShow = !this.isShow;
38 | // console.log("validating...")
39 | // }
40 | // }
41 |
42 | onlogin(userName:HTMLInputElement,passWord:HTMLInputElement){
43 | let validator:RegExp = /^[A-Za-z0-9]{6,32}$/;
44 | let userValid = validator.test(userName.value);
45 | let pasValid = validator.test(passWord.value);
46 | if(userValid&&pasValid){
47 | console.log(userName.value);
48 | this.isShow = false;
49 | this.storage.set('token', userName.value).then(()=>{
50 | console.log('Stored token: ' + userName.value);
51 | });
52 | this.events.publish('user:login', {
53 | //token: 'succed'
54 | });
55 | }else{
56 | this.isShow = true;
57 | }
58 | }
59 | onSubmit(form) {
60 | //debugger
61 | console.log(form.value); // { first: '', last: '' }
62 | //console.log(form.valid); // false
63 | }
64 |
65 | }
66 |
--------------------------------------------------------------------------------
/src/pages/search/search.html:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | {{ item }}
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/pages/search/search.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { IonicPageModule } from 'ionic-angular';
3 | import { SearchPage } from './search';
4 |
5 | @NgModule({
6 | declarations: [
7 | SearchPage,
8 | ],
9 | imports: [
10 | IonicPageModule.forChild(SearchPage),
11 | ],
12 | })
13 | export class SearchPageModule {}
14 |
--------------------------------------------------------------------------------
/src/pages/search/search.scss:
--------------------------------------------------------------------------------
1 | page-search {
2 | .search-box{
3 | display: flex;
4 | align-items:flex-start;
5 | width:100%;
6 | height:70px;
7 | line-height: 100px;
8 | //background:rgba(0, 0, 0, 0.2)
9 | }
10 | .searchbar-md{
11 | background:rgba(0, 0, 0, 0.2);
12 | }
13 | .searchbar-input-container{
14 | width: 75%;
15 | background:rgba(0, 0, 0, 0.0);
16 | }
17 | .back-btn{
18 | position: absolute;
19 | top:20px;
20 | right: 0;
21 | width:100px;
22 | background:rgba(0, 0, 0, 0.0);
23 | font-size: 16px;
24 | color: #488aff;
25 | }
26 | input{
27 | color: #cccccc;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/pages/search/search.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { IonicPage, NavController, NavParams } from 'ionic-angular';
3 |
4 | /**
5 | * Generated class for the SearchPage page.
6 | *
7 | * See https://ionicframework.com/docs/components/#navigation for more info on
8 | * Ionic pages and navigation.
9 | */
10 |
11 | @IonicPage()
12 | @Component({
13 | selector: 'page-search',
14 | templateUrl: 'search.html',
15 | })
16 | export class SearchPage {
17 |
18 | searchQuery: string = '';
19 | items:string[];
20 |
21 | constructor(
22 | public navCtrl: NavController,
23 | public navParams: NavParams
24 | ){
25 | this.initializeItems();
26 | }
27 |
28 | ionViewDidLoad() {
29 | console.log('ionViewDidLoad SearchPage');
30 | }
31 |
32 | initializeItems(){
33 | this.items = [
34 | 'Amsterdam',
35 | 'Bogota',
36 | 'nurdun',
37 | 'andysh'
38 | ];
39 | }
40 |
41 | getItems(event:any){
42 | //Reset items back to all of the items
43 | this.initializeItems();
44 |
45 | //set val to the value of the searchbar
46 | let val = event.target.value;
47 |
48 | //if the value is an empty string dont`t filter the items
49 | if(val && val.trim()!=''){
50 | this.items = this.items.filter((item)=>{
51 | return (item.toLowerCase().indexOf(val.toLowerCase()) > -1);
52 | })
53 | }
54 | }
55 |
56 | //返回到主页面
57 | goBack(){
58 | this.navCtrl.pop()
59 | }
60 |
61 | }
62 |
--------------------------------------------------------------------------------
/src/pages/tabs/tabs.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src/pages/tabs/tabs.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 |
3 | import { AboutPage } from '../about/about';
4 | import { UserPage } from '../user/user';
5 | import { HomePage } from '../home/home';
6 |
7 | @Component({
8 | templateUrl: 'tabs.html'
9 | })
10 | export class TabsPage {
11 |
12 | tab1Root = HomePage;
13 | tab2Root = AboutPage;
14 | tab3Root = UserPage;
15 |
16 | constructor() {
17 |
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/pages/user/user.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Contact
5 |
6 |
7 |
8 |
9 |
10 |
11 | Follow us on Twitter
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/src/pages/user/user.scss:
--------------------------------------------------------------------------------
1 | page-user {
2 | button{
3 | width: 200px;
4 | height: 40px !important;
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/pages/user/user.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { NavController } from 'ionic-angular';
3 | import { Events } from 'ionic-angular';
4 | import { Storage } from '@ionic/storage';
5 |
6 | @Component({
7 | selector: 'page-user',
8 | templateUrl: 'user.html'
9 | })
10 | export class UserPage {
11 |
12 | constructor(
13 | public navCtrl: NavController,
14 | public storage:Storage,
15 | public events:Events
16 | ) {
17 |
18 | }
19 | //点击登出按钮时返回到登录页面
20 | //并且清理token
21 | logout(){
22 | this.storage.set('token', '').then(()=>{
23 | console.log('token was cleaned');
24 | });
25 | this.events.publish('user:logout', {
26 | //token: 'succed'
27 | });
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/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/vendor.js',
19 | './build/main.css',
20 | './build/polyfills.js',
21 | 'index.html',
22 | 'manifest.json'
23 | ]
24 | );
25 |
26 | // dynamically cache any other local assets
27 | self.toolbox.router.any('/*', self.toolbox.cacheFirst);
28 |
29 | // for any other requests go to the network, cache,
30 | // and then only use that cached resource if your user goes offline
31 | self.toolbox.router.default = self.toolbox.networkFirst;
32 |
--------------------------------------------------------------------------------
/src/theme/variables.scss:
--------------------------------------------------------------------------------
1 | // Ionic Variables and Theming. For more info, please see:
2 | // http://ionicframework.com/docs/theming/
3 |
4 | // Font path is used to include ionicons,
5 | // roboto, and noto sans fonts
6 | $font-path: "../assets/fonts";
7 |
8 |
9 | // The app direction is used to include
10 | // rtl styles in your app. For more info, please see:
11 | // http://ionicframework.com/docs/theming/rtl-support/
12 | $app-direction: ltr;
13 |
14 |
15 | @import "ionic.globals";
16 |
17 |
18 | // Shared Variables
19 | // --------------------------------------------------
20 | // To customize the look and feel of this app, you can override
21 | // the Sass variables found in Ionic's source scss files.
22 | // To view all the possible Ionic variables, see:
23 | // http://ionicframework.com/docs/theming/overriding-ionic-variables/
24 |
25 |
26 |
27 |
28 | // Named Color Variables
29 | // --------------------------------------------------
30 | // Named colors makes it easy to reuse colors on various components.
31 | // It's highly recommended to change the default colors
32 | // to match your app's branding. Ionic uses a Sass map of
33 | // colors so you can add, rename and remove colors as needed.
34 | // The "primary" color is the only required color in the map.
35 |
36 | $colors: (
37 | primary: #488aff,
38 | secondary: #32db64,
39 | danger: #f53d3d,
40 | light: #f4f4f4,
41 | dark: #222
42 | );
43 |
44 |
45 | // App iOS Variables
46 | // --------------------------------------------------
47 | // iOS only Sass variables can go here
48 |
49 |
50 |
51 |
52 | // App Material Design Variables
53 | // --------------------------------------------------
54 | // Material Design only Sass variables can go here
55 |
56 |
57 |
58 |
59 | // App Windows Variables
60 | // --------------------------------------------------
61 | // Windows only Sass variables can go here
62 |
63 |
64 |
65 |
66 | // App Theme
67 | // --------------------------------------------------
68 | // Ionic apps can have different themes applied, which can
69 | // then be future customized. This import comes last
70 | // so that the above variables are used and Ionic's
71 | // default are overridden.
72 |
73 | @import "ionic.theme.default";
74 |
75 |
76 | // Ionicons
77 | // --------------------------------------------------
78 | // The premium icon font for Ionic. For more info, please see:
79 | // http://ionicframework.com/docs/ionicons/
80 |
81 | @import "ionic.ionicons";
82 |
83 |
84 | // Fonts
85 | // --------------------------------------------------
86 |
87 | @import "roboto";
88 | @import "noto-sans";
89 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------