修改消息bug和UI

This commit is contained in:
CYH 2023-07-19 09:55:28 +08:00
parent 5d6f953858
commit 92065b0cb3
7 changed files with 199 additions and 143 deletions

View File

@ -402,96 +402,133 @@ class _TIMUIKItHistoryMessageListItemState
}
if (messageItem.customElem?.extension?.contains('cardData') ?? false) {
Map info = jsonDecode(messageItem.customElem?.data ?? '');
return Container(
height: info.containsKey('city') ? 175.sp : 135.sp,
width: Get.width,
margin: EdgeInsets.only(left: isFromSelf ? 16 : 0, right: isFromSelf ? 0 : 16),
decoration: BoxDecoration(
image: DecorationImage(
fit: BoxFit.fill,
image: AssetImage(
getCircleImage('pic_bg'),
))),
child: Column(
children: [
Container(
padding: EdgeInsets.only(left: 12.sp, right: 12.sp),
// height: 60,
child: Column(
children: [
if (info.containsKey('city'))
Container(
margin: EdgeInsets.only(top: 10.sp),
child: Row(
children: [
Container(
margin: EdgeInsets.only(right: 5.sp),
width: 3.sp,
height: 3.sp,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(1.5.sp),
color: Color(0xFF00FFF4)),
),
Text(
info['city'],
style: TextStyle(
color: Colors.white,
fontSize: 14.sp,
fontWeight: FontWeight.w500),
)
],
),
),
if (info.containsKey('both_interests'))
Container(
margin: EdgeInsets.only(top: 16.sp),
child: Row(
children: [
Container(
margin: EdgeInsets.only(right: 5.sp),
width: 3,
height: 3,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(1.5),
color: Color(0xFF00FFF4)),
),
Text(
info['both_interests'],
style: TextStyle(
color: Colors.white,
fontSize: 14.sp,
fontWeight: FontWeight.w500),
)
],
),
),
Container(
margin: EdgeInsets.only(top: 10.sp, bottom: 10.sp),
alignment: Alignment.centerLeft,
child: Text(
isFromSelf
? info['user']['signature']
: info['my']['signature'],
style: TextStyle(
color: Colors.white,
fontSize: 14.sp,
fontWeight: FontWeight.w500),
maxLines: 2,
overflow: TextOverflow.ellipsis,
),
),
Image.asset(
getCircleImage('line'),
width: Get.width,
return Column(
children: [
Container(
height: info.containsKey('city') ? 175.sp : 135.sp,
width: Get.width,
margin: EdgeInsets.only(left: isFromSelf ? 16 : 0, right: isFromSelf ? 0 : 16),
decoration: BoxDecoration(
image: DecorationImage(
fit: BoxFit.fill,
image: AssetImage(
getCircleImage('pic_bg'),
))),
child: Column(
children: [
Container(
padding: EdgeInsets.only(left: 12.sp, right: 12.sp),
// height: 60,
child: Column(
children: [
if (info.containsKey('city'))
Container(
margin: EdgeInsets.only(top: 10.sp),
child: Row(
children: [
Container(
margin: EdgeInsets.only(right: 5.sp),
width: 3.sp,
height: 3.sp,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(1.5.sp),
color: Color(0xFF00FFF4)),
),
Text(
info['city'],
style: TextStyle(
color: Colors.white,
fontSize: 14.sp,
fontWeight: FontWeight.w500),
)
],
),
),
if (info.containsKey('both_interests'))
Container(
margin: EdgeInsets.only(top: 16.sp),
child: Row(
children: [
Container(
margin: EdgeInsets.only(right: 5.sp),
width: 3,
height: 3,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(1.5),
color: Color(0xFF00FFF4)),
),
Text(
info['both_interests'],
style: TextStyle(
color: Colors.white,
fontSize: 14.sp,
fontWeight: FontWeight.w500),
)
],
),
),
Container(
margin: EdgeInsets.only(top: 10.sp, bottom: 10.sp),
alignment: Alignment.centerLeft,
child: Text(
isFromSelf
? info['user']['signature']
: info['my']['signature'],
style: TextStyle(
color: Colors.white,
fontSize: 14.sp,
fontWeight: FontWeight.w500),
maxLines: 2,
overflow: TextOverflow.ellipsis,
),
),
Image.asset(
getCircleImage('line'),
width: Get.width,
fit: BoxFit.fill,
),
interestWdiget(
isFromSelf ? info['interests'] : info['myInterests'])
],
),
interestWdiget(
isFromSelf ? info['interests'] : info['myInterests'])
],
),
)
],
),
)
],
),
),
Container(
width: Get.width,
margin: EdgeInsets.only(top: 10.sp,left: isFromSelf ? 16 : 0, right: isFromSelf ? 0 : 16),
// margin: EdgeInsets.only(top: 10.sp),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'骂人、诈骗、造谣均属于严重违规行为,请严格遵守',
style: TextStyle(
color: Colors.white,
fontSize: 11.sp,
fontWeight: FontWeight.w600),
),
SizedBox(
width: 2.sp,
),
GestureDetector(
onTap: (){
navigateToUserAgreement();
},
child: Text(
'《文明公约》',
style: TextStyle(
color: Color(0xff00FFF4),
fontSize: 11.sp,
fontWeight: FontWeight.w400,
),
),
),
],
),
)
],
);
}

