Skip to content

Commit

Permalink
merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
guozhigq committed Mar 16, 2024
2 parents 13c7795 + 4865948 commit 1b54f07
Show file tree
Hide file tree
Showing 9 changed files with 421 additions and 733 deletions.
4 changes: 2 additions & 2 deletions lib/http/msg.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ class MsgHttp {
} catch (err) {
return {
'status': false,
'date': [],
'data': [],
'msg': err.toString(),
};
}
} else {
return {
'status': false,
'date': [],
'data': [],
'msg': res.data['message'],
};
}
Expand Down
57 changes: 15 additions & 42 deletions lib/pages/bangumi/introduction/controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,6 @@ class BangumiIntroController extends GetxController {
? int.tryParse(Get.parameters['epId']!)
: null;

// 是否预渲染 骨架屏
bool preRender = false;

// 视频详情 上个页面传入
Map? videoItem = {};
BangumiInfoModel? bangumiItem;

// 请求状态
RxBool isLoading = false.obs;

Expand Down Expand Up @@ -63,27 +56,6 @@ class BangumiIntroController extends GetxController {
@override
void onInit() {
super.onInit();
if (Get.arguments.isNotEmpty as bool) {
if (Get.arguments.containsKey('bangumiItem') as bool) {
preRender = true;
bangumiItem = Get.arguments['bangumiItem'];
// bangumiItem!['pic'] = args.pic;
// if (args.title is String) {
// videoItem!['title'] = args.title;
// } else {
// String str = '';
// for (Map map in args.title) {
// str += map['text'];
// }
// videoItem!['title'] = str;
// }
// if (args.stat != null) {
// videoItem!['stat'] = args.stat;
// }
// videoItem!['pubdate'] = args.pubdate;
// videoItem!['owner'] = args.owner;
}
}
userInfo = userInfoCache.get('userInfoCache');
userLogin = userInfo != null;
}
Expand Down Expand Up @@ -183,20 +155,21 @@ class BangumiIntroController extends GetxController {
actions: [
TextButton(onPressed: () => Get.back(), child: const Text('取消')),
TextButton(
onPressed: () async {
var res = await VideoHttp.coinVideo(
bvid: bvid, multiply: _tempThemeValue);
if (res['status']) {
SmartDialog.showToast('投币成功 👏');
hasCoin.value = true;
bangumiDetail.value.stat!['coins'] =
bangumiDetail.value.stat!['coins'] + _tempThemeValue;
} else {
SmartDialog.showToast(res['msg']);
}
Get.back();
},
child: const Text('确定'))
onPressed: () async {
var res = await VideoHttp.coinVideo(
bvid: bvid, multiply: _tempThemeValue);
if (res['status']) {
SmartDialog.showToast('投币成功 👏');
hasCoin.value = true;
bangumiDetail.value.stat!['coins'] =
bangumiDetail.value.stat!['coins'] + _tempThemeValue;
} else {
SmartDialog.showToast(res['msg']);
}
Get.back();
},
child: const Text('确定'),
)
],
);
});
Expand Down
Loading

0 comments on commit 1b54f07

Please sign in to comment.