|
@@ -1,6 +1,7 @@
|
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
import 'package:flutter_redux/flutter_redux.dart';
|
|
import 'package:flutter_redux/flutter_redux.dart';
|
|
|
import 'package:flutter/cupertino.dart';
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
|
+import 'package:intl/intl.dart';
|
|
|
import '../redux/AppState.dart';
|
|
import '../redux/AppState.dart';
|
|
|
import '../model/ProductInfo.dart';
|
|
import '../model/ProductInfo.dart';
|
|
|
import '../widget/Dialog.dart';
|
|
import '../widget/Dialog.dart';
|
|
@@ -62,6 +63,7 @@ class RechargeState extends State<Recharge> {
|
|
|
List<ProductInfo> productInfoList = [];
|
|
List<ProductInfo> productInfoList = [];
|
|
|
int chooseMoney = 0;
|
|
int chooseMoney = 0;
|
|
|
ProductInfo chooseProduct;
|
|
ProductInfo chooseProduct;
|
|
|
|
|
+ int payWay = 1; // 类型 1普通 2微信支付宝
|
|
|
|
|
|
|
|
Future<void> getInfoList() async {
|
|
Future<void> getInfoList() async {
|
|
|
Toast.show(context, '加载中', -1, 'loading');
|
|
Toast.show(context, '加载中', -1, 'loading');
|
|
@@ -93,6 +95,15 @@ class RechargeState extends State<Recharge> {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ Result res3 = await HttpManager.get('systemVariable/get', data: {'name': "pay_channel"});
|
|
|
|
|
+
|
|
|
|
|
+ if (res3.success) {
|
|
|
|
|
+ print(res3.data);
|
|
|
|
|
+ setState(() {
|
|
|
|
|
+ payWay = int.parse(res3.data);
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
for (var item in productInfoList) {
|
|
for (var item in productInfoList) {
|
|
|
if (item.canUse) {
|
|
if (item.canUse) {
|
|
|
setState(() {
|
|
setState(() {
|
|
@@ -158,14 +169,18 @@ class RechargeState extends State<Recharge> {
|
|
|
children: <Widget>[
|
|
children: <Widget>[
|
|
|
Text(productInfoList[index].productName,
|
|
Text(productInfoList[index].productName,
|
|
|
style: TextStyle(
|
|
style: TextStyle(
|
|
|
- color: productInfoList[index].canUse ? Color(0xFFFFFFFF) : Color(0xFF666666), fontWeight: FontWeight.w500, fontSize: 15)),
|
|
|
|
|
|
|
+ color: productInfoList[index].canUse || payWay == 2 ? Color(0xFFFFFFFF) : Color(0xFF666666),
|
|
|
|
|
+ fontWeight: FontWeight.w500,
|
|
|
|
|
+ fontSize: 15)),
|
|
|
Container(
|
|
Container(
|
|
|
width: 10,
|
|
width: 10,
|
|
|
),
|
|
),
|
|
|
Text(
|
|
Text(
|
|
|
'¥' + productInfoList[index].money.toString(),
|
|
'¥' + productInfoList[index].money.toString(),
|
|
|
style: TextStyle(
|
|
style: TextStyle(
|
|
|
- color: productInfoList[index].canUse ? Color(0xFF727785) : Color(0xFF666666), fontWeight: FontWeight.w400, fontSize: 14),
|
|
|
|
|
|
|
+ color: productInfoList[index].canUse || payWay == 2 ? Color(0xFF727785) : Color(0xFF666666),
|
|
|
|
|
+ fontWeight: FontWeight.w400,
|
|
|
|
|
+ fontSize: 14),
|
|
|
)
|
|
)
|
|
|
],
|
|
],
|
|
|
),
|
|
),
|
|
@@ -178,7 +193,7 @@ class RechargeState extends State<Recharge> {
|
|
|
],
|
|
],
|
|
|
),
|
|
),
|
|
|
),
|
|
),
|
|
|
- onPressed: productInfoList[index].canUse
|
|
|
|
|
|
|
+ onPressed: productInfoList[index].canUse || payWay == 2
|
|
|
? () {
|
|
? () {
|
|
|
if (!isChoose) {
|
|
if (!isChoose) {
|
|
|
setState(() {
|
|
setState(() {
|
|
@@ -210,7 +225,7 @@ class RechargeState extends State<Recharge> {
|
|
|
if (res.success && res.data != null && res.data == 'true' && Platform.isIOS) {
|
|
if (res.success && res.data != null && res.data == 'true' && Platform.isIOS) {
|
|
|
MyDialog.showDialog(context, 'ios充值暂未开放');
|
|
MyDialog.showDialog(context, 'ios充值暂未开放');
|
|
|
} else {
|
|
} else {
|
|
|
- Navigator.push(context, CupertinoPageRoute(builder: (context) => ChoosePay(widget.type, chooseProduct)));
|
|
|
|
|
|
|
+ Navigator.push(context, CupertinoPageRoute(builder: (context) => ChoosePay(widget.type, chooseProduct, payWay)));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Toast.show(context, '加载中', -1, 'loading');
|
|
// Toast.show(context, '加载中', -1, 'loading');
|