Переглянути джерело

1.优化QQ空间分享支持存文本分享

2.优化轮播图背景色设置
3.优化公告栏颜色设置
4.适配首页延时设置
5.新增广告弹窗
tags/0.0.4+8
“yanghuaxuan” 3 роки тому
джерело
коміт
6e4df10748
13 змінених файлів з 215 додано та 28 видалено
  1. +4
    -2
      example/android/app/build.gradle
  2. +12
    -7
      lib/dialog/global_dialog/activity_dialog/activity_dialog.dart
  3. +90
    -0
      lib/dialog/global_dialog/advertising_dialog/advertising_dialog.dart
  4. +68
    -0
      lib/dialog/global_dialog/advertising_dialog/advertising_model.dart
  5. +1
    -1
      lib/models/app_config_model.dart
  6. +2
    -2
      lib/pages/goods_details_page/goods_details_page.dart
  7. +2
    -1
      lib/pages/home_page/home_page.dart
  8. +1
    -1
      lib/widgets/custom/notice/custom_notice_widget.dart
  9. +2
    -0
      lib/widgets/custom/notice/model/custom_notice_model.dart
  10. +10
    -11
      lib/widgets/custom/slide_banner/custom_slide_banner.dart
  11. +9
    -0
      lib/widgets/custom/slide_banner/model/custom_slide_banner_model.dart
  12. +11
    -2
      lib/widgets/share/share_alert.dart
  13. +3
    -1
      lib/zhiying_base_widget.dart

+ 4
- 2
example/android/app/build.gradle Переглянути файл

