master
王亚玲 2 years ago
parent 83052cf5e8
commit 3bb7c372f6

@ -77,6 +77,9 @@ class _Content{
///
String get trialVip => '/app/user/trialVip';
///
String get redeemVip => '/app/user/redeem';
}
class _Pay {

@ -0,0 +1,19 @@
import 'package:project_telephony/model/network/api_client.dart';
import 'package:project_telephony/model/network/base_model.dart';
import '../../../../constants/api.dart';
import '../../../../utils/toast/cloud_toast.dart';
class UserInfoFunc {
static Future<bool> getAddVip(String code) async {
BaseModel res =
await apiClient.request(API.content.redeemVip, data: {"code": code});
if(res.code==0){
CloudToast.show("卡密兑换成功");
return true;
}else{
CloudToast.show(res.msg);
return false;
}
}
}

@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:project_telephony/base/base_style.dart';
import 'package:project_telephony/ui/home/set/func/user_info_func.dart';
import 'package:project_telephony/ui/widget/plone_bottom.dart';
import 'package:project_telephony/utils/headers.dart';
import 'package:project_telephony/utils/toast/cloud_toast.dart';
@ -68,11 +69,15 @@ class _UserCardPageState extends State<UserCardPage> {
88.hb,
PloneBottom(
blM: false,
onTap: () {
onTap: () async{
if(cardMi.isEmpty){
CloudToast.show("卡密为空");
}else{
CloudToast.show("卡密兑换成功");
var res= await UserInfoFunc.getAddVip(cardMi);
if(res){
Get.back();
}
// CloudToast.show("卡密兑换成功");
}
},
border: cardMi.isEmpty?true:false,

@ -114,6 +114,7 @@ class _UserPageState extends State<UserPage> {
children: [
Expanded(
child: EasyRefresh(
controller: _easyRefreshController,
firstRefresh: true,
header: MaterialHeader(),
onRefresh: () async {
@ -475,7 +476,12 @@ class _UserPageState extends State<UserPage> {
));
break;
case "卡密兑换":
Get.to(()=>UserCardPage());
Navigator.of(context)
.push(
MaterialPageRoute(builder: (_) => const UserCardPage()),
)
.then((val) => _easyRefreshController.callRefresh());
break;
default:
break;

Loading…
Cancel
Save