新增会话界面 发送视频和视频拍摄 修改同意隐私协议的逻辑
This commit is contained in:
parent
4a86537491
commit
8f6e0c5aab
@ -65,8 +65,8 @@ android {
|
|||||||
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
|
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion flutter.targetSdkVersion
|
targetSdkVersion flutter.targetSdkVersion
|
||||||
versionCode 10
|
versionCode 11
|
||||||
versionName "1.0.9"
|
versionName "1.1.0"
|
||||||
manifestPlaceholders = [
|
manifestPlaceholders = [
|
||||||
vivo_APPID: "105669716",
|
vivo_APPID: "105669716",
|
||||||
vivo_APPKEY:"84f750207787376b310ca5b0d5969122",
|
vivo_APPKEY:"84f750207787376b310ca5b0d5969122",
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
import 'dart:ffi';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'dart:math';
|
import 'dart:math';
|
||||||
import 'dart:typed_data';
|
import 'dart:typed_data';
|
||||||
@ -804,16 +805,14 @@ class _TIMTextFieldLayoutNarrowState
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future checkVipStatus() async {
|
Future checkVipStatus(int plate) async {
|
||||||
if (!isVip) {
|
var data =
|
||||||
var data = await DioManager.instance.get(url: Api.getUserMine);
|
await DioManager.instance.get(url: Api.getIsVips + plate.toString());
|
||||||
var bean = BaseResponse<MineResponseBean>.fromJson(
|
|
||||||
data, (data) => MineResponseBean.fromJson(data));
|
if (data['code'] == 200) {
|
||||||
if (bean.isSuccess()) {
|
isVip = !data['data'];
|
||||||
User userInfoBean = bean.data.user!;
|
|
||||||
isVip = userInfoBean.vip > 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isVip) {
|
if (!isVip) {
|
||||||
showOKToast('开通会员之后才能发送图片');
|
showOKToast('开通会员之后才能发送图片');
|
||||||
Get.bottomSheet(
|
Get.bottomSheet(
|
||||||
@ -833,7 +832,8 @@ class _TIMTextFieldLayoutNarrowState
|
|||||||
VideoPlayerController? videoPlayerController;
|
VideoPlayerController? videoPlayerController;
|
||||||
|
|
||||||
Future getVideoFile(ImageSource imageSource) async {
|
Future getVideoFile(ImageSource imageSource) async {
|
||||||
bool isOK = await checkVipStatus();
|
bool isOK = await checkVipStatus(imageSource == ImageSource.camera ? 2 : 4);
|
||||||
|
|
||||||
if (!isOK) {
|
if (!isOK) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -874,6 +874,11 @@ class _TIMTextFieldLayoutNarrowState
|
|||||||
duration: durationInSeconds.toInt(),
|
duration: durationInSeconds.toInt(),
|
||||||
inputElement: context,
|
inputElement: context,
|
||||||
);
|
);
|
||||||
|
if (imageSource == ImageSource.camera) {
|
||||||
|
DioManager.instance.get(url: Api.getAddTrialCount + "2");
|
||||||
|
} else {
|
||||||
|
DioManager.instance.get(url: Api.getAddTrialCount + "4");
|
||||||
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print(e);
|
print(e);
|
||||||
// setState(() {
|
// setState(() {
|
||||||
@ -906,7 +911,7 @@ class _TIMTextFieldLayoutNarrowState
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future getImageFile() async {
|
Future getImageFile() async {
|
||||||
bool isOK = await checkVipStatus();
|
bool isOK = await checkVipStatus(3);
|
||||||
if (!isOK) {
|
if (!isOK) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -919,6 +924,7 @@ class _TIMTextFieldLayoutNarrowState
|
|||||||
convID: widget.conversationID,
|
convID: widget.conversationID,
|
||||||
convType: widget.conversationType,
|
convType: widget.conversationType,
|
||||||
inputElement: context);
|
inputElement: context);
|
||||||
|
var data = await DioManager.instance.get(url: Api.getAddTrialCount + "3");
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print(e);
|
print(e);
|
||||||
// setState(() {
|
// setState(() {
|
||||||
@ -928,7 +934,7 @@ class _TIMTextFieldLayoutNarrowState
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future getTakeImageFile() async {
|
Future getTakeImageFile() async {
|
||||||
bool isOK = await checkVipStatus();
|
bool isOK = await checkVipStatus(1);
|
||||||
if (!isOK) {
|
if (!isOK) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -942,6 +948,7 @@ class _TIMTextFieldLayoutNarrowState
|
|||||||
convID: widget.conversationID,
|
convID: widget.conversationID,
|
||||||
convType: widget.conversationType,
|
convType: widget.conversationType,
|
||||||
inputElement: context);
|
inputElement: context);
|
||||||
|
var data = await DioManager.instance.get(url: Api.getAddTrialCount + "1");
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,10 +1,13 @@
|
|||||||
|
import 'dart:ffi';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
|
import 'package:connectivity/connectivity.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/gestures.dart';
|
import 'package:flutter/gestures.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||||
import 'package:tencent_chat_push_for_china/tencent_chat_push_for_china.dart';
|
import 'package:tencent_chat_push_for_china/tencent_chat_push_for_china.dart';
|
||||||
import 'package:tencent_cloud_chat_uikit/tencent_cloud_chat_uikit.dart';
|
import 'package:tencent_cloud_chat_uikit/tencent_cloud_chat_uikit.dart';
|
||||||
|
|
||||||
@ -36,7 +39,6 @@ class _CustomDialogState extends State<YesAgreementDialog> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return WillPopScope(
|
return WillPopScope(
|
||||||
onWillPop: () async {
|
onWillPop: () async {
|
||||||
|
|
||||||
print(getAgreemement());
|
print(getAgreemement());
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
@ -126,10 +128,23 @@ class _CustomDialogState extends State<YesAgreementDialog> {
|
|||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
// 点击操作
|
// 点击操作
|
||||||
|
SmartDialog.showLoading();
|
||||||
|
var connectivityResult =
|
||||||
|
await Connectivity().checkConnectivity();
|
||||||
|
|
||||||
|
if (connectivityResult == ConnectivityResult.none) {
|
||||||
|
showOKToast("请检查网络连接是否正常");
|
||||||
|
print('没网');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
var sp = await SharedPreferencesHelper.getInstance();
|
var sp = await SharedPreferencesHelper.getInstance();
|
||||||
sp.setBool(SharedPreferencesHelper.AGREEMENT, true);
|
sp.setBool(SharedPreferencesHelper.AGREEMENT, true);
|
||||||
|
} catch (e) {}
|
||||||
|
await uploadBuzIDAndToken();
|
||||||
|
SmartDialog.dismiss();
|
||||||
pushLoginPage();
|
pushLoginPage();
|
||||||
uploadBuzIDAndToken();
|
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 240.sp,
|
width: 240.sp,
|
||||||
@ -179,8 +194,7 @@ class _CustomDialogState extends State<YesAgreementDialog> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<bool> uploadBuzIDAndToken() async {
|
||||||
void uploadBuzIDAndToken() async {
|
|
||||||
if (Platform.isAndroid) {
|
if (Platform.isAndroid) {
|
||||||
initWxApi();
|
initWxApi();
|
||||||
}
|
}
|
||||||
@ -199,5 +213,7 @@ class _CustomDialogState extends State<YesAgreementDialog> {
|
|||||||
|
|
||||||
print("token=" + res.code.toString());
|
print("token=" + res.code.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
|
import 'package:connectivity/connectivity.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_native_splash/flutter_native_splash.dart';
|
import 'package:flutter_native_splash/flutter_native_splash.dart';
|
||||||
@ -26,11 +27,16 @@ class SplashLogic extends GetxController {
|
|||||||
super.onReady();
|
super.onReady();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onInit() async {
|
void onInit() async {
|
||||||
super.onInit();
|
super.onInit();
|
||||||
// await Future.delayed(Duration(seconds: 30));
|
// await Future.delayed(Duration(seconds: 30));
|
||||||
|
|
||||||
|
// 启动网络连接监听
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var data1 =
|
var data1 =
|
||||||
await DioManager.instance.get(url: Api.getCircleList, params: {});
|
await DioManager.instance.get(url: Api.getCircleList, params: {});
|
||||||
var bean1 = BaseResponse<ConfigBean>.fromJson(
|
var bean1 = BaseResponse<ConfigBean>.fromJson(
|
||||||
@ -50,7 +56,6 @@ class SplashLogic extends GetxController {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ((await getAuthorization()).isEmpty) {
|
if ((await getAuthorization()).isEmpty) {
|
||||||
if (Platform.isIOS) {
|
if (Platform.isIOS) {
|
||||||
pushLoginPage();
|
pushLoginPage();
|
||||||
@ -82,7 +87,9 @@ class SplashLogic extends GetxController {
|
|||||||
});
|
});
|
||||||
|
|
||||||
return;
|
return;
|
||||||
} else if (bean.code == 5000 || bean.code == 5001 || bean.code == 5002 ||
|
} else if (bean.code == 5000 ||
|
||||||
|
bean.code == 5001 ||
|
||||||
|
bean.code == 5002 ||
|
||||||
bean.code == 5003) {
|
bean.code == 5003) {
|
||||||
pushLoginPage();
|
pushLoginPage();
|
||||||
return;
|
return;
|
||||||
@ -99,7 +106,6 @@ class SplashLogic extends GetxController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void showReportDialog() {
|
void showReportDialog() {
|
||||||
FlutterNativeSplash.remove();
|
FlutterNativeSplash.remove();
|
||||||
showDialog(
|
showDialog(
|
||||||
|
|||||||
@ -45,12 +45,7 @@ class _WebViewContainerState extends State<WebviewPage> {
|
|||||||
|
|
||||||
},
|
},
|
||||||
onWebResourceError: (WebResourceError error) {},
|
onWebResourceError: (WebResourceError error) {},
|
||||||
onNavigationRequest: (NavigationRequest request) {
|
|
||||||
if (request.url.startsWith('')) {
|
|
||||||
return NavigationDecision.prevent;
|
|
||||||
}
|
|
||||||
return NavigationDecision.navigate;
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
..loadRequest(Uri.parse(url));
|
..loadRequest(Uri.parse(url));
|
||||||
|
|||||||
@ -80,6 +80,15 @@ class Api {
|
|||||||
static const getUserMine = 'user-service/my/main';
|
static const getUserMine = 'user-service/my/main';
|
||||||
|
|
||||||
|
|
||||||
|
//发消息是否需要vip弹窗
|
||||||
|
static const getIsVips = 'mall-service/vips/show/';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//发视频图片消息增加计数
|
||||||
|
static const getAddTrialCount = 'mall-service/vips/trialCount/';
|
||||||
|
|
||||||
|
|
||||||
//个人信息
|
//个人信息
|
||||||
static const getUserInfo = 'user-service/my/home';
|
static const getUserInfo = 'user-service/my/home';
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user