Рассчет вознаграждения по правильной формуле
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="com.dinect.checker"
|
package="com.dinect.checker"
|
||||||
android:versionCode="1"
|
android:versionCode="1"
|
||||||
android:versionName="0.1">
|
android:versionName="0.3">
|
||||||
|
|
||||||
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="21" />
|
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="21" />
|
||||||
|
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ class PurchaseScreenState<T> extends BaseState<PurchaseScreen> {
|
|||||||
if (await platform.invokeMethod('isOnline')) {
|
if (await platform.invokeMethod('isOnline')) {
|
||||||
|
|
||||||
var headers = {
|
var headers = {
|
||||||
'DM-Authorization': 'dmapptoken 9fec83cdca38c357e6b65dbb17514cdd36bf2a08',
|
'DM-Authorization': 'dmapptoken $appToken',
|
||||||
'Authorization': 'dmtoken ${token}'
|
'Authorization': 'dmtoken ${token}'
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -121,7 +121,8 @@ class PurchaseScreenState<T> extends BaseState<PurchaseScreen> {
|
|||||||
this.loyality = '${user['discount']}%';
|
this.loyality = '${user['discount']}%';
|
||||||
} else {
|
} else {
|
||||||
List amountToBonus = bonuses['amount_to_bonus'];
|
List amountToBonus = bonuses['amount_to_bonus'];
|
||||||
this.loyality = '${(amountToBonus[0] / double.parse(amountToBonus[1])).toStringAsFixed(0)}%';
|
double loyalityVal = (double.parse(amountToBonus[1]) / amountToBonus[0]) * 100;
|
||||||
|
this.loyality = '${loyalityVal.toStringAsFixed(0)}%';
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}).catchError((error) {
|
}).catchError((error) {
|
||||||
@@ -183,7 +184,7 @@ class PurchaseScreenState<T> extends BaseState<PurchaseScreen> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
var headers = {
|
var headers = {
|
||||||
'DM-Authorization': 'dmapptoken 9fec83cdca38c357e6b65dbb17514cdd36bf2a08',
|
'DM-Authorization': 'dmapptoken $appToken',
|
||||||
'Authorization': 'dmtoken ${token}'
|
'Authorization': 'dmtoken ${token}'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ class SplashScreen extends StatelessWidget {
|
|||||||
} else {
|
} else {
|
||||||
|
|
||||||
Map statusResponseMap = JSON.decode(statusResponse.body);
|
Map statusResponseMap = JSON.decode(statusResponse.body);
|
||||||
bool active = statusResponseMap['active'];
|
bool active = statusResponseMap['active'] == null ? false : statusResponseMap['active'];
|
||||||
|
|
||||||
if (active) {
|
if (active) {
|
||||||
startScanner(context);
|
startScanner(context);
|
||||||
|
|||||||
Reference in New Issue
Block a user