封装上传图片 个人资料细节修改
This commit is contained in:
parent
194745786e
commit
82921e0d04
@ -15,6 +15,7 @@ import 'package:shared_preferences/shared_preferences.dart';
|
|||||||
import 'package:video_player/video_player.dart';
|
import 'package:video_player/video_player.dart';
|
||||||
import 'package:video_thumbnail/video_thumbnail.dart';
|
import 'package:video_thumbnail/video_thumbnail.dart';
|
||||||
|
|
||||||
|
import '../../common/Widgets/open_vip_tip/view.dart';
|
||||||
import '../../common/errorcode.dart';
|
import '../../common/errorcode.dart';
|
||||||
import '../../network/api.dart';
|
import '../../network/api.dart';
|
||||||
import '../../network/dio_manager.dart';
|
import '../../network/dio_manager.dart';
|
||||||
@ -35,7 +36,7 @@ class Call_outLogic extends GetxController {
|
|||||||
var quToken = '';
|
var quToken = '';
|
||||||
VideoPlayerController? videoPlayerController;
|
VideoPlayerController? videoPlayerController;
|
||||||
List<MyConfigData> numbers = [];
|
List<MyConfigData> numbers = [];
|
||||||
List<MyConfigData> myConfigData= Get.arguments['numbers'];
|
List<MyConfigData> myConfigData = Get.arguments['numbers'];
|
||||||
int vip = 0;
|
int vip = 0;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -47,20 +48,20 @@ class Call_outLogic extends GetxController {
|
|||||||
@override
|
@override
|
||||||
void onInit() async {
|
void onInit() async {
|
||||||
super.onInit();
|
super.onInit();
|
||||||
if(myConfigData!=null){
|
if (myConfigData != null) {
|
||||||
// print(myConfigData.name);
|
// print(myConfigData.name);
|
||||||
numbers.addAll(myConfigData);
|
numbers.addAll(myConfigData);
|
||||||
circleName = numbers[0].name;
|
circleName = numbers[0].name;
|
||||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||||
vip = prefs.getInt("vip")??0;
|
vip = prefs.getInt("vip") ?? 0;
|
||||||
if(vip == 2){
|
if (vip == 2) {
|
||||||
isCheck = true;
|
isCheck = true;
|
||||||
}
|
}
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var data =
|
||||||
var data = await DioManager.instance.get(url: Api.getCircleList, params: {});
|
await DioManager.instance.get(url: Api.getCircleList, params: {});
|
||||||
var bean = BaseResponse<ConfigBean>.fromJson(
|
var bean = BaseResponse<ConfigBean>.fromJson(
|
||||||
data, (data) => ConfigBean.fromJson(data));
|
data, (data) => ConfigBean.fromJson(data));
|
||||||
if (bean.isSuccess()) {
|
if (bean.isSuccess()) {
|
||||||
@ -74,7 +75,15 @@ 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();
|
||||||
|
}
|
||||||
|
showRechargeDialog(){
|
||||||
|
Get.bottomSheet(
|
||||||
|
Scaffold(
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
body: Open_vip_tipPage(),
|
||||||
|
),
|
||||||
|
isScrollControlled: true,
|
||||||
|
enableDrag: false);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -124,147 +133,163 @@ class Call_outLogic extends GetxController {
|
|||||||
'useQueen': isCheck,
|
'useQueen': isCheck,
|
||||||
});
|
});
|
||||||
|
|
||||||
var beandata = BaseResponse<dynamic>.fromJson(data, (jsonData) => jsonData,);
|
var beandata = BaseResponse<dynamic>.fromJson(
|
||||||
|
data,
|
||||||
|
(jsonData) => jsonData,
|
||||||
|
);
|
||||||
|
|
||||||
if (beandata.isSuccess()) {
|
if (beandata.isSuccess()) {
|
||||||
showToast(beandata.msg);
|
showToast(beandata.msg);
|
||||||
// Navigator.pop(Get.context!, numbers);
|
// Navigator.pop(Get.context!, numbers);
|
||||||
Get.back();
|
Get.back();
|
||||||
}else if(beandata.code == 30503){
|
} else if (beandata.code == 30503) {
|
||||||
if(beandata.data ==null){
|
if (beandata.data == null) {
|
||||||
return ;
|
return;
|
||||||
}
|
}
|
||||||
showToast(beandata.msg);
|
showToast(beandata.msg);
|
||||||
var callOutBean = BaseResponse<List<String>>.fromJson(
|
var callOutBean = BaseResponse<List<String>>.fromJson(
|
||||||
data,
|
data,
|
||||||
(jsonData) => List<String>.from(jsonData),
|
(jsonData) => List<String>.from(jsonData),
|
||||||
);
|
);
|
||||||
|
|
||||||
textEditingController.text = filterSensitiveWords(textEditingController.text , callOutBean.data!);
|
textEditingController.text =
|
||||||
print(filterSensitiveWords(textEditingController.text , callOutBean.data!));
|
filterSensitiveWords(textEditingController.text, callOutBean.data!);
|
||||||
|
print(
|
||||||
|
filterSensitiveWords(textEditingController.text, callOutBean.data!));
|
||||||
update();
|
update();
|
||||||
} else if(beandata.code == 30505){
|
} else if (beandata.code == 30505) {
|
||||||
var callOutBean = BaseResponse<CirclePaymentBean>.fromJson(data, (jsonData) => CirclePaymentBean.fromJson(jsonData),);
|
var callOutBean = BaseResponse<CirclePaymentBean>.fromJson(
|
||||||
|
data,
|
||||||
|
(jsonData) => CirclePaymentBean.fromJson(jsonData),
|
||||||
|
);
|
||||||
showDialog();
|
showDialog();
|
||||||
// tipWdiget()
|
// tipWdiget()
|
||||||
}else{
|
} else {
|
||||||
showToast(beandata.msg);
|
showToast(beandata.msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void showDialog(){
|
|
||||||
Get.bottomSheet(Scaffold(
|
void showDialog() {
|
||||||
backgroundColor: Colors.transparent,
|
Get.bottomSheet(
|
||||||
body: Container(
|
Scaffold(
|
||||||
width: Get.width,
|
backgroundColor: Colors.transparent,
|
||||||
height: Get.height,
|
body: Container(
|
||||||
child: Center(
|
width: Get.width,
|
||||||
child: Container(
|
height: Get.height,
|
||||||
width: 339.sp,
|
child: Center(
|
||||||
height: 330.sp,
|
child: Container(
|
||||||
decoration: BoxDecoration(
|
width: 339.sp,
|
||||||
image: DecorationImage(
|
height: 330.sp,
|
||||||
fit: BoxFit.fill,
|
decoration: BoxDecoration(
|
||||||
image: AssetImage(getCircleImage('add_tip_bg')))),
|
image: DecorationImage(
|
||||||
child: Stack(
|
fit: BoxFit.fill,
|
||||||
alignment: Alignment.center,
|
image: AssetImage(getCircleImage('add_tip_bg')))),
|
||||||
children: [
|
child: Stack(
|
||||||
Positioned(
|
alignment: Alignment.center,
|
||||||
top: 5.sp,
|
children: [
|
||||||
right: 12.sp,
|
Positioned(
|
||||||
child: GestureDetector(
|
top: 5.sp,
|
||||||
onTap: () {
|
right: 12.sp,
|
||||||
Get.back();
|
child: GestureDetector(
|
||||||
},
|
onTap: () {
|
||||||
child: Image.asset(
|
Get.back();
|
||||||
getCircleImage('close'),
|
},
|
||||||
width: 24.sp,
|
child: Image.asset(
|
||||||
),
|
getCircleImage('close'),
|
||||||
)),
|
width: 24.sp,
|
||||||
Positioned(
|
|
||||||
top: 24.sp,
|
|
||||||
child: Text(
|
|
||||||
'解锁圈子才能发布喊话',
|
|
||||||
style: TextStyle(color: Colors.white, fontSize: 16.sp),
|
|
||||||
)),
|
|
||||||
Positioned(
|
|
||||||
left: 17.sp,
|
|
||||||
top: 64.sp,
|
|
||||||
child: Text(
|
|
||||||
'为什么要解锁圈子?',
|
|
||||||
style: TextStyle(color: Colors.white, fontSize: 16.sp),
|
|
||||||
)),
|
|
||||||
Positioned(
|
|
||||||
top: 98.sp,
|
|
||||||
child: Container(
|
|
||||||
width: 339.sp,
|
|
||||||
padding: EdgeInsets.only(left: 17.sp, right: 17.sp),
|
|
||||||
child: Text(
|
|
||||||
'为打造纯净的社交环境,更好地服务大家,基于以下几方面考虑:1、平台升级为全天24小时人工审核,保证用户真实,避免骗子、酒托、虚假人士等扰乱平台 ;2、杜绝未入圈用户随意骚扰或影响已入圈的跨友;3、谢绝只会白嫖的猎奇人士。',
|
|
||||||
style: TextStyle(
|
|
||||||
color: Color.fromRGBO(247, 250, 250, 0.8),
|
|
||||||
fontSize: 12.sp)),
|
|
||||||
)),
|
|
||||||
Positioned(
|
|
||||||
bottom: 18.sp,
|
|
||||||
child: Container(
|
|
||||||
width: 168.sp,
|
|
||||||
height: 42.sp,
|
|
||||||
alignment: Alignment.center,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
borderRadius: BorderRadius.circular(21.sp),
|
|
||||||
gradient: const LinearGradient(
|
|
||||||
begin: Alignment.centerLeft,
|
|
||||||
end: Alignment.centerRight,
|
|
||||||
colors: [Color(0xff0AFCFF), Color(0xffD739EA)])),
|
|
||||||
child: Text(
|
|
||||||
'立即解锁',
|
|
||||||
style: TextStyle(color: Colors.white, fontSize: 16.sp),
|
|
||||||
),
|
|
||||||
)),
|
|
||||||
Positioned(
|
|
||||||
bottom: 72.sp,
|
|
||||||
child: Container(
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
'¥18',
|
|
||||||
style: TextStyle(
|
|
||||||
color: Color(0xffE845FF),
|
|
||||||
fontSize: 16.sp,
|
|
||||||
fontWeight: FontWeight.w600),
|
|
||||||
),
|
),
|
||||||
SizedBox(
|
)),
|
||||||
width: 2.sp,
|
Positioned(
|
||||||
|
top: 24.sp,
|
||||||
|
child: Text(
|
||||||
|
'解锁圈子才能发布喊话',
|
||||||
|
style:
|
||||||
|
TextStyle(color: Colors.white, fontSize: 16.sp),
|
||||||
|
)),
|
||||||
|
Positioned(
|
||||||
|
left: 17.sp,
|
||||||
|
top: 64.sp,
|
||||||
|
child: Text(
|
||||||
|
'为什么要解锁圈子?',
|
||||||
|
style:
|
||||||
|
TextStyle(color: Colors.white, fontSize: 16.sp),
|
||||||
|
)),
|
||||||
|
Positioned(
|
||||||
|
top: 98.sp,
|
||||||
|
child: Container(
|
||||||
|
width: 339.sp,
|
||||||
|
padding: EdgeInsets.only(left: 17.sp, right: 17.sp),
|
||||||
|
child: Text(
|
||||||
|
'为打造纯净的社交环境,更好地服务大家,基于以下几方面考虑:1、平台升级为全天24小时人工审核,保证用户真实,避免骗子、酒托、虚假人士等扰乱平台 ;2、杜绝未入圈用户随意骚扰或影响已入圈的跨友;3、谢绝只会白嫖的猎奇人士。',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Color.fromRGBO(247, 250, 250, 0.8),
|
||||||
|
fontSize: 12.sp)),
|
||||||
|
)),
|
||||||
|
Positioned(
|
||||||
|
bottom: 18.sp,
|
||||||
|
child: Container(
|
||||||
|
width: 168.sp,
|
||||||
|
height: 42.sp,
|
||||||
|
alignment: Alignment.center,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(21.sp),
|
||||||
|
gradient: const LinearGradient(
|
||||||
|
begin: Alignment.centerLeft,
|
||||||
|
end: Alignment.centerRight,
|
||||||
|
colors: [
|
||||||
|
Color(0xff0AFCFF),
|
||||||
|
Color(0xffD739EA)
|
||||||
|
])),
|
||||||
|
child: Text(
|
||||||
|
'立即解锁',
|
||||||
|
style:
|
||||||
|
TextStyle(color: Colors.white, fontSize: 16.sp),
|
||||||
),
|
),
|
||||||
Text(
|
)),
|
||||||
'(原价60)',
|
Positioned(
|
||||||
style: TextStyle(
|
bottom: 72.sp,
|
||||||
color: Colors.white70,
|
child: Container(
|
||||||
fontSize: 16.sp,
|
child: Row(
|
||||||
fontWeight: FontWeight.w400,
|
children: [
|
||||||
decoration: TextDecoration.lineThrough,
|
Text(
|
||||||
decorationColor: Colors.white70,
|
'¥18',
|
||||||
),
|
style: TextStyle(
|
||||||
|
color: Color(0xffE845FF),
|
||||||
|
fontSize: 16.sp,
|
||||||
|
fontWeight: FontWeight.w600),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: 2.sp,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'(原价60)',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.white70,
|
||||||
|
fontSize: 16.sp,
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
decoration: TextDecoration.lineThrough,
|
||||||
|
decorationColor: Colors.white70,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
],
|
))
|
||||||
),
|
],
|
||||||
))
|
),
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
isScrollControlled: true,
|
||||||
),
|
enableDrag: false);
|
||||||
isScrollControlled: true,
|
|
||||||
enableDrag: false
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
startSelectCircleActivity() async {
|
startSelectCircleActivity() async {
|
||||||
var data = await Get.toNamed(AppRoutes.SelectCircleActivity,
|
var data = await Get.toNamed(AppRoutes.SelectCircleActivity, arguments: {
|
||||||
arguments: {"interestMap": configBean.interestMap,
|
"interestMap": configBean.interestMap,
|
||||||
'selectCircle':numbers,
|
'selectCircle': numbers,
|
||||||
"isRodio": true});
|
"isRodio": true
|
||||||
|
});
|
||||||
if (null != data) {
|
if (null != data) {
|
||||||
numbers = data;
|
numbers = data;
|
||||||
circleName = numbers[0].name;
|
circleName = numbers[0].name;
|
||||||
@ -276,7 +301,7 @@ class Call_outLogic extends GetxController {
|
|||||||
|
|
||||||
showImg() async {
|
showImg() async {
|
||||||
try {
|
try {
|
||||||
if (state.videolist.length!=0) {
|
if (state.videolist.length != 0) {
|
||||||
showToast("已添加视频,无法添加图片。");
|
showToast("已添加视频,无法添加图片。");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -287,24 +312,16 @@ class Call_outLogic extends GetxController {
|
|||||||
final XFile? pickedFile = await _picker.pickImage(
|
final XFile? pickedFile = await _picker.pickImage(
|
||||||
source: ImageSource.gallery,
|
source: ImageSource.gallery,
|
||||||
);
|
);
|
||||||
|
if(null==pickedFile){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
SmartDialog.showLoading();
|
SmartDialog.showLoading();
|
||||||
var path = await getApplicationSupportDirectoryPath();
|
upDataImage(quToken,pickedFile!,CONFIG.CALL_OUT_IMAGE,(result){
|
||||||
CompressObject compressObject = CompressObject(
|
SmartDialog.dismiss();
|
||||||
imageFile:File(pickedFile!.path), //image
|
state.imaglist.add(result);
|
||||||
path:path, //compress to path
|
update();
|
||||||
quality: 80,//first compress quality, default 80
|
|
||||||
step: 9,//compress quality step, The bigger the fast, Smaller is more accurate, default 6
|
|
||||||
mode: CompressMode.LARGE2SMALL,//default AUTO
|
|
||||||
);
|
|
||||||
Luban.compressImage(compressObject).then((_path) {
|
|
||||||
updataQiniu(pickedFile!,CONFIG.CALL_OUT_IMAGE,quToken,(result){
|
|
||||||
state.imaglist.add(result);
|
|
||||||
update();
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print(e);
|
print(e);
|
||||||
}
|
}
|
||||||
@ -333,14 +350,12 @@ class Call_outLogic extends GetxController {
|
|||||||
return completer.future;
|
return completer.future;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
showVideo() async {
|
showVideo() async {
|
||||||
if (state.imaglist.length != 0) {
|
if (state.imaglist.length != 0) {
|
||||||
showToast("已添加图片,无法添加视频。");
|
showToast("已添加图片,无法添加视频。");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (state.videolist.length!=0) {
|
if (state.videolist.length != 0) {
|
||||||
showToast("最多上传1个视频哦~");
|
showToast("最多上传1个视频哦~");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -348,9 +363,12 @@ class Call_outLogic extends GetxController {
|
|||||||
final XFile? pickedFile = await _picker.pickVideo(
|
final XFile? pickedFile = await _picker.pickVideo(
|
||||||
source: ImageSource.gallery,
|
source: ImageSource.gallery,
|
||||||
);
|
);
|
||||||
|
if(null==pickedFile){
|
||||||
|
return;
|
||||||
|
}
|
||||||
SmartDialog.showLoading();
|
SmartDialog.showLoading();
|
||||||
var path = await getApplicationSupportDirectoryPath();
|
var path = await getApplicationSupportDirectoryPath();
|
||||||
compressVideo(pickedFile!.path,path,(result) async{
|
compressVideo(pickedFile!.path, path, (result) async {
|
||||||
print(result);
|
print(result);
|
||||||
videoPlayerController = VideoPlayerController.file(
|
videoPlayerController = VideoPlayerController.file(
|
||||||
File(result),
|
File(result),
|
||||||
@ -368,20 +386,20 @@ class Call_outLogic extends GetxController {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
upVideoQiniu(result,pickedFile.name,CONFIG.CALL_OUT_VIDEO,quToken,(result){
|
updataQiniu(result, pickedFile.name, CONFIG.CALL_OUT_VIDEO, quToken,
|
||||||
|
(result) {
|
||||||
|
SmartDialog.dismiss();
|
||||||
state.videolist.add(result);
|
state.videolist.add(result);
|
||||||
update();
|
update();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
SmartDialog.dismiss();
|
||||||
showToast("请上传5-30秒的视频");
|
showToast("请上传5-30秒的视频");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Future<ClosedCaptionFile> _loadCaptions(BuildContext context) async {
|
Future<ClosedCaptionFile> _loadCaptions(BuildContext context) async {
|
||||||
final String fileContents = await DefaultAssetBundle.of(context)
|
final String fileContents = await DefaultAssetBundle.of(context)
|
||||||
.loadString('assets/bumble_bee_captions.vtt');
|
.loadString('assets/bumble_bee_captions.vtt');
|
||||||
@ -424,7 +442,6 @@ class ThumbnailResult {
|
|||||||
required this.width});
|
required this.width});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class CirclePaymentBean {
|
class CirclePaymentBean {
|
||||||
final int id;
|
final int id;
|
||||||
final String title;
|
final String title;
|
||||||
@ -447,4 +464,3 @@ class CirclePaymentBean {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import 'package:get/get.dart';
|
|||||||
import 'package:video_player/video_player.dart';
|
import 'package:video_player/video_player.dart';
|
||||||
|
|
||||||
import '../../router/app_routers.dart';
|
import '../../router/app_routers.dart';
|
||||||
|
import '../circle/widgets/video_item.dart';
|
||||||
import 'logic.dart';
|
import 'logic.dart';
|
||||||
|
|
||||||
class Call_outPage extends StatelessWidget {
|
class Call_outPage extends StatelessWidget {
|
||||||
@ -29,6 +30,7 @@ class Call_outPage extends StatelessWidget {
|
|||||||
fit: BoxFit.fill,
|
fit: BoxFit.fill,
|
||||||
image: AssetImage(getBaseImage('home_back')))),
|
image: AssetImage(getBaseImage('home_back')))),
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
|
resizeToAvoidBottomInset: false,
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
appBar: MyAppBar(
|
appBar: MyAppBar(
|
||||||
centerTitle: '世界喊话',
|
centerTitle: '世界喊话',
|
||||||
@ -179,8 +181,13 @@ class Call_outPage extends StatelessWidget {
|
|||||||
Expanded(
|
Expanded(
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
controller.isCheck = !controller.isCheck;
|
if(controller.vip ==2){
|
||||||
controller.update();
|
controller.isCheck = !controller.isCheck;
|
||||||
|
controller.update();
|
||||||
|
}else{
|
||||||
|
controller.showRechargeDialog();
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
@ -229,48 +236,88 @@ class Call_outPage extends StatelessWidget {
|
|||||||
if (controller.videoPlayerController == null) {
|
if (controller.videoPlayerController == null) {
|
||||||
return Container();
|
return Container();
|
||||||
} else {
|
} else {
|
||||||
return Container(
|
return _mixVideo(controller);
|
||||||
width:controller.videoPlayerController!.value.size.width < controller.videoPlayerController!.value.size.height ? 135.sp : 240.sp,
|
|
||||||
height:controller.videoPlayerController!.value.size.width < controller.videoPlayerController!.value.size.height ? 240.sp :135.sp,
|
|
||||||
child: GestureDetector(
|
|
||||||
onTap: () {
|
|
||||||
if(controller.videoPlayerController!.value.isPlaying){
|
|
||||||
controller.videoPlayerController!.pause();
|
|
||||||
}else{
|
|
||||||
controller.videoPlayerController!.play();
|
|
||||||
}
|
|
||||||
controller.update();
|
|
||||||
},
|
|
||||||
child: AspectRatio(
|
|
||||||
aspectRatio: controller.videoPlayerController!.value.aspectRatio,
|
|
||||||
child: Stack(
|
|
||||||
children: [
|
|
||||||
VideoPlayer(controller.videoPlayerController!),
|
|
||||||
Center(child:controller.videoPlayerController!.value.isPlaying ? Container() : Image(image: AssetImage(getMineImage("icon_play")),width: 30.sp,height: 30.sp,),),
|
|
||||||
Positioned(
|
|
||||||
top: 0,
|
|
||||||
right: 0,
|
|
||||||
child: GestureDetector(
|
|
||||||
onTap: () {
|
|
||||||
// showToast("删除");
|
|
||||||
_showDelVideoDialog(Get.context!, controller);
|
|
||||||
},
|
|
||||||
child: Image(
|
|
||||||
image: AssetImage(getMineImage("icon_img_del")),
|
|
||||||
width: 20.sp,
|
|
||||||
height: 20.sp,
|
|
||||||
),
|
|
||||||
))
|
|
||||||
|
|
||||||
// ClosedCaption(text: controller.videoPlayerController!.value.caption.text),
|
|
||||||
// _ControlsOverlay(controller: controller.videoPlayerController),
|
|
||||||
// VideoProgressIndicator(controller.videoPlayerController!, allowScrubbing: true),
|
}
|
||||||
],
|
}
|
||||||
),
|
|
||||||
|
Widget _maxVideo(Call_outLogic controller){
|
||||||
|
return Container(
|
||||||
|
width:controller.videoPlayerController!.value.size.width < controller.videoPlayerController!.value.size.height ? 9*15.sp : 16*15.sp,
|
||||||
|
height:controller.videoPlayerController!.value.size.width < controller.videoPlayerController!.value.size.height ? 16*15.sp :9*15.sp,
|
||||||
|
|
||||||
|
child: Stack(
|
||||||
|
children: [
|
||||||
|
ClipRRect(
|
||||||
|
borderRadius: BorderRadius.circular(6.sp),
|
||||||
|
child: VideoItemWidget(controller.state.videolist[0])),
|
||||||
|
// Center(child:controller.videoPlayerController!.value.isPlaying ? Container() : Image(image: AssetImage(getMineImage("icon_play")),width: 30.sp,height: 30.sp,),),
|
||||||
|
Positioned(
|
||||||
|
top: 0,
|
||||||
|
right: 0,
|
||||||
|
child: GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
// showToast("删除");
|
||||||
|
_showDelVideoDialog(Get.context!, controller);
|
||||||
|
},
|
||||||
|
child: Image(
|
||||||
|
image: AssetImage(getMineImage("icon_img_del")),
|
||||||
|
width: 20.sp,
|
||||||
|
height: 20.sp,
|
||||||
|
),
|
||||||
|
))
|
||||||
|
|
||||||
|
// ClosedCaption(text: controller.videoPlayerController!.value.caption.text),
|
||||||
|
// _ControlsOverlay(controller: controller.videoPlayerController),
|
||||||
|
// VideoProgressIndicator(controller.videoPlayerController!, allowScrubbing: true),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
Widget _mixVideo(Call_outLogic controller){
|
||||||
|
return Container(
|
||||||
|
width:controller.videoPlayerController!.value.size.width < controller.videoPlayerController!.value.size.height ? 135.sp : 240.sp,
|
||||||
|
height:controller.videoPlayerController!.value.size.width < controller.videoPlayerController!.value.size.height ? 240.sp :135.sp,
|
||||||
|
child: GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
if(controller.videoPlayerController!.value.isPlaying){
|
||||||
|
controller.videoPlayerController!.pause();
|
||||||
|
}else{
|
||||||
|
controller.videoPlayerController!.play();
|
||||||
|
}
|
||||||
|
controller.update();
|
||||||
|
},
|
||||||
|
child: AspectRatio(
|
||||||
|
aspectRatio: controller.videoPlayerController!.value.aspectRatio,
|
||||||
|
child: Stack(
|
||||||
|
children: [
|
||||||
|
VideoPlayer(controller.videoPlayerController!),
|
||||||
|
Center(child:controller.videoPlayerController!.value.isPlaying ? Container() : Image(image: AssetImage(getMineImage("icon_play")),width: 30.sp,height: 30.sp,),),
|
||||||
|
Positioned(
|
||||||
|
top: 0,
|
||||||
|
right: 0,
|
||||||
|
child: GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
// showToast("删除");
|
||||||
|
_showDelVideoDialog(Get.context!, controller);
|
||||||
|
},
|
||||||
|
child: Image(
|
||||||
|
image: AssetImage(getMineImage("icon_img_del")),
|
||||||
|
width: 20.sp,
|
||||||
|
height: 20.sp,
|
||||||
|
),
|
||||||
|
))
|
||||||
|
|
||||||
|
// ClosedCaption(text: controller.videoPlayerController!.value.caption.text),
|
||||||
|
// _ControlsOverlay(controller: controller.videoPlayerController),
|
||||||
|
// VideoProgressIndicator(controller.videoPlayerController!, allowScrubbing: true),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
),
|
||||||
}
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _imageAdapter(Call_outLogic controller) {
|
Widget _imageAdapter(Call_outLogic controller) {
|
||||||
@ -571,7 +618,7 @@ class Call_outPage extends StatelessWidget {
|
|||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
|
controller.videoPlayerController?.dispose();
|
||||||
controller.videoPlayerController=null;
|
controller.videoPlayerController=null;
|
||||||
controller.state.videolist = [];
|
controller.state.videolist = [];
|
||||||
controller.update();
|
controller.update();
|
||||||
|
|||||||
@ -467,7 +467,7 @@ class InfoListView extends StatelessWidget {
|
|||||||
fit: BoxFit.fill,
|
fit: BoxFit.fill,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
))
|
)
|
||||||
],
|
],
|
||||||
)),
|
)),
|
||||||
Expanded(
|
Expanded(
|
||||||
@ -632,10 +632,7 @@ class InfoListView extends StatelessWidget {
|
|||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
)
|
)]));
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
///普通图文喊话
|
///普通图文喊话
|
||||||
|
|||||||
@ -97,25 +97,19 @@ class Complete_materialLogic extends GetxController {
|
|||||||
final XFile? pickedFile = await _picker.pickImage(
|
final XFile? pickedFile = await _picker.pickImage(
|
||||||
source: ImageSource.gallery,
|
source: ImageSource.gallery,
|
||||||
);
|
);
|
||||||
var path = await getApplicationSupportDirectoryPath();
|
if(null==pickedFile){
|
||||||
CompressObject compressObject = CompressObject(
|
return;
|
||||||
imageFile:File(pickedFile!.path), //image
|
}
|
||||||
path:path, //compress to path
|
SmartDialog.showLoading();
|
||||||
quality: 80,//first compress quality, default 80
|
upDataImage(quToken,pickedFile!,CONFIG.USER_INFO_AVATAR,(result){
|
||||||
step: 9,//compress quality step, The bigger the fast, Smaller is more accurate, default 6
|
SmartDialog.dismiss();
|
||||||
mode: CompressMode.LARGE2SMALL,//default AUTO
|
headUrl = result;
|
||||||
);
|
update();
|
||||||
Luban.compressImage(compressObject).then((_path) {
|
|
||||||
updataQiniu(pickedFile!,CONFIG.USER_INFO_AVATAR,quToken,(result){
|
|
||||||
headUrl = result;
|
|
||||||
update();
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print(e);
|
print(e);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
import 'package:cached_network_image/cached_network_image.dart';
|
||||||
import 'package:circle_app/components/my_app_bar.dart';
|
import 'package:circle_app/components/my_app_bar.dart';
|
||||||
import 'package:circle_app/router/app_routers.dart';
|
import 'package:circle_app/router/app_routers.dart';
|
||||||
import 'package:circle_app/util/util.dart';
|
import 'package:circle_app/util/util.dart';
|
||||||
@ -61,9 +62,9 @@ class Complete_materialPage extends StatelessWidget {
|
|||||||
height: 86.sp,
|
height: 86.sp,
|
||||||
)
|
)
|
||||||
: ClipOval(
|
: ClipOval(
|
||||||
child: Image.network(
|
child: CachedNetworkImage(
|
||||||
fit: BoxFit.fill,
|
fit: BoxFit.fill,
|
||||||
controller.headUrl,
|
imageUrl: controller.headUrl,
|
||||||
width: 86.sp,
|
width: 86.sp,
|
||||||
height: 86.sp,
|
height: 86.sp,
|
||||||
),
|
),
|
||||||
@ -300,27 +301,41 @@ class Complete_materialPage extends StatelessWidget {
|
|||||||
width: 240.sp,
|
width: 240.sp,
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
itemCount: controller.numbers.length,
|
itemCount: controller.numbers.length,
|
||||||
// 替换为实际的 item 数量
|
|
||||||
scrollDirection: Axis.horizontal,
|
scrollDirection: Axis.horizontal,
|
||||||
// 设置为水平方向
|
|
||||||
padding: EdgeInsets.symmetric(vertical: 18.sp),
|
padding: EdgeInsets.symmetric(vertical: 18.sp),
|
||||||
// 替换为实际的边距值
|
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
return Container(
|
return Container(
|
||||||
margin: EdgeInsets.only(right: 11.sp), // 替换为实际的 item 间距
|
margin: EdgeInsets.only(right: 11.sp), // 替换为实际的 item 间距
|
||||||
child: Container(
|
child: Container(
|
||||||
height: 34.sp,
|
|
||||||
padding: EdgeInsets.only(left: 15.sp, right: 15.sp),
|
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(17.0.sp), // 设置圆角半径
|
borderRadius: BorderRadius.circular(17.0), // 设置圆角半径
|
||||||
border: Border.all(color: Colors.white, width: 1.sp),
|
gradient: LinearGradient(
|
||||||
|
colors: [
|
||||||
|
Color(0xFF06F9FA),
|
||||||
|
Color(0xFFDC5BFD),
|
||||||
|
],
|
||||||
|
),
|
||||||
color: Color(0xFF392D53),
|
color: Color(0xFF392D53),
|
||||||
),
|
),
|
||||||
child: Text(
|
child: Container(
|
||||||
controller.numbers[index].name,
|
margin: EdgeInsets.all(0.5.sp),
|
||||||
style: TextStyle(
|
decoration: BoxDecoration(
|
||||||
fontSize: 12.0.sp,
|
borderRadius: BorderRadius.circular(17.0),
|
||||||
color: Colors.white,
|
// shape: BoxShape.circle,
|
||||||
|
color: Color(0xFF392D53),
|
||||||
|
),
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.only(
|
||||||
|
top: 2.sp, bottom: 2.sp, left: 15.sp, right: 15.sp),
|
||||||
|
child: Center(
|
||||||
|
child: Text(
|
||||||
|
controller.numbers[index].name,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 11.0,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
), // 替换为实际的列表项小部件
|
), // 替换为实际的列表项小部件
|
||||||
@ -328,24 +343,9 @@ class Complete_materialPage extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
// return Container(
|
|
||||||
// height: 21.sp,
|
|
||||||
// padding: EdgeInsets.only(left: 12.sp, right: 12.sp),
|
|
||||||
// margin: EdgeInsets.only(left: 10.sp),
|
|
||||||
// alignment: Alignment.center,
|
|
||||||
// decoration: BoxDecoration(
|
|
||||||
// border: Border.all(width: 1, color: Colors.white),
|
|
||||||
// borderRadius: BorderRadius.circular(21.sp),
|
|
||||||
// ),
|
|
||||||
// child: Text(
|
|
||||||
// interest,
|
|
||||||
// style: TextStyle(
|
|
||||||
// color: Colors.white, fontSize: 11.sp, fontWeight: FontWeight.w500),
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
showSexPiker(context, Complete_materialLogic controller) {
|
showSexPiker(context, Complete_materialLogic controller) {
|
||||||
Pickers.showSinglePicker(context,
|
Pickers.showSinglePicker(context,
|
||||||
pickerStyle: DefaultPickerStyle.dark(),
|
pickerStyle: DefaultPickerStyle.dark(),
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
import 'package:cached_network_image/cached_network_image.dart';
|
||||||
import 'package:circle_app/router/app_routers.dart';
|
import 'package:circle_app/router/app_routers.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';
|
||||||
@ -399,8 +400,8 @@ class MinefragmentPage extends StatelessWidget {
|
|||||||
child:logic.userInfoBean==null ? Container(
|
child:logic.userInfoBean==null ? Container(
|
||||||
width: 65.sp,
|
width: 65.sp,
|
||||||
height: 65.sp,
|
height: 65.sp,
|
||||||
): Image.network(
|
): CachedNetworkImage(
|
||||||
logic.userInfoBean!=null ? logic.userInfoBean!.avatar!: "",
|
imageUrl: logic.userInfoBean!=null ? logic.userInfoBean!.avatar!: "",
|
||||||
width: 65.sp,
|
width: 65.sp,
|
||||||
height: 65.sp,
|
height: 65.sp,
|
||||||
),
|
),
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:image_picker/image_picker.dart';
|
import 'package:image_picker/image_picker.dart';
|
||||||
|
|
||||||
@ -5,6 +6,7 @@ import 'state.dart';
|
|||||||
|
|
||||||
class ReportLogic extends GetxController {
|
class ReportLogic extends GetxController {
|
||||||
final ReportState state = ReportState();
|
final ReportState state = ReportState();
|
||||||
|
TextEditingController textEditingController = TextEditingController();
|
||||||
List<MyObject> arrList = <MyObject>[
|
List<MyObject> arrList = <MyObject>[
|
||||||
MyObject("涉嫌欺诈", false),
|
MyObject("涉嫌欺诈", false),
|
||||||
MyObject("色情低俗", false),
|
MyObject("色情低俗", false),
|
||||||
|
|||||||
@ -80,6 +80,7 @@ class ReportPage extends StatelessWidget {
|
|||||||
Container(
|
Container(
|
||||||
margin: EdgeInsets.only(left: 16, right: 16),
|
margin: EdgeInsets.only(left: 16, right: 16),
|
||||||
height: 200,
|
height: 200,
|
||||||
|
width: double.infinity,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Color(0xFF4C3E5F),
|
color: Color(0xFF4C3E5F),
|
||||||
borderRadius: BorderRadius.circular(10),
|
borderRadius: BorderRadius.circular(10),
|
||||||
@ -87,23 +88,62 @@ class ReportPage extends StatelessWidget {
|
|||||||
padding: EdgeInsets.all(16.sp),
|
padding: EdgeInsets.all(16.sp),
|
||||||
child: Stack(
|
child: Stack(
|
||||||
children: [
|
children: [
|
||||||
TextField(
|
Container(
|
||||||
decoration: InputDecoration.collapsed(
|
height: 200.sp,
|
||||||
hintText: '违规补充说明,帮助审核处理,选填',
|
child: TextField(
|
||||||
hintStyle: TextStyle(
|
controller: controller.textEditingController,
|
||||||
color: Color(0xFFB7BECC),
|
onChanged: (value) {
|
||||||
fontSize: 12,
|
controller.update();
|
||||||
),
|
},
|
||||||
),
|
style: TextStyle(
|
||||||
maxLines: null,
|
color: Colors.white, fontSize: 14.0.sp),
|
||||||
maxLength: 200,
|
maxLines: 32,
|
||||||
style: TextStyle(
|
maxLength: 200,
|
||||||
color: Color(0xFF000000),
|
decoration: InputDecoration(
|
||||||
fontSize: 12,
|
hintStyle: TextStyle(
|
||||||
|
color: Color.fromRGBO(
|
||||||
|
255, 255, 255, 0.6),
|
||||||
|
fontSize: 14.sp),
|
||||||
|
hintText: '违规补充说明,帮助审核处理,选填',
|
||||||
|
border: InputBorder.none,
|
||||||
|
|
||||||
|
counter: Text('')),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
Positioned(
|
||||||
|
right: 15.sp,
|
||||||
|
top: 160.sp,
|
||||||
|
child: Text(
|
||||||
|
'${controller.textEditingController.text.length}/200',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.white, fontSize: 12.sp),
|
||||||
|
)),
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
],
|
],
|
||||||
),
|
)
|
||||||
|
|
||||||
|
|
||||||
|
// Stack(
|
||||||
|
// children: [
|
||||||
|
// TextField(
|
||||||
|
// decoration: InputDecoration.collapsed(
|
||||||
|
// hintText: '违规补充说明,帮助审核处理,选填',
|
||||||
|
// border: InputBorder.none,
|
||||||
|
// hintStyle: TextStyle(
|
||||||
|
// color: Color(0xFFB7BECC),
|
||||||
|
// fontSize: 12,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// maxLength: 200,
|
||||||
|
// style: TextStyle(
|
||||||
|
// color: Color(0xFFFFFFFF),
|
||||||
|
// fontSize: 12,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@ -317,7 +317,7 @@ class _MyTabbedScreenState extends State<TextPage>
|
|||||||
children: [
|
children: [
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
showToast("鼓掌");
|
// showToast("鼓掌");
|
||||||
_showBottomSheet(context);
|
_showBottomSheet(context);
|
||||||
},
|
},
|
||||||
child: Image(
|
child: Image(
|
||||||
|
|||||||
@ -1,9 +1,16 @@
|
|||||||
|
import 'dart:io';
|
||||||
|
|
||||||
|
import 'package:flutter_luban/flutter_luban.dart';
|
||||||
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:image_picker/image_picker.dart';
|
import 'package:image_picker/image_picker.dart';
|
||||||
|
|
||||||
|
import '../../common/config.dart';
|
||||||
import '../../network/api.dart';
|
import '../../network/api.dart';
|
||||||
import '../../network/dio_manager.dart';
|
import '../../network/dio_manager.dart';
|
||||||
|
import '../../util/qiniu.dart';
|
||||||
import '../../util/util.dart';
|
import '../../util/util.dart';
|
||||||
|
import '../login/complete_material/logic.dart';
|
||||||
import 'state.dart';
|
import 'state.dart';
|
||||||
|
|
||||||
class UserinfoLogic extends GetxController {
|
class UserinfoLogic extends GetxController {
|
||||||
@ -15,22 +22,24 @@ class UserinfoLogic extends GetxController {
|
|||||||
var isVip = 0;
|
var isVip = 0;
|
||||||
var onLineCity = "";
|
var onLineCity = "";
|
||||||
var isLikeFoMsg = '';
|
var isLikeFoMsg = '';
|
||||||
|
var quToken = '';
|
||||||
|
bool isMe = false;
|
||||||
@override
|
@override
|
||||||
void onInit() async {
|
void onInit() async {
|
||||||
super.onInit();
|
super.onInit();
|
||||||
if (userId == '') {
|
if (userId == '') {
|
||||||
|
isMe = true;
|
||||||
var data = await DioManager.instance.get(url: Api.getUserInfo);
|
var data = await DioManager.instance.get(url: Api.getUserInfo);
|
||||||
var bean = BaseResponse<ResponseBean>.fromJson(
|
var bean = BaseResponse<ResponseBean>.fromJson(
|
||||||
data, (data) => ResponseBean.fromJson(data));
|
data, (data) => ResponseBean.fromJson(data));
|
||||||
if(bean.isSuccess()){
|
if(bean.isSuccess()){
|
||||||
isLikeFoMsg = bean.data.imageUrgeCount.toString()+"位圈友感兴趣,其中"+bean.data.likeMeCount.toString()+"位已催您更新";
|
isLikeFoMsg = "${bean.data.imageUrgeCount}位圈友感兴趣,其中${bean.data.likeMeCount}位已催您更新";
|
||||||
userInfoBean = bean.data.user;
|
userInfoBean = bean.data.user;
|
||||||
isVip = userInfoBean!.vip;
|
isVip = userInfoBean!.vip;
|
||||||
|
|
||||||
onLineCity = userInfoBean!.isOnline == true? "在线":"离线";
|
onLineCity = userInfoBean!.isOnline == true? "在线":"离线";
|
||||||
if(userInfoBean!.city != null) {
|
if(userInfoBean!.city != null) {
|
||||||
onLineCity = onLineCity + "·" + userInfoBean!.city.toString();
|
onLineCity = "$onLineCity·${userInfoBean!.city}";
|
||||||
}
|
}
|
||||||
ageMsg = getAgeCOntent(userInfoBean!.gender, userInfoBean!.age, userInfoBean!.role, userInfoBean!.orientation);
|
ageMsg = getAgeCOntent(userInfoBean!.gender, userInfoBean!.age, userInfoBean!.role, userInfoBean!.orientation);
|
||||||
}else{
|
}else{
|
||||||
@ -39,16 +48,17 @@ class UserinfoLogic extends GetxController {
|
|||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
var data = await DioManager.instance.get(url: Api.getUserInfoTA);
|
isMe = false;
|
||||||
|
var data = await DioManager.instance.get(url: Api.getUserInfoTA+userId+"/home");
|
||||||
var bean = BaseResponse<ResponseBean>.fromJson(
|
var bean = BaseResponse<ResponseBean>.fromJson(
|
||||||
data, (data) => ResponseBean.fromJson(data));
|
data, (data) => ResponseBean.fromJson(data));
|
||||||
if(bean.isSuccess()){
|
if(bean.isSuccess()){
|
||||||
isLikeFoMsg = bean.data.imageUrgeCount.toString()+"位圈友感兴趣,其中"+bean.data.likeMeCount.toString()+"位已催您更新";
|
isLikeFoMsg = "${bean.data.imageUrgeCount}位圈友感兴趣,其中${bean.data.likeMeCount}位已催您更新";
|
||||||
userInfoBean = bean.data!;
|
userInfoBean = bean.data!.user;
|
||||||
isVip = userInfoBean!.vip;
|
isVip = userInfoBean!.vip;
|
||||||
onLineCity = userInfoBean!.isOnline == true? "在线":"离线";
|
onLineCity = userInfoBean!.isOnline == true? "在线":"离线";
|
||||||
if(userInfoBean!.city != null){
|
if(userInfoBean!.city != null){
|
||||||
onLineCity = onLineCity +"·"+userInfoBean!.city.toString();
|
onLineCity = "$onLineCity·${userInfoBean!.city}";
|
||||||
}
|
}
|
||||||
|
|
||||||
ageMsg = getAgeCOntent(userInfoBean!.gender, userInfoBean!.age, userInfoBean!.role, userInfoBean!.orientation);
|
ageMsg = getAgeCOntent(userInfoBean!.gender, userInfoBean!.age, userInfoBean!.role, userInfoBean!.orientation);
|
||||||
@ -58,6 +68,18 @@ class UserinfoLogic extends GetxController {
|
|||||||
}
|
}
|
||||||
update();
|
update();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var data =
|
||||||
|
await DioManager.instance.get(url: Api.getqiniuToken, params: {});
|
||||||
|
var bean = BaseResponse<QnTokenData>.fromJson(
|
||||||
|
data, (data) => QnTokenData.fromJson(data));
|
||||||
|
quToken = bean.data!.token.toString();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
updataImage(){
|
||||||
|
showToast(""+state.updataimaglist.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
Future getImageFile() async {
|
Future getImageFile() async {
|
||||||
@ -65,13 +87,18 @@ class UserinfoLogic extends GetxController {
|
|||||||
final XFile? pickedFile = await _picker.pickImage(
|
final XFile? pickedFile = await _picker.pickImage(
|
||||||
source: ImageSource.gallery,
|
source: ImageSource.gallery,
|
||||||
);
|
);
|
||||||
// setState(() {
|
if(null==pickedFile){
|
||||||
// _setImageFileListFromFile(pickedFile);
|
return;
|
||||||
// });
|
}
|
||||||
|
SmartDialog.showLoading();
|
||||||
|
upDataImage(quToken,pickedFile!,CONFIG.USER_ALBUM_IMAGE,(result){
|
||||||
|
SmartDialog.dismiss();
|
||||||
|
state.imaglist.add(result);
|
||||||
|
state.updataimaglist.add(result);
|
||||||
|
update();
|
||||||
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// setState(() {
|
|
||||||
// _pickImageError = e;
|
|
||||||
// });
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,4 +4,5 @@ class UserinfoState {
|
|||||||
///Initialize variables
|
///Initialize variables
|
||||||
}
|
}
|
||||||
List<String> imaglist = [];
|
List<String> imaglist = [];
|
||||||
|
List<String> updataimaglist = [];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
import 'package:cached_network_image/cached_network_image.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';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
@ -121,7 +122,7 @@ class _MyTabbedScreenState extends State<UserinfoPage>
|
|||||||
children: [
|
children: [
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
showToast("鼓掌");
|
// showToast("鼓掌");
|
||||||
_showBottomSheet(context);
|
_showBottomSheet(context);
|
||||||
},
|
},
|
||||||
child: Image(
|
child: Image(
|
||||||
@ -288,13 +289,13 @@ class _MyTabbedScreenState extends State<UserinfoPage>
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
titleTab(),
|
titleTab(controller),
|
||||||
Container(
|
Container(
|
||||||
margin: EdgeInsets.only(top: 18.sp, bottom: 14.sp),
|
margin: EdgeInsets.only(top: 18.sp, bottom: 14.sp),
|
||||||
child: Text(
|
child: controller.isMe? Text(
|
||||||
controller.isLikeFoMsg,
|
controller.isLikeFoMsg,
|
||||||
style: TextStyle(color: Colors.white30),
|
style: TextStyle(color: Colors.white30),
|
||||||
)),
|
) :Container()) ,
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Container(
|
child: Container(
|
||||||
// color: Colors.blue,
|
// color: Colors.blue,
|
||||||
@ -310,7 +311,7 @@ class _MyTabbedScreenState extends State<UserinfoPage>
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
Widget titleTab(){
|
Widget titleTab(UserinfoLogic controller){
|
||||||
return Container(
|
return Container(
|
||||||
alignment: Alignment.centerLeft,
|
alignment: Alignment.centerLeft,
|
||||||
height: 27.sp,
|
height: 27.sp,
|
||||||
@ -332,28 +333,31 @@ class _MyTabbedScreenState extends State<UserinfoPage>
|
|||||||
Tab(text: "喊话")
|
Tab(text: "喊话")
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
Container(
|
GestureDetector(onTap: (){
|
||||||
decoration: BoxDecoration(
|
controller.updataImage();
|
||||||
borderRadius: BorderRadius.circular(17),
|
},
|
||||||
gradient: LinearGradient(
|
child: Container(
|
||||||
colors: [
|
decoration: BoxDecoration(
|
||||||
Color(0xFF06F9FA),
|
borderRadius: BorderRadius.circular(17),
|
||||||
Color(0xFFDC5BFD),
|
gradient: LinearGradient(
|
||||||
],
|
colors: [
|
||||||
begin: Alignment.centerLeft,
|
controller.state.updataimaglist.length==0 && controller.isMe? Color(0xFF4A3E5D):Color(0xFF06F9FA),
|
||||||
end: Alignment.centerRight,
|
controller.state.updataimaglist.length==0 && controller.isMe? Color(0xFF344143):Color(0xFFDC5BFD),
|
||||||
),
|
],
|
||||||
),
|
begin: Alignment.centerLeft,
|
||||||
padding: EdgeInsets.only(
|
end: Alignment.centerRight,
|
||||||
top: 2.sp, bottom: 2.sp, left: 12.sp, right: 12.sp),
|
),
|
||||||
child: Text(
|
),
|
||||||
"完成",
|
padding: EdgeInsets.only(
|
||||||
style: TextStyle(
|
top: 2.sp, bottom: 2.sp, left: 12.sp, right: 12.sp),
|
||||||
color: Colors.white,
|
child: Text(
|
||||||
fontSize: 12,
|
controller.isMe? "完成" : "催更",
|
||||||
),
|
style: TextStyle(
|
||||||
),
|
color: Colors.white,
|
||||||
),
|
fontSize: 12,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),),
|
||||||
],
|
],
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
@ -363,34 +367,44 @@ class _MyTabbedScreenState extends State<UserinfoPage>
|
|||||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||||
crossAxisCount: 3, // 每行显示的项目数量
|
crossAxisCount: 3, // 每行显示的项目数量
|
||||||
),
|
),
|
||||||
itemCount: controller.state.imaglist.length+1, // 项目的总数量,包括固定图片和接口获取的项目
|
itemCount:controller.isMe? controller.state.imaglist.length+1: controller.state.imaglist.length, // 项目的总数量,包括固定图片和接口获取的项目
|
||||||
itemBuilder: (BuildContext context, int index) {
|
itemBuilder: (BuildContext context, int index) {
|
||||||
if (index == 0) {
|
if(controller.isMe){
|
||||||
// 第一个项目,显示固定的图片
|
if (index == 0) {
|
||||||
return GestureDetector(
|
// 第一个项目,显示固定的图片
|
||||||
onTap: () {
|
return GestureDetector(
|
||||||
controller.getImageFile();
|
onTap: () {
|
||||||
|
controller.getImageFile();
|
||||||
|
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
margin: EdgeInsets.all(5.sp),
|
margin: EdgeInsets.all(5.sp),
|
||||||
child: Image(
|
child: Image(
|
||||||
image: AssetImage(getMineImage("icon_img_add")),
|
image: AssetImage(getMineImage("icon_img_add")),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
);
|
||||||
);
|
} else {
|
||||||
} else {
|
return Container(
|
||||||
// 后续项目,根据接口获取数据
|
margin: EdgeInsets.all(5.sp),
|
||||||
// 假设通过接口获取到的数据存储在一个名为 data 的列表中
|
child: Center(
|
||||||
// var itemData = data[index - 1]; // 减去第一个固定图片的索引
|
child: _buildImageItem(
|
||||||
|
controller.state.imaglist[index-1],
|
||||||
|
controller,index-1)),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
return Container(
|
return Container(
|
||||||
margin: EdgeInsets.all(5.sp),
|
margin: EdgeInsets.all(5.sp),
|
||||||
child: Center(
|
child: Center(
|
||||||
child: _buildImageItem(
|
child: _buildImageItem(
|
||||||
controller.state.imaglist[index-1],
|
controller.state.imaglist[index],
|
||||||
controller,index-1)),
|
controller,index)),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -497,8 +511,8 @@ class _MyTabbedScreenState extends State<UserinfoPage>
|
|||||||
'index': 0
|
'index': 0
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
child: Image.network(
|
child: CachedNetworkImage(
|
||||||
controller.userInfoBean != null
|
imageUrl: controller.userInfoBean != null
|
||||||
? controller.userInfoBean!.avatar
|
? controller.userInfoBean!.avatar
|
||||||
: "",
|
: "",
|
||||||
width: 66.sp,
|
width: 66.sp,
|
||||||
@ -512,19 +526,22 @@ class _MyTabbedScreenState extends State<UserinfoPage>
|
|||||||
Widget _buildImageItem(String url, UserinfoLogic controller,int index) {
|
Widget _buildImageItem(String url, UserinfoLogic controller,int index) {
|
||||||
return Stack(
|
return Stack(
|
||||||
children: [
|
children: [
|
||||||
ClipRRect(
|
Container(
|
||||||
borderRadius: BorderRadius.circular(0.0),
|
width: double.infinity, // 设置容器宽度为屏幕宽度
|
||||||
child: GestureDetector(
|
height: double.infinity,
|
||||||
onTap: () {
|
child: ClipRRect(
|
||||||
// Get.toNamed(AppRoutes.Swiper,arguments:controller.state.imaglist);
|
borderRadius: BorderRadius.circular(0.0),
|
||||||
|
child: GestureDetector(
|
||||||
Get.toNamed(AppRoutes.Swiper, arguments: {
|
onTap: () {
|
||||||
'imaglist':controller.state.imaglist,
|
Get.toNamed(AppRoutes.Swiper, arguments: {
|
||||||
'index':index
|
'imaglist':controller.state.imaglist,
|
||||||
});
|
'index':index
|
||||||
},
|
});
|
||||||
child: Image.network(
|
},
|
||||||
url,
|
child: Image.network(
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
url,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -727,7 +744,9 @@ class _MyTabbedScreenState extends State<UserinfoPage>
|
|||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
|
controller.state.updataimaglist.remove(controller.state.updataimaglist[index]);
|
||||||
controller.state.imaglist.removeAt(index);
|
controller.state.imaglist.removeAt(index);
|
||||||
|
|
||||||
controller.update();
|
controller.update();
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|||||||
@ -7,4 +7,6 @@ class CONFIG{
|
|||||||
static const CALL_OUT_IMAGE = 'call_out_image/';
|
static const CALL_OUT_IMAGE = 'call_out_image/';
|
||||||
|
|
||||||
static const USER_INFO_AVATAR = 'user_info_avatar/';
|
static const USER_INFO_AVATAR = 'user_info_avatar/';
|
||||||
|
|
||||||
|
static const USER_ALBUM_IMAGE = 'user_album_image/';
|
||||||
}
|
}
|
||||||
@ -55,5 +55,5 @@ class Api {
|
|||||||
|
|
||||||
|
|
||||||
//他人信息
|
//他人信息
|
||||||
static const getUserInfoTA = 'user-service/user/1/home';
|
static const getUserInfoTA = 'user-service/user/';
|
||||||
}
|
}
|
||||||
@ -104,7 +104,7 @@ class AppPages {
|
|||||||
),
|
),
|
||||||
GetPage(
|
GetPage(
|
||||||
name: AppRoutes.UserInfoActivity,
|
name: AppRoutes.UserInfoActivity,
|
||||||
page: () => UserinfoPage(),
|
page: () => FlutterSmartDialog(child: UserinfoPage()),
|
||||||
binding: UserinfoBinding(),
|
binding: UserinfoBinding(),
|
||||||
),
|
),
|
||||||
GetPage(
|
GetPage(
|
||||||
|
|||||||
@ -2,6 +2,8 @@ import 'dart:convert';
|
|||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'dart:math';
|
import 'dart:math';
|
||||||
|
|
||||||
|
import 'package:circle_app/util/util.dart';
|
||||||
|
import 'package:flutter_luban/flutter_luban.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';
|
||||||
@ -11,35 +13,9 @@ import '../common/config.dart';
|
|||||||
|
|
||||||
typedef void MyCallback(String result);
|
typedef void MyCallback(String result);
|
||||||
|
|
||||||
void updataQiniu(XFile pickedFile,String path ,String quToken,MyCallback myCallback) {
|
|
||||||
SmartDialog.showLoading();
|
|
||||||
var storage = Storage();
|
|
||||||
DateTime now = DateTime.now();
|
|
||||||
String yearMonth = DateFormat('yyyyMM').format(now);
|
|
||||||
String imgPath = path +yearMonth+"/"+generateRandomString(16)+ pickedFile.name;
|
|
||||||
PutController putController = PutController();
|
|
||||||
putController.addStatusListener((StorageStatus status) {
|
|
||||||
if (status == StorageStatus.Success) {
|
|
||||||
var headUrl = CONFIG.IMAGE_HEAD + imgPath;
|
|
||||||
myCallback(headUrl);
|
|
||||||
SmartDialog.dismiss();
|
|
||||||
}
|
|
||||||
print('状态变化: 当前任务状态:$status');
|
|
||||||
});
|
|
||||||
|
|
||||||
putController.addProgressListener((double status) {
|
//上传七牛云
|
||||||
|
void updataQiniu(String filePath,String name,String path ,String quToken,MyCallback myCallback) {
|
||||||
print('上传进度: $status');
|
|
||||||
});
|
|
||||||
|
|
||||||
storage.putFile(File(pickedFile.path), quToken,
|
|
||||||
options: PutOptions(controller: putController, key: imgPath));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void upVideoQiniu(String filePath,String name,String path ,String quToken,MyCallback myCallback) {
|
|
||||||
SmartDialog.showLoading();
|
|
||||||
var storage = Storage();
|
var storage = Storage();
|
||||||
DateTime now = DateTime.now();
|
DateTime now = DateTime.now();
|
||||||
String yearMonth = DateFormat('yyyyMM').format(now);
|
String yearMonth = DateFormat('yyyyMM').format(now);
|
||||||
@ -49,7 +25,7 @@ void upVideoQiniu(String filePath,String name,String path ,String quToken,MyCall
|
|||||||
if (status == StorageStatus.Success) {
|
if (status == StorageStatus.Success) {
|
||||||
var headUrl = CONFIG.IMAGE_HEAD + imgPath;
|
var headUrl = CONFIG.IMAGE_HEAD + imgPath;
|
||||||
myCallback(headUrl);
|
myCallback(headUrl);
|
||||||
SmartDialog.dismiss();
|
|
||||||
}
|
}
|
||||||
print('状态变化: 当前任务状态:$status');
|
print('状态变化: 当前任务状态:$status');
|
||||||
});
|
});
|
||||||
@ -64,6 +40,27 @@ void upVideoQiniu(String filePath,String name,String path ,String quToken,MyCall
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//封装上传图片
|
||||||
|
void upDataImage(String quToken ,XFile pickedFile,String updataRoute,MyCallback myCallback) async{
|
||||||
|
|
||||||
|
var path = await getApplicationSupportDirectoryPath();
|
||||||
|
|
||||||
|
CompressObject compressObject = CompressObject(
|
||||||
|
imageFile:File(pickedFile.path), //image
|
||||||
|
path:path, //compress to path
|
||||||
|
quality: 80,//first compress quality, default 80
|
||||||
|
step: 9,//compress quality step, The bigger the fast, Smaller is more accurate, default 6
|
||||||
|
mode: CompressMode.LARGE2SMALL,//default AUTO
|
||||||
|
);
|
||||||
|
Luban.compressImage(compressObject).then((_path) {
|
||||||
|
updataQiniu(_path.toString(),pickedFile.name,updataRoute,quToken,(result){
|
||||||
|
myCallback(result);
|
||||||
|
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
String generateRandomString(int length) {
|
String generateRandomString(int length) {
|
||||||
var random = Random.secure();
|
var random = Random.secure();
|
||||||
var values = List<int>.generate(length, (index) => random.nextInt(256));
|
var values = List<int>.generate(length, (index) => random.nextInt(256));
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user