mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-02 00:58:19 +08:00
show forwarded dyn pic
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -892,4 +892,6 @@ class Api {
|
|||||||
static const String dynTopicRcmd = '/x/topic/web/dynamic/rcmd';
|
static const String dynTopicRcmd = '/x/topic/web/dynamic/rcmd';
|
||||||
|
|
||||||
static const String matchInfo = '/x/esports/match/info';
|
static const String matchInfo = '/x/esports/match/info';
|
||||||
|
|
||||||
|
static const String dynPic = '/x/polymer/web-dynamic/v1/detail/pic';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -493,4 +493,21 @@ class DynamicsHttp {
|
|||||||
return Error(res.data['message']);
|
return Error(res.data['message']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Future<LoadingState<List<OpusPicModel>?>> dynPic(dynamic id) async {
|
||||||
|
final res = await Request().get(
|
||||||
|
Api.dynPic,
|
||||||
|
queryParameters: {
|
||||||
|
'id': id,
|
||||||
|
'web_location': 333.1368,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
if (res.data['code'] == 0) {
|
||||||
|
return Success((res.data['data'] as List?)
|
||||||
|
?.map((e) => OpusPicModel.fromJson(e))
|
||||||
|
.toList());
|
||||||
|
} else {
|
||||||
|
return Error(res.data['message']);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1175,13 +1175,13 @@ class DynamicOpusModel {
|
|||||||
});
|
});
|
||||||
|
|
||||||
String? jumpUrl;
|
String? jumpUrl;
|
||||||
List<OpusPicsModel>? pics;
|
List<OpusPicModel>? pics;
|
||||||
SummaryModel? summary;
|
SummaryModel? summary;
|
||||||
String? title;
|
String? title;
|
||||||
DynamicOpusModel.fromJson(Map<String, dynamic> json) {
|
DynamicOpusModel.fromJson(Map<String, dynamic> json) {
|
||||||
jumpUrl = json['jump_url'];
|
jumpUrl = json['jump_url'];
|
||||||
pics = (json['pics'] as List?)
|
pics = (json['pics'] as List?)
|
||||||
?.map<OpusPicsModel>((e) => OpusPicsModel.fromJson(e))
|
?.map<OpusPicModel>((e) => OpusPicModel.fromJson(e))
|
||||||
.toList();
|
.toList();
|
||||||
summary =
|
summary =
|
||||||
json['summary'] != null ? SummaryModel.fromJson(json['summary']) : null;
|
json['summary'] != null ? SummaryModel.fromJson(json['summary']) : null;
|
||||||
@@ -1219,7 +1219,7 @@ class RichTextNodeItem {
|
|||||||
String? text;
|
String? text;
|
||||||
String? type;
|
String? type;
|
||||||
String? rid;
|
String? rid;
|
||||||
List<OpusPicsModel>? pics;
|
List<OpusPicModel>? pics;
|
||||||
String? jumpUrl;
|
String? jumpUrl;
|
||||||
|
|
||||||
RichTextNodeItem.fromJson(Map<String, dynamic> json) {
|
RichTextNodeItem.fromJson(Map<String, dynamic> json) {
|
||||||
@@ -1231,7 +1231,7 @@ class RichTextNodeItem {
|
|||||||
pics = json['pics'] == null
|
pics = json['pics'] == null
|
||||||
? null
|
? null
|
||||||
: (json['pics'] as List?)
|
: (json['pics'] as List?)
|
||||||
?.map((e) => OpusPicsModel.fromJson(e))
|
?.map((e) => OpusPicModel.fromJson(e))
|
||||||
.toList();
|
.toList();
|
||||||
jumpUrl = json['jump_url'];
|
jumpUrl = json['jump_url'];
|
||||||
}
|
}
|
||||||
@@ -1267,26 +1267,23 @@ class DynamicNoneModel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class OpusPicsModel {
|
class OpusPicModel {
|
||||||
OpusPicsModel({
|
OpusPicModel({
|
||||||
this.width,
|
this.width,
|
||||||
this.height,
|
this.height,
|
||||||
this.size,
|
|
||||||
this.src,
|
this.src,
|
||||||
this.url,
|
this.url,
|
||||||
});
|
});
|
||||||
|
|
||||||
int? width;
|
int? width;
|
||||||
int? height;
|
int? height;
|
||||||
int? size;
|
|
||||||
String? src;
|
String? src;
|
||||||
String? url;
|
String? url;
|
||||||
String? liveUrl;
|
String? liveUrl;
|
||||||
|
|
||||||
OpusPicsModel.fromJson(Map<String, dynamic> json) {
|
OpusPicModel.fromJson(Map<String, dynamic> json) {
|
||||||
width = json['width'];
|
width = json['width'];
|
||||||
height = json['height'];
|
height = json['height'];
|
||||||
size = json['size'] != null ? json['size'].toInt() : 0;
|
|
||||||
src = json['src'];
|
src = json['src'];
|
||||||
url = json['url'];
|
url = json['url'];
|
||||||
liveUrl = json['live_url'];
|
liveUrl = json['live_url'];
|
||||||
|
|||||||
@@ -1,10 +1,14 @@
|
|||||||
import 'package:PiliPlus/common/widgets/image/image_view.dart';
|
import 'package:PiliPlus/common/widgets/image/image_view.dart';
|
||||||
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
||||||
|
import 'package:PiliPlus/http/dynamics.dart';
|
||||||
import 'package:PiliPlus/http/search.dart';
|
import 'package:PiliPlus/http/search.dart';
|
||||||
|
import 'package:PiliPlus/models/common/image_preview_type.dart'
|
||||||
|
show SourceModel;
|
||||||
import 'package:PiliPlus/models/common/image_type.dart';
|
import 'package:PiliPlus/models/common/image_type.dart';
|
||||||
import 'package:PiliPlus/models/dynamics/result.dart';
|
import 'package:PiliPlus/models/dynamics/result.dart';
|
||||||
import 'package:PiliPlus/pages/dynamics/widgets/vote.dart';
|
import 'package:PiliPlus/pages/dynamics/widgets/vote.dart';
|
||||||
import 'package:PiliPlus/utils/app_scheme.dart';
|
import 'package:PiliPlus/utils/app_scheme.dart';
|
||||||
|
import 'package:PiliPlus/utils/extension.dart';
|
||||||
import 'package:PiliPlus/utils/page_utils.dart';
|
import 'package:PiliPlus/utils/page_utils.dart';
|
||||||
import 'package:PiliPlus/utils/utils.dart';
|
import 'package:PiliPlus/utils/utils.dart';
|
||||||
import 'package:flutter/foundation.dart' show kDebugMode;
|
import 'package:flutter/foundation.dart' show kDebugMode;
|
||||||
@@ -235,8 +239,8 @@ TextSpan? richNode(
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
case 'RICH_TEXT_NODE_TYPE_VIEW_PICTURE'
|
case 'RICH_TEXT_NODE_TYPE_VIEW_PICTURE':
|
||||||
when (i.pics?.isNotEmpty == true):
|
if (i.pics?.isNotEmpty == true) {
|
||||||
spanChildren
|
spanChildren
|
||||||
..add(const TextSpan(text: '\n'))
|
..add(const TextSpan(text: '\n'))
|
||||||
..add(
|
..add(
|
||||||
@@ -257,6 +261,30 @@ TextSpan? richNode(
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
spanChildren.add(
|
||||||
|
TextSpan(
|
||||||
|
text: i.text,
|
||||||
|
style: style,
|
||||||
|
recognizer: TapGestureRecognizer()
|
||||||
|
..onTap = () {
|
||||||
|
DynamicsHttp.dynPic(i.rid).then((res) {
|
||||||
|
if (res.isSuccess) {
|
||||||
|
var list = res.data;
|
||||||
|
if (list?.isNotEmpty == true) {
|
||||||
|
Get.context!.imageView(
|
||||||
|
imgList: list!
|
||||||
|
.map((e) => SourceModel(url: e.src!))
|
||||||
|
.toList());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
res.toast();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
spanChildren.add(TextSpan(text: i.text, style: style));
|
spanChildren.add(TextSpan(text: i.text, style: style));
|
||||||
|
|||||||
Reference in New Issue
Block a user