diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 56be33f..63ea64f 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,7 +1,7 @@ + android:versionName="0.0.5"> diff --git a/android/app/src/main/java/com/dinect/checker/activity/CameraActivity.java b/android/app/src/main/java/com/dinect/checker/activity/CameraActivity.java index 6c7b770..1277533 100644 --- a/android/app/src/main/java/com/dinect/checker/activity/CameraActivity.java +++ b/android/app/src/main/java/com/dinect/checker/activity/CameraActivity.java @@ -338,7 +338,7 @@ public class CameraActivity extends AppCompatActivity implements SurfaceHolder.C private CameraActivity mActivity; private String mCode = ""; - private String mUrl = "http://pos-api-int.dinect.com/20130701/users/?auto="; + private String mUrl = "http://pos-api-autoclub.dinect.com/20130701/?auto="; private String mCard = ""; private String mToken = ""; @@ -359,12 +359,9 @@ public class CameraActivity extends AppCompatActivity implements SurfaceHolder.C @Override public void run() { - - Log.d("kifio", mUrl); - Log.d("kifio", mToken); Request request = new Request.Builder() - .addHeader("DM-Authorization", "dmapptoken 9fec83cdca38c357e6b65dbb17514cdd36bf2a08") + .addHeader("DM-Authorization", "dmapptoken bdea0f3ba9034b688019a7cac753d1209e2b227f") .addHeader("Authorization", "dmtoken " + mToken) .url(mUrl) .build(); diff --git a/assets/registration_logo.png b/assets/registration_logo.png index 29eda7a..78b0091 100644 Binary files a/assets/registration_logo.png and b/assets/registration_logo.png differ diff --git a/assets/splash_logo.png b/assets/splash_logo.png new file mode 100644 index 0000000..a783a0c Binary files /dev/null and b/assets/splash_logo.png differ diff --git a/checker.sublime-workspace b/checker.sublime-workspace index 8267108..2a73d21 100644 --- a/checker.sublime-workspace +++ b/checker.sublime-workspace @@ -3,6 +3,14 @@ { "selected_items": [ + [ + "e", + "else" + ], + [ + "pre", + "previewing" + ], [ "purc", "_purchase" @@ -15,34 +23,7 @@ "file": "lib/base_state.dart", "settings": { - "buffer_size": 3196, - "encoding": "UTF-8", - "line_ending": "Unix" - } - }, - { - "file": "lib/splash.dart", - "settings": - { - "buffer_size": 1877, - "encoding": "UTF-8", - "line_ending": "Unix" - } - }, - { - "file": "lib/purchase.dart", - "settings": - { - "buffer_size": 3790, - "encoding": "UTF-8", - "line_ending": "Unix" - } - }, - { - "file": "lib/purchase_success.dart", - "settings": - { - "buffer_size": 1219, + "buffer_size": 5474, "encoding": "UTF-8", "line_ending": "Unix" } @@ -51,7 +32,25 @@ "file": "lib/main.dart", "settings": { - "buffer_size": 3225, + "buffer_size": 439, + "encoding": "UTF-8", + "line_ending": "Unix" + } + }, + { + "file": "lib/network.dart", + "settings": + { + "buffer_size": 1105, + "encoding": "UTF-8", + "line_ending": "Unix" + } + }, + { + "file": "lib/purchase.dart", + "settings": + { + "buffer_size": 5084, "encoding": "UTF-8", "line_ending": "Unix" } @@ -60,7 +59,16 @@ "file": "lib/registration.dart", "settings": { - "buffer_size": 4032, + "buffer_size": 2514, + "encoding": "UTF-8", + "line_ending": "Unix" + } + }, + { + "file": "android/app/src/main/java/com/dinect/checker/activity/MainActivity.java", + "settings": + { + "buffer_size": 6170, "encoding": "UTF-8", "line_ending": "Unix" } @@ -69,7 +77,52 @@ "file": "lib/activate_token.dart", "settings": { - "buffer_size": 3446, + "buffer_size": 3297, + "encoding": "UTF-8", + "line_ending": "Unix" + } + }, + { + "file": "lib/common.dart", + "settings": + { + "buffer_size": 3424, + "encoding": "UTF-8", + "line_ending": "Unix" + } + }, + { + "file": "lib/consts.dart", + "settings": + { + "buffer_size": 1436, + "encoding": "UTF-8", + "line_ending": "Unix" + } + }, + { + "file": "lib/splash.dart", + "settings": + { + "buffer_size": 3435, + "encoding": "UTF-8", + "line_ending": "Unix" + } + }, + { + "file": "lib/faq.dart", + "settings": + { + "buffer_size": 4387, + "encoding": "UTF-8", + "line_ending": "Unix" + } + }, + { + "file": "android/app/src/main/java/com/dinect/checker/activity/CameraActivity.java", + "settings": + { + "buffer_size": 8727, "encoding": "UTF-8", "line_ending": "Unix" } @@ -116,11 +169,29 @@ "expanded_folders": [ "/Users/kifio/FlutterProjects/checker", + "/Users/kifio/FlutterProjects/checker/android", + "/Users/kifio/FlutterProjects/checker/android/app", + "/Users/kifio/FlutterProjects/checker/android/app/src", + "/Users/kifio/FlutterProjects/checker/android/app/src/main", + "/Users/kifio/FlutterProjects/checker/android/app/src/main/java", + "/Users/kifio/FlutterProjects/checker/android/app/src/main/java/com", + "/Users/kifio/FlutterProjects/checker/android/app/src/main/java/com/dinect", + "/Users/kifio/FlutterProjects/checker/android/app/src/main/java/com/dinect/checker", + "/Users/kifio/FlutterProjects/checker/android/app/src/main/java/com/dinect/checker/activity", + "/Users/kifio/FlutterProjects/checker/android/app/src/main/res", + "/Users/kifio/FlutterProjects/checker/android/app/src/main/res/menu", "/Users/kifio/FlutterProjects/checker/assets", "/Users/kifio/FlutterProjects/checker/lib" ], "file_history": [ + "/Users/kifio/FlutterProjects/checker/lib/consts.dart", + "/Users/kifio/FlutterProjects/checker/lib/activate_token.dart", + "/Users/kifio/FlutterProjects/checker/lib/registration.dart", + "/Users/kifio/FlutterProjects/checker/lib/purchase_success.dart", + "/Users/kifio/FlutterProjects/checker/lib/purchase.dart", + "/Users/kifio/FlutterProjects/checker/lib/main.dart", + "/Users/kifio/FlutterProjects/checker/lib/faq.dart", "/home/kifio/ShitCoding/checker/lib/main.dart", "/home/kifio/ShitCoding/checker/lib/base_state.dart", "/home/kifio/ShitCoding/checker/lib/splash.dart", @@ -129,7 +200,7 @@ ], "find": { - "height": 46.0 + "height": 35.0 }, "find_in_files": { @@ -143,6 +214,8 @@ "case_sensitive": true, "find_history": [ + "async", + "common", " \treturn new Text('Покупка на сумму 1234.00 руб. проведена', style: new TextStyle(color: tokenActiveTextColor, decorationColor: const Color(0x8ae28aff)));\n", "getProgressIndicator", "direc", @@ -175,7 +248,7 @@ "groups": [ { - "selected": 6, + "selected": 0, "sheets": [ { @@ -184,15 +257,15 @@ "semi_transient": false, "settings": { - "buffer_size": 3196, + "buffer_size": 5474, "regions": { }, "selection": [ [ - 713, - 713 + 886, + 886 ] ], "settings": @@ -203,27 +276,117 @@ "translate_tabs_to_spaces": true }, "translation.x": 0.0, - "translation.y": 121.0, + "translation.y": 918.0, "zoom_level": 1.0 }, - "stack_index": 6, + "stack_index": 0, "type": "text" }, { "buffer": 1, - "file": "lib/splash.dart", + "file": "lib/main.dart", "semi_transient": false, "settings": { - "buffer_size": 1877, + "buffer_size": 439, "regions": { }, "selection": [ [ - 581, - 581 + 83, + 83 + ] + ], + "settings": + { + "syntax": "Packages/Dart/Dart.tmLanguage", + "tab_size": 2, + "translate_tabs_to_spaces": true + }, + "translation.x": 0.0, + "translation.y": 0.0, + "zoom_level": 1.0 + }, + "stack_index": 11, + "type": "text" + }, + { + "buffer": 2, + "file": "lib/network.dart", + "semi_transient": false, + "settings": + { + "buffer_size": 1105, + "regions": + { + }, + "selection": + [ + [ + 1105, + 1105 + ] + ], + "settings": + { + "syntax": "Packages/Dart/Dart.tmLanguage", + "tab_size": 2, + "translate_tabs_to_spaces": true + }, + "translation.x": 0.0, + "translation.y": 0.0, + "zoom_level": 1.0 + }, + "stack_index": 2, + "type": "text" + }, + { + "buffer": 3, + "file": "lib/purchase.dart", + "semi_transient": true, + "settings": + { + "buffer_size": 5084, + "regions": + { + }, + "selection": + [ + [ + 0, + 0 + ] + ], + "settings": + { + "syntax": "Packages/Dart/Dart.tmLanguage", + "tab_size": 2, + "translate_tabs_to_spaces": true + }, + "translation.x": 0.0, + "translation.y": 1410.0, + "zoom_level": 1.0 + }, + "stack_index": 1, + "type": "text" + }, + { + "buffer": 4, + "file": "lib/registration.dart", + "semi_transient": false, + "settings": + { + "buffer_size": 2514, + "regions": + { + }, + "selection": + [ + [ + 1877, + 1877 ] ], "settings": @@ -239,123 +402,34 @@ "stack_index": 5, "type": "text" }, - { - "buffer": 2, - "file": "lib/purchase.dart", - "semi_transient": false, - "settings": - { - "buffer_size": 3790, - "regions": - { - }, - "selection": - [ - [ - 1224, - 1224 - ] - ], - "settings": - { - "syntax": "Packages/Dart/Dart.tmLanguage", - "tab_size": 2, - "translate_tabs_to_spaces": true - }, - "translation.x": 0.0, - "translation.y": 390.0, - "zoom_level": 1.0 - }, - "stack_index": 4, - "type": "text" - }, - { - "buffer": 3, - "file": "lib/purchase_success.dart", - "semi_transient": false, - "settings": - { - "buffer_size": 1219, - "regions": - { - }, - "selection": - [ - [ - 724, - 724 - ] - ], - "settings": - { - "auto_name": "", - "syntax": "Packages/Dart/Dart.tmLanguage" - }, - "translation.x": 0.0, - "translation.y": 0.0, - "zoom_level": 1.0 - }, - "stack_index": 3, - "type": "text" - }, - { - "buffer": 4, - "file": "lib/main.dart", - "semi_transient": false, - "settings": - { - "buffer_size": 3225, - "regions": - { - }, - "selection": - [ - [ - 1267, - 1267 - ] - ], - "settings": - { - "syntax": "Packages/Dart/Dart.tmLanguage", - "tab_size": 2, - "translate_tabs_to_spaces": true - }, - "translation.x": 0.0, - "translation.y": 367.0, - "zoom_level": 1.0 - }, - "stack_index": 2, - "type": "text" - }, { "buffer": 5, - "file": "lib/registration.dart", + "file": "android/app/src/main/java/com/dinect/checker/activity/MainActivity.java", "semi_transient": false, "settings": { - "buffer_size": 4032, + "buffer_size": 6170, "regions": { }, "selection": [ [ - 990, - 990 + 5764, + 5764 ] ], "settings": { - "syntax": "Packages/Dart/Dart.tmLanguage", - "tab_size": 2, + "syntax": "Packages/Java/Java.sublime-syntax", + "tab_size": 4, "translate_tabs_to_spaces": true }, "translation.x": 0.0, - "translation.y": 630.0, + "translation.y": 1245.0, "zoom_level": 1.0 }, - "stack_index": 1, + "stack_index": 9, "type": "text" }, { @@ -364,15 +438,15 @@ "semi_transient": false, "settings": { - "buffer_size": 3446, + "buffer_size": 3297, "regions": { }, "selection": [ [ - 2138, - 2156 + 124, + 124 ] ], "settings": @@ -382,10 +456,158 @@ "translate_tabs_to_spaces": true }, "translation.x": 0.0, - "translation.y": 222.0, + "translation.y": 8.0, "zoom_level": 1.0 }, - "stack_index": 0, + "stack_index": 4, + "type": "text" + }, + { + "buffer": 7, + "file": "lib/common.dart", + "semi_transient": false, + "settings": + { + "buffer_size": 3424, + "regions": + { + }, + "selection": + [ + [ + 1136, + 1136 + ] + ], + "settings": + { + "syntax": "Packages/Dart/Dart.tmLanguage", + "tab_size": 2, + "translate_tabs_to_spaces": true + }, + "translation.x": 0.0, + "translation.y": 1.0, + "zoom_level": 1.0 + }, + "stack_index": 3, + "type": "text" + }, + { + "buffer": 8, + "file": "lib/consts.dart", + "semi_transient": false, + "settings": + { + "buffer_size": 1436, + "regions": + { + }, + "selection": + [ + [ + 1180, + 1180 + ] + ], + "settings": + { + "syntax": "Packages/Dart/Dart.tmLanguage" + }, + "translation.x": 0.0, + "translation.y": 0.0, + "zoom_level": 1.0 + }, + "stack_index": 7, + "type": "text" + }, + { + "buffer": 9, + "file": "lib/splash.dart", + "semi_transient": false, + "settings": + { + "buffer_size": 3435, + "regions": + { + }, + "selection": + [ + [ + 2886, + 3248 + ] + ], + "settings": + { + "syntax": "Packages/Dart/Dart.tmLanguage", + "tab_size": 2, + "translate_tabs_to_spaces": true + }, + "translation.x": 0.0, + "translation.y": 255.0, + "zoom_level": 1.0 + }, + "stack_index": 6, + "type": "text" + }, + { + "buffer": 10, + "file": "lib/faq.dart", + "semi_transient": false, + "settings": + { + "buffer_size": 4387, + "regions": + { + }, + "selection": + [ + [ + 39, + 39 + ] + ], + "settings": + { + "syntax": "Packages/Dart/Dart.tmLanguage", + "tab_size": 2, + "translate_tabs_to_spaces": true + }, + "translation.x": 0.0, + "translation.y": 9.0, + "zoom_level": 1.0 + }, + "stack_index": 8, + "type": "text" + }, + { + "buffer": 11, + "file": "android/app/src/main/java/com/dinect/checker/activity/CameraActivity.java", + "semi_transient": false, + "settings": + { + "buffer_size": 8727, + "regions": + { + }, + "selection": + [ + [ + 7036, + 7036 + ] + ], + "settings": + { + "syntax": "Packages/Java/Java.sublime-syntax", + "tab_size": 4, + "translate_tabs_to_spaces": true + }, + "translation.x": 0.0, + "translation.y": 2950.0, + "zoom_level": 1.0 + }, + "stack_index": 10, "type": "text" } ] diff --git a/lib/consts.dart b/lib/consts.dart index 59033d5..2f42cf7 100644 --- a/lib/consts.dart +++ b/lib/consts.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; // Serious constants -const String intUrl = 'https://pos-api-int.dinect.com/20130701/'; -const String intToken = '9fec83cdca38c357e6b65dbb17514cdd36bf2a08'; +const String url = 'http://pos-api-autoclub.dinect.com/20130701/'; +const String appToken = 'bdea0f3ba9034b688019a7cac753d1209e2b227f'; // Hints const String merchantIDHint = 'ID магазина'; @@ -17,6 +17,7 @@ const String active_token_bg_png = 'assets/active_token_message_background.png'; const String expansion_icon_png = 'assets/expansion_icon.png'; const String powered_by_dinect_splash_png = 'assets/powered_by_dinect_splash.png'; const String powered_by_dinect_png = 'assets/powered_by_dinect.png'; +const String splash_logo_png = 'assets/splash_logo_png'; // Colors const Color primaryColor = const Color(0xffeb0004); diff --git a/lib/network.dart b/lib/network.dart index 8a4a685..a998129 100644 --- a/lib/network.dart +++ b/lib/network.dart @@ -11,25 +11,21 @@ final httpClient = createHttpClient(); // На сервере есть ограничение в 40 токенов. createToken(String merchantId, String posID) async { - String url = intUrl + 'tokens/?_dmapptoken=' + intToken; - // Поле description - необязательное. var body = { 'merchant_shop': merchantId, 'pos': posID, }; - return httpClient.post(url, body: body); + return httpClient.post(url + 'tokens/?_dmapptoken=' + appToken, body: body); } // Проверка статуса токена. В ответе приходит параметр active, который может быть либо true, либо false,. checkTokenStatus(String token) async { - return httpClient.get(intUrl + 'tokens/' + token + '?_dmapptoken=' + intToken); + return httpClient.get(url + 'tokens/' + token + '?_dmapptoken=' + appToken); } // Удаление токена на сервере. deleteToken(String token) async { - String url = intUrl + 'tokens/' + token + '?_dmapptoken=' + intToken; - print(url); - return httpClient.delete(url); + return httpClient.delete(url + 'tokens/' + token + '?_dmapptoken=' + appToken); } \ No newline at end of file diff --git a/lib/splash.dart b/lib/splash.dart index 85b7f6c..9841d82 100644 --- a/lib/splash.dart +++ b/lib/splash.dart @@ -20,7 +20,8 @@ class SplashScreen extends StatelessWidget { return new Stack(children: [getBackgroundContainer(), new Align(alignment: FractionalOffset.bottomRight, child: - new Container(margin: new EdgeInsets.only(right: 11.0, bottom: 5.0), child: new Image.asset(powered_by_dinect_splash_png, height: 16.0, width: 122.0)))]); + new Container(margin: new EdgeInsets.only(right: 11.0, bottom: 5.0), child: new Image.asset(powered_by_dinect_splash_png, height: 16.0, width: 122.0))), + new Center(child: new Image.asset(splash_logo_png, height: 198.0, width: 252.0))]); } getBackgroundContainer() { diff --git a/pubspec.yaml b/pubspec.yaml index 011ab7c..2a5b46c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -28,8 +28,7 @@ flutter: - assets/expansion_icon.png - assets/powered_by_dinect_splash.png - assets/powered_by_dinect.png - - + - assets/splash_logo.png # To add assets from package dependencies, first ensure the asset # is in the lib/ directory of the dependency. Then,