Browse Source

1、商品详情的全部修改完毕

tags/0.0.4+2
PH2 4 years ago
parent
commit
66a176bbd3
10 changed files with 170 additions and 57 deletions
  1. +2
    -2
      lib/register.dart
  2. +5
    -1
      lib/widgets/goods_details/evaluate/model/goods_details_evaluate_model.dart
  3. +11
    -8
      lib/widgets/goods_details/footer/goods_details_footer_widget.dart
  4. +19
    -10
      lib/widgets/goods_details/slide_banner/goods_details_slide_banner_widget.dart
  5. +116
    -31
      lib/widgets/goods_details/slide_banner/model/goods_details_silde_banner_model.dart
  6. +1
    -1
      lib/widgets/goods_details/store/store_widget.dart
  7. +1
    -1
      lib/widgets/goods_details/title/goods_details_title_widget.dart
  8. +8
    -0
      lib/widgets/goods_details/title/model/goods_details_title_model.dart
  9. +4
    -0
      lib/widgets/goods_details/upgrade_tip/model/upgrade_tip_model.dart
  10. +3
    -3
      lib/widgets/goods_details/upgrade_tip/upgrade_tip_widget.dart

+ 2
- 2
lib/register.dart View File

@@ -340,8 +340,8 @@ class BaseWidgetRegister {
WidgetFactory.regist('product_detail_image', DefaultWidgetCreater((model) => GoodsDetailsImgWidget(model))); WidgetFactory.regist('product_detail_image', DefaultWidgetCreater((model) => GoodsDetailsImgWidget(model)));
// 商品推荐列表的小标题 // 商品推荐列表的小标题
WidgetFactory.regist('product_detail_recommend_title', DefaultWidgetCreater((model) => GoodsDetailsRecommendTitleWidget(model))); WidgetFactory.regist('product_detail_recommend_title', DefaultWidgetCreater((model) => GoodsDetailsRecommendTitleWidget(model)));
// 商品详情底部推荐列表 // 商品详情底部推荐列表(改用首页的商品列表了)
WidgetFactory.regist('product_detail_bottom_rec', GoodsDetailCommendCreater()); // WidgetFactory.regist('product_detail_bottom_rec', GoodsDetailCommendCreater());
// 商品详情底部 // 商品详情底部
WidgetFactory.regist('product_detail_bottom', DefaultWidgetCreater((model) => GoodsDetailsFooterWidget(model))); WidgetFactory.regist('product_detail_bottom', DefaultWidgetCreater((model) => GoodsDetailsFooterWidget(model)));




+ 5
- 1
lib/widgets/goods_details/evaluate/model/goods_details_evaluate_model.dart View File

@@ -21,6 +21,7 @@ class GoodsDetailsEvaluateModel {
String titleIcon; String titleIcon;
String moreText; String moreText;
String moreIcon; String moreIcon;
String moreTextColor;


GoodsDetailsEvaluateModel({ GoodsDetailsEvaluateModel({
this.comment_url, this.comment_url,
@@ -43,7 +44,8 @@ class GoodsDetailsEvaluateModel {
this.titleColor, this.titleColor,
this.titleIcon, this.titleIcon,
this.moreText, this.moreText,
this.moreIcon this.moreIcon,
this.moreTextColor,
}); });


GoodsDetailsEvaluateModel.fromJson(Map<String, dynamic> json) { GoodsDetailsEvaluateModel.fromJson(Map<String, dynamic> json) {
@@ -70,6 +72,7 @@ class GoodsDetailsEvaluateModel {
titleIcon = json['title_icon']; titleIcon = json['title_icon'];
moreText = json['more_text']; moreText = json['more_text'];
moreIcon = json['more_icon']; moreIcon = json['more_icon'];
moreTextColor = json['more_text_color'];
} }


Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@@ -97,6 +100,7 @@ class GoodsDetailsEvaluateModel {
data['title_icon'] = this.titleIcon; data['title_icon'] = this.titleIcon;
data['more_text'] = this.moreText; data['more_text'] = this.moreText;
data['more_icon'] = this.moreIcon; data['more_icon'] = this.moreIcon;
data['more_text_color'] = this.moreText;


return data; return data;
} }


+ 11
- 8
lib/widgets/goods_details/footer/goods_details_footer_widget.dart View File

@@ -7,6 +7,7 @@ import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:fluttertoast/fluttertoast.dart'; import 'package:fluttertoast/fluttertoast.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:zhiying_base_widget/pages/goods_share_page/goods_share_page.dart'; import 'package:zhiying_base_widget/pages/goods_share_page/goods_share_page.dart';
import 'package:zhiying_base_widget/widgets/custom/multi_nav/cached_network_image_util.dart';
import 'package:zhiying_base_widget/widgets/goods_details/footer/bloc/goods_details_footer_bloc.dart'; import 'package:zhiying_base_widget/widgets/goods_details/footer/bloc/goods_details_footer_bloc.dart';
import 'package:zhiying_base_widget/widgets/goods_details/footer/bloc/goods_details_footer_repository.dart'; import 'package:zhiying_base_widget/widgets/goods_details/footer/bloc/goods_details_footer_repository.dart';
import 'package:zhiying_base_widget/widgets/goods_details/footer/goods_details_footer_sk.dart'; import 'package:zhiying_base_widget/widgets/goods_details/footer/goods_details_footer_sk.dart';
@@ -210,10 +211,11 @@ class _GoodsDetailsFooterContainerState extends State<_GoodsDetailsFooterContain
width: 110, width: 110,
// padding: const EdgeInsets.only(left: 30, right: 30, top: 5, bottom: 5), // padding: const EdgeInsets.only(left: 30, right: 30, top: 5, bottom: 5),
decoration: BoxDecoration( decoration: BoxDecoration(
gradient: LinearGradient( // gradient: LinearGradient(
colors: [HexColor.fromHex(/*model?.share_earn_bg1_color ??*/ '#FFCA66'), HexColor.fromHex(/*model?.share_earn_bg2_color ??*/ '#FFD961')], // colors: [HexColor.fromHex(/*model?.share_earn_bg1_color ??*/ '#FFCA66'), HexColor.fromHex(/*model?.share_earn_bg2_color ??*/ '#FFD961')],
begin: Alignment.centerLeft, // begin: Alignment.centerLeft,
end: Alignment.centerRight), // end: Alignment.centerRight),
image: DecorationImage(image: CachedNetworkImageProvider(model?.listStyle?.rightIcon1?.bgImage ?? ''), fit: BoxFit.fitWidth),
borderRadius: BorderRadius.only(bottomLeft: Radius.circular(25), topLeft: Radius.circular(25))), borderRadius: BorderRadius.only(bottomLeft: Radius.circular(25), topLeft: Radius.circular(25))),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
@@ -248,10 +250,11 @@ class _GoodsDetailsFooterContainerState extends State<_GoodsDetailsFooterContain
height: 44, height: 44,
width: 110, width: 110,
decoration: BoxDecoration( decoration: BoxDecoration(
gradient: LinearGradient( // gradient: LinearGradient(
colors: [HexColor.fromHex(/*model?.save_earn_bg1_color ??*/ '#FF6969'), HexColor.fromHex(/*model?.save_earn_bg2_color ??*/ '#FF4646')], // colors: [HexColor.fromHex(/*model?.save_earn_bg1_color ??*/ '#FF6969'), HexColor.fromHex(/*model?.save_earn_bg2_color ??*/ '#FF4646')],
begin: Alignment.centerLeft, // begin: Alignment.centerLeft,
end: Alignment.centerRight), // end: Alignment.centerRight),
image: DecorationImage(image: CachedNetworkImageProvider(model?.listStyle?.rightIcon2?.bgImage ?? ''), fit: BoxFit.fitWidth),
borderRadius: BorderRadius.only(bottomRight: Radius.circular(25), topRight: Radius.circular(25))), borderRadius: BorderRadius.only(bottomRight: Radius.circular(25), topRight: Radius.circular(25))),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,


+ 19
- 10
lib/widgets/goods_details/slide_banner/goods_details_slide_banner_widget.dart View File

@@ -48,8 +48,7 @@ class _GoodsDetailsSlideBannerContainerState
void _itemOnClick(String model, List<String> images, int index) { void _itemOnClick(String model, List<String> images, int index) {
print('点击了 $model'); print('点击了 $model');
if (images != null) { if (images != null) {
PhotoPreview.showPhotoPreviewByimages(context, images, PhotoPreview.showPhotoPreviewByimages(context, images, currentIndex: index, heroTagSuffix: "top");
currentIndex: index, heroTagSuffix: "top");
} }
} }


@@ -103,6 +102,16 @@ class _GoodsDetailsSlideBannerContainerState
Widget _getMainWidget(GoodsDetailsSlideBannerModel datas) { Widget _getMainWidget(GoodsDetailsSlideBannerModel datas) {
return Container( return Container(
width: double.infinity, width: double.infinity,
margin: EdgeInsets.only(top: ParseUtil.stringParseDouble(datas?.topMargin), left: ParseUtil.stringParseDouble(datas?.leftRightMargin), right: ParseUtil.stringParseDouble(datas?.leftRightMargin)),
decoration: BoxDecoration(
color: HexColor.fromHex(datas?.bgColor),
borderRadius: BorderRadius.only(
topRight: Radius.circular(ParseUtil.stringParseDouble(datas?.topRightRadius)),
topLeft: Radius.circular(ParseUtil.stringParseDouble(datas?.topLeftRadius)),
bottomLeft: Radius.circular(ParseUtil.stringParseDouble(datas?.bottomLeftRadius)),
bottomRight: Radius.circular(ParseUtil.stringParseDouble(datas?.bottomRightRadius)),
)
),
height: MediaQuery.of(context).size.width, height: MediaQuery.of(context).size.width,
child: Swiper( child: Swiper(
controller: _control, controller: _control,
@@ -150,20 +159,20 @@ class _GoodsDetailsSlideBannerContainerState
/// 获取进度样式 /// 获取进度样式
SwiperPlugin _getSwiperStyleByType( SwiperPlugin _getSwiperStyleByType(
GoodsDetailsSlideBannerModel model, int pageCount) { GoodsDetailsSlideBannerModel model, int pageCount) {
if ('1' != model.pagination_open) { // if ('1' != model.pagination_open) {
return null; // return null;
} // }
if ('type_number' == model.pagination) { if ('type_number' == model.pagination) {
return _getNumswiperPlugin(pageCount, model.pagination_select_color, return _getNumswiperPlugin(pageCount, model.paginationSelectColor,
model.pagination_unselect_color); model.paginationUnselectColor);
} }
if ('type_point' == model.pagination) { if ('type_point' == model.pagination) {
return _swiperCustomPaginationDito(pageCount, return _swiperCustomPaginationDito(pageCount,
model.pagination_select_color, model.pagination_unselect_color); model.paginationSelectColor, model.paginationUnselectColor);
} }
if ('type_bar' == model.pagination) { if ('type_bar' == model.pagination) {
return _swiperCustomPagination(pageCount, model.pagination_select_color, return _swiperCustomPagination(pageCount, model.paginationSelectColor,
model.pagination_unselect_color); model.paginationUnselectColor);
} }
return null; return null;
} }


+ 116
- 31
lib/widgets/goods_details/slide_banner/model/goods_details_silde_banner_model.dart View File

@@ -1,36 +1,121 @@
class GoodsDetailsSlideBannerModel { class GoodsDetailsSlideBannerModel {
List<String> image_list; List<String> image_list;
String pagination;
String pagination_open;
List<String> pagination_options;
String pagination_select_color;
String pagination_unselect_color;


GoodsDetailsSlideBannerModel({this.image_list, this.pagination, this.pagination_open, this.pagination_options, this.pagination_select_color, this.pagination_unselect_color}); String name;
String desc;
String pagination;
String moduleType;
String moduleKey;
String isTopMargin;
String isLeftRightMargin;
String isShow;
String carouselType;
String paginationSelectColor;
String paginationUnselectColor;
String barWidthHeightRatio;
String bgWidthHeightRatio;
String carouselTime;
String topMargin;
String leftRightMargin;
String topLeftRadius;
String topRightRadius;
String bottomLeftRadius;
String bottomRightRadius;
String bgColor;
String hasVideo;
// List<Null> indexCarouselList;


factory GoodsDetailsSlideBannerModel.fromJson(Map<String, dynamic> json) { GoodsDetailsSlideBannerModel({
return GoodsDetailsSlideBannerModel( this.image_list,
image_list: json['image_list'] != null ? new List<String>.from(json['image_list']) : null, this.name,
pagination: json['pagination'], this.desc,
pagination_open: json['pagination_open'], this.pagination,
pagination_options: json['pagination_options'] != null ? new List<String>.from(json['pagination_options']) : null, this.moduleType,
pagination_select_color: json['pagination_select_color'], this.moduleKey,
pagination_unselect_color: json['pagination_unselect_color'], this.isTopMargin,
); this.isLeftRightMargin,
} this.isShow,
this.carouselType,
this.paginationSelectColor,
this.paginationUnselectColor,
this.barWidthHeightRatio,
this.bgWidthHeightRatio,
this.carouselTime,
this.topMargin,
this.leftRightMargin,
this.topLeftRadius,
this.topRightRadius,
this.bottomLeftRadius,
this.bottomRightRadius,
this.bgColor,
this.hasVideo,
// this.indexCarouselList,
});

GoodsDetailsSlideBannerModel.fromJson(Map<String, dynamic> json) {
image_list = json['image_list'] != null ? new List<String>.from(json['image_list']) : null;

name = json['name'];
desc = json['desc'];
pagination = json['pagination'];
moduleType = json['module_type'];
moduleKey = json['module_key'];
isTopMargin = json['is_top_margin'];
isLeftRightMargin = json['is_left_right_margin'];
isShow = json['is_show'];
carouselType = json['carousel_type'];
paginationSelectColor = json['pagination_select_color'];
paginationUnselectColor = json['pagination_unselect_color'];
barWidthHeightRatio = json['bar_width_height_ratio'];
bgWidthHeightRatio = json['bg_width_height_ratio'];
carouselTime = json['carousel_time'];
topMargin = json['top_margin'];
leftRightMargin = json['left_right_margin'];
topLeftRadius = json['top_left_radius'];
topRightRadius = json['top_right_radius'];
bottomLeftRadius = json['bottom_left_radius'];
bottomRightRadius = json['bottom_right_radius'];
bgColor = json['bg_color'];
hasVideo = json['has_video'];
// if (json['index_carousel_list'] != null) {
// indexCarouselList = new List<Null>();
// json['index_carousel_list'].forEach((v) {
// indexCarouselList.add(new Null.fromJson(v));
// });
// }
}


Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
data['pagination'] = this.pagination; if (this.image_list != null) {
data['pagination_open'] = this.pagination_open; data['image_list'] = this.image_list;
data['pagination_select_color'] = this.pagination_select_color;
data['pagination_unselect_color'] = this.pagination_unselect_color;
if (this.image_list != null) {
data['image_list'] = this.image_list;
}
if (this.pagination_options != null) {
data['pagination_options'] = this.pagination_options;
}
return data;
} }
} data['name'] = this.name;
data['desc'] = this.desc;
data['pagination'] = this.pagination;
data['module_type'] = this.moduleType;
data['module_key'] = this.moduleKey;
data['is_top_margin'] = this.isTopMargin;
data['is_left_right_margin'] = this.isLeftRightMargin;
data['is_show'] = this.isShow;
data['carousel_type'] = this.carouselType;
data['pagination_select_color'] = this.paginationSelectColor;
data['pagination_unselect_color'] = this.paginationUnselectColor;
data['bar_width_height_ratio'] = this.barWidthHeightRatio;
data['bg_width_height_ratio'] = this.bgWidthHeightRatio;
data['carousel_time'] = this.carouselTime;
data['top_margin'] = this.topMargin;
data['left_right_margin'] = this.leftRightMargin;
data['top_left_radius'] = this.topLeftRadius;
data['top_right_radius'] = this.topRightRadius;
data['bottom_left_radius'] = this.bottomLeftRadius;
data['bottom_right_radius'] = this.bottomRightRadius;
data['bg_color'] = this.bgColor;
data['has_video'] = this.hasVideo;
// if (this.indexCarouselList != null) {
// data['index_carousel_list'] =
// this.indexCarouselList.map((v) => v.toJson()).toList();
// }
return data;
}
}

+ 1
- 1
lib/widgets/goods_details/store/store_widget.dart View File

@@ -140,7 +140,7 @@ class _StoreContainerState extends State<StoreContainer> {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[ children: <Widget>[
/// 商店名称 /// 商店名称
Text(model?.shop_name ?? '品胜京东自营旗舰店', Text(model?.shop_name ?? '',
style: TextStyle( style: TextStyle(
color: HexColor.fromHex(model?.shopTextColor ?? '#333333'), color: HexColor.fromHex(model?.shopTextColor ?? '#333333'),
fontSize: 13, fontSize: 13,


+ 1
- 1
lib/widgets/goods_details/title/goods_details_title_widget.dart View File

@@ -121,7 +121,7 @@ class GoodsDetailsTitleWidget extends StatelessWidget {
if(model?.provider == GlobalConfig.PROVIDER_VIP || model?.provider == GlobalConfig.PROVIDER_KL){ if(model?.provider == GlobalConfig.PROVIDER_VIP || model?.provider == GlobalConfig.PROVIDER_KL){
return Container(); return Container();
} }
return Text('${model?.soldCount}人已购买' ?? '99999人已购买', style: TextStyle(color: HexColor.fromHex(/*model?.buy_color ??*/ '#999999'), fontSize: 12.5)); return Text('${model?.soldCount?? 0}${model?.goBuyText ?? '人已购买'}' ?? '99999人已购买', style: TextStyle(color: HexColor.fromHex(model?.goBuyColor ?? '#999999'), fontSize: 12.5));
} }






+ 8
- 0
lib/widgets/goods_details/title/model/goods_details_title_model.dart View File

@@ -24,6 +24,8 @@ class GoodsDetailsTitleModel {
String rewardStr; String rewardStr;
List<PlatformCss> platformCss; List<PlatformCss> platformCss;
List<String> sourceList; List<String> sourceList;
String goBuyText;
String goBuyColor;




String currentPrice; String currentPrice;
@@ -62,6 +64,8 @@ class GoodsDetailsTitleModel {
this.rewardStr, this.rewardStr,
this.platformCss, this.platformCss,
this.sourceList, this.sourceList,
this.goBuyText,
this.goBuyColor,


this.currentPrice, this.currentPrice,
this.isCoupon, this.isCoupon,
@@ -105,6 +109,8 @@ class GoodsDetailsTitleModel {
}); });
} }
sourceList = json['source_list'].cast<String>(); sourceList = json['source_list'].cast<String>();
goBuyText = json['go_buy_text'];
goBuyColor = json['go_buy_text_color'];


currentPrice = json['current_price']; currentPrice = json['current_price'];
isCoupon = json['is_coupon']; isCoupon = json['is_coupon'];
@@ -146,6 +152,8 @@ class GoodsDetailsTitleModel {
data['platform_css'] = this.platformCss.map((v) => v.toJson()).toList(); data['platform_css'] = this.platformCss.map((v) => v.toJson()).toList();
} }
data['source_list'] = this.sourceList; data['source_list'] = this.sourceList;
data['go_buy_text'] = this.goBuyText;
data['go_buy_text_color'] = this.goBuyColor;


data['current_price'] = this.currentPrice; data['current_price'] = this.currentPrice;
data['is_coupon'] = this.isCoupon; data['is_coupon'] = this.isCoupon;


+ 4
- 0
lib/widgets/goods_details/upgrade_tip/model/upgrade_tip_model.dart View File

@@ -20,6 +20,7 @@ class UpgradeTipModel {
String bottomRightRadius; String bottomRightRadius;
String bgColor; String bgColor;
String bulletinText; String bulletinText;
String bulletinBgColor;
String bulletinTextColor; String bulletinTextColor;
String goText; String goText;
GoSkip goSkip; GoSkip goSkip;
@@ -41,6 +42,7 @@ class UpgradeTipModel {
this.bottomRightRadius, this.bottomRightRadius,
this.bgColor, this.bgColor,
this.bulletinText, this.bulletinText,
this.bulletinBgColor,
this.bulletinTextColor, this.bulletinTextColor,
this.goText, this.goText,
this.goSkip, this.goSkip,
@@ -64,6 +66,7 @@ class UpgradeTipModel {
bottomRightRadius = json['bottom_right_radius']; bottomRightRadius = json['bottom_right_radius'];
bgColor = json['bg_color']; bgColor = json['bg_color'];
bulletinText = json['bulletin_text']; bulletinText = json['bulletin_text'];
bulletinBgColor = json ['bulletin_bg_color'];
bulletinTextColor = json['bulletin_text_color']; bulletinTextColor = json['bulletin_text_color'];
goText = json['go_text']; goText = json['go_text'];
goSkip = goSkip =
@@ -90,6 +93,7 @@ class UpgradeTipModel {
data['bottom_right_radius'] = this.bottomRightRadius; data['bottom_right_radius'] = this.bottomRightRadius;
data['bg_color'] = this.bgColor; data['bg_color'] = this.bgColor;
data['bulletin_text'] = this.bulletinText; data['bulletin_text'] = this.bulletinText;
data['bulletin_bg_color'] = this.bulletinBgColor;
data['bulletin_text_color'] = this.bulletinTextColor; data['bulletin_text_color'] = this.bulletinTextColor;
data['go_text'] = this.goText; data['go_text'] = this.goText;
if (this.goSkip != null) { if (this.goSkip != null) {


+ 3
- 3
lib/widgets/goods_details/upgrade_tip/upgrade_tip_widget.dart View File

@@ -34,8 +34,8 @@ class UpgradeTipWidget extends StatelessWidget {
margin: EdgeInsets.only(top: ParseUtil.stringParseDouble(_model?.topMargin), left: ParseUtil.stringParseDouble(_model?.leftRightMargin), right: ParseUtil.stringParseDouble(_model?.leftRightMargin)), margin: EdgeInsets.only(top: ParseUtil.stringParseDouble(_model?.topMargin), left: ParseUtil.stringParseDouble(_model?.leftRightMargin), right: ParseUtil.stringParseDouble(_model?.leftRightMargin)),
padding: const EdgeInsets.only(left: 12.5, right: 12.5, top: 6, bottom: 6), padding: const EdgeInsets.only(left: 12.5, right: 12.5, top: 6, bottom: 6),
decoration: BoxDecoration( decoration: BoxDecoration(
// color: HexColor.fromHex(_model?.bgColor), color: HexColor.fromHex(_model?.bgColor),
color: Colors.white, // color: Colors.white,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: Radius.circular(ParseUtil.stringParseDouble(_model?.topLeftRadius)), topLeft: Radius.circular(ParseUtil.stringParseDouble(_model?.topLeftRadius)),
topRight: Radius.circular(ParseUtil.stringParseDouble(_model?.topLeftRadius)), topRight: Radius.circular(ParseUtil.stringParseDouble(_model?.topLeftRadius)),
@@ -48,7 +48,7 @@ class UpgradeTipWidget extends StatelessWidget {
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
/// 背景颜色 /// 背景颜色
color: HexColor.fromHex(_model?.bgColor ?? '#FFEFDA'), color: HexColor.fromHex(_model?.bulletinBgColor ?? '#FFEFDA'),
borderRadius: BorderRadius.circular(30), borderRadius: BorderRadius.circular(30),
), ),
padding: const EdgeInsets.only(left: 10, right: 13, top: 10, bottom: 10), padding: const EdgeInsets.only(left: 10, right: 13, top: 10, bottom: 10),


||||||
x
 
000:0
Loading…
Cancel
Save