|
@@ -148,6 +148,10 @@ class MyApp extends StatelessWidget with WidgetsBindingObserver {
|
|
|
|
|
|
|
|
@override
|
|
@override
|
|
|
Widget build(BuildContext context) {
|
|
Widget build(BuildContext context) {
|
|
|
|
|
+ SystemChrome.setPreferredOrientations([
|
|
|
|
|
+ DeviceOrientation.portraitUp, //只能纵向
|
|
|
|
|
+ DeviceOrientation.portraitDown, //只能纵向
|
|
|
|
|
+ ]);
|
|
|
return RefreshConfiguration(
|
|
return RefreshConfiguration(
|
|
|
child: MaterialApp(
|
|
child: MaterialApp(
|
|
|
navigatorKey: navigatorKey,
|
|
navigatorKey: navigatorKey,
|
|
@@ -239,8 +243,12 @@ class MyApp extends StatelessWidget with WidgetsBindingObserver {
|
|
|
|
|
|
|
|
var orderHash;
|
|
var orderHash;
|
|
|
|
|
|
|
|
|
|
+ //最大金额赢家数量 0---发送订单的人不是最大赢家 1---发订单的人是最大赢家 2---发订单的人是最大赢家且有两个一样的金额
|
|
|
|
|
+ int commissionPayerNum = -1;
|
|
|
|
|
+
|
|
|
//匹配模板去除不是自己的订单
|
|
//匹配模板去除不是自己的订单
|
|
|
void checkOrder(List<TemplateBeanData> data) {
|
|
void checkOrder(List<TemplateBeanData> data) {
|
|
|
|
|
+ commissionPayerNum = -1;
|
|
|
bool hasMatch = false;
|
|
bool hasMatch = false;
|
|
|
w:
|
|
w:
|
|
|
for (int i = 0; i < data.length; i++) {
|
|
for (int i = 0; i < data.length; i++) {
|
|
@@ -248,9 +256,37 @@ class MyApp extends StatelessWidget with WidgetsBindingObserver {
|
|
|
var res = parseString2(
|
|
var res = parseString2(
|
|
|
data[i].template.replaceAll('\r', ''), '''$clipboardT''');
|
|
data[i].template.replaceAll('\r', ''), '''$clipboardT''');
|
|
|
if (res != null) {
|
|
if (res != null) {
|
|
|
|
|
+ print('-----------data[i].template-----------');
|
|
|
print(data[i].template);
|
|
print(data[i].template);
|
|
|
print(json.encode(res));
|
|
print(json.encode(res));
|
|
|
var order = parse2(res);
|
|
var order = parse2(res);
|
|
|
|
|
+ print(order.toString());
|
|
|
|
|
+ var maxAmount = 0;
|
|
|
|
|
+ int maxAmountNum = 0;
|
|
|
|
|
+ order.forEach((element) {
|
|
|
|
|
+ if (maxAmount < element.seller.amount) {
|
|
|
|
|
+ maxAmount = element.seller.amount;
|
|
|
|
|
+ maxAmountNum = 1;
|
|
|
|
|
+ } else if (maxAmount == element.seller.amount) {
|
|
|
|
|
+ maxAmountNum++;
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ print('maxAmount---------$maxAmount');
|
|
|
|
|
+ print('maxAmountNum---------$maxAmountNum');
|
|
|
|
|
+ int meIsMaximum = order.indexWhere((element) =>
|
|
|
|
|
+ element.seller.amount == maxAmount &&
|
|
|
|
|
+ (element.seller.name
|
|
|
|
|
+ .contains(MyCookie().loginInformation.data.extra.name) ||
|
|
|
|
|
+ MyCookie()
|
|
|
|
|
+ .loginInformation
|
|
|
|
|
+ .data
|
|
|
|
|
+ .extra
|
|
|
|
|
+ .name
|
|
|
|
|
+ .contains(element.seller.name)));
|
|
|
|
|
+ if (meIsMaximum >= 0) {
|
|
|
|
|
+ commissionPayerNum = maxAmountNum;
|
|
|
|
|
+ }
|
|
|
|
|
+ print('commissionPayerNum-----------$commissionPayerNum');
|
|
|
order.removeWhere((element) =>
|
|
order.removeWhere((element) =>
|
|
|
!element.seller.name
|
|
!element.seller.name
|
|
|
.contains(MyCookie().loginInformation.data.extra.name) &&
|
|
.contains(MyCookie().loginInformation.data.extra.name) &&
|
|
@@ -622,7 +658,8 @@ class MyApp extends StatelessWidget with WidgetsBindingObserver {
|
|
|
'seller_name': MyCookie().loginInformation.data.extra.name,
|
|
'seller_name': MyCookie().loginInformation.data.extra.name,
|
|
|
'buyer_name': element.payer.name,
|
|
'buyer_name': element.payer.name,
|
|
|
'type': orderTypeThirdPlatform,
|
|
'type': orderTypeThirdPlatform,
|
|
|
- 'amount': NumUtil.multiply(element.payer.amount, element.factor)
|
|
|
|
|
|
|
+ 'amount': NumUtil.multiply(element.payer.amount, element.factor),
|
|
|
|
|
+ 'commission_payer_num': commissionPayerNum
|
|
|
}
|
|
}
|
|
|
}, (response, hasError) {
|
|
}, (response, hasError) {
|
|
|
if (!hasError) {
|
|
if (!hasError) {
|
|
@@ -1267,9 +1304,9 @@ class MyApp extends StatelessWidget with WidgetsBindingObserver {
|
|
|
}
|
|
}
|
|
|
}, (response, hasError) {
|
|
}, (response, hasError) {
|
|
|
if (!hasError) {
|
|
if (!hasError) {
|
|
|
- MyCookie().userBean.wxOpenid =entity.openid;
|
|
|
|
|
- MyCookie().userBean.wxName =entity.nickname;
|
|
|
|
|
- MyCookie().userBean.wxPicture =entity.headimgurl;
|
|
|
|
|
|
|
+ MyCookie().userBean.wxOpenid = entity.openid;
|
|
|
|
|
+ MyCookie().userBean.wxName = entity.nickname;
|
|
|
|
|
+ MyCookie().userBean.wxPicture = entity.headimgurl;
|
|
|
EventBus().emit('bindToWeChat');
|
|
EventBus().emit('bindToWeChat');
|
|
|
}
|
|
}
|
|
|
}, (error) {});
|
|
}, (error) {});
|