issue 10730
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.dinect.checker"
|
||||
android:versionCode="5"
|
||||
android:versionName="1.1.7">
|
||||
android:versionCode="6"
|
||||
android:versionName="1.1.8">
|
||||
|
||||
<uses-sdk
|
||||
android:minSdkVersion="16"
|
||||
|
||||
@@ -97,8 +97,6 @@ public abstract class AbstractScannerActivity extends AppCompatActivity impleme
|
||||
mClient = new ApiClient(url, appToken, token);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* initialize activity
|
||||
* - removes windows title
|
||||
@@ -166,7 +164,8 @@ public abstract class AbstractScannerActivity extends AppCompatActivity impleme
|
||||
EditText manualInput = (EditText) findViewById(R.id.manual_input);
|
||||
|
||||
// для удобства, чтоб не вводить постоянно руками при разработке
|
||||
manualInput.setText("4620011139016337050236302");
|
||||
// manualInput.setText("4620011139016337050236302");
|
||||
manualInput.setHint(getIntent().getStringExtra("enter_manual"));
|
||||
|
||||
manualInput.setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
||||
@Override
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<string name="identifier_not_found">"Identifier %s is not found"</string>
|
||||
<string name="enter_manual">Enter the card number</string>
|
||||
<string name="enter_phone">Phone 79XXXXXXXXX</string>
|
||||
<string name="error_contact_support">You can use manual input or call the number:\n%s</string>
|
||||
<string name="error_contact_support">You can use manual input or call the number:%s</string>
|
||||
<string name="ID_Store">Store ID</string>
|
||||
<string name="ID_not_found">Identifier %s is not found</string>
|
||||
<string name="app_activ">The application is activated</string>
|
||||
@@ -74,11 +74,11 @@ Store log in screen is the first thing you will see after starting the applicati
|
||||
|
||||
Enter the store number (ID). You can look it up in the loyalty program control panel. If you do not have access to the control panel, ask the administrator.
|
||||
|
||||
Click the ""Login"" button.
|
||||
Click the "Login" button.
|
||||
|
||||
Please wait while the administrator activates your request. You can refresh your store activation status by pressing the "Update activation status" button.
|
||||
|
||||
After the administrator activates your request, click the ""Complete activation"" button. The application is ready to use.
|
||||
After the administrator activates your request, click the "Complete activation" button. The application is ready to use.
|
||||
|
||||
If you want to log in as another store, click the Menu button (upper right corner of the screen) and select "Exit".
|
||||
</string>
|
||||
@@ -92,11 +92,11 @@ If the scan is successful, the customer's information will appear on the screen.
|
||||
|
||||
Step 2:
|
||||
|
||||
Enter the purchase amount and click the ""Create a purchase"" button.
|
||||
Enter the purchase amount and click the "Create a purchase" button.
|
||||
|
||||
In a pop-up window press ""YES"" to confirm the amount and allot the points to a customer.
|
||||
In a pop-up window press "YES" to confirm the amount and allot the points to a customer.
|
||||
|
||||
If you want to correct the amount, press ""NO"" and you will return back to the purchase screen where you can adjust the amount.
|
||||
If you want to correct the amount, press "NO" and you will return back to the purchase screen where you can adjust the amount.
|
||||
</string>
|
||||
|
||||
<string name="support_guide">
|
||||
|
||||
@@ -64,12 +64,12 @@ Store log in screen is the first thing you will see after starting the applicati
|
||||
Enter the store number (DIN). You can look it up in the loyalty program control panel. If you do
|
||||
not have access to the control panel, ask the administrator.
|
||||
|
||||
Click the ""Login"" button.
|
||||
Click the "Login" button.
|
||||
|
||||
Please wait while the administrator activates your request. You can refresh your store activation
|
||||
status by pressing the ""Update activation status"" button.
|
||||
status by pressing the "Update activation status" button.
|
||||
|
||||
After the administrator activates your request, click the ""Complete activation"" button. The
|
||||
After the administrator activates your request, click the "Complete activation" button. The
|
||||
application is ready to use.
|
||||
|
||||
If you want to log in as another store, click the Menu button (upper right corner of the screen)
|
||||
@@ -84,11 +84,11 @@ If the scan is successful, the customer's information will appear on the screen.
|
||||
|
||||
Step 2:
|
||||
|
||||
Enter the purchase amount and click the ""Create a purchase"" button.
|
||||
Enter the purchase amount and click the "Create a purchase" button.
|
||||
|
||||
In a pop-up window press ""YES"" to confirm the amount and allot the points to a customer.
|
||||
In a pop-up window press "YES" to confirm the amount and allot the points to a customer.
|
||||
|
||||
If you want to correct the amount, press ""NO"" and you will return back to the purchase screen
|
||||
If you want to correct the amount, press "NO" and you will return back to the purchase screen
|
||||
where you can adjust the amount.
|
||||
</string>
|
||||
<string name="support_guide">
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
|
||||
После подтверждения запроса на активацию программы Партнером/менеджером кликните по кнопке «Завершить регистрацию», приложение готово к использованию.
|
||||
|
||||
При желании изменить ID магазина, необходимо нажать на кнопку Меню (верхний правый угол экрана) и выбрать "Выход".
|
||||
При желании изменить ID магазина, необходимо нажать на кнопку Меню (верхний правый угол экрана) и выбрать «Выход».
|
||||
</string>
|
||||
|
||||
<string name="usage_guide">
|
||||
@@ -93,7 +93,7 @@
|
||||
|
||||
Введите сумму покупки данного покупателя и нажмите на кнопку «Проведение покупки».
|
||||
|
||||
Во всплывающем окне нажмите ""ДА"", для подтверждения суммы покупки
|
||||
Во всплывающем окне нажмите «ДА», для подтверждения суммы покупки
|
||||
|
||||
Если вы хотите поправить сумму, нажмите «НЕТ» и Вы вернетесь на экран покупки и сможете её скорректировать.
|
||||
</string>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<string name="identifier_not_found">"Ідентифікатор %s не знайден</string>
|
||||
<string name="enter_manual">Введіть штрихкод вручну</string>
|
||||
<string name="enter_phone">Телефон 79XXXXXXXXX</string>
|
||||
<string name="error_contact_support">Можете скористатися ручним введенням або зателефонувати на номер:\n%s</string>
|
||||
<string name="error_contact_support">Можете скористатися ручним введенням або зателефонувати на номер:%s</string>
|
||||
<string name="ID_Store">ID магазину</string>
|
||||
<string name="ID_not_found">Ідентифікатор %s не знайден</string>
|
||||
<string name="app_activ">Додаток активований</string>
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>BuildLocationStyle</key>
|
||||
<string>UseTargetSettings</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -1,7 +1,9 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:checker/screens/faq.dart';
|
||||
import 'package:checker/screens/purchase.dart';
|
||||
import 'package:checker/screens/registration.dart';
|
||||
import 'package:checker/screens/settings.dart';
|
||||
import 'package:checker/screens/splash.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
@@ -19,13 +21,18 @@ const platform = const MethodChannel('com.dinect.checker/instance_id');
|
||||
pushRouteReplacement(BuildContext context, Widget widget) {
|
||||
var route =
|
||||
new MaterialPageRoute<Null>(builder: (BuildContext context) => widget);
|
||||
new Future.delayed(const Duration(milliseconds: 200), () {
|
||||
Navigator.of(context).pushReplacement(route);
|
||||
});
|
||||
}
|
||||
|
||||
pushRoute(BuildContext context, Widget widget) {
|
||||
var route =
|
||||
new MaterialPageRoute<Null>(builder: (BuildContext context) => widget);
|
||||
new MaterialPageRoute<Null>(builder: (BuildContext context) => widget, fullscreenDialog: true);
|
||||
new Future.delayed(const Duration(milliseconds: 200), ()
|
||||
{
|
||||
Navigator.of(context).push(route);
|
||||
});
|
||||
}
|
||||
|
||||
// Добавление route, с возможностью вернуться к предыдущему экрану.
|
||||
@@ -37,24 +44,24 @@ faq(SqliteHelper helper, String app, BuildContext context,
|
||||
// В методе отправляется запрос на удаление токена кассы, очищаются SharedPreferences приложения.
|
||||
logout(BuildContext context, SqliteHelper helper) async {
|
||||
String token = await helper.getToken();
|
||||
// String locale = await helper.getLocale();
|
||||
|
||||
VoidCallback positiveCallback = () {
|
||||
if (token != null) {
|
||||
getDeleteTokenRequest(token).then((response) {
|
||||
helper.clear().then((result) {
|
||||
// helper.close().then((_) {
|
||||
// Navigator.of(context).pop();
|
||||
// Navigator.of(context).pop();
|
||||
pushRouteReplacement(context, new SplashScreen()); // Запускаем регистрацию
|
||||
// });
|
||||
platform.invokeMethod('getFlavor').then((flavor) {
|
||||
while (Navigator.of(context).canPop()) {
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
pushRouteReplacement(context, new RegistrationScreen(helper, flavor));
|
||||
});
|
||||
});
|
||||
}).catchError((error) {
|
||||
print(error.toString());
|
||||
});
|
||||
} else {
|
||||
while (Navigator.of(context).canPop()) {
|
||||
Navigator.of(context).pop();
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -62,43 +69,15 @@ logout(BuildContext context, SqliteHelper helper) async {
|
||||
StringsLocalization.askChangeStore(), positiveCallback);
|
||||
}
|
||||
|
||||
forceLogout(String token, BuildContext context) async {
|
||||
getDeleteTokenRequest(token).then((response) {
|
||||
SqliteHelper helper = new SqliteHelper();
|
||||
helper.open().then((_) {
|
||||
helper.clear().then((_) {
|
||||
// helper.close().then((_) {
|
||||
while (Navigator.of(context).canPop()) {
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
pushRouteReplacement(context, new SplashScreen());
|
||||
// });
|
||||
});
|
||||
});
|
||||
}).catchError((error) {
|
||||
print(error.toString());
|
||||
});
|
||||
}
|
||||
|
||||
/// Запуск спецефичной для каждой платформы части приложения - сканера.
|
||||
/// Может производиться с нескольких экранов (splash, finish_registration).
|
||||
startScanner(BuildContext context, String app, SqliteHelper helper) async {
|
||||
if (helper == null) {
|
||||
helper = new SqliteHelper();
|
||||
helper.open().then((_) {
|
||||
startScanner(context, app, helper);
|
||||
});
|
||||
} else {
|
||||
String token = await helper.getToken();
|
||||
// Канал ловит вызовы методов из "нативной" части приложения.
|
||||
// Могут быть вызваны либо exit либо faq, либо purchase.
|
||||
if (token != null) {
|
||||
platform.setMethodCallHandler((MethodCall call) async {
|
||||
print('flutter handler');
|
||||
print(call.method);
|
||||
|
||||
if (call.method == 'findUser') {
|
||||
|
||||
var userResponse;
|
||||
String cardPhone = call.arguments[0];
|
||||
|
||||
@@ -111,7 +90,6 @@ startScanner(BuildContext context, String app, SqliteHelper helper) async {
|
||||
userResponse = await getUserByPhone(cardPhone, token);
|
||||
break;
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
print(error.toString());
|
||||
}
|
||||
@@ -131,8 +109,6 @@ startScanner(BuildContext context, String app, SqliteHelper helper) async {
|
||||
startScanner(context, app, helper);
|
||||
throw new FlutterError("Users not found");
|
||||
}
|
||||
|
||||
|
||||
} else if (call.method == 'faq') {
|
||||
faq(helper, app, context, true);
|
||||
} else if (call.method == 'settings') {
|
||||
@@ -150,13 +126,7 @@ startScanner(BuildContext context, String app, SqliteHelper helper) async {
|
||||
|
||||
String card = call.arguments[1];
|
||||
print('$userString, $card');
|
||||
var route = new MaterialPageRoute<Null>(
|
||||
builder: (BuildContext context) =>
|
||||
new PurchaseScreen(helper, app, userString, card));
|
||||
while (Navigator.of(context).canPop()) {
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
Navigator.of(context).pushReplacement(route);
|
||||
pushRouteReplacement(context, new PurchaseScreen(helper, app, userString, card));
|
||||
}
|
||||
});
|
||||
|
||||
@@ -166,13 +136,15 @@ startScanner(BuildContext context, String app, SqliteHelper helper) async {
|
||||
'url': await platform.invokeMethod('getEndpoint'),
|
||||
'appToken': await platform.invokeMethod('getAppToken'),
|
||||
'localeCode': StringsLocalization.localeCode,
|
||||
'color': Resources.getPrimaryColor(app).value.toString()
|
||||
'color': Resources
|
||||
.getPrimaryColor(app)
|
||||
.value
|
||||
.toString()
|
||||
});
|
||||
|
||||
platform.invokeMethod('startScanner', args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Запуск диалога с двумя кнопками
|
||||
showYesNoDialog(BuildContext context, String title, String content,
|
||||
|
||||
@@ -7,7 +7,6 @@ class Resources {
|
||||
}
|
||||
|
||||
static String getSplash(String app) {
|
||||
// app != null ? app :
|
||||
return 'assets/${'pip'}_splash.png';
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ class PurchaseScreenState<T> extends BaseState<PurchaseScreen> {
|
||||
setState(() {
|
||||
requestAsyncData(user);
|
||||
});
|
||||
return getMainWidget();
|
||||
return new WillPopScope(onWillPop: onWillPop, child: getMainWidget());
|
||||
}
|
||||
|
||||
bool purchaseInProgress = false;
|
||||
@@ -423,4 +423,8 @@ class PurchaseScreenState<T> extends BaseState<PurchaseScreen> {
|
||||
print('kifio ' + this.loyalty);
|
||||
print('bonus ' + this.bonus);
|
||||
}
|
||||
|
||||
onWillPop() {
|
||||
return startScanner(context, app, helper);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user