mod: 取消投币限制&布局
This commit is contained in:
@ -2,6 +2,7 @@ import 'dart:async';
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||||
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:hive/hive.dart';
|
import 'package:hive/hive.dart';
|
||||||
import 'package:pilipala/http/constants.dart';
|
import 'package:pilipala/http/constants.dart';
|
||||||
@ -196,35 +197,29 @@ class VideoIntroController extends GetxController {
|
|||||||
SmartDialog.showToast('账号未登录');
|
SmartDialog.showToast('账号未登录');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (hasCoin.value) {
|
|
||||||
SmartDialog.showToast('已投过币了');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
showDialog(
|
showDialog(
|
||||||
context: Get.context!,
|
context: Get.context!,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
title: const Text('选择投币个数'),
|
title: const Text('选择投币个数'),
|
||||||
contentPadding: const EdgeInsets.fromLTRB(0, 12, 0, 24),
|
contentPadding: const EdgeInsets.fromLTRB(0, 12, 0, 24),
|
||||||
content: StatefulBuilder(builder: (context, StateSetter setState) {
|
content: Column(
|
||||||
return Column(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [1, 2]
|
children: [1, 2]
|
||||||
.map(
|
.map(
|
||||||
(e) => RadioListTile(
|
(e) => ListTile(
|
||||||
value: e,
|
title: Padding(
|
||||||
title: Text('$e枚'),
|
padding: const EdgeInsets.only(left: 20),
|
||||||
groupValue: _tempThemeValue,
|
child: Text('$e 枚'),
|
||||||
onChanged: (value) async {
|
),
|
||||||
_tempThemeValue = value!;
|
onTap: () async {
|
||||||
setState(() {});
|
var res =
|
||||||
var res = await VideoHttp.coinVideo(
|
await VideoHttp.coinVideo(bvid: bvid, multiply: e);
|
||||||
bvid: bvid, multiply: _tempThemeValue);
|
|
||||||
if (res['status']) {
|
if (res['status']) {
|
||||||
SmartDialog.showToast('投币成功');
|
SmartDialog.showToast('投币成功');
|
||||||
hasCoin.value = true;
|
hasCoin.value = true;
|
||||||
videoDetail.value.stat!.coin =
|
videoDetail.value.stat!.coin =
|
||||||
videoDetail.value.stat!.coin! + _tempThemeValue;
|
videoDetail.value.stat!.coin! + e;
|
||||||
} else {
|
} else {
|
||||||
SmartDialog.showToast(res['msg']);
|
SmartDialog.showToast(res['msg']);
|
||||||
}
|
}
|
||||||
@ -233,8 +228,7 @@ class VideoIntroController extends GetxController {
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
.toList(),
|
.toList(),
|
||||||
);
|
),
|
||||||
}),
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user