更改提交

master
王亚玲 2 years ago
parent 3bb7c372f6
commit 741c103161

@ -19,7 +19,23 @@ if (flutterVersionCode == null) {
def flutterVersionName = localProperties.getProperty('flutter.versionName') def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) { if (flutterVersionName == null) {
flutterVersionName = '1.0' flutterVersionName = '1.0'
}else{
//
def tem1=Integer.parseInt(flutterVersionName.substring(flutterVersionName.lastIndexof(".")+1,flutterVersionName.length()))
tem1++
//localPropertiesfluttervarsionName
def newVersionName=flutterVersionName.substring(0,flutterVersionName.lastIndexof(".")+1)+tem1
localProperties.setProperty("flutter.versionName",newVersionName)
flutterVersionName=newVersionName
//localproperyiesstring,local.properties
def newLocalProperties=localProperties.toString()
newLocalProperties =newLocalProperties.replace(",","\n")
newLocalProperties =newLocalProperties.replace("{","")
newLocalProperties =newLocalProperties.replace("}","")
localPropertiesFile.write(newLocalProperties)
} }
def keystoreProperties = new Properties() def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties') def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) { if (keystorePropertiesFile.exists()) {

@ -209,8 +209,8 @@ class UserProvider extends ChangeNotifier {
for (int i = 0; i < numberList.length; i++) { for (int i = 0; i < numberList.length; i++) {
numList.add(numberList[i].phone); numList.add(numberList[i].phone);
} }
await prefs.setStringList("specified", numList ?? []); await prefs.setStringList("specified", numList);
await prefs.setStringList("addressList", numbers ?? []); await prefs.setStringList("addressList", numbers);
service.invoke("stopService"); service.invoke("stopService");
if (prefs.getBool('kg')!) { if (prefs.getBool('kg')!) {

@ -58,7 +58,7 @@ class _CallingIdleListState extends State<CallingIdleList>
Future<void> getSwitch() async { Future<void> getSwitch() async {
final SharedPreferences prefs = await _prefs; final SharedPreferences prefs = await _prefs;
val = prefs.getBool(widget.name!)!; val = prefs.getBool(widget.name!) ?? false;
print(val); print(val);
} }
@ -180,7 +180,7 @@ class _CallingIdleListState extends State<CallingIdleList>
setState(() { setState(() {
val = value; val = value;
prefs.remove(widget.name!); prefs.remove(widget.name!);
prefs.setBool(widget.name!, val); prefs.setBool(widget.name!, val );
}); });
service.invoke("stopService"); service.invoke("stopService");
if (prefs.getBool('kg')!) { if (prefs.getBool('kg')!) {

@ -192,18 +192,18 @@ class _PhoneSetPageState extends State<PhoneSetPage> {
final service = FlutterBackgroundService(); final service = FlutterBackgroundService();
return GestureDetector( return GestureDetector(
onTap: () async { onTap: () async {
// final SharedPreferences prefs = await SharedPreferences.getInstance(); final SharedPreferences prefs = await SharedPreferences.getInstance();
// select = index; select = index;
// await prefs.setInt("numIndex", index); await prefs.setInt("numIndex", index);
// service.invoke("stopService"); service.invoke("stopService");
// if (prefs.getBool('kg')!) { if (prefs.getBool('kg') ?? false) {
// Future.delayed(const Duration(seconds: 1), () async { Future.delayed(const Duration(seconds: 1), () async {
// service.startService(); service.startService();
// }); });
// } }
//
// UserTool.userProvider.viewLoading(); UserTool.userProvider.viewLoading();
// _refreshController.callRefresh(); _refreshController.callRefresh();
// print(_selectIndex); // print(_selectIndex);
setState(() {}); setState(() {});
}, },
@ -228,17 +228,17 @@ class _PhoneSetPageState extends State<PhoneSetPage> {
height: 40.w, height: 40.w,
child: Radio( child: Radio(
onChanged: (int? value) async{ onChanged: (int? value) async{
final SharedPreferences prefs = await SharedPreferences.getInstance(); // final SharedPreferences prefs = await SharedPreferences.getInstance();
select = index; // select = index;
await prefs.setInt("numIndex", index); // await prefs.setInt("numIndex", index);
service.invoke("stopService"); // service.invoke("stopService");
if (prefs.getBool('kg')!) { // if (prefs.getBool('kg')!) {
Future.delayed(const Duration(seconds: 1), () async { // Future.delayed(const Duration(seconds: 1), () async {
service.startService(); // service.startService();
}); // });
} // }
UserTool.userProvider.viewLoading(); // UserTool.userProvider.viewLoading();
_refreshController.callRefresh(); // _refreshController.callRefresh();
// select = index; // select = index;
// print(_selectIndex); // print(_selectIndex);
setState(() {}); setState(() {});

@ -75,6 +75,7 @@ class _UserCardPageState extends State<UserCardPage> {
}else{ }else{
var res= await UserInfoFunc.getAddVip(cardMi); var res= await UserInfoFunc.getAddVip(cardMi);
if(res){ if(res){
// Navigator.pop(context,true);
Get.back(); Get.back();
} }
// CloudToast.show("卡密兑换成功"); // CloudToast.show("卡密兑换成功");

@ -122,6 +122,7 @@ class _UserPageState extends State<UserPage> {
_getRequests(); _getRequests();
// await UserTool.userProvider.updateUserInfo(); // await UserTool.userProvider.updateUserInfo();
if (UserTool.userProvider.isLogin) { if (UserTool.userProvider.isLogin) {
// var res=await apiClient.request(API.app.trialVip); // var res=await apiClient.request(API.app.trialVip);
if (UserTool.userProvider.userInfo.isTrial == 0) { if (UserTool.userProvider.userInfo.isTrial == 0) {
showDialog( showDialog(
@ -145,7 +146,9 @@ class _UserPageState extends State<UserPage> {
// UserTool.userProvider.userInfo.end * 1000, // UserTool.userProvider.userInfo.end * 1000,
// format: DateFormats.y_mo_d); // format: DateFormats.y_mo_d);
} else { } else {
vle = false; vle = false;
Get.to(()=>const LoginPage());
} }
setState(() {}); setState(() {});
}, },
@ -293,14 +296,17 @@ class _UserPageState extends State<UserPage> {
} else { } else {
isVip = true; isVip = true;
vle = await service.isRunning(); vle = await service.isRunning();
_easyRefreshController.callRefresh();
} }
//service.isRunning() as bool; //service.isRunning() as bool;
// endDate = DateUtil.formatDateMs( // endDate = DateUtil.formatDateMs(
// UserTool.userProvider.userInfo.end * 1000, // UserTool.userProvider.userInfo.end * 1000,
// format: DateFormats.y_mo_d); // format: DateFormats.y_mo_d);
} else { } else {
vle = false; vle = false;
} }
//
setState(() {}); setState(() {});
} }
@ -420,20 +426,25 @@ class _UserPageState extends State<UserPage> {
print("true"); print("true");
prefs.remove("kg"); prefs.remove("kg");
prefs.setBool("kg", vle); prefs.setBool("kg", vle);
// Future.delayed(const Duration(seconds: 1), () async {
// service.startService();
// });
service.startService(); service.startService();
// WidgetsFlutterBinding.ensureInitialized(); // WidgetsFlutterBinding.ensureInitialized();
// initializeService(); // initializeService();
// UserTool.userProvider.setKg(vle) // UserTool.userProvider.setKg(vle)
// initializeService(); // initializeService();
initializeService(); // initializeService();
BotToast.showText(text: " 你开启了该功能"); BotToast.showText(text: " 你开启了该功能");
// initializeService(); // initializeService();
// print("这是数据${prefs.getBool("kg")}"); // print("这是数据${prefs.getBool("kg")}");
} else { } else {
prefs.remove("kg"); prefs.remove("kg");
prefs.setBool("kg", vle); prefs.setBool("kg", vle);
// Future.delayed(const Duration(seconds: 1), () async {
// service.invoke("stopService");
// });
service.invoke("stopService"); service.invoke("stopService");
/// ///
// exit(0); // exit(0);
// UserTool.userProvider.setKg(vle); // UserTool.userProvider.setKg(vle);
@ -476,18 +487,24 @@ class _UserPageState extends State<UserPage> {
)); ));
break; break;
case "卡密兑换": case "卡密兑换":
Navigator.of(context) Navigator.of(context)
.push( .push(
MaterialPageRoute(builder: (_) => const UserCardPage()), MaterialPageRoute(builder: (_) => const UserCardPage()),
) )
.then((val) => _easyRefreshController.callRefresh()); .then((val) => _getRequests()
// _easyRefreshController.callRefresh()
);
break; break;
default: default:
break; break;
} }
} }
}, },
child: Container( child: Container(
padding: EdgeInsets.symmetric(horizontal: 32.w), padding: EdgeInsets.symmetric(horizontal: 32.w),
child: ListTile( child: ListTile(

Loading…
Cancel
Save