Browse Source

更新后的问题修改

dart3
fff 10 months ago
parent
commit
c586d5f18c
  1. 59
      android/app/build.gradle
  2. 1
      android/app/src/main/AndroidManifest.xml
  3. 1
      android/gradle.properties
  4. 20
      android/settings.gradle
  5. 7
      android/tmpmob/assets/ShareSDK.xml
  6. 132
      lib/home/guide_page.dart
  7. 6
      lib/home/home_page.dart
  8. 2
      lib/home/home_view/welfare_core.dart
  9. 88
      lib/login/new_login_page.dart
  10. 54
      lib/main_page.dart
  11. 80
      lib/setting/about_page.dart
  12. 34
      lib/setting/treaty_page.dart
  13. 2
      lib/view_widget/round_button.dart
  14. 6
      pubspec.lock
  15. 2
      pubspec.yaml

59
android/app/build.gradle

@ -2,7 +2,7 @@ plugins {
id "com.android.application" id "com.android.application"
id "kotlin-android" id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin" id "dev.flutter.flutter-gradle-plugin"
// id 'com.huawei.agconnect' id 'com.mob.sdk'
} }
def localProperties = new Properties() def localProperties = new Properties()
@ -98,4 +98,59 @@ flutter {
source '../..' source '../..'
} }
dependencies {} dependencies {
// classpath 'com.mob.sdk:MobSDK:+'
}
MobSDK {
appKey "m33ee7650da86a"
appSecret "876f2eaebfd2a88c89d5fc294397838c"
spEdition "fp"
ShareSDK {
devInfo {
Wechat {
id 4
sortId 4
appId "wx3b269e795ed23e5f"
appSecret "64020361b8ec4c99936c0e3999a9f249"
userName "gh_afb25ac019c9"
path "pages/index/index.html?id=1"
withShareTicket true
miniprogramType 0
bypassApproval false
enable true
}
WechatMoments {
id 3
sortId 3
appId "wx3b269e795ed23e5f"
appSecret "64020361b8ec4c99936c0e3999a9f249"
bypassApproval false
enable true
}
Facebook {
id 8
sortId 8
appKey "523308712059457"
appSecret "d3a1b6377100871799d8973fbe84794a"
callbackUri "https://mob.com"
shareByAppClient true
enable true
}
Line {
id 2
sortId 2
// appKey "1656257249"
// appSecret "7f160c9686672a50b5952364a8553f99"
appKey "1656257047"
appSecret "fd93cb8f12b285b80c7c67bdee8bd091"
callbackUri "https://mob.com"
callbackscheme "huixiang"
shareByAppClient true
enable true
}
}
}
}

1
android/app/src/main/AndroidManifest.xml

@ -84,7 +84,6 @@
android:name="com.yalantis.ucrop.UCropActivity" android:name="com.yalantis.ucrop.UCropActivity"
android:screenOrientation="portrait"/> android:screenOrientation="portrait"/>
<meta-data <meta-data
android:name="dcloud_appkey" android:name="dcloud_appkey"
android:value="" /> android:value="" />

1
android/gradle.properties

@ -1,3 +1,4 @@
org.gradle.jvmargs=-Xmx4G org.gradle.jvmargs=-Xmx4G
android.useAndroidX=true android.useAndroidX=true
android.enableJetifier=true android.enableJetifier=true
MobSDK.spEdition=IZNAO

20
android/settings.gradle

@ -11,9 +11,22 @@ pluginManagement {
includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle") includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle")
repositories { repositories {
google() // google()
mavenCentral() // mavenCentral()
gradlePluginPortal() // gradlePluginPortal()
maven {
url 'https://maven.aliyun.com/repository/google'
}
maven {
url 'https://maven.aliyun.com/repository/jcenter'
}
maven { url "https://www.jitpack.io" }
maven { url 'https://repo1.maven.org/maven2/' }
maven { url 'https://developer.huawei.com/repo/' }
maven {
url "http://mvn.mob.com/android"
allowInsecureProtocol = true
}
} }
} }
@ -21,6 +34,7 @@ plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0" id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "7.3.0" apply false id "com.android.application" version "7.3.0" apply false
id "org.jetbrains.kotlin.android" version "1.7.10" apply false id "org.jetbrains.kotlin.android" version "1.7.10" apply false
id "com.mob.sdk" version "+" apply false
} }
include ":app" include ":app"

7
android/tmpmob/assets/ShareSDK.xml

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<DevInfor>
<Wechat Id="4" SortId="4" AppId="wx3b269e795ed23e5f" AppSecret="64020361b8ec4c99936c0e3999a9f249" Enable="true" BypassApproval="false" UserName="gh_afb25ac019c9" Path="pages/index/index.html?id=1" WithShareTicket="true" MiniprogramType="0" />
<WechatMoments Id="3" SortId="3" AppId="wx3b269e795ed23e5f" AppSecret="64020361b8ec4c99936c0e3999a9f249" Enable="true" BypassApproval="false" />
<Facebook Id="8" SortId="8" ShareByAppClient="true" Enable="true" ConsumerKey="523308712059457" ConsumerSecret="d3a1b6377100871799d8973fbe84794a" RedirectUrl="https://mob.com" />
<Line Id="2" SortId="2" AppKey="1656257047" ShareByAppClient="true" Enable="true" Callbackscheme="huixiang" ChannelID="null" ChannelSecret="fd93cb8f12b285b80c7c67bdee8bd091" RedirectUri="https://mob.com" />
</DevInfor>

