修改第一次安装 app计数不准的问题 还有最近访客vip权限
This commit is contained in:
parent
45fe408fe1
commit
f81f04708a
@ -1,6 +1,8 @@
|
||||
import 'dart:async';
|
||||
import 'dart:io';
|
||||
|
||||
import 'dart:ffi';
|
||||
|
||||
import 'package:circle_app/app/circle/logic.dart';
|
||||
import 'package:circle_app/app/minefragment/logic.dart';
|
||||
import 'package:circle_app/main.dart';
|
||||
@ -53,7 +55,9 @@ class HomeLogic extends GetxController {
|
||||
userInfo,
|
||||
text,
|
||||
) async {
|
||||
getUnreadSize();
|
||||
print("收到新消息"+text);
|
||||
unreadSIze.value = (int.parse(unreadSIze.value)+1).toString();
|
||||
//getUnreadSize();
|
||||
});
|
||||
_messageService.addSimpleMsgListener(listener: msgListener);
|
||||
|
||||
@ -72,7 +76,7 @@ class HomeLogic extends GetxController {
|
||||
await TencentImSDKPlugin.v2TIMManager
|
||||
.getConversationManager()
|
||||
.getTotalUnreadMessageCount();
|
||||
print("未读数量" + getTotalUnreadMessageCountRes.desc.toString()+getTotalUnreadMessageCountRes.code.toString());
|
||||
print("未读数量desc=" + getTotalUnreadMessageCountRes.desc.toString()+"code="+getTotalUnreadMessageCountRes.code.toString()+"data="+getTotalUnreadMessageCountRes.data.toString());
|
||||
|
||||
if (getTotalUnreadMessageCountRes.code == 0) {
|
||||
unreadSIze.value = getTotalUnreadMessageCountRes.data.toString();
|
||||
|
||||
@ -67,6 +67,7 @@ class VisitorlistLogic extends GetxController {
|
||||
data, (data) => UserList.fromJson(data));
|
||||
if (bean.isSuccess()) {
|
||||
lists.addAll(bean.data.lists);
|
||||
|
||||
}
|
||||
|
||||
isLoad = false;
|
||||
|
||||
@ -23,6 +23,11 @@ class VisitorlistPage extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return GetBuilder<VisitorlistLogic>(builder: (logic) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
@ -58,39 +63,7 @@ class VisitorlistPage extends StatelessWidget {
|
||||
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,
|
||||
),
|
||||
),
|
||||
),
|
||||
))
|
||||
showGd()
|
||||
],
|
||||
),
|
||||
),
|
||||
@ -102,6 +75,166 @@ class VisitorlistPage extends StatelessWidget {
|
||||
});
|
||||
}
|
||||
|
||||
Widget showGd() {
|
||||
double interval = 50;
|
||||
List<String> urlList = [];
|
||||
|
||||
if (logic.lists.length > 3) {
|
||||
for (int i = 3; i < logic.lists.length; i++) {
|
||||
if (urlList.length < 3) {
|
||||
urlList.add(logic.lists[i].user.avatar);
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
List<Widget> widgets = [];
|
||||
|
||||
switch(urlList.length){
|
||||
case 0:
|
||||
widgets.add(Positioned(
|
||||
left: (Get.width /2) - 40,
|
||||
child: circleWidget(""),
|
||||
));
|
||||
break;
|
||||
case 1:
|
||||
for (int i = 0; i < urlList.length; i++) {
|
||||
var element = urlList[i];
|
||||
// double xOffset = interval * i + xOffsetBase;
|
||||
double let = (Get.width /2) - 60 ;
|
||||
|
||||
widgets.add(Positioned(
|
||||
left: let,
|
||||
child: circleWidget(element),
|
||||
));
|
||||
}
|
||||
|
||||
widgets.add(Positioned(
|
||||
left: (Get.width /2) - 20,
|
||||
child: circleWidget(""),
|
||||
));
|
||||
break;
|
||||
case 2:
|
||||
|
||||
double xOffsetBase = (Get.width + interval * urlList.length - 60.0 * urlList.length) * 0.25;
|
||||
|
||||
for (int i = 0; i < urlList.length; i++) {
|
||||
var element = urlList[i];
|
||||
// double xOffset = interval * i + xOffsetBase;
|
||||
double let = ((Get.width /2) - ((40*urlList.length))+(i*40)) ;
|
||||
|
||||
widgets.add(Positioned(
|
||||
left: let,
|
||||
child: circleWidget(element),
|
||||
));
|
||||
}
|
||||
|
||||
double xOffset = interval * urlList.length + xOffsetBase;
|
||||
widgets.add(Positioned(
|
||||
left: xOffset,
|
||||
child: circleWidget(""),
|
||||
));
|
||||
break;
|
||||
case 3:
|
||||
// double xOffsetBase = (Get.width + interval * urlList.length - 60.0 * urlList.length) * 0.25;
|
||||
|
||||
for (int i = 0; i < urlList.length; i++) {
|
||||
switch(i){
|
||||
case 0:
|
||||
widgets.add(Positioned(
|
||||
left: (Get.width /2) - 100,
|
||||
child: circleWidget(urlList[i]),
|
||||
));
|
||||
break;
|
||||
case 1:
|
||||
widgets.add(Positioned(
|
||||
left: (Get.width /2) - 60,
|
||||
child: circleWidget(urlList[i]),
|
||||
));
|
||||
break;
|
||||
case 2:
|
||||
widgets.add(Positioned(
|
||||
left: (Get.width /2) - 20,
|
||||
child: circleWidget(urlList[i]),
|
||||
));
|
||||
break;
|
||||
}
|
||||
}
|
||||
widgets.add(Positioned(
|
||||
left: (Get.width /2) + 20,
|
||||
child: circleWidget(""),
|
||||
));
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
return logic.isVip > 0
|
||||
? Container()
|
||||
: Positioned(
|
||||
bottom: 150,
|
||||
child: Container(
|
||||
width: Get.width,
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 140.sp,
|
||||
width: Get.width,
|
||||
child: Stack(
|
||||
alignment: Alignment.centerLeft,
|
||||
children: widgets,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(bottom: 40.sp),
|
||||
child: Text(
|
||||
"TA们也来看过你 \n"
|
||||
"成为会员查看完整访客信息",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 15.sp,
|
||||
),
|
||||
),
|
||||
),
|
||||
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.symmetric(
|
||||
vertical: 10.sp,
|
||||
horizontal: 55.sp,
|
||||
),
|
||||
child: Text(
|
||||
"开通会员查看访客",
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 12.sp,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Widget ListItem(UserListItem item, int index) {
|
||||
//print("是不是vip"+logic.isVip.toString());
|
||||
return GestureDetector(
|
||||
@ -204,7 +337,7 @@ class VisitorlistPage extends StatelessWidget {
|
||||
borderRadius: BorderRadius.circular(14.sp),
|
||||
),
|
||||
child: Center(
|
||||
child: Text("私聊",
|
||||
child: Text("回访",
|
||||
style: TextStyle(fontSize: 14.sp, color: Colors.white)),
|
||||
),
|
||||
),
|
||||
@ -274,4 +407,34 @@ class VisitorlistPage extends StatelessWidget {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
circleWidget(String url, {double width = 80}) {
|
||||
return GestureDetector(
|
||||
onTap: (){
|
||||
showRechargeDialog();
|
||||
},
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
getCircleImage('more'),
|
||||
width: width.sp,
|
||||
height: width.sp,
|
||||
),
|
||||
url.contains("http") ? ClipOval(
|
||||
child: Image.network(
|
||||
url,
|
||||
width: (width - 1).sp,
|
||||
height: (width - 1).sp,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
) : Text(url,style: TextStyle(color: Color(0xffF756FF),fontSize: 12.sp),)
|
||||
],
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user