完善一些需求
This commit is contained in:
parent
20c824b84b
commit
5a1ffc90e3
BIN
circle_app/assets/images/mine/im_toggle.png
Normal file
BIN
circle_app/assets/images/mine/im_toggle.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.3 KiB |
BIN
circle_app/assets/images/mine/im_toggle_true.png
Normal file
BIN
circle_app/assets/images/mine/im_toggle_true.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.3 KiB |
@ -17,6 +17,7 @@ import '../../network/api.dart';
|
|||||||
import '../../network/dio_manager.dart';
|
import '../../network/dio_manager.dart';
|
||||||
import '../../router/app_routers.dart';
|
import '../../router/app_routers.dart';
|
||||||
import '../../util/SharedPreferencesHelper.dart';
|
import '../../util/SharedPreferencesHelper.dart';
|
||||||
|
import '../../util/eventBus.dart';
|
||||||
import '../../util/qiniu.dart';
|
import '../../util/qiniu.dart';
|
||||||
import '../circle/logic.dart';
|
import '../circle/logic.dart';
|
||||||
import '../select_circle/logic.dart';
|
import '../select_circle/logic.dart';
|
||||||
@ -76,6 +77,14 @@ class Call_outLogic extends GetxController {
|
|||||||
var qiniuBean = BaseResponse<QnTokenData>.fromJson(
|
var qiniuBean = BaseResponse<QnTokenData>.fromJson(
|
||||||
quniuData, (quniuData) => QnTokenData.fromJson(quniuData));
|
quniuData, (quniuData) => QnTokenData.fromJson(quniuData));
|
||||||
quToken = qiniuBean.data!.token.toString();
|
quToken = qiniuBean.data!.token.toString();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
StreamSubscription subscription = EventBusManager.on<CommentVipEvent>().listen((event) {
|
||||||
|
vip = event.vip;
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -266,7 +266,7 @@ class _InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClie
|
|||||||
children: [
|
children: [
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
SizedBox(
|
||||||
height: 30.sp,
|
height: 30.sp,
|
||||||
width: 30.0.sp +
|
width: 30.0.sp +
|
||||||
15.sp *
|
15.sp *
|
||||||
@ -379,7 +379,7 @@ class _InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClie
|
|||||||
'${convertToTenThousand(widget.bean.viewTotal)}人看过',
|
'${convertToTenThousand(widget.bean.viewTotal)}人看过',
|
||||||
textAlign: TextAlign.left,
|
textAlign: TextAlign.left,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Color(0xff03FEFB),
|
color: const Color(0xff03FEFB),
|
||||||
fontSize: 12.sp,
|
fontSize: 12.sp,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -433,7 +433,7 @@ class _InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClie
|
|||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
child: Container(
|
child: Container(
|
||||||
height: 300.sp,
|
height: 300.sp,
|
||||||
padding: EdgeInsets.all(1.0),
|
padding: const EdgeInsets.all(1.0),
|
||||||
child: Stack(
|
child: Stack(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
@ -469,7 +469,7 @@ class _InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClie
|
|||||||
msg,
|
msg,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Color(0xCCF7FAFA), fontSize: 16.sp),
|
color: const Color(0xCCF7FAFA), fontSize: 16.sp),
|
||||||
),),
|
),),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
@ -548,12 +548,13 @@ class _InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClie
|
|||||||
Positioned(
|
Positioned(
|
||||||
left: 0,
|
left: 0,
|
||||||
top: 2.sp,
|
top: 2.sp,
|
||||||
child: Image.asset(getCircleImage('vip_say')),
|
|
||||||
height: 18.sp,
|
height: 18.sp,
|
||||||
|
child: Image.asset(getCircleImage('vip_say')),
|
||||||
),
|
),
|
||||||
Positioned(
|
Positioned(
|
||||||
right: 2.sp,
|
right: 2.sp,
|
||||||
top: 2.sp,
|
top: 2.sp,
|
||||||
|
height: 18.sp,
|
||||||
child: Stack(
|
child: Stack(
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
children: [
|
children: [
|
||||||
@ -567,7 +568,6 @@ class _InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClie
|
|||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
height: 18.sp,
|
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
height: widgetHeight,
|
height: widgetHeight,
|
||||||
@ -575,7 +575,7 @@ class _InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClie
|
|||||||
padding: EdgeInsets.only(top: 12.sp, left: 12.sp, right: 12.sp),
|
padding: EdgeInsets.only(top: 12.sp, left: 12.sp, right: 12.sp),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
SizedBox(
|
||||||
height: 72.sp,
|
height: 72.sp,
|
||||||
child: Row(
|
child: Row(
|
||||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
@ -589,7 +589,7 @@ class _InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClie
|
|||||||
Get.toNamed(AppRoutes.UserInfoActivity);
|
Get.toNamed(AppRoutes.UserInfoActivity);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (widget.bean.is_limit) {
|
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;
|
||||||
});
|
});
|
||||||
@ -727,7 +727,7 @@ class _InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClie
|
|||||||
// ),
|
// ),
|
||||||
// ),
|
// ),
|
||||||
errorWidget: (context, url, error) =>
|
errorWidget: (context, url, error) =>
|
||||||
Icon(Icons.error),
|
const Icon(Icons.error),
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -747,7 +747,7 @@ class _InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClie
|
|||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
widgets.isNotEmpty
|
widgets.isNotEmpty
|
||||||
? Container(
|
? SizedBox(
|
||||||
width: 24 + 12.sp * widgets.length - 12.sp,
|
width: 24 + 12.sp * widgets.length - 12.sp,
|
||||||
height: 24.sp,
|
height: 24.sp,
|
||||||
child: Stack(children: widgets),
|
child: Stack(children: widgets),
|
||||||
@ -871,7 +871,7 @@ class _InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClie
|
|||||||
padding: EdgeInsets.only(left: 12.sp, right: 12.sp),
|
padding: EdgeInsets.only(left: 12.sp, right: 12.sp),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
SizedBox(
|
||||||
height: 72.sp,
|
height: 72.sp,
|
||||||
child: Row(
|
child: Row(
|
||||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
@ -1032,7 +1032,7 @@ class _InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClie
|
|||||||
// ),
|
// ),
|
||||||
// ),
|
// ),
|
||||||
errorWidget: (context, url, error) =>
|
errorWidget: (context, url, error) =>
|
||||||
Icon(Icons.error),
|
const Icon(Icons.error),
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -1052,7 +1052,7 @@ class _InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClie
|
|||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
widgets.isNotEmpty
|
widgets.isNotEmpty
|
||||||
? Container(
|
? SizedBox(
|
||||||
width: 24 + 12.sp * widgets.length - 12.sp,
|
width: 24 + 12.sp * widgets.length - 12.sp,
|
||||||
height: 24.sp,
|
height: 24.sp,
|
||||||
child: Stack(children: widgets),
|
child: Stack(children: widgets),
|
||||||
@ -1127,14 +1127,14 @@ class _InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClie
|
|||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
child: Container(
|
child: Container(
|
||||||
height: 160.sp,
|
height: 160.sp,
|
||||||
padding: EdgeInsets.all(1.0),
|
padding: const EdgeInsets.all(1.0),
|
||||||
child: Stack(
|
child: Stack(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
shape: BoxShape.rectangle,
|
shape: BoxShape.rectangle,
|
||||||
borderRadius: BorderRadius.circular(10.0),
|
borderRadius: BorderRadius.circular(10.0),
|
||||||
gradient: LinearGradient(
|
gradient: const LinearGradient(
|
||||||
colors: [Color(0xFFDD3DF4), Color(0xFF30FFD9)],
|
colors: [Color(0xFFDD3DF4), Color(0xFF30FFD9)],
|
||||||
begin: Alignment.topCenter,
|
begin: Alignment.topCenter,
|
||||||
end: Alignment.bottomCenter,
|
end: Alignment.bottomCenter,
|
||||||
@ -1146,7 +1146,7 @@ class _InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClie
|
|||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
shape: BoxShape.rectangle,
|
shape: BoxShape.rectangle,
|
||||||
borderRadius: BorderRadius.circular(10.0),
|
borderRadius: BorderRadius.circular(10.0),
|
||||||
gradient: LinearGradient(
|
gradient: const LinearGradient(
|
||||||
colors: [Color(0xFF4C3E5F), Color(0xFF324140)],
|
colors: [Color(0xFF4C3E5F), Color(0xFF324140)],
|
||||||
begin: Alignment.topCenter,
|
begin: Alignment.topCenter,
|
||||||
end: Alignment.bottomCenter,
|
end: Alignment.bottomCenter,
|
||||||
@ -1172,7 +1172,7 @@ class _InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClie
|
|||||||
"是否确认退出该圈子。",
|
"是否确认退出该圈子。",
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Color(0xCCF7FAFA), fontSize: 16.sp),
|
color: const Color(0xCCF7FAFA), fontSize: 16.sp),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
@ -1187,7 +1187,7 @@ class _InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClie
|
|||||||
margin: EdgeInsets.only(top: 30.sp),
|
margin: EdgeInsets.only(top: 30.sp),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(17),
|
borderRadius: BorderRadius.circular(17),
|
||||||
gradient: LinearGradient(
|
gradient: const LinearGradient(
|
||||||
colors: [
|
colors: [
|
||||||
Color(0x26FFFFFF),
|
Color(0x26FFFFFF),
|
||||||
Color(0x26FFFFFF),
|
Color(0x26FFFFFF),
|
||||||
@ -1205,7 +1205,7 @@ class _InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClie
|
|||||||
"否",
|
"否",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
fontSize: 12,
|
fontSize: 12.sp,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -1222,7 +1222,7 @@ class _InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClie
|
|||||||
margin: EdgeInsets.only(top: 24.sp),
|
margin: EdgeInsets.only(top: 24.sp),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(17),
|
borderRadius: BorderRadius.circular(17),
|
||||||
gradient: LinearGradient(
|
gradient: const LinearGradient(
|
||||||
colors: [
|
colors: [
|
||||||
Color(0xFF06F9FA),
|
Color(0xFF06F9FA),
|
||||||
Color(0xFFDC5BFD),
|
Color(0xFFDC5BFD),
|
||||||
@ -1240,7 +1240,7 @@ class _InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClie
|
|||||||
"是",
|
"是",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
fontSize: 12,
|
fontSize: 12.sp,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@ -45,9 +45,14 @@ class MinefragmentLogic extends GetxController {
|
|||||||
like_me_count = bean.data.likeMeCount ?? 0;
|
like_me_count = bean.data.likeMeCount ?? 0;
|
||||||
recent_visit_count = bean.data.recentVisitCount ?? 0;
|
recent_visit_count = bean.data.recentVisitCount ?? 0;
|
||||||
joinedCircle = "${"加入了${bean.data.joininterestcount}"}个圈子";
|
joinedCircle = "${"加入了${bean.data.joininterestcount}"}个圈子";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
SharedPreferences sharedPreferences =
|
SharedPreferences sharedPreferences =
|
||||||
await SharedPreferences.getInstance();
|
await SharedPreferences.getInstance();
|
||||||
|
if(bean.data.user.vip>0){
|
||||||
|
vipMsg = "会员时长剩余${bean.data.vipExpireDays}天";
|
||||||
|
}
|
||||||
|
|
||||||
int likeMeCount = sharedPreferences.getInt(SharedPreferencesHelper.LIKEMECOUNT)??0;
|
int likeMeCount = sharedPreferences.getInt(SharedPreferencesHelper.LIKEMECOUNT)??0;
|
||||||
int recentVisitCount = sharedPreferences.getInt(SharedPreferencesHelper.RECENTVISITCOUNT)??0;
|
int recentVisitCount = sharedPreferences.getInt(SharedPreferencesHelper.RECENTVISITCOUNT)??0;
|
||||||
|
|||||||
10
circle_app/lib/app/privacy/binding.dart
Normal file
10
circle_app/lib/app/privacy/binding.dart
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
import 'logic.dart';
|
||||||
|
|
||||||
|
class PrivacyBinding extends Bindings {
|
||||||
|
@override
|
||||||
|
void dependencies() {
|
||||||
|
Get.lazyPut(() => PrivacyLogic());
|
||||||
|
}
|
||||||
|
}
|
||||||
29
circle_app/lib/app/privacy/logic.dart
Normal file
29
circle_app/lib/app/privacy/logic.dart
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
import 'dart:async';
|
||||||
|
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
import '../../util/SharedPreferencesHelper.dart';
|
||||||
|
import '../../util/eventBus.dart';
|
||||||
|
import 'state.dart';
|
||||||
|
|
||||||
|
class PrivacyLogic extends GetxController {
|
||||||
|
int vip = 0;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onInit() {
|
||||||
|
// TODO: implement onInit
|
||||||
|
super.onInit();
|
||||||
|
SharedPreferencesHelper.getInstance().then((sharedPreferences) {
|
||||||
|
vip = sharedPreferences.getInt(SharedPreferencesHelper.VIP);
|
||||||
|
update();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
StreamSubscription subscription = EventBusManager.on<CommentVipEvent>().listen((event) {
|
||||||
|
vip = event.vip;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
bool isOpen = false;
|
||||||
|
final PrivacyState state = PrivacyState();
|
||||||
|
}
|
||||||
5
circle_app/lib/app/privacy/state.dart
Normal file
5
circle_app/lib/app/privacy/state.dart
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
class PrivacyState {
|
||||||
|
PrivacyState() {
|
||||||
|
///Initialize variables
|
||||||
|
}
|
||||||
|
}
|
||||||
117
circle_app/lib/app/privacy/view.dart
Normal file
117
circle_app/lib/app/privacy/view.dart
Normal file
@ -0,0 +1,117 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
import '../../common/Widgets/open_vip_tip/view.dart';
|
||||||
|
import '../../components/my_app_bar.dart';
|
||||||
|
import '../../util/util.dart';
|
||||||
|
import 'logic.dart';
|
||||||
|
|
||||||
|
class PrivacyPage extends StatelessWidget {
|
||||||
|
PrivacyPage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
final logic = Get.find<PrivacyLogic>();
|
||||||
|
final state = Get.find<PrivacyLogic>().state;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
// _getFormat(context);
|
||||||
|
return GetBuilder<PrivacyLogic>(builder: (logic) {
|
||||||
|
return Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
image: DecorationImage(
|
||||||
|
image: AssetImage(getBaseImage("home_back")),
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Scaffold(
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
appBar: const MyAppBar(centerTitle: '隐私设置',),
|
||||||
|
body: SafeArea(
|
||||||
|
child: Container(
|
||||||
|
height: 60.sp,
|
||||||
|
margin: EdgeInsets.only(left: 16.sp, top: 16.sp, right: 16.sp),
|
||||||
|
child: Row(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'神秘隐身',
|
||||||
|
style: TextStyle(
|
||||||
|
color: const Color(0xFFF7FAFA),
|
||||||
|
fontSize: 16.sp,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.only(left: 4.sp),
|
||||||
|
child: Image.asset(
|
||||||
|
getBaseImage("vip"),
|
||||||
|
width: 24,
|
||||||
|
height: 24,
|
||||||
|
// Set visibility based on your logic
|
||||||
|
// For example, `visibility: isVisible ? Visibility.visible : Visibility.gone`
|
||||||
|
// replace `isVisible` with your actual variable or condition
|
||||||
|
// visibility: isVisible ? Visibility.visible : Visibility.gone,
|
||||||
|
// use `visible` instead of `Visibility.visible` if using flutter_svg package
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.only(top: 8.sp),
|
||||||
|
child: Text(
|
||||||
|
'开启后,其他人无法看见您',
|
||||||
|
style: TextStyle(
|
||||||
|
color: const Color(0xFFB7BECC),
|
||||||
|
fontSize: 12.sp,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Align(
|
||||||
|
alignment: Alignment.centerRight,
|
||||||
|
child: GestureDetector(
|
||||||
|
onTap: (){
|
||||||
|
if(logic.vip>0){
|
||||||
|
logic.isOpen = !logic.isOpen;
|
||||||
|
logic.update();
|
||||||
|
}else{
|
||||||
|
showRechargeDialog();
|
||||||
|
showToast("请先升级vip");
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
child: Image.asset(
|
||||||
|
getMineImage(logic.isOpen? "im_toggle_true":"im_toggle"),
|
||||||
|
width: 24.sp,
|
||||||
|
height: 24.sp,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
showRechargeDialog(){
|
||||||
|
Get.bottomSheet(
|
||||||
|
Scaffold(
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
body: Open_vip_tipPage(false),
|
||||||
|
),
|
||||||
|
isScrollControlled: true,
|
||||||
|
enableDrag: false);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@ -71,7 +71,14 @@ class SetupPage extends StatelessWidget {
|
|||||||
// SizedBox(height: 16.sp),
|
// SizedBox(height: 16.sp),
|
||||||
// _buildItemRow('聊天设置', getHomeImage("icon_in")),
|
// _buildItemRow('聊天设置', getHomeImage("icon_in")),
|
||||||
// SizedBox(height: 16.sp),
|
// SizedBox(height: 16.sp),
|
||||||
|
GestureDetector(
|
||||||
|
behavior: HitTestBehavior.opaque,
|
||||||
|
onTap: () {
|
||||||
|
Get.toNamed(AppRoutes.PrivacyActivity);
|
||||||
|
},
|
||||||
|
child: _buildItemRow('隐私设置', getHomeImage("icon_in")),
|
||||||
|
),
|
||||||
|
SizedBox(height: 16.sp),
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
behavior: HitTestBehavior.opaque,
|
behavior: HitTestBehavior.opaque,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
|
|||||||
@ -28,7 +28,7 @@ class VisitorlistPage extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
appBar: MyAppBar(
|
appBar: const MyAppBar(
|
||||||
centerTitle:"最近访客",
|
centerTitle:"最近访客",
|
||||||
),
|
),
|
||||||
body: SafeArea(
|
body: SafeArea(
|
||||||
@ -58,7 +58,7 @@ class VisitorlistPage extends StatelessWidget {
|
|||||||
Get.toNamed(AppRoutes.UserInfoActivity, arguments: item.user.id.toString());
|
Get.toNamed(AppRoutes.UserInfoActivity, arguments: item.user.id.toString());
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
margin: EdgeInsets.only(bottom: 21),
|
margin: const EdgeInsets.only(bottom: 21),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Stack(children: [
|
Stack(children: [
|
||||||
@ -134,7 +134,7 @@ class VisitorlistPage extends StatelessWidget {
|
|||||||
borderRadius: BorderRadius.circular(14),
|
borderRadius: BorderRadius.circular(14),
|
||||||
),
|
),
|
||||||
child: Center(
|
child: Center(
|
||||||
child: Text("私聊", style: TextStyle(fontSize: 14, color: Colors.white)),
|
child: Text("私聊", style: TextStyle(fontSize: 14.sp, color: Colors.white)),
|
||||||
)
|
)
|
||||||
|
|
||||||
,
|
,
|
||||||
@ -154,7 +154,7 @@ class VisitorlistPage extends StatelessWidget {
|
|||||||
Container(
|
Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(17.sp),
|
borderRadius: BorderRadius.circular(17.sp),
|
||||||
gradient: LinearGradient(
|
gradient: const LinearGradient(
|
||||||
colors: [
|
colors: [
|
||||||
Color.fromRGBO(141, 255, 248, 1.0),
|
Color.fromRGBO(141, 255, 248, 1.0),
|
||||||
Color.fromRGBO(181, 211, 255, 1.0),
|
Color.fromRGBO(181, 211, 255, 1.0),
|
||||||
|
|||||||
@ -68,7 +68,10 @@ joiinCircileTipWdiget(String cicleId, String pirce, String oldPrice,
|
|||||||
fontSize: 12.sp)),
|
fontSize: 12.sp)),
|
||||||
)),
|
)),
|
||||||
Platform.isIOS
|
Platform.isIOS
|
||||||
? Container()
|
? Container(
|
||||||
|
height: 1,
|
||||||
|
width: 1,
|
||||||
|
)
|
||||||
: Positioned(
|
: Positioned(
|
||||||
bottom: 108.sp,
|
bottom: 108.sp,
|
||||||
child: Container(
|
child: Container(
|
||||||
|
|||||||
@ -1,9 +1,12 @@
|
|||||||
|
|
||||||
import 'package:circle_app/util/util.dart';
|
import 'package:circle_app/util/util.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
import '../../../network/api.dart';
|
import '../../../network/api.dart';
|
||||||
import '../../../network/dio_manager.dart';
|
import '../../../network/dio_manager.dart';
|
||||||
import '../../../util/PaymentUtils.dart';
|
import '../../../util/PaymentUtils.dart';
|
||||||
|
import '../../../util/SharedPreferencesHelper.dart';
|
||||||
|
import '../../../util/eventBus.dart';
|
||||||
import 'state.dart';
|
import 'state.dart';
|
||||||
|
|
||||||
class Open_vip_tipLogic extends GetxController {
|
class Open_vip_tipLogic extends GetxController {
|
||||||
@ -53,8 +56,11 @@ class Open_vip_tipLogic extends GetxController {
|
|||||||
openAliPay(bean.data.payUrl, (isSuccess, errorMsg) {
|
openAliPay(bean.data.payUrl, (isSuccess, errorMsg) {
|
||||||
if (isSuccess) {
|
if (isSuccess) {
|
||||||
// 处理支付成功
|
// 处理支付成功
|
||||||
|
refreshVipStatus();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// 处理支付失败,errorMessage 可能为 null
|
// 处理支付失败,errorMessage 可能为 null
|
||||||
|
refreshVipStatus();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@ -70,6 +76,7 @@ class Open_vip_tipLogic extends GetxController {
|
|||||||
openWxPay(bean.data, (bool isSuccess, String? errorMessage) {
|
openWxPay(bean.data, (bool isSuccess, String? errorMessage) {
|
||||||
if (isSuccess) {
|
if (isSuccess) {
|
||||||
// 处理支付成功
|
// 处理支付成功
|
||||||
|
refreshVipStatus();
|
||||||
} else {
|
} else {
|
||||||
// 处理支付失败,errorMessage 可能为 null
|
// 处理支付失败,errorMessage 可能为 null
|
||||||
}
|
}
|
||||||
@ -79,6 +86,22 @@ class Open_vip_tipLogic extends GetxController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
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);
|
||||||
|
EventBusManager.fire(CommentVipEvent(bean.data.vipLevel));
|
||||||
|
Get.back();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class PayUrlBean {
|
class PayUrlBean {
|
||||||
@ -155,3 +178,33 @@ class PriceBean {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class VipInfo {
|
||||||
|
int? vipLevel;
|
||||||
|
String? expireDate;
|
||||||
|
int? expireDays;
|
||||||
|
|
||||||
|
VipInfo({
|
||||||
|
this.vipLevel,
|
||||||
|
this.expireDate,
|
||||||
|
this.expireDays,
|
||||||
|
});
|
||||||
|
|
||||||
|
factory VipInfo.fromJson(Map<String, dynamic> json) {
|
||||||
|
return VipInfo(
|
||||||
|
vipLevel: json['vip'] as int,
|
||||||
|
expireDate: json['vip_expire_date'] as String,
|
||||||
|
expireDays: json['vip_expire_days'] as int,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = {};
|
||||||
|
data['vip'] = vipLevel;
|
||||||
|
data['vip_expire_date'] = expireDate;
|
||||||
|
data['vip_expire_days'] = expireDays;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -42,6 +42,13 @@ class Api {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//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';
|
||||||
|
|||||||
@ -35,6 +35,7 @@ import 'package:circle_app/app/offaccount/binding.dart';
|
|||||||
import 'package:circle_app/app/offaccount/view.dart';
|
import 'package:circle_app/app/offaccount/view.dart';
|
||||||
import 'package:circle_app/app/photoinfo/binding.dart';
|
import 'package:circle_app/app/photoinfo/binding.dart';
|
||||||
import 'package:circle_app/app/photoinfo/view.dart';
|
import 'package:circle_app/app/photoinfo/view.dart';
|
||||||
|
import 'package:circle_app/app/privacy/view.dart';
|
||||||
import 'package:circle_app/app/report/binding.dart';
|
import 'package:circle_app/app/report/binding.dart';
|
||||||
import 'package:circle_app/app/report/view.dart';
|
import 'package:circle_app/app/report/view.dart';
|
||||||
import 'package:circle_app/app/select_circle/binding.dart';
|
import 'package:circle_app/app/select_circle/binding.dart';
|
||||||
@ -58,6 +59,7 @@ import 'package:get/get_navigation/src/routes/get_route.dart';
|
|||||||
|
|
||||||
import '../app/blacklist/view.dart';
|
import '../app/blacklist/view.dart';
|
||||||
import '../app/circle/binding.dart';
|
import '../app/circle/binding.dart';
|
||||||
|
import '../app/privacy/binding.dart';
|
||||||
import '../app/splash/view.dart';
|
import '../app/splash/view.dart';
|
||||||
import '../app/visitorlist/binding.dart';
|
import '../app/visitorlist/binding.dart';
|
||||||
import 'app_routers.dart';
|
import 'app_routers.dart';
|
||||||
@ -200,5 +202,10 @@ class AppPages {
|
|||||||
page: () => Sys_notify_listPage(),
|
page: () => Sys_notify_listPage(),
|
||||||
binding: Sys_notify_listBinding(),
|
binding: Sys_notify_listBinding(),
|
||||||
),
|
),
|
||||||
|
GetPage(
|
||||||
|
name: AppRoutes.PrivacyActivity,
|
||||||
|
page: () => PrivacyPage(),
|
||||||
|
binding: PrivacyBinding(),
|
||||||
|
),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -29,4 +29,9 @@ abstract class AppRoutes {
|
|||||||
static const MyFeedBackListActivity = '/mine/MyFeedBackListActivity';
|
static const MyFeedBackListActivity = '/mine/MyFeedBackListActivity';
|
||||||
|
|
||||||
static const Sys_notify_list = '/msg/Sys_notify_list';
|
static const Sys_notify_list = '/msg/Sys_notify_list';
|
||||||
|
|
||||||
|
static const PrivacyActivity = '/user/PrivacyActivity';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -77,7 +77,7 @@ void _listenPay(AlipayResp resp) {
|
|||||||
showToast("重复请求");
|
showToast("重复请求");
|
||||||
break;
|
break;
|
||||||
case 6001:
|
case 6001:
|
||||||
showToast("取消支付");
|
showToast("支付已取消");
|
||||||
break;
|
break;
|
||||||
case 6002:
|
case 6002:
|
||||||
showToast("网络连接出错");
|
showToast("网络连接出错");
|
||||||
|
|||||||
34
circle_app/lib/util/eventBus.dart
Normal file
34
circle_app/lib/util/eventBus.dart
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
|
||||||
|
|
||||||
|
import 'dart:async';
|
||||||
|
|
||||||
|
import 'package:event_bus/event_bus.dart';
|
||||||
|
|
||||||
|
class EventBusManager {
|
||||||
|
|
||||||
|
static EventBus? _eventBus;
|
||||||
|
static EventBus get eventBus {
|
||||||
|
if (_eventBus == null) {
|
||||||
|
_eventBus = EventBus();
|
||||||
|
}
|
||||||
|
return _eventBus!;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void fire(dynamic event) {
|
||||||
|
eventBus.fire(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
static Stream<T> on<T>() {
|
||||||
|
return eventBus.on<T>();
|
||||||
|
}
|
||||||
|
|
||||||
|
static void cancelSubscription(StreamSubscription subscription) {
|
||||||
|
subscription.cancel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class CommentVipEvent{
|
||||||
|
int vip = 0;
|
||||||
|
CommentVipEvent(this.vip);
|
||||||
|
}
|
||||||
@ -90,6 +90,8 @@ dependencies:
|
|||||||
alipay_kit: 5.0.0
|
alipay_kit: 5.0.0
|
||||||
# 微信SDK插件
|
# 微信SDK插件
|
||||||
fluwx: ^3.8.1+1
|
fluwx: ^3.8.1+1
|
||||||
|
#event_bus:
|
||||||
|
event_bus: ^2.0.0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user