132
lib/home/guide_page.dart

@ -1,8 +1,10 @@
import 'dart:io'; import 'dart:io';
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:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/utils/constant.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/border_text.dart'; import 'package:huixiang/view_widget/border_text.dart';
import 'package:huixiang/view_widget/round_button.dart'; import 'package:huixiang/view_widget/round_button.dart';
@ -18,12 +20,10 @@ class GuidePage extends StatefulWidget {
} }
class _GuidePage extends State<GuidePage> { class _GuidePage extends State<GuidePage> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
if(Platform.isAndroid) if (Platform.isAndroid) isLogin();
isLogin();
} }
isLogin() async { isLogin() async {
@ -123,8 +123,10 @@ class _GuidePage extends State<GuidePage> {
children: [ children: [
Text( Text(
"", "",
style: style: TextStyle(
TextStyle(fontSize: 8.sp, color: Colors.black), fontSize: 8.sp,
color: Colors.black,
),
), ),
SizedBox( SizedBox(
width: 10.w, width: 10.w,
@ -132,7 +134,9 @@ class _GuidePage extends State<GuidePage> {
Text( Text(
"", "",
style: TextStyle( style: TextStyle(
fontSize: 8.sp, color: Color(0xffB2B2B2)), fontSize: 8.sp,
color: Color(0xffB2B2B2),
),
), ),
SizedBox( SizedBox(
width: 10.w, width: 10.w,
@ -140,7 +144,9 @@ class _GuidePage extends State<GuidePage> {
Text( Text(
"", "",
style: TextStyle( style: TextStyle(
fontSize: 8.sp, color: Color(0xffB2B2B2)), fontSize: 8.sp,
color: Color(0xffB2B2B2),
),
), ),
SizedBox( SizedBox(
height: 108.h, height: 108.h,
@ -197,7 +203,8 @@ class _GuidePage extends State<GuidePage> {
fontSize: 16.sp, fontSize: 16.sp,
height: 1.5.h, height: 1.5.h,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
color: Color(0XFF727272)), color: Color(0XFF727272),
),
), ),
), ),
], ],
@ -211,15 +218,19 @@ class _GuidePage extends State<GuidePage> {
Text( Text(
"", "",
style: TextStyle( style: TextStyle(
fontSize: 8.sp, color: Color(0xffB2B2B2)), fontSize: 8.sp,
color: Color(0xffB2B2B2),
),
), ),
SizedBox( SizedBox(
width: 10.w, width: 10.w,
), ),
Text( Text(
"", "",
style: style: TextStyle(
TextStyle(fontSize: 8.sp, color: Colors.black), fontSize: 8.sp,
color: Colors.black,
),
), ),
SizedBox( SizedBox(
width: 10.w, width: 10.w,
@ -227,7 +238,9 @@ class _GuidePage extends State<GuidePage> {
Text( Text(
"", "",
style: TextStyle( style: TextStyle(
fontSize: 8.sp, color: Color(0xffB2B2B2)), fontSize: 8.sp,
color: Color(0xffB2B2B2),
),
), ),
SizedBox( SizedBox(
height: 108.h, height: 108.h,
@ -245,7 +258,9 @@ class _GuidePage extends State<GuidePage> {
color: Colors.white, color: Colors.white,
child: Center( child: Center(
child: Container( child: Container(
margin: EdgeInsets.only(top: 120.h, left: 19.w, right: 19.w), margin: EdgeInsets.only(
top: 120.h, left: 19.w, right: 19.w,
),
child: Stack( child: Stack(
children: [ children: [
Column( Column(
@ -284,7 +299,8 @@ class _GuidePage extends State<GuidePage> {
fontSize: 16.sp, fontSize: 16.sp,
height: 1.5.h, height: 1.5.h,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
color: Color(0XFF727272)), color: Color(0XFF727272),
),
), ),
), ),
], ],
@ -298,7 +314,9 @@ class _GuidePage extends State<GuidePage> {
Text( Text(
"", "",
style: TextStyle( style: TextStyle(
fontSize: 8.sp, color: Color(0xffB2B2B2)), fontSize: 8.sp,
color: Color(0xffB2B2B2),
),
), ),
SizedBox( SizedBox(
width: 10.w, width: 10.w,
@ -306,15 +324,19 @@ class _GuidePage extends State<GuidePage> {
Text( Text(
"", "",
style: TextStyle( style: TextStyle(
fontSize: 8.sp, color: Color(0xffB2B2B2)), fontSize: 8.sp,
color: Color(0xffB2B2B2),
),
), ),
SizedBox( SizedBox(
width: 10.w, width: 10.w,
), ),
Text( Text(
"", "",
style: style: TextStyle(
TextStyle(fontSize: 8.sp, color: Colors.black), fontSize: 8.sp,
color: Colors.black,
),
), ),
SizedBox( SizedBox(
height: 108.h, height: 108.h,
@ -342,7 +364,9 @@ class _GuidePage extends State<GuidePage> {
fit: BoxFit.fill, fit: BoxFit.fill,
), ),
SizedBox( SizedBox(
height: MediaQuery.of(context).size.width >= 650 ? 20.h :66.h, height: MediaQuery.of(context).size.width >= 650
? 20.h
: 66.h,
), ),
Container( Container(
alignment: Alignment.center, alignment: Alignment.center,
@ -352,11 +376,14 @@ class _GuidePage extends State<GuidePage> {
style: TextStyle( style: TextStyle(
fontSize: 24.sp, fontSize: 24.sp,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
color: Color(0XFF32A060)), color: Color(0XFF32A060),
),
), ),
), ),
SizedBox( SizedBox(
height: MediaQuery.of(context).size.width >= 650 ? 15.h :23.h, height: MediaQuery.of(context).size.width >= 650
? 15.h
: 23.h,
), ),
Padding( Padding(
padding: EdgeInsets.only(left: 52.w, right: 52.w), padding: EdgeInsets.only(left: 52.w, right: 52.w),
@ -367,7 +394,8 @@ class _GuidePage extends State<GuidePage> {
fontSize: 16.sp, fontSize: 16.sp,
height: 1.5.h, height: 1.5.h,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
color: Color(0XFF727272)), color: Color(0XFF727272),
),
), ),
), ),
], ],
@ -381,7 +409,8 @@ class _GuidePage extends State<GuidePage> {
child: Container( child: Container(
height: 50.h, height: 50.h,
margin: EdgeInsets.only( margin: EdgeInsets.only(
left: 71.w, right: 71.w, bottom: 55.h), left: 71.w, right: 71.w, bottom: 55.h,
),
alignment: Alignment.center, alignment: Alignment.center,
child: BorderText( child: BorderText(
padding: EdgeInsets.all(5), padding: EdgeInsets.all(5),
@ -400,21 +429,21 @@ class _GuidePage extends State<GuidePage> {
), ),
), ),
), ),
) ),
], ],
), ),
); );
} }
showAlertDialog() { showAlertDialog() {
// //
showDialog( showDialog(
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {
return WillPopScope( return PopScope(
onWillPop: () async => false, canPop: true,
child:SimpleDialog( onPopInvoked: (isPop) {},
child: SimpleDialog(
titlePadding: EdgeInsets.all(10), titlePadding: EdgeInsets.all(10),
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
elevation: 0, elevation: 0,
@ -422,9 +451,6 @@ class _GuidePage extends State<GuidePage> {
borderRadius: BorderRadius.circular(6), borderRadius: BorderRadius.circular(6),
), ),
children: <Widget>[ children: <Widget>[
Stack(
alignment: Alignment.bottomCenter,
children: [
Container( Container(
alignment: Alignment.center, alignment: Alignment.center,
width: double.infinity, width: double.infinity,
@ -447,6 +473,10 @@ class _GuidePage extends State<GuidePage> {
), ),
), ),
), ),
Expanded(
child: SingleChildScrollView(
child: Column(
children: [
Text.rich( Text.rich(
TextSpan(children: [ TextSpan(children: [
TextSpan( TextSpan(
@ -463,7 +493,8 @@ class _GuidePage extends State<GuidePage> {
style: TextStyle( style: TextStyle(
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
fontSize: 14.sp, fontSize: 14.sp,
color: Color(0xff32A060)), color: Color(0xff32A060),
),
recognizer: TapGestureRecognizer() recognizer: TapGestureRecognizer()
..onTap = () { ..onTap = () {
Navigator.of(context) Navigator.of(context)
@ -472,11 +503,10 @@ class _GuidePage extends State<GuidePage> {
), ),
]), ]),
), ),
SizedBox( 10.d,
height: 10.h,
),
Text( Text(
S.of(context).yinsizhengce2, S.of(context).yinsizhengce2,
textAlign: TextAlign.justify,
style: TextStyle( style: TextStyle(
color: Color(0xff727272), color: Color(0xff727272),
fontSize: 14.sp, fontSize: 14.sp,
@ -484,19 +514,18 @@ class _GuidePage extends State<GuidePage> {
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
), ),
), ),
SizedBox(
height: 16.h,
),
], ],
), ),
), ),
),
16.d,
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
GestureDetector( GestureDetector(
onTap: () { onTap: () {
Navigator.of(context).pop(); // Navigator.of(context).pop();
// exit(0); exit(0);
}, },
child: Container( child: Container(
height: 40.h, height: 40.h,
@ -506,8 +535,8 @@ class _GuidePage extends State<GuidePage> {
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: 10.h, top: 10.h,
bottom: 10.h, bottom: 10.h,
left: 36.w, left: 24.w,
right: 36.w, right: 24.w,
), ),
text: S.of(context).jujue, text: S.of(context).jujue,
fontSize: 12.sp, fontSize: 12.sp,
@ -518,10 +547,9 @@ class _GuidePage extends State<GuidePage> {
), ),
), ),
), ),
SizedBox( 15.vd,
width: 21.w, Expanded(
), child: Container(
Container(
height: 40.h, height: 40.h,
margin: EdgeInsets.only(bottom: 20.h), margin: EdgeInsets.only(bottom: 20.h),
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
@ -535,8 +563,8 @@ class _GuidePage extends State<GuidePage> {
}); });
SharesdkPlugin.uploadPrivacyPermissionStatus( SharesdkPlugin.uploadPrivacyPermissionStatus(
1, 1,
(success) => { (success) {
Navigator.of(context).pop(), Navigator.of(context).pop();
}, },
); );
}, },
@ -550,15 +578,15 @@ class _GuidePage extends State<GuidePage> {
radius: 23, radius: 23,
), ),
), ),
SizedBox(
height: 20.h,
), ),
], ],
), ),
], ],
) ),
),
], ],
)); ),
);
}, },
); );
} }

