1.4.0代码提交

This commit is contained in:
CYH 2023-12-04 11:40:07 +07:00
parent b9664e13a8
commit 07a4c42cde
33 changed files with 1753 additions and 768 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -382,7 +382,7 @@
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1.3.2; MARKETING_VERSION = 1.3.2;
PRODUCT_BUNDLE_IDENTIFIER = com.example.kyApp; PRODUCT_BUNDLE_IDENTIFIER = com.example.circleapp;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO; SUPPORTS_MACCATALYST = NO;
@ -531,7 +531,7 @@
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1.3.2; MARKETING_VERSION = 1.3.2;
PRODUCT_BUNDLE_IDENTIFIER = com.example.kyApp; PRODUCT_BUNDLE_IDENTIFIER = com.example.circleapp;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO; SUPPORTS_MACCATALYST = NO;
@ -574,7 +574,7 @@
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1.3.2; MARKETING_VERSION = 1.3.2;
PRODUCT_BUNDLE_IDENTIFIER = com.example.kyApp; PRODUCT_BUNDLE_IDENTIFIER = com.example.circleapp;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO; SUPPORTS_MACCATALYST = NO;

View File

@ -1,8 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <dict/>
<key>aps-environment</key>
<string>development</string>
</dict>
</plist> </plist>

View File

