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,
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<CommunityDynamic> {
space: 4.w,
leftImage: "assets/svg/xihuan.svg",
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 : "",
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",
),

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/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<BrandPage>
BrandData brandData;
List<GlobalKey> globaKeys = [];
List<BannerData> 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<BrandPage>
brands.addAll((brand.data["brandList"] as List<dynamic>)
.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<BrandPage>
@override
void initState() {
super.initState();
eventBus.on<EventType>().listen((event) {
print("object: BrandPage");
if (event.type < 3) {
setState(() {});
}
});
queryHome();
}
@ -163,7 +164,7 @@ class _BrandPage extends State<BrandPage>
HuiXiangBanner(bannerData),
///
OriginInfo(brandData),
OriginInfo(founder),
StoreTitleTab(
brands,

157
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<StatefulWidget> createState() {
@ -50,9 +51,9 @@ class _OriginInfo extends State<OriginInfo> {
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<OriginInfo> {
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<OriginInfo> {
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<OriginInfo> {
],
),
),
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"),
],
),
],
),
),
],
),
);

5
lib/store/store_order.dart

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

Loading…
Cancel
Save