|
|
@ -74,6 +74,7 @@ class _MembersPageState extends State<MembersPage> {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void _paySuccess() {
|
|
|
|
void _paySuccess() {
|
|
|
|
_easyRefreshController.callRefresh();
|
|
|
|
_easyRefreshController.callRefresh();
|
|
|
|
|
|
|
|
// Get.offAll(const TabNavigator(index: 1,));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
@ -121,15 +122,15 @@ class _MembersPageState extends State<MembersPage> {
|
|
|
|
Get.snackbar('提示', "请先选择充值月份");
|
|
|
|
Get.snackbar('提示', "请先选择充值月份");
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if (_selectIndex == 0) {
|
|
|
|
if (_selectIndex == 0) {
|
|
|
|
print("这是数据${_piceList[_selectIndex].pice}");
|
|
|
|
// print("这是数据${_chooseItem?.pice}");
|
|
|
|
_wxPayFunc(_piceList[_selectIndex].pice);
|
|
|
|
_wxPayFunc(_chooseItem?.pice);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
var result =
|
|
|
|
var result =
|
|
|
|
await isAliPayInstalled(); // 这里判断是否安装支付宝
|
|
|
|
await isAliPayInstalled(); // 这里判断是否安装支付宝
|
|
|
|
if (!result) {
|
|
|
|
if (!result) {
|
|
|
|
Get.snackbar('提示', "请先安装支付宝");
|
|
|
|
Get.snackbar('提示', "请先安装支付宝");
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
_aliPay();
|
|
|
|
_aliPay(_chooseItem?.pice);
|
|
|
|
// aliPay("paySign").then((payResult) {
|
|
|
|
// aliPay("paySign").then((payResult) {
|
|
|
|
// // map["paySign"]是请求接口返回的字符串直接放进去就好了
|
|
|
|
// // map["paySign"]是请求接口返回的字符串直接放进去就好了
|
|
|
|
// print("支付宝:$payResult");
|
|
|
|
// print("支付宝:$payResult");
|
|
|
@ -249,14 +250,14 @@ class _MembersPageState extends State<MembersPage> {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Future _wxPayFunc(double pay) async {
|
|
|
|
Future _wxPayFunc(double? pay) async {
|
|
|
|
bool isInstalled = await fluwx.isWeChatInstalled;
|
|
|
|
bool isInstalled = await fluwx.isWeChatInstalled;
|
|
|
|
if (!isInstalled) {
|
|
|
|
if (!isInstalled) {
|
|
|
|
BotToast.showText(text: "请先安装微信");
|
|
|
|
BotToast.showText(text: "请先安装微信");
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//调起支付
|
|
|
|
//调起支付
|
|
|
|
_wxPay(pay);
|
|
|
|
_wxPay(pay!);
|
|
|
|
// var wxPayModel = WxPayModel.fromJson({
|
|
|
|
// var wxPayModel = WxPayModel.fromJson({
|
|
|
|
// "prepayId": "wx121434071826969924754d7d3309520000",
|
|
|
|
// "prepayId": "wx121434071826969924754d7d3309520000",
|
|
|
|
// "partnerId": "1622850618",
|
|
|
|
// "partnerId": "1622850618",
|
|
|
@ -291,9 +292,9 @@ class _MembersPageState extends State<MembersPage> {
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
//
|
|
|
|
Future _aliPay() async {
|
|
|
|
Future _aliPay(double? pay) async {
|
|
|
|
var base = await apiClient.request(API.pay.alipay, data: {
|
|
|
|
var base = await apiClient.request(API.pay.alipay, data: {
|
|
|
|
'amount': nowPrice,//注释
|
|
|
|
'amount': pay,//注释
|
|
|
|
// 'amount': 0.01,
|
|
|
|
// 'amount': 0.01,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
if (base.code == 0) {
|
|
|
|
if (base.code == 0) {
|
|
|
|