@ -446,6 +446,35 @@ class _TIMUIKItHistoryMessageListItemState
if (messageItem.customElem?.extension?.contains('cardData') ?? false) { if (messageItem.customElem?.extension?.contains('cardData') ?? false) {
Map info = jsonDecode(messageItem.customElem?.data ?? ''); Map info = jsonDecode(messageItem.customElem?.data ?? '');
String title = '';
if (info.containsKey('title')) {
var recommendCircleFriendData= info['title'];
if (recommendCircleFriendData['is_follow_me'] && isFromSelf) {
title = '对方喜欢了你';
} else if (recommendCircleFriendData['is_follow_to'] && !isFromSelf) {
title = '对方喜欢了你';
} else if (recommendCircleFriendData['is_follow_to']) {
title = '你喜欢了TA';
} else if (recommendCircleFriendData['has_both_friend']) {
title = '你们有共同喜欢的圈友';
} else if (recommendCircleFriendData['has_friend_follow_to'] && isFromSelf) {
title = '你喜欢的圈友也喜欢TA';
} else if (recommendCircleFriendData['is_wanna_meet'] && isFromSelf) {
title = '很多圈友都喜欢TA';
} else if (recommendCircleFriendData['is_wanna_meet'] && isFromSelf) {
title = 'TA是乐园优秀圈主哦~';
} else if (recommendCircleFriendData['is_wanna_meet'] && isFromSelf) {
title = '可能是你想认识的人';
}
}
return Column( return Column(
children: [ children: [
Container( Container(
@ -464,6 +493,30 @@ class _TIMUIKItHistoryMessageListItemState
child: Column( child: Column(
children: [ children: [
if (title.isNotEmpty)
Container(
margin: EdgeInsets.only(top: 10.sp),
child: Row(
children: [
Container(
margin: EdgeInsets.only(right: 5.sp),
width: 3.sp,
height: 3.sp,
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(1.5.sp),
color: Color(0xFF00FFF4)),
),
Text(
title,
style: TextStyle(
color: Colors.white,
fontSize: 14.sp,
fontWeight: FontWeight.w500),
)
],
),
),
if (info.containsKey('city')) if (info.containsKey('city'))
info['city'].toString().isNotEmpty info['city'].toString().isNotEmpty
? Container( ? Container(
@ -492,7 +545,7 @@ class _TIMUIKItHistoryMessageListItemState
: Container(), : Container(),
if (info.containsKey('both_interests')) if (info.containsKey('both_interests'))
Container( Container(
margin: EdgeInsets.only(top: 16.sp, right: 16.sp), margin: EdgeInsets.only(top: 10.sp, right: 16.sp),
child: Row( child: Row(
children: [ children: [
Container( Container(

View File

@ -31,6 +31,7 @@ import 'package:tencent_cloud_chat_uikit/ui/views/TIMUIKitChat/TIMUIKitTextField
import '../../../../common/Widgets/open_vip_tip/view.dart'; import '../../../../common/Widgets/open_vip_tip/view.dart';
import '../../../../util/eventBus.dart'; import '../../../../util/eventBus.dart';
import '../../widget/send_gift_dialog.dart';
enum MuteStatus { none, me, all } enum MuteStatus { none, me, all }
@ -358,12 +359,18 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
atUserIDList: getUserIdFromMemberInfoMap()), atUserIDList: getUserIdFromMemberInfoMap()),
context); context);
} else if (memberInfoMap.isNotEmpty) { } else if (memberInfoMap.isNotEmpty) {
widget.model.sendTextAtMessage( widget.model.sendTextAtMessage(
text: text, text: text,
convType: widget.conversationType, convType: widget.conversationType,
convID: widget.conversationID, convID: widget.conversationID,
atUserList: getUserIdFromMemberInfoMap()); atUserList: getUserIdFromMemberInfoMap());
} else { } else {
bool isOK = await loadIsShowSendGiftDialogData();
if (!isOK) {
return;
}
isSendLoging = true; isSendLoging = true;
var data = await DioManager.instance var data = await DioManager.instance
.post(url: Api.shieldWordCheck, params: {'text': text, 'type': 2}); .post(url: Api.shieldWordCheck, params: {'text': text, 'type': 2});
@ -379,12 +386,14 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
} }
if (words.isEmpty) { if (words.isEmpty) {
MessageUtils.handleMessageError( var msgResult = await MessageUtils.handleMessageError(
widget.model.sendTextMessage( widget.model.sendTextMessage(
text: text, text: text,
convID: widget.conversationID, convID: widget.conversationID,
convType: convType), convType: convType),
context); context);
addChatRecord(text, msgResult!.data!.msgID! ?? '', msgResult!.data!.timestamp!.toString() ?? '');
} else { } else {
textEditingController.text = text; textEditingController.text = text;
showOKToast('含违规词汇,无法发送'); showOKToast('含违规词汇,无法发送');
@ -403,6 +412,19 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
} }
} }
loadIsShowSendGiftDialogData() async {
V2TimConversation con = Get.arguments;
var data = await DioManager.instance.get(url: Api.isShow_give_gift + widget.conversationID.split('_').last);
if (data['code'] == 200) {
if (data['data']) {
Get.bottomSheet(SendGiftDialog(accid: widget.conversationID,title: data['msg'],), isScrollControlled: true,
enableDrag: false);
return false;
}
}
return true;
}
sendHiText() async { sendHiText() async {
Map info = Map info =
jsonDecode(widget.currentConversation.lastMessage!.customElem!.data!); jsonDecode(widget.currentConversation.lastMessage!.customElem!.data!);
@ -417,13 +439,23 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
} }
sendHiTextMsg(String text) async { sendHiTextMsg(String text) async {
var result = await widget.model.sendTextMessage( widget.model.sendTextMessage(
text: text, convID: widget.conversationID, convType: ConvType.c2c); text: text, convID: widget.conversationID, convType: ConvType.c2c);
hintText = '说些什么吧~'; hintText = '说些什么吧~';
setState(() {}); setState(() {});
} }
addChatRecord(String msgContent,String msgId,String sendTime) async {
String str = DateTime.now().toString().split('.').first;
var data =
await DioManager.instance.post(url: Api.chatRecord, params: {
"content": msgContent,
"msgId": msgId,
"sendTime": str,
"to": widget.conversationID.split('_').last
});
}
void goDownBottom() { void goDownBottom() {
if (globalModel.getMessageListPosition(widget.conversationID) == if (globalModel.getMessageListPosition(widget.conversationID) ==
HistoryMessagePosition.notShowLatest) { HistoryMessagePosition.notShowLatest) {

View File

@ -921,6 +921,10 @@ class _TIMTextFieldLayoutNarrowState
} }
Future checkImStatus() async { Future checkImStatus() async {
imStatusOK = await loadIsShowSendGiftDialogData();
if (imStatusOK == false) {
return imStatusOK;
}
var data = await DioManager.instance.get(url: Api.imstate); var data = await DioManager.instance.get(url: Api.imstate);
int code = data['code']; int code = data['code'];
@ -939,9 +943,23 @@ class _TIMTextFieldLayoutNarrowState
showOKToast(data['msg']); showOKToast(data['msg']);
imStatusOK = false; imStatusOK = false;
} }
return imStatusOK; return imStatusOK;
} }
loadIsShowSendGiftDialogData() async {
var data = await DioManager.instance.get(url: Api.isShow_give_gift +widget.userId!.split('_').last);
if (data['code'] == 200) {
if (data['data']) {
Get.bottomSheet(SendGiftDialog(accid: widget.userId!,title: data['msg'],), isScrollControlled: true,
enableDrag: false);
return false;
}
}
return true;
}
Future checkVipStatus(int plate) async { Future checkVipStatus(int plate) async {
var data = var data =
await DioManager.instance.get(url: Api.getIsVips + plate.toString()); await DioManager.instance.get(url: Api.getIsVips + plate.toString());
@ -966,6 +984,20 @@ class _TIMTextFieldLayoutNarrowState
return isVip; return isVip;
} }
addChatRecord(String msgContent,String msgId,String sendTime) async {
String str = DateTime.now().toString().split('.').first;
var data =
await DioManager.instance.post(url: Api.chatRecord, params: {
"content": msgContent,
"msgId": msgId,
"sendTime": str,
"to": widget.conversationID.split('_').last
});
}
VideoPlayerController? videoPlayerController; VideoPlayerController? videoPlayerController;
Future getVideoFile(ImageSource imageSource) async { Future getVideoFile(ImageSource imageSource) async {
@ -1009,7 +1041,7 @@ class _TIMTextFieldLayoutNarrowState
final Duration videoDuration = videoPlayerController!.value.duration; final Duration videoDuration = videoPlayerController!.value.duration;
final double durationInSeconds = videoDuration.inSeconds.toDouble(); final double durationInSeconds = videoDuration.inSeconds.toDouble();
await widget.model.sendVideoMessage( V2TimValueCallback<V2TimMessage>? msgresult = await widget.model.sendVideoMessage(
videoPath: pickedFile.path, videoPath: pickedFile.path,
snapshotPath: thumbnailPath, snapshotPath: thumbnailPath,
// //
@ -1018,6 +1050,9 @@ class _TIMTextFieldLayoutNarrowState
duration: durationInSeconds.toInt(), duration: durationInSeconds.toInt(),
inputElement: context, inputElement: context,
); );
addChatRecord('[视频]', msgresult!.data!.msgID! ?? '', msgresult!.data!.timestamp!.toString() ?? '');
if (imageSource == ImageSource.camera) { if (imageSource == ImageSource.camera) {
DioManager.instance.get(url: Api.getAddTrialCount + "2"); DioManager.instance.get(url: Api.getAddTrialCount + "2");
} else { } else {
@ -1068,11 +1103,13 @@ class _TIMTextFieldLayoutNarrowState
final XFile? pickedFile = await _picker.pickImage( final XFile? pickedFile = await _picker.pickImage(
source: ImageSource.gallery, source: ImageSource.gallery,
); );
await widget.model.sendImageMessage( var msgresult = await widget.model.sendImageMessage(
imagePath: pickedFile!.path, imagePath: pickedFile!.path,
convID: widget.conversationID, convID: widget.conversationID,
convType: widget.conversationType, convType: widget.conversationType,
inputElement: context); inputElement: context);
addChatRecord('[图片]', msgresult!.data!.msgID! ?? '', msgresult!.data!.timestamp!.toString() ?? '');
var data = await DioManager.instance.get(url: Api.getAddTrialCount + "3"); var data = await DioManager.instance.get(url: Api.getAddTrialCount + "3");
} catch (e) { } catch (e) {
print(e); print(e);
@ -1100,11 +1137,12 @@ class _TIMTextFieldLayoutNarrowState
if (null == pickedFile) { if (null == pickedFile) {
return; return;
} }
widget.model.sendImageMessage( var msgresult = await widget.model.sendImageMessage(
imagePath: pickedFile.path, imagePath: pickedFile.path,
convID: widget.conversationID, convID: widget.conversationID,
convType: widget.conversationType, convType: widget.conversationType,
inputElement: context); inputElement: context);
addChatRecord('[图片]', msgresult!.data?.msgID! ?? '', msgresult!.data!.timestamp!.toString() ?? '');
DioManager.instance.get(url: Api.getAddTrialCount + "1"); DioManager.instance.get(url: Api.getAddTrialCount + "1");
} catch (e) {} } catch (e) {}
} }

View File

@ -1,9 +1,11 @@
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:get/get.dart'; import 'package:get/get.dart';
import 'package:tencent_cloud_chat_uikit/tencent_cloud_chat_uikit.dart'; import 'package:tencent_cloud_chat_uikit/tencent_cloud_chat_uikit.dart';
import '../../util/eventBus.dart'; import '../../util/eventBus.dart';
import 'state.dart'; import 'state.dart';
import 'widget/send_gift_dialog.dart';
class ChatLogic extends GetxController { class ChatLogic extends GetxController {
@ -14,12 +16,25 @@ class ChatLogic extends GetxController {
void onInit() { void onInit() {
// TODO: implement onInit // TODO: implement onInit
super.onInit(); super.onInit();
// loadIsShowSendGiftDialogData();
selectedConversation = Get.arguments; selectedConversation = Get.arguments;
} }
sendData() async { sendData() async {
var data = await DioManager.instance.get(url: 'url',params: {}); var data = await DioManager.instance.get(url: Api.isShow_give_gift,params: {});
}
Future<bool> loadIsShowSendGiftDialogData() async {
var data = await DioManager.instance.get(url: Api.isShow_give_gift + selectedConversation!.conversationID!.split('_').last);
if (data['code'] == 200) {
if (data['data']) {
Get.bottomSheet(SendGiftDialog(accid: selectedConversation!.conversationID!,title: data['msg'],), isScrollControlled: true,
enableDrag: false);
return false;
}
}
return true;
} }
} }

View File

@ -33,7 +33,7 @@ class _ChatPageState extends State<ChatPage> {
@override @override
void dispose() { void dispose() {
// TODO: implement dispose // TODO: implement dispose
EventBusManager.fire(RefreshUnread()); sub.cancel();
super.dispose(); super.dispose();
} }
@ -41,25 +41,42 @@ class _ChatPageState extends State<ChatPage> {
TIMUIKitChatController(); TIMUIKitChatController();
User? userInfoBean; User? userInfoBean;
var sub;
@override @override
void initState() { void initState() {
// TODO: implement initState // TODO: implement initState
super.initState(); super.initState();
initEventBus(); initEventBus();
loadMyInfo(); loadMyInfo();
// loadIsShowSendGiftDialogData();
}
void loadIsShowSendGiftDialogData() async {
V2TimConversation con = Get.arguments;
var data = await DioManager.instance.get(url: Api.isShow_give_gift + con!.conversationID!.split('_').last);
if (data['code'] == 200) {
if (data['data']) {
Get.bottomSheet(SendGiftDialog(accid: con!.conversationID!,title: data['msg'],), isScrollControlled: true,
enableDrag: false);
}
}
} }
initEventBus()async{ initEventBus()async{
EventBusManager.on<SendCoustomMessage>().listen((event) async{ sub = EventBusManager.on<SendCoustomMessage>().listen((event) async{
V2TimValueCallback<V2TimMessage>? sendMessageRes = V2TimValueCallback<V2TimMessage>? sendMessageRes =
await _timuiKitChatController.sendMessage( await _timuiKitChatController.sendMessage(
messageInfo: event.createCustomMessageRes?.data?.messageInfo); messageInfo: event.createCustomMessageRes?.data?.messageInfo);
if (sendMessageRes!.code == 0) { if (sendMessageRes!.code == 0) {
// //
showOKToast('发送成功'); if (sendMessageRes.data?.customElem?.extension != 'cardData') {
showOKToast('发送成功');
}
//
sendMessageRes.data?.customElem?.data; //data sendMessageRes.data?.customElem?.data; //data
sendMessageRes.data?.customElem?.desc; //desc sendMessageRes.data?.customElem?.desc; //desc
sendMessageRes.data?.customElem?.extension; //extension sendMessageRes.data?.customElem?.extension; //extension

View File

@ -83,6 +83,7 @@ class _ChatCircleShareDialogState extends State<ChatCircleShareDialog> {
body: Column( body: Column(
children: [ children: [
Expanded(child: Container()), Expanded(child: Container()),
Container( Container(
height:Get.height * 0.5, height:Get.height * 0.5,
color: Color(0xFF423055), color: Color(0xFF423055),
@ -99,7 +100,7 @@ class _ChatCircleShareDialogState extends State<ChatCircleShareDialog> {
var bean = circle.lists[index]; var bean = circle.lists[index];
return circleInfoItemWidget( return circleInfoItemWidget(
circle.lists[index]); circle.lists[index],index);
}, },
itemCount: circle.lists.length + 1, itemCount: circle.lists.length + 1,
), ),
@ -112,12 +113,20 @@ class _ChatCircleShareDialogState extends State<ChatCircleShareDialog> {
} }
circleInfoItemWidget(Circle bean) { circleInfoItemWidget(Circle bean,int index) {
return Container( return Container(
margin: EdgeInsets.only(top: 10.sp, left: 10.sp, right: 10.sp), margin: EdgeInsets.only(top: 10.sp, left: 10.sp, right: 10.sp),
child: Column( child: Column(
children: [ children: [
if (index == 0)
Container(
height: 28.sp,
margin: EdgeInsets.only(bottom: 10.sp),
alignment: Alignment.center,
child: Text('我的圈子',style: TextStyle(color: Colors.white,fontSize: 17.sp),),
),
ClipRRect( ClipRRect(
borderRadius: BorderRadius.circular(10.sp), borderRadius: BorderRadius.circular(10.sp),
child: Container( child: Container(

View File

@ -74,7 +74,7 @@ class _ChatGiftPannelState extends State<ChatGiftPannel>
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox(height: 5.sp,),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
@ -90,13 +90,13 @@ class _ChatGiftPannelState extends State<ChatGiftPannel>
indicatorColor: AppColor.mainColor, indicatorColor: AppColor.mainColor,
indicatorSize: TabBarIndicatorSize.label, indicatorSize: TabBarIndicatorSize.label,
unselectedLabelStyle: TextStyle( unselectedLabelStyle: TextStyle(
fontSize: 14.sp, fontSize: 16.sp,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
), ),
unselectedLabelColor: Color(0xB3FFFFFF), unselectedLabelColor: Color(0xB3FFFFFF),
labelColor: AppColor.mainColor, labelColor: AppColor.mainColor,
labelStyle: TextStyle( labelStyle: TextStyle(
fontSize: 14.sp, fontWeight: FontWeight.w500), fontSize: 16.sp, fontWeight: FontWeight.w500),
controller: tabController, controller: tabController,
tabs: const <Widget>[ tabs: const <Widget>[
Tab( Tab(
@ -132,7 +132,7 @@ class _ChatGiftPannelState extends State<ChatGiftPannel>
color: Color(0xFF423055), color: Color(0xFF423055),
borderRadius: BorderRadius.circular(10.sp) borderRadius: BorderRadius.circular(10.sp)
)), )),
Text('礼物',style: TextStyle(color: Colors.white,fontSize: 14.sp),) Text('礼物',style: TextStyle(color: Colors.white,fontSize: 14.sp),)
], ],
), ),
)), )),

View File

@ -17,7 +17,7 @@ import '../../../common/Widgets/base_tip_widget.dart';
class Gift extends StatefulWidget { class Gift extends StatefulWidget {
String accid; String accid;
String giftId; String giftId;
Gift(this.accid,this.giftId, {super.key}); Gift(this.accid, this.giftId, {super.key});
@override @override
_GiftState createState() => _GiftState(); _GiftState createState() => _GiftState();
} }
@ -48,20 +48,22 @@ class _GiftState extends State<Gift> {
} }
gelectThirdItem() async { gelectThirdItem() async {
var data = await DioManager.getInstance().get(url: Api.walletRechargeSelectItem); var data =
await DioManager.getInstance().get(url: Api.walletRechargeSelectItem);
if (data['code'] == 200) { if (data['code'] == 200) {
// "walletRechargeSelectItemBos" -> [_GrowableList] // "walletRechargeSelectItemBos" -> [_GrowableList]
List response =data['data']['priceConfs']; List response = data['data']['priceConfs'];
incomeBalance = data['data']['balance'].toString(); incomeBalance = data['data']['balance'].toString();
// List<RechargeItem> walletRechargeSelectItemBos = []; // List<RechargeItem> walletRechargeSelectItemBos = [];
AssetsDataDataPriceConfs info = AssetsDataDataPriceConfs.fromJson(response.last); AssetsDataDataPriceConfs info =
balanceTipStr = info.remark!.isNotEmpty ? '首冲最高赠送' + info.remark!.split('').last + '>' : '充值>'; AssetsDataDataPriceConfs.fromJson(response.last);
balanceTipStr = info.remark!.isNotEmpty
? '首冲最高赠送' + info.remark!.split('').last + '>'
: '充值>';
} }
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Stack( return Stack(
@ -70,19 +72,20 @@ class _GiftState extends State<Gift> {
color: Colors.transparent, color: Colors.transparent,
child: Column( child: Column(
children: [ children: [
widget.accid!.isNotEmpty
widget.accid!.isNotEmpty ? Container( ? Container(
margin: EdgeInsets.only(top: 10.sp, bottom: 10.sp), margin: EdgeInsets.only(top: 10.sp, bottom: 10.sp),
width: Get.width, width: Get.width,
alignment: Alignment.center, alignment: Alignment.center,
child: Text( child: Text(
tipStr.isNotEmpty ? '礼物送出后,获得$tipStr小时的消息置顶' : '', tipStr.isNotEmpty ? '礼物送出后,获得$tipStr小时的消息置顶' : '',
style: TextStyle( style: TextStyle(
color: AppColor.mainColor, color: AppColor.mainColor,
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: FontWeight.w500), fontWeight: FontWeight.w500),
), ),
) : Container(), )
: Container(),
Expanded( Expanded(
child: Container( child: Container(
width: Get.width, width: Get.width,
@ -99,35 +102,39 @@ class _GiftState extends State<Gift> {
width: Get.width, width: Get.width,
child: Row( child: Row(
children: [ children: [
Container(
margin: EdgeInsets.only(right: 4.sp),
child: Image.asset(
getMineImage('bi_icon1'),
width: 24.sp,
),
),
Text(
'${incomeBalance}',
style: TextStyle(
color: Color(0xFFF7FAFA),
fontSize: 12.sp,
fontWeight: FontWeight.w500),
),
SizedBox(
width: 16.sp,
),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
showRechargeScreenDialog().then((value) { showRechargeScreenDialog().then((value) {
getAsset(); getAsset();
}); });
}, },
child: Text( child: Row(
balanceTipStr, children: [
style: TextStyle( Container(
color: AppColor.mainColor, margin: EdgeInsets.only(right: 4.sp),
fontSize: 12.sp, child: Image.asset(
fontWeight: FontWeight.w500), getMineImage('bi_icon1'),
width: 24.sp,
),
),
Text(
'${incomeBalance}',
style: TextStyle(
color: Color(0xFFF7FAFA),
fontSize: 12.sp,
fontWeight: FontWeight.w500),
),
SizedBox(
width: 16.sp,
),
Text(
balanceTipStr,
style: TextStyle(
color: AppColor.mainColor,
fontSize: 12.sp,
fontWeight: FontWeight.w500),
),
],
), ),
), ),
Expanded(child: Container()), Expanded(child: Container()),
@ -153,7 +160,8 @@ class _GiftState extends State<Gift> {
height: 27.sp, height: 27.sp,
decoration: BoxDecoration( decoration: BoxDecoration(
gradient: AppColor.mainVerLinearGradient, gradient: AppColor.mainVerLinearGradient,
borderRadius: BorderRadius.circular(13.5.sp)), borderRadius:
BorderRadius.circular(13.5.sp)),
alignment: Alignment.center, alignment: Alignment.center,
child: Text( child: Text(
'求送', '求送',
@ -164,13 +172,15 @@ class _GiftState extends State<Gift> {
), ),
), ),
), ),
SizedBox(width: 8,), SizedBox(
width: 8,
),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
if (giftId.isEmpty) { if (giftId.isEmpty) {
showOKToast('请选择您想赠送的礼物'); showOKToast('请选择您想赠送的礼物');
} else { } else {
sendGiftData(); sendGiftData();
} }
}, },
child: Container( child: Container(
@ -178,7 +188,8 @@ class _GiftState extends State<Gift> {
height: 27.sp, height: 27.sp,
decoration: BoxDecoration( decoration: BoxDecoration(
gradient: AppColor.mainVerLinearGradient, gradient: AppColor.mainVerLinearGradient,
borderRadius: BorderRadius.circular(13.5.sp)), borderRadius:
BorderRadius.circular(13.5.sp)),
alignment: Alignment.center, alignment: Alignment.center,
child: Text( child: Text(
'赠送', '赠送',
@ -211,9 +222,13 @@ class _GiftState extends State<Gift> {
sendGetGiftCustomMsg(widget.accid, jsonEncode(info), '求您送我${info['name']}'); sendGetGiftCustomMsg(widget.accid, jsonEncode(info), '求您送我${info['name']}');
} }
void sendGiftData() async { void sendGiftData() async {
var result = await DioManager.instance.post(url: Api.sendGift,params: {'accid':widget.accid,'giftId':giftId,'num':giftCount,'toUserId':widget.accid!.split('_').last}); var result = await DioManager.instance.post(url: Api.sendGift, params: {
'accid': widget.accid,
'giftId': giftId,
'num': giftCount,
'toUserId': widget.accid!.split('_').last
});
if (result['code'] == 200) { if (result['code'] == 200) {
showOKToast('赠送成功'); showOKToast('赠送成功');
getAsset(); getAsset();
@ -223,12 +238,12 @@ class _GiftState extends State<Gift> {
} }
} }
void loadGiftData() async { void loadGiftData() async {
var result = await DioManager.instance.get(url: Api.giftList); var result = await DioManager.instance.get(url: Api.giftList);
if (result['code'] == 200) { if (result['code'] == 200) {
List dataList = result['data']; List dataList = result['data'];
List giftItemData = []; List giftItemData = [];
for (int i = 0; i < dataList.length; i++) { for (int i = 0; i < dataList.length; i++) {
var info = dataList[i]; var info = dataList[i];
if (info['id'] == giftId) { if (info['id'] == giftId) {
@ -242,6 +257,15 @@ class _GiftState extends State<Gift> {
giftItemData.clear(); giftItemData.clear();
} }
} }
for (int i = 0; i < giftList[0].length; i++) {
var info = giftList[0][i];
if (info['name'] == '浪漫告白') {
selectedIndex = i;
giftId = info['id'].toString();
}
}
setState(() {}); setState(() {});
} }
} }
@ -267,7 +291,7 @@ class _GiftState extends State<Gift> {
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 / 127.5.sp,
), ),
itemCount: info.length, itemCount: info.length,
// Replace with the actual item count // Replace with the actual item count
@ -275,13 +299,13 @@ class _GiftState extends State<Gift> {
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, index) { itemBuilder: (context, index) {
// Replace the placeholders with the actual item widgets // Replace the placeholders with the actual item widgets
return giftItemWidget(info[index],index); return giftItemWidget(info[index], index);
}, },
), ),
); );
} }
giftItemWidget(Map info,int index) { giftItemWidget(Map info, int index) {
bool isSelected = giftId.contains(info['id'].toString()); bool isSelected = giftId.contains(info['id'].toString());
double price = info['price']; double price = info['price'];
@ -309,7 +333,11 @@ class _GiftState extends State<Gift> {
child: Stack( child: Stack(
fit: StackFit.expand, fit: StackFit.expand,
children: [ children: [
isSelected ? Image.asset(getMsgImage('gift_bg'),) : Container(), isSelected
? Image.asset(
getMsgImage('gift_bg'),
)
: Container(),
Column( Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
@ -359,9 +387,7 @@ class _GiftState extends State<Gift> {
onTap: () { onTap: () {
giftCount = count; giftCount = count;
isShowCount = false; isShowCount = false;
setState(() { setState(() {});
});
}, },
child: Container( child: Container(
height: 30.sp, height: 30.sp,
@ -372,18 +398,20 @@ class _GiftState extends State<Gift> {
children: [ children: [
Expanded( Expanded(
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,
child: Text( child: Text(
'${count}', '${count}',
style: TextStyle(color: Color(0xFFE6E6E6), fontSize: 12.sp), style:
))), TextStyle(color: Color(0xFFE6E6E6), fontSize: 12.sp),
))),
Expanded( Expanded(
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,
child: Text( child: Text(
desc, desc,
style: TextStyle(color: Color(0xFFE6E6E6), fontSize: 12.sp), style:
))), TextStyle(color: Color(0xFFE6E6E6), fontSize: 12.sp),
))),
], ],
), ),
), ),

View File

@ -80,8 +80,8 @@ class _PartnerOptionState extends State<PartnerOption> {
setState(() {}); setState(() {});
}, },
child: Container( child: Container(
height: 60.sp, // height: 60.sp,
padding: EdgeInsets.only(left: 15.sp, right: 15.sp), padding: EdgeInsets.only(left: 15.sp, right: 15.sp,top: 10.sp,bottom: 10.sp),
// margin: EdgeInsets.only(right: 5.sp, bottom: 5.sp), // margin: EdgeInsets.only(right: 5.sp, bottom: 5.sp),
//height: 300, //height: 300,
decoration: BoxDecoration( decoration: BoxDecoration(
@ -96,8 +96,8 @@ class _PartnerOptionState extends State<PartnerOption> {
children: [ children: [
Image.asset( Image.asset(
getMsgImage(vipName[index]), getMsgImage(vipName[index]),
width: 48.sp, width: 60.sp,
height: 48.sp, height: 60.sp,
fit: BoxFit.cover, fit: BoxFit.cover,
), ),
SizedBox(width: 10.sp), SizedBox(width: 10.sp),
@ -109,7 +109,7 @@ class _PartnerOptionState extends State<PartnerOption> {
Text( Text(
vipTitleName[index], vipTitleName[index],
style: TextStyle( style: TextStyle(
color: Colors.white, fontSize: 14.sp), color: Colors.white, fontSize: 17.sp),
), ),
SizedBox(height: 4.sp), SizedBox(height: 4.sp),
Text( Text(
@ -120,7 +120,7 @@ class _PartnerOptionState extends State<PartnerOption> {
? '3个月' ? '3个月'
: '1个月'), : '1个月'),
style: TextStyle( style: TextStyle(
color: Colors.grey, fontSize: 10.sp), color: Colors.grey, fontSize: 15.sp),
), ),
], ],
)), )),
@ -128,7 +128,7 @@ class _PartnerOptionState extends State<PartnerOption> {
Text( Text(
item.amount.toInt().toString() + '', item.amount.toInt().toString() + '',
style: TextStyle( style: TextStyle(
color: AppColor.mainColor, fontSize: 12.sp), color: AppColor.mainColor, fontSize: 14.sp),
) )
], ],
), ),

View File

@ -11,8 +11,8 @@ import '../../../util/util.dart';
class SendGiftDialog extends StatefulWidget { class SendGiftDialog extends StatefulWidget {
String accid; String accid;
String title;
SendGiftDialog({super.key,required this.accid}); SendGiftDialog({super.key,required this.accid,required this.title});
@override @override
_SendGiftDialogState createState() => new _SendGiftDialogState(); _SendGiftDialogState createState() => new _SendGiftDialogState();
@ -37,6 +37,15 @@ class _SendGiftDialogState extends State<SendGiftDialog> {
var result = await DioManager.instance.get(url: Api.giftList); var result = await DioManager.instance.get(url: Api.giftList);
if (result['code'] == 200) { if (result['code'] == 200) {
giftList = result['data']; giftList = result['data'];
for (int i= 0; i< giftList.length; i++) {
var info = giftList[i];
if (info['name'] == '浪漫告白') {
selectedIndex = i ;
giftId = info['id'].toString();
}
}
setState(() {}); setState(() {});
} }
} }
@ -44,104 +53,112 @@ class _SendGiftDialogState extends State<SendGiftDialog> {
@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.transparent, onTap: () {
body: Center(
child: Container(
height: 255.sp,
margin: EdgeInsets.only(left: 15.sp,right: 15.sp),
padding: EdgeInsets.only(left: 15.sp,right: 15.sp),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10.sp),
gradient: LinearGradient(colors: [Color(0xFF4C3E5F),Color(0xFF324140)]),
border: GradientBoxBorder(
gradient:
AppColor.mainVerLinearGradient,
width: 1.sp,
),
),
child: Column(
children: [
Container(
margin: EdgeInsets.only(top: 18.sp),
child: Text(
'今天找TA聊天的人有点多哦为了避免打扰你需要赠送个礼物给TA才能继续聊天哈~',
style: TextStyle(color: Colors.white, fontSize: 15.sp),
),
),
Container(
height: 102.sp,
margin: EdgeInsets.only(top: 12.sp,),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10.sp),
gradient: LinearGradient(
colors: [Color(0xFF132B40), Color(0xFF251240)])),
child: giftGridWidget(),
),
Container(
margin: EdgeInsets.only(top: 25.sp,),
padding: EdgeInsets.only(left: 15.sp, right: 15.sp),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
GestureDetector(
onTap: () {
Get.back();
},
child: Container(
height: 42.sp,
width: 136.sp,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(21.sp),
color: Color(0x26FFFFFF)
),
alignment: Alignment.center,
child: Text(
'放弃',
style: TextStyle(
color: Colors.white,
fontSize: 16.sp,
fontWeight: FontWeight.w600),
),
),
),
GestureDetector(
onTap: () async {
if (selectedIndex < 0) {
showOKToast('请选择一个礼物');
return;
}
var result = await DioManager.instance.post(url: Api.sendGift,params: {'accid':widget.accid,'giftId':giftId,'num':1,'toUserId':widget.accid!.split('_').last});
if (result['code'] == 200) {
showOKToast('赠送成功');
Get.back();
} else if (result['code'] == 31201) {
showOKToast(result['msg']);
showRechargeScreenDialog();
}
}, },
child: Container( child: Scaffold(
height: 42.sp, backgroundColor: Colors.transparent,
width: 136.sp, body: Center(
alignment: Alignment.center, child: Container(
decoration: BoxDecoration( constraints: BoxConstraints(
borderRadius: BorderRadius.circular(21.sp), maxHeight: 285.sp
gradient: AppColor.mainVerLinearGradient ),
), margin: EdgeInsets.only(left: 15.sp,right: 15.sp),
child: Text( padding: EdgeInsets.only(left: 15.sp,right: 15.sp),
'赠送', decoration: BoxDecoration(
style: TextStyle( borderRadius: BorderRadius.circular(10.sp),
color: Colors.white, gradient: LinearGradient(colors: [Color(0xFF4C3E5F),Color(0xFF324140)]),
fontSize: 16.sp, border: GradientBoxBorder(
fontWeight: FontWeight.w600), gradient:
AppColor.mainVerLinearGradient,
width: 1.sp,
),
),
child: Column(
children: [
Container(
margin: EdgeInsets.only(top: 18.sp),
child: Text(
widget.title,
style: TextStyle(color: Colors.white, fontSize: 15.sp),
),
),
Container(
height: 102.sp,
margin: EdgeInsets.only(top: 12.sp,),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10.sp),
gradient: LinearGradient(
colors: [Color(0xFF132B40), Color(0xFF251240)])),
child: giftGridWidget(),
),
Container(
margin: EdgeInsets.only(top: 25.sp,),
padding: EdgeInsets.only(left: 15.sp, right: 15.sp),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
GestureDetector(
onTap: () {
Get.back();
Get.back();
},
child: Container(
height: 42.sp,
width: 136.sp,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(21.sp),
color: Color(0x26FFFFFF)
),
alignment: Alignment.center,
child: Text(
'放弃',
style: TextStyle(
color: Colors.white,
fontSize: 16.sp,
fontWeight: FontWeight.w600),
),
), ),
), ),
), GestureDetector(
], onTap: () async {
), if (selectedIndex < 0) {
) showOKToast('请选择一个礼物');
], return;
}
var result = await DioManager.instance.post(url: Api.sendGift,params: {'accid':widget.accid,'giftId':giftId,'num':1,'toUserId':widget.accid!.split('_').last});
if (result['code'] == 200) {
showOKToast('赠送成功');
Get.back();
} else if (result['code'] == 31201) {
showOKToast(result['msg']);
showRechargeScreenDialog();
}
},
child: Container(
height: 42.sp,
width: 136.sp,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(21.sp),
gradient: AppColor.mainVerLinearGradient
),
child: Text(
'赠送',
style: TextStyle(
color: Colors.white,
fontSize: 16.sp,
fontWeight: FontWeight.w600),
),
),
),
],
),
)
],
),
), ),
), ),
), ),

View File

@ -24,7 +24,7 @@ class _WishDialogState extends State<WishDialog> {
List giftList = []; List giftList = [];
String giftId = ''; String giftId = '';
String withStr = ''; String withStr = '';
int selectedIndex = -1; int selectedIndex = 1;
List<String> optionList = [ List<String> optionList = [
'分享一张本人照片', '分享一张本人照片',
@ -47,6 +47,13 @@ class _WishDialogState extends State<WishDialog> {
var result = await DioManager.instance.get(url: Api.giftList); var result = await DioManager.instance.get(url: Api.giftList);
if (result['code'] == 200) { if (result['code'] == 200) {
giftList = result['data']; giftList = result['data'];
for (int i= 0; i< giftList.length; i++) {
var info = giftList[i];
if (info['name'] == '浪漫告白') {
selectedIndex = i ;
giftId = info['id'].toString();
}
}
setState(() {}); setState(() {});
} }
} }
@ -149,46 +156,45 @@ class _WishDialogState extends State<WishDialog> {
colors: [Color(0xFF132B40), Color(0xFF251240)])), colors: [Color(0xFF132B40), Color(0xFF251240)])),
child: giftGridWidget(), child: giftGridWidget(),
), ),
Container( GestureDetector(
height: 30.sp, onTap: () {
padding: EdgeInsets.only(left: 10.sp, right: 10.sp), showOptionPiker(withStr);
margin: EdgeInsets.only(top: 12.sp), },
decoration: BoxDecoration( // behavior: HitTestBehavior.opaque,
color: Color(0x1AFFFFFF), child: Container(
borderRadius: BorderRadius.circular(15.sp)), height: 30.sp,
child: Row( padding: EdgeInsets.only(left: 10.sp, right: 10.sp),
mainAxisAlignment: MainAxisAlignment.spaceBetween, margin: EdgeInsets.only(top: 12.sp),
children: [ decoration: BoxDecoration(
Text( color: Color(0x1AFFFFFF),
'选择感恩方式', borderRadius: BorderRadius.circular(15.sp)),
style: TextStyle( child: Row(
color: Color(0xB3FFFFFF), fontSize: 15.sp), mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'选择感恩方式',
style: TextStyle(
color: Color(0xB3FFFFFF), fontSize: 15.sp),
),
Row(
children: [
Text(
withStr.isNotEmpty ? withStr : '请选择',
style: TextStyle(
color: withStr.isNotEmpty
? AppColor.mainColor
: Colors.white,
fontSize: 15.sp),
),
Image.asset(
getHomeImage('icon_in'),
width: 24.sp,
)
],
),
],
), ),
GestureDetector( )),
onTap: () {
showOptionPiker(withStr);
},
behavior: HitTestBehavior.opaque,
child: Row(
children: [
Text(
withStr.isNotEmpty ? withStr : '请选择',
style: TextStyle(
color: withStr.isNotEmpty
? AppColor.mainColor
: Colors.white,
fontSize: 15.sp),
),
Image.asset(
getHomeImage('icon_in'),
width: 24.sp,
)
],
),
)
],
),
),
Container( Container(
margin: EdgeInsets.only(top: 12.sp, bottom: 15.sp), margin: EdgeInsets.only(top: 12.sp, bottom: 15.sp),
padding: EdgeInsets.only(left: 30.sp, right: 30.sp), padding: EdgeInsets.only(left: 30.sp, right: 30.sp),
@ -228,14 +234,14 @@ class _WishDialogState extends State<WishDialog> {
if (selectedIndex < 0) { if (selectedIndex < 0) {
showOKToast('请选择一个礼物'); showOKToast('请选择一个礼物');
return; return;
} else if (withStr.isEmpty) { } else if (withStr.isEmpty) {
showOKToast('请选择感恩方式'); showOKToast('请选择感恩方式');
return; return;
} }
var info = giftList[selectedIndex]; var info = giftList[selectedIndex];
info['option'] = withStr; info['option'] = withStr;
sendGetWishCustomMsg( sendGetWishCustomMsg(widget.accId, jsonEncode(info),
widget.accId, jsonEncode(info), '许愿:想要${info['name']}'); '许愿:想要${info['name']}');
}, },
child: Container( child: Container(
height: 42.sp, height: 42.sp,
@ -277,7 +283,7 @@ class _WishDialogState extends State<WishDialog> {
Pickers.showSinglePicker(context, Pickers.showSinglePicker(context,
pickerStyle: DefaultPickerStyle.dark(), pickerStyle: DefaultPickerStyle.dark(),
data: optionList, data: optionList,
selectData: text.isNotEmpty ? text : optionList.first, selectData: text.isNotEmpty ? text : optionList[2],
onConfirm: (p, position) { onConfirm: (p, position) {
withStr = p; withStr = p;
setState(() {}); setState(() {});

View File

@ -562,11 +562,11 @@ class _DiscoverState extends State<Discover>
), ),
Container( Container(
width: Get.width - 120.sp, width: Get.width - 120.sp,
margin: EdgeInsets.only(top: 10.sp,bottom: 10.sp), margin: EdgeInsets.only(top: 15.sp,bottom: 15.sp),
child: Text( child: Text(
user.signature! ?? '', user.signature! ?? '',
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
maxLines: 2, maxLines: (user.signature! ?? '').length > 15 ? 2 : 1,
style: TextStyle( style: TextStyle(
fontSize: 16.sp, fontSize: 16.sp,
color: const Color(0XFFF7FAFA)), color: const Color(0XFFF7FAFA)),

View File

@ -67,6 +67,10 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
EventBusManager.cancelSubscription(scroToTop!); EventBusManager.cancelSubscription(scroToTop!);
} }
if (cicleInfoRefresh != null) {
cicleInfoRefresh!.cancel();
}
scrollController.dispose(); scrollController.dispose();
super.dispose(); super.dispose();
@ -74,6 +78,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
} }
StreamSubscription? callRefreshCicle =null; StreamSubscription? callRefreshCicle =null;
StreamSubscription? cicleInfoRefresh =null;
StreamSubscription? scroToTop =null; StreamSubscription? scroToTop =null;
@override @override
@ -99,10 +104,18 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
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){
callOutPage = 1;
loadCallOutListData(); loadCallOutListData();
} }
}); });
cicleInfoRefresh = EventBusManager.on<CircleInfoRefresh>().listen((event) {
if(widget.bean.id.toString() == event.circleId){
refreshCircleData();
}
});
// //
// scroToTop = EventBusManager.on<ScrollToTop>().listen((event) { // scroToTop = EventBusManager.on<ScrollToTop>().listen((event) {
// if (widget.logic.state.index == widget.index) { // if (widget.logic.state.index == widget.index) {
@ -219,6 +232,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) {
await refreshCircleData();
}
if (widget.bean.is_limit&&widget.bean.amount>0) { if (widget.bean.is_limit&&widget.bean.amount>0) {
showJoinCiclePiker(cicleId,widget.bean.amount.toString(),widget.bean.oldAmount.toString(),2,(payResult){ showJoinCiclePiker(cicleId,widget.bean.amount.toString(),widget.bean.oldAmount.toString(),2,(payResult){
@ -770,6 +786,9 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
Get.toNamed(AppRoutes.UserInfoActivity); Get.toNamed(AppRoutes.UserInfoActivity);
return; return;
} }
if (widget.bean.is_limit&&widget.bean.amount > 0) {
await refreshCircleData();
}
if (widget.bean.is_limit&&widget.bean.amount>0) { if (widget.bean.is_limit&&widget.bean.amount>0) {
showJoinCiclePiker(widget.bean.id.toString(),widget.bean.amount.toString(),widget.bean.oldAmount.toString(),1,(payResult){ 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;
@ -1075,6 +1094,10 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
Get.toNamed(AppRoutes.UserInfoActivity); Get.toNamed(AppRoutes.UserInfoActivity);
return; return;
} }
if (widget.bean.is_limit&&widget.bean.amount > 0) {
await refreshCircleData();
}
if (widget.bean.is_limit&&widget.bean.amount > 0) { if (widget.bean.is_limit&&widget.bean.amount > 0) {
showJoinCiclePiker(widget.bean.id.toString(),widget.bean.amount.toString(),widget.bean.oldAmount.toString(),1,(payResult){ 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;
@ -1588,9 +1611,9 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
content, 17.sp, FontWeight.w300, Get.currentRoute == AppRoutes.Home ? Get.width - 90.sp : Get.width - 64.sp, 100); content, 17.sp, FontWeight.w300, Get.currentRoute == AppRoutes.Home ? Get.width - 90.sp : Get.width - 64.sp, 100);
} }
void refreshCircleData() async { refreshCircleData() async {
var routePath = Get.currentRoute; // var routePath = Get.currentRoute;
if (routePath == AppRoutes.Signal_circle_list) return; // if (routePath == AppRoutes.Signal_circle_list) return;
var data = await DioManager.instance var data = await DioManager.instance
.get(url: 'up-service/interest/${widget.bean.id}'); .get(url: 'up-service/interest/${widget.bean.id}');

View File

@ -24,7 +24,7 @@ class Gift_shopPage extends StatelessWidget {
return Scaffold( return Scaffold(
backgroundColor: Colors.black, backgroundColor: Colors.black,
appBar: MyAppBar( appBar: MyAppBar(
centerTitle: logic.userId.isNotEmpty ? 'Ta的礼物' : '我的礼物馆', centerTitle: logic.userId.isNotEmpty ? 'Ta的礼物' : '我的礼物墙',
actionWdiget: logic.userId.isNotEmpty actionWdiget: logic.userId.isNotEmpty
? Container() ? Container()
: GestureDetector( : GestureDetector(
@ -118,7 +118,7 @@ class Gift_shopPage extends StatelessWidget {
children: [ children: [
Image.network( Image.network(
logic.toUser['avatar'] ?? logic.toUser['avatar'] ??
'http://qiniuyun.ikuayou.com/avatar/default/default_header.png', 'https://qiniuyun.ikuayou.com/avatar/default/default_header.png',
width: Get.width - 32.sp, width: Get.width - 32.sp,
height: 100.sp, height: 100.sp,
fit: BoxFit.cover, fit: BoxFit.cover,
@ -140,7 +140,7 @@ class Gift_shopPage extends StatelessWidget {
child: CachedNetworkImage( child: CachedNetworkImage(
fit: BoxFit.cover, fit: BoxFit.cover,
imageUrl: logic.toUser['avatar'] ?? imageUrl: logic.toUser['avatar'] ??
'http://qiniuyun.ikuayou.com/avatar/default/default_header.png', 'https://qiniuyun.ikuayou.com/avatar/default/default_header.png',
width: 45.sp, width: 45.sp,
height: 45.sp, height: 45.sp,
), ),
@ -313,8 +313,14 @@ class Gift_shopPage extends StatelessWidget {
fontWeight: FontWeight.w500)), fontWeight: FontWeight.w500)),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
logic.sendGiftData(logic.accid, info['id'].toString(), if (logic.userId.isEmpty) {
logic.userId, index, ''); logic.sendGiftData(logic.accid, info['id'].toString(),
logic.accid.split('_').last, index, '');
} else {
logic.sendGiftData(logic.accid, info['id'].toString(),
logic.userId, index, '');
}
}, },
child: Container( child: Container(
height: 20.sp, height: 20.sp,
@ -326,7 +332,7 @@ class Gift_shopPage extends StatelessWidget {
gradient: AppColor.mainVerLinearGradient, gradient: AppColor.mainVerLinearGradient,
borderRadius: BorderRadius.circular(10.sp)), borderRadius: BorderRadius.circular(10.sp)),
child: Text( child: Text(
!isGet ? '去送礼' : '赠送', !isGet ? '点亮' : '赠送',
style: TextStyle(color: Colors.white, fontSize: 11.sp), style: TextStyle(color: Colors.white, fontSize: 11.sp),
), ),
), ),

View File

@ -11,6 +11,7 @@ import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:image_picker/image_picker.dart'; import 'package:image_picker/image_picker.dart';
import '../../../common/Widgets/base_tip_widget.dart';
import '../../../common/config.dart'; import '../../../common/config.dart';
import '../../../network/api.dart'; import '../../../network/api.dart';
import '../../../util/qiniu.dart'; import '../../../util/qiniu.dart';
@ -38,6 +39,8 @@ class Complete_materialLogic extends GetxController {
int unLockWxNum = 0; int unLockWxNum = 0;
Map wxStatusInfo = {};
late ConfigBean configBean; late ConfigBean configBean;
List<MyConfigData> numbers = []; List<MyConfigData> numbers = [];
@ -62,6 +65,7 @@ class Complete_materialLogic extends GetxController {
await loadCofigData(); await loadCofigData();
getCityList(); getCityList();
if(type!=''){ if(type!=''){
loadWXEditStatus();
var data = await DioManager.instance.get(url: Api.getUserInfo); var data = await DioManager.instance.get(url: Api.getUserInfo);
var bean = BaseResponse<ResponseBean>.fromJson( var bean = BaseResponse<ResponseBean>.fromJson(
data, (data) => ResponseBean.fromJson(data)); data, (data) => ResponseBean.fromJson(data));
@ -107,6 +111,21 @@ class Complete_materialLogic extends GetxController {
} }
loadWXEditStatus() async {
var data =
await DioManager.instance.get(url: Api.checkWxNumState,);
if (data['code'] == 200) {
// code 200 4000 32100
//
// BAN_ACTION(4000, "用户当前操作被禁止"),
//
// NOTICE_UPDATE_WXNUM(32100, "填写/更新微信需要消耗{}小票哦");
} else {
wxStatusInfo['${data['code']}'] = data['msg'];
}
}
loadCofigData() async { loadCofigData() async {
var data = var data =
await DioManager.instance.get(url: Api.getqiniuToken, params: {}); await DioManager.instance.get(url: Api.getqiniuToken, params: {});
@ -326,7 +345,7 @@ class Complete_materialLogic extends GetxController {
return; return;
} }
if (state.wxEditingController.text.isNotEmpty) { if (state.wxEditingController.text.isNotEmpty && userInfoBean!.wx_num != state.wxEditingController.text) {
bool isPass = false; bool isPass = false;
if (state.wxEditingController.text.length == 11) { if (state.wxEditingController.text.length == 11) {
RegExp exp = RegExp( RegExp exp = RegExp(
@ -341,8 +360,23 @@ class Complete_materialLogic extends GetxController {
return; return;
} }
} }
if (wxStatusInfo.containsKey('4000')) {
showOKToast(wxStatusInfo['40000']);
return;
}
var result = await DioManager().post(url: Api.updateWxNum,params: {'type':2,'wxNum':state.wxEditingController.text}); var result = await DioManager().post(url: Api.updateWxNum,params: {'type':2,'wxNum':state.wxEditingController.text});
if (result['code'] == 31201) {
// showToast.
showOKToast(result['msg']);
showRechargeScreenDialog();
return;
} else if (result['code'] == 200) {
if (wxStatusInfo.containsKey('32100')) {
showOKToast(wxStatusInfo['32100']);
}
}
print(result); print(result);
} }
//TODO //TODO
@ -367,6 +401,7 @@ class Complete_materialLogic extends GetxController {
}); });
var bean = BaseResponse<String>.fromJson(data, (data) => data); var bean = BaseResponse<String>.fromJson(data, (data) => data);
if (bean.code == 200) { if (bean.code == 200) {
showOKToast('操作成功');
var mineFragment = Get.find<MinefragmentLogic>(); var mineFragment = Get.find<MinefragmentLogic>();
mineFragment.avatar = headUrl; mineFragment.avatar = headUrl;
mineFragment.name = state.textEditingController.text; mineFragment.name = state.textEditingController.text;

View File

@ -1,8 +1,13 @@
import 'dart:convert'; import 'dart:convert';
import 'dart:math'; import 'dart:math';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:circle_app/common/colors/app_color.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_slidable_for_tencent_im/flutter_slidable.dart'; import 'package:flutter_slidable_for_tencent_im/flutter_slidable.dart';
import 'package:get/get.dart';
import 'package:gradient_borders/gradient_borders.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:scroll_to_index/scroll_to_index.dart'; import 'package:scroll_to_index/scroll_to_index.dart';
import 'package:tencent_cloud_chat_uikit/base_widgets/tim_ui_kit_state.dart'; import 'package:tencent_cloud_chat_uikit/base_widgets/tim_ui_kit_state.dart';
@ -19,7 +24,12 @@ import 'package:tencent_cloud_chat_uikit/ui/views/TIMUIKitConversation/tim_uikit
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 '../../../network/api.dart';
import '../../../network/dio_manager.dart';
import '../../../router/app_routers.dart';
import '../../../util/eventBus.dart'; import '../../../util/eventBus.dart';
import '../../../util/util.dart';
import '../../circle/widgets/discover.dart';
import 'tim_uikit_conversation_item.dart'; import 'tim_uikit_conversation_item.dart';
typedef TIMConversationItemBuilder = Widget Function( typedef TIMConversationItemBuilder = Widget Function(
@ -137,8 +147,6 @@ class ConversationItemSlidePanel extends TIMUIKitStatelessWidget {
/// A label to display below the [icon]. /// A label to display below the [icon].
final String? label; final String? label;
@override @override
Widget tuiBuild(BuildContext context, TUIKitBuildValue value) { Widget tuiBuild(BuildContext context, TUIKitBuildValue value) {
return SlidableAction( return SlidableAction(
@ -161,16 +169,19 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
// final TUIFriendShipViewModel friendShipViewModel = // final TUIFriendShipViewModel friendShipViewModel =
// serviceLocator<TUIFriendShipViewModel>(); // serviceLocator<TUIFriendShipViewModel>();
bool hasMore = true; bool hasMore = true;
List<String> chatImIdList = [];
var recommendCircleFriendData = {};
@override @override
void initState() { void initState() {
super.initState(); super.initState();
loadRecommendCircleFriendData();
final controller = getController(); final controller = getController();
widget.scrollController!.addListener(() { widget.scrollController!.addListener(() {
try { try {
if (widget.scrollController!.position.pixels == if (widget.scrollController!.position.pixels ==
widget.scrollController!.position.maxScrollExtent && hasMore) { widget.scrollController!.position.maxScrollExtent &&
hasMore) {
_timuiKitConversationController.loadData(); _timuiKitConversationController.loadData();
} }
} catch (_) {} } catch (_) {}
@ -418,28 +429,18 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
future: getUserListInfo(userIdList), future: getUserListInfo(userIdList),
builder: (BuildContext context, builder: (BuildContext context,
AsyncSnapshot<List<V2TimUserFullInfo>> snapshot) { AsyncSnapshot<List<V2TimUserFullInfo>> snapshot) {
// if (snapshot.connectionState != ConnectionState.done ||
// haveMoreData) {
// if (haveMoreData) {
// _timuiKitConversationController.loadData();
// }
//
// return Container();
// }
return ListView.builder( return ListView.builder(
controller: widget.scrollController!, controller: widget.scrollController!,
shrinkWrap: true, // shrinkWrap: true,
itemCount: filteredConversationList.length, itemCount: recommendCircleFriendData.isNotEmpty && filteredConversationList.length < 15
? filteredConversationList.length + 1
: filteredConversationList.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
// if (index == filteredConversationList.length - 1) { if (index == filteredConversationList.length) {
// if (haveMoreData) { return recommendCircleFriendData.isNotEmpty
// loaddingWidget(true); ? recommendCircleFriendWidget()
// // _timuiKitConversationController.loadData(); : Container();
// } else { }
// return Container();
// }
// }
final conversationItem = final conversationItem =
filteredConversationList[index]; filteredConversationList[index];
@ -488,9 +489,9 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
if (userFullInfo!.customInfo! if (userFullInfo!.customInfo!
.containsKey('Label')) { .containsKey('Label')) {
if (userFullInfo! if (userFullInfo!.customInfo!['Label']
.customInfo!['Label'] .toString()
.toString().isNotEmpty) { .isNotEmpty) {
var otherInfo = jsonDecode(userFullInfo! var otherInfo = jsonDecode(userFullInfo!
.customInfo!['Label'] .customInfo!['Label']
.toString()); .toString());
@ -614,23 +615,541 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
}) })
: (widget.emptyBuilder != null : (widget.emptyBuilder != null
? widget.emptyBuilder!() ? widget.emptyBuilder!()
: Container()); : recommendCircleFriendData.isNotEmpty
? recommendCircleFriendWidget()
: Container());
} }
// EasyRefresh( // EasyRefresh(
// header: CustomizeBallPulseHeader(color: theme.primaryColor), // header: CustomizeBallPulseHeader(color: theme.primaryColor),
// onRefresh: () async { // onRefresh: () async {
// model.refresh(); // model.refresh();
// }, // },
// child: // child:
return TUIKitScreenUtils.getDeviceWidget( return TUIKitScreenUtils.getDeviceWidget(
defaultWidget: SlidableAutoCloseBehavior( defaultWidget: SlidableAutoCloseBehavior(
child: conversationList(), child: conversationList(),
),
),
desktopWidget: Scrollbar( desktopWidget: Scrollbar(
controller: widget.autoScrollController!, controller: widget.autoScrollController!,
child: conversationList())); child: conversationList()));
}); });
} }
recommendCircleFriendWidget() {
var info = {};
var user = Users.fromJson(recommendCircleFriendData['user']);
// 100
// ·90
// ·TA80
// ·70
// ·260
// ·50
// ·TA40
// ·TA是乐园优秀圈主哦30
var titleList = [];
if (recommendCircleFriendData['is_follow_me']) {
titleList.add('对方喜欢了你');
} else if (recommendCircleFriendData['has_both_friend']) {
titleList.add('你们有共同喜欢的圈友');
} else if (recommendCircleFriendData['has_friend_follow_to']) {
titleList.add('你喜欢的圈友也喜欢TA');
}
if (titleList.length < 3) {
List citys = recommendCircleFriendData['both_cities'];
if (citys.isNotEmpty) {
titleList.add('你们都在${citys.first}留下过足迹');
}
}
if (titleList.length < 3) {
List circles = recommendCircleFriendData['both_interests'];
if (circles.isNotEmpty) {
List<dynamic> both_interests =
recommendCircleFriendData['both_interests'];
List<String> circleList = [];
both_interests.forEach((element) {
circleList.add(element['title']);
});
if (circleList.isNotEmpty) {
titleList
.add('你们有${circleList.length}个共同的圈子:${circleList.join('')}');
}
}
}
if (titleList.length < 3) {
if (recommendCircleFriendData['is_wanna_meet']) {
titleList.add('很多圈友都喜欢TA');
}
}
if (titleList.length < 3) {
if (recommendCircleFriendData['is_most_fans']) {
titleList.add('可能是你想认识的人');
}
}
if (titleList.length < 3) {
if (recommendCircleFriendData['is_excellent_qz_leader']) {
titleList.add('TA是乐园优秀圈主哦');
}
}
if (titleList.length >= 1) {
info['city'] = titleList.first;
}
if (titleList.length >= 2) {
info['both_interests'] = titleList[1];
}
if (titleList.length >= 3) {
info['desc'] = titleList[2];
}
List circleList = recommendCircleFriendData['interests'];
return Container(
padding: EdgeInsets.only(left: 15.sp, right: 15.sp),
child: Column(children: [
Container(
margin: EdgeInsets.only(top: 20.sp),
child: Row(
children: [
Expanded(
child: Container(
height: 2.sp,
color: Colors.white.withOpacity(0.5),
)),
Container(
width: 4.sp,
height: 4.sp,
margin: EdgeInsets.only(left: 15.sp, right: 15.sp),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.white.withOpacity(0.5)),
),
Expanded(
child: Container(
height: 2.sp,
color: Colors.white.withOpacity(0.5),
)),
],
),
),
Container(
margin: EdgeInsets.only(top: 16.sp),
child: Row(
children: [
Image.asset(
getMsgImage('heart_icon'),
width: 18.sp,
),
SizedBox(
width: 4.sp,
),
ShaderMask(
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(
width: 4.sp,
),
Image.asset(
getMsgImage('heart_icon'),
width: 18.sp,
),
Expanded(child: Container()),
InkWell(
onTap: () {
loadRecommendCircleFriendData();
},
child: Container(
child: Row(
children: [
Icon(
Icons.refresh_sharp,
size: 18.sp,
color: AppColor.mainColor,
),
SizedBox(
width: 4.sp,
),
Text(
'换一位',
style: TextStyle(
color: AppColor.mainColor, fontSize: 15.sp),
)
],
),
),
)
],
),
),
Container(
margin: EdgeInsets.only(top: 16.sp),
width: Get.width,
// constraints: BoxConstraints(maxHeight: 230.sp),
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [Color(0xFF4C3E5F), Color(0xFF324140)]),
borderRadius: BorderRadius.circular(8.sp),
border: GradientBoxBorder(
gradient: AppColor.mainVerLinearGradient,
width: 1.sp,
),
),
padding: EdgeInsets.only(left: 12.sp, right: 12.sp,top: 10.sp),
child: Column(
children: [
GestureDetector(
onTap: () {
Get.toNamed(AppRoutes.UserInfoActivity,arguments: user.userId.toString());
},
child: Container(
child: Row(
children: [
ClipOval(
child: Image.network(
recommendCircleFriendData['user']['avatar'],
width: 50.sp,
height: 50.sp,
fit: BoxFit.cover,
),
),
SizedBox(
width: 6.sp,
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
user.nickname ?? '',
style: TextStyle(
fontSize: 16.sp,
color: Color(0XFFF7FAFA),
fontWeight: FontWeight.bold),
),
SizedBox(height: 4.sp,),
Row(
children: [
Container(
alignment: Alignment.center,
height: 18.sp,
padding:
EdgeInsets.only(left: 6.sp, right: 6.sp),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(9.sp),
gradient: const LinearGradient(
begin: Alignment(0.25, 0.5),
end: Alignment(0.75, 0.5),
colors: [
Color(0xff8DFFF8),
Color(0xffB5D3FF)
])),
child: Text(
getAgeCOntent(
user!.gender ?? 0,
user!.age ?? 0,
user!.role ?? 0,
user!.orientation ?? 0),
style: TextStyle(
color: Colors.black,
fontSize: 12.sp,
),
),
),
if (user.vip! > 0)
Container(
margin: EdgeInsets.only(
left: 4.sp,
),
child: Image.asset(
getCircleImage(
user.vip == 1 ? 'vip' : 'year_vip'),
width: 36.sp,
),
),
],
),
],
)),
GestureDetector(
onTap: () async {
if (!chatImIdList.contains(user.userId.toString())) {
await createCustomMsg(user.userId.toString(), recommendCircleFriendData['user']['imId']);
}
pushChatPage(user.userId.toString(), recommendCircleFriendData['user']['imId'], user.nickname!);
},
child: Container(
height: 25.sp,
padding: EdgeInsets.only(left: 6.sp,right: 6.sp),
decoration: BoxDecoration(
gradient: AppColor.mainVerLinearGradient,
borderRadius: BorderRadius.circular(12.5.sp)),
alignment: Alignment.center,
child: Text(
'聊一聊',
style:
TextStyle(color: Colors.white, fontSize: 15.sp),
),
),
)
],
),
),
),
if (info.containsKey('desc'))
Container(
margin: EdgeInsets.only(top: 10.sp, right: 16.sp),
child: Row(
children: [
Container(
margin: EdgeInsets.only(right: 5.sp),
width: 3,
height: 3,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(1.5),
color: Color(0xFF00FFF4)),
),
Expanded(
child: Container(
child: Text(
info['desc'],
style: TextStyle(
color: Colors.white,
fontSize: 14.sp,
fontWeight: FontWeight.w500,
),
overflow: TextOverflow.ellipsis,
maxLines: 1,
),
),
)
],
),
),
if (info.containsKey('city'))
info['city'].toString().isNotEmpty
? Container(
margin: EdgeInsets.only(top: 10.sp),
child: Row(
children: [
Container(
margin: EdgeInsets.only(right: 5.sp),
width: 3.sp,
height: 3.sp,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(1.5.sp),
color: Color(0xFF00FFF4)),
),
Expanded(child: Text(
info['city'],
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Colors.white,
fontSize: 14.sp,
fontWeight: FontWeight.w500),
))
],
),
)
: Container(),
if (info.containsKey('both_interests'))
Container(
margin: EdgeInsets.only(top: 10.sp, right: 16.sp),
child: Row(
children: [
Container(
margin: EdgeInsets.only(right: 5.sp),
width: 3,
height: 3,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(1.5),
color: Color(0xFF00FFF4)),
),
Expanded(
child: Container(
child: Text(
info['both_interests'],
style: TextStyle(
color: Colors.white,
fontSize: 14.sp,
fontWeight: FontWeight.w500,
),
overflow: TextOverflow.ellipsis,
maxLines: 1,
),
),
)
],
),
),
Container(
margin: EdgeInsets.only(top: 10.sp, bottom: 10.sp),
alignment: Alignment.centerLeft,
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.only(right: 5.sp, top: 10.sp),
width: 3,
height: 3,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(1.5),
color: Color(0xFF00FFF4)),
),
Expanded(
child: Text(
'交友宣言:' +
recommendCircleFriendData['user']['signature'],
style: TextStyle(
color: Colors.white,
fontSize: 14.sp,
fontWeight: FontWeight.w500),
maxLines: 2,
overflow: TextOverflow.ellipsis,
)),
])),
Image.asset(
getCircleImage('line'),
width: Get.width,
fit: BoxFit.fill,
),
if (circleList.isNotEmpty)
Container(
height: 72.sp,
margin: EdgeInsets.only(top: 10.sp,bottom: 10.sp),
width: Get.width,
child: ListView.builder(itemBuilder: (context,index) {
return circleInfoItem(circleList[index], index);
},itemCount: circleList.length,scrollDirection: Axis.horizontal,),
)
],
),
),
]));
}
circleInfoItem(var bean, int index) {
return GestureDetector(
onTap: () {
Get.toNamed(AppRoutes.Signal_circle_list,
arguments: bean['id'].toString());
},
child: Container(
margin: EdgeInsets.only(right: 10.sp),
padding: EdgeInsets.only(left: 12.sp, right: 12.sp),
height: 72.sp,
width: 140.sp,
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(8.sp),
border: GradientBoxBorder(
gradient:
AppColor.mainVerLinearGradient,
width: 1.sp,
),
),
child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
width: 42.sp,
height: 42.sp,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.0),
gradient: const LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
Color(0xFF71F3F2),
Color(0xFFF558FF),
],
stops: [0.0365, 0.9427],
),
),
padding: EdgeInsets.all(1.sp),
child: ClipRRect(
borderRadius: BorderRadius.circular(8.0),
child: CachedNetworkImage(
imageUrl: bean['image'],
width: 40.sp,
height: 40.sp,
memCacheHeight: 40,
memCacheWidth: 40,
fit: BoxFit.cover),
),
),
Expanded(
child: Container(
padding: EdgeInsets.only(left: 8.sp, ),
// alignment: Alignment.,
height: 72.sp,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
bean['title'],
style: TextStyle(
color: Colors.white,
fontSize: 12.sp,
fontWeight: FontWeight.w600),
),
SizedBox(
height: 4.sp,
),
Text(
// "view_total" -> 21
'${convertToTenThousand(bean['viewTotal'])}人看过',
textAlign: TextAlign.left,
style: TextStyle(
color: const Color(0xff03FEFB),
fontSize: 12.sp,
),
),
],
),
)),
],
),
),
);
}
void loadRecommendCircleFriendData() async {
var data = await DioManager.instance.get(
url: Api.chatRecommendFriend,
);
if (data['code'] == 200) {
recommendCircleFriendData = data['data'][0];
setState(() {});
}
}
} }

View File

@ -19,12 +19,15 @@ class MsgLogic extends GetxController {
int total = 0; int total = 0;
bool isStart = false;
@override @override
void onInit() { void onInit() {
// TODO: implement onInit // TODO: implement onInit
super.onInit(); super.onInit();
loadChatData(); loadChatData();
loadLikeData(); loadLikeData();
loadStatusData();
} }
loadLikeData() async { loadLikeData() async {
var data = var data =
@ -65,9 +68,10 @@ class MsgLogic extends GetxController {
.get(url: Api.startQuick); .get(url: Api.startQuick);
if (data["code"] == 200) { if (data["code"] == 200) {
showOKToast("已开启速聊"); showOKToast("已开启速聊");
isStart = true;
loadChatData(); loadChatData();
return true; return true;
} else if (data["code"] == 10102) { } else if (data["code"] == 31201) {
showRechargeScreenDialog(); showRechargeScreenDialog();
} }
} else if (data["data"] == 1) { } else if (data["data"] == 1) {
@ -84,6 +88,7 @@ class MsgLogic extends GetxController {
await DioManager.getInstance().get(url: Api.stopQuick); await DioManager.getInstance().get(url: Api.stopQuick);
if (data["code"] == 200) { if (data["code"] == 200) {
showOKToast('操作成功'); showOKToast('操作成功');
isStart = false;
loadChatData(); loadChatData();
} }
@ -95,11 +100,9 @@ class MsgLogic extends GetxController {
if (data["code"] == 200) { if (data["code"] == 200) {
showOKToast("已成功召唤三十人请耐心等待TA的回复哈~"); showOKToast("已成功召唤三十人请耐心等待TA的回复哈~");
return true; return true;
} else if(data["code"] == 10081){ } else if (data["code"] == 31201) {
showOKToast(data["msg"]);
showRechargeScreenDialog(); showRechargeScreenDialog();
} else{
}else{
showOKToast(data["msg"]); showOKToast(data["msg"]);
} }
return false; return false;
@ -149,4 +152,17 @@ class MsgLogic extends GetxController {
), ),
isScrollControlled: true); isScrollControlled: true);
} }
void loadStatusData() async {
var data =
await DioManager.getInstance().get(url: Api.queryQuickStart);
if (data["code"] == 200) {
if (data["data"] == 0) {
isStart = false;
} else {
isStart = true;
}
}
update();
}
} }

View File

@ -67,34 +67,30 @@ class _MsgPageState extends State<MsgPage> with AutomaticKeepAliveClientMixin {
return Scaffold( return Scaffold(
resizeToAvoidBottomInset: false, resizeToAvoidBottomInset: false,
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
body: Stack( body: SafeArea(
children: [ child: GetBuilder(builder: (MsgLogic controller) {
SafeArea( return Column(
child: GetBuilder(builder: (MsgLogic controller) { children: [
return Column( navigatorItem(controller),
children: [ tipWidget(),
navigatorItem(controller), reconmandWidget(),
tipWidget(), // Text(controller.state.msg),
reconmandWidget(), Expanded(child: TIMConversation(
// Text(controller.state.msg), autoScrollController: logic.scrollController,
Expanded(child: TIMConversation( scrollController: logic.listScrollController,
autoScrollController: logic.scrollController, onTapItem: (selectedConv) async{
scrollController: logic.listScrollController, String type = selectedConv.userID!.split('_')[2];
onTapItem: (selectedConv) async{ if (int.parse(type) == 11) {
String type = selectedConv.userID!.split('_')[2]; Get.toNamed(AppRoutes.Sys_notify_list, arguments: selectedConv);
if (int.parse(type) == 11) { return;
Get.toNamed(AppRoutes.Sys_notify_list, arguments: selectedConv); }
return; Get.toNamed(AppRoutes.Chat, arguments: selectedConv);
}
Get.toNamed(AppRoutes.Chat, arguments: selectedConv);
}, },
)) ))
], ],
); );
}), }),
)
],
), ),
); );
} }
@ -314,7 +310,7 @@ class _MsgPageState extends State<MsgPage> with AutomaticKeepAliveClientMixin {
height: 4.sp, height: 4.sp,
), ),
Text( Text(
'抢占第一', ctr.isStart ? '关闭速聊' : '开启速聊',
style: TextStyle(color: Colors.white, fontSize: 12.sp), style: TextStyle(color: Colors.white, fontSize: 12.sp),
), ),
], ],

View File

@ -107,47 +107,54 @@ class My_assetsPage extends StatelessWidget {
), ),
Expanded( Expanded(
flex: 1, flex: 1,
child: Row( child: Container(
mainAxisAlignment: MainAxisAlignment.center, padding: EdgeInsets.only(left: 10.sp,right: 10.sp),
children: [ child: Row(
Text( mainAxisAlignment: MainAxisAlignment.center,
"收入金额", children: [
style: TextStyle( Container(
color: Colors.white, margin: EdgeInsets.only(right: 15.sp),
fontSize: 13.sp), child: Text(
), "收入金额",
// if (Platform.isAndroid) style: TextStyle(
SizedBox(width: 4.sp), color: Colors.white,
// if (Platform.isAndroid) fontSize: 13.sp),
GestureDetector(
onTap: () {
var con;
if(kDebugMode){
con = V2TimConversation(
conversationID: "c2c_qpqz_dev_10_102", userID: "qpqz_dev_10_102", showName: "测试乐园客服", type: 1);
}else{
con = V2TimConversation(
conversationID: "c2c_qpqz_prod_10_102", userID: "qpqz_prod_10_102", showName: "乐园客服", type: 1);
}
Get.toNamed(AppRoutes.Chat, arguments: con);
},
child: Container(
height: 20.sp,
padding: EdgeInsets.only(left: 6.sp,right: 6.sp),
alignment: Alignment.center,
decoration: BoxDecoration(
gradient: AppColor
.mainVerLinearGradient,
borderRadius: BorderRadius
.circular(10.sp)
),
child: Text('联系客服',
style: TextStyle(
color: Colors.white,
fontSize: 14.sp),),
), ),
) ),
], // if (Platform.isAndroid)
// SizedBox(width: 30.sp,),
// Expanded(child: Container()),
// if (Platform.isAndroid)
GestureDetector(
onTap: () {
var con;
if(kDebugMode){
con = V2TimConversation(
conversationID: "c2c_qpqz_dev_10_102", userID: "qpqz_dev_10_102", showName: "测试乐园客服", type: 1);
}else{
con = V2TimConversation(
conversationID: "c2c_qpqz_prod_10_102", userID: "qpqz_prod_10_102", showName: "乐园客服", type: 1);
}
Get.toNamed(AppRoutes.Chat, arguments: con);
},
child: Container(
height: 20.sp,
padding: EdgeInsets.only(left: 6.sp,right: 6.sp),
alignment: Alignment.center,
decoration: BoxDecoration(
gradient: AppColor
.mainVerLinearGradient,
borderRadius: BorderRadius
.circular(10.sp)
),
child: Text('联系客服',
style: TextStyle(
color: Colors.white,
fontSize: 14.sp),),
),
)
],
),
), ),
), ),
], ],
@ -209,16 +216,21 @@ class My_assetsPage extends StatelessWidget {
"总充值", "总充值",
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 12.sp), fontSize: 14.sp),
), ),
Text("${logic.myAssest!.totalRechargeBalance!}小票", Text("${logic.myAssest!.totalRechargeBalance!}小票",
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 12.sp), fontSize: 14.sp),
), ),
], ],
), ),
), ),
Container(
height: 15.sp,
width: 1.sp,
color:Color(0x4DFFFFFF),
),
Expanded( Expanded(
flex: 1, flex: 1,
child: Column( child: Column(
@ -228,17 +240,22 @@ class My_assetsPage extends StatelessWidget {
"总收入", "总收入",
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 12.sp), fontSize: 14.sp),
), ),
Text( Text(
"${logic.myAssest!.totalIncomeBalance!}小票", "${logic.myAssest!.totalIncomeBalance!}小票",
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 12.sp), fontSize: 14.sp),
), ),
], ],
), ),
), ),
Container(
height: 15.sp,
width: 1.sp,
color:Color(0x4DFFFFFF),
),
Expanded( Expanded(
flex: 1, flex: 1,
child: Column( child: Column(
@ -248,12 +265,12 @@ class My_assetsPage extends StatelessWidget {
"总支出", "总支出",
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 12.sp), fontSize: 14.sp),
), ),
Text("${logic.myAssest!.totalExpenseBalance!}小票", Text("${logic.myAssest!.totalExpenseBalance!}小票",
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 12.sp), fontSize: 14.sp),
), ),
], ],
), ),