@@ -112,9 +112,9 @@ android {
// 智夜生活
zhiying {
applicationId "cn.zhios.zhiying"
versionCode 35
versionCode 37
dimension "app"
versionName '1.2.35'
versionName '1.2.37'
// 签名信息
signingConfig signingConfigs.zhiying
}
@@ -227,6 +227,8 @@ MobSDK {
enable true
}
QZone {
appId "1111030588"
appKey "XoHKlrBybXy7ORBt"
enable true
}
SinaWeibo {


+ 12
- 7
lib/dialog/global_dialog/activity_dialog/activity_dialog.dart Переглянути файл

@@ -18,12 +18,15 @@ class ActivityDialog extends StatelessWidget {
try {
Map result = await NetUtil.post('/api/v1/mod/pub.flutter.current_activity_dialog', method: NetMethod.GET);
if (!EmptyUtil.isEmpty(result)) {
var modListData = result['data']['mod_list'][0]['data'];
if (!EmptyUtil.isEmpty(modListData)) {
Map<String, dynamic> da = Map<String, dynamic>.from(jsonDecode(modListData));
ActivityDialogModel model = ActivityDialogModel.fromJson(Map<String, dynamic>.from(da));
if(!EmptyUtil.isEmpty(model) && model.isOpen == '1' ) {
return await showCupertinoDialog(context: context, builder: (_) => ActivityDialog(model));
var dialogList=result['data']['mod_list'];
for(var item in dialogList){
var modListData = item['data'];
if (!EmptyUtil.isEmpty(modListData)) {
Map<String, dynamic> da = Map<String, dynamic>.from(jsonDecode(modListData));
ActivityDialogModel model = ActivityDialogModel.fromJson(Map<String, dynamic>.from(da));
if(!EmptyUtil.isEmpty(model) && model.isOpen == '1' ) {
return await showCupertinoDialog(context: context, builder: (_) => ActivityDialog(model));
}
}
}
}
@@ -36,7 +39,9 @@ class ActivityDialog extends StatelessWidget {
void _jumpTo(BuildContext context){
Navigator.maybePop(context);
if(!EmptyUtil.isEmpty(model)){
RouterUtil.route(model, model.toJson(), context);

RouterUtil.route(model, model.toJson(), context);

}
}



+ 90
- 0
lib/dialog/global_dialog/advertising_dialog/advertising_dialog.dart Переглянути файл

@@ -0,0 +1,90 @@
import 'dart:convert';

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

import 'package:zhiying_comm/zhiying_comm.dart';

import '../activity_dialog/activity_dialog_model.dart';
import 'advertising_model.dart';

///
/// 广告弹窗接口
///
class AdvertisingDialog extends StatelessWidget {
final AdvertisingDialogModel model;

const AdvertisingDialog(this.model, {Key key}) : super(key: key);

static Future show(BuildContext context) async {
try {
Map result = await NetUtil.post('/api/v1/app/push_dialog', method: NetMethod.GET);
if (!EmptyUtil.isEmpty(result)) {
var dialogList = result['data'];
for (var item in dialogList) {
if (!EmptyUtil.isEmpty(item)) {
AdvertisingDialogModel model = AdvertisingDialogModel.fromJson(item);
if (!EmptyUtil.isEmpty(model)) {
await Future.delayed(Duration(milliseconds: model?.interval*1000));
await showCupertinoDialog(context: context, builder: (_) => AdvertisingDialog(model));
}
}
}
}
} catch (e, s) {
Logger.error(e, s);
}
}

/// 跳转
void _jumpTo(BuildContext context) {
Navigator.maybePop(context);
RouterUtil.route(SkipModel.fromJson(json.decode(model?.skip)), json.decode(model?.skip), context);
}

@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.transparent,
body: Container(
width: double.infinity,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
/// 图片
GestureDetector(
onTap: () => _jumpTo(context),
behavior: HitTestBehavior.opaque,
child: Container(
// margin: const EdgeInsets.symmetric(horizontal: 40),
width: MediaQuery.of(context).size.width * 0.7,
child: CachedNetworkImage(
fadeInDuration: Duration(milliseconds: 0),
imageUrl: model?.image ?? '',
fit: BoxFit.fitWidth,
),
),
),

/// 关闭按钮
GestureDetector(
child: Container(
width: 30,
height: 30,
margin: EdgeInsets.only(top: 10),
child: Icon(
Icons.cancel,
color: Colors.white,
size: 32,
)),
onTap: () {
Navigator.pop(context);
},
)
],
),
),
);
}
}

+ 68
- 0
lib/dialog/global_dialog/advertising_dialog/advertising_model.dart Переглянути файл

@@ -0,0 +1,68 @@
class AdvertisingDialogModel {
int id;
int uid;
String name;
String conditionType;
String condition;
String position;
String image;
int interval;
String skip;
int type;
String popupTime;
int state;
String createAt;
String updateAt;

AdvertisingDialogModel(
{this.id,
this.uid,
this.name,
this.conditionType,
this.condition,
this.position,
this.image,
this.interval,
this.skip,
this.type,
this.popupTime,
this.state,
this.createAt,
this.updateAt});

AdvertisingDialogModel.fromJson(Map<String, dynamic> json) {
id = json['id'];
uid = json['uid'];
name = json['name'];
conditionType = json['condition_type'];
condition = json['condition'];
position = json['position'];
image = json['image'];
interval = json['interval'];
skip = json['skip'];
type = json['type'];
popupTime = json['popup_time'];
state = json['state'];
createAt = json['create_at'];
updateAt = json['update_at'];
}

Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['uid'] = this.uid;
data['name'] = this.name;
data['condition_type'] = this.conditionType;
data['condition'] = this.condition;
data['position'] = this.position;
data['image'] = this.image;
data['interval'] = this.interval;
data['skip'] = this.skip;
data['type'] = this.type;
data['popup_time'] = this.popupTime;
data['state'] = this.state;
data['create_at'] = this.createAt;
data['update_at'] = this.updateAt;
return data;
}
}

+ 1
- 1
lib/models/app_config_model.dart Переглянути файл

@@ -54,7 +54,7 @@ class AppConfigModel {
keys = json['keys'] != null ? new AppConfigKeyModel.fromJson(json['keys']) : null;
guideImage = json['guide_image'] != null ? new AppConfigGuideModel.fromJson(json['guide_image']) : null;
guideData = json['guide_data'] != null ? GuideData.fromJson(json['guide_data']) : null;
appStartDelay=json['app_start_delay'];
appStartDelay=json['app_start_delay']!=null?json['app_start_delay']:'0.5';
}

Map<String, dynamic> toJson() {


+ 2
- 2
lib/pages/goods_details_page/goods_details_page.dart Переглянути файл

@@ -315,7 +315,7 @@ class _FloatViewState extends State<FloatView> with TickerProviderStateMixin {
setState(() {});
});

// animationController.repeat(reverse: true);
animationController.repeat(reverse: true);

super.initState();
}
@@ -328,7 +328,7 @@ class _FloatViewState extends State<FloatView> with TickerProviderStateMixin {

@override
Widget build(BuildContext context) {
return Container();
// return Container();
return Row(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[


+ 2
- 1
lib/pages/home_page/home_page.dart Переглянути файл

@@ -16,6 +16,7 @@ import 'package:mobpush_plugin/mobpush_notify_message.dart';
import 'package:mobpush_plugin/mobpush_plugin.dart';
import 'package:provider/provider.dart';
import 'package:zhiying_base_widget/dialog/global_dialog/activity_dialog/activity_dialog.dart';
import 'package:zhiying_base_widget/dialog/global_dialog/advertising_dialog/advertising_dialog.dart';
import 'package:zhiying_base_widget/dialog/global_dialog/intellect_search_goods_dialog/intellect_create.dart';
import 'package:zhiying_base_widget/dialog/global_dialog/notification_setting_dialog/notification_setting_dialog.dart';
import 'package:zhiying_base_widget/dialog/global_dialog/policy_dialog/policy_dialog.dart';
@@ -271,7 +272,7 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver, Ticker
}

// 活动弹窗
await ActivityDialog.show(context);
await AdvertisingDialog.show(context);

await AppUpdateUtil.updateApp(context);



+ 1
- 1
lib/widgets/custom/notice/custom_notice_widget.dart Переглянути файл

@@ -81,7 +81,7 @@ class _CustomNoticeWidgetContainerState extends State<_CustomNoticeWidgetContain
right: ParseUtil.stringParseDouble(model?.leftRightMargin)),
padding: EdgeInsets.symmetric(horizontal:7.5, vertical: 7.5),
child: Container(
decoration: BoxDecoration(borderRadius: BorderRadius.circular(7.5), color: HexColor.fromHex('#F6F6F6')),
decoration: BoxDecoration(borderRadius: BorderRadius.circular(7.5), color: HexColor.fromHex(model?.outsideBgColor??'#F6F6F6')),
padding: const EdgeInsets.only(top: 8, bottom: 8, left: 12, right: 8),
width: double.infinity,
child: _getChildWidget(model),


+ 2
- 0
lib/widgets/custom/notice/model/custom_notice_model.dart Переглянути файл

@@ -19,6 +19,7 @@ class CustomNoticeModel {
String appNameImg;
String jumpImg;
String bg_color;
String outsideBgColor;
List<NoticeListStyle> listStyle;

CustomNoticeModel(
@@ -68,6 +69,7 @@ class CustomNoticeModel {
listStyle.add(new NoticeListStyle.fromJson(v));
});
}
outsideBgColor=json['outside_bg_color']!=null?json['outside_bg_color']:null;
}

Map<String, dynamic> toJson() {


+ 10
- 11
lib/widgets/custom/slide_banner/custom_slide_banner.dart Переглянути файл

@@ -119,23 +119,22 @@ class _CustomSlideBannerContainerState extends State<CustomSlideBannerContainer>
Column(
children: <Widget>[
Flexible(
flex: 6,
child: Container(
decoration: BoxDecoration(
color: size > 1 ? HexColor.fromHex(datas?.bgColor??"#00000000") : Colors.transparent,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(double.tryParse(datas?.topLeftRadius)??0),
topRight: Radius.circular(double.tryParse(datas?.topRightRadius)??0),
bottomRight: Radius.circular(double.tryParse(datas?.bottomRightRadius)??0),
bottomLeft: Radius.circular(double.tryParse(datas?.bottomLeftRadius)??0)
)
),
width: double.infinity,
height: double.infinity,
color: size > 1 ? HexColor.fromHex(datas?.bgColor2??"#00000000") : Colors.transparent,
// color: Colors.yellow,
),
),
Flexible(
flex: 4,
child: Container(
height: double.infinity,
width: double.infinity,
color: size > 1 ? HexColor.fromHex(datas?.bgColor??"#FFFFFF") : Colors.transparent,
// color: Colors.yellow,
),
)
],
),
Padding(


+ 9
- 0
lib/widgets/custom/slide_banner/model/custom_slide_banner_model.dart Переглянути файл

@@ -21,6 +21,11 @@ class CustomSlideBannerModel {
String bgColor2;
List<IndexCarouselList> indexCarouselList;
int moduleKeyId;
String topLeftRadius;
String topRightRadius;
String bottomLeftRadius;
String bottomRightRadius;


CustomSlideBannerModel({
this.name,
@@ -64,6 +69,10 @@ class CustomSlideBannerModel {
leftRightMargin = json['left_right_margin'];
bgColor=json['bg_color'];
bgColor2=json['bg_color2'];
topLeftRadius=json['top_left_radius'];
topRightRadius=json['top_right_radius'];
bottomRightRadius=json['bottom_right_radius'];
bottomLeftRadius=json['bottom_left_radius'];
if (json['index_carousel_list'] != null) {
indexCarouselList = new List<IndexCarouselList>();
json['index_carousel_list'].forEach((v) {


+ 11
- 2
lib/widgets/share/share_alert.dart Переглянути файл

@@ -1,3 +1,4 @@
import 'dart:async';
import 'dart:convert';
import 'dart:io';
import 'dart:ui';
@@ -233,6 +234,10 @@ class _ShareAlertContentState extends State<_ShareAlertContent> {
}

Loading.show(context);
Timer(Duration(milliseconds: 2000),(){
Loading.dismiss();
});

SSDKMap params;
if (widget.model.poster != null) {
String path = await _savePoster();
@@ -263,11 +268,15 @@ class _ShareAlertContentState extends State<_ShareAlertContent> {
}else if(widget?.model?.title!=null||widget.model?.content!=null){
type=SSDKContentTypes.text;
}
if(plateform==ShareSDKPlatforms.qZone){
widget?.model?.title=null;
type=SSDKContentTypes.message;
}

params = SSDKMap()
..setGeneral(
widget.model?.title ?? '123',
widget.model?.content ?? '',
widget.model?.title ?? '',
widget?.model?.content??'',
Platform.isIOS ? widget.model.image : null,
Platform.isAndroid ? widget?.model?.image?.first : null,
null,


+ 3
- 1
lib/zhiying_base_widget.dart Переглянути файл

@@ -1,4 +1,6 @@
library zhiying_base_widget;

export 'dialog/loading/loading.dart';
export 'package:flutter_swiper/flutter_swiper.dart';
export 'package:flutter_swiper/flutter_swiper.dart';
export 'package:zhiying_base_widget/pages/main_page/model/background_model.dart';
export 'package:zhiying_base_widget/pages/custom_page/bloc/background_bloc.dart';

Завантаження…
Відмінити
Зберегти