diff --git a/lib/community/community_view/course_banner.dart b/lib/community/community_view/course_banner.dart index f76ea5aa..20665357 100644 --- a/lib/community/community_view/course_banner.dart +++ b/lib/community/community_view/course_banner.dart @@ -74,7 +74,7 @@ class _CourseBanner extends State { ); } - /// contentType 跳转类型(0:不跳转,1:积分商品,2:活动,3:文章,4:页面跳转,5:课程) + /// contentType 跳转类型(0:不跳转,1:积分商品,2:活动,3:文章,4:页面跳转,5:课程,7门店跳转) bannerClick(BannerData bannerData) async { switch (bannerData.contentType) { case 1: @@ -110,6 +110,11 @@ class _CourseBanner extends State { "id": bannerData.content, }); break; + case 7: + String params = bannerData.content.substring(bannerData.content.indexOf("?")+1); + Map map = jsonDecode(params); + Navigator.of(context).pushNamed(bannerData.content.substring(0,bannerData.content.indexOf("?")), arguments: map); + break; } } } diff --git a/lib/community/headlines/headlines_banner.dart b/lib/community/headlines/headlines_banner.dart index 59e2e8c7..0e98e26f 100644 --- a/lib/community/headlines/headlines_banner.dart +++ b/lib/community/headlines/headlines_banner.dart @@ -71,7 +71,7 @@ class _HeadlinesBanner extends State { ); } - /// contentType 跳转类型(0:不跳转,1:积分商品,2:活动,3:文章,4:页面跳转,5:课程) + /// contentType 跳转类型(0:不跳转,1:积分商品,2:活动,3:文章,4:页面跳转,5:课程,7门店跳转) bannerClick(BannerData bannerData) async { switch (bannerData.contentType) { case 1: @@ -107,6 +107,11 @@ class _HeadlinesBanner extends State { "id": bannerData.content, }); break; + case 7: + String params = bannerData.content.substring(bannerData.content.indexOf("?")+1); + Map map = jsonDecode(params); + Navigator.of(context).pushNamed(bannerData.content.substring(0,bannerData.content.indexOf("?")), arguments: map); + break; } } } diff --git a/lib/home/home_view/home_banner.dart b/lib/home/home_view/home_banner.dart index 5068a554..f597a018 100644 --- a/lib/home/home_view/home_banner.dart +++ b/lib/home/home_view/home_banner.dart @@ -72,7 +72,7 @@ class _HomeBanner extends State { ); } - /// contentType 跳转类型(0:不跳转,1:积分商品,2:活动,3:文章,4:页面跳转,5:课程) + /// contentType 跳转类型(0:不跳转,1:积分商品,2:活动,3:文章,4:页面跳转,5:课程,7:门店跳转) bannerClick(BannerData bannerData) async { switch (bannerData.contentType) { case 1: @@ -80,14 +80,12 @@ class _HomeBanner extends State { arguments: {"goodsId": bannerData.content}); break; case 2: - Navigator.of(context) - .pushNamed('/router/web_page', arguments: { + Navigator.of(context).pushNamed('/router/web_page', arguments: { "activityId": bannerData.content, }); break; case 3: - Navigator.of(context) - .pushNamed('/router/web_page', arguments: { + Navigator.of(context).pushNamed('/router/web_page', arguments: { "articleId": bannerData.content, }); break; @@ -95,19 +93,25 @@ class _HomeBanner extends State { String router = bannerData.content; // String router = "/router/store_order?{\"id\":\"1512378184161558528\",\"tenant\":\"1188\",\"storeName\":\"农场煮意\"}"; if (router.contains("?")) { - String params = router.substring(router.indexOf("?")+1); + String params = router.substring(router.indexOf("?") + 1); Map map = jsonDecode(params); - Navigator.of(context).pushNamed(router.substring(0,router.indexOf("?")), arguments: map); + Navigator.of(context).pushNamed( + router.substring(0, router.indexOf("?")), + arguments: map); } else { Navigator.of(context).pushNamed(router); } break; case 5: - Navigator.of(context) - .pushNamed('/router/class_details', arguments: { + Navigator.of(context).pushNamed('/router/class_details', arguments: { "id": bannerData.content, }); break; + case 7: + String params = bannerData.content.substring(bannerData.content.indexOf("?")+1); + Map map = jsonDecode(params); + Navigator.of(context).pushNamed(bannerData.content.substring(0,bannerData.content.indexOf("?")), arguments: map); + break; } } } diff --git a/lib/home/huixiang_view/huixiang_banner.dart b/lib/home/huixiang_view/huixiang_banner.dart index 8d31f8a8..3549fba2 100644 --- a/lib/home/huixiang_view/huixiang_banner.dart +++ b/lib/home/huixiang_view/huixiang_banner.dart @@ -65,7 +65,7 @@ class _HuiXiangBanner extends State { ); } - /// contentType 跳转类型(0:不跳转,1:积分商品,2:活动,3:文章,4:页面跳转,5:课程) + /// contentType 跳转类型(0:不跳转,1:积分商品,2:活动,3:文章,4:页面跳转,5:课程,7门店跳转) bannerClick(BannerData bannerData) async { switch (bannerData.contentType) { case 1: @@ -101,6 +101,11 @@ class _HuiXiangBanner extends State { "id": bannerData.content, }); break; + case 7: + String params = bannerData.content.substring(bannerData.content.indexOf("?")+1); + Map map = jsonDecode(params); + Navigator.of(context).pushNamed(bannerData.content.substring(0,bannerData.content.indexOf("?")), arguments: map); + break; } } diff --git a/lib/home/points_mall_view/points_mall_banner.dart b/lib/home/points_mall_view/points_mall_banner.dart index 6ea77bdc..71624054 100644 --- a/lib/home/points_mall_view/points_mall_banner.dart +++ b/lib/home/points_mall_view/points_mall_banner.dart @@ -69,7 +69,7 @@ class _PointMallBanner extends State { ); } - /// contentType 跳转类型(0:不跳转,1:积分商品,2:活动,3:文章,4:页面跳转,5:课程) + /// contentType 跳转类型(0:不跳转,1:积分商品,2:活动,3:文章,4:页面跳转,5:课程,7:门店跳转) bannerClick(BannerData bannerData) async { switch (bannerData.contentType) { case 1: @@ -105,6 +105,11 @@ class _PointMallBanner extends State { "id": bannerData.content, }); break; + case 7: + String params = bannerData.content.substring(bannerData.content.indexOf("?")+1); + Map map = jsonDecode(params); + Navigator.of(context).pushNamed(bannerData.content.substring(0,bannerData.content.indexOf("?")), arguments: map); + break; } } diff --git a/lib/store/shopping/shopping_home/shopping_home_banner.dart b/lib/store/shopping/shopping_home/shopping_home_banner.dart index c544541b..5a69cac1 100644 --- a/lib/store/shopping/shopping_home/shopping_home_banner.dart +++ b/lib/store/shopping/shopping_home/shopping_home_banner.dart @@ -72,7 +72,7 @@ class _ShoppingHomeBanner extends State { ); } - /// contentType 跳转类型(0:不跳转,1:积分商品,2:活动,3:文章,4:页面跳转,5:课程) + /// contentType 跳转类型(0:不跳转,1:积分商品,2:活动,3:文章,4:页面跳转,5:课程,7:门店跳转) bannerClick(BannerData bannerData) async { switch (bannerData.contentType) { case 1: @@ -108,6 +108,11 @@ class _ShoppingHomeBanner extends State { "id": bannerData.content, }); break; + case 7: + String params = bannerData.content.substring(bannerData.content.indexOf("?")+1); + Map map = jsonDecode(params); + Navigator.of(context).pushNamed(bannerData.content.substring(0,bannerData.content.indexOf("?")), arguments: map); + break; } } } diff --git a/lib/view_widget/activity_poster.dart b/lib/view_widget/activity_poster.dart index 9500d023..0756b7a2 100644 --- a/lib/view_widget/activity_poster.dart +++ b/lib/view_widget/activity_poster.dart @@ -98,20 +98,20 @@ class _ActivityPoster extends State { ); } - /// contentType 跳转类型(0:不跳转,1:积分商品,2:活动,3:文章,4:页面跳转,5:课程) + /// contentType 跳转类型(0:不跳转,1:积分商品,2:活动,3:文章,4:页面跳转,5:课程,7:门店跳转) jumpClick(ActivityPos activityPos) async { switch (activityPos.jumpType) { case 1: - Navigator.of(context).pushNamed('/router/integral_store_page', + Navigator.of(context).popAndPushNamed('/router/integral_store_page', arguments: {"goodsId": widget.activityPos.jumpUrl}); break; case 2: - Navigator.of(context).pushNamed('/router/web_page', arguments: { + Navigator.of(context).popAndPushNamed('/router/web_page', arguments: { "activityId": widget.activityPos.jumpUrl, }); break; case 3: - Navigator.of(context).pushNamed('/router/web_page', arguments: { + Navigator.of(context).popAndPushNamed('/router/web_page', arguments: { "articleId": widget.activityPos.jumpUrl, }); break; @@ -121,16 +121,21 @@ class _ActivityPoster extends State { if (router.contains("?")) { String params = router.substring(router.indexOf("?")+1); Map map = jsonDecode(params); - Navigator.of(context).pushNamed(router.substring(0,router.indexOf("?")), arguments: map); + Navigator.of(context).popAndPushNamed(router.substring(0,router.indexOf("?")), arguments: map); } else { - Navigator.of(context).pushNamed(router); + Navigator.of(context).popAndPushNamed(router); } break; case 5: - Navigator.of(context).pushNamed('/router/class_details', arguments: { + Navigator.of(context).popAndPushNamed('/router/class_details', arguments: { "id": widget.activityPos.jumpUrl, }); break; + case 7: + String params = widget.activityPos.jumpUrl.substring(widget.activityPos.jumpUrl.indexOf("?")+1); + Map map = jsonDecode(params); + Navigator.of(context).popAndPushNamed(widget.activityPos.jumpUrl.substring(0,widget.activityPos.jumpUrl.indexOf("?")), arguments: map); + break; } } }