View File

@ -469,15 +469,18 @@ class UserBean {
class Interest { class Interest {
int id; int id;
String title; String title;
int viewTotal;
Interest({ Interest({
required this.id, required this.id,
required this.title, required this.title,
required this.viewTotal,
}); });
factory Interest.fromJson(Map<String, dynamic> json) { factory Interest.fromJson(Map<String, dynamic> json) {
return Interest( return Interest(
id: json['id'], id: json['id'],
viewTotal: json['viewTotal'] ?? 0,
title: json['title'], title: json['title'],
); );
} }

View File

@ -1,3 +1,5 @@
import 'package:cached_network_image/cached_network_image.dart'; import 'package:cached_network_image/cached_network_image.dart';
import 'package:circle_app/app/userinfo/widgets/home_call_out.dart'; import 'package:circle_app/app/userinfo/widgets/home_call_out.dart';
import 'package:circle_app/common/Widgets/base_tip_widget.dart'; import 'package:circle_app/common/Widgets/base_tip_widget.dart';
@ -12,6 +14,7 @@ import 'package:get/get.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/eventBus.dart';
import '../../util/util.dart'; import '../../util/util.dart';
import '../select_circle/logic.dart'; import '../select_circle/logic.dart';
import 'logic.dart'; import 'logic.dart';
@ -31,9 +34,35 @@ class MyTabbedScreenState extends State<UserinfoPage>
ScrollController scrollController = ScrollController(); ScrollController scrollController = ScrollController();
bool isShowBlackTitle = false; bool isShowBlackTitle = false;
bool isSetState = false;
var sub;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
sub = EventBusManager.on<ScrollViewScrollTop>().listen((event) {
scrollController.animateTo(0, duration: Duration(microseconds: 200), curve: Curves.easeIn);
});
scrollController.addListener(() {
if (scrollController.position.pixels ==
scrollController.position.maxScrollExtent) {
print('2222');
isSetState = true;
setState(() {
});
EventBusManager.fire(ScrollViewIsEnd(true));
} else {
EventBusManager.fire(ScrollViewIsEnd(false));
if (isSetState) {
setState(() {
});
isSetState = false;
}
print('111');
}
});
_pageController = PageController(); _pageController = PageController();
_tabController = TabController(length: 2, vsync: this); _tabController = TabController(length: 2, vsync: this);
_tabController.animation!.addListener(_handleTabChange); _tabController.animation!.addListener(_handleTabChange);
@ -50,24 +79,22 @@ class MyTabbedScreenState extends State<UserinfoPage>
routeObserver.subscribe(this, ModalRoute.of(context) as PageRoute); routeObserver.subscribe(this, ModalRoute.of(context) as PageRoute);
} }
void didPopNext() { void didPopNext() {
print('didPopNext'); print('didPopNext');
if (logic.userId.isEmpty) { if (logic.userId.isEmpty) {
logic.fetchUserInfo(Api.getUserInfo); logic.fetchUserInfo(Api.getUserInfo);
} }
} }
/// ///
void didPush() { void didPush() {
print('didPopNext'); print('didPopNext');
} }
void didPop() { void didPop() {
print('didPop'); print('didPop');
} }
void _handleTabChange() { void _handleTabChange() {
// //
// //
@ -79,6 +106,7 @@ class MyTabbedScreenState extends State<UserinfoPage>
@override @override
void dispose() { void dispose() {
_tabController.dispose(); _tabController.dispose();
sub.cancel();
routeObserver.unsubscribe(this); routeObserver.unsubscribe(this);
super.dispose(); super.dispose();
} }
@ -108,95 +136,159 @@ class MyTabbedScreenState extends State<UserinfoPage>
Scaffold( Scaffold(
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
appBar: MyAppBar( appBar: MyAppBar(
centerTitle: logic.userInfoBean != null centerTitle: logic.userInfoBean != null
? "${logic.userInfoBean!.nickname}" ? "${logic.userInfoBean!.nickname}"
: "个人主页", : "个人主页",
actionWdiget: logic.isMe ? GestureDetector( actionWdiget: logic.isMe
onTap: () async{ ? GestureDetector(
await showAddWxPicker(logic.userInfoBean!.wx_num!.isNotEmpty ?? false,isHidden: logic.userInfoBean!.wx_num!.isNotEmpty ?? false,isWxHidden:logic.userInfoBean!.hide_wx_num == 1,); onTap: () async {
logic.fetchUserInfo(Api.getUserInfo); await showAddWxPicker(
}, logic.userInfoBean!.wx_num!.isNotEmpty ?? false,
child:Stack( isHidden:
alignment: Alignment.center, logic.userInfoBean!.wx_num!.isNotEmpty ?? false,
children: [ isWxHidden: logic.userInfoBean!.hide_wx_num == 1,
Container( );
width: 101.sp, logic.fetchUserInfo(Api.getUserInfo);
height: 26.sp, },
decoration: BoxDecoration( child: Stack(
borderRadius: BorderRadius.circular(12.sp), alignment: Alignment.center,
gradient: LinearGradient( children: [
colors: [ Color(0xFF30FFD9),Color(0xFFDD3DF4)], Container(
begin: Alignment.centerLeft, width: 101.sp,
end: Alignment.centerRight, height: 26.sp,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12.sp),
gradient: LinearGradient(
colors: [
Color(0xFF30FFD9),
Color(0xFFDD3DF4)
],
begin: Alignment.centerLeft,
end: Alignment.centerRight,
),
),
),
Container(
width: 100.sp,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(11.sp),
color: Color(0xFF240F3B)),
alignment: Alignment.center,
height: 24.sp,
child: Text(
'填写微信号',
style: TextStyle(
color: Colors.white, fontSize: 14.sp),
),
)
],
), ),
), // Container(
), // alignment: Alignment.center,
Container( // // width: 90.sp,
width: 100.sp, // height: 24.sp,
decoration: BoxDecoration( // padding:
borderRadius: BorderRadius.circular(11.sp), // EdgeInsets.only(left: 6.sp, right: 6.sp),
color: Color(0xFF240F3B) // decoration: BoxDecoration(
// color: AppColor.mainColor,
), // borderRadius:
alignment: Alignment.center, // BorderRadiusDirectional.circular(
height: 24.sp, // 11.sp)),
child: Text( // child: Text(
'填写微信号', // '填写微信号',
style: TextStyle( // style: TextStyle(
color: Colors.white, fontSize: 14.sp), // color: Colors.white, fontSize: 13.sp),
), // ),
) // ),
], )
), : Container()),
// Container(
// alignment: Alignment.center,
// // width: 90.sp,
// height: 24.sp,
// padding:
// EdgeInsets.only(left: 6.sp, right: 6.sp),
// decoration: BoxDecoration(
// color: AppColor.mainColor,
// borderRadius:
// BorderRadiusDirectional.circular(
// 11.sp)),
// child: Text(
// '填写微信号',
// style: TextStyle(
// color: Colors.white, fontSize: 13.sp),
// ),
// ),
) : Container()
),
body: Stack( body: Stack(
// fit: StackFit.expand,
children: [ children: [
Container( Container(
child: buildContent(logic), height: Get.height,
), width: Get.width,
// color: Colors.red,
child:
NestedScrollView(
controller: scrollController,
headerSliverBuilder: (context,isScrolled) {
return [
SliverAppBar(
stretch: false,
elevation: 0,
primary: true,
pinned: true,
floating: true,
forceElevated: false,
toolbarHeight: 0,
foregroundColor: Colors.transparent,
backgroundColor: Colors.transparent,
expandedHeight: 372.sp + (logic.userInfoBean != null
? logic.userInfoBean!.wx_num!.isNotEmpty
? 59.sp : 0 : 0),
bottom: PreferredSize(
preferredSize: Size(Get.width,40),
child: titleTab(logic),
),
flexibleSpace: FlexibleSpaceBar(
expandedTitleScale: 1.0,
centerTitle: true,
title: buildContent(logic),
),
)
];
},
body: contentWidget(logic),
// slivers: [
// SliverAppBar(
// leadingWidth: 0,
// titleSpacing: 0,
// title: buildContent(logic),
// toolbarHeight: 500.sp,
// backgroundColor: Colors.transparent,
// ),
// SliverPadding(
// padding: EdgeInsets.zero,
// sliver: SliverList(delegate:
// SliverChildBuilderDelegate((context, index) {
// // if (index == 0) {
// // return buildContent(logic);
// // }
// return contentWidget(logic);
// },childCount: 1),))
//
// // (delegate: (BuildContext context, int index) {
// // return contentWidget(logic);
// // }),
//
// // buildContent(logic),
// ]
)),
Positioned( Positioned(
bottom: 27.sp, bottom: 27.sp,
width: Get.width, width: Get.width,
child: _meInfoButton(logic), child: _meInfoButton(logic),
), ),
!logic.isShowAlbum &&logic.isMe ? Positioned( !logic.isShowAlbum && logic.isMe
bottom: 36.sp, ? Positioned(
right: 10.sp, bottom: 36.sp,
child: GestureDetector( right: 10.sp,
onTap: () async { child: GestureDetector(
onTap: () async {
List<MyConfigData> numbers = [];
List<MyConfigData> numbers = []; var data = await Get.toNamed(AppRoutes.Call_out,
arguments: {'numbers': numbers});
var data = await Get.toNamed( },
AppRoutes.Call_out, child: Image.asset(
arguments: {'numbers': numbers}); getCircleImage('send_msg'),
}, width: 60.sp,
child: Image.asset( )))
getCircleImage('send_msg'), : Container()
width: 60.sp,
))):Container()
], ],
), ),
), ),
], ],
), ),
); );
@ -342,11 +434,15 @@ class MyTabbedScreenState extends State<UserinfoPage>
final interests = userInfoBean?.interests ?? []; final interests = userInfoBean?.interests ?? [];
return Container( return Container(
// color: Colors.red,
width: Get.width,
// height: Get.height,
padding: EdgeInsets.symmetric(vertical: 14.sp), padding: EdgeInsets.symmetric(vertical: 14.sp),
child: Column( child: Column(
children: [ children: [
Container( Container(
padding: EdgeInsets.symmetric(horizontal: 19.sp), height: 58.sp,
padding: EdgeInsets.symmetric(horizontal: 15.sp),
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -359,7 +455,7 @@ class MyTabbedScreenState extends State<UserinfoPage>
), ),
Container( Container(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
horizontal: 19.sp, horizontal: 15.sp,
), ),
margin: EdgeInsets.only(top: 19.sp), margin: EdgeInsets.only(top: 19.sp),
child: Row( child: Row(
@ -369,7 +465,7 @@ class MyTabbedScreenState extends State<UserinfoPage>
children: [ children: [
Text( Text(
userInfoBean?.nickname ?? "", userInfoBean?.nickname ?? "",
style: TextStyle( style: TextStyle(
color: Color.fromRGBO(247, 250, 250, 1.0), color: Color.fromRGBO(247, 250, 250, 1.0),
fontSize: 14.sp, fontSize: 14.sp,
), ),
@ -410,35 +506,42 @@ class MyTabbedScreenState extends State<UserinfoPage>
), ),
), ),
SizedBox( SizedBox(
height: 59.sp, height: 78.sp,
child: logic.isBlack || logic.isDestroy || logic.isBlackBeen child: logic.isBlack || logic.isDestroy || logic.isBlackBeen
? Container() ? Container()
: _buildInterestsListView(interests), : _buildInterestsListView(interests),
), ),
if (!logic.isMe) if (!logic.isMe)
logic.userInfoBean != null ? logic.userInfoBean!.wx_num!.isNotEmpty ? Container( logic.userInfoBean != null
alignment: Alignment.centerLeft, ? logic.userInfoBean!.wx_num!.isNotEmpty
// width: 200.sp, ? Container(
// color: Colors.red, alignment: Alignment.centerLeft,
margin: EdgeInsets.only(left: 20.sp,bottom: 15.sp), // width: 200.sp,
child: Row( // color: Colors.red,
mainAxisAlignment: MainAxisAlignment.start, margin: EdgeInsets.only(left: 15.sp, bottom: 15.sp),
children: [ child: Row(
wxStatusWidget(logic.unLockWxNum == 1,logic.userInfoBean!.wx_num, logic.userInfoBean!.id.toString(),logic.userInfoBean!.avatar!, (){}), mainAxisAlignment: MainAxisAlignment.start,
], children: [
)) : Container() : Container(), wxStatusWidget(
logic.unLockWxNum == 1,
logic.userInfoBean!.wx_num,
logic.userInfoBean!.id.toString(),
logic.userInfoBean!.avatar!,
() {}),
],
))
: Container()
: Container(),
if (logic.userInfoBean != null && logic.giftList.isNotEmpty) if (logic.userInfoBean != null && logic.giftList.isNotEmpty)
GestureDetector( GestureDetector(
onTap: () async { onTap: () async {
var result = await Get.toNamed(AppRoutes.GiftShopPage, var result = await Get.toNamed(AppRoutes.GiftShopPage,
arguments: logic.imId.split('_').last); arguments: logic.userId);
logic.loadGiftListData(); logic.loadGiftListData();
}, },
child: Container( child: Container(
margin: EdgeInsets.only(top: 0.sp,left: 15.sp,right: 15.sp), margin: EdgeInsets.only(
top: 0.sp, left: 15.sp, right: 10.sp, bottom: 10.sp),
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: 12.sp, right: 12.sp, bottom: 18.sp, top: 16.sp), left: 12.sp, right: 12.sp, bottom: 18.sp, top: 16.sp),
height: 144.sp, height: 144.sp,
@ -486,107 +589,125 @@ class MyTabbedScreenState extends State<UserinfoPage>
), ),
Expanded( Expanded(
child: Container( child: Container(
margin: EdgeInsets.only(top: 10.sp), margin: EdgeInsets.only(top: 10.sp),
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
child: ListView.builder( child: ListView.builder(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
itemCount: logic.giftList.length, itemCount: logic.giftList.length,
itemBuilder: (BuildContext context, int giftIndex) { itemBuilder: (BuildContext context, int giftIndex) {
var info = logic.giftList[giftIndex]; var info = logic.giftList[giftIndex];
bool isGet = false; bool isGet = false;
int num = 0; int num = 0;
logic.recevigiftList.forEach((element) { logic.recevigiftList.forEach((element) {
if (element['giftId'] == info['id']) { if (element['giftId'] == info['id']) {
isGet = true; isGet = true;
num = element['num']; num = element['num'];
} }
}); });
return GestureDetector( return GestureDetector(
onTap: () {}, onTap: () {},
child: Container( child: Container(
margin: EdgeInsets.only(right: 10.sp), margin: EdgeInsets.only(right: 10.sp),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Stack(children: [ Stack(children: [
Opacity( Opacity(
opacity: !isGet ? 0.5 : 1, opacity: !isGet ? 0.5 : 1,
child: Image.network( child: Image.network(
info['icon'], info['icon'],
width: 50.sp, width: 50.sp,
height: 50.sp, height: 50.sp,
fit: BoxFit.cover, fit: BoxFit.cover,
),
),
]),
SizedBox(
height: 6.sp,
), ),
GestureDetector( ),
onTap: () { ]),
logic.sendGiftData( SizedBox(
logic.imId, height: 6.sp,
info['id'].toString(),
logic.imId.split('_').last,
);
},
child: Container(
height: 20.sp,
width: 52.sp,
// padding: EdgeInsets.only(left: 5.sp,right: 5.sp),
alignment: Alignment.center,
decoration: BoxDecoration(
gradient: AppColor
.mainVerLinearGradient,
borderRadius:
BorderRadius.circular(10.sp)),
child: Text(
!isGet ? '点亮' : '赠送',
style: TextStyle(
color: Colors.white,
fontSize: 11.sp),
),
),
)
],
), ),
), GestureDetector(
); onTap: () {
}), logic.sendGiftData(
)) logic.imId,
info['id'].toString(),
logic.imId.split('_').last,
);
},
child: Container(
height: 20.sp,
width: 52.sp,
// padding: EdgeInsets.only(left: 5.sp,right: 5.sp),
alignment: Alignment.center,
decoration: BoxDecoration(
gradient:
AppColor.mainVerLinearGradient,
borderRadius:
BorderRadius.circular(10.sp)),
child: Text(
!isGet ? '点亮' : '赠送',
style: TextStyle(
color: Colors.white,
fontSize: 11.sp),
),
),
)
],
),
),
);
}),
))
], ],
), ),
), ),
), ),
// titleTab(controller),
titleTab(controller),
Expanded(
child: PageView(
controller: _pageController,
onPageChanged: (index) {
_tabController.animateTo(index);
},
children: [
logic.isBlack || logic.isDestroy || logic.isBlackBeen
? Container()
: _imageAdapter(controller),
logic.isBlack || logic.isDestroy || logic.isBlackBeen
? Container()
: HomeCallOutView(controller.userId),
],
),
),
], ],
), ),
); );
// Expanded(
// child: PageView(
// controller: _pageController,
// onPageChanged: (index) {
// _tabController.animateTo(index);
// },
// children: [
// logic.isBlack || logic.isDestroy || logic.isBlackBeen
// ? Container()
// : _imageAdapter(controller),
// logic.isBlack || logic.isDestroy || logic.isBlackBeen
// ? Container()
// : HomeCallOutView(controller.userId),
// ],
// ),
// ),
}
contentWidget(UserinfoLogic controller) {
return TabBarView(
controller: _tabController,
// controller: _pageController,
// onPageChanged: (index) {
// _tabController.animateTo(index);
// },
children: [
logic.isBlack || logic.isDestroy || logic.isBlackBeen
? Container()
: _imageAdapter(controller),
logic.isBlack || logic.isDestroy || logic.isBlackBeen
? Container()
: HomeCallOutView(controller.userId),
],
);
} }
Widget _buildInterestsListView(List<Interest> interests) { Widget _buildInterestsListView(List<Interest> interests) {
return ListView.builder( return ListView.builder(
itemCount: interests.length, itemCount: interests.length,
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
padding: EdgeInsets.symmetric(vertical: 18.sp, horizontal: 19.sp), padding: EdgeInsets.symmetric(vertical: 15.sp, horizontal: 15.sp),
itemBuilder: (context, index) { itemBuilder: (context, index) {
final interest = interests[index]; final interest = interests[index];
return GestureDetector( return GestureDetector(
@ -597,7 +718,7 @@ class MyTabbedScreenState extends State<UserinfoPage>
child: Container( child: Container(
margin: EdgeInsets.only(right: 11.sp), margin: EdgeInsets.only(right: 11.sp),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(17.0), borderRadius: BorderRadius.circular(8.0),
gradient: const LinearGradient( gradient: const LinearGradient(
colors: [ colors: [
Color(0xFF06F9FA), Color(0xFF06F9FA),
@ -607,29 +728,48 @@ class MyTabbedScreenState extends State<UserinfoPage>
color: const Color(0xFF392D53), color: const Color(0xFF392D53),
), ),
child: Container( child: Container(
margin: EdgeInsets.all(0.2.sp), margin: EdgeInsets.all(0.2.sp),
decoration: BoxDecoration( padding: EdgeInsets.only(left: 5.sp, right: 0.sp, top: 5.sp),
borderRadius: BorderRadius.circular(17.0), decoration: BoxDecoration(
color: const Color(0xFF392D53), borderRadius: BorderRadius.circular(8.0),
), color: const Color(0xFF392D53),
child: Padding(
padding: EdgeInsets.only(
top: 2.sp,
bottom: 2.sp,
left: 15.sp,
right: 15.sp,
), ),
child: Center( child: Column(
child: Text( crossAxisAlignment: CrossAxisAlignment.start,
interest.title, children: [
style: const TextStyle( Container(
fontSize: 11.0, // color: Colors.red,
color: Colors.white, child: Row(
children: [
Text(
interest.title,
style: TextStyle(
fontSize: 13.sp,
color: Colors.white,
),
),
Container(
margin: EdgeInsets.only(
bottom: 2.sp,
),
child: Icon(
Icons.keyboard_arrow_right,
color: Colors.white,
size: 18.sp,
),
)
],
),
), ),
), Text(
), '${interest.viewTotal}人看过',
), style: TextStyle(
), fontSize: 13.sp,
color: AppColor.mainColor,
),
),
],
)),
), ),
); );
}, },
@ -650,7 +790,7 @@ class MyTabbedScreenState extends State<UserinfoPage>
} }
return Container( return Container(
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
padding: EdgeInsets.symmetric(horizontal: 10.sp), padding: EdgeInsets.only(left: 0, right: 10.sp),
height: 27.sp, height: 27.sp,
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -663,7 +803,7 @@ class MyTabbedScreenState extends State<UserinfoPage>
color: const Color(0xFF00FFF4), color: const Color(0xFF00FFF4),
width: 2.sp, width: 2.sp,
), ),
insets: EdgeInsets.symmetric(horizontal: 6.0.sp), insets: EdgeInsets.symmetric(horizontal: 12.0.sp),
borderRadius: BorderRadius.circular(18.0), borderRadius: BorderRadius.circular(18.0),
), ),
indicatorColor: const Color(0xFF00FFF4), indicatorColor: const Color(0xFF00FFF4),
@ -677,57 +817,62 @@ class MyTabbedScreenState extends State<UserinfoPage>
), ),
Tab(text: "喊话"), Tab(text: "喊话"),
], ],
onTap: (index) { // onTap: (index) {
_pageController.animateToPage( // _pageController.animateToPage(
index, // // index, //
duration: const Duration(milliseconds: 300), // // duration: const Duration(milliseconds: 300), //
curve: Curves.ease, // 线 // curve: Curves.ease, // 线
); // );
}, // },
), ),
logic.isBlack||logic.isDestroy||logic.isBlackBeen?Container(): _tabController.index == 0 ? GestureDetector( logic.isBlack || logic.isDestroy || logic.isBlackBeen
onTap: () { ? Container()
if(!logic.isShowAlbum&&controller.isMe){ : _tabController.index == 0
List<MyConfigData> numbers = []; ? GestureDetector(
var data = Get.toNamed(AppRoutes.Call_out, arguments: {'numbers': numbers}); onTap: () {
return ; if (!logic.isShowAlbum && controller.isMe) {
} List<MyConfigData> numbers = [];
if (controller.isMe) { var data = Get.toNamed(AppRoutes.Call_out,
controller.isEdit = !controller.isEdit; arguments: {'numbers': numbers});
controller.update(); return;
} else { }
controller.urgeChange(); if (controller.isMe) {
} controller.isEdit = !controller.isEdit;
}, controller.update();
child: Visibility( } else {
// visible: logic.isShowAlbum, controller.urgeChange();
child: Container( }
margin: EdgeInsets.only(left: 10.sp), },
decoration: BoxDecoration( child: Visibility(
borderRadius: BorderRadius.circular(17), // visible: logic.isShowAlbum,
gradient: const LinearGradient( child: Container(
colors: [ margin: EdgeInsets.only(left: 10.sp),
Color(0xFF06F9FA), decoration: BoxDecoration(
Color(0xFFDC5BFD), borderRadius: BorderRadius.circular(17),
], gradient: const LinearGradient(
begin: Alignment.centerLeft, colors: [
end: Alignment.centerRight, Color(0xFF06F9FA),
), Color(0xFFDC5BFD),
), ],
padding: EdgeInsets.symmetric( begin: Alignment.centerLeft,
vertical: 2.sp, end: Alignment.centerRight,
horizontal: 12.sp, ),
), ),
child: Text( padding: EdgeInsets.symmetric(
buttonText, vertical: 2.sp,
style: const TextStyle( horizontal: 12.sp,
color: Colors.white, ),
fontSize: 12, child: Text(
), buttonText,
), style: const TextStyle(
), color: Colors.white,
), fontSize: 12,
) : Container(), ),
),
),
),
)
: Container(),
], ],
), ),
); );
@ -738,6 +883,7 @@ class MyTabbedScreenState extends State<UserinfoPage>
// : // :
return Container( return Container(
margin: EdgeInsets.only(top: isSetState ? 40.sp : 0.sp),
padding: EdgeInsets.symmetric(horizontal: 19.sp), padding: EdgeInsets.symmetric(horizontal: 19.sp),
child: Stack( child: Stack(
children: [ children: [
@ -757,7 +903,7 @@ class MyTabbedScreenState extends State<UserinfoPage>
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
const SizedBox( const SizedBox(
height: 100, height: 30,
), ),
Image.asset( Image.asset(
getBaseImage('no_result'), getBaseImage('no_result'),
@ -784,20 +930,20 @@ 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 // ? controller.state.imaglist.length
? controller.state.imaglist.length+1 ? controller.state.imaglist.length + 1
: controller.state.imaglist.length , : controller.state.imaglist.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
// print("123123123123"); // print("123123123123");
if (controller.isMe ) { if (controller.isMe) {
if (index == 0) { if (index == 0) {
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {
if(controller.state.imaglist.length >= 15){ if (controller.state.imaglist.length >= 15) {
showOKToast("最大只可上传15张图片哦~"); showOKToast("最大只可上传15张图片哦~");
return ; return;
} }
controller.getImageFile(); controller.getImageFile();
}, },
@ -902,7 +1048,7 @@ class MyTabbedScreenState extends State<UserinfoPage>
? controller.userInfoBean!.signature ? controller.userInfoBean!.signature
: "", : "",
maxLines: 2, maxLines: 2,
style: const TextStyle(color: Colors.white), style: TextStyle(color: Colors.white,fontSize: 15.sp),
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
), ),
), ),
@ -1377,3 +1523,12 @@ class MyTabbedScreenState extends State<UserinfoPage>
); );
} }
} }
class ScrollViewIsEnd {
bool isEnd;
ScrollViewIsEnd(this.isEnd);
}
class ScrollViewScrollTop {
}

View File

@ -3,6 +3,7 @@ import 'package:circle_app/app/circle/state.dart';
import 'package:circle_app/app/circle/widgets/video_item.dart'; import 'package:circle_app/app/circle/widgets/video_item.dart';
import 'package:circle_app/app/userinfo/widgets/home_call_out_logic.dart'; import 'package:circle_app/app/userinfo/widgets/home_call_out_logic.dart';
import 'package:circle_app/router/app_routers.dart'; import 'package:circle_app/router/app_routers.dart';
import 'package:circle_app/util/eventBus.dart';
import 'package:circle_app/util/util.dart'; import 'package:circle_app/util/util.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -11,6 +12,8 @@ import 'package:get/get.dart';
import 'package:get/get_core/src/get_main.dart'; import 'package:get/get_core/src/get_main.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import '../view.dart';
class HomeCallOutView extends StatefulWidget { class HomeCallOutView extends StatefulWidget {
// Get.lazyPut(() => ListLogic()); // Get.lazyPut(() => ListLogic());
@ -27,19 +30,46 @@ class _HomeCallOutViewState extends State<HomeCallOutView> with AutomaticKeepAli
bool get wantKeepAlive => true; bool get wantKeepAlive => true;
HomeCallOutLogic? listsLg; HomeCallOutLogic? listsLg;
bool isEnd = false;
var sub;
@override @override
void initState() { void initState() {
// TODO: implement initState // TODO: implement initState
super.initState(); super.initState();
sub = EventBusManager.on<ScrollViewIsEnd>().listen((event) {
if (event.isEnd) {
isEnd = true;
setState(() {
});
} else {
isEnd = false;
setState(() {
});
}
});
Get.lazyPut(() => HomeCallOutLogic()); Get.lazyPut(() => HomeCallOutLogic());
listsLg = Get.find<HomeCallOutLogic>(); listsLg = Get.find<HomeCallOutLogic>();
listsLg?.loadCallOutListData(widget.userId); listsLg?.loadCallOutListData(widget.userId);
listsLg!.scrollController.addListener(() {
if (listsLg!.scrollController.offset < 0) {
EventBusManager.fire(ScrollViewScrollTop());
isEnd = false;
setState(() {
});
}
});
} }
@override @override
void dispose() { void dispose() {
// TODO: implement dispose // TODO: implement dispose
super.dispose(); super.dispose();
sub.cancel();
listsLg?.onClose(); listsLg?.onClose();
} }
@ -48,61 +78,46 @@ class _HomeCallOutViewState extends State<HomeCallOutView> with AutomaticKeepAli
return GetBuilder<HomeCallOutLogic>( return GetBuilder<HomeCallOutLogic>(
assignId: true, assignId: true,
builder: (listLogic) { builder: (listLogic) {
return ClipRRect( return listLogic.lists.isEmpty?Center(
borderRadius: BorderRadius.circular(10.sp), child: Image.asset(
child: listLogic.lists.isEmpty?Center( getBaseImage('no_result'),
child: Image.asset( width: 200,
getBaseImage('no_result'), // height: 11,
width: 200, ),
// height: 11, ): Container(
), width: Get.width,
): Container( margin: EdgeInsets.only(top: isEnd ? 40.sp : 0.sp),
width: Get.width, child: listLogic.lists.isEmpty
child: Stack( ? loaddingWidget(true)
children: [ : ListView.builder(
Container( // physics: const AlwaysScrollableScrollPhysics(),
height: Get.height, physics: isEnd ? AlwaysScrollableScrollPhysics() : NeverScrollableScrollPhysics(),
width: Get.width, // shrinkWrap:true,
margin: EdgeInsets.only( padding: EdgeInsets.only(
// bottom: MediaQuery.of(context).padding.bottom + 56.sp, bottom: MediaQuery.of(context).padding.bottom + 56.sp),
left: 19.sp,
right: 19.sp), scrollDirection: Axis.vertical,
child: RefreshIndicator( controller: listLogic.scrollController,
onRefresh: () async { itemCount: listLogic.lists.length + 1,
listLogic.refreshData(); itemBuilder: (context, index) {
}, if (listLogic.lists.length > index) {
child: listLogic.lists.isEmpty Lists lists = listLogic.lists[index];
? loaddingWidget(true) if (lists.isQueen!) {
: ListView.builder( return vipDynamicItem(lists);
padding: EdgeInsets.only( } else {
bottom: MediaQuery.of(context).padding.bottom + 56.sp), return normalDynamicItem(lists);
physics: const AlwaysScrollableScrollPhysics(), }
scrollDirection: Axis.vertical, } else {
controller: listLogic.scrollController, return Container(
itemCount: listLogic.lists.length + 1, margin: EdgeInsets.only(
itemBuilder: (context, index) { top: listLogic.callOutMore
if (listLogic.lists.length > index) { ? 0
Lists lists = listLogic.lists[index]; : 10.sp),
if (lists.isQueen!) { child:
return vipDynamicItem(lists); loaddingWidget(listLogic.callOutMore),
} else { );
return normalDynamicItem(lists); }
} }));
} else {
return Container(
margin: EdgeInsets.only(
top: listLogic.callOutMore
? 0
: 10.sp),
child:
loaddingWidget(listLogic.callOutMore),
);
}
}),
),
),
],
)));
}, },
); );
} }

View File

@ -62,7 +62,7 @@ class _RechargeScreenDialogState extends State<RechargeScreenDialog> {
response.forEach((element) { response.forEach((element) {
AssetsDataDataPriceConfs item = AssetsDataDataPriceConfs.fromJson(element); AssetsDataDataPriceConfs item = AssetsDataDataPriceConfs.fromJson(element);
if (walletRechargeSelectItemBos.isEmpty) { if (walletRechargeSelectItemBos.length == 1) {
item.isSelected = true; item.isSelected = true;
} }
walletRechargeSelectItemBos.add(item); walletRechargeSelectItemBos.add(item);
@ -324,7 +324,7 @@ class _RechargeScreenDialogState extends State<RechargeScreenDialog> {
), ),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
// navigateToPriceAgreement(); navigateToItem();
}, },
child: Text( child: Text(
'《小票充值协议》', '《小票充值协议》',

View File

@ -311,7 +311,8 @@ class _CircleShareState extends State<CircleShare> {
var info = lists[index]; var info = lists[index];
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {
sendCircleCustomMsg( 'qpqz_dev_0_'+ info.user.id.toString(), jsonEncode(widget.bean.toJson()), '分享[${widget.bean.title}]'); sendCircleCustomMsg(info.user.imId,
jsonEncode(widget.bean.toJson()), '分享[${widget.bean.title}]');
}, },
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
child: Container( child: Container(

View File

@ -41,7 +41,7 @@ wxStatusWidget(bool isUnclock, String wx, String userId, String avatarUrl,
}, },
child: Container( child: Container(
height: 42.sp, height: 42.sp,
width: (isUnclock ? 60.sp : 100.sp) + textWidth, width: (isUnclock ? 60.sp : 102.sp) + textWidth,
decoration: BoxDecoration( decoration: BoxDecoration(
gradient: const LinearGradient( gradient: const LinearGradient(
colors: [ colors: [

View File

@ -12,6 +12,7 @@ class Api {
// //
static const login = 'user-service/login/smscode'; static const login = 'user-service/login/smscode';
// //
static const new_login = 'user-service/login/password'; static const new_login = 'user-service/login/password';
@ -20,7 +21,6 @@ class Api {
static const getqiniuToken = 'up-service/oss/token'; static const getqiniuToken = 'up-service/oss/token';
// //
static const UpdataUserInfo = 'user-service/register/user/info'; static const UpdataUserInfo = 'user-service/register/user/info';
@ -37,39 +37,26 @@ class Api {
static const queryUnlockPrice = '/mall-service/wxNum/unlock/queryUnlockPrice'; static const queryUnlockPrice = '/mall-service/wxNum/unlock/queryUnlockPrice';
// //
static const postAliPayOrder = 'mall-service/alipay/order'; static const postAliPayOrder = 'mall-service/alipay/order';
// //
static const postWxOrder = 'mall-service/wxpay/order'; static const postWxOrder = 'mall-service/wxpay/order';
//vip状态 //vip状态
static const getVipStatus = 'mall-service/my/vip'; static const getVipStatus = 'mall-service/my/vip';
//token //token
static const refreshToken = 'user-service/login/token/refresh'; static const refreshToken = 'user-service/login/token/refresh';
// //
static const getCircleInterests = 'up-service/interest/interests'; static const getCircleInterests = 'up-service/interest/interests';
// //
static const APP_VERSION = 'user-service/app/version'; static const APP_VERSION = 'user-service/app/version';
@ -81,15 +68,14 @@ class Api {
static const SendShout = 'up-service/callout'; static const SendShout = 'up-service/callout';
//mine //mine
static const getUserMine = 'user-service/my/main'; static const getUserMine = 'user-service/my/main';
//vip弹窗 //vip弹窗
static const getIsVips = 'mall-service/vips/show/'; static const getIsVips = 'mall-service/vips/show/';
//IM状态 //IM状态
static const imstate = '/user-service/user/im/state'; static const imstate = '/user-service/user/im/state';
@ -125,8 +111,6 @@ class Api {
static const blackList = 'user-service/blacklist/users'; static const blackList = 'user-service/blacklist/users';
// //
static const getMyAlbum = 'up-service/my/albums'; static const getMyAlbum = 'up-service/my/albums';
@ -139,31 +123,22 @@ class Api {
static const updataAlbum = 'up-service/album'; static const updataAlbum = 'up-service/album';
// //
static const deleteAlbum = 'up-service/album/'; static const deleteAlbum = 'up-service/album/';
//Ta的相册 //Ta的相册
static const urgeAlbum = 'up-service/user/'; static const urgeAlbum = 'up-service/user/';
// //
static const getUrgeStatus = 'up-service/user/'; static const getUrgeStatus = 'up-service/user/';
// //
static const followList = 'user-service/follow/users'; static const followList = 'user-service/follow/users';
// //
static const fansList = 'user-service/fans/users'; static const fansList = 'user-service/fans/users';
@ -172,76 +147,34 @@ class Api {
static const visitList = 'user-service/visit/users'; static const visitList = 'user-service/visit/users';
// //
static const postReport = 'up-service/report'; static const postReport = 'up-service/report';
// //
static const getFeedBack = 'up-service/feedback'; static const getFeedBack = 'up-service/feedback';
// //
static const getFeedBackList = 'up-service/my/feedbacks'; static const getFeedBackList = 'up-service/my/feedbacks';
// //访 // //访
// static const getInterestList = 'up-service/interest/20/users'; // static const getInterestList = 'up-service/interest/20/users';
// //
static const getQuestions = 'up-service/guide/feedback/questions'; static const getQuestions = 'up-service/guide/feedback/questions';
//banner //banner
static const getNearbyBeanner = 'user-service/nearby/banner'; static const getNearbyBeanner = 'user-service/nearby/banner';
// //
static const postNearbyList = 'user-service/nearby/queryNearByUserList'; static const postNearbyList = 'user-service/nearby/queryNearByUserList';
//IM配置信息 //IM配置信息
static const getIMInfo = 'msg-service/im/token'; static const getIMInfo = 'msg-service/im/token';
@ -252,10 +185,13 @@ class Api {
// /up-service/my/interests /up-service/interest/statistics // /up-service/my/interests /up-service/interest/statistics
static const getMyCircleInterests = 'up-service/my/interests'; static const getMyCircleInterests = 'up-service/my/interests';
// //
static const getMyCircleAll = '/up-service/my/interests/all'; static const getMyCircleAll = '/up-service/my/interests/all';
// //
static const getMatch = 'msg-service/im/chat/match'; static const getMatch = 'msg-service/im/chat/match';
// //
static const getNotices = 'msg-service/system/notices'; static const getNotices = 'msg-service/system/notices';
@ -307,13 +243,16 @@ class Api {
// //
static const circleTop = '/up-service/interest/top'; static const circleTop = '/up-service/interest/top';
// //
static const hideWxNum = '/user-service/hideWxNum/'; static const hideWxNum = '/user-service/hideWxNum/';
// //
static const showPositiveFeedBack = '/up-service/showPositiveFeedBack'; static const showPositiveFeedBack = '/up-service/showPositiveFeedBack';
// //
static const walletRechargeSelectItem = '/mall-service/wallet/walletRechargeConfig'; static const walletRechargeSelectItem = '/mall-service/wallet/walletRechargeConfig';
// //
static const userAsset = '/mall-service/wallet/userAsset'; static const userAsset = '/mall-service/wallet/userAsset';
@ -327,7 +266,7 @@ class Api {
// //
static const giftList = '/mall-service/gift/giftMall'; static const giftList = '/mall-service/gift/giftMall';
// //
static const giftHall = '/mall-service/gift/giftHall/'; static const giftHall = '/mall-service/gift/giftHall/';
// //
@ -352,4 +291,15 @@ class Api {
// //
static const msgRandOne = '/msg-service/message/hello_word/randOne'; static const msgRandOne = '/msg-service/message/hello_word/randOne';
//
static const checkWxNumState = '/user-service/user/updateWxNum/state';
//
static const chatRecord = '/msg-service/message/chat/log/save';
//
static const chatRecommendFriend = '/msg-service/im/chat/recommend';
//
static const isShow_give_gift = '/msg-service/message/show_give_gift/';
} }

View File

@ -233,7 +233,6 @@ class DioManager {
pushLoginPage(); pushLoginPage();
} else { } else {
switch (responseMap["code"]) { switch (responseMap["code"]) {
case 4000:
case 4001: case 4001:
case 4002: case 4002:
case 4003: case 4003:
@ -247,7 +246,7 @@ class DioManager {
pushLoginPage(); pushLoginPage();
break; break;
} }
if (responseMap["code"] != 200 && responseMap["code"] != 10000) { if (responseMap["code"] != 200 && responseMap["code"] != 10000 && !url.contains(Api.checkWxNumState)) {
showOKToast(responseMap['msg']); showOKToast(responseMap['msg']);
} }
} }

View File

@ -56,7 +56,13 @@ class CommentBlackMoreEvent {
class CallRefreshCircle { class CallRefreshCircle {
String circleId = ""; String circleId = "";
CallRefreshCircle(String id); CallRefreshCircle(this.circleId);
}
class CircleInfoRefresh {
String circleId = "";
CircleInfoRefresh(this.circleId);
} }
class ScrollToTop { class ScrollToTop {

View File

@ -115,6 +115,7 @@ class IOSPayment {
} }
logic.update(); logic.update();
} }
EventBusManager.fire(CircleInfoRefresh(typeId));
} else if (type == 2) { } else if (type == 2) {
if (target_id.isNotEmpty) { if (target_id.isNotEmpty) {
showOKToast('赠送会员成功'); showOKToast('赠送会员成功');

View File

@ -411,6 +411,14 @@ void navigateToPartnerAgreement() {
}); });
} }
//
void navigateToItem() {
Get.toNamed(AppRoutes.WebViewActivity, arguments: {
'title': "小票充值协议",
"url":'https://www.iquanpai.com/app-h5/4_173.html'
});
}
// //
void navigateToInviteStrategy() { void navigateToInviteStrategy() {
Get.toNamed(AppRoutes.WebViewActivity, arguments: { Get.toNamed(AppRoutes.WebViewActivity, arguments: {
@ -515,6 +523,20 @@ createCustomMsg(String userId, String imId) async {
String cityStr = ''; String cityStr = '';
Map<String, dynamic> info = {}; Map<String, dynamic> info = {};
// 100
// ·90
// ·TA80
// ·70
// ·260
// ·50
// ·TA40
// ·TA是乐园优秀圈主哦30
var titleList = [];
var recommendCircleFriendData = data['data'];
if (data['data']['both_interests'] != null) { if (data['data']['both_interests'] != null) {
List<dynamic> both_interests = data['data']['both_interests']; List<dynamic> both_interests = data['data']['both_interests'];
List<String> circleList = []; List<String> circleList = [];
@ -543,8 +565,8 @@ createCustomMsg(String userId, String imId) async {
if (data['data']['both_cities'] != null) { if (data['data']['both_cities'] != null) {
info['city'] = cityStr; info['city'] = cityStr;
} }
info['title'] = recommendCircleFriendData;
info['interests'] = data['data']['interests'] ?? []; info['interests'] = data['data']['interests'] ?? [];
info['guide_text'] = data['data']['guide_text'] ?? '';
info['my'] = data['data']['my'] ?? ''; info['my'] = data['data']['my'] ?? '';
info['myInterests'] = data['data']['myInterests'] ?? []; info['myInterests'] = data['data']['myInterests'] ?? [];
info['user'] = data['data']['user']; info['user'] = data['data']['user'];
@ -649,8 +671,17 @@ sendCircleCustomMsg(String userId, String data, String desc) async {
); );
if (createCustomMessageRes.code == 0) { if (createCustomMessageRes.code == 0) {
String? id = createCustomMessageRes.data?.id; String? id = createCustomMessageRes.data?.id;
// V2TimValueCallback<V2TimMessage> sendMessageRes = await TencentImSDKPlugin
EventBusManager.fire(SendCoustomMessage(createCustomMessageRes)); .v2TIMManager
.getMessageManager()
.sendMessage(id: id!, receiver: userId, groupID: '');
if (sendMessageRes.code == 0) {
//
showOKToast('发送成功');
sendMessageRes.data?.customElem?.data; //data
sendMessageRes.data?.customElem?.desc; //desc
sendMessageRes.data?.customElem?.extension; //extension
}
} }
} }