修改图片压缩第三方,增加更新提示红点,评价有奖功能
This commit is contained in:
parent
b19a9357a0
commit
2eb774988e
BIN
circle_app/assets/images/mine/edit_good_review.png
Normal file
BIN
circle_app/assets/images/mine/edit_good_review.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.9 KiB |
BIN
circle_app/assets/images/mine/icon_upload.png
Normal file
BIN
circle_app/assets/images/mine/icon_upload.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.0 KiB |
BIN
circle_app/assets/images/mine/share.png
Normal file
BIN
circle_app/assets/images/mine/share.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.6 KiB |
@ -1,5 +1,3 @@
|
|||||||
|
|
||||||
|
|
||||||
import 'package:circle_app/util/util.dart';
|
import 'package:circle_app/util/util.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
@ -8,15 +6,11 @@ import 'package:get/get.dart';
|
|||||||
import '../../components/my_app_bar.dart';
|
import '../../components/my_app_bar.dart';
|
||||||
import 'logic.dart';
|
import 'logic.dart';
|
||||||
|
|
||||||
|
|
||||||
class AboutappPage extends StatelessWidget {
|
class AboutappPage extends StatelessWidget {
|
||||||
AboutappPage({Key? key}) : super(key: key);
|
AboutappPage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
final logic = Get.find<AboutappLogic>();
|
final logic = Get.find<AboutappLogic>();
|
||||||
final state = Get
|
final state = Get.find<AboutappLogic>().state;
|
||||||
.find<AboutappLogic>()
|
|
||||||
.state;
|
|
||||||
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@ -30,7 +24,9 @@ class AboutappPage extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
appBar: const MyAppBar(centerTitle: '关于微乐园',),
|
appBar: const MyAppBar(
|
||||||
|
centerTitle: '关于微乐园',
|
||||||
|
),
|
||||||
body: Scaffold(
|
body: Scaffold(
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
// Replace with your desired color
|
// Replace with your desired color
|
||||||
@ -39,18 +35,19 @@ class AboutappPage extends StatelessWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
|
||||||
children: [
|
children: [
|
||||||
GestureDetector(onTap: (){
|
GestureDetector(
|
||||||
|
onTap: () {
|
||||||
// showToast("13");
|
// showToast("13");
|
||||||
},
|
},
|
||||||
child:Image.asset(
|
child: Image.asset(
|
||||||
getBaseImage("ic_launcher"), // Replace with your image path
|
getBaseImage(
|
||||||
|
"ic_launcher"), // Replace with your image path
|
||||||
width: 100.sp,
|
width: 100.sp,
|
||||||
height: 100.sp,
|
height: 100.sp,
|
||||||
fit: BoxFit.contain,
|
fit: BoxFit.contain,
|
||||||
) ,)
|
),
|
||||||
,
|
),
|
||||||
SizedBox(height: 20.sp),
|
SizedBox(height: 20.sp),
|
||||||
Text(
|
Text(
|
||||||
logic.currentVersion,
|
logic.currentVersion,
|
||||||
@ -105,7 +102,7 @@ class AboutappPage extends StatelessWidget {
|
|||||||
SizedBox(height: 20.sp),
|
SizedBox(height: 20.sp),
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
behavior: HitTestBehavior.opaque,
|
behavior: HitTestBehavior.opaque,
|
||||||
onTap: (){
|
onTap: () {
|
||||||
navigateToUserAgreement();
|
navigateToUserAgreement();
|
||||||
},
|
},
|
||||||
child: Row(
|
child: Row(
|
||||||
@ -125,11 +122,12 @@ class AboutappPage extends StatelessWidget {
|
|||||||
fit: BoxFit.fill,
|
fit: BoxFit.fill,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),),
|
),
|
||||||
|
),
|
||||||
SizedBox(height: 20.sp),
|
SizedBox(height: 20.sp),
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
behavior: HitTestBehavior.opaque,
|
behavior: HitTestBehavior.opaque,
|
||||||
onTap: (){
|
onTap: () {
|
||||||
navigateToPrivacyPolicy();
|
navigateToPrivacyPolicy();
|
||||||
},
|
},
|
||||||
child: Row(
|
child: Row(
|
||||||
@ -149,12 +147,12 @@ class AboutappPage extends StatelessWidget {
|
|||||||
fit: BoxFit.fill,
|
fit: BoxFit.fill,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),)
|
),
|
||||||
,
|
),
|
||||||
SizedBox(height: 20.sp),
|
SizedBox(height: 20.sp),
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
behavior: HitTestBehavior.opaque,
|
behavior: HitTestBehavior.opaque,
|
||||||
onTap: (){
|
onTap: () {
|
||||||
logic.getUpVersion();
|
logic.getUpVersion();
|
||||||
},
|
},
|
||||||
child: Row(
|
child: Row(
|
||||||
@ -167,23 +165,23 @@ class AboutappPage extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
logic.isUpdate? Container(
|
logic.isUpdate
|
||||||
width: 6.sp,
|
? Container(
|
||||||
height: 5.sp,
|
width: 10.sp,
|
||||||
margin: EdgeInsets.only(top: 1.sp, right: 8.sp),
|
height: 10.sp,
|
||||||
decoration: BoxDecoration(
|
margin: EdgeInsets.only(right: 4.sp),
|
||||||
|
decoration: const BoxDecoration(
|
||||||
color: Colors.red,
|
color: Colors.red,
|
||||||
borderRadius: BorderRadius.circular(3.sp),
|
shape: BoxShape.circle),
|
||||||
),
|
)
|
||||||
):Container(),
|
: Container(),
|
||||||
Text(
|
Text(
|
||||||
"",
|
logic.isUpdate ? '有新版本啦' : "",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: const Color(0xFFB7BECC),
|
color: const Color(0xFFB7BECC),
|
||||||
fontSize: 12.sp,
|
fontSize: 14.sp,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(width: 8.sp),
|
|
||||||
Image(
|
Image(
|
||||||
image: AssetImage(getHomeImage("icon_in")),
|
image: AssetImage(getHomeImage("icon_in")),
|
||||||
width: 24.sp,
|
width: 24.sp,
|
||||||
@ -194,13 +192,13 @@ class AboutappPage extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),)
|
),
|
||||||
),),
|
)),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// String url = 'https://www.baidu.com'; // Replace with your desired URL
|
// String url = 'https://www.baidu.com'; // Replace with your desired URL
|
||||||
//
|
//
|
||||||
// void _openBrowser() async {
|
// void _openBrowser() async {
|
||||||
@ -210,5 +208,4 @@ class AboutappPage extends StatelessWidget {
|
|||||||
// throw 'Could not launch $url';
|
// throw 'Could not launch $url';
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -349,8 +349,8 @@ class Call_outLogic extends GetxController {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
uploadQiniu(
|
uploadQiniuVideo(
|
||||||
pickedFile.path, pickedFile.name, CONFIG.CALL_OUT_VIDEO, quToken,
|
File(pickedFile.path), pickedFile.name, CONFIG.CALL_OUT_VIDEO, quToken,
|
||||||
(result) {
|
(result) {
|
||||||
SmartDialog.dismiss();
|
SmartDialog.dismiss();
|
||||||
state.videolist.add(result);
|
state.videolist.add(result);
|
||||||
|
|||||||
@ -118,7 +118,7 @@ class _Call_outPageState extends State<Call_outPage> {
|
|||||||
child: Stack(
|
child: Stack(
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 200.sp,
|
height: 100.sp,
|
||||||
child: TextField(
|
child: TextField(
|
||||||
controller:
|
controller:
|
||||||
controller.textEditingController,
|
controller.textEditingController,
|
||||||
@ -130,7 +130,7 @@ class _Call_outPageState extends State<Call_outPage> {
|
|||||||
setState(() {});
|
setState(() {});
|
||||||
},
|
},
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.white, fontSize: 14.0.sp),
|
color: Colors.white, fontSize: 17.0.sp),
|
||||||
maxLines: 32,
|
maxLines: 32,
|
||||||
maxLength: 200,
|
maxLength: 200,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
@ -147,18 +147,18 @@ class _Call_outPageState extends State<Call_outPage> {
|
|||||||
),
|
),
|
||||||
Positioned(
|
Positioned(
|
||||||
right: 15.sp,
|
right: 15.sp,
|
||||||
top: 190.sp,
|
top: 100.sp,
|
||||||
child: Text(
|
child: Text(
|
||||||
'${controller.textEditingController.text.length}/200',
|
'${controller.textEditingController.text.length}/200',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.white, fontSize: 12.sp),
|
color: Colors.white, fontSize: 12.sp),
|
||||||
)),
|
)),
|
||||||
Container(
|
Container(
|
||||||
margin: EdgeInsets.only(top: 220.sp),
|
margin: EdgeInsets.only(top: 130.sp),
|
||||||
child: _imageAdapter(controller)),
|
child: _imageAdapter(controller)),
|
||||||
Container(
|
Container(
|
||||||
margin: EdgeInsets.only(
|
margin: EdgeInsets.only(
|
||||||
top: 220.sp, left: 15.sp, right: 15.sp),
|
top: 130.sp, left: 15.sp, right: 15.sp),
|
||||||
child: _showVideo(controller),
|
child: _showVideo(controller),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
@ -347,8 +347,8 @@ class _Call_outPageState extends State<Call_outPage> {
|
|||||||
: 240.sp,
|
: 240.sp,
|
||||||
height: controller.videoPlayerController!.value.size.width <
|
height: controller.videoPlayerController!.value.size.width <
|
||||||
controller.videoPlayerController!.value.size.height
|
controller.videoPlayerController!.value.size.height
|
||||||
? 240.sp
|
? 135.sp / controller.videoPlayerController!.value.aspectRatio
|
||||||
: 135.sp,
|
: 240.sp / controller.videoPlayerController!.value.aspectRatio,
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
if (controller.videoPlayerController!.value.isPlaying) {
|
if (controller.videoPlayerController!.value.isPlaying) {
|
||||||
|
|||||||
@ -174,7 +174,7 @@ class _ChatPageState extends State<ChatPage> {
|
|||||||
var data = await Get.toNamed(AppRoutes.UserInfoActivity,arguments: con.userID.toString().split('_').last,preventDuplicates: false);
|
var data = await Get.toNamed(AppRoutes.UserInfoActivity,arguments: con.userID.toString().split('_').last,preventDuplicates: false);
|
||||||
|
|
||||||
},
|
},
|
||||||
child: Text('TA的主页',style: TextStyle(color: const Color(0xFF00FFF4),fontSize:12.sp,fontWeight: FontWeight.w500),),
|
child: Text('查看主页',style: TextStyle(color: const Color(0xFF00FFF4),fontSize:12.sp,fontWeight: FontWeight.w500),),
|
||||||
),
|
),
|
||||||
onPressed: () {},
|
onPressed: () {},
|
||||||
),
|
),
|
||||||
|
|||||||
@ -252,14 +252,27 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
|||||||
pushChatPage(data['data']['account_id'].toString().split("_").last,data['data']['account_id'], bean.user!.nickname!);
|
pushChatPage(data['data']['account_id'].toString().split("_").last,data['data']['account_id'], bean.user!.nickname!);
|
||||||
|
|
||||||
await Future.delayed(Duration(seconds: 1));
|
await Future.delayed(Duration(seconds: 1));
|
||||||
|
|
||||||
|
|
||||||
SharedPreferences sharedPreferences =await SharedPreferences.getInstance();
|
SharedPreferences sharedPreferences =await SharedPreferences.getInstance();
|
||||||
// SharedPreferencesHelper.getInstance().then((sharedPreferences) {
|
// SharedPreferencesHelper.getInstance().then((sharedPreferences) {
|
||||||
int userId = sharedPreferences.getInt(SharedPreferencesHelper.USERID)??0;
|
int userId = sharedPreferences.getInt(SharedPreferencesHelper.USERID)??0;
|
||||||
String avatar = sharedPreferences.getString(SharedPreferencesHelper.AVATAR)??"";
|
String avatar = sharedPreferences.getString(SharedPreferencesHelper.AVATAR)??"";
|
||||||
String name = sharedPreferences.getString(SharedPreferencesHelper.NAME)??"";
|
String name = sharedPreferences.getString(SharedPreferencesHelper.NAME)??"";
|
||||||
|
|
||||||
|
bool isContain = false;
|
||||||
|
for (var info in bean.chat!.users!) {
|
||||||
|
if (info.id == userId) {
|
||||||
|
isContain = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!isContain) {
|
||||||
bean.chat!.users!.add(Users(avatar: avatar,id: userId,nickname: name));
|
bean.chat!.users!.add(Users(avatar: avatar,id: userId,nickname: name));
|
||||||
|
bean.chat!.count = bean.chat!.count! + 1;
|
||||||
widget.logic.update();
|
widget.logic.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
@ -265,8 +265,22 @@ class _LikeViewState extends State<LikeView>
|
|||||||
sharedPreferences.getString(SharedPreferencesHelper.AVATAR) ?? "";
|
sharedPreferences.getString(SharedPreferencesHelper.AVATAR) ?? "";
|
||||||
String name =
|
String name =
|
||||||
sharedPreferences.getString(SharedPreferencesHelper.NAME) ?? "";
|
sharedPreferences.getString(SharedPreferencesHelper.NAME) ?? "";
|
||||||
// bean.chat!.users!.add(Users(avatar: avatar,id: userId,nickname: name));
|
|
||||||
// widget.logic.update();
|
bool isContain = false;
|
||||||
|
for (var info in bean.chat!.users!) {
|
||||||
|
if (info.id == userId) {
|
||||||
|
isContain = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!isContain) {
|
||||||
|
bean.chat!.users!.add(Users(avatar: avatar,id: userId,nickname: name));
|
||||||
|
bean.chat!.count = bean.chat!.count + 1;
|
||||||
|
setState(() {
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import 'dart:io';
|
|||||||
|
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_install_app/flutter_install_app.dart';
|
// import 'package:flutter_install_app/flutter_install_app.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
|
|
||||||
@ -260,7 +260,7 @@ class _CustomDialogState extends State<UpdateDialog> {
|
|||||||
// SmartDialog.dismiss();
|
// SmartDialog.dismiss();
|
||||||
print(error);
|
print(error);
|
||||||
});
|
});
|
||||||
await AppInstaller.installApk(filePath, actionRequired: false);
|
// await AppInstaller.installApk(filePath, actionRequired: false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
10
circle_app/lib/app/externalshare/binding.dart
Normal file
10
circle_app/lib/app/externalshare/binding.dart
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
import 'logic.dart';
|
||||||
|
|
||||||
|
class ExternalshareBinding extends Bindings {
|
||||||
|
@override
|
||||||
|
void dependencies() {
|
||||||
|
Get.lazyPut(() => ExternalshareLogic());
|
||||||
|
}
|
||||||
|
}
|
||||||
67
circle_app/lib/app/externalshare/logic.dart
Normal file
67
circle_app/lib/app/externalshare/logic.dart
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
|
||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
|
import 'package:circle_app/app/login/login/logic.dart';
|
||||||
|
import 'package:circle_app/util/util.dart';
|
||||||
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:image_picker/image_picker.dart';
|
||||||
|
|
||||||
|
import '../../common/config.dart';
|
||||||
|
import '../../network/api.dart';
|
||||||
|
import '../../network/dio_manager.dart';
|
||||||
|
import '../../util/qiniu.dart';
|
||||||
|
import 'state.dart';
|
||||||
|
|
||||||
|
class ExternalshareLogic extends GetxController {
|
||||||
|
final ExternalshareState state = ExternalshareState();
|
||||||
|
|
||||||
|
final ImagePicker _picker = ImagePicker();
|
||||||
|
|
||||||
|
var quToken = '';
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onInit() async{
|
||||||
|
super.onInit();
|
||||||
|
var data =
|
||||||
|
await DioManager.instance.get(url: Api.getqiniuToken, params: {});
|
||||||
|
|
||||||
|
if(data['cpde'] == 200){
|
||||||
|
quToken = data['data']['token'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
updateExternalShare()async{
|
||||||
|
if(state.imaglist==0){
|
||||||
|
showOKToast("请上传图片");
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
String jsonString = jsonEncode(state.imaglist);
|
||||||
|
var data = await DioManager.instance.post(url:' Api.UPDATE_EXTERNAL_SHARE', params: {
|
||||||
|
'picUrl':jsonString
|
||||||
|
});
|
||||||
|
if(data["code"]==200){
|
||||||
|
Get.back();
|
||||||
|
}
|
||||||
|
showOKToast(data["msg"]);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Future getImageFile() async {
|
||||||
|
try {
|
||||||
|
final XFile? pickedFile = await _picker.pickImage(
|
||||||
|
source: ImageSource.gallery,
|
||||||
|
);
|
||||||
|
if(null==pickedFile){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
SmartDialog.showLoading();
|
||||||
|
uploadImage(quToken,pickedFile,CONFIG.USER_ALBUM_IMAGE,(result){
|
||||||
|
SmartDialog.dismiss(force: true);
|
||||||
|
state.imaglist.add(result);
|
||||||
|
update();
|
||||||
|
});
|
||||||
|
} catch (_) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
6
circle_app/lib/app/externalshare/state.dart
Normal file
6
circle_app/lib/app/externalshare/state.dart
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
class ExternalshareState {
|
||||||
|
ExternalshareState() {
|
||||||
|
///Initialize variables
|
||||||
|
}
|
||||||
|
List<String> imaglist = [];
|
||||||
|
}
|
||||||
257
circle_app/lib/app/externalshare/view.dart
Normal file
257
circle_app/lib/app/externalshare/view.dart
Normal file
@ -0,0 +1,257 @@
|
|||||||
|
import 'package:circle_app/common/colors/app_color.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
import '../../components/my_app_bar.dart';
|
||||||
|
import '../../router/app_routers.dart';
|
||||||
|
import '../../util/util.dart';
|
||||||
|
import 'logic.dart';
|
||||||
|
|
||||||
|
class ExternalsharePage extends StatelessWidget {
|
||||||
|
ExternalsharePage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
final logic = Get.find<ExternalshareLogic>();
|
||||||
|
final state = Get.find<ExternalshareLogic>().state;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
// _getFormat(context);
|
||||||
|
return GetBuilder<ExternalshareLogic>(builder: (logic) {
|
||||||
|
return Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
image: DecorationImage(
|
||||||
|
image: AssetImage(getBaseImage("bg")),
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Scaffold(
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
appBar: const MyAppBar(
|
||||||
|
centerTitle: '站外分享',
|
||||||
|
),
|
||||||
|
body: Container(
|
||||||
|
height: Get.height,
|
||||||
|
child: Stack(
|
||||||
|
children: [
|
||||||
|
SingleChildScrollView(
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(16.0),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
"温馨提示:站外分享除了能享受'邀请有奖'的各种奖励,还能获得下述的奖励哦~",
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(height: 18),
|
||||||
|
Text(
|
||||||
|
"奖励说明",
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 16.sp,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(height: 8.sp),
|
||||||
|
buildRichText(
|
||||||
|
"1. 站外平台粉丝达到1000人以上,发新动态置顶一天,可获得1000豆子;"),
|
||||||
|
SizedBox(height: 8.sp),
|
||||||
|
buildRichText("2. 邀请海报发到微信朋友圈或QQ动态(删除无效),可获得100豆子;"),
|
||||||
|
SizedBox(height: 8.sp),
|
||||||
|
buildRichText(
|
||||||
|
"3. 分享到圈内群聊(QQ、微信、B站、快手、抖音、微博、推特或其他平台均有效),群里有多少人点击就获得多少豆子。"),
|
||||||
|
SizedBox(height: 24.sp),
|
||||||
|
|
||||||
|
buildRichText("*上传分享截图"),
|
||||||
|
SizedBox(height: 8.sp),
|
||||||
|
buildRichText("截图时间跟发布时间需要间隔1小时以上才有效", fontSize: 14.sp),
|
||||||
|
SizedBox(height: 8.sp),
|
||||||
|
Container(
|
||||||
|
height: 380.sp,
|
||||||
|
// margin: EdgeInsets.only(left: 16.sp, right: 16.sp),
|
||||||
|
child: GridView.builder(
|
||||||
|
gridDelegate:
|
||||||
|
SliverGridDelegateWithFixedCrossAxisCount(
|
||||||
|
crossAxisCount: 3, // 每行显示的项目数量
|
||||||
|
),
|
||||||
|
itemCount: logic.state.imaglist.length < 9
|
||||||
|
? logic.state.imaglist.length + 1
|
||||||
|
: logic.state.imaglist.length,
|
||||||
|
// Replace with your item count
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
if (index == 0 &&
|
||||||
|
logic.state.imaglist.length < 9) {
|
||||||
|
// 第一个项目,显示固定的图片
|
||||||
|
return GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
logic.getImageFile();
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
margin: EdgeInsets.all(5.sp),
|
||||||
|
child: Image(
|
||||||
|
image: AssetImage(
|
||||||
|
getMineImage("icon_img_add")),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
// 后续项目,根据接口获取数据
|
||||||
|
// 假设通过接口获取到的数据存储在一个名为 data 的列表中
|
||||||
|
// var itemData = data[index - 1]; // 减去第一个固定图片的索引
|
||||||
|
return Container(
|
||||||
|
// margin: EdgeInsets.all(5.sp),
|
||||||
|
child: Center(
|
||||||
|
child: _buildImageItem(
|
||||||
|
logic.state.imaglist.length < 9
|
||||||
|
? logic.state.imaglist[index - 1]
|
||||||
|
: logic.state.imaglist[index],
|
||||||
|
// Replace with your item count
|
||||||
|
logic,
|
||||||
|
logic.state.imaglist.length < 9
|
||||||
|
? index - 1
|
||||||
|
: index),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
Positioned(
|
||||||
|
bottom: 0,
|
||||||
|
left: 20.sp,
|
||||||
|
right: 20.sp,
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
|
children: [
|
||||||
|
//TODO 海报这版不做
|
||||||
|
// Expanded(
|
||||||
|
// child: Container(
|
||||||
|
// margin: EdgeInsets.only(bottom: 35),
|
||||||
|
// child: ElevatedButton(
|
||||||
|
// onPressed: () {
|
||||||
|
// // TODO: 添加获取邀请海报的点击事件
|
||||||
|
// },
|
||||||
|
// style: ElevatedButton.styleFrom(
|
||||||
|
// primary: Color(0xFF21BEAB),
|
||||||
|
// shape: RoundedRectangleBorder(
|
||||||
|
// borderRadius: BorderRadius.circular(20), // 设置圆角的大小
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// child: Text(
|
||||||
|
// "获取邀请海报",
|
||||||
|
// style: TextStyle(
|
||||||
|
// color: Colors.white,
|
||||||
|
// fontSize: 12,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// SizedBox(width: 30.sp,),
|
||||||
|
|
||||||
|
Expanded(
|
||||||
|
child: Container(
|
||||||
|
margin: EdgeInsets.only(bottom: 35, left: 20, right: 20),
|
||||||
|
child: ElevatedButton(
|
||||||
|
onPressed: () {
|
||||||
|
logic.updateExternalShare();
|
||||||
|
},
|
||||||
|
style: ElevatedButton.styleFrom(
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(20), // 设置圆角的大小
|
||||||
|
),
|
||||||
|
padding: EdgeInsets.zero, // Remove default button padding
|
||||||
|
elevation: 0, // Remove button shad
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
primary: null, // Remove background color
|
||||||
|
),
|
||||||
|
child: Ink(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
gradient:AppColor.mainVerLinearGradient,
|
||||||
|
borderRadius: BorderRadius.circular(20), // 设置圆角的大小
|
||||||
|
),
|
||||||
|
child: Container(
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 50, vertical: 10),
|
||||||
|
child: Text(
|
||||||
|
"提交奖励申请",
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 14.sp,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildImageItem(String url, ExternalshareLogic logic, int index) {
|
||||||
|
return Stack(
|
||||||
|
children: [
|
||||||
|
ClipRRect(
|
||||||
|
borderRadius: BorderRadius.circular(0.0),
|
||||||
|
child: Container(
|
||||||
|
width: double.infinity, // 设置容器宽度为屏幕宽度
|
||||||
|
height: double.infinity, // 设置容器高度为屏幕高度
|
||||||
|
child: ClipRRect(
|
||||||
|
borderRadius: BorderRadius.circular(0.0),
|
||||||
|
child: GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
Get.toNamed(AppRoutes.Swiper, arguments: {
|
||||||
|
'imaglist': logic.state.imaglist,
|
||||||
|
'index': index
|
||||||
|
});
|
||||||
|
},
|
||||||
|
child: Image.network(
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
url,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Positioned(
|
||||||
|
top: 0,
|
||||||
|
right: 0,
|
||||||
|
child: GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
logic.state.imaglist.removeAt(index);
|
||||||
|
logic.update();
|
||||||
|
},
|
||||||
|
child: Image(
|
||||||
|
image: AssetImage(getMineImage("icon_img_del")),
|
||||||
|
width: 20.sp,
|
||||||
|
height: 20.sp,
|
||||||
|
),
|
||||||
|
))
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget buildRichText(String text, {double fontSize = 16}) {
|
||||||
|
return RichText(
|
||||||
|
text: TextSpan(
|
||||||
|
text: text,
|
||||||
|
style: TextStyle(color: Colors.white, fontSize: fontSize),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
10
circle_app/lib/app/good_reviews/binding.dart
Normal file
10
circle_app/lib/app/good_reviews/binding.dart
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
import 'logic.dart';
|
||||||
|
|
||||||
|
class Good_reviewsBinding extends Bindings {
|
||||||
|
@override
|
||||||
|
void dependencies() {
|
||||||
|
Get.lazyPut(() => Good_reviewsLogic());
|
||||||
|
}
|
||||||
|
}
|
||||||
79
circle_app/lib/app/good_reviews/logic.dart
Normal file
79
circle_app/lib/app/good_reviews/logic.dart
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:image_picker/image_picker.dart';
|
||||||
|
import 'package:circle_app/common/config.dart';
|
||||||
|
import 'package:circle_app/network/api.dart';
|
||||||
|
import 'package:circle_app/network/dio_manager.dart';
|
||||||
|
import 'package:circle_app/util/qiniu.dart';
|
||||||
|
import 'package:circle_app/util/util.dart';
|
||||||
|
|
||||||
|
class Good_reviewsLogic extends GetxController {
|
||||||
|
|
||||||
|
List imgUrl = [];
|
||||||
|
List<String> tipImgUrl = [];
|
||||||
|
final ImagePicker _picker = ImagePicker();
|
||||||
|
var quToken = '';
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onInit() {
|
||||||
|
// TODO: implement onInit
|
||||||
|
super.onInit();
|
||||||
|
loadToken();
|
||||||
|
loadTipImgUrl();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future getImageFile() async {
|
||||||
|
try {
|
||||||
|
|
||||||
|
final XFile? pickedFile = await _picker.pickImage(
|
||||||
|
source: ImageSource.gallery,
|
||||||
|
);
|
||||||
|
if (null == pickedFile) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
SmartDialog.showLoading();
|
||||||
|
uploadImage(quToken, pickedFile, CONFIG.USER_INFO_AVATAR, (result) async {
|
||||||
|
imgUrl.add(result);
|
||||||
|
update();
|
||||||
|
SmartDialog.dismiss();
|
||||||
|
});
|
||||||
|
} catch (e) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
void loadTipImgUrl() async {
|
||||||
|
// var result =
|
||||||
|
// await DioManager.instance.get(url: 'Api.queryPositiveFeesBackExample', params: {});
|
||||||
|
// if (result['code'] == 10000) {
|
||||||
|
// List list = result['list'];
|
||||||
|
// for (var element in list) {
|
||||||
|
// tipImgUrl.add(element);
|
||||||
|
// }
|
||||||
|
// update();
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
void loadToken() async {
|
||||||
|
var qiniudata =
|
||||||
|
await DioManager.instance.get(url: Api.getqiniuToken, params: {});
|
||||||
|
|
||||||
|
if (qiniudata['code'] == 200) {
|
||||||
|
quToken = qiniudata['data']['token'].toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void sendGoodReview() async {
|
||||||
|
var albumList = [];
|
||||||
|
for (var url in imgUrl) {
|
||||||
|
Map info = {'type':1,'url':url};
|
||||||
|
albumList.add(info);
|
||||||
|
}
|
||||||
|
var result =
|
||||||
|
await DioManager.instance.post(url: Api.getFeedBack, params: {'type':2,'album':albumList});
|
||||||
|
if (result['code'] == 200) {
|
||||||
|
showOKToast('提交成功,等待审核');
|
||||||
|
Get.back();
|
||||||
|
print(result);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
163
circle_app/lib/app/good_reviews/view.dart
Normal file
163
circle_app/lib/app/good_reviews/view.dart
Normal file
@ -0,0 +1,163 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:circle_app/components/my_app_bar.dart';
|
||||||
|
import 'package:circle_app/router/app_routers.dart';
|
||||||
|
import 'package:circle_app/util/util.dart';
|
||||||
|
|
||||||
|
import 'logic.dart';
|
||||||
|
|
||||||
|
class Good_reviewsPage extends StatelessWidget {
|
||||||
|
Good_reviewsPage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
final logic = Get.find<Good_reviewsLogic>();
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return GetBuilder<Good_reviewsLogic>(builder: (logic) {
|
||||||
|
List<Widget> widgets = [];
|
||||||
|
List<Widget> tipwidgets = [];
|
||||||
|
if (logic.imgUrl.isEmpty) {
|
||||||
|
widgets.add(GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
logic.getImageFile();
|
||||||
|
},
|
||||||
|
child: Image.asset(
|
||||||
|
getMineImage(
|
||||||
|
'icon_upload',
|
||||||
|
),
|
||||||
|
width: 100.sp,
|
||||||
|
),
|
||||||
|
));
|
||||||
|
} else {
|
||||||
|
for (var element in logic.imgUrl) {
|
||||||
|
widgets.add(Stack(
|
||||||
|
children: [
|
||||||
|
ClipRRect(
|
||||||
|
borderRadius: BorderRadius.circular(8.sp),
|
||||||
|
child: Image.network(
|
||||||
|
element,
|
||||||
|
width: 100.sp,
|
||||||
|
height: 100.sp,
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
)),
|
||||||
|
Positioned(
|
||||||
|
top: 0,
|
||||||
|
right: 0,
|
||||||
|
child: GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
// showToast("删除");
|
||||||
|
logic.imgUrl.remove(element);
|
||||||
|
logic.update();
|
||||||
|
},
|
||||||
|
child: Image(
|
||||||
|
image: AssetImage(getMineImage("icon_img_del")),
|
||||||
|
width: 20.sp,
|
||||||
|
height: 20.sp,
|
||||||
|
),
|
||||||
|
))
|
||||||
|
],
|
||||||
|
));
|
||||||
|
widgets.add(SizedBox(width: 10.sp,));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (logic.imgUrl.length < 3) {
|
||||||
|
widgets.add(GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
logic.getImageFile();
|
||||||
|
},
|
||||||
|
child: Image.asset(
|
||||||
|
getMineImage(
|
||||||
|
'icon_upload',
|
||||||
|
),
|
||||||
|
width: 100.sp,
|
||||||
|
),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (var element in logic.tipImgUrl) {
|
||||||
|
tipwidgets.add(
|
||||||
|
GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
Get.toNamed(AppRoutes.Swiper,arguments: {
|
||||||
|
'imaglist': logic.tipImgUrl,
|
||||||
|
'index': logic.tipImgUrl.indexOf(element)
|
||||||
|
});
|
||||||
|
},
|
||||||
|
child: ClipRRect(
|
||||||
|
borderRadius: BorderRadius.circular(8.sp),
|
||||||
|
child: Image.network(
|
||||||
|
element,
|
||||||
|
width: 100.sp,
|
||||||
|
height: 100.sp,
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
tipwidgets.add(SizedBox(width: 10.sp,));
|
||||||
|
}
|
||||||
|
|
||||||
|
return Scaffold(
|
||||||
|
backgroundColor: Colors.black,
|
||||||
|
appBar: MyAppBar(
|
||||||
|
centerTitle: '反馈截图',
|
||||||
|
actionWdiget: GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
if (logic.imgUrl.isEmpty) {
|
||||||
|
showOKToast('请上传评价截图:(至少一张)');
|
||||||
|
} else {
|
||||||
|
logic.sendGoodReview();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
child: Text(
|
||||||
|
'提交',
|
||||||
|
style: TextStyle(color: Colors.white, fontSize: 16.sp),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
body: Padding(
|
||||||
|
padding: EdgeInsets.only(left: 15.sp, right: 15.sp, top: 15.sp),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'感谢您的支持,请填写评价反馈,我们将在您提交反馈之后的24小时之内核实并发放奖励。',
|
||||||
|
style: TextStyle(color: Color(0xFFF7FAFA), fontSize: 16.sp),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 12.sp,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'请上传评价截图:(至少一张)',
|
||||||
|
style: TextStyle(color: Color(0xFFF7FAFA), fontSize: 16.sp),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.only(top: 10),
|
||||||
|
height: 100.sp,
|
||||||
|
child: Row(
|
||||||
|
children: widgets,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
// SizedBox(
|
||||||
|
// height: 20.sp,
|
||||||
|
// ),
|
||||||
|
//
|
||||||
|
// Text(
|
||||||
|
// '示例:',
|
||||||
|
// style: TextStyle(color: Color(0xFFF7FAFA), fontSize: 14.sp),
|
||||||
|
// ),
|
||||||
|
// Container(
|
||||||
|
// margin: EdgeInsets.only(top: 10),
|
||||||
|
// height: 100.sp,
|
||||||
|
// child: Row(
|
||||||
|
// children: tipwidgets,
|
||||||
|
// ),
|
||||||
|
// )
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,6 +1,7 @@
|
|||||||
import 'package:circle_app/app/circle/logic.dart';
|
import 'package:circle_app/app/circle/logic.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
import '../minefragment/logic.dart';
|
||||||
import 'logic.dart';
|
import 'logic.dart';
|
||||||
|
|
||||||
class HomeBinding extends Bindings {
|
class HomeBinding extends Bindings {
|
||||||
@ -8,5 +9,6 @@ class HomeBinding extends Bindings {
|
|||||||
void dependencies() {
|
void dependencies() {
|
||||||
Get.lazyPut(() => HomeLogic());
|
Get.lazyPut(() => HomeLogic());
|
||||||
Get.lazyPut(() => CircleLogic());
|
Get.lazyPut(() => CircleLogic());
|
||||||
|
Get.lazyPut(() => MinefragmentLogic());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,7 +28,7 @@ import '../minefragment/view.dart';
|
|||||||
import '../msg/view.dart';
|
import '../msg/view.dart';
|
||||||
import 'state.dart';
|
import 'state.dart';
|
||||||
|
|
||||||
class HomeLogic extends GetxController {
|
class HomeLogic extends GetxController with WidgetsBindingObserver {
|
||||||
late TabController tabController;
|
late TabController tabController;
|
||||||
|
|
||||||
int currentIndex = 0;
|
int currentIndex = 0;
|
||||||
@ -43,6 +43,11 @@ class HomeLogic extends GetxController {
|
|||||||
|
|
||||||
final RxBool showcirlceUnred = false.obs;
|
final RxBool showcirlceUnred = false.obs;
|
||||||
late V2TimSimpleMsgListener msgListener;
|
late V2TimSimpleMsgListener msgListener;
|
||||||
|
InterestsBean mycircle = InterestsBean(lists: []);
|
||||||
|
|
||||||
|
StreamSubscription? sub;
|
||||||
|
|
||||||
|
bool isUpdateVersion = false;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onClose() {
|
void onClose() {
|
||||||
@ -50,7 +55,8 @@ class HomeLogic extends GetxController {
|
|||||||
super.onClose();
|
super.onClose();
|
||||||
TencentImSDKPlugin.v2TIMManager
|
TencentImSDKPlugin.v2TIMManager
|
||||||
.v2TIMMessageManager.removeAdvancedMsgListener();
|
.v2TIMMessageManager.removeAdvancedMsgListener();
|
||||||
|
WidgetsBinding.instance.removeObserver(this);
|
||||||
|
sub!.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -66,14 +72,21 @@ class HomeLogic extends GetxController {
|
|||||||
tabs.add(MsgPage());
|
tabs.add(MsgPage());
|
||||||
tabs.add(MinefragmentPage());
|
tabs.add(MinefragmentPage());
|
||||||
|
|
||||||
// EventBusManager.on<RefreshUnread>().listen((event) {
|
sub = EventBusManager.on<RefreshUnread>().listen((event) {
|
||||||
// getUnreadSize();
|
getUnreadSize();
|
||||||
// });
|
});
|
||||||
// getUnreadSize();
|
// getUnreadSize();
|
||||||
|
|
||||||
|
|
||||||
|
WidgetsBinding.instance.addObserver(this);
|
||||||
|
|
||||||
|
addMsgListener();
|
||||||
|
|
||||||
|
checkVersion();
|
||||||
|
loadMyCircleData();
|
||||||
|
}
|
||||||
|
|
||||||
|
void addMsgListener() {
|
||||||
msgListener = V2TimSimpleMsgListener(onRecvC2CTextMessage: (
|
msgListener = V2TimSimpleMsgListener(onRecvC2CTextMessage: (
|
||||||
msgID,
|
msgID,
|
||||||
userInfo,
|
userInfo,
|
||||||
@ -151,11 +164,31 @@ class HomeLogic extends GetxController {
|
|||||||
|
|
||||||
|
|
||||||
_messageService.addSimpleMsgListener(listener: msgListener);
|
_messageService.addSimpleMsgListener(listener: msgListener);
|
||||||
|
|
||||||
checkVersion();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@override
|
||||||
|
void didChangeAppLifecycleState(AppLifecycleState state) {
|
||||||
|
switch (state) {
|
||||||
|
case AppLifecycleState.inactive:
|
||||||
|
break;
|
||||||
|
|
||||||
|
case AppLifecycleState.resumed: //从后台切换前台,界面可见
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case AppLifecycleState.paused: // 界面不可见,后台
|
||||||
|
addBadge();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case AppLifecycleState.detached: // APP结束时调用
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Future<void> checkVersion() async {
|
Future<void> checkVersion() async {
|
||||||
var data = await DioManager.instance.get(url: Api.APP_VERSION);
|
var data = await DioManager.instance.get(url: Api.APP_VERSION);
|
||||||
@ -165,6 +198,7 @@ class HomeLogic extends GetxController {
|
|||||||
showReportDialog(Get.context!, bean.data.constraint == 0, bean.data);
|
showReportDialog(Get.context!, bean.data.constraint == 0, bean.data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setLike(String userId) async {
|
setLike(String userId) async {
|
||||||
var data = await DioManager.instance.post(
|
var data = await DioManager.instance.post(
|
||||||
url: "${Api.setLike + userId}/follow",
|
url: "${Api.setLike + userId}/follow",
|
||||||
@ -197,12 +231,12 @@ class HomeLogic extends GetxController {
|
|||||||
unreadSIze.value = getTotalUnreadMessageCountRes.data.toString();
|
unreadSIze.value = getTotalUnreadMessageCountRes.data.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Platform.isAndroid) {
|
|
||||||
setOfflinePushStatus(status: AppStatus.foreground);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -235,6 +269,12 @@ class HomeLogic extends GetxController {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addBadge() {
|
||||||
|
if (Platform.isAndroid) {
|
||||||
|
setOfflinePushStatus(status: AppStatus.foreground);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void showReportDialog(
|
void showReportDialog(
|
||||||
BuildContext context, bool isDismiss, UpdateInfo updateInfo) {
|
BuildContext context, bool isDismiss, UpdateInfo updateInfo) {
|
||||||
showDialog(
|
showDialog(
|
||||||
@ -284,4 +324,52 @@ class HomeLogic extends GetxController {
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
loadMyCircleData() async {
|
||||||
|
var data = await DioManager.instance
|
||||||
|
.get(url: Api.getMyCircleAll);
|
||||||
|
|
||||||
|
// var bean = BaseResponse<InterestsBean>.fromJson(
|
||||||
|
// data, (data) => InterestsBean.fromJson(data));
|
||||||
|
|
||||||
|
if (data['code'] == 200) {
|
||||||
|
List circleList = data['data'];
|
||||||
|
if (circleList.isNotEmpty) {
|
||||||
|
List<Circle> infoList = [];
|
||||||
|
circleList.forEach((element) {
|
||||||
|
var info = Circle.fromJson(element);
|
||||||
|
infoList.add(info);
|
||||||
|
});
|
||||||
|
mycircle.lists = infoList;
|
||||||
|
if (currentIndex >= mycircle.lists.length - 1) {
|
||||||
|
currentIndex = mycircle.lists.length -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
loadCalloutsNew();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
loadCalloutsNew() async {
|
||||||
|
List<String> idList = [];
|
||||||
|
mycircle.lists.forEach((element) {
|
||||||
|
idList.add(element.id.toString());
|
||||||
|
});
|
||||||
|
var data = await DioManager.instance.post(
|
||||||
|
url:Api.calloutsNew,
|
||||||
|
params: {"interestIds":idList});
|
||||||
|
|
||||||
|
if (data['code'] == 200) {
|
||||||
|
List infoList = data['data'];
|
||||||
|
bool isHasNew = false;
|
||||||
|
if (infoList.isNotEmpty) {
|
||||||
|
infoList.forEach((element) {
|
||||||
|
if (element['hasNew']) {
|
||||||
|
isHasNew = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
showcirlceUnred.value = isHasNew;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,6 +8,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
import '../../main.dart';
|
||||||
import 'logic.dart';
|
import 'logic.dart';
|
||||||
|
|
||||||
class HomePage extends StatefulWidget {
|
class HomePage extends StatefulWidget {
|
||||||
@ -18,7 +19,7 @@ class HomePage extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _HomePageState extends State<HomePage>
|
class _HomePageState extends State<HomePage>
|
||||||
with AutomaticKeepAliveClientMixin, SingleTickerProviderStateMixin {
|
with AutomaticKeepAliveClientMixin, SingleTickerProviderStateMixin,RouteAware {
|
||||||
@override
|
@override
|
||||||
bool get wantKeepAlive => true;
|
bool get wantKeepAlive => true;
|
||||||
|
|
||||||
@ -34,6 +35,39 @@ class _HomePageState extends State<HomePage>
|
|||||||
animationDuration: Duration.zero);
|
animationDuration: Duration.zero);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void didChangeDependencies() {
|
||||||
|
// TODO: implement didChangeDependencies
|
||||||
|
super.didChangeDependencies();
|
||||||
|
|
||||||
|
/// 路由订阅
|
||||||
|
routeObserver.subscribe(this, ModalRoute.of(context) as PageRoute);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void didPopNext() {
|
||||||
|
print('didPopNext');
|
||||||
|
logic.getUnreadSize();
|
||||||
|
}
|
||||||
|
|
||||||
|
///当前页面进入时触发
|
||||||
|
void didPush() {
|
||||||
|
print('didPopNext');
|
||||||
|
|
||||||
|
}
|
||||||
|
void didPop() {
|
||||||
|
print('didPop');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
// TODO: implement dispose
|
||||||
|
super.dispose();
|
||||||
|
routeObserver.unsubscribe(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return GetBuilder(builder: (HomeLogic controller) {
|
return GetBuilder(builder: (HomeLogic controller) {
|
||||||
|
|||||||
@ -54,6 +54,7 @@ class _LikePageState extends State<LikePage> with RouteAware {
|
|||||||
print('didPopNext');
|
print('didPopNext');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void didPop() {
|
void didPop() {
|
||||||
print('didPop');
|
print('didPop');
|
||||||
}
|
}
|
||||||
@ -151,18 +152,18 @@ class _LikePageState extends State<LikePage> with RouteAware {
|
|||||||
},
|
},
|
||||||
child: Image.asset(
|
child: Image.asset(
|
||||||
getCircleImage('send_msg'),
|
getCircleImage('send_msg'),
|
||||||
width: 60.sp,
|
width: 70.sp,
|
||||||
)))
|
)))
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
goDetailPage(Circle bean,int index) async {
|
goDetailPage(Circle bean,int index) async {
|
||||||
if (!bean.isJoin) {
|
// if (!bean.isJoin) {
|
||||||
await logic.outCircle(
|
// await logic.outCircle(
|
||||||
bean.id.toString(),
|
// bean.id.toString(),
|
||||||
bean.isJoin);
|
// bean.isJoin);
|
||||||
}
|
// }
|
||||||
|
|
||||||
var result = await Get.toNamed(AppRoutes.Signal_circle_list, arguments: bean.id);
|
var result = await Get.toNamed(AppRoutes.Signal_circle_list, arguments: bean.id);
|
||||||
var data = await DioManager.instance.get(
|
var data = await DioManager.instance.get(
|
||||||
|
|||||||
@ -240,7 +240,7 @@ class Complete_materialLogic extends GetxController {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
if(genderTagList.isEmpty){
|
if(genderTagList.isEmpty){
|
||||||
showOKToast("请选择你想认识的人");
|
showOKToast("请点击选择你想认识的人");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -319,7 +319,7 @@ class Complete_materialLogic extends GetxController {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
if(genderTagList.isEmpty){
|
if(genderTagList.isEmpty){
|
||||||
showOKToast("请选择你想认识的人");
|
showOKToast("请点击选择你想认识的人");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -103,6 +103,10 @@ class _Complete_materialPageState extends State<Complete_materialPage> {
|
|||||||
height: 86.sp,
|
height: 86.sp,
|
||||||
)
|
)
|
||||||
: ClipOval(
|
: ClipOval(
|
||||||
|
child: Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
gradient: AppColor.mainVerLinearGradient
|
||||||
|
),
|
||||||
child: CachedNetworkImage(
|
child: CachedNetworkImage(
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
imageUrl: controller.headUrl,
|
imageUrl: controller.headUrl,
|
||||||
@ -111,6 +115,7 @@ class _Complete_materialPageState extends State<Complete_materialPage> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 15.sp,
|
height: 15.sp,
|
||||||
),
|
),
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import '../../network/dio_manager.dart';
|
|||||||
import '../../util/SharedPreferencesHelper.dart';
|
import '../../util/SharedPreferencesHelper.dart';
|
||||||
import '../../util/eventBus.dart';
|
import '../../util/eventBus.dart';
|
||||||
import '../../util/util.dart';
|
import '../../util/util.dart';
|
||||||
|
import '../dialog/UpdateDialog.dart';
|
||||||
import 'state.dart';
|
import 'state.dart';
|
||||||
import 'package:shared_preferences/shared_preferences.dart';
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
|
|
||||||
@ -29,7 +30,7 @@ class MinefragmentLogic extends GetxController {
|
|||||||
int orientation = -1;
|
int orientation = -1;
|
||||||
|
|
||||||
bool has_pwd = false;
|
bool has_pwd = false;
|
||||||
|
bool isUpdateVersion = false;
|
||||||
String enterHomeInfoMsg = "进入主页";
|
String enterHomeInfoMsg = "进入主页";
|
||||||
String joinedCircle = "";
|
String joinedCircle = "";
|
||||||
String vipMsg = "十几种专属特权等你领取";
|
String vipMsg = "十几种专属特权等你领取";
|
||||||
@ -45,12 +46,23 @@ class MinefragmentLogic extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getMode();
|
getMode();
|
||||||
|
checkVersion();
|
||||||
EventBusManager.on<CommentVipEvent>().listen((event) {
|
EventBusManager.on<CommentVipEvent>().listen((event) {
|
||||||
isVip.value = event.vip;
|
isVip.value = event.vip;
|
||||||
// update();
|
// update();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> checkVersion() async {
|
||||||
|
var data = await DioManager.instance.get(url: Api.APP_VERSION);
|
||||||
|
var bean = BaseResponse<UpdateInfo>.fromJson(
|
||||||
|
data, (data) => UpdateInfo.fromJson(data));
|
||||||
|
if (bean.isSuccess()) {
|
||||||
|
isUpdateVersion = bean.data.update == 1;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
getMode() async {
|
getMode() async {
|
||||||
var data = await DioManager.instance.get(url: Api.getUserMine);
|
var data = await DioManager.instance.get(url: Api.getUserMine);
|
||||||
var bean = BaseResponse<MineResponseBean>.fromJson(
|
var bean = BaseResponse<MineResponseBean>.fromJson(
|
||||||
|
|||||||
@ -7,12 +7,15 @@ import 'package:circle_app/app/circle/view.dart';
|
|||||||
|
|
||||||
import 'package:circle_app/app/msg/view.dart';
|
import 'package:circle_app/app/msg/view.dart';
|
||||||
import 'package:circle_app/router/app_routers.dart';
|
import 'package:circle_app/router/app_routers.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_cache_manager/flutter_cache_manager.dart';
|
import 'package:flutter_cache_manager/flutter_cache_manager.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
|
|
||||||
import '../../common/Widgets/open_vip_tip/view.dart';
|
import '../../common/Widgets/open_vip_tip/view.dart';
|
||||||
|
import '../../main.dart';
|
||||||
import '../../util/SharedPreferencesHelper.dart';
|
import '../../util/SharedPreferencesHelper.dart';
|
||||||
import '../../util/util.dart';
|
import '../../util/util.dart';
|
||||||
import 'logic.dart';
|
import 'logic.dart';
|
||||||
@ -31,16 +34,54 @@ const MyImageWidget1 = Image(
|
|||||||
fit: BoxFit.fill,
|
fit: BoxFit.fill,
|
||||||
);
|
);
|
||||||
|
|
||||||
class MinefragmentPage extends StatelessWidget {
|
class MinefragmentPage extends StatefulWidget {
|
||||||
MinefragmentPage({Key? key}) : super(key: key);
|
MinefragmentPage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<MinefragmentPage> createState() => _MinefragmentPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _MinefragmentPageState extends State<MinefragmentPage> with RouteAware {
|
||||||
final logic = Get.lazyPut(() => MinefragmentLogic());
|
final logic = Get.lazyPut(() => MinefragmentLogic());
|
||||||
|
|
||||||
|
final mineLogic = Get.find<MinefragmentLogic>();
|
||||||
|
|
||||||
final state = Get
|
final state = Get
|
||||||
.find<MinefragmentLogic>()
|
.find<MinefragmentLogic>()
|
||||||
.state;
|
.state;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
// TODO: implement dispose
|
||||||
|
super.dispose();
|
||||||
|
routeObserver.unsubscribe(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void didChangeDependencies() {
|
||||||
|
// TODO: implement didChangeDependencies
|
||||||
|
super.didChangeDependencies();
|
||||||
|
|
||||||
|
/// 路由订阅
|
||||||
|
routeObserver.subscribe(this, ModalRoute.of(context) as PageRoute);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void didPopNext() {
|
||||||
|
print('didPopNext');
|
||||||
|
mineLogic.checkVersion();
|
||||||
|
}
|
||||||
|
|
||||||
|
///当前页面进入时触发
|
||||||
|
void didPush() {
|
||||||
|
print('didPopNext');
|
||||||
|
|
||||||
|
}
|
||||||
|
void didPop() {
|
||||||
|
print('didPop');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
double statusBarHeight = MediaQuery
|
double statusBarHeight = MediaQuery
|
||||||
@ -121,7 +162,7 @@ class MinefragmentPage extends StatelessWidget {
|
|||||||
|
|
||||||
Widget _circleLiveView(MinefragmentLogic logic) {
|
Widget _circleLiveView(MinefragmentLogic logic) {
|
||||||
return Column(
|
return Column(
|
||||||
children: [_circleItemView(logic),_invienItemView(), _helpItemView(),_setUpItemView()],
|
children: [_circleItemView(logic),_invienItemView(),_editGoodReviewItemView(), _helpItemView(),_setUpItemView()],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -154,11 +195,24 @@ class MinefragmentPage extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
|
mineLogic.isUpdateVersion
|
||||||
|
? Container(
|
||||||
|
width: 10.sp,
|
||||||
|
height: 10.sp,
|
||||||
|
margin: EdgeInsets.only(right: 4.sp),
|
||||||
|
decoration: const BoxDecoration(
|
||||||
|
color: Colors.red,
|
||||||
|
shape: BoxShape.circle),
|
||||||
|
)
|
||||||
|
: Container(),
|
||||||
|
if (mineLogic.isUpdateVersion)
|
||||||
|
Text('有新版本啦',style: TextStyle(color: Colors.white60),),
|
||||||
Image(
|
Image(
|
||||||
image: AssetImage(getHomeImage("icon_in")),
|
image: AssetImage(getHomeImage("icon_in")),
|
||||||
width: 24.sp,
|
width: 24.sp,
|
||||||
height: 24.sp,
|
height: 24.sp,
|
||||||
),
|
),
|
||||||
|
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
@ -243,6 +297,14 @@ class MinefragmentPage extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
|
Container(
|
||||||
|
width: 10.sp,
|
||||||
|
height: 10.sp,
|
||||||
|
margin: EdgeInsets.only(right: 4.sp),
|
||||||
|
decoration: const BoxDecoration(
|
||||||
|
color: Colors.red,
|
||||||
|
shape: BoxShape.circle),
|
||||||
|
),
|
||||||
const Text(
|
const Text(
|
||||||
"免费领取会员",
|
"免费领取会员",
|
||||||
style: TextStyle(color: Colors.white60),
|
style: TextStyle(color: Colors.white60),
|
||||||
@ -261,6 +323,104 @@ class MinefragmentPage extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget _editGoodReviewItemView() {
|
||||||
|
return GestureDetector(
|
||||||
|
behavior: HitTestBehavior.opaque,
|
||||||
|
onTap: () {
|
||||||
|
showTipPop();
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
margin: EdgeInsets.only(top: 18.sp),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Image(
|
||||||
|
image: AssetImage(getMineImage("edit_good_review")),
|
||||||
|
width: 24.sp,
|
||||||
|
height: 24.sp,
|
||||||
|
),
|
||||||
|
SizedBox(width: 10.sp),
|
||||||
|
|
||||||
|
const Text(
|
||||||
|
"评价微乐园",
|
||||||
|
style: TextStyle(color: Colors.white),
|
||||||
|
),
|
||||||
|
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
width: 10.sp,
|
||||||
|
height: 10.sp,
|
||||||
|
margin: EdgeInsets.only(right: 4.sp),
|
||||||
|
decoration: const BoxDecoration(
|
||||||
|
color: Colors.red,
|
||||||
|
shape: BoxShape.circle),
|
||||||
|
),
|
||||||
|
const Text(
|
||||||
|
"+3天会员时长",
|
||||||
|
style: TextStyle(color: Colors.white60),
|
||||||
|
),
|
||||||
|
Image(
|
||||||
|
image: AssetImage(getHomeImage("icon_in")),
|
||||||
|
width: 24.sp,
|
||||||
|
height: 24.sp,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _shareItemView() {
|
||||||
|
return GestureDetector(
|
||||||
|
behavior: HitTestBehavior.opaque,
|
||||||
|
onTap: () {
|
||||||
|
Get.toNamed(AppRoutes.ExternalsharePage);
|
||||||
|
// controller.state.hearUrl
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
margin: EdgeInsets.only(top: 18.sp),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Image(
|
||||||
|
image: AssetImage(getMineImage("share")),
|
||||||
|
width: 24.sp,
|
||||||
|
height: 24.sp,
|
||||||
|
),
|
||||||
|
SizedBox(width: 10.sp),
|
||||||
|
const Text(
|
||||||
|
"站外分享",
|
||||||
|
style: TextStyle(color: Colors.white),
|
||||||
|
),
|
||||||
|
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Image(
|
||||||
|
image: AssetImage(getHomeImage("icon_in")),
|
||||||
|
width: 24.sp,
|
||||||
|
height: 24.sp,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
Widget _circleItemView(MinefragmentLogic logic) {
|
Widget _circleItemView(MinefragmentLogic logic) {
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
behavior: HitTestBehavior.opaque,
|
behavior: HitTestBehavior.opaque,
|
||||||
@ -644,4 +804,40 @@ class MinefragmentPage extends StatelessWidget {
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
showTipPop() {
|
||||||
|
Get.bottomSheet(
|
||||||
|
CupertinoActionSheet(
|
||||||
|
// 标题
|
||||||
|
//提示内容
|
||||||
|
actions: <Widget>[
|
||||||
|
//操作按钮集合
|
||||||
|
CupertinoActionSheetAction(
|
||||||
|
onPressed: () async {
|
||||||
|
Get.back();
|
||||||
|
//
|
||||||
|
await launch('https://apps.apple.com/cn/app/%E5%BE%AE%E4%B9%90%E5%9B%AD-%E4%BA%9A%E6%96%87%E5%8C%96%E5%A4%9A%E5%85%83%E4%BA%A4%E5%8F%8B%E5%9F%BA%E5%9C%B0/id6459449499', forceSafariVC: false);
|
||||||
|
},
|
||||||
|
child: Text('立即评价'),
|
||||||
|
),
|
||||||
|
CupertinoActionSheetAction(
|
||||||
|
onPressed: () {
|
||||||
|
|
||||||
|
Get.back();
|
||||||
|
Get.toNamed(AppRoutes.Good_Reviews);
|
||||||
|
|
||||||
|
},
|
||||||
|
child: Text('反馈截图'),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
cancelButton: CupertinoActionSheetAction(
|
||||||
|
//取消按钮
|
||||||
|
onPressed: () {
|
||||||
|
Get.back();
|
||||||
|
},
|
||||||
|
child: Text('取消'),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
isScrollControlled: true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -44,6 +44,7 @@ class Sys_notify_listLogic extends GetxController {
|
|||||||
// lists.addAll(bean.data.lists);
|
// lists.addAll(bean.data.lists);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
if (data['code'] == 200) {
|
||||||
List bean = data['data']['lists'];
|
List bean = data['data']['lists'];
|
||||||
if (bean.length > 0) {
|
if (bean.length > 0) {
|
||||||
bean.forEach((element) {
|
bean.forEach((element) {
|
||||||
@ -53,6 +54,8 @@ class Sys_notify_listLogic extends GetxController {
|
|||||||
if (bean.length < 10) {
|
if (bean.length < 10) {
|
||||||
isMore = false;
|
isMore = false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
isLoad = false;
|
isLoad = false;
|
||||||
update();
|
update();
|
||||||
if (page == 0) {
|
if (page == 0) {
|
||||||
|
|||||||
@ -244,7 +244,7 @@ class _MsgPageState extends State<MsgPage> with AutomaticKeepAliveClientMixin {
|
|||||||
tipWidget() {
|
tipWidget() {
|
||||||
return Container(
|
return Container(
|
||||||
margin: EdgeInsets.only(top: 18.sp, bottom: 15.sp),
|
margin: EdgeInsets.only(top: 18.sp, bottom: 15.sp),
|
||||||
padding: EdgeInsets.only(left: 16.sp, right: 18.sp),
|
padding: EdgeInsets.only(left: 16.sp, right: 12.sp),
|
||||||
width: Get.width,
|
width: Get.width,
|
||||||
height: 20,
|
height: 20,
|
||||||
child: Row(
|
child: Row(
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
import 'package:circle_app/app/minefragment/logic.dart';
|
||||||
import 'package:circle_app/components/my_app_bar.dart';
|
import 'package:circle_app/components/my_app_bar.dart';
|
||||||
import 'package:circle_app/util/util.dart';
|
import 'package:circle_app/util/util.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@ -128,6 +129,8 @@ class SetupPage extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildItemRow(String text, String imagePath) {
|
Widget _buildItemRow(String text, String imagePath) {
|
||||||
|
var mineLogic = Get.find<MinefragmentLogic>();
|
||||||
|
|
||||||
return Container(
|
return Container(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 16.sp),
|
padding: EdgeInsets.symmetric(horizontal: 16.sp),
|
||||||
// 将 @dimen/dp_16 替换为相应的值
|
// 将 @dimen/dp_16 替换为相应的值
|
||||||
@ -141,6 +144,17 @@ class SetupPage extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
|
if (mineLogic.isUpdateVersion && text == '关于微乐园')
|
||||||
|
Container(
|
||||||
|
width: 10.sp,
|
||||||
|
height: 10.sp,
|
||||||
|
margin: EdgeInsets.only(right: 4.sp),
|
||||||
|
decoration: const BoxDecoration(
|
||||||
|
color: Colors.red,
|
||||||
|
shape: BoxShape.circle),
|
||||||
|
),
|
||||||
|
if (mineLogic.isUpdateVersion && text == '关于微乐园')
|
||||||
|
Text('有新版本啦',style: TextStyle(color: Colors.white60,fontSize: 14.sp),),
|
||||||
Image.asset(
|
Image.asset(
|
||||||
imagePath,
|
imagePath,
|
||||||
width: 20.sp, // 将相应的值替换为图像的宽度
|
width: 20.sp, // 将相应的值替换为图像的宽度
|
||||||
|
|||||||
@ -9,4 +9,5 @@ class CONFIG{
|
|||||||
static const USER_INFO_AVATAR = 'user_info_avatar/';
|
static const USER_INFO_AVATAR = 'user_info_avatar/';
|
||||||
|
|
||||||
static const USER_ALBUM_IMAGE = 'user_album_image/';
|
static const USER_ALBUM_IMAGE = 'user_album_image/';
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -232,7 +232,6 @@ class DioManager {
|
|||||||
pushLoginPage();
|
pushLoginPage();
|
||||||
} else {
|
} else {
|
||||||
switch (responseMap["code"]) {
|
switch (responseMap["code"]) {
|
||||||
case 1001:
|
|
||||||
case 4000:
|
case 4000:
|
||||||
case 4001:
|
case 4001:
|
||||||
case 4002:
|
case 4002:
|
||||||
|
|||||||
@ -69,6 +69,10 @@ 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/externalshare/binding.dart';
|
||||||
|
import '../app/externalshare/view.dart';
|
||||||
|
import '../app/good_reviews/binding.dart';
|
||||||
|
import '../app/good_reviews/view.dart';
|
||||||
import '../app/privacy/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';
|
||||||
@ -238,5 +242,15 @@ class AppPages {
|
|||||||
page: () => Reset_pwdPage(),
|
page: () => Reset_pwdPage(),
|
||||||
binding: Reset_pwdBinding(),
|
binding: Reset_pwdBinding(),
|
||||||
),
|
),
|
||||||
|
GetPage(
|
||||||
|
name: AppRoutes.ExternalsharePage,
|
||||||
|
page: () => ExternalsharePage(),
|
||||||
|
binding: ExternalshareBinding(),
|
||||||
|
),
|
||||||
|
GetPage(
|
||||||
|
name: AppRoutes.Good_Reviews,
|
||||||
|
page: () => Good_reviewsPage(),
|
||||||
|
binding: Good_reviewsBinding(),
|
||||||
|
),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -41,6 +41,10 @@ abstract class AppRoutes {
|
|||||||
static const EditPwd = '/mine/EditPwd';
|
static const EditPwd = '/mine/EditPwd';
|
||||||
static const ResetPwd = '/mine/EditPwd/ResetPwd';
|
static const ResetPwd = '/mine/EditPwd/ResetPwd';
|
||||||
|
|
||||||
|
static const ExternalsharePage = '/ExternalsharePage';
|
||||||
|
|
||||||
|
static const Good_Reviews = '/Good_Reviews';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1,9 +1,10 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'dart:math';
|
import 'dart:math';
|
||||||
|
import 'dart:typed_data';
|
||||||
|
|
||||||
import 'package:circle_app/util/util.dart';
|
import 'package:circle_app/util/util.dart';
|
||||||
import 'package:flutter_luban/flutter_luban.dart';
|
import 'package:flutter_image_compress/flutter_image_compress.dart';
|
||||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||||
import 'package:image_picker/image_picker.dart';
|
import 'package:image_picker/image_picker.dart';
|
||||||
import 'package:qiniu_flutter_sdk/qiniu_flutter_sdk.dart';
|
import 'package:qiniu_flutter_sdk/qiniu_flutter_sdk.dart';
|
||||||
@ -17,7 +18,7 @@ import 'package:image/image.dart' as img;
|
|||||||
typedef void MyCallback(String result);
|
typedef void MyCallback(String result);
|
||||||
|
|
||||||
//上传七牛云
|
//上传七牛云
|
||||||
void uploadQiniu(String filePath, String name, String path, String quToken,
|
void uploadQiniuVideo(File file, String name, String path, String quToken,
|
||||||
MyCallback myCallback) {
|
MyCallback myCallback) {
|
||||||
var storage = Storage();
|
var storage = Storage();
|
||||||
DateTime now = DateTime.now();
|
DateTime now = DateTime.now();
|
||||||
@ -36,7 +37,32 @@ void uploadQiniu(String filePath, String name, String path, String quToken,
|
|||||||
print('上传进度: $status');
|
print('上传进度: $status');
|
||||||
});
|
});
|
||||||
|
|
||||||
storage.putFile(File(filePath), quToken,
|
storage.putFile(file, quToken,
|
||||||
|
options: PutOptions(controller: putController, key: imgPath));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//上传七牛云
|
||||||
|
void uploadQiniu(Uint8List bytes, String name, String path, String quToken,
|
||||||
|
MyCallback myCallback) {
|
||||||
|
var storage = Storage();
|
||||||
|
DateTime now = DateTime.now();
|
||||||
|
String yearMonth = DateFormat('yyyyMM').format(now);
|
||||||
|
String imgPath = "$path$yearMonth/${generateRandomString(16)}$name";
|
||||||
|
PutController putController = PutController();
|
||||||
|
putController.addStatusListener((StorageStatus status) {
|
||||||
|
if (status == StorageStatus.Success) {
|
||||||
|
var headUrl = CONFIG.IMAGE_HEAD + imgPath;
|
||||||
|
myCallback(headUrl);
|
||||||
|
}
|
||||||
|
print('状态变化: 当前任务状态:$status');
|
||||||
|
});
|
||||||
|
|
||||||
|
putController.addProgressListener((double status) {
|
||||||
|
print('上传进度: $status');
|
||||||
|
});
|
||||||
|
|
||||||
|
storage.putBytes(bytes, quToken,
|
||||||
options: PutOptions(controller: putController, key: imgPath));
|
options: PutOptions(controller: putController, key: imgPath));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,30 +91,20 @@ void uploadImage(String quToken, XFile pickedFile, String updataRoute,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isImageJpgOrPng(pickedFile.path)){
|
var result = await FlutterImageCompress.compressWithFile(
|
||||||
var path = await getApplicationSupportDirectoryPath();
|
pickedFile.path,
|
||||||
CompressObject compressObject = CompressObject(
|
minWidth: 2300,
|
||||||
imageFile: File(pickedFile.path),
|
minHeight: 1500,
|
||||||
path: path,
|
quality: 94,
|
||||||
quality: 80,
|
|
||||||
step: 9,
|
|
||||||
mode: CompressMode.AUTO,
|
|
||||||
);
|
);
|
||||||
Luban.compressImage(compressObject).then((_path) {
|
|
||||||
uploadQiniu(_path.toString(), pickedFile.name, updataRoute, quToken,
|
var size = await pickedFile.length();
|
||||||
(result) {
|
print(size);
|
||||||
|
print(result!.length);
|
||||||
|
|
||||||
|
uploadQiniu(result!, pickedFile.name, updataRoute, quToken, (result) {
|
||||||
myCallback(result);
|
myCallback(result);
|
||||||
});
|
});
|
||||||
}).catchError((error) {
|
|
||||||
print(error);
|
|
||||||
showOKToast("图片上传失败");
|
|
||||||
SmartDialog.dismiss(force: true);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
uploadQiniu(pickedFile.path, pickedFile.name, updataRoute, quToken, (result) {
|
|
||||||
myCallback(result);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void convertImageFormat(
|
void convertImageFormat(
|
||||||
|
|||||||
@ -599,21 +599,13 @@ packages:
|
|||||||
source: hosted
|
source: hosted
|
||||||
version: "2.2.2"
|
version: "2.2.2"
|
||||||
flutter_image_compress:
|
flutter_image_compress:
|
||||||
dependency: transitive
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: flutter_image_compress
|
name: flutter_image_compress
|
||||||
sha256: "37f1b26399098e5f97b74c1483f534855e7dff68ead6ddaccf747029fb03f29f"
|
sha256: "37f1b26399098e5f97b74c1483f534855e7dff68ead6ddaccf747029fb03f29f"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.3"
|
version: "1.1.3"
|
||||||
flutter_install_app:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: flutter_install_app
|
|
||||||
sha256: "9b117006d17c900e671c26bcbc9b15c7b8efd15d6f9b4442ad5d576de20fab53"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.3.0"
|
|
||||||
flutter_intl:
|
flutter_intl:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@ -651,14 +643,6 @@ packages:
|
|||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.0"
|
version: "0.0.0"
|
||||||
flutter_luban:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: flutter_luban
|
|
||||||
sha256: "42c01fbc1d0dd14f4d573372b79d6747415749552a8e996cf989018cc70cf2a8"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "0.1.13"
|
|
||||||
flutter_markdown:
|
flutter_markdown:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|||||||
@ -80,8 +80,6 @@ dependencies:
|
|||||||
video_player: ^2.6.1
|
video_player: ^2.6.1
|
||||||
#时间戳
|
#时间戳
|
||||||
flutter_intl: ^0.0.1
|
flutter_intl: ^0.0.1
|
||||||
#图片压缩
|
|
||||||
flutter_luban: any
|
|
||||||
#视频压缩
|
#视频压缩
|
||||||
video_compress: ^3.1.2
|
video_compress: ^3.1.2
|
||||||
#图片缓存
|
#图片缓存
|
||||||
@ -95,7 +93,7 @@ dependencies:
|
|||||||
#event_bus:
|
#event_bus:
|
||||||
event_bus: ^2.0.0
|
event_bus: ^2.0.0
|
||||||
#安装apk
|
#安装apk
|
||||||
flutter_install_app: 1.3.0
|
# flutter_install_app: 1.3.0
|
||||||
#闪屏页
|
#闪屏页
|
||||||
flutter_native_splash: 2.2.16
|
flutter_native_splash: 2.2.16
|
||||||
#腾讯离线推送
|
#腾讯离线推送
|
||||||
@ -111,6 +109,9 @@ dependencies:
|
|||||||
#腾讯bugly
|
#腾讯bugly
|
||||||
flutter_bugly: ^0.4.4
|
flutter_bugly: ^0.4.4
|
||||||
|
|
||||||
|
#图片压缩
|
||||||
|
flutter_image_compress: ^1.1.3
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user