Browse Source

Merge remote-tracking branch 'origin/dev' into remove_uniapp

ff_new
fmk 3 years ago
parent
commit
d030f3d828
  1. 9
      lib/community/community_view/community_dynamic.dart
  2. 2
      lib/home/home_view/founder_store.dart
  3. 9
      lib/home/huixiang_brand_page.dart
  4. 157
      lib/home/huixiang_view/origin_info.dart
  5. 5
      lib/store/store_order.dart

9
lib/community/community_view/community_dynamic.dart

@ -284,12 +284,18 @@ class _CommunityDynamic extends State<CommunityDynamic> {
space: 4.w, space: 4.w,
leftImage: "assets/svg/liulanliang.svg", leftImage: "assets/svg/liulanliang.svg",
iconSize: 16, iconSize: 16,
textStyle: TextStyle(
fontSize: 14.sp,
),
), ),
IconText( IconText(
"${widget.comment.comments ?? 0}", "${widget.comment.comments ?? 0}",
space: 4.w, space: 4.w,
leftImage: "assets/svg/pinglun.svg", leftImage: "assets/svg/pinglun.svg",
iconSize: 16, iconSize: 16,
textStyle: TextStyle(
fontSize: 14.sp,
),
), ),
GestureDetector( GestureDetector(
onTap: () {}, onTap: () {},
@ -298,6 +304,9 @@ class _CommunityDynamic extends State<CommunityDynamic> {
space: 4.w, space: 4.w,
leftImage: "assets/svg/xihuan.svg", leftImage: "assets/svg/xihuan.svg",
iconSize: 16, iconSize: 16,
textStyle: TextStyle(
fontSize: 14.sp,
),
), ),
), ),
], ],

2
lib/home/home_view/founder_store.dart

@ -63,7 +63,7 @@ class _FounderStore extends State<FounderStore> {
widget.founder != null ? widget.founder.imgUrl : "", widget.founder != null ? widget.founder.imgUrl : "",
aspectRatio: 2, aspectRatio: 2,
radius: BorderRadius.circular(4.w), radius: BorderRadius.circular(4.w),
fit: BoxFit.cover, // fit: BoxFit.cover,
errorSrc: "assets/image/default_2_1.png", errorSrc: "assets/image/default_2_1.png",
fadeSrc: "assets/image/default_2_1.png", fadeSrc: "assets/image/default_2_1.png",
), ),

