一些细节问题 和上架相关的问题
This commit is contained in:
parent
c5e5003aa5
commit
71ea3d19ad
@ -13,12 +13,12 @@ if (flutterRoot == null) {
|
||||
|
||||
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
|
||||
if (flutterVersionCode == null) {
|
||||
flutterVersionCode = '1'
|
||||
flutterVersionCode = '2'
|
||||
}
|
||||
|
||||
def flutterVersionName = localProperties.getProperty('flutter.versionName')
|
||||
if (flutterVersionName == null) {
|
||||
flutterVersionName = '1.0'
|
||||
flutterVersionName = '1.0.1'
|
||||
}
|
||||
|
||||
apply plugin: 'com.android.application'
|
||||
@ -65,17 +65,17 @@ android {
|
||||
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
|
||||
minSdkVersion 21
|
||||
targetSdkVersion flutter.targetSdkVersion
|
||||
versionCode flutterVersionCode.toInteger()
|
||||
versionName flutterVersionName
|
||||
versionCode 1
|
||||
versionName "1.0.0"
|
||||
manifestPlaceholders = [
|
||||
vivo_APPID: "105669716",
|
||||
vivo_APPKEY:"84f750207787376b310ca5b0d5969122",
|
||||
]
|
||||
|
||||
// ndk {
|
||||
// abiFilters 'armeabi-v7a', 'arm64-v8a'
|
||||
// ldLibs "log"
|
||||
// }
|
||||
ndk {
|
||||
abiFilters 'armeabi-v7a', 'arm64-v8a'
|
||||
ldLibs "log"
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
|
||||
@ -2,9 +2,11 @@ import 'package:circle_app/network/dio_manager.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:tencent_cloud_chat_uikit/tencent_cloud_chat_uikit.dart';
|
||||
|
||||
import '../../util/eventBus.dart';
|
||||
import 'state.dart';
|
||||
|
||||
class ChatLogic extends GetxController {
|
||||
|
||||
final ChatState state = ChatState();
|
||||
V2TimConversation? selectedConversation;
|
||||
|
||||
@ -15,6 +17,7 @@ class ChatLogic extends GetxController {
|
||||
selectedConversation = Get.arguments;
|
||||
}
|
||||
|
||||
|
||||
sendData() async {
|
||||
var data = await DioManager.instance.get(url: 'url',params: {});
|
||||
}
|
||||
|
||||
@ -29,6 +29,12 @@ class _ChatPageState extends State<ChatPage> {
|
||||
// final logic = Get.find<ChatLogic>();
|
||||
//
|
||||
// final state = Get.find<ChatLogic>().state;
|
||||
@override
|
||||
void dispose() {
|
||||
// TODO: implement dispose
|
||||
EventBusManager.fire(RefreshUnread());
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
final TIMUIKitChatController _timuiKitChatController =
|
||||
TIMUIKitChatController();
|
||||
@ -44,6 +50,7 @@ class _ChatPageState extends State<ChatPage> {
|
||||
}
|
||||
|
||||
|
||||
|
||||
initEventBus()async{
|
||||
EventBusManager.on<SendCoustomMessage>().listen((event) async{
|
||||
V2TimValueCallback<V2TimMessage>? sendMessageRes =
|
||||
|
||||
@ -16,6 +16,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get_core/src/get_main.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
import '../../../util/SharedPreferencesHelper.dart';
|
||||
import '../../../util/eventBus.dart';
|
||||
@ -194,6 +195,17 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
if (widget.bean.is_limit&&widget.bean.amount>0) {
|
||||
showJoinCiclePiker(cicleId,widget.bean.amount.toString(),widget.bean.oldAmount.toString(),2,(payResult){
|
||||
widget.bean.is_limit = false;
|
||||
if (Get.isRegistered<CircleLogic>()) {
|
||||
var logic = Get.find<CircleLogic>();
|
||||
for (var element in logic.circle.lists) {
|
||||
if (element.id == widget.bean.id) {
|
||||
element.is_limit = false;
|
||||
element.isJoin = true;
|
||||
}
|
||||
}
|
||||
logic.update();
|
||||
}
|
||||
Get.back();
|
||||
},widget.bean.ios_item);
|
||||
return;
|
||||
}
|
||||
@ -661,6 +673,17 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
if (widget.bean.is_limit&&widget.bean.amount>0) {
|
||||
showJoinCiclePiker(widget.bean.id.toString(),widget.bean.amount.toString(),widget.bean.oldAmount.toString(),1,(payResult){
|
||||
widget.bean.is_limit = false;
|
||||
if (Get.isRegistered<CircleLogic>()) {
|
||||
var logic = Get.find<CircleLogic>();
|
||||
for (var element in logic.circle.lists) {
|
||||
if (element.id == widget.bean.id) {
|
||||
element.is_limit = false;
|
||||
element.isJoin = true;
|
||||
}
|
||||
}
|
||||
logic.update();
|
||||
}
|
||||
Get.back();
|
||||
},widget.bean.ios_item);
|
||||
return;
|
||||
}
|
||||
@ -956,6 +979,17 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
if (widget.bean.is_limit&&widget.bean.amount > 0) {
|
||||
showJoinCiclePiker(widget.bean.id.toString(),widget.bean.amount.toString(),widget.bean.oldAmount.toString(),1,(payResult){
|
||||
widget.bean.is_limit = false;
|
||||
if (Get.isRegistered<CircleLogic>()) {
|
||||
var logic = Get.find<CircleLogic>();
|
||||
for (var element in logic.circle.lists) {
|
||||
if (element.id == widget.bean.id) {
|
||||
element.is_limit = false;
|
||||
element.isJoin = true;
|
||||
}
|
||||
}
|
||||
logic.update();
|
||||
}
|
||||
Get.back();
|
||||
},widget.bean.ios_item);
|
||||
return;
|
||||
}
|
||||
@ -1144,10 +1178,17 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
color: Colors.white, fontSize: 12.sp),
|
||||
)),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
|
||||
|
||||
onTap: () async{
|
||||
pushMsgPage(lists, widget.bean.id.toString());
|
||||
await Future.delayed(Duration(seconds: 1));
|
||||
SharedPreferences sharedPreferences =await SharedPreferences.getInstance();
|
||||
// SharedPreferencesHelper.getInstance().then((sharedPreferences) {
|
||||
int userId = sharedPreferences.getInt(SharedPreferencesHelper.USERID)??0;
|
||||
String avatar = sharedPreferences.getString(SharedPreferencesHelper.AVATAR)??"";
|
||||
String name = sharedPreferences.getString(SharedPreferencesHelper.NAME)??"";
|
||||
lists.chat!.users!.add(Users(avatar: avatar,id: userId,nickname: name));
|
||||
widget.logic.update();
|
||||
// });
|
||||
},
|
||||
child: Image.asset(
|
||||
getCircleImage('chat'),
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:circle_app/app/util/paymentUtil.dart';
|
||||
import 'package:circle_app/util/paymentUtil.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
|
||||
@ -9,6 +9,7 @@ import 'package:tencent_chat_push_for_china/tencent_chat_push_for_china.dart';
|
||||
import 'package:tencent_cloud_chat_uikit/tencent_cloud_chat_uikit.dart';
|
||||
|
||||
import '../../common/values/pushconfig.dart';
|
||||
import '../../util/PaymentUtils.dart';
|
||||
import '../../util/SharedPreferencesHelper.dart';
|
||||
import '../../util/device.dart';
|
||||
import '../../util/util.dart';
|
||||
@ -179,6 +180,9 @@ class _CustomDialogState extends State<YesAgreementDialog> {
|
||||
|
||||
|
||||
void uploadBuzIDAndToken() async {
|
||||
if (Platform.isAndroid) {
|
||||
initWxApi();
|
||||
}
|
||||
final CoreServicesImpl coreInstance = TIMUIKitCore.getInstance();
|
||||
await ChannelPush.init((msg) {});
|
||||
|
||||
|
||||
@ -86,7 +86,7 @@ class HelpPage extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'猜你想问',
|
||||
'常见问题',
|
||||
style: TextStyle(
|
||||
color: const Color(0xFFB7BECC),
|
||||
fontSize: 14.sp,
|
||||
|
||||
@ -7,7 +7,12 @@ import 'package:circle_app/util/util.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_native_splash/flutter_native_splash.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:tencent_cloud_chat_uikit/data_services/core/core_services.dart';
|
||||
import 'package:tencent_cloud_chat_uikit/data_services/message/message_services.dart';
|
||||
import 'package:tencent_cloud_chat_uikit/data_services/services_locatar.dart';
|
||||
import 'package:tencent_cloud_chat_uikit/tencent_cloud_chat_uikit.dart';
|
||||
|
||||
import '../../util/eventBus.dart';
|
||||
import '../circle/view.dart';
|
||||
import '../dialog/UpdateDialog.dart';
|
||||
import '../minefragment/view.dart';
|
||||
@ -23,15 +28,72 @@ class HomeLogic extends GetxController {
|
||||
|
||||
final List<Widget> tabs = [];
|
||||
var circlePage = CirclePage();
|
||||
static final MessageService _messageService =
|
||||
serviceLocator<MessageService>();
|
||||
final RxString unreadSIze = "0".obs;
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
void onInit() async {
|
||||
super.onInit();
|
||||
getIMData();
|
||||
|
||||
tabs.add(MsgPage());
|
||||
tabs.add(CirclePage());
|
||||
tabs.add(MinefragmentPage());
|
||||
|
||||
EventBusManager.on<RefreshUnread>().listen((event) {
|
||||
getUnreadSize();
|
||||
});
|
||||
getUnreadSize();
|
||||
var msgListener = V2TimSimpleMsgListener(onRecvC2CTextMessage: (
|
||||
msgID,
|
||||
userInfo,
|
||||
text,
|
||||
) async {
|
||||
getUnreadSize();
|
||||
});
|
||||
_messageService.addSimpleMsgListener(listener: msgListener);
|
||||
|
||||
|
||||
|
||||
var data = await DioManager.instance.get(url: Api.APP_VERSION);
|
||||
var bean = BaseResponse<UpdateInfo>.fromJson(
|
||||
data, (data) => UpdateInfo.fromJson(data));
|
||||
if (bean.isSuccess() && bean.data.update == 1) {
|
||||
showReportDialog(Get.context!, bean.data.constraint == 0, bean.data);
|
||||
}
|
||||
}
|
||||
|
||||
getUnreadSize() async {
|
||||
V2TimValueCallback<int> getTotalUnreadMessageCountRes =
|
||||
await TencentImSDKPlugin.v2TIMManager
|
||||
.getConversationManager()
|
||||
.getTotalUnreadMessageCount();
|
||||
print("未读数量" + getTotalUnreadMessageCountRes.desc.toString()+getTotalUnreadMessageCountRes.code.toString());
|
||||
|
||||
if (getTotalUnreadMessageCountRes.code == 0) {
|
||||
unreadSIze.value = getTotalUnreadMessageCountRes.data.toString();
|
||||
setOfflinePushStatus(status: AppStatus.foreground);
|
||||
}else{
|
||||
getUnreadSize();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@override
|
||||
Future<V2TimCallback> setOfflinePushStatus(
|
||||
{required AppStatus status, int? totalCount}) {
|
||||
if (status == AppStatus.foreground) {
|
||||
// 当应用status为前台时,上报doForeground()
|
||||
return TencentImSDKPlugin.v2TIMManager
|
||||
.getOfflinePushManager()
|
||||
.doForeground();
|
||||
} else {
|
||||
// 当应用status为后台时,上报doBackground(),并带上未读数
|
||||
return TencentImSDKPlugin.v2TIMManager
|
||||
.getOfflinePushManager()
|
||||
.doBackground(unreadCount: totalCount ?? 0);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
@ -40,12 +102,7 @@ class HomeLogic extends GetxController {
|
||||
super.onReady();
|
||||
|
||||
FlutterNativeSplash.remove();
|
||||
var data = await DioManager.instance.get(url: Api.APP_VERSION);
|
||||
var bean = BaseResponse<UpdateInfo>.fromJson(
|
||||
data, (data) => UpdateInfo.fromJson(data));
|
||||
if (bean.isSuccess() && bean.data.update == 1) {
|
||||
showReportDialog(Get.context!, bean.data.constraint == 0, bean.data);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void showReportDialog(
|
||||
|
||||
@ -39,7 +39,7 @@ class _HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin
|
||||
height: 49.sp + MediaQuery.of(context).padding.bottom,
|
||||
width: Get.width,
|
||||
// color: Colors.red,
|
||||
padding: EdgeInsets.only(left: 50.sp, right: 50.sp, top: 8.sp),
|
||||
padding: EdgeInsets.only(left: 50.sp, right: 50.sp),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFF423055),
|
||||
image: DecorationImage(
|
||||
@ -74,9 +74,8 @@ class _HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin
|
||||
|
||||
funcItem(int index, String image, bool isSelected, HomeLogic controller) {
|
||||
return SizedBox(
|
||||
width: 80,
|
||||
|
||||
height: 36,
|
||||
width: 80.sp,
|
||||
height: 36.sp,
|
||||
child: GestureDetector(
|
||||
behavior: HitTestBehavior.opaque,
|
||||
onTap: () {
|
||||
@ -85,12 +84,50 @@ class _HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin
|
||||
controller.updateIndex(index);
|
||||
}
|
||||
},
|
||||
child: Image.asset(
|
||||
isSelected
|
||||
? getTabbarImage('${image}_selected')
|
||||
: getTabbarImage('${image}_normal'),
|
||||
width: 34.sp,
|
||||
height: 34.sp,
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children:[
|
||||
Container(
|
||||
|
||||
margin: EdgeInsets.only(top: 8.sp),
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
isSelected
|
||||
? getTabbarImage('${image}_selected')
|
||||
: getTabbarImage('${image}_normal'),
|
||||
width: 34.sp,
|
||||
height: 34.sp,
|
||||
),
|
||||
),
|
||||
),
|
||||
// Obx(() => null)
|
||||
Obx(() => Visibility(
|
||||
visible: index == 0 &&controller.unreadSIze!="0",
|
||||
child: Positioned(
|
||||
// right: 4.sp,
|
||||
top: 4.sp,
|
||||
child:
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: int.parse(controller.unreadSIze.value) > 99 ? 30.sp : 20.sp),
|
||||
height: 18.sp,
|
||||
padding: EdgeInsets.only(left: 5.sp,right: 5.sp),
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.red,
|
||||
borderRadius: BorderRadius.circular(11.sp)
|
||||
),
|
||||
child: Text(
|
||||
int.parse(controller.unreadSIze.value) > 99 ? '99+' : controller.unreadSIze.value, // The number in the red dot
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 12.0.sp, // Font size of the text
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
)))
|
||||
|
||||
]
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@ -14,6 +14,7 @@ import 'package:scroll_to_index/scroll_to_index.dart';
|
||||
import 'package:tencent_cloud_chat_uikit/tencent_cloud_chat_uikit.dart';
|
||||
import 'package:tencent_cloud_chat_uikit/ui/controller/tim_uikit_conversation_controller.dart';
|
||||
|
||||
import '../../util/eventBus.dart';
|
||||
import 'TIMUIKitConversation/tim_uikit_conversation.dart';
|
||||
import 'logic.dart';
|
||||
|
||||
@ -206,13 +207,14 @@ class MsgPage extends StatelessWidget {
|
||||
fontWeight: FontWeight.w500),
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
onTap: () async{
|
||||
V2TimConversation conv = V2TimConversation(
|
||||
type: 1,
|
||||
userID: '10040818',
|
||||
conversationID: 'c2c_10040818',
|
||||
showName: '456');
|
||||
Get.toNamed(AppRoutes.Chat, arguments: conv);
|
||||
|
||||
},
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
@ -320,13 +322,14 @@ class MsgPage extends StatelessWidget {
|
||||
return TIMConversation(
|
||||
autoScrollController: logic.scrollController,
|
||||
scrollController: logic.listScrollController,
|
||||
onTapItem: (selectedConv) {
|
||||
onTapItem: (selectedConv) async{
|
||||
String type = selectedConv.userID!.split('_')[2];
|
||||
if (int.parse(type) == 11) {
|
||||
Get.toNamed(AppRoutes.Sys_notify_list, arguments: selectedConv);
|
||||
return;
|
||||
}
|
||||
Get.toNamed(AppRoutes.Chat, arguments: selectedConv);
|
||||
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@ -18,6 +18,7 @@ class _SwiperPageState extends State<SwiperPage> {
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
return GetBuilder<SwiperLogic>(builder: (logic) {
|
||||
|
||||
return Scaffold(
|
||||
appBar: null,
|
||||
backgroundColor: Colors.black87,
|
||||
@ -31,6 +32,7 @@ class _SwiperPageState extends State<SwiperPage> {
|
||||
controller: logic.swiperController,
|
||||
index:logic.index,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
print("img="+logic.imgList[index]);
|
||||
return SizedBox(
|
||||
width: double.infinity,
|
||||
child: Image.network(
|
||||
|
||||
@ -657,15 +657,7 @@ class MyTabbedScreenState extends State<UserinfoPage>
|
||||
],
|
||||
);
|
||||
}
|
||||
sendmsg(){
|
||||
OfflinePushInfo(
|
||||
title : '测试', // 推送通知标题。留空字符串时,按照优先级,IM后台自动替换成 sender的昵称 => sender ID。因此,如无特殊需求,该字段建议留空,可达到和微信一致的效果
|
||||
desc : '测试', // 推送第二行小字部分
|
||||
disablePush : false,
|
||||
ext : 'null', // 推送内额外信息,对方可于单击通知跳转时拿到。建议传含Conversation信息的JSON,用于收件方跳转至对应Chat。可参见下方TUIKit的实例代码。
|
||||
androidOPPOChannelID : 'new_message', // OPPO的channel ID
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildAvatar1(UserinfoLogic controller) {
|
||||
if (controller.userInfoBean == null) {
|
||||
return SizedBox(
|
||||
|
||||
@ -1,17 +1,24 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:get/get.dart';
|
||||
import 'package:pull_to_refresh/pull_to_refresh.dart';
|
||||
|
||||
import '../../common/Widgets/open_vip_tip/logic.dart';
|
||||
import '../../network/api.dart';
|
||||
import '../../network/dio_manager.dart';
|
||||
import '../../util/SharedPreferencesHelper.dart';
|
||||
import '../../util/eventBus.dart';
|
||||
import 'state.dart';
|
||||
|
||||
class VisitorlistLogic extends GetxController {
|
||||
@override
|
||||
void dispose() {
|
||||
refreshController.dispose();
|
||||
super.dispose();
|
||||
if (null != subscription) {
|
||||
EventBusManager.cancelSubscription(subscription!);
|
||||
}
|
||||
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
final RefreshController refreshController = RefreshController();
|
||||
@ -20,23 +27,42 @@ class VisitorlistLogic extends GetxController {
|
||||
int isVip = 0;
|
||||
bool isLoad = true;
|
||||
List<UserListItem> lists = [];
|
||||
StreamSubscription? subscription = null;
|
||||
|
||||
@override
|
||||
void onInit() async {
|
||||
super.onInit();
|
||||
initList();
|
||||
|
||||
subscription = EventBusManager.on<CommentVipEvent>().listen((event) {
|
||||
isVip = event.vip;
|
||||
page = 1;
|
||||
initList();
|
||||
});
|
||||
refreshVipStatus();
|
||||
}
|
||||
|
||||
refreshVipStatus() async {
|
||||
var data = await DioManager.instance.get(url: Api.getVipStatus);
|
||||
var bean =
|
||||
BaseResponse<VipInfo>.fromJson(data, (data) => VipInfo.fromJson(data));
|
||||
if (bean.isSuccess()) {
|
||||
SharedPreferencesHelper.getInstance().then((sharedPreferences) {
|
||||
sharedPreferences.setInt(
|
||||
SharedPreferencesHelper.VIP, bean.data.vipLevel);
|
||||
isVip = bean.data.vipLevel;
|
||||
initList();
|
||||
// update();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
initList() async {
|
||||
if (page == 1) {
|
||||
lists.clear();
|
||||
}
|
||||
|
||||
var data =
|
||||
await DioManager.instance.get(url: Api.visitList, params: {
|
||||
'page': page
|
||||
});
|
||||
var data = await DioManager.instance
|
||||
.get(url: Api.visitList, params: {'page': page});
|
||||
var bean = BaseResponse<UserList>.fromJson(
|
||||
data, (data) => UserList.fromJson(data));
|
||||
if (bean.isSuccess()) {
|
||||
@ -51,12 +77,8 @@ class VisitorlistLogic extends GetxController {
|
||||
refreshController.loadComplete();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
class User {
|
||||
final int id;
|
||||
final String nickname;
|
||||
@ -147,4 +169,3 @@ class UserList {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:circle_app/main.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@ -5,6 +7,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:pull_to_refresh/pull_to_refresh.dart';
|
||||
|
||||
import '../../common/Widgets/open_vip_tip/view.dart';
|
||||
import '../../components/my_app_bar.dart';
|
||||
import '../../router/app_routers.dart';
|
||||
import '../../util/util.dart';
|
||||
@ -14,7 +17,9 @@ class VisitorlistPage extends StatelessWidget {
|
||||
VisitorlistPage({Key? key}) : super(key: key);
|
||||
|
||||
final logic = Get.find<VisitorlistLogic>();
|
||||
final state = Get.find<VisitorlistLogic>().state;
|
||||
final state = Get
|
||||
.find<VisitorlistLogic>()
|
||||
.state;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@ -29,69 +34,127 @@ class VisitorlistPage extends StatelessWidget {
|
||||
child: Scaffold(
|
||||
backgroundColor: Colors.transparent,
|
||||
appBar: const MyAppBar(
|
||||
centerTitle:"最近访客",
|
||||
centerTitle: "最近访客",
|
||||
),
|
||||
body: SafeArea(
|
||||
child: logic.isLoad ? loaddingWidget(true) : logic.lists.isEmpty ? noResultWidget() : SmartRefresher(
|
||||
controller: logic.refreshController,
|
||||
onRefresh: _onRefresh,
|
||||
onLoading: _onLoading,
|
||||
enablePullUp:true,
|
||||
child: ListView.builder(
|
||||
padding: EdgeInsets.all(10.sp),
|
||||
itemCount: logic.lists.length,
|
||||
itemBuilder: (context, index) {
|
||||
return ListItem(logic.lists[index],index);
|
||||
},
|
||||
body: Stack(
|
||||
children: [
|
||||
Container(
|
||||
child: logic.isLoad
|
||||
? loaddingWidget(true)
|
||||
: logic.lists.isEmpty
|
||||
? noResultWidget()
|
||||
: SmartRefresher(
|
||||
controller: logic.refreshController,
|
||||
onRefresh: _onRefresh,
|
||||
onLoading: _onLoading,
|
||||
enablePullUp: true,
|
||||
child: Stack(
|
||||
alignment: Alignment.topCenter,
|
||||
children: [
|
||||
ListView.builder(
|
||||
padding: EdgeInsets.all(10.sp),
|
||||
itemCount: logic.lists.length,
|
||||
itemBuilder: (context, index) {
|
||||
return ListItem(logic.lists[index], index);
|
||||
},
|
||||
),
|
||||
logic.isVip > 0 ? Container() : Positioned(
|
||||
bottom: 150,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
showRechargeDialog();
|
||||
},
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius:
|
||||
BorderRadius.circular(17),
|
||||
gradient: LinearGradient(
|
||||
colors: [
|
||||
Color(0xFF06F9FA),
|
||||
Color(0xFFDC5BFD),
|
||||
],
|
||||
begin: Alignment.centerLeft,
|
||||
end: Alignment.centerRight,
|
||||
),
|
||||
),
|
||||
padding: EdgeInsets.only(
|
||||
top: 10.sp,
|
||||
bottom: 10.sp,
|
||||
left: 55.sp,
|
||||
right: 55.sp),
|
||||
child: Text(
|
||||
"开通会员查看访客",
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
),
|
||||
))
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
Widget ListItem(UserListItem item,int index) {
|
||||
Widget ListItem(UserListItem item, int index) {
|
||||
//print("是不是vip"+logic.isVip.toString());
|
||||
return GestureDetector(
|
||||
behavior: HitTestBehavior.opaque,
|
||||
onTap: (){
|
||||
Get.toNamed(AppRoutes.UserInfoActivity, arguments: item.user.id.toString());
|
||||
onTap: () {
|
||||
if (logic.isVip > 0 || index < 3) {
|
||||
Get.toNamed(AppRoutes.UserInfoActivity,
|
||||
arguments: item.user.id.toString());
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
child: ImageFiltered(
|
||||
imageFilter: ImageFilter.blur(
|
||||
sigmaX: (logic.isVip > 0 || index < 3) ? 0 : 5,
|
||||
sigmaY: (logic.isVip > 0 || index < 3) ? 0 : 5,
|
||||
),
|
||||
child: Container(
|
||||
margin: const EdgeInsets.only(bottom: 21),
|
||||
child: Row(
|
||||
children: [
|
||||
Stack(children: [
|
||||
ClipOval(
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
var imgList = <String>[];
|
||||
imgList.add(item.user.avatar);
|
||||
Get.toNamed(AppRoutes.Swiper, arguments: {
|
||||
'imaglist': imgList,
|
||||
'index': 0
|
||||
});
|
||||
},
|
||||
child: CachedNetworkImage(
|
||||
fit: BoxFit.cover,
|
||||
imageUrl: item.user.avatarThumb,
|
||||
width: 53.sp,
|
||||
height: 53.sp,
|
||||
Stack(
|
||||
children: [
|
||||
ClipOval(
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
if (logic.isVip > 0 || index < 3) {
|
||||
var imgList = <String>[];
|
||||
imgList.add(item.user.avatar);
|
||||
Get.toNamed(AppRoutes.Swiper,
|
||||
arguments: {'imaglist': imgList, 'index': 0});
|
||||
}
|
||||
},
|
||||
child: CachedNetworkImage(
|
||||
fit: BoxFit.cover,
|
||||
imageUrl: item.user.avatarThumb,
|
||||
width: 53.sp,
|
||||
height: 53.sp,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
right: 0.sp,
|
||||
left: 0.sp,
|
||||
bottom: 0.sp,
|
||||
|
||||
child: item.user.vip!=0 ?
|
||||
Image(
|
||||
image: AssetImage(getBaseImage("vip")),
|
||||
width: 44.sp,
|
||||
height: 18.sp,
|
||||
):Container(),)
|
||||
],),
|
||||
Positioned(
|
||||
right: 0.sp,
|
||||
left: 0.sp,
|
||||
bottom: 0.sp,
|
||||
child: item.user.vip != 0
|
||||
? Image(
|
||||
image: AssetImage(getBaseImage("vip")),
|
||||
width: 44.sp,
|
||||
height: 18.sp,
|
||||
)
|
||||
: Container(),
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(width: 10.sp),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
@ -100,7 +163,10 @@ class VisitorlistPage extends StatelessWidget {
|
||||
children: [
|
||||
Text(
|
||||
item.user.nickname,
|
||||
style: const TextStyle(color :Colors.white70,fontSize: 14, fontWeight: FontWeight.bold),
|
||||
style: const TextStyle(
|
||||
color: Colors.white70,
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.bold),
|
||||
),
|
||||
SizedBox(width: 4.sp),
|
||||
// SizedBox(height: 8.sp),
|
||||
@ -115,39 +181,48 @@ class VisitorlistPage extends StatelessWidget {
|
||||
item.user.signature,
|
||||
overflow: TextOverflow.ellipsis, // 超出部分使用省略号表示
|
||||
maxLines: 1,
|
||||
style: TextStyle(fontSize: 12.sp, color: const Color(0xFFB7BECC)),
|
||||
style: TextStyle(
|
||||
fontSize: 12.sp, color: const Color(0xFFB7BECC)),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
// Pla
|
||||
const Spacer(),
|
||||
GestureDetector(onTap: (){
|
||||
pushChatPage(item.user.id.toString(),item.accountId, item.user.nickname);
|
||||
},
|
||||
child: Container(
|
||||
width: 60.sp,
|
||||
height: 28.sp,
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFFFF4D7C),
|
||||
borderRadius: BorderRadius.circular(14.sp),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
if (logic.isVip > 0 || index < 3) {
|
||||
pushChatPage(item.user.id.toString(), item.accountId,
|
||||
item.user.nickname);
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
width: 60.sp,
|
||||
height: 28.sp,
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFFFF4D7C),
|
||||
borderRadius: BorderRadius.circular(14.sp),
|
||||
),
|
||||
child: Center(
|
||||
child: Text("私聊",
|
||||
style: TextStyle(fontSize: 14.sp, color: Colors.white)),
|
||||
),
|
||||
),
|
||||
child: Center(
|
||||
child: Text("私聊", style: TextStyle(fontSize: 14.sp, color: Colors.white)),
|
||||
)
|
||||
|
||||
,
|
||||
),),
|
||||
),
|
||||
],
|
||||
),
|
||||
),);
|
||||
)
|
||||
,
|
||||
),)
|
||||
,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Widget _buildInfoRow(UserListItem userInfoBean) {
|
||||
String ageMsg = getAgeCOntent(userInfoBean.user.gender, userInfoBean.user.age,
|
||||
userInfoBean.user.role, userInfoBean.user.orientation);
|
||||
String ageMsg = getAgeCOntent(
|
||||
userInfoBean.user.gender,
|
||||
userInfoBean.user.age,
|
||||
userInfoBean.user.role,
|
||||
userInfoBean.user.orientation);
|
||||
return Row(
|
||||
children: [
|
||||
Container(
|
||||
@ -165,7 +240,7 @@ class VisitorlistPage extends StatelessWidget {
|
||||
padding: EdgeInsets.only(
|
||||
top: 2.sp, bottom: 2.sp, left: 10.sp, right: 10.sp),
|
||||
child: Text(
|
||||
ageMsg ,
|
||||
ageMsg,
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 10.sp,
|
||||
@ -173,12 +248,10 @@ class VisitorlistPage extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
SizedBox(width: 6.sp),
|
||||
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
void _onRefresh() async {
|
||||
logic.page = 1;
|
||||
logic.initList();
|
||||
@ -188,4 +261,17 @@ class VisitorlistPage extends StatelessWidget {
|
||||
logic.page = logic.page + 1;
|
||||
logic.initList();
|
||||
}
|
||||
|
||||
showRechargeDialog() async {
|
||||
Get.bottomSheet(
|
||||
Scaffold(
|
||||
backgroundColor: Colors.transparent,
|
||||
body: Open_vip_tipPage(false),
|
||||
),
|
||||
isScrollControlled: true,
|
||||
enableDrag: false)
|
||||
.then((value) {
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:circle_app/app/util/paymentUtil.dart';
|
||||
import 'package:circle_app/util/paymentUtil.dart';
|
||||
import 'package:circle_app/util/util.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
@ -29,7 +29,7 @@ joiinCircileTipWdiget(String cicleId, String pirce, String oldPrice,
|
||||
children: [
|
||||
Container(
|
||||
width: 339.sp,
|
||||
height: 330.sp,
|
||||
height: 400.sp,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
fit: BoxFit.fill,
|
||||
@ -65,10 +65,10 @@ joiinCircileTipWdiget(String cicleId, String pirce, String oldPrice,
|
||||
width: 339.sp,
|
||||
padding: EdgeInsets.only(left: 17.sp, right: 17.sp),
|
||||
child: Text(
|
||||
'为打造纯净的社交环境,更好地服务大家,基于以下几方面考虑:1、平台升级为全天24小时人工审核,保证用户真实,避免骗子、酒托、虚假人士等扰乱平台 ;2、杜绝未入圈用户随意骚扰或影响已入圈的;3、谢绝只会白嫖的猎奇人士。',
|
||||
'为打造纯净的社交环境,更好地服务大家,基于以下几方面考虑:\n\n1、平台升级为全天24小时人工审核,保证用户真实,避免骗子、酒托、虚假人士等扰乱平台 ;\n\n2、杜绝未入圈用户随意骚扰或影响已入圈的;\n\n3、谢绝只会白嫖的猎奇人士。',
|
||||
style: TextStyle(
|
||||
color: const Color.fromRGBO(247, 250, 250, 0.8),
|
||||
fontSize: 12.sp)),
|
||||
fontSize: 14.sp)),
|
||||
)),
|
||||
Platform.isIOS
|
||||
? Container(
|
||||
@ -166,6 +166,7 @@ joiinCircileTipWdiget(String cicleId, String pirce, String oldPrice,
|
||||
IOSPayment.instance.iosPay(iosItem, cicleId, 1);
|
||||
} else {
|
||||
unlockingPayment(cicleId, myCallback);
|
||||
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:circle_app/app/util/paymentUtil.dart';
|
||||
import 'package:circle_app/util/paymentUtil.dart';
|
||||
import 'package:circle_app/util/util.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
|
||||
@ -2,7 +2,7 @@ import 'dart:io';
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:circle_app/app/splash/binding.dart';
|
||||
import 'package:circle_app/app/util/paymentUtil.dart';
|
||||
import 'package:circle_app/util/paymentUtil.dart';
|
||||
import 'package:circle_app/common/values/pushconfig.dart';
|
||||
import 'package:circle_app/network/api.dart';
|
||||
import 'package:circle_app/network/dio_manager.dart';
|
||||
@ -65,6 +65,10 @@ void uploadBuzIDAndToken() async {
|
||||
if(!isAgreemement){
|
||||
return;
|
||||
}
|
||||
|
||||
if (Platform.isAndroid) {
|
||||
initWxApi();
|
||||
}
|
||||
await ChannelPush.init((msg) {});
|
||||
|
||||
int? businessID = await TimUiKitPushPlugin.getBuzId(PushConfig.appInfo);
|
||||
@ -264,9 +268,7 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
|
||||
void initState() {
|
||||
initIM();
|
||||
WidgetsBinding.instance.addObserver(this);
|
||||
if (Platform.isAndroid) {
|
||||
initWxApi();
|
||||
}
|
||||
|
||||
|
||||
// uploadBuzIDAndToken();
|
||||
loadBgImage();
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
|
||||
|
||||
class Api {
|
||||
static const baseUrl = 'https://leyuan666.com/zuul-service/';
|
||||
|
||||
@ -45,6 +45,7 @@ Future<void> openWxPay(PaymentData data, WxPayCallback callback) async {
|
||||
if (event.isSuccessful) {
|
||||
showOKToast("微信支付成功");
|
||||
callback(true, null);
|
||||
|
||||
} else {
|
||||
print(event.errStr);
|
||||
showOKToast(event.errStr ?? "微信支付失败");
|
||||
|
||||
@ -57,4 +57,9 @@ class CallRefreshCircle {
|
||||
|
||||
class ScrollToTop {
|
||||
|
||||
}
|
||||
|
||||
|
||||
class RefreshUnread {
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user