View File

@ -132,7 +132,7 @@ class TIMChat extends StatefulWidget {
final List customEmojiStickerList;
final Widget? customAppBar;
final PreferredSizeWidget? customAppBar;
/// Custom emoji panel.
final CustomStickerPanel? customStickerPanel;
@ -376,16 +376,7 @@ class _TUIChatState extends TIMUIKitState<TIMChat> {
child: Scaffold(
backgroundColor: Colors.transparent,
resizeToAvoidBottomInset: false,
appBar: (widget.customAppBar == null)
? TIMUIKitAppBar(
showTotalUnReadCount: widget.showTotalUnReadCount,
config: widget.appBarConfig,
conversationShowName: _getTitle(),
conversationID: _getConvID(),
showC2cMessageEditStatus:
widget.config?.showC2cMessageEditStatus ?? true,
)
: null,
appBar:widget.customAppBar!,
body: DropTarget(
onDragDone: (detail) {
setState(() {
@ -413,13 +404,13 @@ class _TUIChatState extends TIMUIKitState<TIMChat> {
children: [
Column(
children: [
if (widget.customAppBar != null) widget.customAppBar!,
if (filteredApplicationList.isNotEmpty)
_renderJoinGroupApplication(
filteredApplicationList.length, theme),
if (widget.topFixWidget != null) widget.topFixWidget!,
Expanded(
child: Container(
// color: Colors.red,
color: theme.chatBgColor,
child: Align(
// key: alignKey,

View File

@ -87,16 +87,17 @@ class _ChatPageState extends State<ChatPage> {
GroupReceiptAllowType.public
],
),
customAppBar: MyAppBar(
centerTitle: con.showName!,
actionWdiget: GestureDetector(
onTap: () {
Get.toNamed(AppRoutes.UserInfoActivity,arguments: con.userID.toString().split('_').last);
},
child: Text('TA的主页',style: TextStyle(color: Color(0xFF00FFF4),fontSize:12.sp,fontWeight: FontWeight.w500),),
customAppBar:MyAppBar(
centerTitle: con.showName!,
actionWdiget: GestureDetector(
onTap: () {
Get.toNamed(AppRoutes.UserInfoActivity,arguments: con.userID.toString().split('_').last);
},
child: Text('TA的主页',style: TextStyle(color: Color(0xFF00FFF4),fontSize:12.sp,fontWeight: FontWeight.w500),),
),
onPressed: () {},
),
onPressed: () {},
),
userAvatarBuilder: (BuildContext context, V2TimMessage message) {
return avatarWidget(message.faceUrl ?? 'http://qiniuyun.ikuayou.com/avatar/default/default_header.png');
},

View File

@ -1119,7 +1119,7 @@ class _InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClie
}
void _showOutCircleDialog(
BuildContext context, CircleLogic controller, Circle bean) {
BuildContext context, var controller, Circle bean) {
showDialog(
context: context,
builder: (BuildContext context) {

View File

@ -17,6 +17,7 @@ class Sys_notify_listLogic extends GetxController {
int page = 0;
int isVip = 0;
bool isLoad = true;
bool isMore = true;
List<Lists> lists = [];
@override
@ -49,6 +50,9 @@ class Sys_notify_listLogic extends GetxController {
lists.add(Lists.fromJson(element));
});
}
if (bean.length < 10) {
isMore = false;
}
isLoad = false;
update();
if (page == 0) {
@ -65,8 +69,13 @@ class Sys_notify_listLogic extends GetxController {
}
void onLoading() {
if (isMore) {
initList();
} else {
refreshController.loadNoData();
}
// page = page + 1;
initList();
}
void makeRead() async {

View File

@ -1,5 +1,8 @@
import 'dart:convert';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:circle_app/components/my_app_bar.dart';
import 'package:circle_app/router/app_routers.dart';
import 'package:circle_app/util/util.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -35,22 +38,22 @@ class Sys_notify_listPage extends StatelessWidget {
child: logic.isLoad
? loaddingWidget(true)
: logic.lists.isEmpty
? noResultWidget()
: SmartRefresher(
controller: logic.refreshController,
enablePullUp: true,
onRefresh: logic.onRefresh,
onLoading: () {
logic.onLoading();
},
child: ListView.builder(
padding: EdgeInsets.all(10.sp),
itemCount: logic.lists.length,
itemBuilder: (context, index) {
return ListItem(logic.lists[index]);
},
),
),
? noResultWidget()
: SmartRefresher(
controller: logic.refreshController,
enablePullUp: true,
onRefresh: logic.onRefresh,
onLoading: () {
logic.onLoading();
},
child: ListView.builder(
padding: EdgeInsets.all(10.sp),
itemCount: logic.lists.length,
itemBuilder: (context, index) {
return ListItem(logic.lists[index]);
},
),
),
),
),
),
@ -70,23 +73,24 @@ class Sys_notify_listPage extends StatelessWidget {
));
}
if (data.title?.isNotEmpty ?? false) {
widgets.add(Container(
margin: EdgeInsets.only(
top: 8.sp, left: 16.sp, right: 16.sp),
child: Text(
data.title!,
style: TextStyle(
color: Color(0xFFF7FAFA),
fontSize: 14.sp,
fontWeight: FontWeight.w500),
widgets.add(
Container(
margin: EdgeInsets.only(top: 8.sp, left: 16.sp, right: 16.sp),
child: Text(
data.title!,
style: TextStyle(
color: Color(0xFFF7FAFA),
fontSize: 14.sp,
fontWeight: FontWeight.w500),
),
),
),);
);
}
if (data.content?.isNotEmpty ?? false) {
widgets.add(Container(
margin: EdgeInsets.only(
top: 10.sp, left: 16.sp, right: 16.sp,bottom: 10.sp),
top: 10.sp, left: 16.sp, right: 16.sp, bottom: 10.sp),
child: Text(
data.content!,
style: TextStyle(
@ -97,6 +101,21 @@ class Sys_notify_listPage extends StatelessWidget {
));
}
widgets.add(GestureDetector(
onTap: () {
Get.toNamed(AppRoutes.WebViewActivity,
arguments: jsonDecode(data.note!));
},
child: Container(
margin: EdgeInsets.only(bottom: 8.sp, left: 16.sp),
child: Text('点击查看>',
style: TextStyle(
color: Color(0xFF00FFF4),
fontSize: 12.sp,
fontWeight: FontWeight.w500)),
),
));
return Container(
child: Column(
children: [
@ -127,14 +146,13 @@ class Sys_notify_listPage extends StatelessWidget {
borderRadius: BorderRadius.circular(10.sp),
color: Color(0xFF292836)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children:widgets
),
crossAxisAlignment: CrossAxisAlignment.start,
children: widgets),
)
],
)
],
)
),
],
),
);

View File

@ -5,6 +5,6 @@ import 'state.dart';
class WebviewLogic extends GetxController {
final WebviewState state = WebviewState();
final title = Get.arguments['title'];
final title = Get.arguments['title'] ?? '';
}