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

commit

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