9
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/base_data.dart';
import 'package:huixiang/retrofit/data/brand.dart'; import 'package:huixiang/retrofit/data/brand.dart';
import 'package:huixiang/retrofit/data/brand_data.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/data/page.dart';
import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/event_type.dart'; import 'package:huixiang/utils/event_type.dart';
@ -40,8 +41,9 @@ class _BrandPage extends State<BrandPage>
BrandData brandData; BrandData brandData;
List<GlobalKey> globaKeys = []; List<GlobalKey> globaKeys = [];
List<BannerData> bannerData = []; List<BannerData> bannerData = [];
Founder founder;
Future queryHome() async { queryHome() async {
EasyLoading.show(status: S.current.zhengzaijiazai); EasyLoading.show(status: S.current.zhengzaijiazai);
final SharedPreferences value = await SharedPreferences.getInstance(); final SharedPreferences value = await SharedPreferences.getInstance();
@ -79,6 +81,7 @@ class _BrandPage extends State<BrandPage>
brands.addAll((brand.data["brandList"] as List<dynamic>) brands.addAll((brand.data["brandList"] as List<dynamic>)
.map((e) => Brand.fromJson(e)) .map((e) => Brand.fromJson(e))
.toList()); .toList());
founder = Founder.fromJson(brand.data["founder"]);
brands.forEach((element) { brands.forEach((element) {
globaKeys.add(GlobalKey()); globaKeys.add(GlobalKey());
}); });
@ -93,14 +96,12 @@ class _BrandPage extends State<BrandPage>
@override @override
void initState() { void initState() {
super.initState(); super.initState();
eventBus.on<EventType>().listen((event) { eventBus.on<EventType>().listen((event) {
print("object: BrandPage"); print("object: BrandPage");
if (event.type < 3) { if (event.type < 3) {
setState(() {}); setState(() {});
} }
}); });
queryHome(); queryHome();
} }
@ -163,7 +164,7 @@ class _BrandPage extends State<BrandPage>
HuiXiangBanner(bannerData), HuiXiangBanner(bannerData),
/// ///
OriginInfo(brandData), OriginInfo(founder),
StoreTitleTab( StoreTitleTab(
brands, brands,

157
lib/home/huixiang_view/origin_info.dart

@ -1,15 +1,16 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/brand_data.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/MyPainter.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/custom_image.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
class OriginInfo extends StatefulWidget { class OriginInfo extends StatefulWidget {
final BrandData brandData; final Founder founder;
OriginInfo(this.brandData); OriginInfo(this.founder);
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -50,9 +51,9 @@ class _OriginInfo extends State<OriginInfo> {
children: [ children: [
ClipOval( ClipOval(
child: MImage( child: MImage(
widget.brandData == null widget.founder == null
? "" ? ""
: widget.brandData.originAvatar, : widget.founder.imgUrl,
fit: BoxFit.cover, fit: BoxFit.cover,
width: 60, width: 60,
height: 60, height: 60,
@ -73,9 +74,9 @@ class _OriginInfo extends State<OriginInfo> {
TextSpan( TextSpan(
children: [ children: [
TextSpan( TextSpan(
text: widget.brandData == null text: widget.founder == null
? "" ? ""
: widget.brandData.originator, : widget.founder.name,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 14.sp, fontSize: 14.sp,
@ -94,9 +95,9 @@ class _OriginInfo extends State<OriginInfo> {
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
), ),
Text( Text(
widget.brandData == null widget.founder == null
? "" ? ""
: widget.brandData.originDesc, : widget.founder.description,
overflow: isShowMore overflow: isShowMore
? TextOverflow.visible ? TextOverflow.visible
: TextOverflow.ellipsis, : TextOverflow.ellipsis,
@ -143,78 +144,80 @@ class _OriginInfo extends State<OriginInfo> {
], ],
), ),
), ),
SizedBox( // InkWell(
height: 40.h, // onTap: () {
), // Navigator.of(context).pushNamed('/router/founder_story_page');
InkWell( // },
onTap: () { // child: Text(
Navigator.of(context).pushNamed('/router/founder_story_page'); // // widget.founder == null ? "" : widget.founder.company,
}, // "",
child: Text( // style: TextStyle(
widget.brandData == null ? "" : widget.brandData.company, // fontSize: 16.sp,
style: TextStyle( // fontWeight: FontWeight.bold,
fontSize: 16.sp, // color: Colors.black,
fontWeight: FontWeight.bold, // ),
color: Colors.black, // ),
), // ),
), // SizedBox(
), // height: 20.h,
SizedBox( // ),
height: 20.h, // InkWell(
), // onTap: () {
InkWell( // Navigator.of(context).pushNamed('/router/founder_story_page');
onTap: () { // },
Navigator.of(context).pushNamed('/router/founder_story_page'); // child: Text(
}, // // widget.brandData == null ? "" : widget.brandData.companyDesc,
child: Text( // "",
widget.brandData == null ? "" : widget.brandData.companyDesc, // textAlign: TextAlign.justify,
textAlign: TextAlign.justify, // style: TextStyle(
style: TextStyle( // fontSize: 12.sp,
fontSize: 12.sp, // color: Color(0xFF353535),
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"),
],
),
],
),
),
], ],
), ),
); );

5
lib/store/store_order.dart

@ -1,6 +1,5 @@
import 'dart:convert'; import 'dart:convert';
import 'package:ai_decimal_accuracy/ai_decimal_accuracy.dart';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/gestures.dart'; import 'package:flutter/gestures.dart';
@ -558,7 +557,9 @@ class _StoreOrderPage extends State<StoreOrderPage>
"numberOfPeople": numberOfPeople, "numberOfPeople": numberOfPeople,
}, },
); );
getParentInfo(); if(tableId >0){
getParentInfo();
}
queryShopCar().then((value) { queryShopCar().then((value) {
this.shopCarGoods = value; this.shopCarGoods = value;
setState(() {}); setState(() {});

Loading…
Cancel
Save