From 2aded504a91f94281fb2eec78dc569d392704335 Mon Sep 17 00:00:00 2001 From: zhangmeng <494089941@qq.com> Date: Fri, 4 Jun 2021 17:43:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E4=BA=AB=E5=B0=8F=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E6=B5=B7=E6=8A=A5=20=E9=80=89=E4=B8=AD=E7=9A=84=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E9=BB=98=E8=AE=A4=E4=B8=BA=E7=AC=AC=E4=B8=80=E5=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/home/classify/goods_page.dart | 2 +- lib/pages/home/home_page.dart | 11 ++++++----- lib/widgets/goods_item.dart | 4 ++-- lib/widgets/share_page/share_goods_poster_page.dart | 4 ++-- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/lib/pages/home/classify/goods_page.dart b/lib/pages/home/classify/goods_page.dart index f141a89..ccb603e 100644 --- a/lib/pages/home/classify/goods_page.dart +++ b/lib/pages/home/classify/goods_page.dart @@ -339,7 +339,7 @@ class _GoodsPageState extends BaseStoreState { String img = ''; int length = widget.goodsDetail.data.mainPhotos.length; if (length >= 2) - img = widget.goodsDetail.data.mainPhotos[1].url; + img = widget.goodsDetail.data.mainPhotos[0].url; if (length >= 1) img = widget.goodsDetail.data.mainPhotos[0].url; ShareTool().goodsShare( diff --git a/lib/pages/home/home_page.dart b/lib/pages/home/home_page.dart index ef78425..7eefda0 100644 --- a/lib/pages/home/home_page.dart +++ b/lib/pages/home/home_page.dart @@ -162,13 +162,14 @@ class _HomePageState extends BaseStoreState // AMapFlutterLocation.setApiKey( // '7225bca14fe7493f9f469315a933f99c', 'e8a8057cfedcdcadcf4e8f2c7f8de982'); _amapFlutterLocation = AMapFlutterLocation(); - + requestPermission().then((value) { if (value) { //监听要在设置参数之前 否则无法获取定位 _amapFlutterLocation.onLocationChanged().listen( (event) { _weatherLocation = event; + LoggerData.addData(_weatherLocation['city']); _getWeather(); }, ); @@ -463,12 +464,12 @@ class _HomePageState extends BaseStoreState children: [ Container( margin: EdgeInsets.only(left: 10), - width: ScreenAdapterUtils.setWidth(iconSize), - height: ScreenAdapterUtils.setWidth(iconSize), + width: iconSize * 2.w, + height: iconSize * 2.w, child: Image.asset( 'assets/home_tab_search.png', - width: ScreenAdapterUtils.setWidth(iconSize), - height: ScreenAdapterUtils.setWidth(iconSize), + width: iconSize * 2.w, + height: iconSize * 2.w, ), ), Container( diff --git a/lib/widgets/goods_item.dart b/lib/widgets/goods_item.dart index f4db54f..93718fe 100644 --- a/lib/widgets/goods_item.dart +++ b/lib/widgets/goods_item.dart @@ -743,8 +743,8 @@ class GoodsItemWidget extends StatelessWidget { String imgUrl; GoodsDetailModel imagesModel = await GoodsDetailModelImpl.getDetailInfo(this.id, UserManager.instance.user.info.id); - if (imagesModel.data.mainPhotos.length>1) { - imgUrl = imagesModel.data.mainPhotos[1].url; + if (imagesModel.data.mainPhotos.length>=1) { + imgUrl = imagesModel.data.mainPhotos[0].url; } else { imgUrl = imagesModel.data?.mainPhotos?.first?.url ?? ''; } diff --git a/lib/widgets/share_page/share_goods_poster_page.dart b/lib/widgets/share_page/share_goods_poster_page.dart index 6b2c4f0..d70c7a1 100644 --- a/lib/widgets/share_page/share_goods_poster_page.dart +++ b/lib/widgets/share_page/share_goods_poster_page.dart @@ -156,8 +156,8 @@ class _ShareGoodsPosterPageState extends BaseStoreState { } // _bottomBarController.setFavorite(_goodsDetail.data.isFavorite); MainPhotos photo = _goodsDetail.data.mainPhotos[0]; - if (_goodsDetail.data.mainPhotos.length >= 2) { - photo = _goodsDetail.data.mainPhotos[1]; + if (_goodsDetail.data.mainPhotos.length >= 1) { + photo = _goodsDetail.data.mainPhotos[0]; } photo.isSelect = true; photo.isSelectNumber = 1;