1.3.9代码提交

This commit is contained in:
CYH 2023-12-21 16:13:15 +08:00
parent d372be171d
commit 0a4c28d7bd
26 changed files with 656 additions and 183 deletions

View File

@ -71,8 +71,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 30 versionCode 31
versionName "1.3.8" versionName "1.3.9"
manifestPlaceholders = [ manifestPlaceholders = [
vivo_APPID: "105669716", vivo_APPID: "105669716",
vivo_APPKEY:"84f750207787376b310ca5b0d5969122", vivo_APPKEY:"84f750207787376b310ca5b0d5969122",

View File

@ -637,6 +637,23 @@ class _TIMTextFieldLayoutNarrowState
onTap: () { onTap: () {
showKeyboard = true; showKeyboard = true;
widget.goDownBottom(); widget.goDownBottom();
widget.textEditingController.value = TextEditingValue(
/// controller.text = "0000"
text: widget.textEditingController.text,
///
selection: TextSelection.fromPosition(
///
TextPosition(
affinity: TextAffinity.downstream,
///
offset: widget.textEditingController.text.length),),);
// = TextEditingController.fromValue(
// ///
// );
setState(() { setState(() {
showEmojiPanel = false; showEmojiPanel = false;
showMore = false; showMore = false;

View File

@ -15,7 +15,8 @@ class ChatGiftPannel extends StatefulWidget {
String accid; String accid;
String giftId; String giftId;
int selectedIndex; int selectedIndex;
ChatGiftPannel({Key? key,required this.accid,this.selectedIndex = 0, this.giftId = ''}) : super(key: key); bool isShowVip;
ChatGiftPannel({Key? key,required this.accid,this.selectedIndex = 0, this.giftId = '',this.isShowVip = true}) : super(key: key);
@override @override
State<StatefulWidget> createState() => _ChatGiftPannelState(); State<StatefulWidget> createState() => _ChatGiftPannelState();
@ -33,7 +34,7 @@ class _ChatGiftPannelState extends State<ChatGiftPannel>
void initState() { void initState() {
// TODO: implement initState // TODO: implement initState
tabController = TabController( tabController = TabController(
length:2, length:widget.isShowVip ? 2 : 1,
vsync: this, vsync: this,
initialIndex: widget.selectedIndex initialIndex: widget.selectedIndex
); );
@ -84,14 +85,14 @@ class _ChatGiftPannelState extends State<ChatGiftPannel>
children: [ children: [
Container( Container(
height: 30.sp, height: 30.sp,
width:120.sp, width: widget.isShowVip ? 120.sp : 60.sp,
margin: EdgeInsets.only(left: 5.sp,), margin: EdgeInsets.only(left: 5.sp,),
child: TabBar( child: TabBar(
isScrollable: false, isScrollable: false,
automaticIndicatorColorAdjustment: false, automaticIndicatorColorAdjustment: false,
labelPadding: EdgeInsets.symmetric(horizontal: 4.0.sp), labelPadding: EdgeInsets.symmetric(horizontal: 4.0.sp),
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
indicatorColor: AppColor.mainColor, indicatorColor: widget.isShowVip ? AppColor.mainColor : Colors.transparent,
indicatorSize: TabBarIndicatorSize.label, indicatorSize: TabBarIndicatorSize.label,
unselectedLabelStyle: TextStyle( unselectedLabelStyle: TextStyle(
fontSize: 16.sp, fontSize: 16.sp,
@ -102,17 +103,19 @@ class _ChatGiftPannelState extends State<ChatGiftPannel>
labelStyle: TextStyle( labelStyle: TextStyle(
fontSize: 16.sp, fontWeight: FontWeight.w500), fontSize: 16.sp, fontWeight: FontWeight.w500),
controller: tabController, controller: tabController,
tabs: const <Widget>[ tabs: widget.isShowVip ? <Widget>[
Tab( Tab(
text: '礼物', text: '礼物',
), ),
Tab( Tab(
text: '会员', text: '会员',
), ),
], ] : <Widget>[Tab(
text: '礼物',
)],
), ),
), ),
tabController.index == 0 ? Container( tabController.index == 0 && widget.isShowVip ? Container(
margin: EdgeInsets.only(right: 15.sp), margin: EdgeInsets.only(right: 15.sp),
child: InkWell( child: InkWell(
onTap: () { onTap: () {
@ -148,6 +151,7 @@ class _ChatGiftPannelState extends State<ChatGiftPannel>
controller: tabController, controller: tabController,
children: [ children: [
Gift(widget.accid,widget.giftId), Gift(widget.accid,widget.giftId),
if (widget.isShowVip)
PartnerOption(accid: widget.accid), PartnerOption(accid: widget.accid),
], ],
)) ))

View File

@ -97,7 +97,7 @@ class _GiftState extends State<Gift> {
}), }),
)), )),
Container( Container(
padding: EdgeInsets.only(left: 16.sp, right: 16.sp), padding: EdgeInsets.only(left: 10.sp, right: 10.sp),
height: 48.sp, height: 48.sp,
width: Get.width, width: Get.width,
child: Row( child: Row(
@ -286,13 +286,13 @@ class _GiftState extends State<Gift> {
width: Get.width, width: Get.width,
// color: Colors.red, // color: Colors.red,
height: 255.sp, height: 255.sp,
padding: EdgeInsets.only(left: 16.sp, right: 16.sp), padding: EdgeInsets.only(left: 10.sp, right: 10.sp),
child: GridView.builder( child: GridView.builder(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 4, crossAxisCount: 4,
crossAxisSpacing: 0.0.sp, crossAxisSpacing: 0.0.sp,
mainAxisSpacing: 0.sp, mainAxisSpacing: 0.sp,
childAspectRatio: (Get.width - 32.sp) / 4 / 127.5.sp, childAspectRatio: (Get.width - 32.sp) / 4 / 120.5.sp,
), ),
itemCount: info.length, itemCount: info.length,
// Replace with the actual item count // Replace with the actual item count

View File

@ -76,6 +76,13 @@ class CircleLogic extends GetxController {
}); });
} }
loadData() {
loadCircleListData();
loadCirclePeopleData();
initGerder();
getCityList();
}
loadCircleListData() async { loadCircleListData() async {
var data = await DioManager.instance.get( var data = await DioManager.instance.get(

View File

@ -21,6 +21,7 @@ import 'package:gradient_borders/gradient_borders.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
import '../../../../util/eventBus.dart'; import '../../../../util/eventBus.dart';
import '../../chat/widget/chat_gift_pannel.dart';
const String todayAddWxStatus = 'todayAddWxStatus'; const String todayAddWxStatus = 'todayAddWxStatus';
@ -658,6 +659,18 @@ class _DiscoverState extends State<Discover>
child: Container( child: Container(
child: Column( child: Column(
children: [ children: [
GestureDetector(
onTap: () async {
showGiftPannel(user.imAccid!.toString());
},
child: Image.asset(
getMsgImage('gift'),
width: 50.sp,
),
),
SizedBox(
height: 25.sp,
),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
pushChatPage( pushChatPage(
@ -976,6 +989,17 @@ class _DiscoverState extends State<Discover>
}, },
); );
} }
showGiftPannel(String accId) {
Get.bottomSheet(
ChatGiftPannel(
accid: accId,
isShowVip:false,
),
isScrollControlled: false,
enableDrag: false,
);
}
} }
class DiscoverDataRefresh { class DiscoverDataRefresh {

View File

@ -760,7 +760,8 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
height: 30.sp, height: 30.sp,
), ),
Text( Text(
lists.user!.city ?? '外星',
(lists.user!.city ?? '外星').length > 4 ? (lists.user!.city ?? '外星').substring(0,4) + '...' :(lists.user!.city ?? '外星'),
style: TextStyle(color: Colors.white, fontSize: 15.sp), style: TextStyle(color: Colors.white, fontSize: 15.sp),
) )
], ],
@ -1068,7 +1069,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
height: 30.sp, height: 30.sp,
), ),
Text( Text(
lists.user!.city ?? '外星', (lists.user!.city ?? '外星').length > 4 ? (lists.user!.city ?? '外星').substring(0,4) + '...' :(lists.user!.city ?? '外星'),
style: TextStyle(color: Colors.white, fontSize: 15.sp), style: TextStyle(color: Colors.white, fontSize: 15.sp),
) )
], ],

View File

@ -573,7 +573,7 @@ class _LikeViewState extends State<LikeView>
height: 30.sp, height: 30.sp,
), ),
Text( Text(
lists.user!.city ?? '外星', (lists.user!.city ?? '外星').length > 4 ? (lists.user!.city ?? '外星').substring(0,4) + '...' :(lists.user!.city ?? '外星'),
style: TextStyle(color: Colors.white, fontSize: 15.sp), style: TextStyle(color: Colors.white, fontSize: 15.sp),
) )
], ],
@ -877,7 +877,7 @@ class _LikeViewState extends State<LikeView>
height: 30.sp, height: 30.sp,
), ),
Text( Text(
lists.user!.city ?? '外星', (lists.user!.city ?? '外星').length > 4 ? (lists.user!.city ?? '外星').substring(0,4) + '...' :(lists.user!.city ?? '外星'),
style: TextStyle(color: Colors.white, fontSize: 15.sp), style: TextStyle(color: Colors.white, fontSize: 15.sp),
) )
], ],

