mod: 网络请求异常样式修改

This commit is contained in:
guozhigq
2024-02-07 01:17:35 +08:00
parent 40c666e3d1
commit 191472d0c4
5 changed files with 30 additions and 35 deletions

View File

@ -51,7 +51,7 @@ class VideoHttp {
(i['owner'] != null &&
!blackMidsList.contains(i['owner']['mid']))) {
RecVideoItemModel videoItem = RecVideoItemModel.fromJson(i);
if (!RecommendFilter.filter(videoItem)){
if (!RecommendFilter.filter(videoItem)) {
list.add(videoItem);
}
}
@ -98,7 +98,7 @@ class VideoHttp {
(i['args'] != null &&
!blackMidsList.contains(i['args']['up_mid']))) {
RecVideoItemAppModel videoItem = RecVideoItemAppModel.fromJson(i);
if (!RecommendFilter.filter(videoItem)){
if (!RecommendFilter.filter(videoItem)) {
list.add(videoItem);
}
}
@ -130,7 +130,7 @@ class VideoHttp {
}
return {'status': true, 'data': list};
} else {
return {'status': false, 'data': []};
return {'status': false, 'data': [], 'msg': res.data['message']};
}
} catch (err) {
return {'status': false, 'data': [], 'msg': err};
@ -217,7 +217,7 @@ class VideoHttp {
List<HotVideoItemModel> list = [];
for (var i in res.data['data']) {
HotVideoItemModel videoItem = HotVideoItemModel.fromJson(i);
if (!RecommendFilter.filter(videoItem, relatedVideos: true)){
if (!RecommendFilter.filter(videoItem, relatedVideos: true)) {
list.add(videoItem);
}
}

View File

@ -192,22 +192,6 @@ class _DynamicsPageState extends State<DynamicsPage>
)
],
),
// Obx(
// () => Visibility(
// visible: _dynamicsController.userLogin.value,
// child: Positioned(
// right: 4,
// top: 0,
// bottom: 0,
// child: IconButton(
// padding: EdgeInsets.zero,
// onPressed: () =>
// {feedBack(), _dynamicsController.resetSearch()},
// icon: const Icon(Icons.history, size: 21),
// ),
// ),
// ),
// ),
],
),
),
@ -229,7 +213,8 @@ class _DynamicsPageState extends State<DynamicsPage>
return Obx(() => UpPanel(_dynamicsController.upData.value));
} else {
return const SliverToBoxAdapter(
child: SizedBox(height: 80));
child: SizedBox(height: 80),
);
}
} else {
return const SliverToBoxAdapter(
@ -240,15 +225,6 @@ class _DynamicsPageState extends State<DynamicsPage>
}
},
),
SliverToBoxAdapter(
child: Container(
height: 6,
color: Theme.of(context)
.colorScheme
.onInverseSurface
.withOpacity(0.5),
),
),
FutureBuilder(
future: _futureBuilderFuture,
builder: (context, snapshot) {

View File

@ -121,6 +121,13 @@ class _UpPanelState extends State<UpPanel> {
],
),
),
Container(
height: 6,
color: Theme.of(context)
.colorScheme
.onInverseSurface
.withOpacity(0.5),
),
],
)),
);

View File

@ -187,9 +187,13 @@ class _SearchPageState extends State<SearchPage> with RouteAware {
),
);
} else {
return HttpError(
errMsg: data['msg'],
fn: () => setState(() {}),
return CustomScrollView(
slivers: [
HttpError(
errMsg: data['msg'],
fn: () => setState(() {}),
)
],
);
}
} else {

View File

@ -105,7 +105,11 @@ class _SearchPanelState extends State<SearchPanel>
slivers: [
HttpError(
errMsg: data['msg'],
fn: () => setState(() {}),
fn: () {
setState(() {
_searchPanelController.onSearch();
});
},
),
],
);
@ -116,7 +120,11 @@ class _SearchPanelState extends State<SearchPanel>
slivers: [
HttpError(
errMsg: '没有相关数据',
fn: () => setState(() {}),
fn: () {
setState(() {
_searchPanelController.onSearch();
});
},
),
],
);