Browse Source

1.修复分享链接是的按钮不显示问题

tags/0.0.5+3
“yanghuaxuan” 3 years ago
parent
commit
1959af55fb
6 changed files with 20 additions and 12 deletions
  1. +2
    -2
      example/android/app/build.gradle
  2. +1
    -1
      lib/pages/goods_share_page/goods_share_image/goods_share_image.dart
  3. +1
    -1
      lib/pages/goods_share_page/goods_share_link/goods_share_link.dart
  4. +2
    -0
      lib/pages/goods_share_page/models/goods_share_style_model.dart
  5. +12
    -8
      lib/pages/home_page/home_page.dart
  6. +2
    -0
      pubspec.yaml

+ 2
- 2
example/android/app/build.gradle View File

@@ -113,9 +113,9 @@ android {
// 智夜生活
zhiying {
applicationId "cn.zhios.zhiying"
versionCode 45
versionCode 46
dimension "app"
versionName '1.3.3'
versionName '1.3.4'
// 签名信息
signingConfig signingConfigs.zhiying
}


+ 1
- 1
lib/pages/goods_share_page/goods_share_image/goods_share_image.dart View File

@@ -363,7 +363,7 @@ class _GoodsShareImageContentState extends State<_GoodsShareImageContent> with A
BuildContext buildContext = _globalKey.currentContext;
if (null != buildContext) {
RenderRepaintBoundary boundary = buildContext.findRenderObject();
ui.Image image = await boundary.toImage(pixelRatio: 2.0);
ui.Image image = await boundary.toImage(pixelRatio: 1.5);
// 注意:png是压缩后格式,如果需要图片的原始像素数据,请使用rawRgba
ByteData byteData = await image.toByteData(format: ui.ImageByteFormat.png);
Uint8List pngBytes = byteData.buffer.asUint8List();


+ 1
- 1
lib/pages/goods_share_page/goods_share_link/goods_share_link.dart View File

@@ -180,7 +180,7 @@ class _GoodsShareLinkContentState extends State<_GoodsShareLinkContent>
}

Widget _createBottom() {
Map<String, dynamic> shareImages = _style?.cssList?.shareImage;
Map<String, dynamic> shareImages = _style?.cssList?.shareLink;
if (shareImages == null) {
return Container();
}


+ 2
- 0
lib/pages/goods_share_page/models/goods_share_style_model.dart View File

@@ -10,6 +10,7 @@ class GoodsShareStyleModel {
String rewardText;
Map<String, dynamic> shareImage;
GoodsShareTempEditorModel editTemplate;
Map<String, dynamic> shareLink;

GoodsShareStyleModel(
{this.unChooseColor,
@@ -31,6 +32,7 @@ class GoodsShareStyleModel {
rewardImage = json['reward_image'];
rewardText = json['reward_text'];
shareImage = json['share_image'];
shareLink=json['share_link'];
if (json['edit_template'] != null) {
editTemplate = GoodsShareTempEditorModel.fromJson(
Map<String, dynamic>.from(json['edit_template']));


+ 12
- 8
lib/pages/home_page/home_page.dart View File

@@ -50,13 +50,19 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver, Ticker
int _currentIndex = 0;
List<Map<String, dynamic>> _data = List();
static const EventChannel _eventChannel = const EventChannel('JAVA_TO_FLUTTER');
StreamSubscription streamSubscription;

@override
void initState() {

///初始化一些数据
initAsync();

//如果登出则重新打开首页
streamSubscription = EventUtil.instance.on<LogOut>().listen((event) {
Navigator.maybePop(context);
Navigator.pushReplacementNamed(context, "/homePage");
});

super.initState();
}

@@ -64,10 +70,11 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver, Ticker
initAsync() async {
try {
WidgetsBinding.instance.addObserver(this);

///渲染完第一帧后调用
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
int delay=((num.tryParse(AppConfigModel.appStartDelay)??0.5)*1000).toInt();
Timer(Duration(milliseconds: delay), (){
int delay = ((num.tryParse(AppConfigModel.appStartDelay) ?? 0.5) * 1000).toInt();
Timer(Duration(milliseconds: delay), () {
NativeUtil.notifyInitSuccess();
});
});
@@ -137,6 +144,7 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver, Ticker
@override
void dispose() {
WidgetsBinding.instance.removeObserver(this);
streamSubscription.cancel();
super.dispose();
}

@@ -262,8 +270,6 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver, Ticker
/// 3、活动弹窗
///
Future _showPolicy() async {


// 通知弹窗
String isShowNotiPermission = await SharedPreferencesUtil.getStringValue(Constants.isShowNotiPermission);
if (isShowNotiPermission == null || isShowNotiPermission != '1') {
@@ -329,8 +335,7 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver, Ticker
void showAlert(String text, BuildContext context) {
showDialog(
context: context,
builder: (BuildContext context) =>
CupertinoAlertDialog(title: new Text("提示"), content: new Text(text), actions: <Widget>[
builder: (BuildContext context) => CupertinoAlertDialog(title: new Text("提示"), content: new Text(text), actions: <Widget>[
new FlatButton(
child: new Text("OK"),
onPressed: () {
@@ -339,5 +344,4 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver, Ticker
)
]));
}

}

+ 2
- 0
pubspec.yaml View File

@@ -53,6 +53,8 @@ dependencies:
loading_indicator: ^1.2.0

mobpush_plugin:
plugin_platform_interface: ^1.0.1
permission_handler_platform_interface: ^2.0.1





Loading…
Cancel
Save