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

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. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion 21 minSdkVersion 21
targetSdkVersion flutter.targetSdkVersion targetSdkVersion flutter.targetSdkVersion
versionCode 8 versionCode 10
versionName "1.0.7" versionName "1.0.9"
manifestPlaceholders = [ manifestPlaceholders = [
vivo_APPID: "105669716", vivo_APPID: "105669716",
vivo_APPKEY:"84f750207787376b310ca5b0d5969122", 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 { getUpVersion() async {
if(isUpdate){ if(isUpdate){
showReportDialog(Get.context!, _updateInfo!.constraint == 0, _updateInfo!); showReportDialog(Get.context!, _updateInfo!.constraint == 0, _updateInfo!);
}else {
showOKToast("暂无新版本");
} }
} }

View File

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

View File

@ -1,5 +1,7 @@
import 'dart:async'; import 'dart:async';
import 'dart:io';
import 'dart:math'; 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/chat/TIMUIKitChat/TIMUIKitTextField/tim_uikit_send_sound_message.dart';
import 'package:circle_app/app/minefragment/logic.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_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_extended_text_field/extended_text_field.dart';
import 'package:tencent_keyboard_visibility/tencent_keyboard_visibility.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 '../../../../../util/eventBus.dart';
import '../../../../call_out/logic.dart';
GlobalKey<_TIMTextFieldLayoutNarrowState> TIMnarrowTextFieldKey = GlobalKey(); GlobalKey<_TIMTextFieldLayoutNarrowState> TIMnarrowTextFieldKey = GlobalKey();
@ -79,7 +84,7 @@ class TIMTextFieldLayoutNarrow extends StatefulWidget {
/// hint text for textField widget /// hint text for textField widget
final String? hintText; final String? hintText;
final String? userId; final String? userId;
final int? currentCursor; final int? currentCursor;
@ -139,7 +144,7 @@ class TIMTextFieldLayoutNarrow extends StatefulWidget {
required this.showSendEmoji, required this.showSendEmoji,
required this.showMorePanel, required this.showMorePanel,
this.hintText, this.hintText,
this.userId, this.userId,
required this.customEmojiStickerList, required this.customEmojiStickerList,
this.controller}) this.controller})
: super(key: key); : super(key: key);
@ -174,9 +179,10 @@ class _TIMTextFieldLayoutNarrowState
} }
}); });
} }
if(null==commentBlackEvent){ if (null == commentBlackEvent) {
commentBlackEvent = EventBusManager.on<CommentBlackEvent>().listen((event) { commentBlackEvent =
if(event.userId == widget.userId){ EventBusManager.on<CommentBlackEvent>().listen((event) {
if (event.userId == widget.userId) {
isBlack = event.isBlack; isBlack = event.isBlack;
} }
}); });
@ -184,15 +190,16 @@ class _TIMTextFieldLayoutNarrowState
getBlack(); getBlack();
} }
StreamSubscription? commentBlackEvent =null;
StreamSubscription? commentBlackEvent = null;
@override @override
void dispose() { void dispose() {
print("TIMTextFieldLayoutNarrow解绑"); print("TIMTextFieldLayoutNarrow解绑");
if(null!=commentBlackEvent){ if (null != commentBlackEvent) {
EventBusManager.cancelSubscription(commentBlackEvent!); EventBusManager.cancelSubscription(commentBlackEvent!);
} }
super.dispose(); super.dispose();
} }
@ -200,7 +207,7 @@ class _TIMTextFieldLayoutNarrowState
getBlack() async { getBlack() async {
final FriendshipServices _friendshipServices = final FriendshipServices _friendshipServices =
serviceLocator<FriendshipServices>(); serviceLocator<FriendshipServices>();
List<V2TimFriendInfo>? blacklist = await _friendshipServices.getBlackList(); List<V2TimFriendInfo>? blacklist = await _friendshipServices.getBlackList();
if (blacklist != null) { if (blacklist != null) {
isBlack = false; isBlack = false;
@ -213,7 +220,6 @@ class _TIMTextFieldLayoutNarrowState
} }
} }
void setSendButton() { void setSendButton() {
final value = widget.textEditingController.text; final value = widget.textEditingController.text;
if (isWebDevice() || isAndroidDevice()) { if (isWebDevice() || isAndroidDevice()) {
@ -411,7 +417,7 @@ class _TIMTextFieldLayoutNarrowState
setKeyboardHeight ??= OptimizeUtils.debounce((height) { setKeyboardHeight ??= OptimizeUtils.debounce((height) {
settingModel.keyboardHeight = height; settingModel.keyboardHeight = height;
}, const Duration(seconds: 1)); }, const Duration(seconds: 1));
// //
final debounceFunc = _debounce((value) { final debounceFunc = _debounce((value) {
if (isWebDevice() || isAndroidDevice()) { if (isWebDevice() || isAndroidDevice()) {
if (value.isEmpty && showMoreButton != true) { if (value.isEmpty && showMoreButton != true) {
@ -518,7 +524,7 @@ class _TIMTextFieldLayoutNarrowState
Stack( Stack(
children: [ children: [
Container( Container(
width: Get.width - 80.sp, width: Get.width - 80.sp,
// width: 296.sp, // width: 296.sp,
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
vertical: 8, horizontal: 12.sp), vertical: 8, horizontal: 12.sp),
@ -667,7 +673,7 @@ class _TIMTextFieldLayoutNarrowState
), ),
), ),
Container( Container(
height: 40.sp, height: 64.sp,
width: Get.width, width: Get.width,
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
@ -691,7 +697,8 @@ class _TIMTextFieldLayoutNarrowState
showSendSoundText = !showSendSoundText; showSendSoundText = !showSendSoundText;
}); });
} else { } else {
var data = await Permission.microphone.request(); var data =
await Permission.microphone.request();
if (data.isGranted) { if (data.isGranted) {
setState(() { setState(() {
showEmojiPanel = false; showEmojiPanel = false;
@ -699,7 +706,8 @@ class _TIMTextFieldLayoutNarrowState
showSendSoundText = !showSendSoundText; showSendSoundText = !showSendSoundText;
}); });
} else { } else {
Permissions.showPermissionConfirmDialog(context, Permission.microphone.value); Permissions.showPermissionConfirmDialog(
context, Permission.microphone.value);
} }
} }
} catch (e) { } catch (e) {
@ -733,6 +741,28 @@ class _TIMTextFieldLayoutNarrowState
child: Image.asset(getMsgImage('take_photo'), child: Image.asset(getMsgImage('take_photo'),
width: 40.sp), 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!; User userInfoBean = bean.data.user!;
isVip = userInfoBean.vip > 0; isVip = userInfoBean.vip > 0;
} }
} }
if (!isVip) { if (!isVip) {
showOKToast('开通会员之后才能发送图片'); showOKToast('开通会员之后才能发送图片');
@ -801,6 +830,81 @@ class _TIMTextFieldLayoutNarrowState
return isVip; 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 { Future getImageFile() async {
bool isOK = await checkVipStatus(); bool isOK = await checkVipStatus();
if (!isOK) { if (!isOK) {
@ -825,10 +929,9 @@ class _TIMTextFieldLayoutNarrowState
Future getTakeImageFile() async { Future getTakeImageFile() async {
bool isOK = await checkVipStatus(); bool isOK = await checkVipStatus();
if (!isOK) { if (!isOK) {
return; return;
} }
try { try {
final XFile? pickedFile = await _picker.pickImage( final XFile? pickedFile = await _picker.pickImage(

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 'package:tencent_cloud_chat_uikit/ui/controller/tim_uikit_chat_controller.dart';
import '../../util/eventBus.dart'; import '../../util/eventBus.dart';
import 'logic.dart';
class ChatPage extends StatefulWidget { class ChatPage extends StatefulWidget {
@ -111,6 +110,7 @@ class _ChatPageState extends State<ChatPage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
V2TimConversation con = Get.arguments; V2TimConversation con = Get.arguments;
return TIMChat( return TIMChat(
conversation: Get.arguments, conversation: Get.arguments,
customStickerPanel: renderCustomStickerPanel, customStickerPanel: renderCustomStickerPanel,
onTapAvatar :(String userId,TapDownDetails tapDownDetails)async{ onTapAvatar :(String userId,TapDownDetails tapDownDetails)async{
@ -121,6 +121,7 @@ class _ChatPageState extends State<ChatPage> {
}, },
controller : _timuiKitChatController, controller : _timuiKitChatController,
config: TIMUIKitChatConfig( config: TIMUIKitChatConfig(
// 使 // 使
isAllowClickAvatar: true, isAllowClickAvatar: true,
isUseDefaultEmoji: 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 { class CircleState {
String msg = ''; String msg = '';
int index = 0; int index = 0;
@ -79,6 +83,7 @@ class Chat {
int? count; int? count;
List<Users>? users; List<Users>? users;
Chat({this.accountId, this.count, this.users}); Chat({this.accountId, this.count, this.users});
Chat.fromJson(Map<String, dynamic> json) { Chat.fromJson(Map<String, dynamic> json) {

View File

@ -21,7 +21,6 @@ class CirclePage extends StatefulWidget {
class _CirclePageState extends State<CirclePage> class _CirclePageState extends State<CirclePage>
with AutomaticKeepAliveClientMixin { with AutomaticKeepAliveClientMixin {
@override @override
bool get wantKeepAlive => true; bool get wantKeepAlive => true;
@ -31,24 +30,20 @@ class _CirclePageState extends State<CirclePage>
final state = Get.find<CircleLogic>().state; final state = Get.find<CircleLogic>().state;
var getContext; var getContext;
@override
void dispose() {
// TODO: implement dispose
super.dispose();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
super.build(context);
getContext = context; getContext = context;
return GetBuilder<CircleLogic>(builder: (logic) { return GetBuilder<CircleLogic>(builder: (logic) {
return Container( return Container(
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height, height: MediaQuery.of(context).size.height,
decoration: const BoxDecoration( decoration: const BoxDecoration(
color: const Color(0xFF423055), color: const Color(0xFF423055), image: bgWidget),
image: bgWidget),
child: Scaffold( child: Scaffold(
resizeToAvoidBottomInset: false,
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
body: SafeArea( body: SafeArea(
child: GetBuilder(builder: (CircleLogic controller) { child: GetBuilder(builder: (CircleLogic controller) {
@ -66,25 +61,24 @@ class _CirclePageState extends State<CirclePage>
Expanded( Expanded(
child: Swiper( child: Swiper(
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
var bean = logic.circle.lists[index]; var bean = logic.circle.lists[index];
// final GlobalKey<InfoListViewState> infoListViewKey = GlobalKey<InfoListViewState>(); // final GlobalKey<InfoListViewState> infoListViewKey = GlobalKey<InfoListViewState>();
return InfoListView(index, bean, logic); return InfoListView(index, bean, logic);
}, },
onIndexChanged: (index) { onIndexChanged: (index) {
controller.state.index = index; controller.state.index = index;
if (index == logic.circle.lists.length - 1) { if (index == logic.circle.lists.length - 1) {
logic.loadMore(); logic.loadMore();
} }
print(index.toString()); print(index.toString());
}, },
index: controller.state.index, index: controller.state.index,
itemCount: logic.circle.lists.length, itemCount: logic.circle.lists.length,
viewportFraction: 0.93, viewportFraction: 0.93,
// scale: 0.9, // scale: 0.9,
loop: false, loop: false,
key: UniqueKey(), key: UniqueKey(),
// pagination: new SwiperPagination(),// // pagination: new SwiperPagination(),//
// control: new SwiperControl(),// // control: new SwiperControl(),//
)) ))
@ -100,8 +94,8 @@ class _CirclePageState extends State<CirclePage>
logic.getCircleIndex().id.toString(), logic.getCircleIndex().id.toString(),
logic.getCircleIndex().title!, logic.getCircleIndex().title!,
false)); 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( child: Image.asset(
getCircleImage('send_msg'), getCircleImage('send_msg'),
@ -122,11 +116,11 @@ class _CirclePageState extends State<CirclePage>
infoList = statistics.lastVisitUsers; infoList = statistics.lastVisitUsers;
if (infoList.isNotEmpty) { if (infoList.isNotEmpty) {
for (var element in infoList) { 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"]); urlList.add(element["avatar"]);
} }
// urlList.add(element["avatar"]); // urlList.add(element["avatar"]);
} }
} }
} }
@ -179,7 +173,7 @@ class _CirclePageState extends State<CirclePage>
).createShader(Offset.zero & bounds.size); ).createShader(Offset.zero & bounds.size);
}, },
child: GestureDetector( child: GestureDetector(
onTap: (){ onTap: () {
EventBusManager.fire(ScrollToTop()); EventBusManager.fire(ScrollToTop());
}, },
child: Text( child: Text(
@ -188,7 +182,9 @@ class _CirclePageState extends State<CirclePage>
fontSize: 18.sp, fontSize: 18.sp,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: Colors.white, 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'), getCircleImage('avatar_bg'),
width: width.sp, width: width.sp,
), ),
url.contains("http") ? ClipOval( url.contains("http")
child: Image.network( ? ClipOval(
url, child: Image.network(
width: (width - 1).sp, url,
height: (width - 1).sp, width: (width - 1).sp,
fit: BoxFit.cover, 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) { void _showTextContentDialog(BuildContext context, String msg) {
showDialog( showDialog(
context: context, context: context,

View File

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

View File

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

View File

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

View File

@ -8,6 +8,7 @@ import 'package:get/get.dart';
import '../../router/app_routers.dart'; import '../../router/app_routers.dart';
import '../../util/SharedPreferencesHelper.dart'; import '../../util/SharedPreferencesHelper.dart';
import '../dialog/YesAgreementDialog.dart'; import '../dialog/YesAgreementDialog.dart';
import '../select_circle/logic.dart';
import 'state.dart'; import 'state.dart';
import '../../network/api.dart'; import '../../network/api.dart';
@ -23,28 +24,44 @@ class SplashLogic extends GetxController {
void onReady() async { void onReady() async {
// TODO: implement onReady // TODO: implement onReady
super.onReady(); super.onReady();
} }
@override @override
void onInit() async { void onInit() async {
super.onInit(); super.onInit();
// await Future.delayed(Duration(seconds: 30)); // 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 ((await getAuthorization()).isEmpty) {
if(Platform.isIOS){ if (Platform.isIOS) {
pushLoginPage(); pushLoginPage();
return; return;
} }
bool isAgreemement = await getAgreemement(); bool isAgreemement = await getAgreemement();
if(!isAgreemement){ if (!isAgreemement) {
showReportDialog(); showReportDialog();
}else{ } else {
pushLoginPage(); pushLoginPage();
} }
} else { } else {
var data = var data =
await DioManager.instance.put(url: Api.refreshToken, params: {}); await DioManager.instance.put(url: Api.refreshToken, params: {});
@ -65,7 +82,8 @@ class SplashLogic extends GetxController {
}); });
return; 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(); pushLoginPage();
return; return;
} }
@ -73,7 +91,7 @@ class SplashLogic extends GetxController {
if (bean.code == 500) { if (bean.code == 500) {
await Future.delayed(Duration(seconds: 5)); await Future.delayed(Duration(seconds: 5));
onInit(); onInit();
}else { } else {
pushLoginPage(); 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 '../../components/my_app_bar.dart';
import '../../router/app_routers.dart'; import '../../router/app_routers.dart';
import '../../util/util.dart'; import '../../util/util.dart';
import '../select_circle/logic.dart';
import 'logic.dart'; import 'logic.dart';
class UserinfoPage extends StatefulWidget { class UserinfoPage extends StatefulWidget {
@ -413,6 +414,11 @@ class MyTabbedScreenState extends State<UserinfoPage>
), ),
logic.isBlack||logic.isDestroy||logic.isBlackBeen?Container(): GestureDetector( logic.isBlack||logic.isDestroy||logic.isBlackBeen?Container(): GestureDetector(
onTap: () { onTap: () {
if(!logic.isShowAlbum){
List<MyConfigData> numbers = [];
var data = Get.toNamed(AppRoutes.Call_out, arguments: {'numbers': numbers});
return ;
}
if (controller.isMe) { if (controller.isMe) {
controller.isEdit = !controller.isEdit; controller.isEdit = !controller.isEdit;
controller.update(); controller.update();
@ -421,7 +427,7 @@ class MyTabbedScreenState extends State<UserinfoPage>
} }
}, },
child: Visibility( child: Visibility(
visible: logic.isShowAlbum, // visible: logic.isShowAlbum,
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(17), borderRadius: BorderRadius.circular(17),
@ -439,13 +445,14 @@ class MyTabbedScreenState extends State<UserinfoPage>
horizontal: 12.sp, horizontal: 12.sp,
), ),
child: Text( child: Text(
logic.isShowAlbum?
controller.isMe controller.isMe
? controller.isEdit ? controller.isEdit
? "完成" ? "完成"
: "管理" : "管理"
: controller.isUrgeStatus : controller.isUrgeStatus
? "已催更" ? "已催更"
: "催更", : "催更":"发布喊话",
style: const TextStyle( style: const TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 12, fontSize: 12,
@ -477,7 +484,7 @@ class MyTabbedScreenState extends State<UserinfoPage>
style: const TextStyle(color: Colors.white30), style: const TextStyle(color: Colors.white30),
), ),
), ),
controller.state.imaglist.isEmpty && !controller.isEdit controller.state.imaglist.isEmpty && !controller.isMe
? Center( ? Center(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
@ -510,19 +517,21 @@ class MyTabbedScreenState extends State<UserinfoPage>
crossAxisCount: 3, crossAxisCount: 3,
), ),
itemCount: controller.isMe itemCount: controller.isMe
? controller.isEdit // ? controller.isEdit
? controller.state.imaglist.length < 15 // ? controller.state.imaglist.length < 15
? controller.state.imaglist.length + 1 // ? controller.state.imaglist.length
: controller.state.imaglist.length ? controller.state.imaglist.length+1
: controller.state.imaglist.length : controller.state.imaglist.length ,
: controller.state.imaglist.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
if (controller.isMe && print("123123123123");
controller.isEdit && if (controller.isMe ) {
controller.state.imaglist.length < 15) {
if (index == 0) { if (index == 0) {
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {
if(controller.state.imaglist.length >= 15){
showOKToast("最大只可上传15张图片哦~");
return ;
}
controller.getImageFile(); controller.getImageFile();
}, },
child: Container( child: Container(

View File

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

View File

@ -12,6 +12,7 @@ import 'package:oktoast/oktoast.dart';
import 'package:path_provider/path_provider.dart'; import 'package:path_provider/path_provider.dart';
import 'package:video_compress/video_compress.dart'; import 'package:video_compress/video_compress.dart';
import '../app/select_circle/logic.dart';
import 'SharedPreferencesHelper.dart'; import 'SharedPreferencesHelper.dart';
class Util {} class Util {}
@ -177,60 +178,81 @@ String getAgeCOntent(int gender, int age, int role, int orientation) {
return "${getGenderContent(gender)}·${age}·${getRoleContent(role)}·${getOrientationContent(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) { String getGenderContent(int number) {
switch (number) { if(genderList.length!=0){
case 1: return genderList[number-1];
return ""; }else {
case 2: switch (number) {
return ""; case 1:
case 3: return "";
return "MTF"; case 2:
case 4: return "";
return "FTM"; case 3:
case 5: return "MTF";
return "CD"; case 4:
case 6: return "FTM";
return "酷儿"; case 5:
default: return "CD";
return ""; case 6:
return "酷儿";
default:
return "";
}
} }
} }
String getOrientationContent(int number) { String getOrientationContent(int number) {
switch (number) { if(orientationList.length!=0){
case 1: return orientationList[number-1];
return "异性恋"; }else {
case 2: switch (number) {
return "同性恋"; case 1:
case 3: return "异性恋";
return "双性恋"; case 2:
case 4: return "同性恋";
return "泛性恋"; case 3:
case 5: return "双性恋";
return "无性恋"; case 4:
case 6: return "泛性恋";
return "智性恋"; case 5:
case 7: return "无性恋";
return "性单恋"; case 6:
default: return "智性恋";
return ""; case 7:
return "性单恋";
default:
return "";
}
} }
} }
String getRoleContent(int number) { String getRoleContent(int number) {
switch (number) { if(roleList.length!=0){
case 1: return roleList[number-1];
return "Sado"; }else {
case 2: switch (number) {
return "Maso"; case 1:
case 3: return "Sado";
return "Dom"; case 2:
case 4: return "Maso";
return "Sub"; case 3:
case 5: return "Dom";
return "Switch"; case 4:
default: return "Sub";
return ""; case 5:
return "Switch";
default:
return "";
}
} }
} }