Merge branch 'fix'
This commit is contained in:
@ -3,11 +3,13 @@ class FollowUpModel {
|
|||||||
this.liveUsers,
|
this.liveUsers,
|
||||||
this.upList,
|
this.upList,
|
||||||
this.liveList,
|
this.liveList,
|
||||||
|
this.myInfo,
|
||||||
});
|
});
|
||||||
|
|
||||||
LiveUsers? liveUsers;
|
LiveUsers? liveUsers;
|
||||||
List<UpItem>? upList;
|
List<UpItem>? upList;
|
||||||
List<LiveUserItem>? liveList;
|
List<LiveUserItem>? liveList;
|
||||||
|
MyInfo? myInfo;
|
||||||
|
|
||||||
FollowUpModel.fromJson(Map<String, dynamic> json) {
|
FollowUpModel.fromJson(Map<String, dynamic> json) {
|
||||||
liveUsers = json['live_users'] != null
|
liveUsers = json['live_users'] != null
|
||||||
@ -21,6 +23,7 @@ class FollowUpModel {
|
|||||||
upList = json['up_list'] != null
|
upList = json['up_list'] != null
|
||||||
? json['up_list'].map<UpItem>((e) => UpItem.fromJson(e)).toList()
|
? json['up_list'].map<UpItem>((e) => UpItem.fromJson(e)).toList()
|
||||||
: [];
|
: [];
|
||||||
|
myInfo = json['my_info'] != null ? MyInfo.fromJson(json['my_info']) : null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -100,3 +103,21 @@ class UpItem {
|
|||||||
uname = json['uname'];
|
uname = json['uname'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class MyInfo {
|
||||||
|
MyInfo({
|
||||||
|
this.face,
|
||||||
|
this.mid,
|
||||||
|
this.name,
|
||||||
|
});
|
||||||
|
|
||||||
|
String? face;
|
||||||
|
int? mid;
|
||||||
|
String? name;
|
||||||
|
|
||||||
|
MyInfo.fromJson(Map<String, dynamic> json) {
|
||||||
|
face = json['face'];
|
||||||
|
mid = json['mid'];
|
||||||
|
name = json['name'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -258,6 +258,10 @@ class DynamicsController extends GetxController {
|
|||||||
if (upData.value.upList!.isEmpty) {
|
if (upData.value.upList!.isEmpty) {
|
||||||
mid.value = -1;
|
mid.value = -1;
|
||||||
}
|
}
|
||||||
|
upData.value.upList!.insertAll(0, [
|
||||||
|
UpItem(face: '', uname: '全部动态', mid: -1),
|
||||||
|
UpItem(face: userInfo.face, uname: '我', mid: userInfo.mid),
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
@ -34,25 +34,25 @@ Widget articlePanel(item, context, {floor = 1}) {
|
|||||||
),
|
),
|
||||||
const SizedBox(height: 8),
|
const SizedBox(height: 8),
|
||||||
],
|
],
|
||||||
Text(
|
// Text(
|
||||||
item.modules.moduleDynamic.major.opus.title,
|
// item.modules.moduleDynamic.major.opus.title,
|
||||||
style: Theme.of(context)
|
// style: Theme.of(context)
|
||||||
.textTheme
|
// .textTheme
|
||||||
.titleMedium!
|
// .titleMedium!
|
||||||
.copyWith(fontWeight: FontWeight.bold),
|
// .copyWith(fontWeight: FontWeight.bold),
|
||||||
),
|
// ),
|
||||||
const SizedBox(height: 2),
|
// const SizedBox(height: 2),
|
||||||
if (item.modules.moduleDynamic.major.opus.summary.text !=
|
// if (item.modules.moduleDynamic.major.opus.summary.text !=
|
||||||
'undefined') ...[
|
// 'undefined') ...[
|
||||||
Text(
|
// Text(
|
||||||
item.modules.moduleDynamic.major.opus.summary.richTextNodes.first
|
// item.modules.moduleDynamic.major.opus.summary.richTextNodes.first
|
||||||
.text,
|
// .text,
|
||||||
maxLines: 4,
|
// maxLines: 4,
|
||||||
style: const TextStyle(height: 1.55),
|
// style: const TextStyle(height: 1.55),
|
||||||
overflow: TextOverflow.ellipsis,
|
// overflow: TextOverflow.ellipsis,
|
||||||
),
|
// ),
|
||||||
const SizedBox(height: 2),
|
// const SizedBox(height: 2),
|
||||||
],
|
// ],
|
||||||
picWidget(item, context)
|
picWidget(item, context)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
@ -1,16 +1,14 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:hive/hive.dart';
|
|
||||||
import 'package:pilipala/common/widgets/network_img_layer.dart';
|
import 'package:pilipala/common/widgets/network_img_layer.dart';
|
||||||
import 'package:pilipala/models/dynamics/up.dart';
|
import 'package:pilipala/models/dynamics/up.dart';
|
||||||
import 'package:pilipala/models/live/item.dart';
|
import 'package:pilipala/models/live/item.dart';
|
||||||
import 'package:pilipala/pages/dynamics/controller.dart';
|
import 'package:pilipala/pages/dynamics/controller.dart';
|
||||||
import 'package:pilipala/utils/feed_back.dart';
|
import 'package:pilipala/utils/feed_back.dart';
|
||||||
import 'package:pilipala/utils/storage.dart';
|
|
||||||
import 'package:pilipala/utils/utils.dart';
|
import 'package:pilipala/utils/utils.dart';
|
||||||
|
|
||||||
class UpPanel extends StatefulWidget {
|
class UpPanel extends StatefulWidget {
|
||||||
final FollowUpModel? upData;
|
final FollowUpModel upData;
|
||||||
const UpPanel(this.upData, {Key? key}) : super(key: key);
|
const UpPanel(this.upData, {Key? key}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -24,33 +22,17 @@ class _UpPanelState extends State<UpPanel> {
|
|||||||
List<UpItem> upList = [];
|
List<UpItem> upList = [];
|
||||||
List<LiveUserItem> liveList = [];
|
List<LiveUserItem> liveList = [];
|
||||||
static const itemPadding = EdgeInsets.symmetric(horizontal: 5, vertical: 0);
|
static const itemPadding = EdgeInsets.symmetric(horizontal: 5, vertical: 0);
|
||||||
Box userInfoCache = GStrorage.userInfo;
|
late MyInfo userInfo;
|
||||||
var userInfo;
|
|
||||||
|
|
||||||
@override
|
void listFormat() {
|
||||||
void initState() {
|
userInfo = widget.upData.myInfo!;
|
||||||
super.initState();
|
upList = widget.upData.upList!;
|
||||||
upList = widget.upData!.upList!;
|
liveList = widget.upData.liveList!;
|
||||||
if (widget.upData!.liveList!.isNotEmpty) {
|
|
||||||
liveList = widget.upData!.liveList!;
|
|
||||||
}
|
|
||||||
upList.insert(
|
|
||||||
0,
|
|
||||||
UpItem(face: '', uname: '全部动态', mid: -1),
|
|
||||||
);
|
|
||||||
userInfo = userInfoCache.get('userInfoCache');
|
|
||||||
upList.insert(
|
|
||||||
1,
|
|
||||||
UpItem(
|
|
||||||
face: userInfo.face,
|
|
||||||
uname: '我',
|
|
||||||
mid: userInfo.mid,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
listFormat();
|
||||||
return SliverPersistentHeader(
|
return SliverPersistentHeader(
|
||||||
floating: true,
|
floating: true,
|
||||||
pinned: false,
|
pinned: false,
|
||||||
|
@ -131,13 +131,13 @@ class WebviewController extends GetxController {
|
|||||||
Get.back();
|
Get.back();
|
||||||
} else {
|
} else {
|
||||||
// 获取用户信息失败
|
// 获取用户信息失败
|
||||||
SmartDialog.showToast(result.msg);
|
SmartDialog.showToast(result['msg']);
|
||||||
Clipboard.setData(ClipboardData(text: result.msg.toString()));
|
Clipboard.setData(ClipboardData(text: result['msg']));
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
SmartDialog.showNotify(msg: e.toString(), notifyType: NotifyType.warning);
|
SmartDialog.showNotify(msg: e.toString(), notifyType: NotifyType.warning);
|
||||||
content = content + e.toString();
|
content = content + e.toString();
|
||||||
}
|
|
||||||
Clipboard.setData(ClipboardData(text: content));
|
Clipboard.setData(ClipboardData(text: content));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user