更新分享图标

物品页面添加额外的图片
更新关于我们页面
master
laiiihz 5 years ago
parent 11253a0bad
commit 845a93ea96

Binary file not shown.

After

Width:  |  Height:  |  Size: 403 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

@ -1,4 +1,7 @@
import 'dart:convert';
import 'package:json_annotation/json_annotation.dart';
import 'package:recook/constants/header.dart';
import 'package:recook/models/base_model.dart';
import 'package:recook/models/price_model.dart';
@ -162,6 +165,8 @@ class Data extends Object {
int shoppingTrolleyCount; //
Notice notice;
List<Recommends> recommends;
num isImport;
@ -192,6 +197,7 @@ class Data extends Object {
this.isImport,
this.isFerme,
this.storehouse,
this.notice,
);
factory Data.fromJson(Map<String, dynamic> srcJson) =>
@ -523,3 +529,38 @@ class Recommends extends Object {
_$RecommendsFromJson(srcJson);
Map<String, dynamic> toJson() => _$RecommendsToJson(this);
}
class Notice {
String title;
String img;
///type: 123
int type;
Notice({
this.title,
this.img,
this.type,
});
Map<String, dynamic> toMap() {
return {
'title': title,
'img': img,
'type': type,
};
}
factory Notice.fromMap(Map<String, dynamic> map) {
if (map == null) return null;
return Notice(
title: map['title'],
img: map['img'],
type: map['type'],
);
}
String toJson() => json.encode(toMap());
factory Notice.fromJson(dynamic source) => Notice.fromMap(source);
}

@ -71,6 +71,9 @@ Data _$DataFromJson(Map<String, dynamic> json) {
json['isImport'],
json['isFerme'],
json['storehouse'],
json['notice'] == null
? null
: Notice.fromJson(json['notice'] as Map<String, dynamic>),
);
}

@ -9,6 +9,7 @@
import 'dart:convert';
import 'package:common_utils/common_utils.dart';
import 'package:flutter/material.dart';
import 'package:recook/base/base_store_state.dart';
import 'package:recook/constants/api.dart';
@ -276,7 +277,33 @@ class _GoodsPageState extends BaseStoreState<GoodsPage> {
// ],
// ),
// ));
insertFirst() {
if (!TextUtil.isEmpty(widget.goodsDetail.data.notice.img))
children.insert(
0,
FadeInImage.assetNetwork(
placeholder: R.ASSETS_PLACEHOLDER_NEW_2X1_A_PNG,
image: Api.getImgUrl(widget.goodsDetail.data.notice.img),
),
);
}
insertLast() {
if (!TextUtil.isEmpty(widget.goodsDetail.data.notice.img))
children.add(
FadeInImage.assetNetwork(
placeholder: R.ASSETS_PLACEHOLDER_NEW_2X1_A_PNG,
image: Api.getImgUrl(widget.goodsDetail.data.notice.img),
),
);
}
if (widget?.goodsDetail?.data?.notice?.type == 1) insertFirst();
if (widget?.goodsDetail?.data?.notice?.type == 2) insertLast();
if (widget?.goodsDetail?.data?.notice?.type == 3) {
insertFirst();
insertLast();
}
return children;
}

@ -12,7 +12,6 @@ class AboutUsPage extends StatefulWidget {
}
class _AboutUsPageState extends BaseStoreState<AboutUsPage> {
@override
Widget buildContext(BuildContext context, {store}) {
return Scaffold(
@ -21,15 +20,14 @@ class _AboutUsPageState extends BaseStoreState<AboutUsPage> {
title: "关于我们",
elevation: 0,
),
body: ListView(
physics: AlwaysScrollableScrollPhysics(),
children: <Widget>[
Container(
// padding: EdgeInsets.symmetric(vertical: 10),
child: Image.asset("assets/recook_about_us.jpg", fit: BoxFit.fill,),
)
],
body: SingleChildScrollView(
child: Container(
child: Image.asset(
"assets/recook_about_us.webp",
fit: BoxFit.fill,
),
),
),
);
}
}
}

@ -138,7 +138,7 @@ class ShareTool {
PlatformItem wechatItem = PlatformItem(
"微信",
Image.asset(
ShareToolIcon.wechatmini,
R.ASSETS_SHARE_BOTTOM_WECHAT_MINI_P_PNG,
width: 36,
height: 36,
), itemClick: () {
@ -213,7 +213,7 @@ class ShareTool {
PlatformItem qqItem = PlatformItem(
"QQ",
Image.asset(
ShareToolIcon.qq,
R.ASSETS_SHARE_BOTTOM_QQ_PNG,
width: 36,
height: 36,
), itemClick: () {
@ -247,7 +247,7 @@ class ShareTool {
PlatformItem copyurl = PlatformItem(
"复制链接",
Image.asset(
ShareToolIcon.copyurl,
R.ASSETS_SHARE_BOTTOM_LINK_PNG,
width: 36,
height: 36,
), itemClick: () {
@ -262,7 +262,7 @@ class ShareTool {
PlatformItem qrcode = PlatformItem(
"小程序海报",
Image.asset(
ShareToolIcon.poster,
R.ASSETS_SHARE_BOTTOM_BANNER_PNG,
width: 36,
height: 36,
), itemClick: () {
@ -275,7 +275,7 @@ class ShareTool {
PlatformItem addToLiveGoodsCart = PlatformItem(
'加到直播车',
Image.asset(
R.ASSETS_LIVE_LIVE_CART_PNG,
R.ASSETS_SHARE_BOTTOM_LIVE_CART_PNG,
width: 36,
height: 36,
),

Loading…
Cancel
Save