View File

@ -13,6 +13,7 @@ import 'package:circle_app/network/api.dart';
import 'package:circle_app/network/dio_manager.dart'; import 'package:circle_app/network/dio_manager.dart';
import 'package:circle_app/router/app_routers.dart'; import 'package:circle_app/router/app_routers.dart';
import 'package:circle_app/util/util.dart'; import 'package:circle_app/util/util.dart';
import 'package:connectivity/connectivity.dart';
import 'package:event_bus/event_bus.dart'; import 'package:event_bus/event_bus.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_native_splash/flutter_native_splash.dart'; import 'package:flutter_native_splash/flutter_native_splash.dart';
@ -31,12 +32,16 @@ import '../../util/eventBus.dart';
import '../../view/notice.dart'; import '../../view/notice.dart';
import '../circle/view.dart'; import '../circle/view.dart';
import '../dialog/UpdateDialog.dart'; import '../dialog/UpdateDialog.dart';
import '../like/logic.dart';
import '../minefragment/view.dart'; import '../minefragment/view.dart';
import '../msg/view.dart'; import '../msg/view.dart';
import 'state.dart'; import 'state.dart';
class HomeLogic extends GetxController with WidgetsBindingObserver { class HomeLogic extends GetxController with WidgetsBindingObserver {
late TabController tabController; late TabController tabController;
var connectivitySub;
ConnectivityResult? currentResult;
int currentIndex = 0; int currentIndex = 0;
Widget currentPage = Container(); Widget currentPage = Container();
@ -61,6 +66,7 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
void onClose() { void onClose() {
// TODO: implement onClose // TODO: implement onClose
super.onClose(); super.onClose();
connectivitySub.cancel();
TencentImSDKPlugin.v2TIMManager TencentImSDKPlugin.v2TIMManager
.v2TIMMessageManager.removeAdvancedMsgListener(); .v2TIMMessageManager.removeAdvancedMsgListener();
WidgetsBinding.instance.removeObserver(this); WidgetsBinding.instance.removeObserver(this);
@ -71,6 +77,10 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
void onInit() async { void onInit() async {
super.onInit(); super.onInit();
unreadSIze.value = '0'; unreadSIze.value = '0';
//
connectListener();
//
getConnectType();
getIMData(); getIMData();
setFirstData(); setFirstData();
@ -433,6 +443,47 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
showcirlceUnred.value = isHasNew; showcirlceUnred.value = isHasNew;
} }
} }
///
void getConnectType() async {
var connectResult = await (Connectivity().checkConnectivity());
if (connectResult == ConnectivityResult.mobile) {
// _netType = "4G";
} else if (connectResult == ConnectivityResult.wifi) {
// _netType = "wifi";
} else if (connectResult == ConnectivityResult.none) {
// _netType = "未连接";
}
}
///
Future<bool> isConnected() async {
var connectResult = await (Connectivity().checkConnectivity());
return connectResult != ConnectivityResult.none;
}
///
connectListener() {
connectivitySub = Connectivity().onConnectivityChanged.listen((ConnectivityResult result) {
if (result == ConnectivityResult.none) {
if (currentIndex == 0) {
var logic = Get.put(CircleLogic());
logic.loadData();
} else if (currentIndex == 1) {
var logic = Get.put(LikeLogic());
logic.loadData();
} else if (currentIndex == 2) {
final logic = Get.find<MsgLogic>();
logic.loadData();
} else if (currentIndex == 3) {
var logic = Get.put(MinefragmentLogic());
logic.loadData();
}
}});
}
} }

