From 46dd3ed141fe3cb469b8b298a48d4cf5056cc555 Mon Sep 17 00:00:00 2001 From: w-R <953969641@qq.com> Date: Wed, 10 Nov 2021 18:29:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../community_view/community_dynamic.dart | 9 + lib/home/home_view/founder_store.dart | 2 +- lib/home/huixiang_brand_page.dart | 9 +- lib/home/huixiang_view/origin_info.dart | 157 +++++++++--------- 4 files changed, 95 insertions(+), 82 deletions(-) diff --git a/lib/community/community_view/community_dynamic.dart b/lib/community/community_view/community_dynamic.dart index 37ca1381..a24ac327 100644 --- a/lib/community/community_view/community_dynamic.dart +++ b/lib/community/community_view/community_dynamic.dart @@ -284,12 +284,18 @@ class _CommunityDynamic extends State { space: 4.w, leftImage: "assets/svg/liulanliang.svg", iconSize: 16, + textStyle: TextStyle( + fontSize: 14.sp, + ), ), IconText( "${widget.comment.comments ?? 0}", space: 4.w, leftImage: "assets/svg/pinglun.svg", iconSize: 16, + textStyle: TextStyle( + fontSize: 14.sp, + ), ), GestureDetector( onTap: () {}, @@ -298,6 +304,9 @@ class _CommunityDynamic extends State { space: 4.w, leftImage: "assets/svg/xihuan.svg", iconSize: 16, + textStyle: TextStyle( + fontSize: 14.sp, + ), ), ), ], diff --git a/lib/home/home_view/founder_store.dart b/lib/home/home_view/founder_store.dart index 503e6fd1..43fa8663 100644 --- a/lib/home/home_view/founder_store.dart +++ b/lib/home/home_view/founder_store.dart @@ -63,7 +63,7 @@ class _FounderStore extends State { widget.founder != null ? widget.founder.imgUrl : "", aspectRatio: 2, radius: BorderRadius.circular(4.w), - fit: BoxFit.cover, + // fit: BoxFit.cover, errorSrc: "assets/image/default_2_1.png", fadeSrc: "assets/image/default_2_1.png", ), diff --git a/lib/home/huixiang_brand_page.dart b/lib/home/huixiang_brand_page.dart index 24849ed2..2595066d 100644 --- a/lib/home/huixiang_brand_page.dart +++ b/lib/home/huixiang_brand_page.dart @@ -11,6 +11,7 @@ import 'package:huixiang/retrofit/data/banner.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/brand.dart'; import 'package:huixiang/retrofit/data/brand_data.dart'; +import 'package:huixiang/retrofit/data/founder.dart'; import 'package:huixiang/retrofit/data/page.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/utils/event_type.dart'; @@ -40,8 +41,9 @@ class _BrandPage extends State BrandData brandData; List globaKeys = []; List bannerData = []; + Founder founder; - Future queryHome() async { + queryHome() async { EasyLoading.show(status: S.current.zhengzaijiazai); final SharedPreferences value = await SharedPreferences.getInstance(); @@ -79,6 +81,7 @@ class _BrandPage extends State brands.addAll((brand.data["brandList"] as List) .map((e) => Brand.fromJson(e)) .toList()); + founder = Founder.fromJson(brand.data["founder"]); brands.forEach((element) { globaKeys.add(GlobalKey()); }); @@ -93,14 +96,12 @@ class _BrandPage extends State @override void initState() { super.initState(); - eventBus.on().listen((event) { print("object: BrandPage"); if (event.type < 3) { setState(() {}); } }); - queryHome(); } @@ -163,7 +164,7 @@ class _BrandPage extends State HuiXiangBanner(bannerData), ///公司信息 - OriginInfo(brandData), + OriginInfo(founder), StoreTitleTab( brands, diff --git a/lib/home/huixiang_view/origin_info.dart b/lib/home/huixiang_view/origin_info.dart index ed16fa54..1b4a114d 100644 --- a/lib/home/huixiang_view/origin_info.dart +++ b/lib/home/huixiang_view/origin_info.dart @@ -1,15 +1,16 @@ import 'package:flutter/material.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/brand_data.dart'; +import 'package:huixiang/retrofit/data/founder.dart'; import 'package:huixiang/utils/MyPainter.dart'; import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/view_widget/custom_image.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; class OriginInfo extends StatefulWidget { - final BrandData brandData; + final Founder founder; - OriginInfo(this.brandData); + OriginInfo(this.founder); @override State createState() { @@ -50,9 +51,9 @@ class _OriginInfo extends State { children: [ ClipOval( child: MImage( - widget.brandData == null + widget.founder == null ? "" - : widget.brandData.originAvatar, + : widget.founder.imgUrl, fit: BoxFit.cover, width: 60, height: 60, @@ -73,9 +74,9 @@ class _OriginInfo extends State { TextSpan( children: [ TextSpan( - text: widget.brandData == null + text: widget.founder == null ? "" - : widget.brandData.originator, + : widget.founder.name, style: TextStyle( fontWeight: FontWeight.bold, fontSize: 14.sp, @@ -94,9 +95,9 @@ class _OriginInfo extends State { textDirection: TextDirection.ltr, ), Text( - widget.brandData == null + widget.founder == null ? "" - : widget.brandData.originDesc, + : widget.founder.description, overflow: isShowMore ? TextOverflow.visible : TextOverflow.ellipsis, @@ -143,78 +144,80 @@ class _OriginInfo extends State { ], ), ), - SizedBox( - height: 40.h, - ), - InkWell( - onTap: () { - Navigator.of(context).pushNamed('/router/founder_story_page'); - }, - child: Text( - widget.brandData == null ? "" : widget.brandData.company, - style: TextStyle( - fontSize: 16.sp, - fontWeight: FontWeight.bold, - color: Colors.black, - ), - ), - ), - SizedBox( - height: 20.h, - ), - InkWell( - onTap: () { - Navigator.of(context).pushNamed('/router/founder_story_page'); - }, - child: Text( - widget.brandData == null ? "" : widget.brandData.companyDesc, - textAlign: TextAlign.justify, - style: TextStyle( - fontSize: 12.sp, - color: Color(0xFF353535), + // InkWell( + // onTap: () { + // Navigator.of(context).pushNamed('/router/founder_story_page'); + // }, + // child: Text( + // // widget.founder == null ? "" : widget.founder.company, + // "", + // style: TextStyle( + // fontSize: 16.sp, + // fontWeight: FontWeight.bold, + // color: Colors.black, + // ), + // ), + // ), + // SizedBox( + // height: 20.h, + // ), + // InkWell( + // onTap: () { + // Navigator.of(context).pushNamed('/router/founder_story_page'); + // }, + // child: Text( + // // widget.brandData == null ? "" : widget.brandData.companyDesc, + // "", + // textAlign: TextAlign.justify, + // style: TextStyle( + // fontSize: 12.sp, + // color: Color(0xFF353535), + // ), + // ), + // ), + // SizedBox( + // height: 40.h, + // ), + // Text( + // S.of(context).linian, + // style: TextStyle( + // fontSize: 16.sp, + // fontWeight: FontWeight.bold, + // color: Colors.black, + // ), + // ), + // SizedBox( + // height: 20.h, + // ), + Container( + margin: EdgeInsets.only(top:30), + child:InkWell( + onTap: () { + Navigator.of(context).pushNamed('/router/founder_story_page'); + }, + child: Column( + children: [ + Row( + children: [ + _ideaWidget("友爱", "assets/image/icon_idea_ya.png"), + _ideaWidget("纯净", "assets/image/icon_idea_cj.png"), + _ideaWidget("健康", "assets/image/icon_idea_jk.png"), + ], + ), + SizedBox( + height: 18.h, + ), + Row( + children: [ + _ideaWidget("有机", "assets/image/icon_idea_yj.png"), + _ideaWidget("环保", "assets/image/icon_idea_hb.png"), + _ideaWidget("智慧", "assets/image/icon_idea_zh.png"), + ], + ), + ], ), ), ), - SizedBox( - height: 40.h, - ), - Text( - S.of(context).linian, - style: TextStyle( - fontSize: 16.sp, - fontWeight: FontWeight.bold, - color: Colors.black, - ), - ), - SizedBox( - height: 20.h, - ), - InkWell( - onTap: () { - Navigator.of(context).pushNamed('/router/founder_story_page'); - }, - child: Column( - children: [ - Row( - children: [ - _ideaWidget("友爱", "assets/image/icon_idea_ya.png"), - _ideaWidget("纯净", "assets/image/icon_idea_cj.png"), - _ideaWidget("健康", "assets/image/icon_idea_jk.png"), - ], - ), - SizedBox( - height: 18.h, - ), - Row( - children: [ - _ideaWidget("有机", "assets/image/icon_idea_yj.png"), - _ideaWidget("环保", "assets/image/icon_idea_hb.png"), - _ideaWidget("智慧", "assets/image/icon_idea_zh.png"), - ], - ), - ], - ), - ), ], ), );