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;