瀏覽代碼

搜索弹窗适配

tags/0.0.1
Weller 4 年之前
父節點
當前提交
e72d0c4503
共有 2 個文件被更改,包括 29 次插入27 次删除
  1. +15
    -13
      lib/dialog/global_dialog/intellect_search_goods_dialog/intellect_search_goods_dialog.dart
  2. +14
    -14
      lib/pages/main_page/main_page.dart

+ 15
- 13
lib/dialog/global_dialog/intellect_search_goods_dialog/intellect_search_goods_dialog.dart 查看文件

@@ -8,7 +8,6 @@ import 'package:flutter_alibc/alibc_const_key.dart';
import 'package:flutter_alibc/alibc_model.dart';
import 'package:flutter_alibc/flutter_alibc.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:provider/provider.dart';
import 'package:zhiying_base_widget/dialog/global_dialog/intellect_search_goods_dialog/model/has_goods_dialog_style_model.dart';
import 'package:zhiying_base_widget/dialog/global_dialog/intellect_search_goods_dialog/model/intellect_dialog_data_model.dart';
import 'package:zhiying_comm/zhiying_comm.dart';
@@ -26,7 +25,6 @@ class IntellectSearchGoodsDialog extends StatefulWidget {
class _IntellectSearchGoodsDialogState
extends State<IntellectSearchGoodsDialog> {
HasGoodsDialogStyleModel _styleModel;
UserInfoModel _userInfo;

@override
void initState() {
@@ -36,7 +34,6 @@ class _IntellectSearchGoodsDialogState

@override
Widget build(BuildContext context) {
_userInfo = Provider.of<UserInfoNotifier>(context).userInfo;
return Scaffold(
backgroundColor: Colors.transparent,
body: InkWell(
@@ -240,15 +237,19 @@ class _IntellectSearchGoodsDialogState
"")),
),
),
Text(
(num.tryParse(widget?.model?.price ?? "0") -
num.tryParse(widget?.model?.couponPrice ?? "0"))
.toString() ??
"",
style: TextStyle(
fontSize: 32.sp,
color: HexColor.fromHex(
_styleModel?.moduleList?.couponAfterPrice?.fontColor),
Expanded(
child: Text(
(num.tryParse(widget?.model?.price ?? "0") -
num.tryParse(
widget?.model?.couponPrice ?? "0"))
.toStringAsFixed(2) ??
"",
maxLines: 1,
style: TextStyle(
fontSize: 32.sp,
color: HexColor.fromHex(_styleModel
?.moduleList?.couponAfterPrice?.fontColor),
),
),
)
],
@@ -346,7 +347,8 @@ class _IntellectSearchGoodsDialogState

void openUrl() async {
///跳转购买
if (_userInfo?.token == null || _userInfo.token == '') {
UserInfoModel userInfo = UserInfoNotifier.staitcUserInfo;
if (userInfo?.token == null || userInfo.token == '') {
print('need login...');
RouterUtil.goLogin(context);
return;


+ 14
- 14
lib/pages/main_page/main_page.dart 查看文件

@@ -5,12 +5,9 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:zhiying_base_widget/dialog/global_dialog/intellect_search_goods_dialog/intellect_create.dart';
import 'package:zhiying_base_widget/dialog/global_dialog/intellect_search_goods_dialog/intellect_search_goods_dialog.dart';
import 'package:zhiying_base_widget/dialog/global_dialog/intellect_search_goods_dialog/intellect_search_no_goods_dialog.dart';
import 'package:zhiying_base_widget/pages/main_page/main_page_bloc.dart';
import 'package:zhiying_base_widget/pages/main_page/notifier/main_page_bg_notifier.dart';
import 'package:zhiying_base_widget/pages/main_page/notifier/main_page_notifier.dart';
import 'package:zhiying_base_widget/utils/contants.dart';
import 'package:zhiying_base_widget/widgets/home/home_auth/home_auth.dart';
import 'package:zhiying_base_widget/widgets/others/mine_header_bg_widget.dart';
import 'package:zhiying_base_widget/widgets/refresh/refresh_header/refresh_header.dart';
@@ -20,7 +17,8 @@ import 'package:zhiying_comm/zhiying_comm.dart';
class MainPage extends StatefulWidget {
final Map<String, dynamic> data;

MainPage(this.data, {
MainPage(
this.data, {
Key key,
}) : super(key: key);

@@ -59,7 +57,7 @@ class _MainPageContainerState extends State<_MainPageContainer>
ScrollController _controller = ScrollController();
MainPageBloc _bloc;
RefreshController _refreshController =
RefreshController(initialRefresh: false);
RefreshController(initialRefresh: false);

Widget _floatWidget;

@@ -81,7 +79,12 @@ class _MainPageContainerState extends State<_MainPageContainer>
@override
void didChangeAppLifecycleState(AppLifecycleState state) async {
///智能粘贴板
IntellectCreate.checkAndCreate(state, context);
String indentifier = widget.data['skip_identifier'];
if (indentifier == 'pub.flutter.index') {
// 只在首页弹窗
IntellectCreate.checkAndCreate(state, context);
}

super.didChangeAppLifecycleState(state);
}

@@ -122,10 +125,7 @@ class _MainPageContainerState extends State<_MainPageContainer>

@override
Widget build(BuildContext context) {
double top = MediaQueryData
.fromWindow(window)
.padding
.top;
double top = MediaQueryData.fromWindow(window).padding.top;
return StreamBuilder<List<Map<String, dynamic>>>(
stream: _bloc.outData,
builder: (BuildContext context, AsyncSnapshot snapshot) {
@@ -135,7 +135,7 @@ class _MainPageContainerState extends State<_MainPageContainer>
backgroundColor: Color(0xfff9f9f9),
floatingActionButton: _floatWidget,
floatingActionButtonLocation:
FloatingActionButtonLocation.centerDocked,
FloatingActionButtonLocation.centerDocked,
body: MediaQuery.removePadding(
removeTop: true,
context: context,
@@ -169,12 +169,12 @@ class _MainPageContainerState extends State<_MainPageContainer>
});
}

List<Widget> _createContent(BuildContext context,
List<Map<String, dynamic>> datas) {
List<Widget> _createContent(
BuildContext context, List<Map<String, dynamic>> datas) {
List<Widget> list = List();
for (int i = 0; i < datas.length; i++) {
WidgetModel item =
WidgetModel.fromJson(Map<String, dynamic>.from(datas[i]));
WidgetModel.fromJson(Map<String, dynamic>.from(datas[i]));

print('item.modName ${item.modName}');
if (item.modName == 'index_taobao_auth_tip') {


Loading…
取消
儲存