@@ -25,8 +25,8 @@ class AdvertisingDialog extends StatelessWidget { | |||
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)); | |||
await Future.delayed(Duration(milliseconds: (model?.interval ?? 0) * 1000 * 60)); | |||
} | |||
} | |||
} | |||
@@ -1,9 +1,11 @@ | |||
import 'dart:async'; | |||
import 'dart:convert'; | |||
import 'dart:io'; | |||
import 'package:flutter/cupertino.dart'; | |||
import 'package:flutter/material.dart'; | |||
import 'package:flutter/services.dart'; | |||
import 'package:flutter_clipboard_plugin/flutter_clipboard_plugin.dart'; | |||
import 'package:zhiying_base_widget/dialog/global_dialog/intellect_search_goods_dialog/model/Intellect_search_set_model.dart'; | |||
import 'package:zhiying_base_widget/dialog/global_dialog/intellect_search_goods_dialog/model/intellect_dialog_data_model.dart'; | |||
import 'package:zhiying_base_widget/utils/contants.dart'; | |||
@@ -30,8 +32,7 @@ class IntellectCreate { | |||
await _requestSetData(context); | |||
} catch (e, s) { | |||
isRequest = false; | |||
print(e); | |||
print(s); | |||
Logger.error(e, s); | |||
} | |||
} | |||
// Timer(Duration(milliseconds: 500), () async { | |||
@@ -119,8 +120,7 @@ class IntellectCreate { | |||
///检查字段是否被监听 | |||
static void validate(BuildContext context, IntellectSearchSetModel setModel) async { | |||
//获取粘贴板的文字 | |||
ClipboardData data = await Clipboard.getData(Clipboard.kTextPlain); | |||
String content = data?.text?.trim() ?? ""; | |||
String content = await FlutterClipboardPlugin.getData; | |||
///粘贴版的文字如果是空直接跳出不检索 | |||
if (content == null || content.length == 0) { | |||
@@ -1,6 +1,7 @@ | |||
import 'dart:convert'; | |||
import 'package:flutter/material.dart'; | |||
import 'package:flutter/services.dart'; | |||
import 'package:flutter_clipboard_plugin/flutter_clipboard_plugin.dart'; | |||
import 'package:zhiying_base_widget/dialog/global_dialog/intellect_search_goods_dialog/model/intellect_dialog_data_model.dart'; | |||
import 'package:zhiying_base_widget/dialog/global_dialog/intellect_search_goods_dialog/model/no_goods_dialog_style_model.dart'; | |||
import 'package:cached_network_image/cached_network_image.dart'; | |||
@@ -34,9 +35,10 @@ class _IntellectSearchNoGoodsDialogState extends State<IntellectSearchNoGoodsDia | |||
///获取粘贴板内容 | |||
_getClipBoardData() async { | |||
ClipboardData data = await Clipboard.getData(Clipboard.kTextPlain); | |||
_textEditingController.text = data.text.trim(); | |||
searchText = data.text.trim(); | |||
// ClipboardData data = await Clipboard.getData(Clipboard.kTextPlain); | |||
String result = await FlutterClipboardPlugin.getData; | |||
_textEditingController.text = result; | |||
searchText = result; | |||
requestStyle(); | |||
setState(() {}); | |||
} | |||
@@ -2,14 +2,11 @@ import 'dart:convert'; | |||
import 'package:flutter/cupertino.dart'; | |||
import 'package:flutter/services.dart'; | |||
import 'package:pull_to_refresh/pull_to_refresh.dart'; | |||
import 'package:tab_indicator_styler/tab_indicator_styler.dart'; | |||
import 'package:zhiying_base_widget/pages/custom_page/custom_item_page.dart'; | |||
import 'package:zhiying_base_widget/pages/main_page/model/background_model.dart'; | |||
import 'package:zhiying_base_widget/pages/main_page/notifier/main_page_bg_notifier.dart'; | |||
import 'package:zhiying_base_widget/widgets/custom/search/custom_search_widget.dart'; | |||
import 'package:zhiying_base_widget/widgets/empty/empty_widget.dart'; | |||
import 'package:zhiying_base_widget/widgets/others/mine_header_bg_widget.dart'; | |||
import 'package:zhiying_comm/zhiying_comm.dart'; | |||
import 'package:flutter/material.dart'; | |||
import 'package:provider/provider.dart'; | |||
@@ -19,8 +16,8 @@ import 'bloc/custom_page_bloc.dart'; | |||
import 'bloc/custom_page_state.dart'; | |||
import 'bloc/custom_page_event.dart'; | |||
import 'bloc/custom_page_repository.dart'; | |||
import 'package:zhiying_base_widget/widgets/search/widget/my_tab.dart'; | |||
import 'dart:ui'; | |||
import 'package:fluttertoast/fluttertoast.dart'; | |||
/// | |||
/// 通用模块页面 | |||
@@ -258,24 +255,24 @@ class __CommonPageContainerState extends State<_CommonPageContainer> with Single | |||
String parentTitle = !EmptyUtil.isEmpty(widget?.data) ? widget?.data['title'] ?? '' : ''; | |||
_isHasAppbar = true; | |||
return AppBar( | |||
backgroundColor: HexColor.fromHex(null != data ? data['app_bar_bg_color'] ?? '#FFFFFF' : '#FFFFFF'), | |||
backgroundColor: HexColor.fromHex(!EmptyUtil.isEmpty(data) ? data['app_bar_bg_color'] ?? '#FFFFFF' : '#FFFFFF'), | |||
brightness: Brightness.light, | |||
leading: IconButton( | |||
leading: Navigator.canPop(context) ? IconButton( | |||
icon: Icon( | |||
Icons.arrow_back_ios, | |||
size: 22, | |||
color: HexColor.fromHex('#333333'), | |||
color: HexColor.fromHex(!EmptyUtil.isEmpty(data) ? data['app_bar_name_color'] ?? '#333333' : '#333333'), | |||
), | |||
onPressed: () => Navigator.maybePop(context), | |||
), | |||
) : null, | |||
title: Text( | |||
null != data && data.containsKey('app_bar_name') | |||
? data['app_bar_name'] != '自定义页面' | |||
!EmptyUtil.isEmpty(data) && data.containsKey('app_bar_name') | |||
// ? data['app_bar_name'] != '自定义页面' | |||
? data['app_bar_name'] | |||
: parentTitle | |||
// : parentTitle | |||
: parentTitle, | |||
style: TextStyle( | |||
color: HexColor.fromHex(null != data ? data['app_bar_name_color'] ?? '#333333' : '#333333'), | |||
color: HexColor.fromHex(!EmptyUtil.isEmpty(data) ? data['app_bar_name_color'] ?? '#333333' : '#333333'), | |||
fontSize: 16, | |||
fontWeight: FontWeight.bold, | |||
), | |||
@@ -314,6 +311,15 @@ class __CommonPageContainerState extends State<_CommonPageContainer> with Single | |||
// 2、导航栏开启的情况 | |||
if (listStyle.length > 0) { | |||
// 获取分类类型,如果第一位type等于imageAndText说明是带有小图标的 | |||
bool haveIcon = false; | |||
try { | |||
haveIcon = listStyle[0]['type']?.toString() == 'imageAndText'; | |||
} catch (e, s){ | |||
Logger.error(e, s); | |||
} | |||
// tabContorller 初始化 | |||
if (null == _tabController || _tabController.length != listStyle.length) { | |||
_tabController = new TabController(length: listStyle.length, vsync: this); | |||
@@ -321,6 +327,7 @@ class __CommonPageContainerState extends State<_CommonPageContainer> with Single | |||
result.add(Container( | |||
height: 40, | |||
padding: const EdgeInsets.only(bottom: 5), | |||
width: double.infinity, | |||
color: HexColor.fromHex(data['bg_color']), | |||
child: TabBar( | |||
@@ -340,7 +347,18 @@ class __CommonPageContainerState extends State<_CommonPageContainer> with Single | |||
height: 2.5, | |||
horizontalPadding: 5, | |||
), | |||
tabs: listStyle.map((e) => Text(e['name'])).toList(), | |||
// 不带图标 | |||
tabs: !haveIcon ? listStyle.map((e) => Text(e['name'])).toList() : | |||
// 带图标 | |||
listStyle.map((item) { | |||
return MyTab( | |||
icon: CachedNetworkImage( | |||
imageUrl: item['choose_image_url'] ?? '', | |||
width: 14, | |||
), | |||
text: item['name'], | |||
); | |||
}).toList() | |||
), | |||
)); | |||
@@ -372,6 +390,7 @@ class __CommonPageContainerState extends State<_CommonPageContainer> with Single | |||
return result; | |||
} | |||
/// 背景颜色 | |||
_buildBackground(BackgroundModel backgroundModel) { | |||
if (backgroundModel != null) { | |||
var headerBg = backgroundModel.headerBg; | |||
@@ -422,7 +441,6 @@ class __CommonPageContainerState extends State<_CommonPageContainer> with Single | |||
} | |||
@override | |||
// TODO: implement wantKeepAlive | |||
bool get wantKeepAlive => true; | |||
} | |||
@@ -4,6 +4,8 @@ import 'dart:convert'; | |||
import 'dart:io'; | |||
import 'package:cached_network_image/cached_network_image.dart'; | |||
import 'package:connectivity/connectivity.dart'; | |||
import 'package:convex_bottom_bar/convex_bottom_bar.dart'; | |||
import 'package:flutter/cupertino.dart'; | |||
import 'package:flutter/foundation.dart'; | |||
import 'package:flutter/material.dart'; | |||
@@ -289,6 +291,11 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver, Ticker | |||
items: items); | |||
} | |||
Widget createBottomNavigationBarNew(List<Map<String, dynamic>> tabs) { | |||
return ConvexAppBar(items: null, initialActiveIndex: _currentIndex, style: TabStyle.titled,); | |||
} | |||
Future<bool> _checkLimit(BaseTabModel model) async { | |||
if (model.requiredLogin == '1') { | |||
UserInfoModel user = await Provider.of<UserInfoNotifier>(context, listen: false).getUserInfoModel(); | |||
@@ -319,6 +326,7 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver, Ticker | |||
// 活动弹窗 | |||
await AdvertisingDialog.show(context); | |||
// 检查app更新 | |||
await AppUpdateUtil.updateApp(context); | |||
IntellectCreate.checkAndCreateFirst(context); | |||
@@ -133,7 +133,7 @@ class _TeamPageContainerState extends State<_TeamPageContainer> { | |||
SliverPersistentHeader( | |||
delegate: new _SliverTabBarDelegate( | |||
tabBar: TabBar( | |||
isScrollable: false, | |||
isScrollable: (styleModel?.userLvTabs?.length ?? 0) <= 4 ? false : true, | |||
labelStyle: TextStyle(fontWeight: FontWeight.bold, fontSize: 13), | |||
unselectedLabelStyle: TextStyle(fontSize: 13), | |||
indicator: MaterialIndicator( | |||
@@ -143,7 +143,7 @@ class _TeamPageContainerState extends State<_TeamPageContainer> { | |||
bottomLeftRadius: 8, | |||
bottomRightRadius: 8, | |||
color: HexColor.fromHex(styleModel?.userLvTabsLineColor ?? '#F94B47'), | |||
horizontalPadding: 30, | |||
horizontalPadding: (styleModel?.userLvTabs?.length ?? 0) <= 4 ? 30 : 20, | |||
), | |||
controller: _controller, | |||
// tabs: tabTitle.map((f) => Tab(text: f)).toList(), | |||
@@ -70,7 +70,111 @@ class CustomSearchWidget extends StatelessWidget { | |||
/// 左1右1图标 | |||
Widget _buildStyle3Widget(BuildContext context) { | |||
return Container(); | |||
return Row( | |||
mainAxisAlignment: MainAxisAlignment.center, | |||
children: [ | |||
GestureDetector( | |||
onTap: () => _onClickListener(context, model?.listStyle?.rightCss), | |||
child: CachedNetworkImage( | |||
width: 30, | |||
height: 30, | |||
imageUrl: model?.listStyle?.rightCss?.image ?? '', | |||
)), | |||
// 图标1 | |||
SizedBox(width: 10), | |||
// 中间 | |||
Expanded( | |||
child: GestureDetector( | |||
onTap: () => _onClickListener(context, model?.listStyle?.searchCss), | |||
behavior: HitTestBehavior.opaque, | |||
child: Container( | |||
// height: 30, | |||
width: double.infinity, | |||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 9), | |||
decoration: BoxDecoration(borderRadius: BorderRadius.circular(60 / 2), color: HexColor.fromHex(model?.listStyle?.searchCss?.bgColor)), | |||
child: Row( | |||
children: <Widget>[ | |||
CachedNetworkImage( | |||
width: 15, | |||
height: 15, | |||
imageUrl: model?.listStyle?.searchCss?.image ?? '', | |||
), | |||
SizedBox(width: 4), | |||
Text(model?.listStyle?.searchCss?.text ?? '输入搜索内容,领券省钱', style: TextStyle(fontSize: 13, color: HexColor.fromHex(model?.listStyle?.searchCss?.textColor??"#FFFFFF"))) | |||
], | |||
), | |||
), | |||
)), | |||
SizedBox(width: 10), | |||
// 图标2 | |||
GestureDetector( | |||
onTap: () => _onClickListener(context, model?.listStyle?.rightCss), | |||
child: CachedNetworkImage( | |||
width: 30, | |||
height: 30, | |||
imageUrl: model?.listStyle?.rightCss?.image ?? '', | |||
)), | |||
], | |||
); | |||
} | |||
/// 左1右2图标 | |||
Widget _buildStyle5Widget(BuildContext context) { | |||
return Row( | |||
mainAxisAlignment: MainAxisAlignment.center, | |||
children: [ | |||
GestureDetector( | |||
onTap: () => _onClickListener(context, model?.listStyle?.rightCss), | |||
child: CachedNetworkImage( | |||
width: 30, | |||
height: 30, | |||
imageUrl: model?.listStyle?.rightCss?.image ?? '', | |||
)), | |||
// 图标1 | |||
SizedBox(width: 10), | |||
// 中间 | |||
Expanded( | |||
child: GestureDetector( | |||
onTap: () => _onClickListener(context, model?.listStyle?.searchCss), | |||
behavior: HitTestBehavior.opaque, | |||
child: Container( | |||
// height: 30, | |||
width: double.infinity, | |||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 9), | |||
decoration: BoxDecoration(borderRadius: BorderRadius.circular(60 / 2), color: HexColor.fromHex(model?.listStyle?.searchCss?.bgColor)), | |||
child: Row( | |||
children: <Widget>[ | |||
CachedNetworkImage( | |||
width: 15, | |||
height: 15, | |||
imageUrl: model?.listStyle?.searchCss?.image ?? '', | |||
), | |||
SizedBox(width: 4), | |||
Text(model?.listStyle?.searchCss?.text ?? '输入搜索内容,领券省钱', style: TextStyle(fontSize: 13, color: HexColor.fromHex(model?.listStyle?.searchCss?.textColor??"#FFFFFF"))) | |||
], | |||
), | |||
), | |||
)), | |||
SizedBox(width: 10), | |||
// 图标2 | |||
GestureDetector( | |||
onTap: () => _onClickListener(context, model?.listStyle?.rightCss), | |||
child: CachedNetworkImage( | |||
width: 30, | |||
height: 30, | |||
imageUrl: model?.listStyle?.rightCss?.image ?? '', | |||
)), | |||
SizedBox(width: 10), | |||
// 图标2 | |||
GestureDetector( | |||
onTap: () => _onClickListener(context, model?.listStyle?.rightCss), | |||
child: CachedNetworkImage( | |||
width: 30, | |||
height: 30, | |||
imageUrl: model?.listStyle?.rightCss?.image ?? '', | |||
)), | |||
], | |||
); | |||
} | |||
/// 右按钮 | |||
@@ -94,8 +198,8 @@ class CustomSearchWidget extends StatelessWidget { | |||
child: Row( | |||
children: <Widget>[ | |||
CachedNetworkImage( | |||
width: 13, | |||
height: 13, | |||
width: 15, | |||
height: 15, | |||
imageUrl: model?.listStyle?.searchCss?.image ?? '', | |||
), | |||
SizedBox(width: 4), | |||
@@ -14,6 +14,7 @@ class GoodsDetailsAppBarWidget extends StatefulWidget { | |||
GoodsDetailsAppBarWidget(this.data, {Key key}) : super(key: key){ | |||
try{ | |||
model = GoodsDetailsAppBarModel.fromJson(jsonDecode(data['data'])); | |||
Logger.log('商品详情页面数据 = ${model.toJson()}'); | |||
}catch(e, s){ | |||
Logger.error(e, s); | |||
} | |||
@@ -54,6 +55,8 @@ class _GoodsDetailsAppBarWidgetState extends State<GoodsDetailsAppBarWidget> { | |||
@override | |||
Widget build(BuildContext context) { | |||
_endTextColor = HexColor.fromHex(widget?.model?.appBarNameColor ?? '#FFFFFF' ); | |||
_endBgColor = HexColor.fromHex(widget?.model?.appBarBgColor ?? '#FF4242'); | |||
// Logger.log('^-^'); | |||
return Container( | |||
width: double.infinity, | |||
@@ -127,7 +127,7 @@ class _MineDataWidgetState extends State<MineDataWidget> { | |||
), | |||
), | |||
Text( | |||
widget?.profile?.gridViews[0]?.value ?? "¥0", | |||
EmptyUtil.isEmpty(widget?.profile?.gridViews) ? '¥0' : widget?.profile?.gridViews[0]?.value ?? "¥0", | |||
style: TextStyle( | |||
fontSize: 18, | |||
fontWeight: FontWeight.w800, | |||
@@ -158,8 +158,8 @@ class _MineDataWidgetState extends State<MineDataWidget> { | |||
), | |||
Center( | |||
child: Text( | |||
_style.cashBtn.btnText, | |||
style: TextStyle(fontSize: 12, color: HexColor.fromHex(_style.cashBtn.btnTextColor)), | |||
_style?.cashBtn?.btnText ?? '', | |||
style: TextStyle(fontSize: 12, color: HexColor.fromHex(_style?.cashBtn?.btnTextColor)), | |||
), | |||
) | |||
], | |||
@@ -167,7 +167,7 @@ class _MineDataWidgetState extends State<MineDataWidget> { | |||
), | |||
behavior: HitTestBehavior.opaque, | |||
onTap: () { | |||
RouterUtil.route(_style.cashBtn, _style.cashBtn.toJson(), context); | |||
RouterUtil.route(_style?.cashBtn, _style?.cashBtn?.toJson(), context); | |||
}, | |||
) | |||
], | |||
@@ -60,8 +60,8 @@ dependencies: | |||
permission_handler_platform_interface: "2.0.1" | |||
flutter_user_agent: ^1.2.2 | |||
# 特效底部 | |||
convex_bottom_bar: ^2.7.1+2 | |||
dev_dependencies: | |||
flutter_test: | |||