diff --git a/assets/recook_about_us.webp b/assets/recook_about_us.webp new file mode 100644 index 0000000..cb7d265 Binary files /dev/null and b/assets/recook_about_us.webp differ diff --git a/assets/share_bottom/banner.png b/assets/share_bottom/banner.png new file mode 100644 index 0000000..77f0422 Binary files /dev/null and b/assets/share_bottom/banner.png differ diff --git a/assets/share_bottom/link.png b/assets/share_bottom/link.png new file mode 100644 index 0000000..9a27ab5 Binary files /dev/null and b/assets/share_bottom/link.png differ diff --git a/assets/share_bottom/live_cart.png b/assets/share_bottom/live_cart.png new file mode 100644 index 0000000..668826e Binary files /dev/null and b/assets/share_bottom/live_cart.png differ diff --git a/assets/share_bottom/qq.png b/assets/share_bottom/qq.png new file mode 100644 index 0000000..8a8fb7e Binary files /dev/null and b/assets/share_bottom/qq.png differ diff --git a/assets/share_bottom/wechat_mini_p.png b/assets/share_bottom/wechat_mini_p.png new file mode 100644 index 0000000..b8ce8f6 Binary files /dev/null and b/assets/share_bottom/wechat_mini_p.png differ diff --git a/lib/models/goods_detail_model.dart b/lib/models/goods_detail_model.dart index 2839d56..e3e3694 100644 --- a/lib/models/goods_detail_model.dart +++ b/lib/models/goods_detail_model.dart @@ -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; num isImport; @@ -192,6 +197,7 @@ class Data extends Object { this.isImport, this.isFerme, this.storehouse, + this.notice, ); factory Data.fromJson(Map srcJson) => @@ -523,3 +529,38 @@ class Recommends extends Object { _$RecommendsFromJson(srcJson); Map toJson() => _$RecommendsToJson(this); } + +class Notice { + String title; + String img; + + ///type: 1头显示,2尾显示,3头尾显示 + int type; + Notice({ + this.title, + this.img, + this.type, + }); + + Map toMap() { + return { + 'title': title, + 'img': img, + 'type': type, + }; + } + + factory Notice.fromMap(Map 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); +} diff --git a/lib/models/goods_detail_model.g.dart b/lib/models/goods_detail_model.g.dart index c51f497..edcf84e 100644 --- a/lib/models/goods_detail_model.g.dart +++ b/lib/models/goods_detail_model.g.dart @@ -71,6 +71,9 @@ Data _$DataFromJson(Map json) { json['isImport'], json['isFerme'], json['storehouse'], + json['notice'] == null + ? null + : Notice.fromJson(json['notice'] as Map), ); } diff --git a/lib/pages/home/classify/goods_page.dart b/lib/pages/home/classify/goods_page.dart index f509a62..63bbc51 100644 --- a/lib/pages/home/classify/goods_page.dart +++ b/lib/pages/home/classify/goods_page.dart @@ -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 { // ], // ), // )); + 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; } diff --git a/lib/pages/user/about_us_page.dart b/lib/pages/user/about_us_page.dart index 6609f4b..c2008b9 100644 --- a/lib/pages/user/about_us_page.dart +++ b/lib/pages/user/about_us_page.dart @@ -12,7 +12,6 @@ class AboutUsPage extends StatefulWidget { } class _AboutUsPageState extends BaseStoreState { - @override Widget buildContext(BuildContext context, {store}) { return Scaffold( @@ -21,15 +20,14 @@ class _AboutUsPageState extends BaseStoreState { title: "关于我们", elevation: 0, ), - body: ListView( - physics: AlwaysScrollableScrollPhysics(), - children: [ - 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, + ), + ), ), ); } -} \ No newline at end of file +} diff --git a/lib/utils/share_tool.dart b/lib/utils/share_tool.dart index 3a15504..013b492 100644 --- a/lib/utils/share_tool.dart +++ b/lib/utils/share_tool.dart @@ -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, ),