mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: dyn red
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -2,14 +2,19 @@ import 'index.dart';
|
||||
|
||||
class CommonHttp {
|
||||
static Future unReadDynamic() async {
|
||||
var res = await Request().get(Api.getUnreadDynamic,
|
||||
data: {'alltype_offset': 0, 'video_offset': '', 'article_offset': 0});
|
||||
var res = await Request().get(Api.getUnreadDynamic, data: {
|
||||
'alltype_offset': 0,
|
||||
'video_offset': 0,
|
||||
'article_offset': 0,
|
||||
});
|
||||
if (res.data['code'] == 0) {
|
||||
return {'status': true, 'data': res.data['data']['dyn_basic_infos']};
|
||||
return {
|
||||
'status': true,
|
||||
'data': res.data['data']['update_info']['item']['count']
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
'status': false,
|
||||
'data': [],
|
||||
'msg': res.data['message'],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:PiliPalaX/grpc/grpc_repo.dart';
|
||||
import 'package:PiliPalaX/http/common.dart';
|
||||
import 'package:PiliPalaX/pages/dynamics/view.dart';
|
||||
import 'package:PiliPalaX/pages/home/view.dart';
|
||||
import 'package:PiliPalaX/pages/media/view.dart';
|
||||
import 'package:PiliPalaX/utils/global_data.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
@@ -57,11 +59,19 @@ class MainController extends GetxController {
|
||||
if (!userLogin.value || dynIndex == -1) {
|
||||
return;
|
||||
}
|
||||
await GrpcRepo.dynRed().then((res) {
|
||||
if (res['status']) {
|
||||
setCount(res['data']);
|
||||
}
|
||||
});
|
||||
if (GlobalData().grpcReply) {
|
||||
await GrpcRepo.dynRed().then((res) {
|
||||
if (res['status']) {
|
||||
setCount(res['data']);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
await CommonHttp.unReadDynamic().then((res) {
|
||||
if (res['status']) {
|
||||
setCount(res['data']);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void setCount([int count = 0]) async {
|
||||
|
||||
@@ -51,7 +51,8 @@ class VideoReplyReplyController extends CommonController
|
||||
|
||||
@override
|
||||
Future queryData([bool isRefresh = true]) async {
|
||||
if (!isDialogue &&
|
||||
if (GlobalData().grpcReply &&
|
||||
!isDialogue &&
|
||||
currentPage == 1 &&
|
||||
!hasRoot &&
|
||||
firstFloor == null &&
|
||||
|
||||
Reference in New Issue
Block a user