├── .editorconfig ├── .gitignore ├── config.xml ├── cordova ├── 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 ├── 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 ├── src ├── app │ ├── app.component.ts │ ├── app.html │ ├── app.module.ts │ ├── app.scss │ └── main.ts ├── assets │ ├── icon │ │ └── favicon.ico │ └── imgs │ │ ├── avatar-blank.png │ │ ├── logo.png │ │ ├── prod.jpg │ │ └── tela-inicial.png ├── config │ ├── api.config.ts │ └── storage_keys.config.ts ├── index.html ├── interceptors │ ├── auth-interceptor.ts │ └── error-interceptor.ts ├── manifest.json ├── models │ ├── cart-item.ts │ ├── cart.ts │ ├── categoria.dto.ts │ ├── cidade.dto.ts │ ├── cliente.dto.ts │ ├── credenciais.dto.ts │ ├── endereco.dto.ts │ ├── estado.dto.ts │ ├── fieldmessage.ts │ ├── item-pedido.dto.ts │ ├── local_user.ts │ ├── pagamento.dto.ts │ ├── pedido.dto.ts │ ├── produto.dto.ts │ └── ref.dto.ts ├── pages │ ├── cart │ │ ├── cart.html │ │ ├── cart.module.ts │ │ ├── cart.scss │ │ └── cart.ts │ ├── categorias │ │ ├── categorias.html │ │ ├── categorias.module.ts │ │ ├── categorias.scss │ │ └── categorias.ts │ ├── home │ │ ├── home.html │ │ ├── home.module.ts │ │ ├── home.scss │ │ └── home.ts │ ├── order-confirmation │ │ ├── order-confirmation.html │ │ ├── order-confirmation.module.ts │ │ ├── order-confirmation.scss │ │ └── order-confirmation.ts │ ├── payment │ │ ├── payment.html │ │ ├── payment.module.ts │ │ ├── payment.scss │ │ └── payment.ts │ ├── pick-address │ │ ├── pick-address.html │ │ ├── pick-address.module.ts │ │ ├── pick-address.scss │ │ └── pick-address.ts │ ├── produto-detail │ │ ├── produto-detail.html │ │ ├── produto-detail.module.ts │ │ ├── produto-detail.scss │ │ └── produto-detail.ts │ ├── produtos │ │ ├── produtos.html │ │ ├── produtos.module.ts │ │ ├── produtos.scss │ │ └── produtos.ts │ ├── profile │ │ ├── profile.html │ │ ├── profile.module.ts │ │ ├── profile.scss │ │ └── profile.ts │ └── signup │ │ ├── signup.html │ │ ├── signup.module.ts │ │ ├── signup.scss │ │ └── signup.ts ├── service-worker.js ├── services │ ├── auth.service.ts │ ├── domain │ │ ├── cart.service.ts │ │ ├── categoria.service.ts │ │ ├── cidade.service.ts │ │ ├── cliente.service.ts │ │ ├── estado.service.ts │ │ ├── pedido.service.ts │ │ └── produto.service.ts │ ├── image-util.service.ts │ └── storage.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 | .vs/ 14 | npm-debug.log* 15 | 16 | .idea/ 17 | .sourcemaps/ 18 | .sass-cache/ 19 | .tmp/ 20 | .versions/ 21 | coverage/ 22 | dist/ 23 | node_modules/ 24 | tmp/ 25 | temp/ 26 | hooks/ 27 | platforms/ 28 | plugins/ 29 | plugins/android.json 30 | plugins/ios.json 31 | www/ 32 | $RECYCLE.BIN/ 33 | 34 | .DS_Store 35 | Thumbs.db 36 | UserInterfaceState.xcuserstate 37 | -------------------------------------------------------------------------------- /config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Sistema de Pedidos 4 | Um estudo de caso sobre Spring Boot e Ionic 5 | Professor Nelio Alves 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 | -------------------------------------------------------------------------------- /cordova: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acenelio/curso-spring-ionic-frontend/4a801564d6e6a2e2515d7ec4ba0d6e1217fa0e7f/cordova -------------------------------------------------------------------------------- /ionic.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "CursoSpringIonic", 3 | "app_id": "", 4 | "type": "ionic-angular", 5 | "integrations": { 6 | "cordova": {} 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "CursoSpringIonic", 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.0.3", 16 | "@angular/compiler": "5.0.3", 17 | "@angular/compiler-cli": "5.0.3", 18 | "@angular/core": "5.0.3", 19 | "@angular/forms": "5.0.3", 20 | "@angular/http": "5.0.3", 21 | "@angular/platform-browser": "5.0.3", 22 | "@angular/platform-browser-dynamic": "5.0.3", 23 | "@ionic-native/camera": "^4.5.3", 24 | "@ionic-native/core": "4.4.0", 25 | "@ionic-native/splash-screen": "4.4.0", 26 | "@ionic-native/status-bar": "4.4.0", 27 | "@ionic/storage": "2.1.3", 28 | "angular2-jwt": "^0.2.3", 29 | "cordova-android": "6.3.0", 30 | "cordova-browser": "5.0.3", 31 | "cordova-plugin-camera": "^4.0.2", 32 | "cordova-plugin-device": "^1.1.7", 33 | "cordova-plugin-ionic-webview": "^1.1.16", 34 | "cordova-plugin-splashscreen": "^4.1.0", 35 | "cordova-plugin-whitelist": "^1.3.3", 36 | "ionic-angular": "3.9.2", 37 | "ionic-plugin-keyboard": "^2.2.1", 38 | "ionicons": "3.0.0", 39 | "rxjs": "5.5.2", 40 | "sw-toolbox": "3.6.0", 41 | "zone.js": "0.8.18" 42 | }, 43 | "devDependencies": { 44 | "@ionic/app-scripts": "3.1.6", 45 | "typescript": "2.4.2" 46 | }, 47 | "description": "An Ionic project", 48 | "cordova": { 49 | "plugins": { 50 | "ionic-plugin-keyboard": {}, 51 | "cordova-plugin-whitelist": {}, 52 | "cordova-plugin-device": {}, 53 | "cordova-plugin-splashscreen": {}, 54 | "cordova-plugin-ionic-webview": {}, 55 | "cordova-plugin-camera": {} 56 | }, 57 | "platforms": [ 58 | "browser", 59 | "android" 60 | ] 61 | } 62 | } -------------------------------------------------------------------------------- /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/acenelio/curso-spring-ionic-frontend/4a801564d6e6a2e2515d7ec4ba0d6e1217fa0e7f/resources/android/icon/drawable-hdpi-icon.png -------------------------------------------------------------------------------- /resources/android/icon/drawable-ldpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acenelio/curso-spring-ionic-frontend/4a801564d6e6a2e2515d7ec4ba0d6e1217fa0e7f/resources/android/icon/drawable-ldpi-icon.png -------------------------------------------------------------------------------- /resources/android/icon/drawable-mdpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acenelio/curso-spring-ionic-frontend/4a801564d6e6a2e2515d7ec4ba0d6e1217fa0e7f/resources/android/icon/drawable-mdpi-icon.png -------------------------------------------------------------------------------- /resources/android/icon/drawable-xhdpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acenelio/curso-spring-ionic-frontend/4a801564d6e6a2e2515d7ec4ba0d6e1217fa0e7f/resources/android/icon/drawable-xhdpi-icon.png -------------------------------------------------------------------------------- /resources/android/icon/drawable-xxhdpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acenelio/curso-spring-ionic-frontend/4a801564d6e6a2e2515d7ec4ba0d6e1217fa0e7f/resources/android/icon/drawable-xxhdpi-icon.png -------------------------------------------------------------------------------- /resources/android/icon/drawable-xxxhdpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acenelio/curso-spring-ionic-frontend/4a801564d6e6a2e2515d7ec4ba0d6e1217fa0e7f/resources/android/icon/drawable-xxxhdpi-icon.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-land-hdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acenelio/curso-spring-ionic-frontend/4a801564d6e6a2e2515d7ec4ba0d6e1217fa0e7f/resources/android/splash/drawable-land-hdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-land-ldpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acenelio/curso-spring-ionic-frontend/4a801564d6e6a2e2515d7ec4ba0d6e1217fa0e7f/resources/android/splash/drawable-land-ldpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-land-mdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acenelio/curso-spring-ionic-frontend/4a801564d6e6a2e2515d7ec4ba0d6e1217fa0e7f/resources/android/splash/drawable-land-mdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-land-xhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acenelio/curso-spring-ionic-frontend/4a801564d6e6a2e2515d7ec4ba0d6e1217fa0e7f/resources/android/splash/drawable-land-xhdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-land-xxhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acenelio/curso-spring-ionic-frontend/4a801564d6e6a2e2515d7ec4ba0d6e1217fa0e7f/resources/android/splash/drawable-land-xxhdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-land-xxxhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acenelio/curso-spring-ionic-frontend/4a801564d6e6a2e2515d7ec4ba0d6e1217fa0e7f/resources/android/splash/drawable-land-xxxhdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-port-hdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acenelio/curso-spring-ionic-frontend/4a801564d6e6a2e2515d7ec4ba0d6e1217fa0e7f/resources/android/splash/drawable-port-hdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-port-ldpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acenelio/curso-spring-ionic-frontend/4a801564d6e6a2e2515d7ec4ba0d6e1217fa0e7f/resources/android/splash/drawable-port-ldpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-port-mdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acenelio/curso-spring-ionic-frontend/4a801564d6e6a2e2515d7ec4ba0d6e1217fa0e7f/resources/android/splash/drawable-port-mdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-port-xhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acenelio/curso-spring-ionic-frontend/4a801564d6e6a2e2515d7ec4ba0d6e1217fa0e7f/resources/android/splash/drawable-port-xhdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-port-xxhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acenelio/curso-spring-ionic-frontend/4a801564d6e6a2e2515d7ec4ba0d6e1217fa0e7f/resources/android/splash/drawable-port-xxhdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-port-xxxhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acenelio/curso-spring-ionic-frontend/4a801564d6e6a2e2515d7ec4ba0d6e1217fa0e7f/resources/android/splash/drawable-port-xxxhdpi-screen.png -------------------------------------------------------------------------------- /resources/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acenelio/curso-spring-ionic-frontend/4a801564d6e6a2e2515d7ec4ba0d6e1217fa0e7f/resources/icon.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acenelio/curso-spring-ionic-frontend/4a801564d6e6a2e2515d7ec4ba0d6e1217fa0e7f/resources/ios/icon/icon-1024.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acenelio/curso-spring-ionic-frontend/4a801564d6e6a2e2515d7ec4ba0d6e1217fa0e7f/resources/ios/icon/icon-40.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acenelio/curso-spring-ionic-frontend/4a801564d6e6a2e2515d7ec4ba0d6e1217fa0e7f/resources/ios/icon/icon-40@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acenelio/curso-spring-ionic-frontend/4a801564d6e6a2e2515d7ec4ba0d6e1217fa0e7f/resources/ios/icon/icon-40@3x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acenelio/curso-spring-ionic-frontend/4a801564d6e6a2e2515d7ec4ba0d6e1217fa0e7f/resources/ios/icon/icon-50.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-50@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acenelio/curso-spring-ionic-frontend/4a801564d6e6a2e2515d7ec4ba0d6e1217fa0e7f/resources/ios/icon/icon-50@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acenelio/curso-spring-ionic-frontend/4a801564d6e6a2e2515d7ec4ba0d6e1217fa0e7f/resources/ios/icon/icon-60.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acenelio/curso-spring-ionic-frontend/4a801564d6e6a2e2515d7ec4ba0d6e1217fa0e7f/resources/ios/icon/icon-60@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acenelio/curso-spring-ionic-frontend/4a801564d6e6a2e2515d7ec4ba0d6e1217fa0e7f/resources/ios/icon/icon-60@3x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acenelio/curso-spring-ionic-frontend/4a801564d6e6a2e2515d7ec4ba0d6e1217fa0e7f/resources/ios/icon/icon-72.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-72@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acenelio/curso-spring-ionic-frontend/4a801564d6e6a2e2515d7ec4ba0d6e1217fa0e7f/resources/ios/icon/icon-72@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acenelio/curso-spring-ionic-frontend/4a801564d6e6a2e2515d7ec4ba0d6e1217fa0e7f/resources/ios/icon/icon-76.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acenelio/curso-spring-ionic-frontend/4a801564d6e6a2e2515d7ec4ba0d6e1217fa0e7f/resources/ios/icon/icon-76@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acenelio/curso-spring-ionic-frontend/4a801564d6e6a2e2515d7ec4ba0d6e1217fa0e7f/resources/ios/icon/icon-83.5@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acenelio/curso-spring-ionic-frontend/4a801564d6e6a2e2515d7ec4ba0d6e1217fa0e7f/resources/ios/icon/icon-small.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-small@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acenelio/curso-spring-ionic-frontend/4a801564d6e6a2e2515d7ec4ba0d6e1217fa0e7f/resources/ios/icon/icon-small@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-small@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acenelio/curso-spring-ionic-frontend/4a801564d6e6a2e2515d7ec4ba0d6e1217fa0e7f/resources/ios/icon/icon-small@3x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acenelio/curso-spring-ionic-frontend/4a801564d6e6a2e2515d7ec4ba0d6e1217fa0e7f/resources/ios/icon/icon.png -------------------------------------------------------------------------------- /resources/ios/icon/icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acenelio/curso-spring-ionic-frontend/4a801564d6e6a2e2515d7ec4ba0d6e1217fa0e7f/resources/ios/icon/icon@2x.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-568h@2x~iphone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acenelio/curso-spring-ionic-frontend/4a801564d6e6a2e2515d7ec4ba0d6e1217fa0e7f/resources/ios/splash/Default-568h@2x~iphone.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-667h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acenelio/curso-spring-ionic-frontend/4a801564d6e6a2e2515d7ec4ba0d6e1217fa0e7f/resources/ios/splash/Default-667h.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-736h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acenelio/curso-spring-ionic-frontend/4a801564d6e6a2e2515d7ec4ba0d6e1217fa0e7f/resources/ios/splash/Default-736h.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-Landscape-736h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acenelio/curso-spring-ionic-frontend/4a801564d6e6a2e2515d7ec4ba0d6e1217fa0e7f/resources/ios/splash/Default-Landscape-736h.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-Landscape@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acenelio/curso-spring-ionic-frontend/4a801564d6e6a2e2515d7ec4ba0d6e1217fa0e7f/resources/ios/splash/Default-Landscape@2x~ipad.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-Landscape@~ipadpro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acenelio/curso-spring-ionic-frontend/4a801564d6e6a2e2515d7ec4ba0d6e1217fa0e7f/resources/ios/splash/Default-Landscape@~ipadpro.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-Landscape~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acenelio/curso-spring-ionic-frontend/4a801564d6e6a2e2515d7ec4ba0d6e1217fa0e7f/resources/ios/splash/Default-Landscape~ipad.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-Portrait@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acenelio/curso-spring-ionic-frontend/4a801564d6e6a2e2515d7ec4ba0d6e1217fa0e7f/resources/ios/splash/Default-Portrait@2x~ipad.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-Portrait@~ipadpro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acenelio/curso-spring-ionic-frontend/4a801564d6e6a2e2515d7ec4ba0d6e1217fa0e7f/resources/ios/splash/Default-Portrait@~ipadpro.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-Portrait~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acenelio/curso-spring-ionic-frontend/4a801564d6e6a2e2515d7ec4ba0d6e1217fa0e7f/resources/ios/splash/Default-Portrait~ipad.png -------------------------------------------------------------------------------- /resources/ios/splash/Default@2x~iphone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acenelio/curso-spring-ionic-frontend/4a801564d6e6a2e2515d7ec4ba0d6e1217fa0e7f/resources/ios/splash/Default@2x~iphone.png -------------------------------------------------------------------------------- /resources/ios/splash/Default@2x~universal~anyany.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acenelio/curso-spring-ionic-frontend/4a801564d6e6a2e2515d7ec4ba0d6e1217fa0e7f/resources/ios/splash/Default@2x~universal~anyany.png -------------------------------------------------------------------------------- /resources/ios/splash/Default~iphone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acenelio/curso-spring-ionic-frontend/4a801564d6e6a2e2515d7ec4ba0d6e1217fa0e7f/resources/ios/splash/Default~iphone.png -------------------------------------------------------------------------------- /resources/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acenelio/curso-spring-ionic-frontend/4a801564d6e6a2e2515d7ec4ba0d6e1217fa0e7f/resources/splash.png -------------------------------------------------------------------------------- /src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, ViewChild } from '@angular/core'; 2 | import { Nav, Platform } from 'ionic-angular'; 3 | import { StatusBar } from '@ionic-native/status-bar'; 4 | import { SplashScreen } from '@ionic-native/splash-screen'; 5 | import { AuthService } from '../services/auth.service'; 6 | 7 | @Component({ 8 | templateUrl: 'app.html' 9 | }) 10 | export class MyApp { 11 | @ViewChild(Nav) nav: Nav; 12 | 13 | rootPage: string = 'HomePage'; 14 | 15 | pages: Array<{title: string, component: string}>; 16 | 17 | constructor( 18 | public platform: Platform, 19 | public statusBar: StatusBar, 20 | public splashScreen: SplashScreen, 21 | public auth: AuthService 22 | ) { 23 | this.initializeApp(); 24 | 25 | // used for an example of ngFor and navigation 26 | this.pages = [ 27 | { title: 'Profile', component: 'ProfilePage' }, 28 | { title: 'Categorias', component: 'CategoriasPage' }, 29 | { title: 'Carrinho', component: 'CartPage'}, 30 | { title: 'Logout', component: ''} 31 | ]; 32 | 33 | } 34 | 35 | initializeApp() { 36 | this.platform.ready().then(() => { 37 | // Okay, so the platform is ready and our plugins are available. 38 | // Here you can do any higher level native things you might need. 39 | this.statusBar.styleDefault(); 40 | this.splashScreen.hide(); 41 | }); 42 | } 43 | 44 | openPage(page : {title:string, component:string}) { 45 | 46 | switch (page.title) { 47 | case 'Logout': 48 | this.auth.logout(); 49 | this.nav.setRoot('HomePage'); 50 | break; 51 | 52 | default: 53 | this.nav.setRoot(page.component); 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/app/app.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Menu 5 | 6 | 7 | 8 | 9 | 10 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { HttpClientModule } from '@angular/common/http'; 3 | import { ErrorHandler, NgModule } from '@angular/core'; 4 | import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular'; 5 | 6 | import { MyApp } from './app.component'; 7 | 8 | import { StatusBar } from '@ionic-native/status-bar'; 9 | import { SplashScreen } from '@ionic-native/splash-screen'; 10 | import { CategoriaService } from '../services/domain/categoria.service'; 11 | import { ErrorInterceptorProvider } from '../interceptors/error-interceptor'; 12 | import { AuthService } from '../services/auth.service'; 13 | import { StorageService } from '../services/storage.service'; 14 | import { ClienteService } from '../services/domain/cliente.service'; 15 | import { AuthInterceptorProvider } from '../interceptors/auth-interceptor'; 16 | import { ProdutoService } from '../services/domain/produto.service'; 17 | import { CartService } from '../services/domain/cart.service'; 18 | import { ImageUtilService } from '../services/image-util.service'; 19 | 20 | @NgModule({ 21 | declarations: [ 22 | MyApp 23 | ], 24 | imports: [ 25 | BrowserModule, 26 | HttpClientModule, 27 | IonicModule.forRoot(MyApp), 28 | ], 29 | bootstrap: [IonicApp], 30 | entryComponents: [ 31 | MyApp 32 | ], 33 | providers: [ 34 | StatusBar, 35 | SplashScreen, 36 | {provide: ErrorHandler, useClass: IonicErrorHandler}, 37 | CategoriaService, 38 | AuthInterceptorProvider, 39 | ErrorInterceptorProvider, 40 | AuthService, 41 | StorageService, 42 | ClienteService, 43 | ProdutoService, 44 | CartService, 45 | ImageUtilService 46 | ] 47 | }) 48 | export class AppModule {} 49 | -------------------------------------------------------------------------------- /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/acenelio/curso-spring-ionic-frontend/4a801564d6e6a2e2515d7ec4ba0d6e1217fa0e7f/src/assets/icon/favicon.ico -------------------------------------------------------------------------------- /src/assets/imgs/avatar-blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acenelio/curso-spring-ionic-frontend/4a801564d6e6a2e2515d7ec4ba0d6e1217fa0e7f/src/assets/imgs/avatar-blank.png -------------------------------------------------------------------------------- /src/assets/imgs/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acenelio/curso-spring-ionic-frontend/4a801564d6e6a2e2515d7ec4ba0d6e1217fa0e7f/src/assets/imgs/logo.png -------------------------------------------------------------------------------- /src/assets/imgs/prod.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acenelio/curso-spring-ionic-frontend/4a801564d6e6a2e2515d7ec4ba0d6e1217fa0e7f/src/assets/imgs/prod.jpg -------------------------------------------------------------------------------- /src/assets/imgs/tela-inicial.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acenelio/curso-spring-ionic-frontend/4a801564d6e6a2e2515d7ec4ba0d6e1217fa0e7f/src/assets/imgs/tela-inicial.png -------------------------------------------------------------------------------- /src/config/api.config.ts: -------------------------------------------------------------------------------- 1 | export const API_CONFIG = { 2 | baseUrl: "https://spring-ionic-nelio.herokuapp.com", 3 | bucketBaseUrl: "https://s3-sa-east-1.amazonaws.com/curso-spring-ionic" 4 | } 5 | -------------------------------------------------------------------------------- /src/config/storage_keys.config.ts: -------------------------------------------------------------------------------- 1 | export const STORAGE_KEYS = { 2 | localUser: "localUser", 3 | cart: "cursoSpringIonicCart" 4 | } 5 | -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Ionic App 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /src/interceptors/auth-interceptor.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { HttpEvent, HttpInterceptor, HttpHandler, HttpRequest, HTTP_INTERCEPTORS } from '@angular/common/http'; 3 | import { Observable } from 'rxjs/Rx'; // IMPORTANTE: IMPORT ATUALIZADO 4 | import { StorageService } from '../services/storage.service'; 5 | import { API_CONFIG } from '../config/api.config'; 6 | 7 | @Injectable() 8 | export class AuthInterceptor implements HttpInterceptor { 9 | 10 | constructor(public storage: StorageService) { 11 | } 12 | 13 | intercept(req: HttpRequest, next: HttpHandler): Observable> { 14 | 15 | let localUser = this.storage.getLocalUser(); 16 | 17 | let N = API_CONFIG.baseUrl.length; 18 | let requestToAPI = req.url.substring(0, N) == API_CONFIG.baseUrl; 19 | 20 | if (localUser && requestToAPI) { 21 | const authReq = req.clone({headers: req.headers.set('Authorization', 'Bearer ' + localUser.token)}); 22 | return next.handle(authReq); 23 | } 24 | else { 25 | return next.handle(req); 26 | } 27 | } 28 | } 29 | 30 | export const AuthInterceptorProvider = { 31 | provide: HTTP_INTERCEPTORS, 32 | useClass: AuthInterceptor, 33 | multi: true, 34 | }; 35 | -------------------------------------------------------------------------------- /src/interceptors/error-interceptor.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { HttpEvent, HttpInterceptor, HttpHandler, HttpRequest, HTTP_INTERCEPTORS } from '@angular/common/http'; 3 | import { Observable } from 'rxjs/Rx'; // IMPORTANTE: IMPORT ATUALIZADO 4 | import { StorageService } from '../services/storage.service'; 5 | import { AlertController } from 'ionic-angular/components/alert/alert-controller'; 6 | import { FieldMessage } from '../models/fieldmessage'; 7 | 8 | @Injectable() 9 | export class ErrorInterceptor implements HttpInterceptor { 10 | 11 | constructor(public storage: StorageService, public alertCtrl: AlertController) { 12 | } 13 | 14 | intercept(req: HttpRequest, next: HttpHandler): Observable> { 15 | return next.handle(req) 16 | .catch((error, caught) => { 17 | 18 | let errorObj = error; 19 | if (errorObj.error) { 20 | errorObj = errorObj.error; 21 | } 22 | if (!errorObj.status) { 23 | errorObj = JSON.parse(errorObj); 24 | } 25 | 26 | console.log("Erro detectado pelo interceptor:"); 27 | console.log(errorObj); 28 | 29 | switch(errorObj.status) { 30 | case 401: 31 | this.handle401(); 32 | break; 33 | 34 | case 403: 35 | this.handle403(); 36 | break; 37 | 38 | case 422: 39 | this.handle422(errorObj); 40 | break; 41 | 42 | default: 43 | this.handleDefaultEror(errorObj); 44 | } 45 | 46 | return Observable.throw(errorObj); 47 | }) as any; 48 | } 49 | 50 | handle403() { 51 | this.storage.setLocalUser(null); 52 | } 53 | 54 | handle401() { 55 | let alert = this.alertCtrl.create({ 56 | title: 'Erro 401: falha de autenticação', 57 | message: 'Email ou senha incorretos', 58 | enableBackdropDismiss: false, 59 | buttons: [ 60 | { 61 | text: 'Ok' 62 | } 63 | ] 64 | }); 65 | alert.present(); 66 | } 67 | 68 | handle422(errorObj) { 69 | let alert = this.alertCtrl.create({ 70 | title: 'Erro 422: Validação', 71 | message: this.listErrors(errorObj.errors), 72 | enableBackdropDismiss: false, 73 | buttons: [ 74 | { 75 | text: 'Ok' 76 | } 77 | ] 78 | }); 79 | alert.present(); 80 | } 81 | 82 | handleDefaultEror(errorObj) { 83 | let alert = this.alertCtrl.create({ 84 | title: 'Erro ' + errorObj.status + ': ' + errorObj.error, 85 | message: errorObj.message, 86 | enableBackdropDismiss: false, 87 | buttons: [ 88 | { 89 | text: 'Ok' 90 | } 91 | ] 92 | }); 93 | alert.present(); 94 | } 95 | 96 | private listErrors(messages : FieldMessage[]) : string { 97 | let s : string = ''; 98 | for (var i=0; i' + messages[i].fieldName + ": " + messages[i].message + '

'; 100 | } 101 | return s; 102 | } 103 | } 104 | 105 | export const ErrorInterceptorProvider = { 106 | provide: HTTP_INTERCEPTORS, 107 | useClass: ErrorInterceptor, 108 | multi: true, 109 | }; 110 | -------------------------------------------------------------------------------- /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/models/cart-item.ts: -------------------------------------------------------------------------------- 1 | import { ProdutoDTO } from "./produto.dto"; 2 | 3 | export interface CartItem { 4 | quantidade: number, 5 | produto: ProdutoDTO 6 | } 7 | -------------------------------------------------------------------------------- /src/models/cart.ts: -------------------------------------------------------------------------------- 1 | import { CartItem } from "./cart-item"; 2 | 3 | export interface Cart { 4 | items: CartItem[] 5 | } 6 | -------------------------------------------------------------------------------- /src/models/categoria.dto.ts: -------------------------------------------------------------------------------- 1 | export interface CategoriaDTO { 2 | id : string; 3 | nome : string; 4 | } 5 | -------------------------------------------------------------------------------- /src/models/cidade.dto.ts: -------------------------------------------------------------------------------- 1 | import { EstadoDTO } from "./estado.dto"; 2 | 3 | export interface CidadeDTO { 4 | id : string; 5 | nome : string; 6 | estado? : EstadoDTO; 7 | } 8 | -------------------------------------------------------------------------------- /src/models/cliente.dto.ts: -------------------------------------------------------------------------------- 1 | export interface ClienteDTO { 2 | id : string; 3 | nome : string; 4 | email : string; 5 | imageUrl? : string; 6 | } 7 | -------------------------------------------------------------------------------- /src/models/credenciais.dto.ts: -------------------------------------------------------------------------------- 1 | export interface CredenciaisDTO { 2 | email : string; 3 | senha : string; 4 | } 5 | -------------------------------------------------------------------------------- /src/models/endereco.dto.ts: -------------------------------------------------------------------------------- 1 | import { CidadeDTO } from "./cidade.dto"; 2 | 3 | export interface EnderecoDTO { 4 | id : string; 5 | logradouro : string; 6 | numero : string; 7 | complemento : string; 8 | bairro : string; 9 | cep : string; 10 | cidade : CidadeDTO; 11 | } 12 | -------------------------------------------------------------------------------- /src/models/estado.dto.ts: -------------------------------------------------------------------------------- 1 | export interface EstadoDTO { 2 | id : string; 3 | nome : string; 4 | } 5 | -------------------------------------------------------------------------------- /src/models/fieldmessage.ts: -------------------------------------------------------------------------------- 1 | export interface FieldMessage { 2 | fieldName : string; 3 | message : string; 4 | } 5 | -------------------------------------------------------------------------------- /src/models/item-pedido.dto.ts: -------------------------------------------------------------------------------- 1 | import { RefDTO } from "./ref.dto"; 2 | 3 | export interface ItemPedidoDTO { 4 | quantidade: number; 5 | produto: RefDTO; 6 | } -------------------------------------------------------------------------------- /src/models/local_user.ts: -------------------------------------------------------------------------------- 1 | export interface LocalUser { 2 | token: string; 3 | email: string; 4 | } 5 | -------------------------------------------------------------------------------- /src/models/pagamento.dto.ts: -------------------------------------------------------------------------------- 1 | export interface PagamentoDTO { 2 | numeroDeParcelas : number; 3 | "@type" : string; 4 | } -------------------------------------------------------------------------------- /src/models/pedido.dto.ts: -------------------------------------------------------------------------------- 1 | import { RefDTO } from "./ref.dto"; 2 | import { PagamentoDTO } from "./pagamento.dto"; 3 | import { ItemPedidoDTO } from "./item-pedido.dto"; 4 | 5 | export interface PedidoDTO { 6 | cliente: RefDTO; 7 | enderecoDeEntrega: RefDTO; 8 | pagamento: PagamentoDTO; 9 | itens: ItemPedidoDTO[]; 10 | } 11 | -------------------------------------------------------------------------------- /src/models/produto.dto.ts: -------------------------------------------------------------------------------- 1 | export interface ProdutoDTO { 2 | id : string; 3 | nome : string; 4 | preco : number; 5 | imageUrl? : string; 6 | } 7 | -------------------------------------------------------------------------------- /src/models/ref.dto.ts: -------------------------------------------------------------------------------- 1 | export interface RefDTO { 2 | id : string; 3 | } -------------------------------------------------------------------------------- /src/pages/cart/cart.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | Cart 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |

{{item.produto.nome}}

17 |

{{item.produto.preco | currency}}

18 | 19 |

{{item.quantidade}}

20 | 21 | 22 |
23 | 24 |

Total

25 |

{{total()}}

26 |
27 | 28 |

Seu carrinho está vazio

29 |
30 |
31 | 32 | 33 |
34 | -------------------------------------------------------------------------------- /src/pages/cart/cart.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { IonicPageModule } from 'ionic-angular'; 3 | import { CartPage } from './cart'; 4 | 5 | @NgModule({ 6 | declarations: [ 7 | CartPage, 8 | ], 9 | imports: [ 10 | IonicPageModule.forChild(CartPage), 11 | ], 12 | }) 13 | export class CartPageModule {} 14 | -------------------------------------------------------------------------------- /src/pages/cart/cart.scss: -------------------------------------------------------------------------------- 1 | page-cart { 2 | .nolinebreak { 3 | float: left; 4 | padding-right: 10px; 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/pages/cart/cart.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { IonicPage, NavController, NavParams } from 'ionic-angular'; 3 | import { CartItem } from '../../models/cart-item'; 4 | import { ProdutoService } from '../../services/domain/produto.service'; 5 | import { API_CONFIG } from '../../config/api.config'; 6 | import { CartService } from '../../services/domain/cart.service'; 7 | import { ProdutoDTO } from '../../models/produto.dto'; 8 | 9 | @IonicPage() 10 | @Component({ 11 | selector: 'page-cart', 12 | templateUrl: 'cart.html', 13 | }) 14 | export class CartPage { 15 | 16 | items: CartItem[]; 17 | 18 | constructor( 19 | public navCtrl: NavController, 20 | public navParams: NavParams, 21 | public cartService: CartService, 22 | public produtoService: ProdutoService) { 23 | } 24 | 25 | ionViewDidLoad() { 26 | let cart = this.cartService.getCart(); 27 | this.items = cart.items; 28 | this.loadImageUrls(); 29 | } 30 | 31 | loadImageUrls() { 32 | for (var i=0; i { 36 | item.produto.imageUrl = `${API_CONFIG.bucketBaseUrl}/prod${item.produto.id}-small.jpg`; 37 | }, 38 | error => {}); 39 | } 40 | } 41 | 42 | removeItem(produto: ProdutoDTO) { 43 | this.items = this.cartService.removeProduto(produto).items; 44 | } 45 | 46 | increaseQuantity(produto: ProdutoDTO) { 47 | this.items = this.cartService.increaseQuantity(produto).items; 48 | } 49 | 50 | decreaseQuantity(produto: ProdutoDTO) { 51 | this.items = this.cartService.decreaseQuantity(produto).items; 52 | } 53 | 54 | total() : number { 55 | return this.cartService.total(); 56 | } 57 | 58 | goOn() { 59 | this.navCtrl.setRoot('CategoriasPage'); 60 | } 61 | 62 | checkout() { 63 | this.navCtrl.push('PickAddressPage'); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/pages/categorias/categorias.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | Categorias 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/pages/categorias/categorias.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { IonicPageModule } from 'ionic-angular'; 3 | import { CategoriasPage } from './categorias'; 4 | 5 | @NgModule({ 6 | declarations: [ 7 | CategoriasPage, 8 | ], 9 | imports: [ 10 | IonicPageModule.forChild(CategoriasPage), 11 | ], 12 | }) 13 | export class CategoriasPageModule {} 14 | -------------------------------------------------------------------------------- /src/pages/categorias/categorias.scss: -------------------------------------------------------------------------------- 1 | page-categorias { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /src/pages/categorias/categorias.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { IonicPage, NavController, NavParams } from 'ionic-angular'; 3 | import { CategoriaService } from '../../services/domain/categoria.service'; 4 | import { CategoriaDTO } from '../../models/categoria.dto'; 5 | import { API_CONFIG } from '../../config/api.config'; 6 | 7 | /** 8 | * Generated class for the CategoriasPage page. 9 | * 10 | * See https://ionicframework.com/docs/components/#navigation for more info on 11 | * Ionic pages and navigation. 12 | */ 13 | 14 | @IonicPage() 15 | @Component({ 16 | selector: 'page-categorias', 17 | templateUrl: 'categorias.html', 18 | }) 19 | export class CategoriasPage { 20 | 21 | bucketUrl: string = API_CONFIG.bucketBaseUrl; 22 | 23 | items: CategoriaDTO[]; 24 | 25 | constructor( 26 | public navCtrl: NavController, 27 | public navParams: NavParams, 28 | public categoriaService: CategoriaService) { 29 | } 30 | 31 | ionViewDidLoad() { 32 | this.categoriaService.findAll() 33 | .subscribe(response => { 34 | this.items = response; 35 | }, 36 | error => {}); 37 | } 38 | 39 | showProdutos(categoria_id : string) { 40 | this.navCtrl.push('ProdutosPage', {categoria_id: categoria_id}); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/pages/home/home.html: -------------------------------------------------------------------------------- 1 | 2 |

Sistema de pedidos

3 | 4 | logo 5 | 6 |
7 | 8 | Email 9 | 10 | 11 | 12 | Senha 13 | 14 | 15 | 16 |
17 | 18 | 19 |
20 | -------------------------------------------------------------------------------- /src/pages/home/home.module.ts: -------------------------------------------------------------------------------- 1 | import { IonicPageModule } from 'ionic-angular/module'; 2 | import { NgModule } from '@angular/core'; 3 | import { HomePage } from './home'; 4 | 5 | @NgModule({ 6 | declarations: [HomePage], 7 | imports: [IonicPageModule.forChild(HomePage)] 8 | }) 9 | export class HomeModule {} 10 | -------------------------------------------------------------------------------- /src/pages/home/home.scss: -------------------------------------------------------------------------------- 1 | page-home { 2 | 3 | h3 { 4 | text-align: center; 5 | } 6 | 7 | img { 8 | width: 200px; 9 | align-self: center; 10 | margin: auto; 11 | display: block; 12 | padding: 10px; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/pages/home/home.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { NavController, IonicPage } from 'ionic-angular'; 3 | import { MenuController } from 'ionic-angular/components/app/menu-controller'; 4 | import { CredenciaisDTO } from '../../models/credenciais.dto'; 5 | import { AuthService } from '../../services/auth.service'; 6 | 7 | @IonicPage() 8 | @Component({ 9 | selector: 'page-home', 10 | templateUrl: 'home.html' 11 | }) 12 | export class HomePage { 13 | 14 | creds : CredenciaisDTO = { 15 | email: "", 16 | senha: "" 17 | }; 18 | 19 | constructor( 20 | public navCtrl: NavController, 21 | public menu: MenuController, 22 | public auth: AuthService) { 23 | 24 | } 25 | 26 | ionViewWillEnter() { 27 | this.menu.swipeEnable(false); 28 | } 29 | 30 | ionViewDidLeave() { 31 | this.menu.swipeEnable(true); 32 | } 33 | 34 | ionViewDidEnter() { 35 | this.auth.refreshToken() 36 | .subscribe(response => { 37 | this.auth.successfulLogin(response.headers.get('Authorization')); 38 | this.navCtrl.setRoot('CategoriasPage'); 39 | }, 40 | error => {}); 41 | } 42 | 43 | login() { 44 | this.auth.authenticate(this.creds) 45 | .subscribe(response => { 46 | this.auth.successfulLogin(response.headers.get('Authorization')); 47 | this.navCtrl.setRoot('CategoriasPage'); 48 | }, 49 | error => {}); 50 | } 51 | 52 | signup() { 53 | this.navCtrl.push('SignupPage'); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/pages/order-confirmation/order-confirmation.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | Pedido registrado! 7 | Confira seu pedido 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | Itens do pedido 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |

{{item.produto.nome}}

25 |

{{item.produto.preco | currency}}

26 |

{{item.quantidade}}

27 |

{{item.produto.preco * item.quantidade | currency}}

28 |
29 | 30 | 31 |

Total

32 |

{{total() | currency}}

33 |
34 |
35 |
36 | 37 | 38 | 39 | Cliente 40 | 41 | 42 |

{{cliente?.nome}}

43 |

{{cliente?.email}}

44 |
45 |
46 | 47 | 48 | 49 | Endereço de entrega 50 | 51 | 52 | 53 |

{{endereco?.logradouro}}, {{endereco?.numero}}

54 |

{{endereco?.complemento}} {{endereco?.bairro}} CEP {{endereco?.cep}}

55 |

{{endereco?.cidade.nome}}, {{endereco?.cidade.estado.nome}}

56 |
57 |
58 | 59 | 60 | 61 | Pagamento 62 | 63 | 64 | 65 |

Pagamento com cartão

66 |

Parcelas: {{pedido.pagamento.numeroDeParcelas}}

67 |
68 | 69 |

Pagamento com boleto

70 |
71 |
72 | 73 | 74 | 75 |
76 | 77 |
78 | 79 | 80 | Seu pedido foi registrado! 81 | 82 | 83 |

Código do pedido: {{codpedido}}

84 |

Verifique seu email

85 |
86 |
87 | 88 | 89 |
90 | 91 |
92 | -------------------------------------------------------------------------------- /src/pages/order-confirmation/order-confirmation.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { IonicPageModule } from 'ionic-angular'; 3 | import { OrderConfirmationPage } from './order-confirmation'; 4 | import { PedidoService } from '../../services/domain/pedido.service'; 5 | 6 | @NgModule({ 7 | declarations: [ 8 | OrderConfirmationPage, 9 | ], 10 | imports: [ 11 | IonicPageModule.forChild(OrderConfirmationPage), 12 | ], 13 | providers: [ 14 | PedidoService 15 | ] 16 | }) 17 | export class OrderConfirmationPageModule {} 18 | -------------------------------------------------------------------------------- /src/pages/order-confirmation/order-confirmation.scss: -------------------------------------------------------------------------------- 1 | page-order-confirmation { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /src/pages/order-confirmation/order-confirmation.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { IonicPage, NavController, NavParams } from 'ionic-angular'; 3 | import { PedidoDTO } from '../../models/pedido.dto'; 4 | import { CartItem } from '../../models/cart-item'; 5 | import { EnderecoDTO } from '../../models/endereco.dto'; 6 | import { ClienteDTO } from '../../models/cliente.dto'; 7 | import { ClienteService } from '../../services/domain/cliente.service'; 8 | import { CartService } from '../../services/domain/cart.service'; 9 | import { PedidoService } from '../../services/domain/pedido.service'; 10 | 11 | @IonicPage() 12 | @Component({ 13 | selector: 'page-order-confirmation', 14 | templateUrl: 'order-confirmation.html', 15 | }) 16 | export class OrderConfirmationPage { 17 | 18 | pedido: PedidoDTO; 19 | cartItems: CartItem[]; 20 | cliente: ClienteDTO; 21 | endereco: EnderecoDTO; 22 | codpedido: string; 23 | 24 | constructor( 25 | public navCtrl: NavController, 26 | public navParams: NavParams, 27 | public clienteService: ClienteService, 28 | public cartService: CartService, 29 | public pedidoService: PedidoService) { 30 | 31 | this.pedido = this.navParams.get('pedido'); 32 | } 33 | 34 | ionViewDidLoad() { 35 | this.cartItems = this.cartService.getCart().items; 36 | 37 | this.clienteService.findById(this.pedido.cliente.id) 38 | .subscribe(response => { 39 | this.cliente = response as ClienteDTO; 40 | this.endereco = this.findEndereco(this.pedido.enderecoDeEntrega.id, response['enderecos']); 41 | }, 42 | error => { 43 | this.navCtrl.setRoot('HomePage'); 44 | }); 45 | } 46 | 47 | private findEndereco(id: string, list: EnderecoDTO[]) : EnderecoDTO { 48 | let position = list.findIndex(x => x.id == id); 49 | return list[position]; 50 | } 51 | 52 | total() : number { 53 | return this.cartService.total(); 54 | } 55 | 56 | back() { 57 | this.navCtrl.setRoot('CartPage'); 58 | } 59 | 60 | home() { 61 | this.navCtrl.setRoot('CategoriasPage'); 62 | } 63 | 64 | checkout() { 65 | this.pedidoService.insert(this.pedido) 66 | .subscribe(response => { 67 | this.cartService.createOrClearCart(); 68 | this.codpedido = this.extractId(response.headers.get('location')); 69 | }, 70 | error => { 71 | if (error.status == 403) { 72 | this.navCtrl.setRoot('HomePage'); 73 | } 74 | }); 75 | } 76 | 77 | private extractId(location : string) : string { 78 | let position = location.lastIndexOf('/'); 79 | return location.substring(position + 1, location.length); 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /src/pages/payment/payment.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | Forma de pagamento 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | Tipo de pagamento 16 | 17 | 18 | Pagamento com cartão 19 | 20 | 21 | 22 | Pagamento com boleto 23 | 24 | 25 | 26 | 27 | 28 | Parcelas no boleto 29 | 30 | {{n}} 31 | 32 | 33 | 34 |
35 |
36 | -------------------------------------------------------------------------------- /src/pages/payment/payment.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { IonicPageModule } from 'ionic-angular'; 3 | import { PaymentPage } from './payment'; 4 | 5 | @NgModule({ 6 | declarations: [ 7 | PaymentPage, 8 | ], 9 | imports: [ 10 | IonicPageModule.forChild(PaymentPage), 11 | ], 12 | }) 13 | export class PaymentPageModule {} 14 | -------------------------------------------------------------------------------- /src/pages/payment/payment.scss: -------------------------------------------------------------------------------- 1 | page-payment { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /src/pages/payment/payment.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { IonicPage, NavController, NavParams } from 'ionic-angular'; 3 | import { PedidoDTO } from '../../models/pedido.dto'; 4 | import { FormGroup, FormBuilder, Validators } from '@angular/forms'; 5 | 6 | @IonicPage() 7 | @Component({ 8 | selector: 'page-payment', 9 | templateUrl: 'payment.html', 10 | }) 11 | export class PaymentPage { 12 | 13 | pedido: PedidoDTO; 14 | 15 | parcelas: number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; 16 | 17 | formGroup: FormGroup; 18 | 19 | constructor( 20 | public navCtrl: NavController, 21 | public navParams: NavParams, 22 | public formBuilder: FormBuilder) { 23 | 24 | this.pedido = this.navParams.get('pedido'); 25 | 26 | this.formGroup = this.formBuilder.group({ 27 | numeroDeParcelas: [1, Validators.required], 28 | "@type": ["pagamentoComCartao", Validators.required] 29 | }); 30 | } 31 | 32 | nextPage() { 33 | this.pedido.pagamento = this.formGroup.value; 34 | this.navCtrl.setRoot('OrderConfirmationPage', {pedido: this.pedido}); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/pages/pick-address/pick-address.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | Fechamento de pedido 7 | 8 | 9 | 10 | 11 | 12 | 13 | Selecione um endereço 14 | 15 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/pages/pick-address/pick-address.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { IonicPageModule } from 'ionic-angular'; 3 | import { PickAddressPage } from './pick-address'; 4 | 5 | @NgModule({ 6 | declarations: [ 7 | PickAddressPage, 8 | ], 9 | imports: [ 10 | IonicPageModule.forChild(PickAddressPage), 11 | ], 12 | }) 13 | export class PickAddressPageModule {} 14 | -------------------------------------------------------------------------------- /src/pages/pick-address/pick-address.scss: -------------------------------------------------------------------------------- 1 | page-pick-address { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /src/pages/pick-address/pick-address.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { IonicPage, NavController, NavParams } from 'ionic-angular'; 3 | import { EnderecoDTO } from '../../models/endereco.dto'; 4 | import { StorageService } from '../../services/storage.service'; 5 | import { ClienteService } from '../../services/domain/cliente.service'; 6 | import { PedidoDTO } from '../../models/pedido.dto'; 7 | import { CartService } from '../../services/domain/cart.service'; 8 | 9 | @IonicPage() 10 | @Component({ 11 | selector: 'page-pick-address', 12 | templateUrl: 'pick-address.html', 13 | }) 14 | export class PickAddressPage { 15 | 16 | items: EnderecoDTO[]; 17 | 18 | pedido: PedidoDTO; 19 | 20 | constructor( 21 | public navCtrl: NavController, 22 | public navParams: NavParams, 23 | public storage: StorageService, 24 | public clienteService: ClienteService, 25 | public cartService: CartService) { 26 | } 27 | 28 | ionViewDidLoad() { 29 | let localUser = this.storage.getLocalUser(); 30 | if (localUser && localUser.email) { 31 | this.clienteService.findByEmail(localUser.email) 32 | .subscribe(response => { 33 | this.items = response['enderecos']; 34 | 35 | let cart = this.cartService.getCart(); 36 | 37 | this.pedido = { 38 | cliente: {id: response['id']}, 39 | enderecoDeEntrega: null, 40 | pagamento: null, 41 | itens : cart.items.map(x => {return {quantidade: x.quantidade, produto: {id: x.produto.id}}}) 42 | } 43 | }, 44 | error => { 45 | if (error.status == 403) { 46 | this.navCtrl.setRoot('HomePage'); 47 | } 48 | }); 49 | } 50 | else { 51 | this.navCtrl.setRoot('HomePage'); 52 | } 53 | } 54 | 55 | nextPage(item: EnderecoDTO) { 56 | this.pedido.enderecoDeEntrega = {id: item.id}; 57 | this.navCtrl.push('PaymentPage', {pedido: this.pedido}); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/pages/produto-detail/produto-detail.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | ProdutoDetail 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | {{item?.nome}} 19 | 20 |

21 | {{item?.preco | currency}} 22 |

23 |
24 |
25 | 26 | 27 |
28 | -------------------------------------------------------------------------------- /src/pages/produto-detail/produto-detail.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { IonicPageModule } from 'ionic-angular'; 3 | import { ProdutoDetailPage } from './produto-detail'; 4 | 5 | @NgModule({ 6 | declarations: [ 7 | ProdutoDetailPage, 8 | ], 9 | imports: [ 10 | IonicPageModule.forChild(ProdutoDetailPage), 11 | ], 12 | }) 13 | export class ProdutoDetailPageModule {} 14 | -------------------------------------------------------------------------------- /src/pages/produto-detail/produto-detail.scss: -------------------------------------------------------------------------------- 1 | page-produto-detail { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /src/pages/produto-detail/produto-detail.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { IonicPage, NavController, NavParams } from 'ionic-angular'; 3 | import { ProdutoDTO } from '../../models/produto.dto'; 4 | import { ProdutoService } from '../../services/domain/produto.service'; 5 | import { API_CONFIG } from '../../config/api.config'; 6 | import { CartService } from '../../services/domain/cart.service'; 7 | 8 | @IonicPage() 9 | @Component({ 10 | selector: 'page-produto-detail', 11 | templateUrl: 'produto-detail.html', 12 | }) 13 | export class ProdutoDetailPage { 14 | 15 | item: ProdutoDTO; 16 | 17 | constructor( 18 | public navCtrl: NavController, 19 | public navParams: NavParams, 20 | public produtoService: ProdutoService, 21 | public cartService: CartService) { 22 | } 23 | 24 | ionViewDidLoad() { 25 | let produto_id = this.navParams.get('produto_id'); 26 | this.produtoService.findById(produto_id) 27 | .subscribe(response => { 28 | this.item = response; 29 | this.getImageUrlIfExists(); 30 | }, 31 | error => {}); 32 | } 33 | 34 | getImageUrlIfExists() { 35 | this.produtoService.getImageFromBucket(this.item.id) 36 | .subscribe(response => { 37 | this.item.imageUrl = `${API_CONFIG.bucketBaseUrl}/prod${this.item.id}.jpg`; 38 | }, 39 | error => {}); 40 | } 41 | 42 | addToCart(produto: ProdutoDTO) { 43 | this.cartService.addProduto(produto); 44 | this.navCtrl.setRoot('CartPage'); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/pages/produtos/produtos.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | Produtos 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/pages/produtos/produtos.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { IonicPageModule } from 'ionic-angular'; 3 | import { ProdutosPage } from './produtos'; 4 | 5 | @NgModule({ 6 | declarations: [ 7 | ProdutosPage, 8 | ], 9 | imports: [ 10 | IonicPageModule.forChild(ProdutosPage), 11 | ], 12 | }) 13 | export class ProdutosPageModule {} 14 | -------------------------------------------------------------------------------- /src/pages/produtos/produtos.scss: -------------------------------------------------------------------------------- 1 | page-produtos { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /src/pages/produtos/produtos.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { IonicPage, NavController, NavParams } from 'ionic-angular'; 3 | import { ProdutoDTO } from '../../models/produto.dto'; 4 | import { API_CONFIG } from '../../config/api.config'; 5 | import { ProdutoService } from '../../services/domain/produto.service'; 6 | import { LoadingController } from 'ionic-angular/components/loading/loading-controller'; 7 | 8 | @IonicPage() 9 | @Component({ 10 | selector: 'page-produtos', 11 | templateUrl: 'produtos.html', 12 | }) 13 | export class ProdutosPage { 14 | 15 | items : ProdutoDTO[] = []; 16 | page : number = 0; 17 | 18 | constructor( 19 | public navCtrl: NavController, 20 | public navParams: NavParams, 21 | public produtoService: ProdutoService, 22 | public loadingCtrl: LoadingController) { 23 | } 24 | 25 | ionViewDidLoad() { 26 | this.loadData(); 27 | } 28 | 29 | loadData() { 30 | let categoria_id = this.navParams.get('categoria_id'); 31 | let loader = this.presentLoading(); 32 | this.produtoService.findByCategoria(categoria_id, this.page, 10) 33 | .subscribe(response => { 34 | let start = this.items.length; 35 | this.items = this.items.concat(response['content']); 36 | let end = this.items.length - 1; 37 | loader.dismiss(); 38 | console.log(this.page); 39 | console.log(this.items); 40 | this.loadImageUrls(start, end); 41 | }, 42 | error => { 43 | loader.dismiss(); 44 | }); 45 | } 46 | 47 | loadImageUrls(start: number, end: number) { 48 | for (var i=start; i<=end; i++) { 49 | let item = this.items[i]; 50 | this.produtoService.getSmallImageFromBucket(item.id) 51 | .subscribe(response => { 52 | item.imageUrl = `${API_CONFIG.bucketBaseUrl}/prod${item.id}-small.jpg`; 53 | }, 54 | error => {}); 55 | } 56 | } 57 | 58 | showDetail(produto_id : string) { 59 | this.navCtrl.push('ProdutoDetailPage', {produto_id: produto_id}); 60 | } 61 | 62 | presentLoading() { 63 | let loader = this.loadingCtrl.create({ 64 | content: "Aguarde..." 65 | }); 66 | loader.present(); 67 | return loader; 68 | } 69 | 70 | doRefresh(refresher) { 71 | this.page = 0; 72 | this.items = []; 73 | this.loadData(); 74 | setTimeout(() => { 75 | refresher.complete(); 76 | }, 1000); 77 | } 78 | 79 | doInfinite(infiniteScroll) { 80 | this.page++; 81 | this.loadData(); 82 | setTimeout(() => { 83 | infiniteScroll.complete(); 84 | }, 1000); 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /src/pages/profile/profile.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | Profile 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |

{{cliente?.nome}}

15 |

{{cliente?.email}}

16 | 17 | 18 | 19 | Enviar imagem de perfil 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
32 | -------------------------------------------------------------------------------- /src/pages/profile/profile.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { IonicPageModule } from 'ionic-angular'; 3 | import { ProfilePage } from './profile'; 4 | import { Camera } from '@ionic-native/camera'; 5 | 6 | @NgModule({ 7 | declarations: [ 8 | ProfilePage, 9 | ], 10 | imports: [ 11 | IonicPageModule.forChild(ProfilePage), 12 | ], 13 | providers: [ 14 | Camera 15 | ] 16 | }) 17 | export class ProfilePageModule {} 18 | -------------------------------------------------------------------------------- /src/pages/profile/profile.scss: -------------------------------------------------------------------------------- 1 | page-profile { 2 | .circle { 3 | width: 60%; 4 | border-radius: 100%; 5 | margin: 25px auto 0 auto; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/pages/profile/profile.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { IonicPage, NavController, NavParams } from 'ionic-angular'; 3 | import { StorageService } from '../../services/storage.service'; 4 | import { ClienteDTO } from '../../models/cliente.dto'; 5 | import { ClienteService } from '../../services/domain/cliente.service'; 6 | import { API_CONFIG } from '../../config/api.config'; 7 | import { CameraOptions, Camera } from '@ionic-native/camera'; 8 | import { DomSanitizer } from '@angular/platform-browser'; 9 | 10 | @IonicPage() 11 | @Component({ 12 | selector: 'page-profile', 13 | templateUrl: 'profile.html', 14 | }) 15 | export class ProfilePage { 16 | 17 | cliente: ClienteDTO; 18 | picture: string; 19 | profileImage; 20 | cameraOn: boolean = false; 21 | 22 | constructor( 23 | public navCtrl: NavController, 24 | public navParams: NavParams, 25 | public storage: StorageService, 26 | public clienteService: ClienteService, 27 | public camera: Camera, 28 | public sanitizer: DomSanitizer) { 29 | 30 | this.profileImage = 'assets/imgs/avatar-blank.png'; 31 | } 32 | 33 | ionViewDidLoad() { 34 | this.loadData(); 35 | } 36 | 37 | loadData() { 38 | let localUser = this.storage.getLocalUser(); 39 | if (localUser && localUser.email) { 40 | this.clienteService.findByEmail(localUser.email) 41 | .subscribe(response => { 42 | this.cliente = response as ClienteDTO; 43 | this.getImageIfExists(); 44 | }, 45 | error => { 46 | if (error.status == 403) { 47 | this.navCtrl.setRoot('HomePage'); 48 | } 49 | }); 50 | } 51 | else { 52 | this.navCtrl.setRoot('HomePage'); 53 | } 54 | } 55 | 56 | getImageIfExists() { 57 | this.clienteService.getImageFromBucket(this.cliente.id) 58 | .subscribe(response => { 59 | this.cliente.imageUrl = `${API_CONFIG.bucketBaseUrl}/cp${this.cliente.id}.jpg`; 60 | this.blobToDataURL(response).then(dataUrl => { 61 | let str : string = dataUrl as string; 62 | this.profileImage = this.sanitizer.bypassSecurityTrustUrl(str); 63 | }); 64 | }, 65 | error => { 66 | this.profileImage = 'assets/imgs/avatar-blank.png'; 67 | }); 68 | } 69 | 70 | // https://gist.github.com/frumbert/3bf7a68ffa2ba59061bdcfc016add9ee 71 | blobToDataURL(blob) { 72 | return new Promise((fulfill, reject) => { 73 | let reader = new FileReader(); 74 | reader.onerror = reject; 75 | reader.onload = (e) => fulfill(reader.result); 76 | reader.readAsDataURL(blob); 77 | }) 78 | } 79 | 80 | getCameraPicture() { 81 | 82 | this.cameraOn = true; 83 | 84 | const options: CameraOptions = { 85 | quality: 100, 86 | destinationType: this.camera.DestinationType.DATA_URL, 87 | encodingType: this.camera.EncodingType.PNG, 88 | mediaType: this.camera.MediaType.PICTURE 89 | } 90 | 91 | this.camera.getPicture(options).then((imageData) => { 92 | this.picture = 'data:image/png;base64,' + imageData; 93 | this.cameraOn = false; 94 | }, (err) => { 95 | this.cameraOn = false; 96 | }); 97 | } 98 | 99 | getGalleryPicture() { 100 | 101 | this.cameraOn = true; 102 | 103 | const options: CameraOptions = { 104 | quality: 100, 105 | sourceType: this.camera.PictureSourceType.PHOTOLIBRARY, 106 | destinationType: this.camera.DestinationType.DATA_URL, 107 | encodingType: this.camera.EncodingType.PNG, 108 | mediaType: this.camera.MediaType.PICTURE 109 | } 110 | 111 | this.camera.getPicture(options).then((imageData) => { 112 | this.picture = 'data:image/png;base64,' + imageData; 113 | this.cameraOn = false; 114 | }, (err) => { 115 | this.cameraOn = false; 116 | }); 117 | } 118 | 119 | sendPicture() { 120 | this.clienteService.uploadPicture(this.picture) 121 | .subscribe(response => { 122 | this.picture = null; 123 | this.getImageIfExists(); 124 | }, 125 | error => { 126 | }); 127 | } 128 | 129 | cancel() { 130 | this.picture = null; 131 | } 132 | } 133 | -------------------------------------------------------------------------------- /src/pages/signup/signup.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Signup 4 | 5 | 6 | 7 | 8 |
9 | 10 | Nome* 11 | 12 | 13 |

Valor inválido

14 | 15 | Email* 16 | 17 | 18 |

Valor inválido

19 | 20 | 21 | Tipo de cliente 22 | 23 | 24 | Pessoa física 25 | 26 | 27 | 28 | Pessoa jurídica 29 | 30 | 31 | 32 | 33 | 34 | CPF ou CNPJ 35 | 36 | 37 |

Valor inválido

38 | 39 | Senha* 40 | 41 | 42 |

Valor inválido

43 | 44 | Logradouro* 45 | 46 | 47 |

Valor inválido

48 | 49 | Número* 50 | 51 | 52 |

Valor inválido

53 | 54 | Complemento 55 | 56 | 57 | 58 | Bairro 59 | 60 | 61 | 62 | CEP* 63 | 64 | 65 |

Valor inválido

66 | 67 | Telefone 1* 68 | 69 | 70 |

Valor inválido

71 | 72 | Telefone 2 73 | 74 | 75 | 76 | Telefone 3 77 | 78 | 79 | 80 | Estado* 81 | 82 | {{estado.nome}} 83 | 84 | 85 | 86 | Cidade* 87 | 88 | {{cidade.nome}} 89 | 90 | 91 | 92 |
93 |
94 | -------------------------------------------------------------------------------- /src/pages/signup/signup.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { IonicPageModule } from 'ionic-angular'; 3 | import { SignupPage } from './signup'; 4 | import { CidadeService } from '../../services/domain/cidade.service'; 5 | import { EstadoService } from '../../services/domain/estado.service'; 6 | 7 | @NgModule({ 8 | declarations: [ 9 | SignupPage, 10 | ], 11 | imports: [ 12 | IonicPageModule.forChild(SignupPage), 13 | ], 14 | providers: [ 15 | CidadeService, 16 | EstadoService 17 | ] 18 | }) 19 | export class SignupPageModule {} 20 | -------------------------------------------------------------------------------- /src/pages/signup/signup.scss: -------------------------------------------------------------------------------- 1 | page-signup { 2 | .danger { 3 | color: red; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /src/pages/signup/signup.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { IonicPage, NavController, NavParams } from 'ionic-angular'; 3 | import { FormGroup, FormBuilder, Validators } from '@angular/forms'; 4 | import { CidadeService } from '../../services/domain/cidade.service'; 5 | import { EstadoService } from '../../services/domain/estado.service'; 6 | import { EstadoDTO } from '../../models/estado.dto'; 7 | import { CidadeDTO } from '../../models/cidade.dto'; 8 | import { ClienteService } from '../../services/domain/cliente.service'; 9 | import { AlertController } from 'ionic-angular/components/alert/alert-controller'; 10 | 11 | @IonicPage() 12 | @Component({ 13 | selector: 'page-signup', 14 | templateUrl: 'signup.html', 15 | }) 16 | export class SignupPage { 17 | 18 | formGroup: FormGroup; 19 | estados: EstadoDTO[]; 20 | cidades: CidadeDTO[]; 21 | 22 | constructor( 23 | public navCtrl: NavController, 24 | public navParams: NavParams, 25 | public formBuilder: FormBuilder, 26 | public cidadeService: CidadeService, 27 | public estadoService: EstadoService, 28 | public clienteService: ClienteService, 29 | public alertCtrl: AlertController) { 30 | 31 | this.formGroup = this.formBuilder.group({ 32 | nome: ['Joaquim', [Validators.required, Validators.minLength(5), Validators.maxLength(120)]], 33 | email: ['joaquim@gmail.com', [Validators.required, Validators.email]], 34 | tipo : ['1', [Validators.required]], 35 | cpfOuCnpj : ['06134596280', [Validators.required, Validators.minLength(11), Validators.maxLength(14)]], 36 | senha : ['123', [Validators.required]], 37 | logradouro : ['Rua Via', [Validators.required]], 38 | numero : ['25', [Validators.required]], 39 | complemento : ['Apto 3', []], 40 | bairro : ['Copacabana', []], 41 | cep : ['10828333', [Validators.required]], 42 | telefone1 : ['977261827', [Validators.required]], 43 | telefone2 : ['', []], 44 | telefone3 : ['', []], 45 | estadoId : [null, [Validators.required]], 46 | cidadeId : [null, [Validators.required]] 47 | }); 48 | } 49 | 50 | ionViewDidLoad() { 51 | this.estadoService.findAll() 52 | .subscribe(response => { 53 | this.estados = response; 54 | this.formGroup.controls.estadoId.setValue(this.estados[0].id); 55 | this.updateCidades(); 56 | }, 57 | error => {}); 58 | } 59 | 60 | updateCidades() { 61 | let estado_id = this.formGroup.value.estadoId; 62 | this.cidadeService.findAll(estado_id) 63 | .subscribe(response => { 64 | this.cidades = response; 65 | this.formGroup.controls.cidadeId.setValue(null); 66 | }, 67 | error => {}); 68 | } 69 | 70 | signupUser() { 71 | this.clienteService.insert(this.formGroup.value) 72 | .subscribe(response => { 73 | this.showInsertOk(); 74 | }, 75 | error => {}); 76 | } 77 | 78 | showInsertOk() { 79 | let alert = this.alertCtrl.create({ 80 | title: 'Sucesso!', 81 | message: 'Cadastro efetuado com sucesso', 82 | enableBackdropDismiss: false, 83 | buttons: [ 84 | { 85 | text: 'Ok', 86 | handler: () => { 87 | this.navCtrl.pop(); 88 | } 89 | } 90 | ] 91 | }); 92 | alert.present(); 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /src/service-worker.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Check out https://googlechromelabs.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.fastest); 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/services/auth.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from "@angular/core"; 2 | import { CredenciaisDTO } from "../models/credenciais.dto"; 3 | import { HttpClient } from "@angular/common/http"; 4 | import { API_CONFIG } from "../config/api.config"; 5 | import { LocalUser } from "../models/local_user"; 6 | import { StorageService } from "./storage.service"; 7 | import { JwtHelper } from 'angular2-jwt'; 8 | import { CartService } from "./domain/cart.service"; 9 | 10 | @Injectable() 11 | export class AuthService { 12 | 13 | jwtHelper: JwtHelper = new JwtHelper(); 14 | 15 | constructor( 16 | public http: HttpClient, 17 | public storage: StorageService, 18 | public cartService: CartService) { 19 | } 20 | 21 | authenticate(creds : CredenciaisDTO) { 22 | return this.http.post( 23 | `${API_CONFIG.baseUrl}/login`, 24 | creds, 25 | { 26 | observe: 'response', 27 | responseType: 'text' 28 | }); 29 | } 30 | 31 | refreshToken() { 32 | return this.http.post( 33 | `${API_CONFIG.baseUrl}/auth/refresh_token`, 34 | {}, 35 | { 36 | observe: 'response', 37 | responseType: 'text' 38 | }); 39 | } 40 | 41 | successfulLogin(authorizationValue : string) { 42 | let tok = authorizationValue.substring(7); 43 | let user : LocalUser = { 44 | token: tok, 45 | email: this.jwtHelper.decodeToken(tok).sub 46 | }; 47 | this.storage.setLocalUser(user); 48 | this.cartService.createOrClearCart(); 49 | } 50 | 51 | logout() { 52 | this.storage.setLocalUser(null); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/services/domain/cart.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { StorageService } from '../storage.service'; 3 | import { Cart } from '../../models/cart'; 4 | import { ProdutoDTO } from '../../models/produto.dto'; 5 | 6 | @Injectable() 7 | export class CartService { 8 | 9 | constructor(public storage: StorageService) { 10 | } 11 | 12 | createOrClearCart() : Cart { 13 | let cart: Cart = {items: []}; 14 | this.storage.setCart(cart); 15 | return cart; 16 | } 17 | 18 | getCart() : Cart { 19 | let cart: Cart = this.storage.getCart(); 20 | if (cart == null) { 21 | cart = this.createOrClearCart(); 22 | } 23 | return cart; 24 | } 25 | 26 | addProduto(produto: ProdutoDTO) : Cart { 27 | let cart = this.getCart(); 28 | let position = cart.items.findIndex(x => x.produto.id == produto.id); 29 | if (position == -1) { 30 | cart.items.push({quantidade: 1, produto: produto}); 31 | } 32 | this.storage.setCart(cart); 33 | return cart; 34 | } 35 | 36 | removeProduto(produto: ProdutoDTO) : Cart { 37 | let cart = this.getCart(); 38 | let position = cart.items.findIndex(x => x.produto.id == produto.id); 39 | if (position != -1) { 40 | cart.items.splice(position, 1); 41 | } 42 | this.storage.setCart(cart); 43 | return cart; 44 | } 45 | 46 | increaseQuantity(produto: ProdutoDTO) : Cart { 47 | let cart = this.getCart(); 48 | let position = cart.items.findIndex(x => x.produto.id == produto.id); 49 | if (position != -1) { 50 | cart.items[position].quantidade++; 51 | } 52 | this.storage.setCart(cart); 53 | return cart; 54 | } 55 | 56 | decreaseQuantity(produto: ProdutoDTO) : Cart { 57 | let cart = this.getCart(); 58 | let position = cart.items.findIndex(x => x.produto.id == produto.id); 59 | if (position != -1) { 60 | cart.items[position].quantidade--; 61 | if (cart.items[position].quantidade < 1) { 62 | cart = this.removeProduto(produto); 63 | } 64 | } 65 | this.storage.setCart(cart); 66 | return cart; 67 | } 68 | 69 | total() : number { 70 | let cart = this.getCart(); 71 | let sum = 0; 72 | for (var i=0; i { 14 | return this.http.get(`${API_CONFIG.baseUrl}/categorias`); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/services/domain/cidade.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from "@angular/core"; 2 | import { HttpClient } from "@angular/common/http"; 3 | import { API_CONFIG } from "../../config/api.config"; 4 | import { CidadeDTO } from "../../models/cidade.dto"; 5 | import { Observable } from "rxjs/Rx"; 6 | 7 | @Injectable() 8 | export class CidadeService { 9 | 10 | constructor(public http: HttpClient) { 11 | } 12 | 13 | findAll(estado_id : string) : Observable { 14 | return this.http.get(`${API_CONFIG.baseUrl}/estados/${estado_id}/cidades`); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/services/domain/cliente.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from "@angular/core"; 2 | import { HttpClient, HttpHeaders } from "@angular/common/http"; 3 | import { Observable } from "rxjs/Rx"; 4 | import { ClienteDTO } from "../../models/cliente.dto"; 5 | import { API_CONFIG } from "../../config/api.config"; 6 | import { StorageService } from "../storage.service"; 7 | import { ImageUtilService } from "../image-util.service"; 8 | 9 | @Injectable() 10 | export class ClienteService { 11 | 12 | constructor( 13 | public http: HttpClient, 14 | public storage: StorageService, 15 | public imageUtilService: ImageUtilService) { 16 | } 17 | 18 | findById(id: string) { 19 | return this.http.get(`${API_CONFIG.baseUrl}/clientes/${id}`); 20 | } 21 | 22 | findByEmail(email: string) { 23 | return this.http.get(`${API_CONFIG.baseUrl}/clientes/email?value=${email}`); 24 | } 25 | 26 | getImageFromBucket(id : string) : Observable { 27 | let url = `${API_CONFIG.bucketBaseUrl}/cp${id}.jpg` 28 | return this.http.get(url, {responseType : 'blob'}); 29 | } 30 | 31 | insert(obj : ClienteDTO) { 32 | return this.http.post( 33 | `${API_CONFIG.baseUrl}/clientes`, 34 | obj, 35 | { 36 | observe: 'response', 37 | responseType: 'text' 38 | } 39 | ); 40 | } 41 | 42 | uploadPicture(picture) { 43 | let pictureBlob = this.imageUtilService.dataUriToBlob(picture); 44 | let formData : FormData = new FormData(); 45 | formData.set('file', pictureBlob, 'file.png'); 46 | return this.http.post( 47 | `${API_CONFIG.baseUrl}/clientes/picture`, 48 | formData, 49 | { 50 | observe: 'response', 51 | responseType: 'text' 52 | } 53 | ); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/services/domain/estado.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from "@angular/core"; 2 | import { HttpClient } from "@angular/common/http"; 3 | import { API_CONFIG } from "../../config/api.config"; 4 | import { EstadoDTO } from "../../models/estado.dto"; 5 | import { Observable } from "rxjs/Rx"; 6 | 7 | @Injectable() 8 | export class EstadoService { 9 | 10 | constructor(public http: HttpClient) { 11 | } 12 | 13 | findAll() : Observable { 14 | return this.http.get(`${API_CONFIG.baseUrl}/estados`); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/services/domain/pedido.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from "@angular/core"; 2 | import { HttpClient } from "@angular/common/http"; 3 | import { API_CONFIG } from "../../config/api.config"; 4 | import { PedidoDTO } from "../../models/pedido.dto"; 5 | 6 | @Injectable() 7 | export class PedidoService { 8 | 9 | constructor(public http: HttpClient) { 10 | } 11 | 12 | insert(obj: PedidoDTO) { 13 | return this.http.post( 14 | `${API_CONFIG.baseUrl}/pedidos`, 15 | obj, 16 | { 17 | observe: 'response', 18 | responseType: 'text' 19 | } 20 | ); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/services/domain/produto.service.ts: -------------------------------------------------------------------------------- 1 | import { HttpClient } from '@angular/common/http'; 2 | import { Injectable } from '@angular/core'; 3 | import { API_CONFIG } from '../../config/api.config'; 4 | import { Observable } from 'rxjs/Rx'; // IMPORTANTE: IMPORT ATUALIZADO 5 | import { ProdutoDTO } from '../../models/produto.dto'; 6 | 7 | @Injectable() 8 | export class ProdutoService { 9 | 10 | constructor(public http: HttpClient) { 11 | } 12 | 13 | findById(produto_id : string) { 14 | return this.http.get(`${API_CONFIG.baseUrl}/produtos/${produto_id}`); 15 | } 16 | 17 | findByCategoria(categoria_id : string, page : number = 0, linesPerPage : number = 24) { 18 | return this.http.get(`${API_CONFIG.baseUrl}/produtos/?categorias=${categoria_id}&page=${page}&linesPerPage=${linesPerPage}`); 19 | } 20 | 21 | getSmallImageFromBucket(id : string) : Observable { 22 | let url = `${API_CONFIG.bucketBaseUrl}/prod${id}-small.jpg` 23 | return this.http.get(url, {responseType : 'blob'}); 24 | } 25 | 26 | getImageFromBucket(id : string) : Observable { 27 | let url = `${API_CONFIG.bucketBaseUrl}/prod${id}.jpg` 28 | return this.http.get(url, {responseType : 'blob'}); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/services/image-util.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from "@angular/core"; 2 | 3 | @Injectable() 4 | export class ImageUtilService { 5 | 6 | dataUriToBlob(dataURI) { 7 | var byteString = atob(dataURI.split(',')[1]); 8 | var mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0] 9 | var ab = new ArrayBuffer(byteString.length); 10 | var ia = new Uint8Array(ab); 11 | for (var i = 0; i < byteString.length; i++) { 12 | ia[i] = byteString.charCodeAt(i); 13 | } 14 | return new Blob([ab], { type: mimeString }); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/services/storage.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from "@angular/core"; 2 | import { STORAGE_KEYS } from "../config/storage_keys.config"; 3 | import { LocalUser } from "../models/local_user"; 4 | import { Cart } from "../models/cart"; 5 | 6 | @Injectable() 7 | export class StorageService { 8 | 9 | getLocalUser() : LocalUser { 10 | let usr = localStorage.getItem(STORAGE_KEYS.localUser); 11 | if (usr == null) { 12 | return null; 13 | } 14 | else { 15 | return JSON.parse(usr); 16 | } 17 | } 18 | 19 | setLocalUser(obj : LocalUser) { 20 | if (obj == null) { 21 | localStorage.removeItem(STORAGE_KEYS.localUser); 22 | } 23 | else { 24 | localStorage.setItem(STORAGE_KEYS.localUser, JSON.stringify(obj)); 25 | } 26 | } 27 | 28 | getCart() : Cart { 29 | let str = localStorage.getItem(STORAGE_KEYS.cart); 30 | if (str != null) { 31 | return JSON.parse(str); 32 | } 33 | else { 34 | return null; 35 | } 36 | } 37 | 38 | setCart(obj : Cart) { 39 | if (obj != null) { 40 | localStorage.setItem(STORAGE_KEYS.cart, JSON.stringify(obj)); 41 | } 42 | else { 43 | localStorage.removeItem(STORAGE_KEYS.cart); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /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 | "typeRoots": [ 16 | "../node_modules/@types" 17 | ] 18 | }, 19 | "include": [ 20 | "src/**/*.ts" 21 | ], 22 | "exclude": [ 23 | "node_modules", 24 | "src/**/*.spec.ts", 25 | "src/**/__tests__/*.ts" 26 | ], 27 | "compileOnSave": false, 28 | "atom": { 29 | "rewriteTsconfig": false 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /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 | --------------------------------------------------------------------------------