Commit ce124e31 authored by 林生雨's avatar 林生雨

commit

parent c6eb5fb3
...@@ -38,7 +38,7 @@ class MainActivity : FlutterActivity() { ...@@ -38,7 +38,7 @@ class MainActivity : FlutterActivity() {
buriedMap["app_version_name"] = "app_version_name" buriedMap["app_version_name"] = "app_version_name"
buriedMap["channel"] = "channel" buriedMap["channel"] = "channel"
buriedMap["current_city_id"] = "current_city_id" buriedMap["current_city_id"] = "current_city_id"
buriedMap["user_type"] = "user_type" // buriedMap["user_type"] = "user_type"
//TODO //TODO
// buriedMap.put("serial_id", serial_id++); // buriedMap.put("serial_id", serial_id++);
buriedMap["grey_type"] = "unknown" buriedMap["grey_type"] = "unknown"
...@@ -63,7 +63,7 @@ class MainActivity : FlutterActivity() { ...@@ -63,7 +63,7 @@ class MainActivity : FlutterActivity() {
result.success("wifi") result.success("wifi")
} else if (call.method == "INIT_PARAMS") { } else if (call.method == "INIT_PARAMS") {
val map = HashMap<String, String>() val map = HashMap<String, String>()
map.put("buildConfig", "debug") map.put("buildConfig", "release")
//HERE //HERE
// map.put("proxy", "172.30.9.84:6666"); // map.put("proxy", "172.30.9.84:6666");
result.success(map) result.success(map)
......
sdk.dir=/Users/apple/Library/Android/sdk sdk.dir=/Users/apple/Library/Android/sdk
flutter.sdk=/Users/apple/Downloads/flutter flutter.sdk=/Users/apple/Downloads/flutter
flutter.buildMode=debug flutter.buildMode=release
flutter.versionName=1.0.0 flutter.versionName=1.0.0
flutter.versionCode=1 flutter.versionCode=1
\ No newline at end of file
...@@ -234,11 +234,11 @@ mkdir /Users/apple/lsy/aar_update/androd${message}/ ...@@ -234,11 +234,11 @@ mkdir /Users/apple/lsy/aar_update/androd${message}/
mkdir /Users/apple/lsy/aar_update/ios${message}/ mkdir /Users/apple/lsy/aar_update/ios${message}/
clean clean
android_apk #android_apk
#android #android
#android_publish #android_publish
#upload_android_aar #upload_android_aar
#ios ios
#ios_publish #ios_publish
#notifyDingDing #notifyDingDing
......
...@@ -16,6 +16,8 @@ import 'package:gmalpha_flutter/commonModel/ui/ALColors.dart'; ...@@ -16,6 +16,8 @@ import 'package:gmalpha_flutter/commonModel/ui/ALColors.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
final _goldenColor = Color(0xFFB9A689); final _goldenColor = Color(0xFFB9A689);
bool stopPage = false;
ActivityReportState state;
class ActivityReportPage extends StatefulWidget { class ActivityReportPage extends StatefulWidget {
ActivityReportModel _model; ActivityReportModel _model;
...@@ -36,92 +38,90 @@ class ActivityReportState extends BasePage<ActivityReportPage> { ...@@ -36,92 +38,90 @@ class ActivityReportState extends BasePage<ActivityReportPage> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
state = this;
_model.init(context); _model.init(context);
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
if (stopPage) {
startTime = DateTime.now().millisecondsSinceEpoch;
stopPage = false;
}
ScreenUtil.instance = ScreenUtil(width: 375, height: 667)..init(context); ScreenUtil.instance = ScreenUtil(width: 375, height: 667)..init(context);
return IMAGE.WillPopScope( return Scaffold(
child: Scaffold( appBar: AppBar(
appBar: AppBar( title: Text(''),
title: Text(''), centerTitle: true,
centerTitle: true, leading: IMAGE.GestureDetector(
leading: IMAGE.GestureDetector( onTap: () {
onTap: () { RouterCenterImpl()
super.pageStop(); .findBuriedRouter()
RouterCenterImpl() ?.onClick(pageName(), "return");
.findBuriedRouter() Navigator.pop(context, "");
?.onClick(pageName(), "return"); jumpToNative("search", null);
Navigator.pop(context, ""); },
jumpToNative("search", null);
},
// child: IMAGE.Image.asset("images/nav_back.png"), // child: IMAGE.Image.asset("images/nav_back.png"),
child: IMAGE.Center( child: IMAGE.Center(
child: SvgPicture.asset( child: SvgPicture.asset(
"images/left_arrow.svg", "images/left_arrow.svg",
color: IMAGE.Color(0xff323232), color: IMAGE.Color(0xff323232),
))), ))),
actions: <Widget>[ actions: <Widget>[
GestureDetector( GestureDetector(
child: Container( child: Container(
margin: EdgeInsets.only(right: 30), margin: EdgeInsets.only(right: 30),
child: Center( child: Center(
child: Text( child: Text(
'再测一次', '再测一次',
style: TextStyle( style: TextStyle(
color: ALColors.Color323232, color: ALColors.Color323232,
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.bold), fontWeight: FontWeight.bold),
))), ))),
onTap: () { onTap: () {
// click("", ""); RouterCenterImpl()
super.pageStop(); .findBuriedRouter()
RouterCenterImpl() ?.onClick(pageName(), "test_again");
.findBuriedRouter() Navigator.pop(context, "");
?.onClick(pageName(), "test_again"); jumpToH5("question", null);
Navigator.pop(context, ""); },
jumpToH5("question", null); )
}, ],
) ),
], body: StreamBuilder<ActivityReportEntity>(
), stream: _model.activityReportLive.stream,
body: StreamBuilder<ActivityReportEntity>( initialData: _model.activityReportLive.data,
stream: _model.activityReportLive.stream, builder: (context, data) {
initialData: _model.activityReportLive.data, if (data.data == null) {
builder: (context, data) { return loadingItem();
if (data.data == null) { }
return loadingItem(); if (data.data.error != 0 || data.data.data == null) {
} return errorItem(data.data.message);
if (data.data.error != 0 || data.data.data == null) { }
return errorItem(data.data.message); return Container(
} color: Color(0xfff5f5f5),
return Container( padding: EdgeInsets.only(
color: Color(0xfff5f5f5), left: ScreenUtil().setWidth(16),
padding: EdgeInsets.only( right: ScreenUtil().setWidth(16)),
left: ScreenUtil().setWidth(16), child: SingleChildScrollView(
right: ScreenUtil().setWidth(16)), child: Column(
child: SingleChildScrollView( children: <Widget>[
child: Column( TopCard(share: data.data.data.report?.share),
children: <Widget>[ SizedBox(height: ScreenUtil().setHeight(8)),
TopCard(share: data.data.data.report?.share), PictorialCard(
SizedBox(height: ScreenUtil().setHeight(8)), this,
PictorialCard( _model,
_model, pictorialList: data.data.data.report?.cards,
pictorialList: data.data.data.report?.cards, id: _model.id,
id: _model.id, ),
), SizedBox(height: ScreenUtil().setHeight(38))
SizedBox(height: ScreenUtil().setHeight(38)) ],
],
),
), ),
); ),
}, );
)), },
onWillPop: () { ));
Navigator.pop(context, "");
},
);
} }
Widget errorItem(String reason) { Widget errorItem(String reason) {
...@@ -137,7 +137,10 @@ class ActivityReportState extends BasePage<ActivityReportPage> { ...@@ -137,7 +137,10 @@ class ActivityReportState extends BasePage<ActivityReportPage> {
@override @override
void dispose() { void dispose() {
super.dispose(); super.dispose();
animationNumberState.clearState();
animationCharacterState.clearState();
_model.dispose(); _model.dispose();
jumpToNative("search", null);
} }
@override @override
...@@ -384,8 +387,9 @@ class PictorialCard extends StatelessWidget { ...@@ -384,8 +387,9 @@ class PictorialCard extends StatelessWidget {
final List<Cards> pictorialList; final List<Cards> pictorialList;
final id; final id;
final ActivityReportModel _model; final ActivityReportModel _model;
final ActivityReportState state;
PictorialCard(this._model, {Key key, this.pictorialList, this.id}) PictorialCard(this.state, this._model, {Key key, this.pictorialList, this.id})
: super(key: key); : super(key: key);
Widget _gridViewItemUI(BuildContext context, item) { Widget _gridViewItemUI(BuildContext context, item) {
...@@ -413,6 +417,8 @@ class PictorialCard extends StatelessWidget { ...@@ -413,6 +417,8 @@ class PictorialCard extends StatelessWidget {
RouterCenterImpl() RouterCenterImpl()
.findBuriedRouter() .findBuriedRouter()
?.onClick("brand_report", "recommand_${indexOf + 1}"); ?.onClick("brand_report", "recommand_${indexOf + 1}");
state.pageStop();
stopPage = true;
jumpToNative("pictorial", jumpToNative("pictorial",
{"url": '${item.protocol}&survey_record_id=$id'}); {"url": '${item.protocol}&survey_record_id=$id'});
}, },
...@@ -476,6 +482,8 @@ class PictorialCard extends StatelessWidget { ...@@ -476,6 +482,8 @@ class PictorialCard extends StatelessWidget {
} }
} }
AnimationNumberState animationNumberState;
class AnimationNumber extends StatefulWidget { class AnimationNumber extends StatefulWidget {
final targetNmber; final targetNmber;
final delay; final delay;
...@@ -484,10 +492,13 @@ class AnimationNumber extends StatefulWidget { ...@@ -484,10 +492,13 @@ class AnimationNumber extends StatefulWidget {
AnimationNumber({Key key, this.targetNmber, this.delay, this.container}) AnimationNumber({Key key, this.targetNmber, this.delay, this.container})
: super(key: key); : super(key: key);
_AnimationNumberState createState() => _AnimationNumberState(); AnimationNumberState createState() {
animationNumberState = AnimationNumberState();
return animationNumberState;
}
} }
class _AnimationNumberState extends State<AnimationNumber> class AnimationNumberState extends State<AnimationNumber>
with TickerProviderStateMixin { with TickerProviderStateMixin {
AnimationController _animationController; AnimationController _animationController;
var _timer; var _timer;
...@@ -506,8 +517,7 @@ class _AnimationNumberState extends State<AnimationNumber> ...@@ -506,8 +517,7 @@ class _AnimationNumberState extends State<AnimationNumber>
}); });
} }
@override clearState() {
void dispose() {
super.dispose(); super.dispose();
_animationController.dispose(); _animationController.dispose();
_timer.dispose(); _timer.dispose();
...@@ -522,16 +532,21 @@ class _AnimationNumberState extends State<AnimationNumber> ...@@ -522,16 +532,21 @@ class _AnimationNumberState extends State<AnimationNumber>
} }
} }
AnimationCharacterState animationCharacterState;
class AnimationCharacter extends StatefulWidget { class AnimationCharacter extends StatefulWidget {
final targetNmber; final targetNmber;
final delay; final delay;
AnimationCharacter({Key key, this.targetNmber, this.delay}) : super(key: key); AnimationCharacter({Key key, this.targetNmber, this.delay}) : super(key: key);
_AnimationCharacterState createState() => _AnimationCharacterState(); AnimationCharacterState createState() {
animationCharacterState = AnimationCharacterState();
return animationCharacterState;
}
} }
class _AnimationCharacterState extends State<AnimationCharacter> class AnimationCharacterState extends State<AnimationCharacter>
with TickerProviderStateMixin { with TickerProviderStateMixin {
AnimationController _animationController; AnimationController _animationController;
var _timer; var _timer;
...@@ -592,8 +607,7 @@ class _AnimationCharacterState extends State<AnimationCharacter> ...@@ -592,8 +607,7 @@ class _AnimationCharacterState extends State<AnimationCharacter>
}); });
} }
@override clearState() {
void dispose() {
super.dispose(); super.dispose();
_animationController.dispose(); _animationController.dispose();
_timer.dispose(); _timer.dispose();
......
/*
* @author lsy
* @date 2019-10-12
**/
...@@ -7,6 +7,7 @@ import 'package:gmalpha_flutter/BuriedLib/proto/burying.pbgrpc.dart'; ...@@ -7,6 +7,7 @@ import 'package:gmalpha_flutter/BuriedLib/proto/burying.pbgrpc.dart';
import 'package:gmalpha_flutter/commonModel/app_module.dart'; import 'package:gmalpha_flutter/commonModel/app_module.dart';
import 'package:gmalpha_flutter/commonModel/base/Temp.dart'; import 'package:gmalpha_flutter/commonModel/base/Temp.dart';
import 'package:gmalpha_flutter/commonModel/cache/CacheManager.dart'; import 'package:gmalpha_flutter/commonModel/cache/CacheManager.dart';
import 'package:gmalpha_flutter/commonModel/net/Api.dart';
import 'package:grpc/grpc.dart'; import 'package:grpc/grpc.dart';
class SendTask { class SendTask {
...@@ -16,9 +17,15 @@ class SendTask { ...@@ -16,9 +17,15 @@ class SendTask {
AppInfo _appInfo; AppInfo _appInfo;
SendTask() { SendTask() {
_buriedChannel = if (Api.BUILD_CONFIG == "release") {
ClientChannelManager.getChannel(BURIED_DEV_HOST, BURIED_DEV_PORT); _buriedChannel =
_client = ReportingClient(_buriedChannel); ClientChannelManager.getChannel(BURIED_RELEASE_HOST, BURIED_RELEASE_PORT);
_client = ReportingClient(_buriedChannel);
} else {
_buriedChannel =
ClientChannelManager.getChannel(BURIED_DEV_HOST, BURIED_DEV_PORT);
_client = ReportingClient(_buriedChannel);
}
} }
void _sendBuriedData(BuryingRequest request) { void _sendBuriedData(BuryingRequest request) {
......
...@@ -7,4 +7,9 @@ ...@@ -7,4 +7,9 @@
//dev 埋点host //dev 埋点host
const String BURIED_DEV_HOST="152.136.6.36"; const String BURIED_DEV_HOST="152.136.6.36";
//dev 埋点port //dev 埋点port
const int BURIED_DEV_PORT=80; const int BURIED_DEV_PORT=80;
\ No newline at end of file
//release 埋点host
const String BURIED_RELEASE_HOST="152.136.9.137";
//release 埋点port
const int BURIED_RELEASE_PORT=80;
...@@ -57,6 +57,9 @@ class ReputationsState extends BasePage<ReputationsPage> { ...@@ -57,6 +57,9 @@ class ReputationsState extends BasePage<ReputationsPage> {
centerTitle: true, centerTitle: true,
leading: GestureDetector( leading: GestureDetector(
onTap: () { onTap: () {
RouterCenterImpl()
.findBuriedRouter()
?.onClick(pageName(), "return");
FlutterBoost.singleton.closePageForContext(context); FlutterBoost.singleton.closePageForContext(context);
}, },
// child: Image.asset("images/nav_back.png"), // child: Image.asset("images/nav_back.png"),
......
...@@ -23,6 +23,8 @@ const String APP_HOST_DEBUG = "http://earth.gmapp.env"; ...@@ -23,6 +23,8 @@ const String APP_HOST_DEBUG = "http://earth.gmapp.env";
const String APP_HOST_DEV = "http://earth.alpha.newdev"; const String APP_HOST_DEV = "http://earth.alpha.newdev";
class Api { class Api {
static String BUILD_CONFIG;
static Api intance = new Api._(); static Api intance = new Api._();
Api._(); Api._();
...@@ -39,6 +41,7 @@ class Api { ...@@ -39,6 +41,7 @@ class Api {
if (buildConfig == null) { if (buildConfig == null) {
return false; return false;
} }
BUILD_CONFIG = buildConfig;
String baseUrl = getBaseUrl(buildConfig) + "/"; String baseUrl = getBaseUrl(buildConfig) + "/";
if (baseUrl == null) { if (baseUrl == null) {
return false; return false;
......
...@@ -12,8 +12,8 @@ import 'package:gmalpha_flutter/messageModel/home/message_home.dart'; ...@@ -12,8 +12,8 @@ import 'package:gmalpha_flutter/messageModel/home/message_home.dart';
import 'comment_suggest.dart'; import 'comment_suggest.dart';
void main(){ void main() {
initParams(()=>runApp(MyApp())); initParams(() => runApp(MyApp()));
} }
class MyApp extends StatefulWidget { class MyApp extends StatefulWidget {
...@@ -45,23 +45,18 @@ class _MyAppState extends State<MyApp> { ...@@ -45,23 +45,18 @@ class _MyAppState extends State<MyApp> {
}, },
"prestige": (pageName, params, _) { "prestige": (pageName, params, _) {
print("PARAMS!! ${params}"); print("PARAMS!! ${params}");
String fromPage = params["fromPage"]; if (!Api.getInstance().setDioCookie(params) ||
if (params == null || params["fromPage"] == null) {
fromPage == null ||
!Api.getInstance().setDioCookie(params)) {
return ErrorPage("出错:需要传递的参数为空"); return ErrorPage("出错:需要传递的参数为空");
} }
int userId = int.parse(params["userId"]); int userId = int.parse(params["userId"]);
return RouterCenterImpl() return RouterCenterImpl().findPrestigeRouter()?.getReputationsPage(
.findPrestigeRouter() userId, params["userName"], params["fromPage"]);
?.getReputationsPage(userId, params["userName"], fromPage);
}, },
"activity_report": (pageName, params, _) { "activity_report": (pageName, params, _) {
print("PARAMS!! ${params}"); print("PARAMS!! ${params}");
String fromPage = params["fromPage"]; if (!Api.getInstance().setDioCookie(params) ||
if (params == null || params["fromPage"] == null) {
fromPage == null ||
!Api.getInstance().setDioCookie(params)) {
return ErrorPage("出错:需要传递的参数为空"); return ErrorPage("出错:需要传递的参数为空");
} }
return RouterCenterImpl() return RouterCenterImpl()
...@@ -73,7 +68,7 @@ class _MyAppState extends State<MyApp> { ...@@ -73,7 +68,7 @@ class _MyAppState extends State<MyApp> {
params["template_id"] == null params["template_id"] == null
? null ? null
: int.parse(params["template_id"]), : int.parse(params["template_id"]),
fromPage); params["fromPage"]);
} }
}); });
FlutterBoost.handleOnStartPage(); FlutterBoost.handleOnStartPage();
...@@ -84,21 +79,21 @@ class _MyAppState extends State<MyApp> { ...@@ -84,21 +79,21 @@ class _MyAppState extends State<MyApp> {
return MaterialApp( return MaterialApp(
title: 'Flutter Boost example', title: 'Flutter Boost example',
debugShowCheckedModeBanner: false, debugShowCheckedModeBanner: false,
routes: { // routes: {
'/': (context) { // '/': (context) {
Api.getInstance().setDioCookie({ // Api.getInstance().setDioCookie({
'Cookie': 'sessionid=iro2ke6i7rc9qselm7yogjf5xvgwzn1p; _gtid=203c91f8ebd811e981aa525400e82fab6765; _gm_token=2927681570850359' // 'Cookie': 'sessionid=iro2ke6i7rc9qselm7yogjf5xvgwzn1p; _gtid=203c91f8ebd811e981aa525400e82fab6765; _gm_token=2927681570850359'
}); // });
return RouterCenterImpl()
.findActivityReportRouter()
?.getActivityReportPage(279, 1, '');
// return RouterCenterImpl().findPrestigeRouter()?.getReputationsPage(1, "ww", "ww");
// return RouterCenterImpl() // return RouterCenterImpl()
// .findAlbumRouter() // .findActivityReportRouter()
// .getAlbumPage("com.example.gengmei_flutter_plugin_example",true, 2, null); // ?.getActivityReportPage(279, 1, '');
}, //// return RouterCenterImpl().findPrestigeRouter()?.getReputationsPage(1, "ww", "ww");
}, //// return RouterCenterImpl()
// builder: FlutterBoost.init(postPush: _onRoutePushed), //// .findAlbumRouter()
//// .getAlbumPage("com.example.gengmei_flutter_plugin_example",true, 2, null);
// },
// },
builder: FlutterBoost.init(postPush: _onRoutePushed),
theme: new ThemeData( theme: new ThemeData(
primaryColor: Colors.white, primaryColor: Colors.white,
backgroundColor: Color(0xFFEFEFEF), backgroundColor: Color(0xFFEFEFEF),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment