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