圈子相关点击滑动到顶部 还有bug修改
This commit is contained in:
parent
28e9f4b29b
commit
dff55ab48f
96
circle_app/android/app/agconnect-services.json
Normal file
96
circle_app/android/app/agconnect-services.json
Normal file
@ -0,0 +1,96 @@
|
||||
{
|
||||
"agcgw":{
|
||||
"backurl":"connect-drcn.hispace.hicloud.com",
|
||||
"url":"connect-drcn.dbankcloud.cn",
|
||||
"websocketbackurl":"connect-ws-drcn.hispace.dbankcloud.com",
|
||||
"websocketurl":"connect-ws-drcn.hispace.dbankcloud.cn"
|
||||
},
|
||||
"agcgw_all":{
|
||||
"CN":"connect-drcn.dbankcloud.cn",
|
||||
"CN_back":"connect-drcn.hispace.hicloud.com",
|
||||
"DE":"connect-dre.dbankcloud.cn",
|
||||
"DE_back":"connect-dre.hispace.hicloud.com",
|
||||
"RU":"connect-drru.hispace.dbankcloud.ru",
|
||||
"RU_back":"connect-drru.hispace.dbankcloud.cn",
|
||||
"SG":"connect-dra.dbankcloud.cn",
|
||||
"SG_back":"connect-dra.hispace.hicloud.com"
|
||||
},
|
||||
"websocketgw_all":{
|
||||
"CN":"connect-ws-drcn.hispace.dbankcloud.cn",
|
||||
"CN_back":"connect-ws-drcn.hispace.dbankcloud.com",
|
||||
"DE":"connect-ws-dre.hispace.dbankcloud.cn",
|
||||
"DE_back":"connect-ws-dre.hispace.dbankcloud.com",
|
||||
"RU":"connect-ws-drru.hispace.dbankcloud.ru",
|
||||
"RU_back":"connect-ws-drru.hispace.dbankcloud.cn",
|
||||
"SG":"connect-ws-dra.hispace.dbankcloud.cn",
|
||||
"SG_back":"connect-ws-dra.hispace.dbankcloud.com"
|
||||
},
|
||||
"client":{
|
||||
"cp_id":"30086000588740851",
|
||||
"product_id":"388421841221621215",
|
||||
"client_id":"1220247869945040704",
|
||||
"client_secret":"6CF6962F20BA3CB6B9636ACF05D7E5EDD012ACA4635A0FB4C9FEFF9CA9AFDDD3",
|
||||
"project_id":"388421841221621215",
|
||||
"app_id":"108937353",
|
||||
"api_key":"DAEDAJgZjHa/eqRm+4a82hc/xGIXjfwMZ7fb3PIBDsjow5BLgA8wvuSI42ntIcLhEKexG5MieEvAOX7cMtz+yCSjLj77CXLkXigVHg==",
|
||||
"package_name":"com.leyuan.app"
|
||||
},
|
||||
"oauth_client":{
|
||||
"client_id":"108937353",
|
||||
"client_type":1
|
||||
},
|
||||
"app_info":{
|
||||
"app_id":"108937353",
|
||||
"package_name":"com.leyuan.app"
|
||||
},
|
||||
"service":{
|
||||
"analytics":{
|
||||
"collector_url":"datacollector-drcn.dt.hicloud.com,datacollector-drcn.dt.dbankcloud.cn",
|
||||
"collector_url_ru":"datacollector-drru.dt.dbankcloud.ru,datacollector-drru.dt.hicloud.com",
|
||||
"collector_url_sg":"datacollector-dra.dt.hicloud.com,datacollector-dra.dt.dbankcloud.cn",
|
||||
"collector_url_de":"datacollector-dre.dt.hicloud.com,datacollector-dre.dt.dbankcloud.cn",
|
||||
"collector_url_cn":"datacollector-drcn.dt.hicloud.com,datacollector-drcn.dt.dbankcloud.cn",
|
||||
"resource_id":"p1",
|
||||
"channel_id":""
|
||||
},
|
||||
"edukit":{
|
||||
"edu_url":"edukit.edu.cloud.huawei.com.cn",
|
||||
"dh_url":"edukit.edu.cloud.huawei.com.cn"
|
||||
},
|
||||
"search":{
|
||||
"url":"https://search-drcn.cloud.huawei.com"
|
||||
},
|
||||
"cloudstorage":{
|
||||
"storage_url_sg_back":"https://agc-storage-dra.cloud.huawei.asia",
|
||||
"storage_url_ru_back":"https://agc-storage-drru.cloud.huawei.ru",
|
||||
"storage_url_ru":"https://agc-storage-drru.cloud.huawei.ru",
|
||||
"storage_url_de_back":"https://agc-storage-dre.cloud.huawei.eu",
|
||||
"storage_url_de":"https://ops-dre.agcstorage.link",
|
||||
"storage_url":"https://agc-storage-drcn.platform.dbankcloud.cn",
|
||||
"storage_url_sg":"https://ops-dra.agcstorage.link",
|
||||
"storage_url_cn_back":"https://agc-storage-drcn.cloud.huawei.com.cn",
|
||||
"storage_url_cn":"https://agc-storage-drcn.platform.dbankcloud.cn"
|
||||
},
|
||||
"ml":{
|
||||
"mlservice_url":"ml-api-drcn.ai.dbankcloud.com,ml-api-drcn.ai.dbankcloud.cn"
|
||||
}
|
||||
},
|
||||
"region":"CN",
|
||||
"configuration_version":"3.0",
|
||||
"appInfos":[
|
||||
{
|
||||
"package_name":"com.leyuan.app",
|
||||
"client":{
|
||||
"app_id":"108937353"
|
||||
},
|
||||
"app_info":{
|
||||
"package_name":"com.leyuan.app",
|
||||
"app_id":"108937353"
|
||||
},
|
||||
"oauth_client":{
|
||||
"client_type":1,
|
||||
"client_id":"108937353"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -24,6 +24,7 @@ if (flutterVersionName == null) {
|
||||
apply plugin: 'com.android.application'
|
||||
apply plugin: 'kotlin-android'
|
||||
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
|
||||
apply plugin: 'com.huawei.agconnect'
|
||||
|
||||
android {
|
||||
compileSdkVersion flutter.compileSdkVersion
|
||||
@ -66,6 +67,11 @@ android {
|
||||
targetSdkVersion flutter.targetSdkVersion
|
||||
versionCode flutterVersionCode.toInteger()
|
||||
versionName flutterVersionName
|
||||
manifestPlaceholders = [
|
||||
vivo_APPID: "105669716",
|
||||
vivo_APPKEY:"84f750207787376b310ca5b0d5969122",
|
||||
]
|
||||
|
||||
// ndk {
|
||||
// abiFilters 'armeabi-v7a', 'arm64-v8a'
|
||||
// ldLibs "log"
|
||||
@ -77,10 +83,11 @@ android {
|
||||
// TODO: Add your own signing config for the release build.
|
||||
// Signing with the debug keys for now, so `flutter run --release` works.
|
||||
//flutter build apk --no-sound-null-safety
|
||||
signingConfig signingConfigs.debug
|
||||
signingConfig signingConfigs.release
|
||||
project.ext.enableFlutterNullSafety = false
|
||||
}
|
||||
debug {
|
||||
signingConfig signingConfigs.release
|
||||
project.ext.enableFlutterNullSafety = false
|
||||
}
|
||||
}
|
||||
|
||||
@ -26,10 +26,41 @@
|
||||
android:name="android.permission.READ_MEDIA_VIDEO"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <!-- 这个权限用于访问GPS定位 -->
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||
<uses-permission android:name = "com.huawei.android.launcher.permission.CHANGE_BADGE "/>
|
||||
<uses-permission android:name="com.vivo.notification.permission.BADGE_ICON" />
|
||||
<uses-permission android:name = "com.hihonor.android.launcher.permission.CHANGE_BADGE" />
|
||||
|
||||
|
||||
<!--小米 开始-->
|
||||
<permission
|
||||
android:name="com.leyuan.app.permission.MIPUSH_RECEIVE"
|
||||
android:protectionLevel="signature" />
|
||||
<uses-permission android:name="com.leyuan.app.permission.MIPUSH_RECEIVE" />
|
||||
<!--小米 结束-->
|
||||
|
||||
<!--OPPO 开始-->
|
||||
<uses-permission android:name="com.coloros.mcs.permission.RECIEVE_MCS_MESSAGE" />
|
||||
<uses-permission android:name="com.heytap.mcs.permission.RECIEVE_MCS_MESSAGE" />
|
||||
<!--OPPO 结束-->
|
||||
|
||||
<!--魅族 开始-->
|
||||
<!-- 可选,用于兼容 Flyme5 且推送服务是旧版本的情况-->
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
<!-- 兼容 Flyme5 的权限配置-->
|
||||
<uses-permission android:name="com.meizu.flyme.push.permission.RECEIVE" />
|
||||
<permission android:name="com.leyuan.app.push.permission.MESSAGE"
|
||||
android:protectionLevel="signature"/>
|
||||
<uses-permission android:name="com.leyuan.app.push.permission.MESSAGE" />
|
||||
<!-- 兼容 Flyme3 的权限配置-->
|
||||
<uses-permission android:name="com.meizu.c2dm.permission.RECEIVE" />
|
||||
<permission android:name="com.leyuan.app.permission.C2D_MESSAGE" android:protectionLevel="signature"
|
||||
/>
|
||||
<uses-permission android:name="com.leyuan.app.permission.C2D_MESSAGE"/>
|
||||
<!--魅族 结束-->
|
||||
|
||||
<application
|
||||
android:label="微乐园"
|
||||
android:name="${applicationName}"
|
||||
|
||||
android:icon="@mipmap/ic_launcher">
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
@ -39,6 +70,7 @@
|
||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
||||
android:hardwareAccelerated="true"
|
||||
android:usesCleartextTraffic="true"
|
||||
android:screenOrientation="portrait"
|
||||
android:networkSecurityConfig="@xml/network_security_config"
|
||||
android:windowSoftInputMode="adjustResize">
|
||||
<!-- Specifies an Android theme to apply to this Activity as soon as
|
||||
@ -49,6 +81,13 @@
|
||||
android:name="io.flutter.embedding.android.NormalTheme"
|
||||
android:resource="@style/NormalTheme"
|
||||
/>
|
||||
<meta-data
|
||||
android:name="com.vivo.push.api_key"
|
||||
android:value="84f750207787376b310ca5b0d5969122" />
|
||||
<meta-data
|
||||
android:name="com.vivo.push.app_id"
|
||||
android:value="105669716" />
|
||||
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
|
||||
@ -7,11 +7,14 @@ buildscript {
|
||||
maven{url 'https://maven.aliyun.com/repository/google-plugin' }
|
||||
maven{url 'https://maven.aliyun.com/repository/public' }
|
||||
maven{url 'https://maven.aliyun.com/repository/jcenter' }
|
||||
maven {url 'https://developer.huawei.com/repo/'}
|
||||
maven { url 'https://developer.hihonor.com/repo/' }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:7.2.0'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
classpath 'com.huawei.agconnect:agcp:1.6.0.300'
|
||||
}
|
||||
}
|
||||
|
||||
@ -24,6 +27,8 @@ allprojects {
|
||||
maven { url 'https://mvn.getui.com/nexus/content/repositories/releases' }
|
||||
maven { url "https://mirrors.tencent.com/nexus/repository/maven-public/" }
|
||||
maven { url 'https://repo1.maven.org/maven2/' }
|
||||
maven {url 'https://developer.huawei.com/repo/'}
|
||||
maven { url 'https://developer.hihonor.com/repo/' }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 407 KiB After Width: | Height: | Size: 395 KiB |
@ -25,6 +25,7 @@ import '../dialog/UnlockCallDialog.dart';
|
||||
import '../select_circle/logic.dart';
|
||||
import 'state.dart';
|
||||
import '../../common/config.dart';
|
||||
import 'package:image/image.dart' as img;
|
||||
|
||||
class Call_outLogic extends GetxController {
|
||||
final Call_outState state = Call_outState();
|
||||
@ -227,12 +228,20 @@ class Call_outLogic extends GetxController {
|
||||
showOKToast("最多上传6张图片哦~");
|
||||
return;
|
||||
}
|
||||
final XFile? pickedFile = await _picker.pickImage(
|
||||
source: ImageSource.gallery,
|
||||
);
|
||||
final XFile? pickedFile = await _picker.pickImage(source: ImageSource.gallery,);
|
||||
if (null == pickedFile) {
|
||||
return;
|
||||
}
|
||||
// final image = img.decodeImage(File(pickedFile.path).readAsBytesSync())!;
|
||||
// img.Image watermarkedImage = img.Image(image.width, image.height);
|
||||
// watermarkedImage = img.copyResize(image, width: image.width, height: image.height);
|
||||
//
|
||||
// // 添加文字水印
|
||||
// img.drawString(watermarkedImage, img.arial_48, 10, 1000, 'Watermark Text', color: img.getColor(255, 0, 0));
|
||||
//
|
||||
// var path = await getApplicationSupportDirectoryPath();
|
||||
// String outputPath = path+"ceshishuiyin";
|
||||
// File(outputPath).writeAsBytesSync(img.encodeJpg(watermarkedImage));
|
||||
|
||||
SmartDialog.showLoading();
|
||||
uploadImage(quToken, pickedFile!, CONFIG.CALL_OUT_IMAGE, (result) {
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:tencent_chat_push_for_china/tencent_chat_push_for_china.dart';
|
||||
import 'package:tencent_cloud_chat_uikit/base_widgets/tim_ui_kit_state.dart';
|
||||
import 'package:tencent_cloud_chat_uikit/business_logic/separate_models/tui_chat_separate_view_model.dart';
|
||||
import 'package:tencent_cloud_chat_uikit/business_logic/view_models/tui_chat_global_model.dart';
|
||||
@ -116,6 +117,8 @@ class _TIMUIKitAppBarState extends TIMUIKitState<TIMUIKitAppBar> {
|
||||
String _getTotalUnReadCount(int unreadCount) {
|
||||
return unreadCount < 99 ? unreadCount.toString() : "99";
|
||||
}
|
||||
final TimUiKitPushPlugin cPush = TimUiKitPushPlugin();
|
||||
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
|
||||
@ -73,7 +73,7 @@ class MinefragmentLogic extends GetxController {
|
||||
userInfoBean = bean.data.user;
|
||||
|
||||
if (userInfoBean != null) {
|
||||
avatar = userInfoBean!.avatar;
|
||||
avatar = userInfoBean!.avatarThumb;
|
||||
sharedPreferences.setString(SharedPreferencesHelper.AVATAR, avatar);
|
||||
name = userInfoBean!.nickname;
|
||||
sharedPreferences.setString(SharedPreferencesHelper.NAME, name);
|
||||
|
||||
@ -63,7 +63,11 @@ class MinefragmentPage extends StatelessWidget {
|
||||
Positioned(
|
||||
top: 54.sp,
|
||||
left: 71.3.sp,
|
||||
child: Text(logic.vipMsg,style: TextStyle(color: const Color(0x99FFFFFF),fontSize: 12.sp),))
|
||||
child: Text(logic.vipMsg,style: TextStyle(color: const Color(0x99FFFFFF),fontSize: 12.sp),)),
|
||||
Positioned(
|
||||
top: 24.sp,
|
||||
left: 71.3.sp,
|
||||
child: Text("会员-微乐园贵宾",style: TextStyle(color: const Color(0xFFFFFFFF),fontSize: 16.sp),))
|
||||
],),
|
||||
),
|
||||
_circleLiveView(logic),
|
||||
@ -154,7 +158,7 @@ class MinefragmentPage extends StatelessWidget {
|
||||
children: [
|
||||
const Text(
|
||||
"乐园客服在线等您哦",
|
||||
style: TextStyle(color: Colors.white30),
|
||||
style: TextStyle(color: Colors.white60),
|
||||
),
|
||||
Image(
|
||||
image: AssetImage(getHomeImage("icon_in")),
|
||||
@ -199,7 +203,7 @@ class MinefragmentPage extends StatelessWidget {
|
||||
children: [
|
||||
Text(
|
||||
logic.joinedCircle,
|
||||
style: const TextStyle(color: Colors.white30),
|
||||
style: const TextStyle(color: Colors.white60),
|
||||
),
|
||||
Image(
|
||||
image: AssetImage(getHomeImage("icon_in")),
|
||||
@ -438,7 +442,7 @@ class MinefragmentPage extends StatelessWidget {
|
||||
onTap: () {
|
||||
if(logic.userInfoBean!=null){
|
||||
var imgList = <String>[];
|
||||
imgList.add(logic.userInfoBean!.avatarThumb);
|
||||
imgList.add(logic.userInfoBean!.avatar);
|
||||
// Get.toNamed(AppRoutes.Swiper,arguments:imgList);
|
||||
Get.toNamed(AppRoutes.Swiper, arguments: {
|
||||
'imaglist': imgList,
|
||||
|
||||
@ -264,4 +264,6 @@ class TIMConversationItem extends TIMUIKitStatelessWidget {
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -34,7 +34,7 @@ class _SwiperPageState extends State<SwiperPage> {
|
||||
return SizedBox(
|
||||
width: double.infinity,
|
||||
child: Image.network(
|
||||
logic.imgList[index], fit: BoxFit.contain,)
|
||||
"${logic.imgList[index]}?imageView2/0/q/60|watermark/2/text/5b6u5LmQ5ZutQVBQ/font/5b6u6L2v6ZuF6buR/fontsize/2160/fill/I0ZGRkZGRg==/dissolve/50/gravity/SouthEast/dx/60/dy/120", fit: BoxFit.contain,)
|
||||
);
|
||||
},
|
||||
itemCount: logic.imgList.length,
|
||||
|
||||
@ -325,37 +325,43 @@ class MyTabbedScreenState extends State<UserinfoPage>
|
||||
padding: EdgeInsets.symmetric(vertical: 18.sp, horizontal: 19.sp),
|
||||
itemBuilder: (context, index) {
|
||||
final interest = interests[index];
|
||||
return Container(
|
||||
margin: EdgeInsets.only(right: 11.sp),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(17.0),
|
||||
gradient: const LinearGradient(
|
||||
colors: [
|
||||
Color(0xFF06F9FA),
|
||||
Color(0xFFDC5BFD),
|
||||
],
|
||||
),
|
||||
color: const Color(0xFF392D53),
|
||||
),
|
||||
return GestureDetector(
|
||||
onTap: (){
|
||||
Get.toNamed(AppRoutes.Signal_circle_list,
|
||||
arguments: interests[index].id);
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.all(0.2.sp),
|
||||
margin: EdgeInsets.only(right: 11.sp),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(17.0),
|
||||
gradient: const LinearGradient(
|
||||
colors: [
|
||||
Color(0xFF06F9FA),
|
||||
Color(0xFFDC5BFD),
|
||||
],
|
||||
),
|
||||
color: const Color(0xFF392D53),
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
top: 2.sp,
|
||||
bottom: 2.sp,
|
||||
left: 15.sp,
|
||||
right: 15.sp,
|
||||
child: Container(
|
||||
margin: EdgeInsets.all(0.2.sp),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(17.0),
|
||||
color: const Color(0xFF392D53),
|
||||
),
|
||||
child: Center(
|
||||
child: Text(
|
||||
interest.title,
|
||||
style: const TextStyle(
|
||||
fontSize: 11.0,
|
||||
color: Colors.white,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
top: 2.sp,
|
||||
bottom: 2.sp,
|
||||
left: 15.sp,
|
||||
right: 15.sp,
|
||||
),
|
||||
child: Center(
|
||||
child: Text(
|
||||
interest.title,
|
||||
style: const TextStyle(
|
||||
fontSize: 11.0,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@ -160,6 +160,7 @@ class PriceBean {
|
||||
double oldAmount;
|
||||
bool isYearVip;
|
||||
String iosItem;
|
||||
String amountText;
|
||||
|
||||
PriceBean({
|
||||
required this.id,
|
||||
@ -168,6 +169,7 @@ class PriceBean {
|
||||
required this.oldAmount,
|
||||
required this.isYearVip,
|
||||
required this.iosItem,
|
||||
required this.amountText,
|
||||
});
|
||||
|
||||
factory PriceBean.fromJson(Map<String, dynamic> json) {
|
||||
@ -175,6 +177,7 @@ class PriceBean {
|
||||
id: json['id'] as int,
|
||||
title: json['title'] as String,
|
||||
amount: json['amount'] as double,
|
||||
amountText :json['amount_text'] as String,
|
||||
oldAmount: json['old_amount'] as double,
|
||||
isYearVip: json['is_year_vip'] as bool,
|
||||
iosItem: json['ios_item'] as String,
|
||||
|
||||
@ -272,8 +272,8 @@ class Open_vip_tipPage extends StatelessWidget {
|
||||
}
|
||||
|
||||
typeItem(Open_vip_tipLogic controller, bool isSelected, int index) {
|
||||
double pricePerDay = controller.priceBean[index].amount / 30;
|
||||
String formattedPricePerDay = '${pricePerDay.toStringAsFixed(2)}元/天';
|
||||
//double pricePerDay = controller.priceBean[index].amount / 30;
|
||||
// String formattedPricePerDay = '${pricePerDay.toStringAsFixed(2)}元/天';
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
if(!isYean){
|
||||
@ -311,7 +311,7 @@ class Open_vip_tipPage extends StatelessWidget {
|
||||
style: TextStyle(color: Colors.white, fontSize: 14.sp),
|
||||
),
|
||||
Text(
|
||||
formattedPricePerDay,
|
||||
controller.priceBean[index].amountText.toString(),
|
||||
style: TextStyle(color: Colors.white, fontSize: 14.sp),
|
||||
),
|
||||
Row(
|
||||
|
||||
@ -8,14 +8,14 @@ class PushConfig{
|
||||
// on the main page of console from Tencent Cloud IM.
|
||||
|
||||
// Business ID for HUAWEI
|
||||
static const HWPushBuzID = 0;
|
||||
static const HWPushBuzID = 30671;
|
||||
|
||||
// Business ID for XiaoMi
|
||||
static const XMPushBuzID = 0;
|
||||
static const XMPushBuzID = 30672;
|
||||
|
||||
// APP Info of XiaoMi
|
||||
static const String XMPushAPPID = "";
|
||||
static const String XMPushAPPKEY = "";
|
||||
static const String XMPushAPPID = "2882303761520264048";
|
||||
static const String XMPushAPPKEY = "Yagmr/c0hntFMGWKweXqgg==";
|
||||
|
||||
// Business ID for Meizu
|
||||
static const MZPushBuzID = 0;
|
||||
@ -25,15 +25,15 @@ class PushConfig{
|
||||
static const String MZPushAPPKEY = "";
|
||||
|
||||
// Business ID for Vivo
|
||||
static const VIVOPushBuzID = 0;
|
||||
static const VIVOPushBuzID = 30673;
|
||||
|
||||
// Business ID for OPPO
|
||||
static const OPPOPushBuzID = 0;
|
||||
static const OPPOPushBuzID = 30674;
|
||||
|
||||
// APP Info of OPPO
|
||||
static const String OPPOPushAPPKEY = "";
|
||||
static const String OPPOPushAPPSECRET = "";
|
||||
static const String OPPOPushAPPID = "";
|
||||
static const String OPPOPushAPPKEY = "09e35257df174f9db390b4b3257f241c";
|
||||
static const String OPPOPushAPPSECRET = "7d17a5b2b2fc43eda61005807002f654";
|
||||
static const String OPPOPushAPPID = "31286141";
|
||||
static const String OPPOChannelID = "new_message";
|
||||
|
||||
|
||||
@ -64,10 +64,12 @@ class ChannelPush{
|
||||
|
||||
static init(PushClickAction pushClickAction) async {
|
||||
// initialize the push plugin
|
||||
cPush.init(
|
||||
print("ChannelPush init");
|
||||
bool isInit = await cPush.init(
|
||||
pushClickAction: pushClickAction,
|
||||
appInfo: PushConfig.appInfo,
|
||||
);
|
||||
print("token=初始化"+isInit.toString());
|
||||
|
||||
// create new notification channel
|
||||
cPush.createNotificationChannel(
|
||||
@ -79,9 +81,22 @@ class ChannelPush{
|
||||
|
||||
// require the permission for notification
|
||||
cPush.requireNotificationPermission();
|
||||
|
||||
|
||||
}
|
||||
|
||||
static Future<String> getDeviceToken() async {
|
||||
return cPush.getDevicePushToken();
|
||||
}
|
||||
static Future<bool> uploadToken() async {
|
||||
|
||||
|
||||
|
||||
return await cPush.uploadToken(PushConfig.appInfo);
|
||||
}
|
||||
|
||||
static setBadgeNum(int unreadCount){
|
||||
cPush.setBadgeNum(unreadCount);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -66,14 +66,23 @@ logoutIM() async {
|
||||
|
||||
//获取设备Token,获取成功后开启离线推送
|
||||
void uploadBuzIDAndToken() async {
|
||||
await ChannelPush.init((msg) { });
|
||||
|
||||
int? businessID = await TimUiKitPushPlugin.getBuzId(PushConfig.appInfo);
|
||||
|
||||
String token = await ChannelPush.getDeviceToken();
|
||||
ChannelPush.uploadToken();
|
||||
|
||||
print("token="+token);
|
||||
if (token != "") {
|
||||
coreInstance.setOfflinePushConfig(
|
||||
V2TimCallback res = await coreInstance.setOfflinePushConfig(
|
||||
token: token,
|
||||
businessID: businessID
|
||||
);
|
||||
print("token="+res.code.toString());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -245,14 +254,20 @@ class MyApp extends StatefulWidget {
|
||||
State<MyApp> createState() => _MyAppState();
|
||||
}
|
||||
|
||||
class _MyAppState extends State<MyApp> {
|
||||
class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
|
||||
AppLifecycleState? _lastLifecycleState;
|
||||
// This widget is the root of your application.
|
||||
|
||||
final List<String> _guideList = ['bg', 'home_back'];
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
// WidgetsBinding.instance.removeObserver(this);
|
||||
super.dispose();
|
||||
}
|
||||
@override
|
||||
void initState() {
|
||||
initIM();
|
||||
// WidgetsBinding.instance.addObserver(this);
|
||||
if (Platform.isAndroid) {
|
||||
initWxApi();
|
||||
}
|
||||
@ -262,6 +277,48 @@ class _MyAppState extends State<MyApp> {
|
||||
super.initState();
|
||||
// getLoginStyle();
|
||||
}
|
||||
@override
|
||||
void didChangeAppLifecycleState(AppLifecycleState state) async{
|
||||
print("--" + state.toString());
|
||||
_lastLifecycleState = state;
|
||||
int? unreadCount = 0;
|
||||
//获取会话未读总数
|
||||
V2TimValueCallback<int> getTotalUnreadMessageCountRes =
|
||||
await TencentImSDKPlugin.v2TIMManager
|
||||
.getConversationManager()
|
||||
.getTotalUnreadMessageCount();
|
||||
if (getTotalUnreadMessageCountRes.code == 0) {
|
||||
//拉取成功
|
||||
unreadCount = getTotalUnreadMessageCountRes.data;//会话未读总数
|
||||
}
|
||||
|
||||
|
||||
switch (state) {
|
||||
case AppLifecycleState.inactive:
|
||||
TencentImSDKPlugin.v2TIMManager
|
||||
.getOfflinePushManager()
|
||||
.doBackground(unreadCount: unreadCount ?? 0);
|
||||
if(unreadCount != null){
|
||||
|
||||
ChannelPush.setBadgeNum(unreadCount);
|
||||
}
|
||||
break;
|
||||
case AppLifecycleState.resumed:
|
||||
TencentImSDKPlugin.v2TIMManager
|
||||
.getOfflinePushManager()
|
||||
.doForeground();
|
||||
break;
|
||||
case AppLifecycleState.paused:
|
||||
TencentImSDKPlugin.v2TIMManager
|
||||
.getOfflinePushManager()
|
||||
.doBackground(unreadCount: unreadCount ?? 0);
|
||||
if(unreadCount != null){
|
||||
ChannelPush.setBadgeNum(unreadCount);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
getLoginStyle() async {
|
||||
if ((await getAuthorization()).isEmpty) {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
|
||||
class Api {
|
||||
static const baseUrl = kDebugMode ? 'http://192.168.3.55:2000/' : 'https://leyuan666.com/zuul-service/';
|
||||
static const baseUrl = !kDebugMode ? 'http://192.168.3.55:2000/' : 'https://leyuan666.com/zuul-service/';
|
||||
|
||||
// static const baseUrl = 'https://leyuan666.com/zuul-service/';
|
||||
|
||||
|
||||
@ -67,9 +67,10 @@ void uploadImage(String quToken ,XFile pickedFile,String updataRoute,MyCallback
|
||||
return;
|
||||
}
|
||||
}
|
||||
var path = await getApplicationSupportDirectoryPath();
|
||||
|
||||
//if(isImageJpgOrPng(pickedFile.path)){
|
||||
if(false){
|
||||
var path = await getApplicationSupportDirectoryPath();
|
||||
CompressObject compressObject = CompressObject(
|
||||
imageFile:File(pickedFile.path),
|
||||
path:path,
|
||||
@ -87,7 +88,9 @@ void uploadImage(String quToken ,XFile pickedFile,String updataRoute,MyCallback
|
||||
SmartDialog.dismiss(force: true);
|
||||
});
|
||||
}else{
|
||||
uploadQiniu(pickedFile.path,pickedFile.name,updataRoute,quToken,(result){
|
||||
var path = await getApplicationSupportDirectoryPath();
|
||||
String outputPath = path+"ceshishuiyin";
|
||||
uploadQiniu(outputPath,pickedFile.name,updataRoute,quToken,(result){
|
||||
myCallback(result);
|
||||
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user