各种属性改成从服务端拉取 聊天界面发视频 还有些文档上的小修改

This commit is contained in:
yangyuhao 2023-09-07 12:04:21 +08:00
parent a2b8a959fa
commit 4a86537491
18 changed files with 558 additions and 358 deletions

View File

@ -65,8 +65,8 @@ android {
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion 21
targetSdkVersion flutter.targetSdkVersion
versionCode 8
versionName "1.0.7"
versionCode 10
versionName "1.0.9"
manifestPlaceholders = [
vivo_APPID: "105669716",
vivo_APPKEY:"84f750207787376b310ca5b0d5969122",

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

View File

@ -50,6 +50,8 @@ class AboutappLogic extends GetxController {
getUpVersion() async {
if(isUpdate){
showReportDialog(Get.context!, _updateInfo!.constraint == 0, _updateInfo!);
}else {
showOKToast("暂无新版本");
}
}

View File

@ -177,7 +177,7 @@ class AboutappPage extends StatelessWidget {
),
):Container(),
Text(
logic.version,
"",
style: TextStyle(
color: const Color(0xFFB7BECC),
fontSize: 12.sp,

View File

@ -1,5 +1,7 @@
import 'dart:async';
import 'dart:io';
import 'dart:math';
import 'dart:typed_data';
import 'package:circle_app/app/chat/TIMUIKitChat/TIMUIKitTextField/tim_uikit_send_sound_message.dart';
import 'package:circle_app/app/minefragment/logic.dart';
@ -30,8 +32,11 @@ import 'package:tencent_cloud_chat_uikit/ui/views/TIMUIKitChat/TIMUIKitTextField
import 'package:tencent_cloud_chat_uikit/ui/views/TIMUIKitChat/TIMUIKitTextField/tim_uikit_send_sound_message.dart';
import 'package:tencent_extended_text_field/extended_text_field.dart';
import 'package:tencent_keyboard_visibility/tencent_keyboard_visibility.dart';
import 'package:video_player/video_player.dart';
import 'package:video_thumbnail/video_thumbnail.dart';
import '../../../../../util/eventBus.dart';
import '../../../../call_out/logic.dart';
GlobalKey<_TIMTextFieldLayoutNarrowState> TIMnarrowTextFieldKey = GlobalKey();
@ -174,9 +179,10 @@ class _TIMTextFieldLayoutNarrowState
}
});
}
if(null==commentBlackEvent){
commentBlackEvent = EventBusManager.on<CommentBlackEvent>().listen((event) {
if(event.userId == widget.userId){
if (null == commentBlackEvent) {
commentBlackEvent =
EventBusManager.on<CommentBlackEvent>().listen((event) {
if (event.userId == widget.userId) {
isBlack = event.isBlack;
}
});
@ -184,15 +190,16 @@ class _TIMTextFieldLayoutNarrowState
getBlack();
}
StreamSubscription? commentBlackEvent =null;
StreamSubscription? commentBlackEvent = null;
@override
void dispose() {
print("TIMTextFieldLayoutNarrow解绑");
if(null!=commentBlackEvent){
if (null != commentBlackEvent) {
EventBusManager.cancelSubscription(commentBlackEvent!);
}
super.dispose();
}
@ -213,7 +220,6 @@ class _TIMTextFieldLayoutNarrowState
}
}
void setSendButton() {
final value = widget.textEditingController.text;
if (isWebDevice() || isAndroidDevice()) {
@ -667,7 +673,7 @@ class _TIMTextFieldLayoutNarrowState
),
),
Container(
height: 40.sp,
height: 64.sp,
width: Get.width,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
@ -691,7 +697,8 @@ class _TIMTextFieldLayoutNarrowState
showSendSoundText = !showSendSoundText;
});
} else {
var data = await Permission.microphone.request();
var data =
await Permission.microphone.request();
if (data.isGranted) {
setState(() {
showEmojiPanel = false;
@ -699,7 +706,8 @@ class _TIMTextFieldLayoutNarrowState
showSendSoundText = !showSendSoundText;
});
} else {
Permissions.showPermissionConfirmDialog(context, Permission.microphone.value);
Permissions.showPermissionConfirmDialog(
context, Permission.microphone.value);
}
}
} catch (e) {
@ -733,6 +741,28 @@ class _TIMTextFieldLayoutNarrowState
child: Image.asset(getMsgImage('take_photo'),
width: 40.sp),
),
GestureDetector(
onTap: () {
if (isBlack) {
showOKToast("您已将对方拉黑,请移除黑名单后在发送消息~");
return;
}
getVideoFile(ImageSource.gallery);
},
child: Image.asset(getMsgImage('icon_video'),
width: 40.sp),
),
GestureDetector(
onTap: () {
if (isBlack) {
showOKToast("您已将对方拉黑,请移除黑名单后在发送消息~");
return;
}
getVideoFile(ImageSource.camera);
},
child: Image.asset(getMsgImage('icon_video_camera'),
width: 40.sp),
),
],
),
),
@ -783,7 +813,6 @@ class _TIMTextFieldLayoutNarrowState
User userInfoBean = bean.data.user!;
isVip = userInfoBean.vip > 0;
}
}
if (!isVip) {
showOKToast('开通会员之后才能发送图片');
@ -801,6 +830,81 @@ class _TIMTextFieldLayoutNarrowState
return isVip;
}
VideoPlayerController? videoPlayerController;
Future getVideoFile(ImageSource imageSource) async {
bool isOK = await checkVipStatus();
if (!isOK) {
return;
}
XFile? pickedFile;
String? thumbnailPath; // thumbnailPath
try {
pickedFile = await _picker.pickVideo(
source: imageSource,
);
if (pickedFile == null) {
return;
}
videoPlayerController = VideoPlayerController.file(
File(pickedFile.path),
videoPlayerOptions: VideoPlayerOptions(mixWithOthers: true),
);
await videoPlayerController?.initialize().then((_) async {
thumbnailPath = await VideoThumbnail.thumbnailFile(
video: pickedFile!.path,
imageFormat: ImageFormat.JPEG,
maxWidth: 100,
quality: 50,
);
});
final Duration videoDuration = videoPlayerController!.value.duration;
final double durationInSeconds = videoDuration.inSeconds.toDouble();
await widget.model.sendVideoMessage(
videoPath: pickedFile.path,
snapshotPath: thumbnailPath,
//
convID: widget.conversationID,
convType: widget.conversationType,
duration: durationInSeconds.toInt(),
inputElement: context,
);
} catch (e) {
print(e);
// setState(() {
// _pickImageError = e;
// });
}
}
Future<ThumbnailResult> getFirstPic(url) async {
Uint8List? bytes = await VideoThumbnail.thumbnailData(video: url);
final Completer<ThumbnailResult> completer = Completer();
if (bytes != null) {
int _imageDataSize = bytes.length;
print("image size: $_imageDataSize");
final _image = Image.memory(bytes);
_image.image
.resolve(ImageConfiguration())
.addListener(ImageStreamListener((ImageInfo info, bool _) {
completer.complete(ThumbnailResult(
image: _image,
dataSize: _imageDataSize,
height: info.image.height,
width: info.image.width,
));
}));
}
return completer.future;
}
Future getImageFile() async {
bool isOK = await checkVipStatus();
if (!isOK) {
@ -829,7 +933,6 @@ class _TIMTextFieldLayoutNarrowState
return;
}
try {
final XFile? pickedFile = await _picker.pickImage(
source: ImageSource.camera,

View File

@ -14,7 +14,6 @@ import 'package:tencent_cloud_chat_uikit/tencent_cloud_chat_uikit.dart';
import 'package:tencent_cloud_chat_uikit/ui/controller/tim_uikit_chat_controller.dart';
import '../../util/eventBus.dart';
import 'logic.dart';
class ChatPage extends StatefulWidget {
@ -111,6 +110,7 @@ class _ChatPageState extends State<ChatPage> {
Widget build(BuildContext context) {
V2TimConversation con = Get.arguments;
return TIMChat(
conversation: Get.arguments,
customStickerPanel: renderCustomStickerPanel,
onTapAvatar :(String userId,TapDownDetails tapDownDetails)async{
@ -121,6 +121,7 @@ class _ChatPageState extends State<ChatPage> {
},
controller : _timuiKitChatController,
config: TIMUIKitChatConfig(
// 使
isAllowClickAvatar: true,
isUseDefaultEmoji: true,

View File

@ -1,3 +1,7 @@
import 'package:get/get_rx/src/rx_types/rx_types.dart';
import 'logic.dart';
class CircleState {
String msg = '';
int index = 0;
@ -79,6 +83,7 @@ class Chat {
int? count;
List<Users>? users;
Chat({this.accountId, this.count, this.users});
Chat.fromJson(Map<String, dynamic> json) {

View File

@ -21,7 +21,6 @@ class CirclePage extends StatefulWidget {
class _CirclePageState extends State<CirclePage>
with AutomaticKeepAliveClientMixin {
@override
bool get wantKeepAlive => true;
@ -31,24 +30,20 @@ class _CirclePageState extends State<CirclePage>
final state = Get.find<CircleLogic>().state;
var getContext;
@override
void dispose() {
// TODO: implement dispose
super.dispose();
}
@override
Widget build(BuildContext context) {
super.build(context);
getContext = context;
return GetBuilder<CircleLogic>(builder: (logic) {
return Container(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height,
decoration: const BoxDecoration(
color: const Color(0xFF423055),
image: bgWidget),
color: const Color(0xFF423055), image: bgWidget),
child: Scaffold(
resizeToAvoidBottomInset: false,
backgroundColor: Colors.transparent,
body: SafeArea(
child: GetBuilder(builder: (CircleLogic controller) {
@ -66,6 +61,7 @@ class _CirclePageState extends State<CirclePage>
Expanded(
child: Swiper(
itemBuilder: (BuildContext context, int index) {
var bean = logic.circle.lists[index];
// final GlobalKey<InfoListViewState> infoListViewKey = GlobalKey<InfoListViewState>();
return InfoListView(index, bean, logic);
@ -74,10 +70,8 @@ class _CirclePageState extends State<CirclePage>
controller.state.index = index;
if (index == logic.circle.lists.length - 1) {
logic.loadMore();
}
print(index.toString());
},
index: controller.state.index,
itemCount: logic.circle.lists.length,
@ -100,8 +94,8 @@ class _CirclePageState extends State<CirclePage>
logic.getCircleIndex().id.toString(),
logic.getCircleIndex().title!,
false));
var data = await Get.toNamed(AppRoutes.Call_out, arguments: {'numbers': numbers});
var data = await Get.toNamed(AppRoutes.Call_out,
arguments: {'numbers': numbers});
},
child: Image.asset(
getCircleImage('send_msg'),
@ -122,7 +116,7 @@ class _CirclePageState extends State<CirclePage>
infoList = statistics.lastVisitUsers;
if (infoList.isNotEmpty) {
for (var element in infoList) {
if(element["avatar"]!=null&&element["avatar"].contains("http")){
if (element["avatar"] != null && element["avatar"].contains("http")) {
urlList.add(element["avatar"]);
}
@ -179,7 +173,7 @@ class _CirclePageState extends State<CirclePage>
).createShader(Offset.zero & bounds.size);
},
child: GestureDetector(
onTap: (){
onTap: () {
EventBusManager.fire(ScrollToTop());
},
child: Text(
@ -188,7 +182,9 @@ class _CirclePageState extends State<CirclePage>
fontSize: 18.sp,
fontWeight: FontWeight.w600,
color: Colors.white,
shadows: const [Shadow(color: Color(0xffF657FF), offset: Offset(0.0, -1))],
shadows: const [
Shadow(color: Color(0xffF657FF), offset: Offset(0.0, -1))
],
),
),
),
@ -219,20 +215,23 @@ class _CirclePageState extends State<CirclePage>
getCircleImage('avatar_bg'),
width: width.sp,
),
url.contains("http") ? ClipOval(
url.contains("http")
? ClipOval(
child: Image.network(
url,
width: (width - 1).sp,
height: (width - 1).sp,
fit: BoxFit.cover,
),
) : Text(url,style: TextStyle(color: Color(0xffF756FF),fontSize: 12.sp),)
)
: Text(
url,
style: TextStyle(color: Color(0xffF756FF), fontSize: 12.sp),
)
],
));
}
void _showTextContentDialog(BuildContext context, String msg) {
showDialog(
context: context,

View File

@ -1,4 +1,3 @@
import 'dart:async';
import 'package:cached_network_image/cached_network_image.dart';
@ -27,22 +26,23 @@ class InfoListView extends StatefulWidget {
var logic;
Circle bean;
int index;
// Function updateBeanCall;
InfoListView(this.index, this.bean, this.logic,{super.key});
InfoListView(this.index, this.bean, this.logic, {super.key});
@override
State<InfoListView> createState() => InfoListViewState();
}
typedef void MyListViewback(State<InfoListView> result);
class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClientMixin {
class InfoListViewState extends State<InfoListView>
with AutomaticKeepAliveClientMixin {
@override
bool get wantKeepAlive => true;
final ScrollController scrollController = ScrollController();
ListLogic? listsLg;
int callOutPage = 1;
@ -52,30 +52,29 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
var circleId = '';
List<Lists> lists = [];
@override
void dispose() {
// TODO: implement dispose
if(null!=callRefreshCicle){
if (null != callRefreshCicle) {
EventBusManager.cancelSubscription(callRefreshCicle!);
}
if(null!=scroToTop){
if (null != scroToTop) {
EventBusManager.cancelSubscription(scroToTop!);
}
scrollController.dispose();
super.dispose();
}
StreamSubscription? callRefreshCicle =null;
StreamSubscription? scroToTop =null;
StreamSubscription? callRefreshCicle = null;
StreamSubscription? scroToTop = null;
@override
void initState() {
// TODO: implement initState
super.initState();
scrollController.addListener(() {
try {
if (scrollController.position.pixels ==
@ -87,12 +86,11 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
circleId = widget.bean.id.toString();
loadCallOutListData();
callRefreshCicle = EventBusManager.on<CallRefreshCircle>().listen((event) {
if(widget.bean.id.toString() == event.circleId){
if (widget.bean.id.toString() == event.circleId) {
loadCallOutListData();
}
});
scroToTop = EventBusManager.on<ScrollToTop>().listen((event) {
scrollController.animateTo(
0.0,
@ -104,9 +102,6 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
// widget.back(widget.createState());
}
loadCallOutListData() async {
var data = await DioManager.instance.get(
url: "/up-service/interest/$circleId/callouts",
@ -175,10 +170,6 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
}
});
// if (bean.isQueen) {
// showJoinCiclePiker(cicleId);
// } else {
@ -191,9 +182,9 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
}
void pushMsgPage(Lists bean, String cicleId) async {
if (widget.bean.is_limit&&widget.bean.amount>0) {
showJoinCiclePiker(cicleId,widget.bean.amount.toString(),widget.bean.oldAmount.toString(),2,(payResult){
if (widget.bean.is_limit && widget.bean.amount > 0) {
showJoinCiclePiker(cicleId, widget.bean.amount.toString(),
widget.bean.oldAmount.toString(), 2, (payResult) {
widget.bean.is_limit = false;
if (Get.isRegistered<CircleLogic>()) {
var logic = Get.find<CircleLogic>();
@ -206,7 +197,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
logic.update();
}
Get.back();
},widget.bean.ios_item);
}, widget.bean.ios_item);
return;
}
@ -217,44 +208,47 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
return;
}
// if ()
var data = await DioManager.instance.get(
url: "/up-service/callout/${bean.id}/chat",);
url: "/up-service/callout/${bean.id}/chat",
);
if (data["code"] == 200) {
pushChatPage(data['data']['account_id'].toString().split("_").last,data['data']['account_id'], bean.user!.nickname!);
await Future.delayed(Duration(seconds: 1));
SharedPreferences sharedPreferences =await SharedPreferences.getInstance();
pushChatPage(data['data']['account_id'].toString().split("_").last,
data['data']['account_id'], bean.user!.nickname!);
// await Future.delayed(Duration(seconds: 1));
SharedPreferences sharedPreferences = await SharedPreferences.getInstance();
// SharedPreferencesHelper.getInstance().then((sharedPreferences) {
int userId = sharedPreferences.getInt(SharedPreferencesHelper.USERID)??0;
String avatar = sharedPreferences.getString(SharedPreferencesHelper.AVATAR)??"";
String name = sharedPreferences.getString(SharedPreferencesHelper.NAME)??"";
bean.chat!.users!.add(Users(avatar: avatar,id: userId,nickname: name));
widget.logic.update();
int userId = sharedPreferences.getInt(SharedPreferencesHelper.USERID) ?? 0;
String avatar = sharedPreferences.getString(SharedPreferencesHelper.AVATAR) ?? "";
String name = sharedPreferences.getString(SharedPreferencesHelper.NAME) ?? "";
bean.chat!.users!.add(Users(avatar: avatar, id: userId, nickname: name));
// widget.logic.update();
// });
}
}
@override
Widget build(BuildContext context) {
super.build(context);
List<JoinUser> urlList = widget.bean.lastJoinUsers;
List<Widget> widgets = [];
int i = 0;
// print(urlList);
if(null!=urlList){
if (null != urlList) {
urlList.forEach((element) {
if(widgets.length>2){
if (widgets.length > 2) {
return;
}
widgets.add(Positioned(
left: 15.sp * i,
child: circleWidget(element.avatar??"https://qiniuyun.leyuan666.com/quanzi/avatar/default.png",element.id.toString()),
child: circleWidget(
element.avatar ??
"https://qiniuyun.leyuan666.com/quanzi/avatar/default.png",
element.id.toString()),
));
i++;
});
}
return ClipRRect(
borderRadius: BorderRadius.circular(10.sp),
child: Container(
@ -304,26 +298,42 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
image: AssetImage(
getCircleImage('circle_desc')))),
child: Container(
margin: EdgeInsets.only(top: 10.sp,bottom: 10.sp),
margin: EdgeInsets.only(
top: 10.sp, bottom: 10.sp),
child: Column(
children: [
Container(
margin: EdgeInsets.only(bottom: 7.sp),
margin:
EdgeInsets.only(bottom: 7.sp),
width: Get.width,
// height: 50.sp,
child: HideText(text: widget.bean.intro,additionText: '查看更多',maxLines: 3,style: TextStyle(color: Colors.white, fontSize: 14.sp),additionStyle: TextStyle(color: const Color(0xFFFF4DF6), fontSize: 14.sp),onTap: () {
child: HideText(
text: widget.bean.intro,
additionText: '查看更多',
maxLines: 3,
style: TextStyle(
color: Colors.white,
fontSize: 14.sp),
additionStyle: TextStyle(
color:
const Color(0xFFFF4DF6),
fontSize: 14.sp),
onTap: () {
_showTextContentDialog(
context, widget.bean.intro,widget.bean.title);
context,
widget.bean.intro,
widget.bean.title);
},
)),
GestureDetector(
behavior:HitTestBehavior.opaque,
onTap: (){
behavior: HitTestBehavior.opaque,
onTap: () {
// showToast("点个鸡毛,星哥还没做");
// Get.toNamed(AppRoutes.FriendsActivity,arguments: '3');
},
child:urlList.length==0?Container(): Row(
child: urlList.length == 0
? Container()
: Row(
children: [
Row(
children: [
@ -343,7 +353,8 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
Text(
'${convertToTenThousand(widget.bean.joinTotal)}圈友加入',
style: TextStyle(
color: Colors.white,
color:
Colors.white,
fontSize: 12.sp),
),
SizedBox(
@ -411,18 +422,16 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
padding: EdgeInsets.all(1.sp),
child: ClipRRect(
borderRadius: BorderRadius.circular(8.0),
child: Image.network(
widget.bean.image,
child: Image.network(widget.bean.image,
width: 40.sp,
height: 40.sp,
fit:BoxFit.cover
),
fit: BoxFit.cover),
),
),
Expanded(
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: (){
onTap: () {
scrollController.animateTo(
0.0, // Scroll to the top
duration: Duration(milliseconds: 300),
@ -458,7 +467,8 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
),
),
)),
GestureDetector(//
GestureDetector(
//
onTap: () async {
if (widget.bean.isJoin) {
_showOutCircleDialog(
@ -497,7 +507,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
)));
}
void _showTextContentDialog(BuildContext context, String msg,String title) {
void _showTextContentDialog(BuildContext context, String msg, String title) {
showDialog(
context: context,
builder: (BuildContext context) {
@ -508,7 +518,6 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
padding: const EdgeInsets.all(1.0),
child: Stack(
children: [
Container(
decoration: BoxDecoration(
shape: BoxShape.rectangle,
@ -536,31 +545,37 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
top: 15,
left: 0,
right: 0,
child: Center(child: Text(title, style: TextStyle(
color: const Color(0xFFF7FAFA), fontSize: 16.sp)),)),
child: Center(
child: Text(title,
style: TextStyle(
color: const Color(0xFFF7FAFA), fontSize: 16.sp)),
)),
Container(
margin: EdgeInsets.only(top: 24.sp,bottom: 24.sp),
margin: EdgeInsets.only(top: 24.sp, bottom: 24.sp),
child: Container(
margin: EdgeInsets.only(
top: 12.sp, left: 14.sp, right: 14.sp),
margin:
EdgeInsets.only(top: 12.sp, left: 14.sp, right: 14.sp),
alignment: Alignment.center,
child: SingleChildScrollView(child: Text(
child: SingleChildScrollView(
child: Text(
msg,
textAlign: TextAlign.center,
style: TextStyle(
color: const Color(0xCCF7FAFA), fontSize: 16.sp),
),),
),
),
),
),
Positioned(
top:8.sp,
top: 8.sp,
right: 10.sp,
child: GestureDetector(
onTap: () {
Get.back();
},
child: Icon(
Icons.close,color: Colors.white,
Icons.close,
color: Colors.white,
size: 20.sp,
),
)),
@ -590,7 +605,8 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
onTap: () {
// pushOtherPeopleHomePage(element.id.toString());
},
child: circleWidget(element.avatar!,element.id.toString(), width: 24),
child:
circleWidget(element.avatar!, element.id.toString(), width: 24),
),
));
index++;
@ -606,7 +622,6 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
double picHeight = 0.0;
if (lists.album != null) {
if (lists.album!.isNotEmpty) {
Album info = lists.album!.first;
@ -672,16 +687,22 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
GestureDetector(
onTap: ()async {
var sp = await SharedPreferencesHelper.getInstance();
onTap: () async {
var sp =
await SharedPreferencesHelper.getInstance();
String myUserId = sp.getMyUserId();
if(lists.user?.id!.toString() == myUserId){
if (lists.user?.id!.toString() == myUserId) {
Get.toNamed(AppRoutes.UserInfoActivity);
return;
}
if (widget.bean.is_limit&&widget.bean.amount>0) {
showJoinCiclePiker(widget.bean.id.toString(),widget.bean.amount.toString(),widget.bean.oldAmount.toString(),1,(payResult){
if (widget.bean.is_limit &&
widget.bean.amount > 0) {
showJoinCiclePiker(
widget.bean.id.toString(),
widget.bean.amount.toString(),
widget.bean.oldAmount.toString(),
1, (payResult) {
widget.bean.is_limit = false;
if (Get.isRegistered<CircleLogic>()) {
var logic = Get.find<CircleLogic>();
@ -694,7 +715,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
logic.update();
}
Get.back();
},widget.bean.ios_item);
}, widget.bean.ios_item);
return;
}
pushHomePage(lists, lists.id.toString());
@ -738,7 +759,9 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
lists.user?.vip != null && lists.user!.vip == 0
? Container()
: Image.asset(
getCircleImage(lists.user!.vip == 1 ? 'vip' : 'year_vip'),
getCircleImage(lists.user!.vip == 1
? 'vip'
: 'year_vip'),
width: 36.sp,
)
],
@ -763,8 +786,11 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
Color(0xffB5D3FF)
])),
child: Text(
getAgeCOntent(lists.user!.gender??0, lists.user!.age??0,
lists.user!.role??0, lists.user!.orientation??0),
getAgeCOntent(
lists.user!.gender ?? 0,
lists.user!.age ?? 0,
lists.user!.role ?? 0,
lists.user!.orientation ?? 0),
// '${genderList[lists.user!.gender!]}.${lists.user!.age}.${roleList[lists.user!.role!]}.${orientationList[lists.user!.orientation!]}',
style: TextStyle(
color: Colors.black,
@ -873,7 +899,10 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
)),
GestureDetector(
onTap: () {
pushMsgPage(lists, widget.bean.id.toString(),);
pushMsgPage(
lists,
widget.bean.id.toString(),
);
// pushHomePage(
// lists, widget.bean.id.toString());
},
@ -922,9 +951,9 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
widgets.add(Positioned(
left: 12.sp * index,
child: GestureDetector(
onTap: () {
},
child: circleWidget(element.avatar!,element.id.toString(), width: 24),
onTap: () {},
child:
circleWidget(element.avatar!, element.id.toString(), width: 24),
),
));
index++;
@ -979,15 +1008,21 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
GestureDetector(
onTap: ()async {
var sp = await SharedPreferencesHelper.getInstance();
onTap: () async {
var sp =
await SharedPreferencesHelper.getInstance();
String myUserId = sp.getMyUserId();
if(lists.user?.id!.toString() == myUserId){
if (lists.user?.id!.toString() == myUserId) {
Get.toNamed(AppRoutes.UserInfoActivity);
return;
}
if (widget.bean.is_limit&&widget.bean.amount > 0) {
showJoinCiclePiker(widget.bean.id.toString(),widget.bean.amount.toString(),widget.bean.oldAmount.toString(),1,(payResult){
if (widget.bean.is_limit &&
widget.bean.amount > 0) {
showJoinCiclePiker(
widget.bean.id.toString(),
widget.bean.amount.toString(),
widget.bean.oldAmount.toString(),
1, (payResult) {
widget.bean.is_limit = false;
if (Get.isRegistered<CircleLogic>()) {
var logic = Get.find<CircleLogic>();
@ -1000,7 +1035,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
logic.update();
}
Get.back();
},widget.bean.ios_item);
}, widget.bean.ios_item);
return;
}
pushHomePage(lists, lists.id.toString());
@ -1041,10 +1076,13 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
SizedBox(
width: 8.sp,
),
lists.user?.vip != null && lists.user!.vip == 0
lists.user?.vip != null &&
lists.user!.vip == 0
? Container()
: Image.asset(
getCircleImage(lists.user!.vip == 1 ? 'vip' : 'year_vip'),
getCircleImage(lists.user!.vip == 1
? 'vip'
: 'year_vip'),
width: 36.sp,
)
],
@ -1070,8 +1108,11 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
Color(0xffB5D3FF)
])),
child: Text(
getAgeCOntent(lists.user!.gender??0, lists.user!.age??0,
lists.user!.role??0, lists.user!.orientation??0),
getAgeCOntent(
lists.user!.gender ?? 0,
lists.user!.age ?? 0,
lists.user!.role ?? 0,
lists.user!.orientation ?? 0),
style: TextStyle(
color: Colors.black,
fontSize: 12.sp,
@ -1188,9 +1229,8 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
color: Colors.white, fontSize: 12.sp),
)),
GestureDetector(
onTap: () async{
onTap: () async {
pushMsgPage(lists, widget.bean.id.toString());
},
child: Image.asset(
getCircleImage('chat'),
@ -1206,9 +1246,9 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
));
}
circleWidget(String url, String userId,{double width = 30}) {
circleWidget(String url, String userId, {double width = 30}) {
return GestureDetector(
onTap: (){
onTap: () {
Get.toNamed(AppRoutes.UserInfoActivity, arguments: userId);
},
child: Stack(
@ -1220,7 +1260,8 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
),
ClipOval(
child: Image.network(
url??"https://qiniuyun.leyuan666.com/quanzi/avatar/default.png",
url ??
"https://qiniuyun.leyuan666.com/quanzi/avatar/default.png",
width: (width - 1).sp,
height: (width - 1).sp,
fit: BoxFit.cover,
@ -1230,8 +1271,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
));
}
void _showOutCircleDialog(
BuildContext context, var controller, Circle bean) {
void _showOutCircleDialog(BuildContext context, var controller, Circle bean) {
showDialog(
context: context,
builder: (BuildContext context) {
@ -1384,13 +1424,10 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
if (data['code'] == 200) {
widget.bean = Circle.fromJson(data['data']);
widget.logic.updateCircleInfo(widget.bean);
setState(() {
});
setState(() {});
// final logic = Get.put(CircleLogic());
// logic.update();
}else if(data['code'] == 404){
} else if (data['code'] == 404) {
var logic = Get.put(CircleLogic());
logic.circle.lists.removeAt(logic.state.index);
logic.update();

View File

@ -2,7 +2,7 @@ import 'dart:io';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
// import 'package:flutter_install_app/flutter_install_app.dart';
import 'package:flutter_install_app/flutter_install_app.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:url_launcher/url_launcher.dart';
@ -218,7 +218,7 @@ class _CustomDialogState extends State<UpdateDialog> {
// SmartDialog.dismiss();
print(error);
});
// await AppInstaller.installApk(filePath, actionRequired: false);
await AppInstaller.installApk(filePath, actionRequired: false);
}
}

View File

@ -78,7 +78,7 @@ class _CustomDialogState extends State<YesAgreementDialog> {
margin: EdgeInsets.only(left: 10.sp, right: 10.sp),
child: RichText(
text: TextSpan(
text: "感谢您信任并使用跨友APP在你使用跨友的服务之前,请认真阅读",
text: "感谢您信任并使用微乐园APP在你使用微乐园的服务之前,请认真阅读",
style: TextStyle(
color: Colors.white,
fontSize: 14.sp,
@ -112,7 +112,7 @@ class _CustomDialogState extends State<YesAgreementDialog> {
),
TextSpan(
text:
"的全部内容,以了解用户权力义务和个人信息处理规则。跨友仅会将您的信息用于提供服务和改善体验,我们将权力保障您的信息安全,请同意后使用,若您不同意本隐私政策,很遗憾,我们将无法为您提供完整的产品和服务。",
"的全部内容,以了解用户权力义务和个人信息处理规则。微乐园仅会将您的信息用于提供服务和改善体验,我们将权力保障您的信息安全,请同意后使用,若您不同意本隐私政策,很遗憾,我们将无法为您提供完整的产品和服务。",
style: TextStyle(
color: Colors.white,
fontSize: 14.sp,

View File

@ -1,7 +1,6 @@
import 'dart:async';
import 'dart:io';
import 'dart:ffi';
import 'package:circle_app/app/circle/logic.dart';
import 'package:circle_app/app/minefragment/logic.dart';

View File

@ -22,6 +22,7 @@ import 'package:tencent_cloud_chat_uikit/ui/widgets/customize_ball_pulse_header.
import 'package:tencent_cloud_chat_uikit/base_widgets/tim_ui_kit_base.dart';
import 'package:tencent_cloud_chat_uikit/ui/widgets/wide_popup.dart';
import '../../../util/eventBus.dart';
import 'tim_uikit_conversation_item.dart';
typedef TIMConversationItemBuilder = Widget Function(
@ -190,9 +191,11 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
model.setSelectedConversation(conversation);
}
_clearHistory(V2TimConversation conversationItem) {
_timuiKitConversationController.clearHistoryMessage(
_clearHistory(V2TimConversation conversationItem) async{
await _timuiKitConversationController.clearHistoryMessage(
conversation: conversationItem);
await Future.delayed(Duration(seconds: 1));
EventBusManager.fire(RefreshUnread());
}
_pinConversation(V2TimConversation conversation) {
@ -201,9 +204,11 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
isPinned: !conversation.isPinned!);
}
_deleteConversation(V2TimConversation conversation) {
_timuiKitConversationController.deleteConversation(
_deleteConversation(V2TimConversation conversation) async{
await _timuiKitConversationController.deleteConversation(
conversationID: conversation.conversationID);
await Future.delayed(Duration(seconds: 1));
EventBusManager.fire(RefreshUnread());
}
List<V2TimConversation?> getFilteredConversation() {

View File

@ -8,6 +8,7 @@ import 'package:get/get.dart';
import '../../router/app_routers.dart';
import '../../util/SharedPreferencesHelper.dart';
import '../dialog/YesAgreementDialog.dart';
import '../select_circle/logic.dart';
import 'state.dart';
import '../../network/api.dart';
@ -23,28 +24,44 @@ class SplashLogic extends GetxController {
void onReady() async {
// TODO: implement onReady
super.onReady();
}
@override
void onInit() async {
super.onInit();
// await Future.delayed(Duration(seconds: 30));
var data1 =
await DioManager.instance.get(url: Api.getCircleList, params: {});
var bean1 = BaseResponse<ConfigBean>.fromJson(
data1, (data1) => ConfigBean.fromJson(data1));
if (bean1.code == 200) {
configBean = bean1.data!;
configBean.genderMap.forEach((key, value) {
genderList.add(value);
});
configBean.orientationMap.forEach((key, value) {
orientationList.add(value);
});
configBean.roleMap.forEach((key, value) {
roleList.add(value);
});
}
if ((await getAuthorization()).isEmpty) {
if(Platform.isIOS){
if (Platform.isIOS) {
pushLoginPage();
return;
}
bool isAgreemement = await getAgreemement();
if(!isAgreemement){
if (!isAgreemement) {
showReportDialog();
}else{
} else {
pushLoginPage();
}
} else {
var data =
await DioManager.instance.put(url: Api.refreshToken, params: {});
@ -65,7 +82,8 @@ class SplashLogic extends GetxController {
});
return;
} else if(bean.code == 5000||bean.code == 5001||bean.code == 5002||bean.code == 5003){
} else if (bean.code == 5000 || bean.code == 5001 || bean.code == 5002 ||
bean.code == 5003) {
pushLoginPage();
return;
}
@ -73,7 +91,7 @@ class SplashLogic extends GetxController {
if (bean.code == 500) {
await Future.delayed(Duration(seconds: 5));
onInit();
}else {
} else {
pushLoginPage();
}

View File

@ -9,6 +9,7 @@ import 'package:tencent_cloud_chat_uikit/tencent_cloud_chat_uikit.dart';
import '../../components/my_app_bar.dart';
import '../../router/app_routers.dart';
import '../../util/util.dart';
import '../select_circle/logic.dart';
import 'logic.dart';
class UserinfoPage extends StatefulWidget {
@ -413,6 +414,11 @@ class MyTabbedScreenState extends State<UserinfoPage>
),
logic.isBlack||logic.isDestroy||logic.isBlackBeen?Container(): GestureDetector(
onTap: () {
if(!logic.isShowAlbum){
List<MyConfigData> numbers = [];
var data = Get.toNamed(AppRoutes.Call_out, arguments: {'numbers': numbers});
return ;
}
if (controller.isMe) {
controller.isEdit = !controller.isEdit;
controller.update();
@ -421,7 +427,7 @@ class MyTabbedScreenState extends State<UserinfoPage>
}
},
child: Visibility(
visible: logic.isShowAlbum,
// visible: logic.isShowAlbum,
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(17),
@ -439,13 +445,14 @@ class MyTabbedScreenState extends State<UserinfoPage>
horizontal: 12.sp,
),
child: Text(
logic.isShowAlbum?
controller.isMe
? controller.isEdit
? "完成"
: "管理"
: controller.isUrgeStatus
? "已催更"
: "催更",
: "催更":"发布喊话",
style: const TextStyle(
color: Colors.white,
fontSize: 12,
@ -477,7 +484,7 @@ class MyTabbedScreenState extends State<UserinfoPage>
style: const TextStyle(color: Colors.white30),
),
),
controller.state.imaglist.isEmpty && !controller.isEdit
controller.state.imaglist.isEmpty && !controller.isMe
? Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
@ -510,19 +517,21 @@ class MyTabbedScreenState extends State<UserinfoPage>
crossAxisCount: 3,
),
itemCount: controller.isMe
? controller.isEdit
? controller.state.imaglist.length < 15
? controller.state.imaglist.length + 1
: controller.state.imaglist.length
: controller.state.imaglist.length
: controller.state.imaglist.length,
// ? controller.isEdit
// ? controller.state.imaglist.length < 15
// ? controller.state.imaglist.length
? controller.state.imaglist.length+1
: controller.state.imaglist.length ,
itemBuilder: (BuildContext context, int index) {
if (controller.isMe &&
controller.isEdit &&
controller.state.imaglist.length < 15) {
print("123123123123");
if (controller.isMe ) {
if (index == 0) {
return GestureDetector(
onTap: () {
if(controller.state.imaglist.length >= 15){
showOKToast("最大只可上传15张图片哦~");
return ;
}
controller.getImageFile();
},
child: Container(

View File

@ -255,7 +255,7 @@ class DioManager {
// String? errorMsg = isNetworkConnected
// ? e.requestOptions.extra["errorMsg"]
// : "网络连接断开,请检查网络设置";
return {'code': 500, 'msg': '加载中'};
return {'code': 500, 'msg': '加载中${e.message}'};
} catch (e) {
//
return {'code': 500, 'msg': '加载中...'};

View File

@ -12,6 +12,7 @@ import 'package:oktoast/oktoast.dart';
import 'package:path_provider/path_provider.dart';
import 'package:video_compress/video_compress.dart';
import '../app/select_circle/logic.dart';
import 'SharedPreferencesHelper.dart';
class Util {}
@ -177,7 +178,19 @@ String getAgeCOntent(int gender, int age, int role, int orientation) {
return "${getGenderContent(gender)}·${age}·${getRoleContent(role)}·${getOrientationContent(orientation)}";
}
late ConfigBean configBean;
List<MyConfigData> numbers = [];
List<String> genderList = [];
List<String> orientationList = [];
List<String> roleList = [];
String getGenderContent(int number) {
if(genderList.length!=0){
return genderList[number-1];
}else {
switch (number) {
case 1:
return "";
@ -194,9 +207,13 @@ String getGenderContent(int number) {
default:
return "";
}
}
}
String getOrientationContent(int number) {
if(orientationList.length!=0){
return orientationList[number-1];
}else {
switch (number) {
case 1:
return "异性恋";
@ -215,9 +232,13 @@ String getOrientationContent(int number) {
default:
return "";
}
}
}
String getRoleContent(int number) {
if(roleList.length!=0){
return roleList[number-1];
}else {
switch (number) {
case 1:
return "Sado";
@ -232,6 +253,7 @@ String getRoleContent(int number) {
default:
return "";
}
}
}
typedef void MyCallback(String path);