|
|
@ -20,9 +20,9 @@ import 'package:tobias/tobias.dart' as tobias; |
|
|
|
|
|
|
|
|
|
|
|
class VipTop extends StatefulWidget { |
|
|
|
class VipTop extends StatefulWidget { |
|
|
|
final VipCardHome vipCardHome; |
|
|
|
final VipCardHome vipCardHome; |
|
|
|
final Function onRefresh; |
|
|
|
final Function queryVipHome; |
|
|
|
|
|
|
|
|
|
|
|
VipTop(this.vipCardHome, this.onRefresh); |
|
|
|
VipTop(this.vipCardHome, this.queryVipHome); |
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
@override |
|
|
|
State<StatefulWidget> createState() { |
|
|
|
State<StatefulWidget> createState() { |
|
|
@ -42,7 +42,7 @@ class _VipTop extends State<VipTop> { |
|
|
|
payListen = weChatResponseEventHandler.listen((event) async { |
|
|
|
payListen = weChatResponseEventHandler.listen((event) async { |
|
|
|
print("payCallback: ${event.errCode}"); |
|
|
|
print("payCallback: ${event.errCode}"); |
|
|
|
if (event.errCode == 0) { |
|
|
|
if (event.errCode == 0) { |
|
|
|
widget.onRefresh(); |
|
|
|
widget.queryVipHome(); |
|
|
|
SmartDialog.showToast("支付成功", alignment: Alignment.center); |
|
|
|
SmartDialog.showToast("支付成功", alignment: Alignment.center); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
SmartDialog.showToast("支付失败", alignment: Alignment.center); |
|
|
|
SmartDialog.showToast("支付失败", alignment: Alignment.center); |
|
|
@ -96,7 +96,7 @@ class _VipTop extends State<VipTop> { |
|
|
|
tobias.aliPay(baseData.data["body"]).then((payRes) { |
|
|
|
tobias.aliPay(baseData.data["body"]).then((payRes) { |
|
|
|
if (payRes['resultStatus'] == 9000 || |
|
|
|
if (payRes['resultStatus'] == 9000 || |
|
|
|
payRes['resultStatus'] == '9000') { |
|
|
|
payRes['resultStatus'] == '9000') { |
|
|
|
widget.onRefresh(); |
|
|
|
widget.queryVipHome(); |
|
|
|
SmartDialog.showToast("支付成功", |
|
|
|
SmartDialog.showToast("支付成功", |
|
|
|
alignment: Alignment.center); |
|
|
|
alignment: Alignment.center); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|