Pārlūkot izejas kodu

0220 添加商品详情页面的店铺网页跳转

tags/0.0.5+2
23028876916@qq.com pirms 3 gadiem
vecāks
revīzija
b05b62e291
3 mainītis faili ar 38 papildinājumiem un 21 dzēšanām
  1. +5
    -1
      lib/widgets/goods_details/store/model/store_model.dart
  2. +31
    -20
      lib/widgets/goods_details/store/store_widget.dart
  3. +2
    -0
      lib/widgets/share/share_alert_select.dart

+ 5
- 1
lib/widgets/goods_details/store/model/store_model.dart Parādīt failu

@@ -33,6 +33,7 @@ class StoreModel {
String heightPointIcon;
String publicPointIcon;
String lowPointIcon;
String shop_url;

StoreModel({
this.description,
@@ -65,7 +66,8 @@ class StoreModel {
this.moreIcon,
this.heightPointIcon,
this.publicPointIcon,
this.lowPointIcon
this.lowPointIcon,
this.shop_url

});

@@ -101,6 +103,7 @@ class StoreModel {
heightPointIcon = json['height_point_icon'];
publicPointIcon = json['public_point_icon'];
lowPointIcon = json['low_point_icon'];
shop_url = json['shop_url'];

}

@@ -137,6 +140,7 @@ class StoreModel {
data['height_point_icon'] = this.heightPointIcon;
data['public_point_icon'] = this.publicPointIcon;
data['low_point_icon'] = this.lowPointIcon;
data['shop_url'] = this.shop_url;

return data;
}


+ 31
- 20
lib/widgets/goods_details/store/store_widget.dart Parādīt failu

@@ -20,7 +20,8 @@ class StoreWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return BlocProvider<StoreBloc>(
create: (_) => StoreBloc(repository: StoreRepository()), //..add(StoreInitEvent(model: model)),
create: (_) => StoreBloc(repository: StoreRepository()),
//..add(StoreInitEvent(model: model)),
child: StoreContainer(
model,
key: UniqueKey(),
@@ -49,12 +50,13 @@ class _StoreContainerState extends State<StoreContainer> {
void _onMoreClick() {}

/// 点击商家
void _onStoreClick() {
print("点击_onStoreClick");
void _onStoreClick(StoreModel model) {
print("点击商家_onStoreClick");
Logger.log(widget.model['data']);

// RouterUtil.openWebview(url, context);

Logger.log("店铺:" + model.shop_url);
if (!EmptyUtil.isEmpty(model.shop_url)) {
RouterUtil.openWebview(model.shop_url, context);
}
}

@override
@@ -80,22 +82,27 @@ class _StoreContainerState extends State<StoreContainer> {
Widget _getMianWidget(StoreModel model) {
return GestureDetector(
onTap: () {
_onStoreClick();
_onStoreClick(model);
},
child: Container(
width: double.infinity,
height: 50 + 20.0 + 18,
padding: const EdgeInsets.only(left: 12.5, right: 12.5, top: 20, bottom: 18),
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)),
decoration: BoxDecoration(
color: HexColor.fromHex(model?.bgColor),
borderRadius: BorderRadius.only(
topRight: Radius.circular(ParseUtil.stringParseDouble(model?.topRightRadius)),
topLeft: Radius.circular(ParseUtil.stringParseDouble(model?.topLeftRadius)),
bottomRight: Radius.circular(ParseUtil.stringParseDouble(model?.bottomRightRadius)),
bottomLeft: Radius.circular(ParseUtil.stringParseDouble(model?.bottomLeftRadius)),
)
),
color: HexColor.fromHex(model?.bgColor),
borderRadius: BorderRadius.only(
topRight:
Radius.circular(ParseUtil.stringParseDouble(model?.topRightRadius)),
topLeft: Radius.circular(ParseUtil.stringParseDouble(model?.topLeftRadius)),
bottomRight:
Radius.circular(ParseUtil.stringParseDouble(model?.bottomRightRadius)),
bottomLeft:
Radius.circular(ParseUtil.stringParseDouble(model?.bottomLeftRadius)),
)),
child: Row(
children: <Widget>[
/// 商家图片
@@ -149,7 +156,8 @@ class _StoreContainerState extends State<StoreContainer> {
/// 更多 TODO 暂时隐藏,等后台有数据后再打开
Visibility(
visible: false,
child: Text(model?.moreText ?? '更多店铺优惠', style: TextStyle(color: HexColor.fromHex('#FF4242'), fontSize: 11))),
child: Text(model?.moreText ?? '更多店铺优惠',
style: TextStyle(color: HexColor.fromHex('#FF4242'), fontSize: 11))),
],
);
}
@@ -160,13 +168,16 @@ class _StoreContainerState extends State<StoreContainer> {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
/// 宝贝描述 5.0
_getCoustomWidet(model?.description ?? '宝贝描述 5.0', model?.descTextColor1 ?? '#999999', model?.heightPointIcon ?? ''),
_getCoustomWidet(model?.description ?? '宝贝描述 5.0',
model?.descTextColor1 ?? '#999999', model?.heightPointIcon ?? ''),

/// 物流服务 5.0
_getCoustomWidet(model?.logistics ?? '宝贝描述 5.0', model?.descTextColor2 ?? '#999999', model?.publicPointIcon ?? ''),
_getCoustomWidet(model?.logistics ?? '宝贝描述 5.0',
model?.descTextColor2 ?? '#999999', model?.publicPointIcon ?? ''),

/// 服务态度 1.0
_getCoustomWidet(model?.service ?? '宝贝描述 5.0', model?.descTextColor3 ?? '#999999', model?.lowPointIcon ?? ''),
_getCoustomWidet(model?.service ?? '宝贝描述 5.0', model?.descTextColor3 ?? '#999999',
model?.lowPointIcon ?? ''),
],
);
}


+ 2
- 0
lib/widgets/share/share_alert_select.dart Parādīt failu

@@ -98,11 +98,13 @@ class _ShareAlertSelectState extends State<ShareAlertSelect> {
EventUtil.instance.fire(model);
}

///截图保存
Future<ShareDataModel> _updateModel(GlobalKey _globalKey) async {
ShareDataModel _shareModel = ShareDataModel();
BuildContext buildContext = _globalKey.currentContext;
if (null != buildContext) {
RenderRepaintBoundary boundary = buildContext.findRenderObject();
///pixelRatio是放大倍数
ui.Image image = await boundary.toImage(pixelRatio: 1);
// 注意:png是压缩后格式,如果需要图片的原始像素数据,请使用rawRgba
ByteData byteData = await image.toByteData(format: ui.ImageByteFormat.png);


Notiek ielāde…
Atcelt
Saglabāt