6
lib/home/home_page.dart

@ -475,7 +475,7 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
}), }),
///广 ///广
if(activityBannerData.length > 0) if (activityBannerData.length > 0)
spread(), spread(),
// /// // ///
@ -571,7 +571,7 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
), ),
autoplay: true, autoplay: true,
duration: 1000, duration: 1000,
autoplayDelay: 2000, autoplayDelay: 3000,
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
itemBuilder: (context, position) { itemBuilder: (context, position) {
return InkWell( return InkWell(
@ -668,7 +668,7 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
), ),
autoplay: true, autoplay: true,
duration: 1000, duration: 1000,
autoplayDelay: 2000, autoplayDelay: 2500,
itemBuilder: (context, position) { itemBuilder: (context, position) {
return InkWell( return InkWell(
onTap: () { onTap: () {

2
lib/home/home_view/welfare_core.dart

@ -71,7 +71,7 @@ class _WelfareCore extends State<WelfareCore> {
}, },
child: Container( child: Container(
width: double.infinity, width: double.infinity,
height: 75.h, height: 76.h,
decoration: BoxDecoration( decoration: BoxDecoration(
image: DecorationImage( image: DecorationImage(
fit: BoxFit.fill, fit: BoxFit.fill,

88
lib/login/new_login_page.dart

@ -12,7 +12,6 @@ import 'package:huixiang/data/channels.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/data/base_data.dart'; import 'package:huixiang/data/base_data.dart';
import 'package:huixiang/data/examine_instance.dart'; import 'package:huixiang/data/examine_instance.dart';
import 'package:huixiang/data/login_info.dart';
import 'package:huixiang/data/user_entity.dart'; import 'package:huixiang/data/user_entity.dart';
import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/event_type.dart'; import 'package:huixiang/utils/event_type.dart';
@ -65,15 +64,16 @@ class _NewLoginPage extends State<NewLoginPage> {
isLogin(); isLogin();
} }
queryChannels() async{ queryChannels() async {
BaseData<Channels>? baseData = await apiService?.appChannels().catchError((error) { BaseData<Channels>? baseData =
await apiService?.appChannels().catchError((error) {
print(error.message); print(error.message);
SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type), SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type),
alignment: Alignment.center); alignment: Alignment.center);
}); });
if (baseData?.isSuccess ?? false) { if (baseData?.isSuccess ?? false) {
channelsList = baseData!.data; channelsList = baseData!.data;
setState((){}); setState(() {});
} else { } else {
SmartDialog.showToast("${baseData?.msg}", alignment: Alignment.center); SmartDialog.showToast("${baseData?.msg}", alignment: Alignment.center);
} }
@ -216,9 +216,11 @@ class _NewLoginPage extends State<NewLoginPage> {
"mobile": mobile, "mobile": mobile,
"invite": invite, "invite": invite,
"areaCode": area, "areaCode": area,
"regChannel":channelName ?? "" "regChannel": channelName ?? ""
}; };
EasyLoading.show(status: S.of(context).zhengzaijiazai,maskType: EasyLoadingMaskType.black); EasyLoading.show(
status: S.of(context).zhengzaijiazai,
maskType: EasyLoadingMaskType.black);
BaseData? value = await apiService?.memberLogin(param).catchError((error) { BaseData? value = await apiService?.memberLogin(param).catchError((error) {
print(error.message); print(error.message);
SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type), SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type),
@ -227,7 +229,8 @@ class _NewLoginPage extends State<NewLoginPage> {
// EasyLoading.show(status: S.of(context).zhengzaijiazai); // EasyLoading.show(status: S.of(context).zhengzaijiazai);
if (value?.isSuccess ?? false) { if (value?.isSuccess ?? false) {
var userInfo = value!.data; var userInfo = value!.data;
ExamineInstance.instance.isExamine = userInfo.authInfo?.account == "13800138000"; ExamineInstance.instance.isExamine =
userInfo.authInfo?.account == "13800138000";
saveUserJson(userInfo.authInfo?.toJson()); saveUserJson(userInfo.authInfo?.toJson());
eventBus.fire(EventType(3)); eventBus.fire(EventType(3));
@ -265,7 +268,8 @@ class _NewLoginPage extends State<NewLoginPage> {
if (sharedPreferences.containsKey('token') && if (sharedPreferences.containsKey('token') &&
sharedPreferences.getString("token") != null && sharedPreferences.getString("token") != null &&
sharedPreferences.getString("token") != "") { sharedPreferences.getString("token") != "") {
ExamineInstance.instance.isExamine = sharedPreferences.getString("mobile") == "13800138000"; ExamineInstance.instance.isExamine =
sharedPreferences.getString("mobile") == "13800138000";
Navigator.of(context).popAndPushNamed('/router/main_page'); Navigator.of(context).popAndPushNamed('/router/main_page');
} else { } else {
apiService = ApiService(Dio(), context: context); apiService = ApiService(Dio(), context: context);
@ -275,7 +279,6 @@ class _NewLoginPage extends State<NewLoginPage> {
} }
} }
@override @override
void dispose() { void dispose() {
if (_timer?.isActive ?? true) { if (_timer?.isActive ?? true) {
@ -327,8 +330,9 @@ class _NewLoginPage extends State<NewLoginPage> {
secondChild: substance(), secondChild: substance(),
firstCurve: Curves.easeInQuart, firstCurve: Curves.easeInQuart,
secondCurve: Curves.easeInQuart, secondCurve: Curves.easeInQuart,
crossFadeState: crossFadeState: isShowLogin
isShowLogin ? CrossFadeState.showSecond : CrossFadeState.showFirst, ? CrossFadeState.showSecond
: CrossFadeState.showFirst,
duration: Duration(milliseconds: Platform.isIOS ? 1000 : 1000), duration: Duration(milliseconds: Platform.isIOS ? 1000 : 1000),
), ),
), ),
@ -355,7 +359,8 @@ class _NewLoginPage extends State<NewLoginPage> {
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: 16.w, left: 16.w,
top: 45.h + MediaQuery.of(context).padding.top, top: 45.h + MediaQuery.of(context).padding.top,
right: 12.w), right: 12.w,
),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -412,7 +417,8 @@ class _NewLoginPage extends State<NewLoginPage> {
fontSize: 16.sp, fontSize: 16.sp,
color: Color(0xFF1A1A1A), color: Color(0xFF1A1A1A),
), ),
)), ),
),
Icon( Icon(
Icons.keyboard_arrow_right, Icons.keyboard_arrow_right,
size: 18, size: 18,
@ -421,7 +427,9 @@ class _NewLoginPage extends State<NewLoginPage> {
Container( Container(
height: 30.h, height: 30.h,
width: MediaQuery.of(context).size.width - 100.w, width: MediaQuery.of(context).size.width - 100.w,
margin: EdgeInsets.only(bottom:Platform.isIOS ? 10.h:5.h), margin: EdgeInsets.only(
bottom: Platform.isIOS ? 10.h : 5.h,
),
child: TextField( child: TextField(
style: TextStyle( style: TextStyle(
height: 1.h, height: 1.h,
@ -599,10 +607,11 @@ class _NewLoginPage extends State<NewLoginPage> {
), ),
if (channelsList?.isOpen ?? false) if (channelsList?.isOpen ?? false)
GestureDetector( GestureDetector(
onTap: (){ onTap: () {
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
'/router/login_store_select',arguments: { '/router/login_store_select',
"channelsList":channelsList, arguments: {
"channelsList": channelsList,
}, },
).then((value) => { ).then((value) => {
setState(() { setState(() {
@ -612,25 +621,33 @@ class _NewLoginPage extends State<NewLoginPage> {
}) })
}); });
}, },
child:Container( child: Container(
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: 12.w, right: 12.w, top: 16.h, bottom: 16.h left: 12.w,
right: 12.w,
top: 16.h,
bottom: 16.h,
), ),
margin: EdgeInsets.only(bottom:30.h), margin: EdgeInsets.only(bottom: 30.h),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xFFF1F1F1), color: Color(0xFFF1F1F1),
borderRadius: BorderRadius.circular(4), borderRadius: BorderRadius.circular(4),
), ),
child: Row( child: Row(
children: [ children: [
SizedBox(width: 3.w,), SizedBox(
width: 3.w,
),
Expanded( Expanded(
child:Text( child: Text(
channelName ?? "邀请来源(选填)", channelName ?? "邀请来源(选填)",
style: TextStyle( style: TextStyle(
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
fontSize: channelName == null ? 12.sp : 13.sp, fontSize:
color:channelName == null ? Color(0xFF868686) : Color(0xFF1A1A1A), channelName == null ? 12.sp : 13.sp,
color: channelName == null
? Color(0xFF868686)
: Color(0xFF1A1A1A),
), ),
), ),
), ),
@ -654,11 +671,16 @@ class _NewLoginPage extends State<NewLoginPage> {
}); });
}, },
checkColor: Color(0xFFFFFFFF), checkColor: Color(0xFFFFFFFF),
fillColor: MaterialStateProperty.all(Color(0xFF32A060)), hoverColor: Colors.white,
activeColor: Color(0xFF32A060),
focusColor: Colors.white,
overlayColor:
MaterialStateProperty.all(Colors.white),
), ),
Expanded( Expanded(
child: Text.rich( child: Text.rich(
TextSpan(children: [ TextSpan(
children: [
TextSpan( TextSpan(
text: S.of(context).privacy_policy1, text: S.of(context).privacy_policy1,
style: TextStyle( style: TextStyle(
@ -955,8 +977,7 @@ class _NewLoginPage extends State<NewLoginPage> {
} }
// //
loadingBlockPuzzle(BuildContext context, loadingBlockPuzzle(BuildContext context, {barrierDismissible = true}) {
{barrierDismissible = true}) {
showDialog<Null>( showDialog<Null>(
context: context, context: context,
barrierDismissible: barrierDismissible, barrierDismissible: barrierDismissible,
@ -973,10 +994,15 @@ class _NewLoginPage extends State<NewLoginPage> {
); );
} }
sendSms(v) async{ sendSms(v) async {
BaseData? baseData = await apiService?.sendVerify({"areaCode":area, "mobile": mobile, "verification": v}).catchError((onError) { BaseData? baseData = await apiService?.sendVerify({
"areaCode": area,
"mobile": mobile,
"verification": v
}).catchError((onError) {
SmartDialog.showToast(AppUtils.dioErrorTypeToString(onError.type), SmartDialog.showToast(AppUtils.dioErrorTypeToString(onError.type),
alignment: Alignment.center);}); alignment: Alignment.center);
});
if (baseData?.isSuccess ?? false) { if (baseData?.isSuccess ?? false) {
_sendCodeStatus = 1; _sendCodeStatus = 1;
countdown(); countdown();

54
lib/main_page.dart

@ -31,6 +31,7 @@ import 'package:permission_handler/permission_handler.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:sharesdk_plugin/sharesdk_interface.dart'; import 'package:sharesdk_plugin/sharesdk_interface.dart';
import 'package:sharesdk_plugin/sharesdk_register.dart'; import 'package:sharesdk_plugin/sharesdk_register.dart';
import 'package:tpns_flutter_plugin/android/native_event_handler.dart';
import 'package:tpns_flutter_plugin/android/xg_android_api.dart'; import 'package:tpns_flutter_plugin/android/xg_android_api.dart';
import 'package:tpns_flutter_plugin/tpns_flutter_plugin.dart'; import 'package:tpns_flutter_plugin/tpns_flutter_plugin.dart';
// import 'package:umeng_common_sdk/umeng_common_sdk.dart'; // import 'package:umeng_common_sdk/umeng_common_sdk.dart';
@ -215,6 +216,57 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
///iOS的appID信息Android信息在build.gradle文件中 ///iOS的appID信息Android信息在build.gradle文件中
xgFlutterPlugin.startXg("1680005688", "IYIB3R2XRE22"); xgFlutterPlugin.startXg("1680005688", "IYIB3R2XRE22");
// xgFlutterPlugin.addEventHandler(
// onReceiveMessage: (Map<String, dynamic> event) async {
// print("onReceiveMessage: ${event.toString()}");
// return true;
// },
// onReceiveNotificationResponse: (Map<String, dynamic> event) async {
// print("onReceiveNotificationResponse: ${event.toString()}");
// return true;
// },
// xgPushDidBindWithIdentifier: (Map<String, dynamic> event) async {
// print("xgPushDidBindWithIdentifier: ${event.toString()}");
// return true;
// },
// xgPushDidUnbindWithIdentifier: (Map<String, dynamic> event) async {
// print("xgPushDidUnbindWithIdentifier: ${event.toString()}");
// return true;
// },
// xgPushDidUpdatedBindedIdentifier: (Map<String, dynamic> event) async {
// print("xgPushDidUpdatedBindedIdentifier: ${event.toString()}");
// return true;
// },
// xgPushClickAction: (Map<String, dynamic> event) async {
// print("xgPushClickAction: ${event.toString()}");
// return true;
// },
// xgPushDidClearAllIdentifiers: (Map<String, dynamic> event) async {
// print("xgPushDidClearAllIdentifiers: ${event.toString()}");
// return true;
// },
// onRegisteredDeviceToken: (String res) async {
// print("onRegisteredDeviceToken: ${res}");
// return true;
// },
// onRegisteredDone: (String res) async {
// print("onRegisteredDone: ${res}");
// return true;
// },
// unRegistered: (String res) async {
// print("unRegistered: ${res}");
// return true;
// },
// xgPushNetworkConnected: (String res) async {
// print("xgPushNetworkConnected: ${res}");
// return true;
// },
// xgPushDidSetBadge: (String res) async {
// print("xgPushDidSetBadge: ${res}");
// return true;
// },
// );
if (Platform.isAndroid) { if (Platform.isAndroid) {
XgAndroidApi androidApi = xgFlutterPlugin.getXgAndroidApi(); XgAndroidApi androidApi = xgFlutterPlugin.getXgAndroidApi();
// //
@ -225,6 +277,8 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
androidApi.regPush(); androidApi.regPush();
} }
// ===========================TPNS====
ShareSDKRegister shareSDKRegister = ShareSDKRegister(); ShareSDKRegister shareSDKRegister = ShareSDKRegister();
shareSDKRegister.setupWechat( shareSDKRegister.setupWechat(
"wx3b269e795ed23e5f", "wx3b269e795ed23e5f",

80
lib/setting/about_page.dart

@ -4,6 +4,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/utils/constant.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:package_info_plus/package_info_plus.dart'; import 'package:package_info_plus/package_info_plus.dart';
@ -54,7 +55,7 @@ class _AboutPage extends State<AboutPage> {
alignment: Alignment.center, alignment: Alignment.center,
child: SingleChildScrollView( child: SingleChildScrollView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
child:Column( child: Column(
children: [ children: [
Image.asset( Image.asset(
"assets/image/icon_about_logo.webp", "assets/image/icon_about_logo.webp",
@ -62,9 +63,17 @@ class _AboutPage extends State<AboutPage> {
height: 130, height: 130,
), ),
Padding( Padding(
padding: EdgeInsets.only(top: 32, bottom: 5), padding: {
't': 32,
'b': 5,
'l': 15,
'r': 15,
}.mpOnly,
child: Text( child: Text(
S.of(context).yixinhuixiang, S.of(context).yixinhuixiang,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.center,
maxLines: 1,
style: TextStyle( style: TextStyle(
fontSize: 30, fontSize: 30,
color: Color(0xFF30415B), color: Color(0xFF30415B),
@ -73,6 +82,9 @@ class _AboutPage extends State<AboutPage> {
), ),
Text( Text(
S.of(context).guojiankangyoujishenghuo, S.of(context).guojiankangyoujishenghuo,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.center,
maxLines: 1,
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
@ -83,13 +95,13 @@ class _AboutPage extends State<AboutPage> {
height: 20, height: 20,
), ),
GestureDetector( GestureDetector(
onTap: (){ onTap: () {
// updateApp(); // updateApp();
}, },
child:settingItem( child: settingItem(
S.of(context).dangqianbanben, S.of(context).dangqianbanben,
S.of(context).banben(version), S.of(context).banben(version),
) ),
), ),
// textItem(S.of(context).tebieshengming), // textItem(S.of(context).tebieshengming),
if (!Platform.isAndroid) if (!Platform.isAndroid)
@ -113,7 +125,8 @@ class _AboutPage extends State<AboutPage> {
GestureDetector( GestureDetector(
child: settingSingleItem("用户协议"), child: settingSingleItem("用户协议"),
onTap: () { onTap: () {
Navigator.of(context).pushNamed('/router/user_service_page'); Navigator.of(context)
.pushNamed('/router/user_service_page');
}, },
), ),
GestureDetector( GestureDetector(
@ -122,19 +135,12 @@ class _AboutPage extends State<AboutPage> {
Navigator.of(context).pushNamed('/router/logout_page'); Navigator.of(context).pushNamed('/router/logout_page');
}, },
), ),
Padding(
padding: EdgeInsets.only(left: 20, right: 20),
child: Divider(
height: 10.0,
indent: 0.0,
color: Colors.grey,
),
),
SizedBox( SizedBox(
height:100, height: 100,
), ),
], ],
),) ),
),
), ),
Container( Container(
margin: EdgeInsets.only(bottom: 23), margin: EdgeInsets.only(bottom: 23),
@ -178,11 +184,11 @@ class _AboutPage extends State<AboutPage> {
} }
updateApp() async { updateApp() async {
String url = Platform.isIOS Uri url = Uri.parse(Platform.isIOS
? "itms-apps://itunes.apple.com/app/id1575124838" ? "itms-apps://itunes.apple.com/app/id1575124838"
: "http://application.lotus-wallet.com/huixiang?release_id="; : "http://application.lotus-wallet.com/huixiang?release_id=");
if (await canLaunch(url)) { if (await canLaunchUrl(url)) {
await launch(url); await launchUrl(url);
} else { } else {
throw 'Could not launch $url'; throw 'Could not launch $url';
} }
@ -191,14 +197,7 @@ class _AboutPage extends State<AboutPage> {
Widget settingSingleItem(right) { Widget settingSingleItem(right) {
return Container( return Container(
margin: EdgeInsets.fromLTRB(16, 0, 16, 0), margin: EdgeInsets.fromLTRB(16, 0, 16, 0),
child: Column( child: Padding(
children: [
Divider(
height: 10.0,
indent: 0.0,
color: Colors.grey,
),
Padding(
padding: EdgeInsets.only(top: 15, bottom: 15), padding: EdgeInsets.only(top: 15, bottom: 15),
child: Row( child: Row(
children: [ children: [
@ -222,22 +221,13 @@ class _AboutPage extends State<AboutPage> {
], ],
), ),
), ),
],
),
); );
} }
Widget settingItem(left, right) { Widget settingItem(left, right) {
return Container( return Container(
margin: EdgeInsets.fromLTRB(16, 0, 16, 0), margin: EdgeInsets.fromLTRB(16, 0, 16, 0),
child: Column( child: Padding(
children: [
Divider(
height: 10.0,
indent: 0.0,
color: Colors.grey,
),
Padding(
padding: EdgeInsets.only(top: 15, bottom: 15), padding: EdgeInsets.only(top: 15, bottom: 15),
child: Row( child: Row(
children: [ children: [
@ -263,8 +253,6 @@ class _AboutPage extends State<AboutPage> {
], ],
), ),
), ),
],
),
); );
} }
@ -273,15 +261,7 @@ class _AboutPage extends State<AboutPage> {
width: double.infinity, width: double.infinity,
// padding: EdgeInsets.fromLTRB(20, 16, 20, 16), // padding: EdgeInsets.fromLTRB(20, 16, 20, 16),
margin: EdgeInsets.fromLTRB(16, 0, 16, 0), margin: EdgeInsets.fromLTRB(16, 0, 16, 0),
child: Column( child: Padding(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Divider(
height: 10.0,
indent: 0.0,
color: Colors.grey,
),
Padding(
padding: EdgeInsets.only(top: 15, bottom: 15), padding: EdgeInsets.only(top: 15, bottom: 15),
child: Text( child: Text(
text, text,
@ -292,8 +272,6 @@ class _AboutPage extends State<AboutPage> {
), ),
), ),
), ),
],
),
); );
} }
} }

34
lib/setting/treaty_page.dart

@ -59,23 +59,23 @@ class _TreatyPage extends State<TreatyPage> {
try { try {
_webViewController = WebViewController() _webViewController = WebViewController()
..setJavaScriptMode(JavaScriptMode.unrestricted) ..setJavaScriptMode(JavaScriptMode.unrestricted)
// ..setNavigationDelegate( ..setNavigationDelegate(
// NavigationDelegate( NavigationDelegate(
// onProgress: (int progress) {}, onProgress: (int progress) {},
// onPageStarted: (String url) {}, onPageStarted: (String url) {},
// onPageFinished: (String url) { onPageFinished: (String url) {
// EasyLoading.dismiss(); EasyLoading.dismiss();
// }, },
// onWebResourceError: (WebResourceError error) {}, onWebResourceError: (WebResourceError error) {},
// onNavigationRequest: (NavigationRequest request) { onNavigationRequest: (NavigationRequest request) {
// // if (request.url.startsWith('https://www.youtube.com/')) { // if (request.url.startsWith('https://www.youtube.com/')) {
// // return NavigationDecision.prevent; // return NavigationDecision.prevent;
// // } // }
// return NavigationDecision.navigate; return NavigationDecision.navigate;
// }, },
// ), ),
// ) )
..loadRequest(Uri.parse("https://huixiang.lotus-wallet.com/Privacy.html")); ..loadRequest(Uri.parse("http://huixiang.lotus-wallet.com/Privacy.html"));
res = WebViewWidget(controller: _webViewController!); res = WebViewWidget(controller: _webViewController!);
} catch (error) { } catch (error) {
res = Text("加载失败"); res = Text("加载失败");

2
lib/view_widget/round_button.dart

@ -51,6 +51,7 @@ class RoundButton extends StatelessWidget {
Widget buildText() { Widget buildText() {
Widget textWidget = Text( Widget textWidget = Text(
text ?? "", text ?? "",
overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
color: textColor, color: textColor,
fontSize: fontSize, fontSize: fontSize,
@ -71,6 +72,7 @@ class RoundButton extends StatelessWidget {
} else { } else {
return Row( return Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
textWidget, textWidget,
], ],

6
pubspec.lock

@ -1342,11 +1342,11 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
path: "." path: "."
ref: "V1.1.6" ref: "V1.2.8"
resolved-ref: a7e45d151171f9ec4b56bc97a720f545aa4a8722 resolved-ref: "74309ee04cada555cb4eaa22da06a0b9d0bb86e4"
url: "https://github.com/TencentCloud/TPNS-Flutter-Plugin" url: "https://github.com/TencentCloud/TPNS-Flutter-Plugin"
source: git source: git
version: "1.1.6" version: "1.2.8"
tuple: tuple:
dependency: transitive dependency: transitive
description: description:

2
pubspec.yaml

@ -44,7 +44,7 @@ dependencies:
tpns_flutter_plugin: tpns_flutter_plugin:
git: git:
url: https://github.com/TencentCloud/TPNS-Flutter-Plugin url: https://github.com/TencentCloud/TPNS-Flutter-Plugin
ref: V1.1.6 ref: V1.2.8
umeng_common_sdk: ^1.2.7 umeng_common_sdk: ^1.2.7
like_button: ^2.0.5 like_button: ^2.0.5

Loading…
Cancel
Save