View File

@ -55,6 +55,12 @@ class LikeLogic extends GetxController {
loadMyCircleData(); loadMyCircleData();
} }
loadData() {
loadInviteData();
loadCircleListData();
loadMyCircleData();
}
loadInviteData() async { loadInviteData() async {
var data = await DioManager.instance.get(url: Api.inviteMainPage); var data = await DioManager.instance.get(url: Api.inviteMainPage);

View File

@ -83,7 +83,6 @@ class Complete_materialLogic extends GetxController {
state.roleId = userInfoBean!.role.toString(); state.roleId = userInfoBean!.role.toString();
state.orientation = getOrientationContent(userInfoBean!.orientation); state.orientation = getOrientationContent(userInfoBean!.orientation);
if (userInfoBean!.orientations.isNotEmpty) { if (userInfoBean!.orientations.isNotEmpty) {
watchGenderList.forEach((element) { watchGenderList.forEach((element) {
if (userInfoBean!.orientations!.contains(element.id)) { if (userInfoBean!.orientations!.contains(element.id)) {
element.isSelect = true; element.isSelect = true;
@ -105,6 +104,9 @@ class Complete_materialLogic extends GetxController {
showOKToast(bean.msg); showOKToast(bean.msg);
} }
} else {
watchGenderList[1].isSelect = true;
update();
} }

View File

@ -55,6 +55,12 @@ class MinefragmentLogic extends GetxController {
}); });
} }
loadData() {
getMode();
checkVersion();
checkShowPositiveFeedBack();
}
Future<void> checkVersion() async { Future<void> checkVersion() async {
var data = await DioManager.instance.get(url: Api.APP_VERSION); var data = await DioManager.instance.get(url: Api.APP_VERSION);
var bean = BaseResponse<UpdateInfo>.fromJson( var bean = BaseResponse<UpdateInfo>.fromJson(

View File

@ -15,6 +15,7 @@ import 'package:get/get.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
import '../../common/Widgets/open_vip_tip/view.dart'; import '../../common/Widgets/open_vip_tip/view.dart';
import '../../common/colors/app_color.dart';
import '../../main.dart'; import '../../main.dart';
import '../../util/SharedPreferencesHelper.dart'; import '../../util/SharedPreferencesHelper.dart';
import '../../util/util.dart'; import '../../util/util.dart';
@ -123,14 +124,14 @@ class _MinefragmentPageState extends State<MinefragmentPage> with RouteAware {
top:24.sp, top:24.sp,
child: Container( child: Container(
width: Get.width, width: Get.width,
padding: EdgeInsets.only(left: 20.sp,right: 50.sp), padding: EdgeInsets.only(left: 18.sp,right: 40.sp),
height: 50.sp, height: 50.sp,
child: Row( child: Row(
children: [ children: [
if (!logic.isProxy) if (!logic.isProxy)
Image.asset(getHomeImage('mine_vip_icon'),width: 46.sp,), Image.asset(getHomeImage('mine_vip_icon'),width: 46.sp,),
SizedBox(width: !logic.isProxy ? 10.sp : 60.sp,), SizedBox(width: !logic.isProxy ? 5.sp : 60.sp,),
Expanded( Expanded(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -142,8 +143,6 @@ class _MinefragmentPageState extends State<MinefragmentPage> with RouteAware {
), ),
), ),
if (!logic.isProxy) if (!logic.isProxy)
SizedBox(width: 10.sp,),
if (!logic.isProxy)
Image.asset(getHomeImage(logic.isVip.value == 0 ? 'open_vip' : 'pay_vip'),height: 28.sp,), Image.asset(getHomeImage(logic.isVip.value == 0 ? 'open_vip' : 'pay_vip'),height: 28.sp,),
], ],
), ),
@ -151,6 +150,7 @@ class _MinefragmentPageState extends State<MinefragmentPage> with RouteAware {
],), ],),
), ),
myAssetsItem(),
_circleLiveView(logic), _circleLiveView(logic),
Container(height: 20.sp,) Container(height: 20.sp,)
], ],
@ -161,11 +161,74 @@ class _MinefragmentPageState extends State<MinefragmentPage> with RouteAware {
}); });
} }
myAssetsItem() {
return GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
Get.toNamed(AppRoutes.MyAssets);
},
child: Container(
margin: EdgeInsets.only(top: 10.sp,),
padding: EdgeInsets.only(
left: 12.sp,
right: 12.sp,
bottom: 10.sp,
top: 10.sp),
// height: 80.sp,
decoration: BoxDecoration(
color: Colors.white.withOpacity(0.05),
borderRadius: BorderRadius.circular(13.sp)),
child: Row(
children: [
Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'我的资产',
style: TextStyle(
color: AppColor.mainColor,
fontSize: 18.sp,
),
),
SizedBox(
height: 8.sp,
),
Text(
'您的圈内资产和收入都在这里哦',
style: TextStyle(
color: Colors.white,
fontSize: 15.sp,
),
),
],
),
),
Expanded(child: Container()),
Container(
height: 26.sp,
padding:
EdgeInsets.only(left: 10.sp, right: 10.sp),
alignment: Alignment.center,
decoration: BoxDecoration(
gradient: AppColor.mainVerLinearGradient,
borderRadius: BorderRadius.circular(13.sp)),
child: Text(
'前往查看',
style: TextStyle(
color: Colors.white, fontSize: 16.sp),
),
),
],
)),
);
}
Widget _circleLiveView(MinefragmentLogic logic) { Widget _circleLiveView(MinefragmentLogic logic) {
return Column( return Column(
children: [_myAssetItemView(),_circleItemView(logic),_invienItemView(),_shareItemView(),_editGoodReviewItemView(), _helpItemView(),_setUpItemView()], children: [_circleItemView(logic),_invienItemView(),_shareItemView(),_editGoodReviewItemView(), _helpItemView(),_setUpItemView()],
); );
} }
@ -328,8 +391,9 @@ class _MinefragmentPageState extends State<MinefragmentPage> with RouteAware {
Widget _editGoodReviewItemView() { Widget _editGoodReviewItemView() {
return mineLogic.isShwGoodReview ? GestureDetector( return (mineLogic.isShwGoodReview ?? false) ? GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap: () { onTap: () {
showTipPop(); showTipPop();
}, },

View File

@ -1018,9 +1018,9 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
}, },
child: Container( child: Container(
margin: EdgeInsets.only(right: 10.sp), margin: EdgeInsets.only(right: 10.sp),
padding: EdgeInsets.only(left: 12.sp, right: 12.sp), padding: EdgeInsets.only(left: 12.sp, right: 5.sp),
height: 72.sp, height: 72.sp,
width: 140.sp, width: 145.sp,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: borderRadius:
BorderRadius.circular(8.sp), BorderRadius.circular(8.sp),

View File

@ -1,5 +1,7 @@
// ignore_for_file: empty_catches // ignore_for_file: empty_catches
import 'dart:convert';
import 'package:cached_network_image/cached_network_image.dart'; import 'package:cached_network_image/cached_network_image.dart';
import 'package:circle_app/app/msg/TIMUIKitConversation/tim_uikit_conversation_last_msg.dart'; import 'package:circle_app/app/msg/TIMUIKitConversation/tim_uikit_conversation_last_msg.dart';
import 'package:circle_app/util/util.dart'; import 'package:circle_app/util/util.dart';
@ -132,6 +134,18 @@ class TIMConversationItem extends TIMUIKitStatelessWidget {
@override @override
Widget tuiBuild(BuildContext context, TUIKitBuildValue value) { Widget tuiBuild(BuildContext context, TUIKitBuildValue value) {
int vipType = 0;
if (userInfo != null) {
if (userInfo!.customInfo!.containsKey('Vip')) {
if (userInfo!.customInfo!['Vip'] != null) {
String infoStr = userInfo!.customInfo!['Vip']!;
Map infoMap = jsonDecode(infoStr);
if (infoMap.containsKey('type')) {
vipType = infoMap['type'];
}
}
}
}
final TUITheme theme = value.theme; final TUITheme theme = value.theme;
final isDesktopScreen = final isDesktopScreen =
TUIKitScreenUtils.getFormFactor(context) == DeviceType.Desktop; TUIKitScreenUtils.getFormFactor(context) == DeviceType.Desktop;
@ -227,6 +241,15 @@ class TIMConversationItem extends TIMUIKitStatelessWidget {
) )
), ),
child: Text('官方',style: TextStyle(color: Color(0xFFF7FAFA),fontSize: 10.sp,fontWeight: FontWeight.w600),),), child: Text('官方',style: TextStyle(color: Color(0xFFF7FAFA),fontSize: 10.sp,fontWeight: FontWeight.w600),),),
if (vipType > 0)
Container(
margin: EdgeInsets.only(left: 5.sp,),
child: Image(
image: AssetImage(getBaseImage(vipType == 2 ? 'year_vip' : "vip")),
width: 44.sp,
height: 18.sp,
) ,),
Expanded( Expanded(
child:Container()), child:Container()),
_getTimeStringForChatWidget(context, theme), _getTimeStringForChatWidget(context, theme),

View File

@ -32,6 +32,14 @@ class MsgLogic extends GetxController {
loadLikeData(); loadLikeData();
loadStatusData(); loadStatusData();
} }
loadData() {
loadMyInfoData();
loadChatData();
loadLikeData();
loadStatusData();
}
loadLikeData() async { loadLikeData() async {
var data = var data =
await DioManager.instance.get(url: Api.fansList, params: { await DioManager.instance.get(url: Api.fansList, params: {

View File

@ -53,7 +53,7 @@ class My_assetsPage extends StatelessWidget {
return logic.myAssest != null ? SingleChildScrollView( return logic.myAssest != null ? SingleChildScrollView(
child: Column( child: Column(
children: [ children: [
Container( Container(
padding: EdgeInsets.only(left: 15.sp, right: 15.sp), padding: EdgeInsets.only(left: 15.sp, right: 15.sp),
child:Stack( child:Stack(
children: [ children: [
@ -282,8 +282,68 @@ class My_assetsPage extends StatelessWidget {
), ),
], ],
)), )),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
navigateStartGetMoeny();
},
child: Container(
margin: EdgeInsets.only(top: 10.sp,left: 15.sp,right: 15.sp),
padding: EdgeInsets.only(
left: 12.sp,
right: 12.sp,
bottom: 10.sp,
top: 10.sp),
// height: 80.sp,
decoration: BoxDecoration(
color: Color(0x1AFFFFFF),
borderRadius: BorderRadius.circular(13.sp)),
child: Row(
children: [
Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'微乐园赚钱攻略',
style: TextStyle(
color: AppColor.mainColor,
fontSize: 18.sp,
),
),
SizedBox(
height: 8.sp,
),
Text(
'几种赚钱方式助你躺赚',
style: TextStyle(
color: Colors.white,
fontSize: 14.sp,
),
),
],
),
),
Expanded(child: Container()),
Container(
height: 26.sp,
padding:
EdgeInsets.only(left: 10.sp, right: 10.sp),
alignment: Alignment.center,
decoration: BoxDecoration(
gradient: AppColor.mainVerLinearGradient,
borderRadius: BorderRadius.circular(13.sp)),
child: Text(
'开始赚钱',
style: TextStyle(
color: Colors.white, fontSize: 16.sp),
),
),
],
)),
),
Container( Container(
margin: EdgeInsets.only(top: 16.sp), margin: EdgeInsets.only(top: 10.sp),
height: 401.sp, height: 401.sp,
width: Get.width, width: Get.width,
child: RechargeScreenDialog(isShowBalance: false,), child: RechargeScreenDialog(isShowBalance: false,),

View File

@ -4,6 +4,7 @@ import 'package:pull_to_refresh/pull_to_refresh.dart';
import '../../network/api.dart'; import '../../network/api.dart';
import '../../network/dio_manager.dart'; import '../../network/dio_manager.dart';
import '../circle/logic.dart';
class QuickLogic extends GetxController { class QuickLogic extends GetxController {
@ -37,7 +38,21 @@ class QuickLogic extends GetxController {
refreshController.loadComplete(); refreshController.loadComplete();
lists = list; lists = list;
} else { } else {
lists.addAll(list);
list.forEach((element) {
var info = VicinityItemBean.fromJson(element);
bool isContain = false;
lists.forEach((element1) {
var info1 = VicinityItemBean.fromJson(element1);
if (info.id == info1.id) {
isContain = true;
}
});
if (!isContain) {
lists.add(element);
}
});
// lists.addAll(list);
refreshController.loadComplete(); refreshController.loadComplete();
} }
} else { } else {

View File

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

View File

@ -24,7 +24,7 @@ class _WebViewContainerState extends State<WebviewPage> {
controller = WebViewController() controller = WebViewController()
..setJavaScriptMode(JavaScriptMode.unrestricted) ..setJavaScriptMode(JavaScriptMode.unrestricted)
..setBackgroundColor(Colors.white) ..setBackgroundColor(logic.title.contains('赚钱') || logic.title.contains('攻略') ? Colors.transparent : Colors.white)
..setNavigationDelegate( ..setNavigationDelegate(
NavigationDelegate( NavigationDelegate(
onProgress: (int progress) { onProgress: (int progress) {

View File

@ -24,6 +24,7 @@ import 'dart:ui' as ui;
import 'package:fluwx/fluwx.dart' as fluwx; import 'package:fluwx/fluwx.dart' as fluwx;
import 'package:path_provider/path_provider.dart'; import 'package:path_provider/path_provider.dart';
import 'package:qr_flutter/qr_flutter.dart'; import 'package:qr_flutter/qr_flutter.dart';
import 'package:tencent_cloud_chat_uikit/tencent_cloud_chat_uikit.dart';
import '../../app/likelist/logic.dart'; import '../../app/likelist/logic.dart';
@ -43,7 +44,7 @@ class _CircleShareState extends State<CircleShare> {
GlobalKey _globalKey = GlobalKey(); GlobalKey _globalKey = GlobalKey();
List<UserListItem> lists = []; List<UserListItem> lists = [];
late MinefragmentLogic logic; late MinefragmentLogic logic;
List<V2TimUserFullInfo> conList = [];
@override @override
void initState() { void initState() {
@ -281,37 +282,46 @@ class _CircleShareState extends State<CircleShare> {
SafeArea( SafeArea(
top: false, top: false,
child: Container( child: Container(
height: lists.isNotEmpty ? 264.sp : 164.sp, height: lists.isNotEmpty || conList.isNotEmpty ? 264.sp : 164.sp,
width: Get.width, width: Get.width,
color: Color(0xFF292247), color: Color(0xFF292247),
child: Column( child: Column(
children: [ children: [
if (lists.isNotEmpty) if (lists.isNotEmpty || conList.isNotEmpty)
Container( Container(
height: 100.sp, height: 100.sp,
child: ListView.builder( child: ListView.builder(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
itemBuilder: (context,index) { itemBuilder: (context,index) {
if (lists.length > 5 && index == 4) { if (index == 4) {
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {
Get.bottomSheet(FollowMeDialog( bean: widget.bean,), isScrollControlled: true, Get.bottomSheet(FollowMeDialog( bean: widget.bean,), isScrollControlled: true,
enableDrag: false); enableDrag: false);
}, },
child: Column( behavior: HitTestBehavior.opaque,
mainAxisAlignment: MainAxisAlignment.center, child: Container(
children: [ width: Get.width / 5,
Image.asset(getCircleImage('share_more'),width: 51.sp,), child: Column(
SizedBox(height: 4.sp,), mainAxisAlignment: MainAxisAlignment.center,
Text('更多',style: TextStyle(color: Colors.white,fontSize: 14.sp),) children: [
], Image.asset(getCircleImage('share_more'),width: 51.sp,),
SizedBox(height: 4.sp,),
Text('更多',style: TextStyle(color: Colors.white,fontSize: 14.sp),)
],
),
), ),
); );
} }
var info = lists[index]; var info;
if (conList.length > index) {
info = conList[index];
} else {
info = lists[index];
}
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {
sendCircleCustomMsg(info.user.imId, sendCircleCustomMsg(info.userID ?? info.user.imId,
jsonEncode(widget.bean.toJson()), '分享[${widget.bean.title}]'); jsonEncode(widget.bean.toJson()), '分享[${widget.bean.title}]');
}, },
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
@ -320,14 +330,14 @@ class _CircleShareState extends State<CircleShare> {
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
ClipOval(child: Image.network(info.user.avatar,width: 51.sp,height: 51.sp,fit: BoxFit.cover,),), ClipOval(child: Image.network(info.faceUrl ?? info.user.avatar,width: 51.sp,height: 51.sp,fit: BoxFit.cover,),),
SizedBox(height: 4.sp,), SizedBox(height: 4.sp,),
Text(info.user.nickname,style: TextStyle(color: Colors.white,fontSize: 14.sp),) Text(info.nickName ?? info.user.nickname,style: TextStyle(color: Colors.white,fontSize: 14.sp),maxLines: 1,overflow: TextOverflow.ellipsis,)
], ],
), ),
), ),
); );
},itemCount: lists.length > 5 ? 5 : lists.length,), },itemCount: conList.length + lists.length > 5 ? 5 : conList.isNotEmpty ? conList.length : lists.length,),
), ),
Expanded( Expanded(
child: Container( child: Container(
@ -786,13 +796,33 @@ class _CircleShareState extends State<CircleShare> {
} }
void loadFollowMeData() async { void loadFollowMeData() async {
var data = await DioManager.instance if (conList.isEmpty) {
.get(url: Api.fansList, params: {'page': 1,'page_size':6}); conList = await loadConverstationListData();
var bean = BaseResponse<UserList>.fromJson(
data, (data) => UserList.fromJson(data));
if (bean.isSuccess()) {
lists.addAll(bean.data.lists);
} }
if (conList.length < 5) {
var data = await DioManager.instance
.get(url: Api.fansList, params: {'page': 1,'page_size':6});
var bean = BaseResponse<UserList>.fromJson(
data, (data) => UserList.fromJson(data));
if (bean.isSuccess()) {
data.forEach((element) {
bool isContain = false;
conList.forEach((user) {
if (element.user.imId == user.userID!) {
isContain = true;
}
});
if (!isContain) {
lists.add(element);
}
});
}
}
setState(() { setState(() {
}); });

View File

@ -6,6 +6,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:tencent_cloud_chat_uikit/tencent_cloud_chat_uikit.dart';
import '../../app/circle/logic.dart'; import '../../app/circle/logic.dart';
import '../../app/likelist/logic.dart'; import '../../app/likelist/logic.dart';
@ -31,9 +32,10 @@ class FollowMeDialog extends StatefulWidget {
class _FollowMeDialogState extends State<FollowMeDialog> { class _FollowMeDialogState extends State<FollowMeDialog> {
// TODO: add state variables and methods // TODO: add state variables and methods
List<UserListItem> lists = []; List<UserListItem> lists = [];
List<V2TimUserFullInfo> conList = [];
bool isMore = true; bool isMore = true;
int page = 1; int page = 1;
bool isVip = false; bool isVip = true;
final RefreshController refreshController = RefreshController(); final RefreshController refreshController = RefreshController();
@ -41,6 +43,7 @@ class _FollowMeDialogState extends State<FollowMeDialog> {
void initState() { void initState() {
// TODO: implement initState // TODO: implement initState
super.initState(); super.initState();
loadMineInfo(); loadMineInfo();
loadData(); loadData();
} }
@ -69,9 +72,9 @@ class _FollowMeDialogState extends State<FollowMeDialog> {
alignment: Alignment.center, alignment: Alignment.center,
children: [ children: [
Text( Text(
'喜欢我的', '最近聊过和喜欢我的',
style: TextStyle( style: TextStyle(
fontSize: 20.sp, fontSize: 18.sp,
color: Colors.white color: Colors.white
)), )),
Positioned( Positioned(
@ -97,9 +100,12 @@ class _FollowMeDialogState extends State<FollowMeDialog> {
enablePullUp: true, enablePullUp: true,
child: ListView.builder( child: ListView.builder(
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
itemCount: lists.length, itemCount: lists.length + conList.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return ListItem(lists[index], index); if (conList.length > index) {
return ConListItem(conList[index], index);
}
return ListItem(lists[index - conList.length], index - conList.length);
}, },
), ),
@ -316,6 +322,68 @@ class _FollowMeDialogState extends State<FollowMeDialog> {
)); ));
} }
Widget ConListItem(V2TimUserFullInfo item, int index) {
return GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
// if (isVip || index < 3) {
sendCircleCustomMsg(item.userID!, jsonEncode(widget.bean.toJson()), '分享[${widget.bean.title}]');
// Get.toNamed(AppRoutes.UserInfoActivity,
// arguments: item.user.id.toString());
// }
},
child: Container(
margin: EdgeInsets.only(bottom: 21.sp),
child: Row(
children: [
Stack(
children: [
ClipOval(
child: CachedNetworkImage(
fit: BoxFit.cover,
imageUrl: item.faceUrl!,
width: 40.sp,
height: 40.sp,
),
),
Positioned(
right: 0.sp,
// left: 0.sp,
bottom: 0.sp,
child: Image.asset(
getMsgImage(getGenderContent(item.role!)),
height: 13.sp,
)
)
],
),
SizedBox(width: 10.sp),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Text(
item.nickName!,
style: TextStyle(
color: Colors.white70,
fontSize: 16.sp,
fontWeight: FontWeight.bold),
),
// Placeholder image
],
),
],
),
// Pla
const Spacer(),
],
),
),
);
}
Widget ListItem(UserListItem item, int index) { Widget ListItem(UserListItem item, int index) {
return GestureDetector( return GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
@ -339,33 +407,21 @@ class _FollowMeDialogState extends State<FollowMeDialog> {
Stack( Stack(
children: [ children: [
ClipOval( ClipOval(
child: GestureDetector( child: CachedNetworkImage(
onTap: () { fit: BoxFit.cover,
var imgList = <String>[]; imageUrl: item.user.avatarThumb,
imgList.add(item.user.avatar); width: 40.sp,
Get.toNamed(AppRoutes.Swiper, height: 40.sp,
arguments: {'imaglist': imgList, 'index': 0});
},
child: CachedNetworkImage(
fit: BoxFit.cover,
imageUrl: item.user.avatarThumb,
width: 53.sp,
height: 53.sp,
),
), ),
), ),
Positioned( Positioned(
right: 0.sp, right: 0.sp,
left: 0.sp, // left: 0.sp,
bottom: 0.sp, bottom: 0.sp,
child: item.user.vip != 0 child: Image.asset(
? Image( getMsgImage(getGenderContent(item.user.gender)),
image: AssetImage(getBaseImage( height: 13.sp,
item.user.vip == 1 ? "vip" : 'year_vip')),
width: 44.sp,
height: 18.sp,
) )
: Container(),
) )
], ],
), ),
@ -377,28 +433,17 @@ class _FollowMeDialogState extends State<FollowMeDialog> {
children: [ children: [
Text( Text(
item.user.nickname, item.user.nickname,
style: const TextStyle( style: TextStyle(
color: Colors.white70, color: Colors.white70,
fontSize: 14, fontSize: 16.sp,
fontWeight: FontWeight.bold), fontWeight: FontWeight.bold),
), ),
SizedBox(width: 4.sp), SizedBox(width: 4.sp),
// SizedBox(height: 8.sp), // SizedBox(height: 8.sp),
_buildInfoRow(item), // _buildInfoRow(item),
// Placeholder image // Placeholder image
], ],
), ),
SizedBox(height: 8.sp),
SizedBox(
width: 200.sp,
child: Text(
item.user.signature,
overflow: TextOverflow.ellipsis, // 使
maxLines: 1,
style: TextStyle(
fontSize: 12.sp, color: const Color(0xFFB7BECC)),
),
),
], ],
), ),
// Pla // Pla
@ -466,14 +511,29 @@ class _FollowMeDialogState extends State<FollowMeDialog> {
} }
void loadData() async { void loadData() async {
if (conList.isEmpty) {
conList = await loadConverstationListData();
}
var data = await DioManager.instance var data = await DioManager.instance
.get(url: Api.fansList, params: {'page': page,'page_size':6}); .get(url: Api.fansList, params: {'page': page,'page_size':8});
var bean = BaseResponse<UserList>.fromJson( var bean = BaseResponse<UserList>.fromJson(
data, (data) => UserList.fromJson(data)); data, (data) => UserList.fromJson(data));
if (bean.isSuccess()) { if (bean.isSuccess()) {
List data = bean.data.lists; List data = bean.data.lists;
if (data.isNotEmpty) { if (data.isNotEmpty) {
lists.addAll(bean.data.lists); data.forEach((element) {
bool isContain = false;
conList.forEach((user) {
if (element.user.imId == user.userID!) {
isContain = true;
}
});
if (!isContain) {
lists.add(element);
}
});
refreshController.loadComplete(); refreshController.loadComplete();
} else { } else {
isMore = false; isMore = false;

View File

@ -35,7 +35,9 @@ class _TodayPeopleDialogState extends State<TodayPeopleDialog> {
if (data['code'] == 200) { if (data['code'] == 200) {
recommendCircleFriendData = data['data'][0]; recommendCircleFriendData = data['data'][0];
setState(() {}); if (mounted) {
setState(() {});
}
} }
} }
@ -386,9 +388,9 @@ class _TodayPeopleDialogState extends State<TodayPeopleDialog> {
}, },
child: Container( child: Container(
margin: EdgeInsets.only(right: 10.sp), margin: EdgeInsets.only(right: 10.sp),
padding: EdgeInsets.only(left: 12.sp, right: 12.sp), padding: EdgeInsets.only(left: 12.sp, right: 5.sp),
height: 72.sp, height: 72.sp,
width: 140.sp, width: 145.sp,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.sp), borderRadius: BorderRadius.circular(8.sp),
border: GradientBoxBorder( border: GradientBoxBorder(
@ -468,104 +470,110 @@ class _TodayPeopleDialogState extends State<TodayPeopleDialog> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
// TODO: add widget build method // TODO: add widget build method
return Scaffold( return GestureDetector(
backgroundColor: Colors.black.withOpacity(0.75), behavior: HitTestBehavior.opaque,
body: recommendCircleFriendData.isNotEmpty onTap: () {
? Column( Get.back();
mainAxisAlignment: MainAxisAlignment.center, },
children: [ child: Scaffold(
Container( backgroundColor: Colors.black.withOpacity(0.75),
margin: EdgeInsets.only(bottom: 16.sp), body: recommendCircleFriendData.isNotEmpty
child: Row( ? Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Image.asset( Container(
getMsgImage('heart_icon'), margin: EdgeInsets.only(bottom: 16.sp),
width: 18.sp, child: Row(
), mainAxisAlignment: MainAxisAlignment.center,
SizedBox( children: [
width: 4.sp, Image.asset(
), getMsgImage('heart_icon'),
ShaderMask( width: 18.sp,
shaderCallback: (Rect bounds) {
return const LinearGradient(
begin: Alignment(0.0, -1.0),
end: Alignment.bottomCenter,
colors: [Color(0xff71F3F2), Color(0xffF657FF)],
).createShader(Offset.zero & bounds.size);
},
child: Text(
'圈友推荐',
style: TextStyle(
fontSize: 18.sp,
fontWeight: FontWeight.w600,
color: Colors.white,
shadows: [
Shadow(
color: Color(0xffF657FF), offset: Offset(0.0, -1))
]),
), ),
), SizedBox(
SizedBox( width: 4.sp,
width: 4.sp, ),
), ShaderMask(
Image.asset( shaderCallback: (Rect bounds) {
getMsgImage('heart_icon'), return const LinearGradient(
width: 18.sp, begin: Alignment(0.0, -1.0),
), end: Alignment.bottomCenter,
], colors: [Color(0xff71F3F2), Color(0xffF657FF)],
), ).createShader(Offset.zero & bounds.size);
), },
itemWidget(),
Container(
height: 40.sp,
margin: EdgeInsets.only(top: 20.sp),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
GestureDetector(
onTap: () {
Get.back();
},
child: Container(
width: 100.sp,
height: 40.sp,
alignment: Alignment.center,
decoration: BoxDecoration(
color: Color(0xFF392D53),
borderRadius: BorderRadius.circular(20.sp)),
child: Text( child: Text(
'先不看了', '圈友推荐',
style: TextStyle( style: TextStyle(
color: Colors.white, fontSize: 15.sp), fontSize: 18.sp,
fontWeight: FontWeight.w600,
color: Colors.white,
shadows: [
Shadow(
color: Color(0xffF657FF), offset: Offset(0.0, -1))
]),
), ),
), ),
), SizedBox(
SizedBox( width: 4.sp,
width: 40.sp, ),
), Image.asset(
GestureDetector( getMsgImage('heart_icon'),
onTap: () { width: 18.sp,
loadRecommendCircleFriendData(); ),
}, ],
child: Container( ),
),
itemWidget(),
Container(
height: 40.sp,
margin: EdgeInsets.only(top: 20.sp),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
GestureDetector(
onTap: () {
Get.back();
},
child: Container(
width: 100.sp, width: 100.sp,
height: 40.sp, height: 40.sp,
alignment: Alignment.center, alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
gradient: AppColor.mainHorLinearGradient, color: Color(0xFF392D53),
borderRadius: BorderRadius.circular(20.sp)), borderRadius: BorderRadius.circular(20.sp)),
child: Text( child: Text(
'换一位', '先不看了',
style: TextStyle( style: TextStyle(
color: Colors.white, fontSize: 15.sp), color: Colors.white, fontSize: 15.sp),
)), ),
) ),
], ),
), SizedBox(
) width: 40.sp,
], ),
) GestureDetector(
: Container()); onTap: () {
loadRecommendCircleFriendData();
},
child: Container(
width: 100.sp,
height: 40.sp,
alignment: Alignment.center,
decoration: BoxDecoration(
gradient: AppColor.mainHorLinearGradient,
borderRadius: BorderRadius.circular(20.sp)),
child: Text(
'换一位',
style: TextStyle(
color: Colors.white, fontSize: 15.sp),
)),
)
],
),
)
],
)
: Container()),
);
} }
} }

View File

@ -44,6 +44,7 @@ final TUIChatSeparateViewModel chatSeparateViewModel =
OverlayEntry? mainOverlayEntry; OverlayEntry? mainOverlayEntry;
void main() { void main() {
// setCustomErrorWidget();
FlutterBugly.postCatchedException(() async { FlutterBugly.postCatchedException(() async {
// ensureInitialized // ensureInitialized
WidgetsBinding widgetsBinding = WidgetsFlutterBinding.ensureInitialized(); WidgetsBinding widgetsBinding = WidgetsFlutterBinding.ensureInitialized();
@ -66,6 +67,23 @@ void main() {
} }
} }
setCustomErrorWidget() {
ErrorWidget.builder = (FlutterErrorDetails details) {
print(details.toString());
// Widget errorBuilder;
// if (isDebug){
// // debug 便
// errorBuilder = defaultErrorBuilder(details);
// } else{
// // 线 线
// errorBuilder = buildErrorWidget(details);
// }
return Center(
child: Text('请重新加载',style: TextStyle(color: Colors.white,fontSize: 15.sp),),
);
};
}
Future<void> getLostData() async { Future<void> getLostData() async {
final ImagePicker picker = ImagePicker(); final ImagePicker picker = ImagePicker();
final LostDataResponse response = await picker.retrieveLostData(); final LostDataResponse response = await picker.retrieveLostData();

View File

@ -308,4 +308,6 @@ class Api {
// //
static const popup = '/user-service/follow/popup/'; static const popup = '/user-service/follow/popup/';
} }

View File

@ -17,6 +17,8 @@ import 'package:oktoast/oktoast.dart';
import 'package:path_provider/path_provider.dart'; import 'package:path_provider/path_provider.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:tencent_cloud_chat_uikit/business_logic/view_models/tui_conversation_view_model.dart';
import 'package:tencent_cloud_chat_uikit/data_services/services_locatar.dart';
import 'package:tencent_cloud_chat_uikit/tencent_cloud_chat_uikit.dart'; import 'package:tencent_cloud_chat_uikit/tencent_cloud_chat_uikit.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
import 'package:video_compress/video_compress.dart'; import 'package:video_compress/video_compress.dart';
@ -431,6 +433,14 @@ void navigateToInviteStrategy() {
}); });
} }
//
navigateStartGetMoeny() {
Get.toNamed(AppRoutes.WebViewActivity, arguments: {
'title': "微乐园赚钱攻略",
"url": 'https://iquanpai.com/app-h5/4_178.html'
});
}
void navigateToCustomRoute(BannerItem bannerItem) async { void navigateToCustomRoute(BannerItem bannerItem) async {
print(bannerItem.param); print(bannerItem.param);
switch (bannerItem.type) { switch (bannerItem.type) {
@ -846,4 +856,61 @@ Map checkCardReturnData(Map recommendCircleFriendData) {
info['desc'] = titleList[2]; info['desc'] = titleList[2];
} }
return info; return info;
}
Future<List<V2TimUserFullInfo>> loadConverstationListData() async {
TUIConversationViewModel model =
serviceLocator<TUIConversationViewModel>();
List<V2TimConversation?> filteredConversationList = model.conversationList
.where(
(element) => (element?.groupID != null || element?.userID != null))
.toList();
// userID qpqz_prod_10_10000000000
String devtTargetUserID = "qpqz_dev_10_10000000000";
String prodTargetUserID = "qpqz_prod_10_10000000000";
filteredConversationList = filteredConversationList
.where((conversation) =>
conversation?.userID != devtTargetUserID &&
conversation?.userID != prodTargetUserID)
.toList();
List<String> userIdList = [];
filteredConversationList.forEach((element) {
userIdList.add(element!.userID!);
});
V2TimValueCallback<String> getLoginUserRes =
await TencentImSDKPlugin.v2TIMManager.getLoginUser();
if (getLoginUserRes.code == 0) {
//
if (getLoginUserRes.data != null) {
userIdList.insert(
0, getLoginUserRes.data!); // getLoginUserRes.data为查询到的登录用户的UserID
}
}
//
V2TimValueCallback<List<V2TimUserFullInfo>> getUsersInfoRes =
await TencentImSDKPlugin.v2TIMManager
.getUsersInfo(userIDList: userIdList); //id列表
if (getUsersInfoRes.code == 0) {
//
getUsersInfoRes.data?.forEach((element) {
element.allowType; // 0: 1: 2:
element.birthday; //
element.customInfo; //
element.faceUrl; // url
element.gender; // 1: 2:
element.level; //
element.nickName; //
element.role; //
element.selfSignature; //
element.userID; // ID
});
return getUsersInfoRes.data ?? [];
}
return [];
} }