diff --git a/android/app/src/main/res/drawable-v21/launch_background.xml b/android/app/src/main/res/drawable-v21/launch_background.xml index da552175..c9a1a768 100644 --- a/android/app/src/main/res/drawable-v21/launch_background.xml +++ b/android/app/src/main/res/drawable-v21/launch_background.xml @@ -4,22 +4,22 @@ - - - + + + + + + android:src="@mipmap/icon_splash2" /> - + + android:src="@mipmap/icon_splash1" /> diff --git a/android/app/src/main/res/drawable/launch_background.xml b/android/app/src/main/res/drawable/launch_background.xml index 756e4d07..bef77a13 100644 --- a/android/app/src/main/res/drawable/launch_background.xml +++ b/android/app/src/main/res/drawable/launch_background.xml @@ -4,22 +4,22 @@ - - - + + + + + + android:src="@mipmap/icon_splash2" /> + android:src="@mipmap/icon_splash1" /> diff --git a/android/app/src/main/res/mipmap-hdpi/icon_splash.png b/android/app/src/main/res/mipmap-hdpi/icon_splash.png new file mode 100644 index 00000000..c22a1f71 Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/icon_splash.png differ diff --git a/android/app/src/main/res/mipmap-hdpi/icon_splash1.png b/android/app/src/main/res/mipmap-hdpi/icon_splash1.png new file mode 100644 index 00000000..01205335 Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/icon_splash1.png differ diff --git a/android/app/src/main/res/mipmap-hdpi/icon_splash2.png b/android/app/src/main/res/mipmap-hdpi/icon_splash2.png new file mode 100644 index 00000000..c9055707 Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/icon_splash2.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/icon_splash.png b/android/app/src/main/res/mipmap-mdpi/icon_splash.png new file mode 100644 index 00000000..e1a35129 Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/icon_splash.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/icon_splash1.png b/android/app/src/main/res/mipmap-mdpi/icon_splash1.png new file mode 100644 index 00000000..231e0721 Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/icon_splash1.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/icon_splash2.png b/android/app/src/main/res/mipmap-mdpi/icon_splash2.png new file mode 100644 index 00000000..dd840cac Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/icon_splash2.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/icon_splash.png b/android/app/src/main/res/mipmap-xhdpi/icon_splash.png new file mode 100644 index 00000000..6a1caa4d Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/icon_splash.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/icon_splash1.png b/android/app/src/main/res/mipmap-xhdpi/icon_splash1.png new file mode 100644 index 00000000..b939d384 Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/icon_splash1.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/icon_splash2.png b/android/app/src/main/res/mipmap-xhdpi/icon_splash2.png new file mode 100644 index 00000000..cdfe4f6f Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/icon_splash2.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/icon_splash.png b/android/app/src/main/res/mipmap-xxhdpi/icon_splash.png new file mode 100644 index 00000000..e18e12da Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/icon_splash.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/icon_splash1.png b/android/app/src/main/res/mipmap-xxhdpi/icon_splash1.png new file mode 100644 index 00000000..fd6be61e Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/icon_splash1.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/icon_splash2.png b/android/app/src/main/res/mipmap-xxhdpi/icon_splash2.png new file mode 100644 index 00000000..b71d62c2 Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/icon_splash2.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/icon_splash.png b/android/app/src/main/res/mipmap-xxxhdpi/icon_splash.png new file mode 100644 index 00000000..2c61cd3a Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/icon_splash.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/icon_splash1.png b/android/app/src/main/res/mipmap-xxxhdpi/icon_splash1.png new file mode 100644 index 00000000..828f5c1d Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/icon_splash1.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/icon_splash2.png b/android/app/src/main/res/mipmap-xxxhdpi/icon_splash2.png new file mode 100644 index 00000000..465de368 Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/icon_splash2.png differ diff --git a/assets/image/2x/bargain.webp b/assets/image/2x/bargain.webp new file mode 100644 index 00000000..62dff84a Binary files /dev/null and b/assets/image/2x/bargain.webp differ diff --git a/assets/image/2x/bill_gl.webp b/assets/image/2x/bill_gl.webp new file mode 100644 index 00000000..4e18de77 Binary files /dev/null and b/assets/image/2x/bill_gl.webp differ diff --git a/assets/image/2x/collage.webp b/assets/image/2x/collage.webp new file mode 100644 index 00000000..ff42761e Binary files /dev/null and b/assets/image/2x/collage.webp differ diff --git a/assets/image/2x/coupon.webp b/assets/image/2x/coupon.webp new file mode 100644 index 00000000..31a46606 Binary files /dev/null and b/assets/image/2x/coupon.webp differ diff --git a/assets/image/2x/discount.webp b/assets/image/2x/discount.webp new file mode 100644 index 00000000..00aa8f7e Binary files /dev/null and b/assets/image/2x/discount.webp differ diff --git a/assets/image/2x/dynamic.webp b/assets/image/2x/dynamic.webp deleted file mode 100644 index bf5f380c..00000000 Binary files a/assets/image/2x/dynamic.webp and /dev/null differ diff --git a/assets/image/2x/fan_kui.webp b/assets/image/2x/fan_kui.webp new file mode 100644 index 00000000..f6b791dc Binary files /dev/null and b/assets/image/2x/fan_kui.webp differ diff --git a/assets/image/2x/goods_shopp.webp b/assets/image/2x/goods_shopp.webp new file mode 100644 index 00000000..dc3d1e07 Binary files /dev/null and b/assets/image/2x/goods_shopp.webp differ diff --git a/assets/image/2x/green_leaf.webp b/assets/image/2x/green_leaf.webp new file mode 100644 index 00000000..af30df5d Binary files /dev/null and b/assets/image/2x/green_leaf.webp differ diff --git a/assets/image/2x/home_chi.webp b/assets/image/2x/home_chi.webp new file mode 100644 index 00000000..fb6e1f98 Binary files /dev/null and b/assets/image/2x/home_chi.webp differ diff --git a/assets/image/2x/home_coupon.webp b/assets/image/2x/home_coupon.webp deleted file mode 100644 index ebff850d..00000000 Binary files a/assets/image/2x/home_coupon.webp and /dev/null differ diff --git a/assets/image/2x/home_he.webp b/assets/image/2x/home_he.webp new file mode 100644 index 00000000..12222bfd Binary files /dev/null and b/assets/image/2x/home_he.webp differ diff --git a/assets/image/2x/home_lm.webp b/assets/image/2x/home_lm.webp new file mode 100644 index 00000000..8f7b28df Binary files /dev/null and b/assets/image/2x/home_lm.webp differ diff --git a/assets/image/2x/home_order.webp b/assets/image/2x/home_order.webp deleted file mode 100644 index aa503bf0..00000000 Binary files a/assets/image/2x/home_order.webp and /dev/null differ diff --git a/assets/image/2x/home_recharge.webp b/assets/image/2x/home_recharge.webp index d41bdd1c..154d654f 100644 Binary files a/assets/image/2x/home_recharge.webp and b/assets/image/2x/home_recharge.webp differ diff --git a/assets/image/2x/home_wan.webp b/assets/image/2x/home_wan.webp new file mode 100644 index 00000000..c6389231 Binary files /dev/null and b/assets/image/2x/home_wan.webp differ diff --git a/assets/image/2x/home_welfare.webp b/assets/image/2x/home_welfare.webp new file mode 100644 index 00000000..daa3b646 Binary files /dev/null and b/assets/image/2x/home_welfare.webp differ diff --git a/assets/image/2x/ic_splash_bg.webp b/assets/image/2x/ic_splash_bg.webp index a723fa10..6a1caa4d 100644 Binary files a/assets/image/2x/ic_splash_bg.webp and b/assets/image/2x/ic_splash_bg.webp differ diff --git a/assets/image/2x/icon_attainment.webp b/assets/image/2x/icon_attainment.webp new file mode 100644 index 00000000..e5e9243e Binary files /dev/null and b/assets/image/2x/icon_attainment.webp differ diff --git a/assets/image/2x/icon_location_address.webp b/assets/image/2x/icon_location_address.webp deleted file mode 100644 index b8ac737b..00000000 Binary files a/assets/image/2x/icon_location_address.webp and /dev/null differ diff --git a/assets/image/2x/icon_mine_card.webp b/assets/image/2x/icon_mine_card.webp deleted file mode 100644 index 1bfc1e22..00000000 Binary files a/assets/image/2x/icon_mine_card.webp and /dev/null differ diff --git a/assets/image/2x/icon_mine_online_service.webp b/assets/image/2x/icon_mine_online_service.webp deleted file mode 100644 index b2cd9aef..00000000 Binary files a/assets/image/2x/icon_mine_online_service.webp and /dev/null differ diff --git a/assets/image/2x/icon_mine_promotion_code.webp b/assets/image/2x/icon_mine_promotion_code.webp deleted file mode 100644 index 6ccfccbc..00000000 Binary files a/assets/image/2x/icon_mine_promotion_code.webp and /dev/null differ diff --git a/assets/image/2x/icon_mine_records_of_consumption.webp b/assets/image/2x/icon_mine_records_of_consumption.webp deleted file mode 100644 index 84276882..00000000 Binary files a/assets/image/2x/icon_mine_records_of_consumption.webp and /dev/null differ diff --git a/assets/image/2x/icon_notices.webp b/assets/image/2x/icon_notices.webp index f95279ce..512316ee 100644 Binary files a/assets/image/2x/icon_notices.webp and b/assets/image/2x/icon_notices.webp differ diff --git a/assets/image/2x/icon_union_location.png.webp b/assets/image/2x/icon_union_location.png.webp deleted file mode 100644 index 6e9bf5d5..00000000 Binary files a/assets/image/2x/icon_union_location.png.webp and /dev/null differ diff --git a/assets/image/2x/icon_upload.webp b/assets/image/2x/icon_upload.webp new file mode 100644 index 00000000..85ed0f37 Binary files /dev/null and b/assets/image/2x/icon_upload.webp differ diff --git a/assets/image/2x/invite_bj.webp b/assets/image/2x/invite_bj.webp new file mode 100644 index 00000000..aaab7757 Binary files /dev/null and b/assets/image/2x/invite_bj.webp differ diff --git a/assets/image/2x/invite_q.webp b/assets/image/2x/invite_q.webp new file mode 100644 index 00000000..abc93c3e Binary files /dev/null and b/assets/image/2x/invite_q.webp differ diff --git a/assets/image/2x/invite_wx.webp b/assets/image/2x/invite_wx.webp new file mode 100644 index 00000000..3b727782 Binary files /dev/null and b/assets/image/2x/invite_wx.webp differ diff --git a/assets/image/2x/ji_fen.webp b/assets/image/2x/ji_fen.webp deleted file mode 100644 index 583ab06c..00000000 Binary files a/assets/image/2x/ji_fen.webp and /dev/null differ diff --git a/assets/image/2x/jifen.webp b/assets/image/2x/jifen.webp new file mode 100644 index 00000000..60aea05e Binary files /dev/null and b/assets/image/2x/jifen.webp differ diff --git a/assets/image/2x/kan_jia.webp b/assets/image/2x/kan_jia.webp deleted file mode 100644 index a89449be..00000000 Binary files a/assets/image/2x/kan_jia.webp and /dev/null differ diff --git a/assets/image/2x/login_bott.webp b/assets/image/2x/login_bott.webp new file mode 100644 index 00000000..48ae077f Binary files /dev/null and b/assets/image/2x/login_bott.webp differ diff --git a/assets/image/2x/pin_tuan.webp b/assets/image/2x/pin_tuan.webp deleted file mode 100644 index 92eb9846..00000000 Binary files a/assets/image/2x/pin_tuan.webp and /dev/null differ diff --git a/assets/image/2x/platform_yue.webp b/assets/image/2x/platform_yue.webp new file mode 100644 index 00000000..87643c3c Binary files /dev/null and b/assets/image/2x/platform_yue.webp differ diff --git a/assets/image/2x/ranking1.webp b/assets/image/2x/ranking1.webp new file mode 100644 index 00000000..1d9691fa Binary files /dev/null and b/assets/image/2x/ranking1.webp differ diff --git a/assets/image/2x/ranking2.webp b/assets/image/2x/ranking2.webp new file mode 100644 index 00000000..d270431b Binary files /dev/null and b/assets/image/2x/ranking2.webp differ diff --git a/assets/image/2x/ranking3.webp b/assets/image/2x/ranking3.webp new file mode 100644 index 00000000..ece7e5e4 Binary files /dev/null and b/assets/image/2x/ranking3.webp differ diff --git a/assets/image/2x/report_h.webp b/assets/image/2x/report_h.webp new file mode 100644 index 00000000..48fde5db Binary files /dev/null and b/assets/image/2x/report_h.webp differ diff --git a/assets/image/2x/report_un.webp b/assets/image/2x/report_un.webp new file mode 100644 index 00000000..d9cec8fc Binary files /dev/null and b/assets/image/2x/report_un.webp differ diff --git a/assets/image/2x/s_bg.webp b/assets/image/2x/s_bg.webp new file mode 100644 index 00000000..8159d85f Binary files /dev/null and b/assets/image/2x/s_bg.webp differ diff --git a/assets/image/2x/settled.webp b/assets/image/2x/settled.webp new file mode 100644 index 00000000..2bbf1f15 Binary files /dev/null and b/assets/image/2x/settled.webp differ diff --git a/assets/image/2x/shop_yue.webp b/assets/image/2x/shop_yue.webp new file mode 100644 index 00000000..3e4c8caf Binary files /dev/null and b/assets/image/2x/shop_yue.webp differ diff --git a/assets/image/2x/shu1.webp b/assets/image/2x/shu1.webp new file mode 100644 index 00000000..8a059ee9 Binary files /dev/null and b/assets/image/2x/shu1.webp differ diff --git a/assets/image/2x/shu2.webp b/assets/image/2x/shu2.webp new file mode 100644 index 00000000..4ecd3819 Binary files /dev/null and b/assets/image/2x/shu2.webp differ diff --git a/assets/image/2x/shu3.webp b/assets/image/2x/shu3.webp new file mode 100644 index 00000000..5af3d4d8 Binary files /dev/null and b/assets/image/2x/shu3.webp differ diff --git a/assets/image/2x/shu_bg.webp b/assets/image/2x/shu_bg.webp new file mode 100644 index 00000000..7a988264 Binary files /dev/null and b/assets/image/2x/shu_bg.webp differ diff --git a/assets/image/2x/week_coupons.png b/assets/image/2x/week_coupons.png new file mode 100644 index 00000000..b72f25bd Binary files /dev/null and b/assets/image/2x/week_coupons.png differ diff --git a/assets/image/2x/welfare1.webp b/assets/image/2x/welfare1.webp new file mode 100644 index 00000000..58d41dba Binary files /dev/null and b/assets/image/2x/welfare1.webp differ diff --git a/assets/image/2x/welfare2.webp b/assets/image/2x/welfare2.webp new file mode 100644 index 00000000..523dfa04 Binary files /dev/null and b/assets/image/2x/welfare2.webp differ diff --git a/assets/image/2x/welfare3.webp b/assets/image/2x/welfare3.webp new file mode 100644 index 00000000..7efea2aa Binary files /dev/null and b/assets/image/2x/welfare3.webp differ diff --git a/assets/image/2x/welfare_zx.webp b/assets/image/2x/welfare_zx.webp new file mode 100644 index 00000000..a8fb64d7 Binary files /dev/null and b/assets/image/2x/welfare_zx.webp differ diff --git a/assets/image/2x/yao_q.webp b/assets/image/2x/yao_q.webp deleted file mode 100644 index 853b1f53..00000000 Binary files a/assets/image/2x/yao_q.webp and /dev/null differ diff --git a/assets/image/2x/yz_l.webp b/assets/image/2x/yz_l.webp new file mode 100644 index 00000000..c0173ffe Binary files /dev/null and b/assets/image/2x/yz_l.webp differ diff --git a/assets/image/2x/yz_r.webp b/assets/image/2x/yz_r.webp new file mode 100644 index 00000000..8f2a87fb Binary files /dev/null and b/assets/image/2x/yz_r.webp differ diff --git a/assets/image/3x/bargain.webp b/assets/image/3x/bargain.webp new file mode 100644 index 00000000..888fd2e1 Binary files /dev/null and b/assets/image/3x/bargain.webp differ diff --git a/assets/image/3x/bill_gl.webp b/assets/image/3x/bill_gl.webp new file mode 100644 index 00000000..bad507f5 Binary files /dev/null and b/assets/image/3x/bill_gl.webp differ diff --git a/assets/image/3x/collage.webp b/assets/image/3x/collage.webp new file mode 100644 index 00000000..1a691c99 Binary files /dev/null and b/assets/image/3x/collage.webp differ diff --git a/assets/image/3x/coupon.webp b/assets/image/3x/coupon.webp new file mode 100644 index 00000000..16fa9f49 Binary files /dev/null and b/assets/image/3x/coupon.webp differ diff --git a/assets/image/3x/discount.webp b/assets/image/3x/discount.webp new file mode 100644 index 00000000..16719e2d Binary files /dev/null and b/assets/image/3x/discount.webp differ diff --git a/assets/image/3x/dynamic.webp b/assets/image/3x/dynamic.webp deleted file mode 100644 index 02b32ba9..00000000 Binary files a/assets/image/3x/dynamic.webp and /dev/null differ diff --git a/assets/image/3x/fan_kui.webp b/assets/image/3x/fan_kui.webp new file mode 100644 index 00000000..d90b45f3 Binary files /dev/null and b/assets/image/3x/fan_kui.webp differ diff --git a/assets/image/3x/goods_shopp.webp b/assets/image/3x/goods_shopp.webp new file mode 100644 index 00000000..e192cfe2 Binary files /dev/null and b/assets/image/3x/goods_shopp.webp differ diff --git a/assets/image/3x/green_leaf.webp b/assets/image/3x/green_leaf.webp new file mode 100644 index 00000000..1588d4aa Binary files /dev/null and b/assets/image/3x/green_leaf.webp differ diff --git a/assets/image/3x/home_chi.webp b/assets/image/3x/home_chi.webp new file mode 100644 index 00000000..f00ba8e4 Binary files /dev/null and b/assets/image/3x/home_chi.webp differ diff --git a/assets/image/3x/home_coupon.webp b/assets/image/3x/home_coupon.webp deleted file mode 100644 index b0f3c673..00000000 Binary files a/assets/image/3x/home_coupon.webp and /dev/null differ diff --git a/assets/image/3x/home_he.webp b/assets/image/3x/home_he.webp new file mode 100644 index 00000000..248f8de9 Binary files /dev/null and b/assets/image/3x/home_he.webp differ diff --git a/assets/image/3x/home_lm.webp b/assets/image/3x/home_lm.webp new file mode 100644 index 00000000..f08d09f8 Binary files /dev/null and b/assets/image/3x/home_lm.webp differ diff --git a/assets/image/3x/home_order.webp b/assets/image/3x/home_order.webp deleted file mode 100644 index dec64d03..00000000 Binary files a/assets/image/3x/home_order.webp and /dev/null differ diff --git a/assets/image/3x/home_recharge.webp b/assets/image/3x/home_recharge.webp index 03ed58fb..d90ee0f4 100644 Binary files a/assets/image/3x/home_recharge.webp and b/assets/image/3x/home_recharge.webp differ diff --git a/assets/image/3x/home_wan.webp b/assets/image/3x/home_wan.webp new file mode 100644 index 00000000..17a39e22 Binary files /dev/null and b/assets/image/3x/home_wan.webp differ diff --git a/assets/image/3x/home_welfare.webp b/assets/image/3x/home_welfare.webp new file mode 100644 index 00000000..06b2d229 Binary files /dev/null and b/assets/image/3x/home_welfare.webp differ diff --git a/assets/image/3x/ic_splash_bg.webp b/assets/image/3x/ic_splash_bg.webp index e23b2ab5..e18e12da 100644 Binary files a/assets/image/3x/ic_splash_bg.webp and b/assets/image/3x/ic_splash_bg.webp differ diff --git a/assets/image/3x/icon_attainment.webp b/assets/image/3x/icon_attainment.webp new file mode 100644 index 00000000..56f8da9a Binary files /dev/null and b/assets/image/3x/icon_attainment.webp differ diff --git a/assets/image/3x/icon_location_address.webp b/assets/image/3x/icon_location_address.webp deleted file mode 100644 index 6173f5c3..00000000 Binary files a/assets/image/3x/icon_location_address.webp and /dev/null differ diff --git a/assets/image/3x/icon_mine_card.webp b/assets/image/3x/icon_mine_card.webp deleted file mode 100644 index 81271b37..00000000 Binary files a/assets/image/3x/icon_mine_card.webp and /dev/null differ diff --git a/assets/image/3x/icon_mine_online_service.webp b/assets/image/3x/icon_mine_online_service.webp deleted file mode 100644 index 5e44161c..00000000 Binary files a/assets/image/3x/icon_mine_online_service.webp and /dev/null differ diff --git a/assets/image/3x/icon_mine_promotion_code.webp b/assets/image/3x/icon_mine_promotion_code.webp deleted file mode 100644 index 6be58329..00000000 Binary files a/assets/image/3x/icon_mine_promotion_code.webp and /dev/null differ diff --git a/assets/image/3x/icon_mine_records_of_consumption.webp b/assets/image/3x/icon_mine_records_of_consumption.webp deleted file mode 100644 index bd664651..00000000 Binary files a/assets/image/3x/icon_mine_records_of_consumption.webp and /dev/null differ diff --git a/assets/image/3x/icon_notices.webp b/assets/image/3x/icon_notices.webp index 79df1d47..2a93cbae 100644 Binary files a/assets/image/3x/icon_notices.webp and b/assets/image/3x/icon_notices.webp differ diff --git a/assets/image/3x/icon_union_location.png.webp b/assets/image/3x/icon_union_location.png.webp deleted file mode 100644 index 123ce93e..00000000 Binary files a/assets/image/3x/icon_union_location.png.webp and /dev/null differ diff --git a/assets/image/3x/icon_upload.webp b/assets/image/3x/icon_upload.webp new file mode 100644 index 00000000..4e001955 Binary files /dev/null and b/assets/image/3x/icon_upload.webp differ diff --git a/assets/image/3x/invite_bj.webp b/assets/image/3x/invite_bj.webp new file mode 100644 index 00000000..3f5cae1c Binary files /dev/null and b/assets/image/3x/invite_bj.webp differ diff --git a/assets/image/3x/invite_q.webp b/assets/image/3x/invite_q.webp new file mode 100644 index 00000000..7e828112 Binary files /dev/null and b/assets/image/3x/invite_q.webp differ diff --git a/assets/image/3x/invite_wx.webp b/assets/image/3x/invite_wx.webp new file mode 100644 index 00000000..e7f29645 Binary files /dev/null and b/assets/image/3x/invite_wx.webp differ diff --git a/assets/image/3x/ji_fen.webp b/assets/image/3x/ji_fen.webp deleted file mode 100644 index 35ef05d6..00000000 Binary files a/assets/image/3x/ji_fen.webp and /dev/null differ diff --git a/assets/image/3x/jifen.webp b/assets/image/3x/jifen.webp new file mode 100644 index 00000000..bab5f98e Binary files /dev/null and b/assets/image/3x/jifen.webp differ diff --git a/assets/image/3x/kan_jia.webp b/assets/image/3x/kan_jia.webp deleted file mode 100644 index c3a3ec9a..00000000 Binary files a/assets/image/3x/kan_jia.webp and /dev/null differ diff --git a/assets/image/3x/login_bott.webp b/assets/image/3x/login_bott.webp new file mode 100644 index 00000000..3a405630 Binary files /dev/null and b/assets/image/3x/login_bott.webp differ diff --git a/assets/image/3x/pin_tuan.webp b/assets/image/3x/pin_tuan.webp deleted file mode 100644 index 58ce53af..00000000 Binary files a/assets/image/3x/pin_tuan.webp and /dev/null differ diff --git a/assets/image/3x/platform_yue.webp b/assets/image/3x/platform_yue.webp new file mode 100644 index 00000000..d6f1cab4 Binary files /dev/null and b/assets/image/3x/platform_yue.webp differ diff --git a/assets/image/3x/ranking1.webp b/assets/image/3x/ranking1.webp new file mode 100644 index 00000000..4b1411da Binary files /dev/null and b/assets/image/3x/ranking1.webp differ diff --git a/assets/image/3x/ranking2.webp b/assets/image/3x/ranking2.webp new file mode 100644 index 00000000..40711f1a Binary files /dev/null and b/assets/image/3x/ranking2.webp differ diff --git a/assets/image/3x/ranking3.webp b/assets/image/3x/ranking3.webp new file mode 100644 index 00000000..218053c7 Binary files /dev/null and b/assets/image/3x/ranking3.webp differ diff --git a/assets/image/3x/report_h.webp b/assets/image/3x/report_h.webp new file mode 100644 index 00000000..fd9053bc Binary files /dev/null and b/assets/image/3x/report_h.webp differ diff --git a/assets/image/3x/report_un.webp b/assets/image/3x/report_un.webp new file mode 100644 index 00000000..d00e3670 Binary files /dev/null and b/assets/image/3x/report_un.webp differ diff --git a/assets/image/3x/s_bg.webp b/assets/image/3x/s_bg.webp new file mode 100644 index 00000000..1f4a3d4c Binary files /dev/null and b/assets/image/3x/s_bg.webp differ diff --git a/assets/image/3x/settled.webp b/assets/image/3x/settled.webp new file mode 100644 index 00000000..5910dee2 Binary files /dev/null and b/assets/image/3x/settled.webp differ diff --git a/assets/image/3x/shop_yue.webp b/assets/image/3x/shop_yue.webp new file mode 100644 index 00000000..491ea6ca Binary files /dev/null and b/assets/image/3x/shop_yue.webp differ diff --git a/assets/image/3x/shu1.webp b/assets/image/3x/shu1.webp new file mode 100644 index 00000000..db81460b Binary files /dev/null and b/assets/image/3x/shu1.webp differ diff --git a/assets/image/3x/shu2.webp b/assets/image/3x/shu2.webp new file mode 100644 index 00000000..77eb373c Binary files /dev/null and b/assets/image/3x/shu2.webp differ diff --git a/assets/image/3x/shu3.webp b/assets/image/3x/shu3.webp new file mode 100644 index 00000000..55777acf Binary files /dev/null and b/assets/image/3x/shu3.webp differ diff --git a/assets/image/3x/shu_bg.webp b/assets/image/3x/shu_bg.webp new file mode 100644 index 00000000..bf72af00 Binary files /dev/null and b/assets/image/3x/shu_bg.webp differ diff --git a/assets/image/3x/week_coupons.png b/assets/image/3x/week_coupons.png new file mode 100644 index 00000000..34250fe2 Binary files /dev/null and b/assets/image/3x/week_coupons.png differ diff --git a/assets/image/3x/welfare1.webp b/assets/image/3x/welfare1.webp new file mode 100644 index 00000000..1c700577 Binary files /dev/null and b/assets/image/3x/welfare1.webp differ diff --git a/assets/image/3x/welfare2.webp b/assets/image/3x/welfare2.webp new file mode 100644 index 00000000..2106d481 Binary files /dev/null and b/assets/image/3x/welfare2.webp differ diff --git a/assets/image/3x/welfare3.webp b/assets/image/3x/welfare3.webp new file mode 100644 index 00000000..8f0d0898 Binary files /dev/null and b/assets/image/3x/welfare3.webp differ diff --git a/assets/image/3x/welfare_zx.webp b/assets/image/3x/welfare_zx.webp new file mode 100644 index 00000000..17365d1f Binary files /dev/null and b/assets/image/3x/welfare_zx.webp differ diff --git a/assets/image/3x/yao_q.webp b/assets/image/3x/yao_q.webp deleted file mode 100644 index df8d5da2..00000000 Binary files a/assets/image/3x/yao_q.webp and /dev/null differ diff --git a/assets/image/3x/yz_l.webp b/assets/image/3x/yz_l.webp new file mode 100644 index 00000000..63cf3642 Binary files /dev/null and b/assets/image/3x/yz_l.webp differ diff --git a/assets/image/3x/yz_r.webp b/assets/image/3x/yz_r.webp new file mode 100644 index 00000000..f7f02569 Binary files /dev/null and b/assets/image/3x/yz_r.webp differ diff --git a/assets/image/bargain.webp b/assets/image/bargain.webp new file mode 100644 index 00000000..fc703e43 Binary files /dev/null and b/assets/image/bargain.webp differ diff --git a/assets/image/bill_gl.webp b/assets/image/bill_gl.webp new file mode 100644 index 00000000..35826336 Binary files /dev/null and b/assets/image/bill_gl.webp differ diff --git a/assets/image/collage.webp b/assets/image/collage.webp new file mode 100644 index 00000000..3b78546e Binary files /dev/null and b/assets/image/collage.webp differ diff --git a/assets/image/coupon.webp b/assets/image/coupon.webp new file mode 100644 index 00000000..0cc53fb8 Binary files /dev/null and b/assets/image/coupon.webp differ diff --git a/assets/image/discount.webp b/assets/image/discount.webp new file mode 100644 index 00000000..333e19ed Binary files /dev/null and b/assets/image/discount.webp differ diff --git a/assets/image/dynamic.webp b/assets/image/dynamic.webp deleted file mode 100644 index 112a7449..00000000 Binary files a/assets/image/dynamic.webp and /dev/null differ diff --git a/assets/image/fan_kui.webp b/assets/image/fan_kui.webp new file mode 100644 index 00000000..7ff9411a Binary files /dev/null and b/assets/image/fan_kui.webp differ diff --git a/assets/image/goods_shopp.webp b/assets/image/goods_shopp.webp new file mode 100644 index 00000000..6a62b129 Binary files /dev/null and b/assets/image/goods_shopp.webp differ diff --git a/assets/image/green_leaf.webp b/assets/image/green_leaf.webp new file mode 100644 index 00000000..054b2f65 Binary files /dev/null and b/assets/image/green_leaf.webp differ diff --git a/assets/image/home_chi.webp b/assets/image/home_chi.webp new file mode 100644 index 00000000..0b5c343f Binary files /dev/null and b/assets/image/home_chi.webp differ diff --git a/assets/image/home_coupon.webp b/assets/image/home_coupon.webp deleted file mode 100644 index 51c19d67..00000000 Binary files a/assets/image/home_coupon.webp and /dev/null differ diff --git a/assets/image/home_he.webp b/assets/image/home_he.webp new file mode 100644 index 00000000..33c1dd44 Binary files /dev/null and b/assets/image/home_he.webp differ diff --git a/assets/image/home_lm.webp b/assets/image/home_lm.webp new file mode 100644 index 00000000..7997a2e9 Binary files /dev/null and b/assets/image/home_lm.webp differ diff --git a/assets/image/home_order.webp b/assets/image/home_order.webp deleted file mode 100644 index 8d2cc35e..00000000 Binary files a/assets/image/home_order.webp and /dev/null differ diff --git a/assets/image/home_recharge.webp b/assets/image/home_recharge.webp index 85fe28dc..b750d260 100644 Binary files a/assets/image/home_recharge.webp and b/assets/image/home_recharge.webp differ diff --git a/assets/image/home_wan.webp b/assets/image/home_wan.webp new file mode 100644 index 00000000..00a4d9a8 Binary files /dev/null and b/assets/image/home_wan.webp differ diff --git a/assets/image/home_welfare.webp b/assets/image/home_welfare.webp new file mode 100644 index 00000000..d73472aa Binary files /dev/null and b/assets/image/home_welfare.webp differ diff --git a/assets/image/ic_splash_bg.webp b/assets/image/ic_splash_bg.webp index b95c3416..e1a35129 100644 Binary files a/assets/image/ic_splash_bg.webp and b/assets/image/ic_splash_bg.webp differ diff --git a/assets/image/icon_attainment.webp b/assets/image/icon_attainment.webp new file mode 100644 index 00000000..b28b1eef Binary files /dev/null and b/assets/image/icon_attainment.webp differ diff --git a/assets/image/icon_location_address.webp b/assets/image/icon_location_address.webp deleted file mode 100644 index 174e1772..00000000 Binary files a/assets/image/icon_location_address.webp and /dev/null differ diff --git a/assets/image/icon_mine_card.webp b/assets/image/icon_mine_card.webp deleted file mode 100644 index 150b7133..00000000 Binary files a/assets/image/icon_mine_card.webp and /dev/null differ diff --git a/assets/image/icon_mine_online_service.webp b/assets/image/icon_mine_online_service.webp deleted file mode 100644 index be33bb54..00000000 Binary files a/assets/image/icon_mine_online_service.webp and /dev/null differ diff --git a/assets/image/icon_mine_promotion_code.webp b/assets/image/icon_mine_promotion_code.webp deleted file mode 100644 index e80bad6b..00000000 Binary files a/assets/image/icon_mine_promotion_code.webp and /dev/null differ diff --git a/assets/image/icon_mine_records_of_consumption.webp b/assets/image/icon_mine_records_of_consumption.webp deleted file mode 100644 index cbe2a21a..00000000 Binary files a/assets/image/icon_mine_records_of_consumption.webp and /dev/null differ diff --git a/assets/image/icon_notices.webp b/assets/image/icon_notices.webp index 0a982669..717e6f72 100644 Binary files a/assets/image/icon_notices.webp and b/assets/image/icon_notices.webp differ diff --git a/assets/image/icon_upload.webp b/assets/image/icon_upload.webp new file mode 100644 index 00000000..0b69c513 Binary files /dev/null and b/assets/image/icon_upload.webp differ diff --git a/assets/image/invite_bj.webp b/assets/image/invite_bj.webp new file mode 100644 index 00000000..f1ab9dc0 Binary files /dev/null and b/assets/image/invite_bj.webp differ diff --git a/assets/image/invite_q.webp b/assets/image/invite_q.webp new file mode 100644 index 00000000..05c51073 Binary files /dev/null and b/assets/image/invite_q.webp differ diff --git a/assets/image/invite_wx.webp b/assets/image/invite_wx.webp new file mode 100644 index 00000000..8bd3955f Binary files /dev/null and b/assets/image/invite_wx.webp differ diff --git a/assets/image/ji_fen.webp b/assets/image/ji_fen.webp deleted file mode 100644 index 1859de1b..00000000 Binary files a/assets/image/ji_fen.webp and /dev/null differ diff --git a/assets/image/jifen.webp b/assets/image/jifen.webp new file mode 100644 index 00000000..a8bea80c Binary files /dev/null and b/assets/image/jifen.webp differ diff --git a/assets/image/kan_jia.webp b/assets/image/kan_jia.webp deleted file mode 100644 index 053248f3..00000000 Binary files a/assets/image/kan_jia.webp and /dev/null differ diff --git a/assets/image/login_bott.webp b/assets/image/login_bott.webp new file mode 100644 index 00000000..f5d41f3b Binary files /dev/null and b/assets/image/login_bott.webp differ diff --git a/assets/image/pin_tuan.webp b/assets/image/pin_tuan.webp deleted file mode 100644 index 57476040..00000000 Binary files a/assets/image/pin_tuan.webp and /dev/null differ diff --git a/assets/image/platform_yue.webp b/assets/image/platform_yue.webp new file mode 100644 index 00000000..d43d0057 Binary files /dev/null and b/assets/image/platform_yue.webp differ diff --git a/assets/image/ranking1.webp b/assets/image/ranking1.webp new file mode 100644 index 00000000..a035bf6b Binary files /dev/null and b/assets/image/ranking1.webp differ diff --git a/assets/image/ranking2.webp b/assets/image/ranking2.webp new file mode 100644 index 00000000..b65ed8a9 Binary files /dev/null and b/assets/image/ranking2.webp differ diff --git a/assets/image/ranking3.webp b/assets/image/ranking3.webp new file mode 100644 index 00000000..9abc1d15 Binary files /dev/null and b/assets/image/ranking3.webp differ diff --git a/assets/image/report_h.webp b/assets/image/report_h.webp new file mode 100644 index 00000000..9b7cdd66 Binary files /dev/null and b/assets/image/report_h.webp differ diff --git a/assets/image/report_un.webp b/assets/image/report_un.webp new file mode 100644 index 00000000..0d0e0e75 Binary files /dev/null and b/assets/image/report_un.webp differ diff --git a/assets/image/s_bg.webp b/assets/image/s_bg.webp new file mode 100644 index 00000000..4abfa998 Binary files /dev/null and b/assets/image/s_bg.webp differ diff --git a/assets/image/settled.webp b/assets/image/settled.webp new file mode 100644 index 00000000..085f1fb3 Binary files /dev/null and b/assets/image/settled.webp differ diff --git a/assets/image/shop_yue.webp b/assets/image/shop_yue.webp new file mode 100644 index 00000000..7750a1de Binary files /dev/null and b/assets/image/shop_yue.webp differ diff --git a/assets/image/shu1.webp b/assets/image/shu1.webp new file mode 100644 index 00000000..4c6375ac Binary files /dev/null and b/assets/image/shu1.webp differ diff --git a/assets/image/shu2.webp b/assets/image/shu2.webp new file mode 100644 index 00000000..43ea6d11 Binary files /dev/null and b/assets/image/shu2.webp differ diff --git a/assets/image/shu3.webp b/assets/image/shu3.webp new file mode 100644 index 00000000..73a33466 Binary files /dev/null and b/assets/image/shu3.webp differ diff --git a/assets/image/shu_bg.webp b/assets/image/shu_bg.webp new file mode 100644 index 00000000..cfbc82a5 Binary files /dev/null and b/assets/image/shu_bg.webp differ diff --git a/assets/image/week_coupons.png b/assets/image/week_coupons.png new file mode 100644 index 00000000..fc926870 Binary files /dev/null and b/assets/image/week_coupons.png differ diff --git a/assets/image/welfare1.webp b/assets/image/welfare1.webp new file mode 100644 index 00000000..7a680ab5 Binary files /dev/null and b/assets/image/welfare1.webp differ diff --git a/assets/image/welfare2.webp b/assets/image/welfare2.webp new file mode 100644 index 00000000..03008186 Binary files /dev/null and b/assets/image/welfare2.webp differ diff --git a/assets/image/welfare3.webp b/assets/image/welfare3.webp new file mode 100644 index 00000000..81cc0226 Binary files /dev/null and b/assets/image/welfare3.webp differ diff --git a/assets/image/welfare_zx.webp b/assets/image/welfare_zx.webp new file mode 100644 index 00000000..c2fabcd7 Binary files /dev/null and b/assets/image/welfare_zx.webp differ diff --git a/assets/image/yao_q.webp b/assets/image/yao_q.webp deleted file mode 100644 index df6e379f..00000000 Binary files a/assets/image/yao_q.webp and /dev/null differ diff --git a/assets/image/yz_l.webp b/assets/image/yz_l.webp new file mode 100644 index 00000000..ca7bfe36 Binary files /dev/null and b/assets/image/yz_l.webp differ diff --git a/assets/image/yz_r.webp b/assets/image/yz_r.webp new file mode 100644 index 00000000..e9ba86f2 Binary files /dev/null and b/assets/image/yz_r.webp differ diff --git a/assets/svg/lianmeng.svg b/assets/svg/lianmeng.svg index 4792864c..73fc8c0a 100644 --- a/assets/svg/lianmeng.svg +++ b/assets/svg/lianmeng.svg @@ -1,20 +1,11 @@ - 编组 7 + 编组 8备份 4 - - - - - - - - - - - - - + + + + \ No newline at end of file diff --git a/assets/svg/shequn.svg b/assets/svg/shequn.svg index f7f8c1e4..2f22dfe2 100644 --- a/assets/svg/shequn.svg +++ b/assets/svg/shequn.svg @@ -1,13 +1,12 @@ - 编组 9 + 编组 12备份 2 - - + + - - + diff --git a/assets/svg/shequn1.svg b/assets/svg/shequn1.svg new file mode 100644 index 00000000..f7f8c1e4 --- /dev/null +++ b/assets/svg/shequn1.svg @@ -0,0 +1,14 @@ + + + 编组 9 + + + + + + + + + + + \ No newline at end of file diff --git a/assets/svg/wode.svg b/assets/svg/wode.svg index 3d07a2d0..4fa0c074 100644 --- a/assets/svg/wode.svg +++ b/assets/svg/wode.svg @@ -1,14 +1,12 @@ - 编组 33 + 编组 13备份 2 - - + + - - - + diff --git a/assets/svg/wode1.svg b/assets/svg/wode1.svg new file mode 100644 index 00000000..3d07a2d0 --- /dev/null +++ b/assets/svg/wode1.svg @@ -0,0 +1,15 @@ + + + 编组 33 + + + + + + + + + + + + \ No newline at end of file diff --git a/lib/community/community_view/community_dynamic.dart b/lib/community/community_view/community_dynamic.dart index 52bcd4a2..fe7c2a9a 100644 --- a/lib/community/community_view/community_dynamic.dart +++ b/lib/community/community_view/community_dynamic.dart @@ -443,13 +443,9 @@ class _CommunityDynamic extends State { padding: EdgeInsets.only(top:3,bottom: 16), alignment: Alignment.center, // color: Colors.red, - child: Text( - "...", - style: TextStyle( - fontSize: 18.sp, - fontWeight: MyFontWeight.medium, - color: Colors.black, - ), + child: Icon( + Icons.more_horiz, + color: Colors.black, ), ))), ], diff --git a/lib/community/headlines/article_page.dart b/lib/community/headlines/article_page.dart index c19033c9..355fb429 100644 --- a/lib/community/headlines/article_page.dart +++ b/lib/community/headlines/article_page.dart @@ -18,6 +18,7 @@ import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/view_widget/classic_header.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:huixiang/view_widget/my_footer.dart'; +import 'package:huixiang/view_widget/store_title_tab.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:shared_preferences/shared_preferences.dart'; diff --git a/lib/generated/intl/messages_en.dart b/lib/generated/intl/messages_en.dart index d7adc5e3..83a3d946 100644 --- a/lib/generated/intl/messages_en.dart +++ b/lib/generated/intl/messages_en.dart @@ -477,7 +477,7 @@ class MessageLookup extends MessageLookupByLibrary { "ruxutuikuanqingyumendianlianxi" : MessageLookupByLibrary.simpleMessage("如需退款,请您提前准备好订单号/取单号,并与门店人员进行联系"), "saoma" : MessageLookupByLibrary.simpleMessage("扫码"), "saomashibieguanzhugongzonghao" : MessageLookupByLibrary.simpleMessage("扫码识别,关注公众号"), - "send_code" : MessageLookupByLibrary.simpleMessage("发送验证"), + "send_code" : MessageLookupByLibrary.simpleMessage("发送验证码"), "shanchu" : MessageLookupByLibrary.simpleMessage("删除"), "shanchudingdan" : MessageLookupByLibrary.simpleMessage("删除一单"), "shangjiaquan" : MessageLookupByLibrary.simpleMessage("商家券"), diff --git a/lib/generated/intl/messages_zh_CN.dart b/lib/generated/intl/messages_zh_CN.dart index 30ab2e21..8b7dad03 100644 --- a/lib/generated/intl/messages_zh_CN.dart +++ b/lib/generated/intl/messages_zh_CN.dart @@ -475,7 +475,7 @@ class MessageLookup extends MessageLookupByLibrary { "ruxutuikuanqingyumendianlianxi" : MessageLookupByLibrary.simpleMessage("如需退款,请您提前准备好订单号/取单号,并与门店人员进行联系"), "saoma" : MessageLookupByLibrary.simpleMessage("扫码"), "saomashibieguanzhugongzonghao" : MessageLookupByLibrary.simpleMessage("扫码识别,关注公众号"), - "send_code" : MessageLookupByLibrary.simpleMessage("发送验证"), + "send_code" : MessageLookupByLibrary.simpleMessage("发送验证码"), "shanchu" : MessageLookupByLibrary.simpleMessage("删除"), "shanchudingdan" : MessageLookupByLibrary.simpleMessage("删除一单"), "shangjiaquan" : MessageLookupByLibrary.simpleMessage("商家券"), diff --git a/lib/generated/intl/messages_zh_Hans_CN.dart b/lib/generated/intl/messages_zh_Hans_CN.dart index 6b900b6c..a4059ff4 100644 --- a/lib/generated/intl/messages_zh_Hans_CN.dart +++ b/lib/generated/intl/messages_zh_Hans_CN.dart @@ -475,7 +475,7 @@ class MessageLookup extends MessageLookupByLibrary { "ruxutuikuanqingyumendianlianxi" : MessageLookupByLibrary.simpleMessage("如需退款,请您提前准备好订单号/取单号,并与门店人员进行联系"), "saoma" : MessageLookupByLibrary.simpleMessage("扫码"), "saomashibieguanzhugongzonghao" : MessageLookupByLibrary.simpleMessage("扫码识别,关注公众号"), - "send_code" : MessageLookupByLibrary.simpleMessage("发送验证"), + "send_code" : MessageLookupByLibrary.simpleMessage("发送验证码"), "shanchu" : MessageLookupByLibrary.simpleMessage("删除"), "shanchudingdan" : MessageLookupByLibrary.simpleMessage("删除一单"), "shangjiaquan" : MessageLookupByLibrary.simpleMessage("商家券"), diff --git a/lib/generated/l10n.dart b/lib/generated/l10n.dart index a2d903fb..f646d904 100644 --- a/lib/generated/l10n.dart +++ b/lib/generated/l10n.dart @@ -95,10 +95,10 @@ class S { ); } - /// `发送验证` + /// `发送验证码` String get send_code { return Intl.message( - '发送验证', + '发送验证码', name: 'send_code', desc: '', args: [], diff --git a/lib/home/guide_page.dart b/lib/home/guide_page.dart index 32a6031a..8afcbc28 100644 --- a/lib/home/guide_page.dart +++ b/lib/home/guide_page.dart @@ -378,7 +378,7 @@ class _GuidePage extends State { value.setBool("isFirst", false); String token = value.getString("token"); if (token == null || token == "") { - Navigator.of(context).popAndPushNamed('/router/login_page'); + Navigator.of(context).popAndPushNamed('/router/new_login_page'); } else { Navigator.of(context).popAndPushNamed('/router/main_page'); } diff --git a/lib/home/home_page.dart b/lib/home/home_page.dart index 5d187b72..0ac92a81 100644 --- a/lib/home/home_page.dart +++ b/lib/home/home_page.dart @@ -5,14 +5,14 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; -import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_swiper/flutter_swiper.dart'; import 'package:huixiang/generated/l10n.dart'; -import 'package:huixiang/home/home_view/featured_acticvity.dart'; +import 'package:huixiang/home/home_view/discount_zone.dart'; import 'package:huixiang/home/home_view/home_banner.dart'; -import 'package:huixiang/home/home_view/home_integral_store.dart'; -import 'package:huixiang/home/home_view/quick_order.dart'; -import 'package:huixiang/home/home_view/sign_view.dart'; +import 'package:huixiang/home/home_view/home_recommend_goods.dart'; +import 'package:huixiang/home/home_view/top_selling_list.dart'; +import 'package:huixiang/home/home_view/union_entry.dart'; +import 'package:huixiang/home/home_view/welfare_core.dart'; import 'package:huixiang/home/points_mall_view/points_goods_title.dart'; import 'package:huixiang/home/points_mall_view/points_goods_view.dart'; import 'package:huixiang/main.dart'; @@ -29,15 +29,12 @@ import 'package:huixiang/retrofit/data/msg_stats.dart'; import 'package:huixiang/retrofit/data/page.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/utils/event_type.dart'; -import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/view_widget/activity_coupons.dart'; import 'package:huixiang/view_widget/activity_poster.dart'; import 'package:huixiang/view_widget/classic_header.dart'; import 'package:huixiang/view_widget/invite_success_dialog.dart'; -import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/new_people_reward.dart'; import 'package:huixiang/view_widget/request_permission.dart'; -import 'package:huixiang/view_widget/round_button.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:shared_preferences/shared_preferences.dart'; @@ -350,81 +347,81 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { super.build(context); return Column( children: [ - MyAppBar( - title: "首页", - leading: false, - actions: [ - Container( - height: 24, - alignment: Alignment.center, - margin: EdgeInsets.only( - right: 12.w, - ), - child: GestureDetector( - onTap: () { - Navigator.of(context).pushNamed('/router/system_msg_page').then((value) { - setState(() { - totalMsg = 0; - }); - }); - // Navigator.of(context).pushNamed('/router/web_turntable_activity'); - }, - child: Container( - height: 24, - alignment:Alignment.center, - child:Stack( - children: [ - SvgPicture.asset( - "assets/svg/tixing.svg", - width: 24, - height: 24, - ), - if(totalMsg != 0) - Container( - width:36, - alignment: Alignment.topRight, - child:Container( - width:22, - height:14, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(100), - border: Border.all( - width: 1, - color: Colors.white, - style: BorderStyle.solid, - ), - color:Color(0xFFFF441A), - ), - child:RoundButton( - text:totalMsg.toString(), - textColor: Colors.white, - fontWeight: MyFontWeight.regular, - backgroup: Color(0xFFFF441A), - fontSize:8.sp, - radius: 100, - ) - ), - ) - ], - ), - ) - ) - ), - Container( - margin: EdgeInsets.only(right: 16.w), - child: GestureDetector( - onTap: () { - toScan(); - }, - child: SvgPicture.asset( - "assets/svg/saoyisao.svg", - width: 24, - height: 24, - ), - ), - ), - ], - ), + // MyAppBar( + // title: "首页", + // leading: false, + // actions: [ + // Container( + // height: 24, + // alignment: Alignment.center, + // margin: EdgeInsets.only( + // right: 12.w, + // ), + // child: GestureDetector( + // onTap: () { + // Navigator.of(context).pushNamed('/router/system_msg_page').then((value) { + // setState(() { + // totalMsg = 0; + // }); + // }); + // // Navigator.of(context).pushNamed('/router/web_turntable_activity'); + // }, + // child: Container( + // height: 24, + // alignment:Alignment.center, + // child:Stack( + // children: [ + // SvgPicture.asset( + // "assets/svg/tixing.svg", + // width: 24, + // height: 24, + // ), + // if(totalMsg != 0) + // Container( + // width:36, + // alignment: Alignment.topRight, + // child:Container( + // width:22, + // height:14, + // decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(100), + // border: Border.all( + // width: 1, + // color: Colors.white, + // style: BorderStyle.solid, + // ), + // color:Color(0xFFFF441A), + // ), + // child:RoundButton( + // text:totalMsg.toString(), + // textColor: Colors.white, + // fontWeight: MyFontWeight.regular, + // backgroup: Color(0xFFFF441A), + // fontSize:8.sp, + // radius: 100, + // ) + // ), + // ) + // ], + // ), + // ) + // ) + // ), + // Container( + // margin: EdgeInsets.only(right: 16.w), + // child: GestureDetector( + // onTap: () { + // toScan(); + // }, + // child: SvgPicture.asset( + // "assets/svg/saoyisao.svg", + // width: 24, + // height: 24, + // ), + // ), + // ), + // ], + // ), Expanded( child: Container( child: SmartRefresher( @@ -447,40 +444,49 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { ///banner HomeBanner(bannerData, controller), + ///吃喝玩 + UnionEntry(() { + widget.changeTab(1); + }), + ///快捷操作 ShortcutOperation(() { widget.changeTab(1); }), - ///签到 - SignView(isSigned, (value) { - setState(() { - isSigned = value; - }); - }), + ///推广图 + spread(), - // ///热门文章 - // HotArticle(articles), - // ///创始人故事 - // FounderStore(founder), - // ///品牌介绍 - // BrandView(brandData), + // ///签到 + // SignView(isSigned, (value) { + // setState(() { + // isSigned = value; + // }); + // }), - ///店铺推荐 - QuickOrder(), + ///特惠专区 + DiscountZone(), - ///超级优惠券 - // CouponView(), + ///推荐商品展示 + HomeRecommendGoods(), - SizedBox( - height: 28, - ), + ///福利中心 + WelfareCore(), + + ///吃喝玩商品热销榜 + TopSellingList(), + + // ///店铺推荐 + // QuickOrder(), + + // ///超级优惠券 + // CouponView(), - ///精选活动 - FeaturedActivity(), + // ///精选活动 + // FeaturedActivity(), - ///积分商城 - HomeIntegralStore(gooods), + // ///积分商城 + // HomeIntegralStore(gooods), ///积分商品头Tab PointsGoodsTitle( @@ -519,6 +525,29 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { ); } + Widget spread(){ + return Container( + width: double.infinity, + height: 100.h, + margin: EdgeInsets.symmetric(horizontal: 14.w), + child: GestureDetector( + onTap: (){ + // Navigator.of(context).pushNamed('/router/invite_friends'); + Navigator.of(context).pushNamed('/router/mine_greenery'); + }, + child: ClipRRect( + child:Image.asset( + "assets/image/icon_story_td.webp", + width:double.infinity, + fit: BoxFit.cover, + height:80.h, + ), + borderRadius: BorderRadius.circular(6.w), + ), + ), + ); + } + ///扫码 toScan() async { if (await Permission.camera.isPermanentlyDenied) { diff --git a/lib/home/home_view/discount_zone.dart b/lib/home/home_view/discount_zone.dart new file mode 100644 index 00000000..ec0a974b --- /dev/null +++ b/lib/home/home_view/discount_zone.dart @@ -0,0 +1,141 @@ +import 'package:dio/dio.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:huixiang/view_widget/item_title.dart'; + +class DiscountZone extends StatefulWidget { + @override + State createState() { + return _DiscountZone(); + } +} + +class _DiscountZone extends State { + ApiService apiService; + + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + return Container( + width: double.infinity, + margin: EdgeInsets.only(bottom: 12.h, top: 16.h), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + ItemTitle( + text: "特惠专区", + ), + Container( + height: 91.h, + margin: EdgeInsets.only(top: 14,left: 14.w), + child: ListView.builder( + scrollDirection: Axis.horizontal, + physics: BouncingScrollPhysics(), + itemCount: 6, + itemBuilder: (context, position) { + return GestureDetector( + onTap: () {}, + child: discountItem(), + ); + }, + ), + ), + ], + ), + ); + } + + Widget discountItem() { + return Container( + width: 246.w, + height: 91.h, + decoration: BoxDecoration( + image: DecorationImage( + fit: BoxFit.cover, + image: AssetImage("assets/image/discount.webp"), + ), + ), + padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 15.h), + margin: EdgeInsets.only(right: 6.w), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Column( + children: [ + Text.rich( + TextSpan( + children: [ + TextSpan( + text: "¥", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFF32A060), + ), + ), + TextSpan( + text: "30", + style: TextStyle( + fontSize: 30.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFF32A060), + ), + ), + ], + ), + ), + Text( + "满30.1可用", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF32A060), + ), + ), + ], + ), + Spacer(), + Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "百年川椒(哈乐城店)", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.bold, + color: Color(0xFF0D0D0D), + ), + ), + Text( + "新人满减30元", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF4D4D4D), + ), + ), + Text( + "有效期至2022-09-10", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF4D4D4D), + ), + ), + ], + ) + ], + ), + ); + } +} diff --git a/lib/home/home_view/home_banner.dart b/lib/home/home_view/home_banner.dart index 4d3df053..6fe50e8d 100644 --- a/lib/home/home_view/home_banner.dart +++ b/lib/home/home_view/home_banner.dart @@ -23,7 +23,7 @@ class _HomeBanner extends State { Widget build(BuildContext context) { return Container( child: AspectRatio( - aspectRatio: 2, + aspectRatio: 1.4, child: Swiper( pagination: SwiperPagination( margin: EdgeInsets.only(bottom: 20.h), @@ -44,16 +44,16 @@ class _HomeBanner extends State { bannerClick(widget.bannerData[position]); }, child: Container( - margin: EdgeInsets.all(16), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(8), - ), + // margin: EdgeInsets.all(16), + // decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(8), + // ), child: MImage( (widget.bannerData != null && position < widget.bannerData.length) ? widget.bannerData[position].imgUrl ?? "" : "", - radius: BorderRadius.circular(8), + // radius: BorderRadius.circular(8), fit: BoxFit.cover, errorSrc: "assets/image/default_2_1.webp", fadeSrc: "assets/image/default_2_1.webp", @@ -90,11 +90,11 @@ class _HomeBanner extends State { break; case 4: String router = bannerData.content; + // String router = "/router/store_order?{\"id\":\"1512378184161558528\",\"tenant\":\"1188\",\"storeName\":\"农场煮意\"}"; if (router.contains("?")) { - String params = router.substring(router.indexOf("?")); - params = params.replaceAll("?", ""); + String params = router.substring(router.indexOf("?")+1); Map map = jsonDecode(params); - Navigator.of(context).pushNamed(router, arguments: map); + Navigator.of(context).pushNamed(router.substring(0,router.indexOf("?")), arguments: map); } else { Navigator.of(context).pushNamed(router); } diff --git a/lib/home/home_view/home_recommend_goods.dart b/lib/home/home_view/home_recommend_goods.dart new file mode 100644 index 00000000..d5deea38 --- /dev/null +++ b/lib/home/home_view/home_recommend_goods.dart @@ -0,0 +1,150 @@ +import 'dart:convert'; + +import 'package:flutter/material.dart'; +import 'package:flutter_swiper/flutter_swiper.dart'; +import 'package:huixiang/retrofit/data/banner.dart'; +import 'package:huixiang/retrofit/data/shopping_home_config.dart'; +import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/view_widget/custom_image.dart'; +import 'package:pull_to_refresh/pull_to_refresh.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +class HomeRecommendGoods extends StatefulWidget { + @override + State createState() { + return _HomeRecommendGoods(); + } +} + +class _HomeRecommendGoods extends State { + ApiService apiService; + final RefreshController refreshController = RefreshController(); + + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + return Container( + width: double.infinity, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + height: 257.h, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(6), + color: Colors.white, + ), + margin: EdgeInsets.only(left: 14.w,right: 14.w,top: 12.h,bottom: 24.h), + child: ListView.builder( + scrollDirection: Axis.horizontal, + physics: BouncingScrollPhysics(), + itemCount:3, + itemBuilder: (context, position) { + return GestureDetector( + onTap: () {}, + child: recommendGoodsItem(), + ); + }, + ), + ), + ], + ), + ); + } + + Widget recommendGoodsItem() { + return Container( + width: 158.w, + margin: EdgeInsets.only(right:7.w,left:12.w,top: 12.h), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Stack( + children: [ + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(4), + ), + child: + ClipRRect( + borderRadius: BorderRadius.circular(4), + child: Image.asset( + "assets/image/icon_story_td.webp", + width: 158.w, + height: 158, + fit: BoxFit.cover, + ), + ),), + Container( + width: 81.w, + height: 27.h, + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(4), + bottomLeft: Radius.circular(0), + bottomRight: Radius.circular(100), + topRight: Radius.circular(100),), + color: Color(0xFF32A060), + ), + child: Text( + "直降¥120.00", + style: TextStyle( + fontWeight: MyFontWeight.regular, + color: Color(0xFFFFFFFF), + fontSize: 12.sp, + ), + ), + ), + ], + ), + SizedBox( + height:8.h, + ), + Text( + "花生吐司", + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 13.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF0D0D0D), + ), + ),SizedBox( + height:4.h, + ), + Text.rich( + TextSpan( + children: [ + TextSpan( + text: "¥123.00", + style: TextStyle( + fontSize: 16.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFFF85400), + ), + ), + TextSpan( + text: "¥123.00", + style: TextStyle( + fontSize:10.sp, + decoration: TextDecoration.lineThrough, + fontWeight: MyFontWeight.regular, + color: Color(0xFFB3B3B3), + ), + ), + ], + ), + ), + ], + ), + ); + } +} diff --git a/lib/home/home_view/shortcut_operation.dart b/lib/home/home_view/shortcut_operation.dart index b168901e..6eaa53c0 100644 --- a/lib/home/home_view/shortcut_operation.dart +++ b/lib/home/home_view/shortcut_operation.dart @@ -28,8 +28,9 @@ class _ShortcutOperation extends State { @override Widget build(BuildContext context) { return Container( - height: 150.h, - margin: EdgeInsets.only(bottom:15,left: 16,right: 16), + height: 80.h, + width: double.infinity, + margin: EdgeInsets.only(bottom:15,left: 10,right: 10), child: Row( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, @@ -39,9 +40,9 @@ class _ShortcutOperation extends State { widget.goToOrder(); }, child: Container( - width: 106, - margin: EdgeInsets.only(right:10), - padding: EdgeInsets.only(top: 8,bottom: 8), + width: double.infinity, + margin: EdgeInsets.symmetric(horizontal:5), + padding: EdgeInsets.all(10.h), decoration: BoxDecoration( color: Colors.white, boxShadow: [ @@ -54,30 +55,38 @@ class _ShortcutOperation extends State { ], borderRadius: BorderRadius.circular(4), ), - child: Column( + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, children: [ - Text( - "现在下单", - style: TextStyle( - fontWeight: MyFontWeight.semi_bold, - fontSize: 15.sp, - color: Colors.black, - ), + Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "联盟", + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, + fontSize: 14.sp, + color: Color(0xFF0D0D0D), + ), + ), + SizedBox(height:5.h), + Text( + "下单赚积分", + style: TextStyle( + fontWeight: MyFontWeight.regular, + fontSize: 12.sp, + color: Color(0xFF4D4D4D), + ), + ), + ], ), - SizedBox(height: 5), - Text( - "美味等你来!", - style: TextStyle( - fontWeight: MyFontWeight.regular, - fontSize: 12.sp, - color: Colors.black, - ), - ), - SizedBox(height: 20), + SizedBox(width: 3.w), Expanded(child: Image.asset( - "assets/image/home_order.webp", - width:70, - height:70, + "assets/image/home_lm.webp", + width:36, + height:36, ),), ], ), @@ -87,10 +96,10 @@ class _ShortcutOperation extends State { onTap: (){ Navigator.of(context).pushNamed('/router/recharge_page'); }, - child: Container( - width: 106, - margin: EdgeInsets.only(right:10), - padding: EdgeInsets.only(top: 8,bottom: 8), + child: Container( + width: double.infinity, + margin: EdgeInsets.symmetric(horizontal:5), + padding: EdgeInsets.all(10.h), decoration: BoxDecoration( color: Colors.white, boxShadow: [ @@ -103,30 +112,38 @@ class _ShortcutOperation extends State { ], borderRadius: BorderRadius.circular(4), ), - child: Column( + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, children: [ - Text( - "平台储值", - style: TextStyle( - fontWeight: MyFontWeight.semi_bold, - fontSize: 15.sp, - color: Colors.black, - ), + Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "充值", + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, + fontSize: 14.sp, + color: Color(0xFF0D0D0D), + ), + ), + SizedBox(height: 5), + Text( + "充值福利多", + style: TextStyle( + fontWeight: MyFontWeight.regular, + fontSize: 12.sp, + color: Color(0xFF4D4D4D), + ), + ), + ], ), - SizedBox(height: 5), - Text( - "会员享有赠送!", - style: TextStyle( - fontWeight: MyFontWeight.regular, - fontSize: 12.sp, - color: Colors.black, - ), - ), - SizedBox(height: 20), - Expanded(child:Image.asset( + SizedBox(width: 3.w), + Expanded(child: Image.asset( "assets/image/home_recharge.webp", - width:70, - height:70, + width:36, + height:36, ),), ], ), @@ -137,8 +154,9 @@ class _ShortcutOperation extends State { Navigator.of(context).pushNamed('/router/roll_center_page'); }, child:Container( - width: 106, - padding: EdgeInsets.only(top: 8,bottom: 8), + width: double.infinity, + margin: EdgeInsets.symmetric(horizontal:5), + padding: EdgeInsets.all(10.h), decoration: BoxDecoration( color: Colors.white, boxShadow: [ @@ -151,32 +169,39 @@ class _ShortcutOperation extends State { ], borderRadius: BorderRadius.circular(4), ), - child: Column( + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, children: [ - Text( - "天天有劵", - style: TextStyle( - fontWeight: MyFontWeight.semi_bold, - fontSize: 15.sp, - color: Colors.black, - ), + Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "福利中心", + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, + fontSize: 14.sp, + color: Color(0xFF0D0D0D), + ), + ), + SizedBox(height: 5), + Text( + "天天得福利", + style: TextStyle( + fontWeight: MyFontWeight.regular, + fontSize: 12.sp, + color: Color(0xFF4D4D4D), + ), + ), + ], ), - SizedBox(height: 5), - Text( - "来领超值好劵!", - style: TextStyle( - fontWeight: MyFontWeight.regular, - fontSize: 12.sp, - color: Colors.black, - ), - ), - SizedBox(height: 20), - Expanded(child: Image.asset( - "assets/image/home_coupon.webp", - width:70, - height:70, - ), ), - + SizedBox(width: 3.w), + Expanded(child: Image.asset( + "assets/image/home_welfare.webp", + width:36, + height:36, + ),), ], ), ), diff --git a/lib/home/home_view/top_selling_list.dart b/lib/home/home_view/top_selling_list.dart new file mode 100644 index 00000000..48901b1c --- /dev/null +++ b/lib/home/home_view/top_selling_list.dart @@ -0,0 +1,191 @@ +import 'dart:convert'; + +import 'package:flutter/material.dart'; +import 'package:flutter_swiper/flutter_swiper.dart'; +import 'package:huixiang/retrofit/data/banner.dart'; +import 'package:huixiang/retrofit/data/shopping_home_config.dart'; +import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/view_widget/custom_image.dart'; +import 'package:pull_to_refresh/pull_to_refresh.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +class TopSellingList extends StatefulWidget { + @override + State createState() { + return _TopSellingList(); + } +} + +class _TopSellingList extends State { + ApiService apiService; + final RefreshController refreshController = RefreshController(); + + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + return Container( + height: 347.h, + width: double.infinity, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(6), + color: Colors.blueGrey, + ), + margin: EdgeInsets.only(left: 14.w,right: 14.w,top: 12.h,bottom: 23.h), + padding: EdgeInsets.only(left: 12.w,top: 16.h), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + width: 85.w, + height: 21.h, + color: Color(0x33000000), + alignment: Alignment.center, + child:Text( + "4月热推榜", + style: TextStyle( + fontWeight: MyFontWeight.medium, + color: Color(0xFFFFFFFF), + fontSize: 15.sp, + ), + ), + ), + Container( + height: 280.h, + child: ListView.builder( + scrollDirection: Axis.horizontal, + physics: BouncingScrollPhysics(), + itemCount:3, + itemBuilder: (context, position) { + return GestureDetector( + onTap: () {}, + child: hotSaleItem(), + ); + }, + ), + ), + ], + ), + ); + } + + Widget hotSaleItem() { + return Container( + width: 290.w, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(4), + color: Color(0xB3FFFFFF), + ), + margin: EdgeInsets.only(right:8.w,top: 12.h), + padding:EdgeInsets.only(left:12.w,top: 12.h), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "好喝榜", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.bold, + color: Color(0xFF0D0D0D), + ), + ),SizedBox( + height:10.h, + ), + Expanded(child: ListView.builder( + padding: EdgeInsets.zero, + itemCount:6, + scrollDirection: Axis.vertical, + shrinkWrap: true, + physics: BouncingScrollPhysics(), + itemBuilder: (context, position) { + return GestureDetector( + onTap: () { + }, + child: rankingItem(), + ); + }, + ),) + ], + ), + ); + } + + Widget rankingItem() { + return Container( + margin: EdgeInsets.only(right:14.w,top: 12.h,bottom: 12.h), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Stack( + children: [ + Image.asset( + "assets/image/icon_story_td.webp", + width: 54.w, + height: 54, + fit: BoxFit.cover, + ), Image.asset( + "assets/image/ranking1.webp", + width: 25.w, + height: 25, + fit: BoxFit.cover, + ), + ], + ), + SizedBox( + width:8.w, + ), + Expanded(child: + Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding(padding:EdgeInsets.only(top: 5.h,bottom: 8.h), + child: Text( + "暴打柠檬茶", + style: TextStyle( + fontSize: 13.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF0D0D0D), + ), + ),), + Text.rich( + TextSpan( + children: [ + TextSpan( + text: "¥22.00", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFF0D0D0D), + ), + ), + TextSpan( + text: "¥22.00", + style: TextStyle( + fontSize:10.sp, + decoration: TextDecoration.lineThrough, + fontWeight: MyFontWeight.regular, + color: Color(0xFF4D4D4D), + ), + ), + ], + ), + ), + ], + ),), + Icon( + Icons.add_circle, + color: Color(0xFF32A060), + ) + ], + ), + ); + } +} diff --git a/lib/home/home_view/union_entry.dart b/lib/home/home_view/union_entry.dart new file mode 100644 index 00000000..7a907f50 --- /dev/null +++ b/lib/home/home_view/union_entry.dart @@ -0,0 +1,172 @@ +import 'package:dio/dio.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +class UnionEntry extends StatefulWidget { + final Function goToOrder; + + UnionEntry(this.goToOrder); + + @override + State createState() { + return _UnionEntry(); + } +} + +class _UnionEntry extends State { + ApiService apiService; + + @override + void initState() { + super.initState(); + } + + + @override + Widget build(BuildContext context) { + return Container( + height: 130.h, + width: double.infinity, + margin: EdgeInsets.only(bottom:10,left: 10,right: 10,top: 14.h), + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded(child:GestureDetector( + onTap: (){ + widget.goToOrder(); + }, + child: Container( + width: double.infinity, + margin: EdgeInsets.symmetric(horizontal:5), + padding: EdgeInsets.symmetric(vertical:12.h), + decoration: BoxDecoration( + color: Colors.white, + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ) + ], + borderRadius: BorderRadius.circular(6), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset( + "assets/image/home_chi.webp", + fit: BoxFit.cover, + width: 60, + height: 60, + ), + SizedBox(height:4.h), + Text( + "吃健康", + style: TextStyle( + fontWeight: MyFontWeight.medium, + fontSize: 15.sp, + color: Color(0xFF0D0D0D), + ), + ), + ], + ), + ), + ) ), + Expanded(child:GestureDetector( + onTap: (){ + widget.goToOrder(); + }, + child: Container( + width: double.infinity, + margin: EdgeInsets.symmetric(horizontal:5), + // padding: EdgeInsets.symmetric(vertical:12.h), + decoration: BoxDecoration( + color: Colors.white, + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ) + ], + borderRadius: BorderRadius.circular(6), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset( + "assets/image/home_he.webp", + fit: BoxFit.cover, + width: 60, + height: 60, + ), + SizedBox(height:4.h), + Text( + "喝健康", + style: TextStyle( + fontWeight: MyFontWeight.medium, + fontSize: 15.sp, + color: Color(0xFF0D0D0D), + ), + ), + ], + ), + ), + ) ), + Expanded(child: GestureDetector( + onTap: (){ + widget.goToOrder(); + }, + child: Container( + width: double.infinity, + margin: EdgeInsets.symmetric(horizontal:5), + padding: EdgeInsets.symmetric(vertical:12.h), + decoration: BoxDecoration( + color: Colors.white, + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ) + ], + borderRadius: BorderRadius.circular(6), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset( + "assets/image/home_wan.webp", + fit: BoxFit.cover, + width: 60, + height: 60, + ), + SizedBox(height:4.h), + Text( + "玩健康", + style: TextStyle( + fontWeight: MyFontWeight.medium, + fontSize: 15.sp, + color: Color(0xFF0D0D0D), + ), + ), + ], + ), + ), + )), + ], + ), + ); + } + +} diff --git a/lib/home/home_view/welfare_core.dart b/lib/home/home_view/welfare_core.dart new file mode 100644 index 00000000..04c70e43 --- /dev/null +++ b/lib/home/home_view/welfare_core.dart @@ -0,0 +1,177 @@ +import 'package:dio/dio.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/retrofit/data/activity.dart'; +import 'package:huixiang/retrofit/data/base_data.dart'; +import 'package:huixiang/retrofit/data/page.dart'; +import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/view_widget/item_title.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:shared_preferences/shared_preferences.dart'; + +class WelfareCore extends StatefulWidget { + @override + State createState() { + return _WelfareCore(); + } +} + +class _WelfareCore extends State { + ApiService apiService; + + @override + void initState() { + super.initState(); + } + + + @override + Widget build(BuildContext context) { + return Column( + children: [ + Padding(padding:EdgeInsets.symmetric(horizontal: 14.w), + child: Row( + children: [ + Expanded(child: + Text( + "福利中心", + style: TextStyle( + color: Color(0xFF0D0D0D), + fontSize: 15.sp, + fontWeight: FontWeight.bold, + ), + )), + GestureDetector( + onTap: (){ + Navigator.of(context).pushNamed('/router/welfare_page'); + }, + child: Text( + "查看更多", + style: TextStyle( + color: Color(0xFF4D4D4D), + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + ), + ), + ) + ], + ),), + + Container( + width: double.infinity, + margin: EdgeInsets.only(left:9.w,right: 9.w,top: 16.h,bottom: 12.h), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded(child: Container( + width: double.infinity, + height:60.h, + padding: EdgeInsets.only(left: 12.w), + decoration: BoxDecoration( + image: DecorationImage( + fit: BoxFit.fill, + image: AssetImage("assets/image/welfare1.webp"), + ), + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "本周劵包", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFFFFFFFF), + ), + ), + SizedBox(height: 2.h), + Text( + "每周三更新劵包", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFFFFFFFF), + ), + ), + ], + ), + )), + Expanded(child: Container( + width: double.infinity, + height:60.h, + padding: EdgeInsets.only(left: 12.w), + decoration: BoxDecoration( + image: DecorationImage( + fit: BoxFit.fill, + image: AssetImage("assets/image/welfare2.webp"), + ), + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "邀请好友", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFFFFFFFF), + ), + ), + SizedBox(height: 2.h), + Text( + "邀请好友得分", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFFFFFFFF), + ), + ), + ], + ), + )), + Expanded(child: Container( + width: double.infinity, + height:60.h, + padding: EdgeInsets.only(left: 12.w), + decoration: BoxDecoration( + image: DecorationImage( + fit: BoxFit.fill, + image: AssetImage("assets/image/welfare3.webp"), + ), + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "做任务得券", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFFFFFFFF), + ), + ), + SizedBox(height: 2.h), + Text( + "多种优惠券等你拿", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFFFFFFFF), + ), + ), + ], + ), + )), + ], + ), + ), + ], + ); + } +} diff --git a/lib/home/points_mall_view/point_mall_user.dart b/lib/home/points_mall_view/point_mall_user.dart index 7950c54b..13dc1d57 100644 --- a/lib/home/points_mall_view/point_mall_user.dart +++ b/lib/home/points_mall_view/point_mall_user.dart @@ -26,7 +26,7 @@ class _PointMallUser extends State { if (value.getString("token") == null || value.getString("token") == "") { Navigator.of(context) - .pushNamed('/router/login_page', arguments: {"login": "login"}); + .pushNamed('/router/new_login_page', arguments: {"login": "login"}); } }); }, diff --git a/lib/home/points_mall_view/points_goods_title.dart b/lib/home/points_mall_view/points_goods_title.dart index f3f9b44f..29d74d45 100644 --- a/lib/home/points_mall_view/points_goods_title.dart +++ b/lib/home/points_mall_view/points_goods_title.dart @@ -44,7 +44,7 @@ class _PointsGoodsTitle extends State { children: [ ItemTitle( text: S.of(context).jifenshangcheng, - imgPath: "assets/image/icon_points_mall.webp", + // imgPath: "assets/image/icon_points_mall.webp", ), // ItemTitle( // text: S.of(context).jifenshangcheng, @@ -101,46 +101,46 @@ class _PointsGoodsTitle extends State { ), ), ), - Container( - width: 124.w, - height: 32.h, - margin: EdgeInsets.only(left: 20.w, top: 10), - color: Colors.white, - child: Stack( - alignment: Alignment.center, - children: [ - Container( - width: 104.w, - height: 32.h, - color: Colors.white, - ), - Container( - padding: EdgeInsets.symmetric(horizontal: 10.w), - child: DropdownButton( - items: sortString - .map( - (e) => DropdownMenuItem( - value: e, - child: Text( - e, - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.medium, - color: Color(0xff353535), - ), - ), - ), - ) - .toList(), - value: _itemText, - itemHeight: 50, - onChanged: _sortChange, - style: TextStyle(), - ), - ), - ], - ), - ), + // Container( + // width: 124.w, + // height: 32.h, + // margin: EdgeInsets.only(left: 20.w, top: 10), + // color: Colors.white, + // child: Stack( + // alignment: Alignment.center, + // children: [ + // Container( + // width: 104.w, + // height: 32.h, + // color: Colors.white, + // ), + // Container( + // padding: EdgeInsets.symmetric(horizontal: 10.w), + // child: DropdownButton( + // items: sortString + // .map( + // (e) => DropdownMenuItem( + // value: e, + // child: Text( + // e, + // style: TextStyle( + // fontSize: 12.sp, + // fontWeight: MyFontWeight.medium, + // color: Color(0xff353535), + // ), + // ), + // ), + // ) + // .toList(), + // value: _itemText, + // itemHeight: 50, + // onChanged: _sortChange, + // style: TextStyle(), + // ), + // ), + // ], + // ), + // ), ], ); } diff --git a/lib/home/points_mall_view/points_goods_view.dart b/lib/home/points_mall_view/points_goods_view.dart index 514dcd4c..f9f6fc4d 100644 --- a/lib/home/points_mall_view/points_goods_view.dart +++ b/lib/home/points_mall_view/points_goods_view.dart @@ -26,7 +26,7 @@ class _PointGoods extends State { padding: EdgeInsets.only( left: 16.w, right: 16.w, - top: 13.h, + top: 18.h, bottom: 16.h, ), shrinkWrap: true, @@ -40,7 +40,7 @@ class _PointGoods extends State { mainAxisSpacing: 16.w, //子Widget宽高比例 0.59 childAspectRatio: - 166 / (281 / 2 + (281 / 2) * AppUtils.textScale(context)), + 200 / (281 / 2 + (281 / 2) * AppUtils.textScale(context)), ), itemBuilder: (context, index) { return GestureDetector( @@ -73,14 +73,16 @@ class _PointGoods extends State { fit: StackFit.loose, children: [ Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.max, children: [ MImage( goods.mainImgPath, - aspectRatio: 1, + aspectRatio: 1.1, radius: BorderRadius.only( - topLeft: Radius.circular(4), - topRight: Radius.circular(4), + topLeft: Radius.circular(6), + topRight: Radius.circular(6), ), fit: BoxFit.cover, errorSrc: "assets/image/default_1.webp", @@ -94,7 +96,7 @@ class _PointGoods extends State { top: 10.h, ), child: Column( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, + mainAxisAlignment: MainAxisAlignment.spaceAround, crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( @@ -104,51 +106,68 @@ class _PointGoods extends State { style: TextStyle( color: Color(0xff353535), fontWeight: MyFontWeight.medium, - fontSize: 16.sp, + fontSize: 15.sp, ), ), - SizedBox( - height: 5.h, - ), - Text( - (goods?.price == null || goods.price == "0"?"":S.of(context).jifen_(goods.price)) + (goods?.money == null|| goods.money == "0.00" ?"":" + ${goods.money}元"), - style: TextStyle( - color: Color(0xFF32A060), - fontSize: 14.sp, - fontWeight: MyFontWeight.semi_bold, - ), - ), - SizedBox( - height: 4.h, - ), + Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.end, + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, children: [ - Expanded( - child: Text( - S.of(context).yuan_(goods.worth), - style: TextStyle( - color: Color(0xFF585858), - decoration: TextDecoration.lineThrough, - decorationColor: Color(0xFF585858), - fontWeight: MyFontWeight.regular, - fontSize: 12.sp, - ), + Text( + (goods?.price == null || goods.price == "0"?"":S.of(context).jifen_(goods.price)) + (goods?.money == null|| goods.money == "0.00" ?"":" + ${goods.money}元"), + style: TextStyle( + color: Color(0xFFE5600D), + fontSize: 16.sp, + fontWeight: MyFontWeight.semi_bold, ), - flex: 1, + ), + Image.asset( + "assets/image/green_leaf.webp", + fit: BoxFit.cover, + width: 12, + height: 12, ), Text( - "库存:${goods?.stock ?? goods?.stock ??""}份", + "x100", + overflow: TextOverflow.ellipsis, + maxLines: 2, style: TextStyle( - color: Color(0xFF585858), - decorationColor: Color(0xFF353535), - fontWeight: MyFontWeight.medium, - fontSize: 12.sp, + color: Color(0xFF32A060), + fontWeight: MyFontWeight.semi_bold, + fontSize: 16.sp, ), ), ], ), + // Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // crossAxisAlignment: CrossAxisAlignment.end, + // children: [ + // Expanded( + // child: Text( + // S.of(context).yuan_(goods.worth), + // style: TextStyle( + // color: Color(0xFF585858), + // decoration: TextDecoration.lineThrough, + // decorationColor: Color(0xFF585858), + // fontWeight: MyFontWeight.regular, + // fontSize: 12.sp, + // ), + // ), + // flex: 1, + // ), + // Text( + // "库存:${goods?.stock ?? goods?.stock ??""}份", + // style: TextStyle( + // color: Color(0xFF585858), + // decorationColor: Color(0xFF353535), + // fontWeight: MyFontWeight.medium, + // fontSize: 12.sp, + // ), + // ), + // ], + // ), ], ), ), @@ -159,18 +178,18 @@ class _PointGoods extends State { ), ], ), - Visibility( - visible: goods.isHot, - child: ClipRRect( - borderRadius: BorderRadius.only(topRight: Radius.circular(4)), - child: Image.asset( - "assets/image/icon_hot_right_top.webp", - width: 36, - height: 36, - fit: BoxFit.cover, - ), - ), - ), + // Visibility( + // visible: goods.isHot, + // child: ClipRRect( + // borderRadius: BorderRadius.only(topRight: Radius.circular(4)), + // child: Image.asset( + // "assets/image/icon_hot_right_top.webp", + // width: 36, + // height: 36, + // fit: BoxFit.cover, + // ), + // ), + // ), ], ), ); diff --git a/lib/home/start_page.dart b/lib/home/start_page.dart new file mode 100644 index 00000000..c9e41f84 --- /dev/null +++ b/lib/home/start_page.dart @@ -0,0 +1,43 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/view_widget/border_text.dart'; +import 'package:shared_preferences/shared_preferences.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +class StartPage extends StatefulWidget { + final bool isFirst; + + StartPage(this.isFirst); + @override + State createState() { + return _StartPage(); + } +} + +class _StartPage extends State { + + @override + Widget build(BuildContext context) { + return Container( + color: Colors.white, + width: double.infinity, + height: double.infinity, + child: Image.asset( + "assets/image/ic_splash_bg.webp", + width: double.infinity, + height: double.infinity, + // fit: BoxFit.cover, + ), + ); + } + + @override + void initState() { + super.initState(); + Future.delayed(Duration(seconds:3), () { + Navigator.of(context).popAndPushNamed((widget.isFirst ?? true) ? '/router/guide_Page' : '/router/new_login_page'); + }); + } +} diff --git a/lib/home/welfare_page.dart b/lib/home/welfare_page.dart new file mode 100644 index 00000000..53ec1725 --- /dev/null +++ b/lib/home/welfare_page.dart @@ -0,0 +1,566 @@ +import 'package:dio/dio.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_swiper/flutter_swiper.dart'; +import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/retrofit/data/activity.dart'; +import 'package:huixiang/retrofit/data/base_data.dart'; +import 'package:huixiang/retrofit/data/page.dart'; +import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/view_widget/classic_header.dart'; +import 'package:huixiang/view_widget/item_title.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; +import 'package:huixiang/view_widget/my_footer.dart'; +import 'package:pull_to_refresh/pull_to_refresh.dart'; +import 'package:shared_preferences/shared_preferences.dart'; + +class WelfarePage extends StatefulWidget { + @override + State createState() { + return _WelfarePage(); + } +} + +class _WelfarePage extends State { + ApiService apiService; + final RefreshController refreshController = RefreshController(); + final ScrollController scrollController = ScrollController(); + + @override + void initState() { + super.initState(); + } + + @override + // Widget build(BuildContext context) { + // return Stack( + // children: [ + // Positioned( + // child: Container( + // height: 155.h + kToolbarHeight + MediaQuery.of(context).padding.top, + // decoration: BoxDecoration( + // image: DecorationImage( + // fit: BoxFit.fill, + // image: AssetImage("assets/image/welfare_zx.webp"), + // ), + // ), + // ), + // top: 0, + // left: 0, + // right: 0, + // ), + // Scaffold( + // backgroundColor: Colors.transparent, + // appBar: MyAppBar( + // exit: (){}, + // background: Colors.transparent, + // leadingColor: Colors.white, + // title: "福利中心", + // titleColor: Colors.white, + // titleSize: 17.sp, + // brightness: Brightness.dark, + // ), + // body:SmartRefresher( + // controller: refreshController, + // enablePullDown: true, + // enablePullUp: false, + // header: MyHeader(), + // footer: CustomFooter( + // builder: (context, mode) { + // return MyFooter(mode); + // }, + // ), + // onRefresh:(){ + // setState(() { + // }); + // }, + // physics: BouncingScrollPhysics(), + // scrollController: scrollController, + // child: Container( + // child: SingleChildScrollView( + // physics: BouncingScrollPhysics(), + // child: FutureBuilder( + // // future: querySignInfo(), + // builder: (context, snap) { + // return Column( + // children: [ + // weekCoupons(), + // + // inviteFriends(), + // + // activityTask(), + // ], + // ); + // }, + // ), + // ), + // ), + // ), + // ), + // ], + // ); + // } + Widget build(BuildContext context) { + return Container( + color: Colors.white, + child: Scaffold( + body: SmartRefresher( + controller: refreshController, + enablePullDown: true, + enablePullUp: false, + header: MyHeader(), + footer: CustomFooter( + builder: (context, mode) { + return MyFooter(mode); + }, + ), + onRefresh: () {}, + physics: BouncingScrollPhysics(), + scrollController: scrollController, + child: Container( + child: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Stack( + children: [ + Container( + decoration: BoxDecoration( + image: DecorationImage( + fit: BoxFit.fill, + image: AssetImage("assets/image/welfare_zx.webp"), + ), + ), + width: double.infinity, + height: 385.h, + ), + Container( + width: double.infinity, + margin: EdgeInsets.only( + top: 23.h + MediaQuery.of(context).padding.top, + left: 14.w,right: 14.w), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + Navigator.of(context).pop(); + }, + child: Container( + // color: Colors.white, + alignment: Alignment.centerLeft, + child: Icon( + Icons.arrow_back_ios, + color: Colors.white, + size: 22, + ), + ), + ), + ), + Expanded( + child: Container( + alignment: Alignment.center, + child: Text( + "福利中心", + style: TextStyle( + color: Colors.white, + fontSize: 18.sp, + fontWeight: MyFontWeight.regular, + ), + )), + ), + Spacer(), + ], + ), + + weekCoupons(), + + inviteFriends(), + + activityTask(), + ], + ), + ), + ], + ) + ], + ), + ), + ), + ), + ), + ); + } + + /// 周券包推荐 + Widget weekCoupons() { + return Container( + width: double.infinity, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(6), + color: Colors.white, + ), + margin: EdgeInsets.only(top: 126.h), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.symmetric(horizontal: 12.w,vertical: 16.h), + child: + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + "本周劵包 ", + style: TextStyle( + color: Color(0xFF0D0D0D), + fontSize: 15.sp, + fontWeight: MyFontWeight.bold, + ), + ), + Text( + "每周五上新 ", + style: TextStyle( + color: Color(0xFF4D4D4D), + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + ), + ), + ], + )), + AspectRatio( + aspectRatio: 1.22, + child: Swiper( + viewportFraction: 0.9, + scale: 0.7, + pagination: SwiperPagination( + alignment: Alignment.bottomCenter, + builder: DotSwiperPaginationBuilder( + size: 8, + activeSize: 8, + space: 5, + activeColor: Colors.black, + color: Colors.black.withAlpha(76), + ), + ), + physics: BouncingScrollPhysics(), + itemBuilder: (context, position) { + return Column( + children: [ + Container( + // height: 84.h, + // child: ListView.builder( + // scrollDirection: Axis.horizontal, + // physics: BouncingScrollPhysics(), + // padding: EdgeInsets.symmetric(horizontal: 12), + // itemCount:3, + // itemBuilder: (context, index) { + // return GestureDetector( + // onTap: () { + // + // }, + // child: weekItem(), + // ); + // }, + // ), + child: weekItem(), + ), + ], + ); + }, + itemCount:3, + ), + ) + ], + ), + ); + } + + Widget weekItem() { + return Container( + width:double.infinity, + height:95.h, + decoration: BoxDecoration( + image: DecorationImage( + fit: BoxFit.fill, + image: AssetImage("assets/image/week_coupons.png"), + ), + ), + padding: EdgeInsets.symmetric(horizontal: 12.w,vertical: 12.h), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text.rich( + TextSpan( + children: [ + TextSpan( + text: "¥", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFFFF4500), + ), + ), + TextSpan( + text: "30", + style: TextStyle( + fontSize: 26.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFFFF4500), + ), + ), + ], + ), + ), + Text( + "满30.1可用", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFFFF4500), + ), + ), + ], + ), + SizedBox(width: 30,), + Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "百年川椒(哈乐城店)", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.bold, + color: Color(0xFF0D0D0D), + ), + ), + SizedBox(height: 10,), + Text( + "新人满减30元", + style: TextStyle( + fontSize: 11.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF4D4D4D), + ), + ), + SizedBox(height:4.h,), + Text( + "有效期至2022-09-10 12:00:00", + style: TextStyle( + fontSize: 11.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF4D4D4D), + ), + ), + ], + ), + Expanded(child: + Container( + width: 55.w, + height: 19.h, + decoration: BoxDecoration( + gradient: new LinearGradient( + begin: Alignment.bottomCenter, + end: Alignment.topCenter, + colors: [ + Color(0xFFFF4F00), + Color(0xFFFF2700), + ]), + // border: Border.all(color: Colors.white,width: 0.5), + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(12), + ), + alignment: Alignment.center, + child:Text( + "领取", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFFFFFFFF), + ), + ), + )) + ], + ), + ); + } + + ///邀请好友 + Widget inviteFriends() { + return Container( + margin: EdgeInsets.only(right:14.w,top:34.h,bottom:20.h), + child:Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "邀请好友", + style: TextStyle( + fontSize: 15.sp, + fontWeight: MyFontWeight.bold, + color: Color(0xFF0D0D0D), + ), + ), + SizedBox(height: 12,), + GestureDetector( + onTap: (){ + Navigator.of(context).pushNamed('/router/invite_friends'); + }, + child:ClipRRect( + child:Image.asset( + "assets/image/icon_story_td.webp", + width:double.infinity, + fit: BoxFit.cover, + height:80.h, + ), + borderRadius: BorderRadius.circular(6.w), + ), + ), + ], + ), + ); + } + + ///活动任务 + Widget activityTask() { + return Container( + margin: EdgeInsets.only(right:14.w,bottom:20.h,), + child:Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "活动任务", + style: TextStyle( + fontSize: 15.sp, + fontWeight: MyFontWeight.bold, + color: Color(0xFF0D0D0D), + ), + ), + Text( + "已完成0/3", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF4D4D4D), + ), + ), + ], + ), + SizedBox(height: 12,), + ListView.builder( + padding: EdgeInsets.zero, + itemCount:6, + scrollDirection: Axis.vertical, + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + itemBuilder: (context, position) { + return GestureDetector( + onTap: () { + }, + child: taskItem(), + ); + }, + ), + ], + ), + ); + } + + Widget taskItem() { + return Container( + width:double.infinity, + height:95.h, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(6), + color: Colors.white, + ), + padding: EdgeInsets.symmetric(horizontal: 12.w,vertical: 12.h), + margin: EdgeInsets.only(bottom: 10.h), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Expanded(child:Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "海峡姐妹茶新品尝鲜(0/3)", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.bold, + color: Color(0xFF353535), + ), + ), + Text( + "可获得¥10代金券", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF4D4D4D), + ), + ), Text( + "购买任意3杯新品", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFFB3B3B3), + ), + ), + ], + ),), + Container( + width: 55.w, + height: 19.h, + decoration: BoxDecoration( + gradient: new LinearGradient( + begin: Alignment.bottomCenter, + end: Alignment.topCenter, + colors: [ + Color(0xFFFF4F00), + Color(0xFFFF2700), + ]), + // border: Border.all(color: Colors.white,width: 0.5), + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(12), + ), + alignment: Alignment.center, + child:Text( + "领取", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFFFFFFFF), + ), + ), + ) + ], + ), + ); + } + +} diff --git a/lib/integral/integral_page.dart b/lib/integral/integral_page.dart index 940c90b5..f2baa8a5 100644 --- a/lib/integral/integral_page.dart +++ b/lib/integral/integral_page.dart @@ -87,11 +87,9 @@ class _IntegralPage extends State { child: Container( height: 122.h + kToolbarHeight + MediaQuery.of(context).padding.top, decoration: BoxDecoration( - gradient: RadialGradient( - center: Alignment.center, - colors: [Color(0xFF36426E), Color(0xFF2D3247)], - focal: Alignment.center, - radius: 1, + image: DecorationImage( + fit: BoxFit.fill, + image: AssetImage("assets/image/jifen.webp"), ), ), ), diff --git a/lib/integral/intergra_view/in_for_points.dart b/lib/integral/intergra_view/in_for_points.dart index 1f7c7e65..3d30e1fe 100644 --- a/lib/integral/intergra_view/in_for_points.dart +++ b/lib/integral/intergra_view/in_for_points.dart @@ -88,17 +88,17 @@ class _InForPoints extends State { child: Container( alignment: Alignment.center, child: RoundButton( - width: 166.w, + width: double.infinity, height: 34.h, text: (widget.signInfo != null && widget.signInfo.todayHasSignin) ? S.of(context).yiqiandao - : S.of(context).lijiqiandao, + : "签到", textColor: (widget.signInfo != null && widget.signInfo.todayHasSignin) ? Color(0xFF808080) : Colors.white, backgroup: (widget.signInfo != null && widget.signInfo.todayHasSignin) ? Color(0xFFF5F6FA) - : Color(0xFF32A060), + : Color(0xFF00BF00), fontSize: 16.sp, fontWeight: MyFontWeight.regular, padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 6.h), @@ -179,7 +179,7 @@ class _InForPoints extends State { color: (widget.signInfo != null && widget.signInfo.signInList != null && widget.signInfo.signInList.length > position) - ? Color(0xFF32A060) + ? Color(0xFF00BF00) : Color(0xFFF5F6FA), borderRadius: BorderRadius.circular(4), ), diff --git a/lib/integral/intergra_view/integral_task.dart b/lib/integral/intergra_view/integral_task.dart index 37ba1f0c..408d8694 100644 --- a/lib/integral/intergra_view/integral_task.dart +++ b/lib/integral/intergra_view/integral_task.dart @@ -210,7 +210,7 @@ class _IntegralTask extends State { backgroup: task.limitDay == (task.complateNum ?? task.conplateNum) ? Color(0xFFF5F6FA) - : Color(0xFF32A060), + : Color(0xFF00BF00), icons: Image.asset( "assets/image/icon_gold_coin.webp", width: 16, diff --git a/lib/l10n/intl_en.arb b/lib/l10n/intl_en.arb index 9cae031e..016dd729 100644 --- a/lib/l10n/intl_en.arb +++ b/lib/l10n/intl_en.arb @@ -5,7 +5,7 @@ "input_phone_hide": "请输入你的手机号", "input_code_hide": "请输入验证码", "login": "登录", - "send_code": "发送验证", + "send_code": "发送验证码", "resend_in_seconds": "{second}s后重新发送", "phone_error": "手机格式错误", "code_error": "验证码输入错误", diff --git a/lib/l10n/intl_zh_CN.arb b/lib/l10n/intl_zh_CN.arb index a71c342b..7134079b 100644 --- a/lib/l10n/intl_zh_CN.arb +++ b/lib/l10n/intl_zh_CN.arb @@ -5,7 +5,7 @@ "input_phone_hide": "请输入你的手机号", "input_code_hide": "请输入验证码", "login": "登录", - "send_code": "发送验证", + "send_code": "发送验证码", "resend_in_seconds": "{second}s后重新发送", "phone_error": "手机格式错误", "code_error": "验证码输入错误", diff --git a/lib/l10n/intl_zh_Hans_CN.arb b/lib/l10n/intl_zh_Hans_CN.arb index 4ca143d8..e80618c5 100644 --- a/lib/l10n/intl_zh_Hans_CN.arb +++ b/lib/l10n/intl_zh_Hans_CN.arb @@ -5,7 +5,7 @@ "input_phone_hide": "请输入你的手机号", "input_code_hide": "请输入验证码", "login": "登录", - "send_code": "发送验证", + "send_code": "发送验证码", "resend_in_seconds": "{second}s后重新发送", "phone_error": "手机格式错误", "code_error": "验证码输入错误", diff --git a/lib/login/new_login_page.dart b/lib/login/new_login_page.dart new file mode 100644 index 00000000..5866c5f3 --- /dev/null +++ b/lib/login/new_login_page.dart @@ -0,0 +1,840 @@ +import 'dart:async'; +import 'dart:convert'; +import 'dart:io'; + +import 'package:dio/dio.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/gestures.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_easyloading/flutter_easyloading.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; +import 'package:flutter_swiper/flutter_swiper.dart'; +import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/retrofit/data/activity.dart'; +import 'package:huixiang/retrofit/data/base_data.dart'; +import 'package:huixiang/retrofit/data/login_info.dart'; +import 'package:huixiang/retrofit/data/page.dart'; +import 'package:huixiang/retrofit/data/user_entity.dart'; +import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/utils/event_type.dart'; +import 'package:huixiang/utils/flutter_utils.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/view_widget/border_text.dart'; +import 'package:huixiang/view_widget/classic_header.dart'; +import 'package:huixiang/view_widget/item_title.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; +import 'package:huixiang/view_widget/my_footer.dart'; +import 'package:huixiang/view_widget/round_button.dart'; +import 'package:pull_to_refresh/pull_to_refresh.dart'; +import 'package:shared_preferences/shared_preferences.dart'; +import 'package:sharesdk_plugin/sharesdk_interface.dart'; + +import '../main.dart'; + +class NewLoginPage extends StatefulWidget { + final Map arguments; + + NewLoginPage({this.arguments}); + + @override + State createState() { + return _NewLoginPage(); + } +} + +class _NewLoginPage extends State { + ApiService apiService; + var _controllerPhone = TextEditingController(); + var _controllerCode = TextEditingController(); + var _controllerInviteCode = TextEditingController(); + final TapGestureRecognizer tapGestureRecognizer = TapGestureRecognizer(); + var verifyStatus = 0; + var mobileStatus = 0; + var mobileErrorText = ""; + var codeErrorText = ""; + var btnText = S.current.send_code; + var _sendCodeStatus = 0; + var checkStatus = false; + Timer _timer; + bool isShowLogin = false; + + @override + void initState() { + super.initState(); + isLogin(); + } + + initController() { + tapGestureRecognizer.onTap = () { + Navigator.of(context).pushNamed('/router/treaty_page'); + }; + + _controllerPhone.addListener(() { + if (_controllerPhone.text != null && _controllerPhone.text != "") { + if (isPhone(_controllerPhone.text)) { + statusPhoneTextColor = Color(0xFF353535); + statusPhoneLineColor = Color(0xFF32A060); + statusPhoneVisible = false; + } else { + statusPhoneTextColor = Color(0xFFF72626); + statusPhoneLineColor = Color(0xFFF72626); + statusPhoneVisible = true; + } + } else { + statusPhoneTextColor = Color(0xFF353535); + statusPhoneLineColor = Color(0xFF32A060); + statusPhoneVisible = false; + } + }); + + _controllerCode.addListener(() { + if (_controllerCode.text != null && _controllerCode.text != "") { + if (_controllerCode.text.length == 6) { + statusCodeTextColor = Color(0xFF353535); + statusCodeLineColor = Color(0xFF32A060); + statusCodeVisible = false; + } else { + statusCodeTextColor = Color(0xFFF72626); + statusCodeLineColor = Color(0xFFF72626); + statusCodeVisible = true; + } + } else { + statusCodeTextColor = Color(0xFF353535); + statusCodeLineColor = Color(0xFF32A060); + statusCodeVisible = false; + } + }); + } + + _sendCode() async { + SharedPreferences sharedPreferences = await SharedPreferences.getInstance(); + if (!sharedPreferences.containsKey("isShowPrivacyPolicy") || + !sharedPreferences.getBool("isShowPrivacyPolicy")) { + showAlertDialog(); + return; + } + if (!checkStatus) { + SmartDialog.showToast(S.of(context).gouxuanxieyi, + alignment: Alignment.center); + return; + } + var mobile = _controllerPhone.text; + if (mobile == "") { + mobileStatus = 2; + mobileErrorText = S.of(context).qingshurushoujihao; + setState(() {}); + return; + } + if (_sendCodeStatus == 0) { + apiService + .sendVerify(mobile) + .then((value) => { + if (value.isSuccess) + {_sendCodeStatus = 1, countdown()} + else + { + btnText = S.of(context).send_code, + _sendCodeStatus = 0, + SmartDialog.showToast("${value.msg}", + alignment: Alignment.center), + refresh() + } + }) + .catchError((error) { + SmartDialog.showToast("$error", alignment: Alignment.center); + }); + } + } + + bool statusPhoneVisible = false; + Color statusPhoneTextColor = Color(0xFF353535); + Color statusPhoneLineColor = Color(0xFFF4F4F4); + + bool statusCodeVisible = false; + Color statusCodeTextColor = Color(0xFF353535); + Color statusCodeLineColor = Color(0xFFF4F4F4); + + countdown() { + if (_timer != null && _timer.isActive) return; + int countdown = 60; + _timer = Timer.periodic(Duration(seconds: 1), (timer) { + countdown--; + if (countdown == 0) { + btnText = S.of(context).send_code; + _sendCodeStatus = 0; + _timer.cancel(); + } else { + btnText = S.of(context).resend_in_seconds(countdown); + } + refresh(); + }); + } + + _login() async { + SharedPreferences sharedPreferences = await SharedPreferences.getInstance(); + if (!sharedPreferences.containsKey("isShowPrivacyPolicy") || + !sharedPreferences.getBool("isShowPrivacyPolicy")) { + showAlertDialog(); + return; + } + if (!checkStatus) { + SmartDialog.showToast(S.of(context).gouxuanxieyi, + alignment: Alignment.center); + return; + } + var mobile = _controllerPhone.text; + if (mobile == "") { + mobileStatus = 2; + mobileErrorText = S.of(context).qingshurushoujihao; + setState(() {}); + return; + } + if (mobile.length != 11) { + mobileStatus = 2; + mobileErrorText = S.of(context).phone_error; + setState(() {}); + return; + } + + var code = _controllerCode.text; + if (code == "") { + verifyStatus = 2; + codeErrorText = S.of(context).qingshuruyanzhengma; + setState(() {}); + return; + } + if (code.length != 6) { + verifyStatus = 2; + codeErrorText = S.of(context).code_error; + setState(() {}); + return; + } + var invite = _controllerInviteCode.text; + var param = { + "capcha": code, + "mobile": mobile, + "invite":invite + }; + EasyLoading.show(status: S.of(context).zhengzaijiazai); + BaseData value = await apiService.memberLogin(param).catchError((error) { + print(error.message); + SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type), alignment: Alignment.center); + }); + // EasyLoading.show(status: S.of(context).zhengzaijiazai); + if (value !=null && value.isSuccess) { + var userInfo = LoginInfo.fromJson(value.data); + saveUserJson(userInfo.authInfo.toJson()); + eventBus.fire(EventType(3)); + + Navigator.of(context).pushNamedAndRemoveUntil( + '/router/main_page', + (route) => false,arguments:{"invite":invite,"interviewCouponList":userInfo.interviewCouponList, + "firstLoginCouponList":userInfo.firstLoginCouponList}); + EasyLoading.dismiss(); + + } else { + SmartDialog.showToast("${value?.msg ??""}", alignment: Alignment.center); + } + } + + saveUserJson(userJson) { + var userEntity = UserEntity.fromJson(userJson); + SharedPreferences.getInstance().then((value) => { + value.setString('userJson', jsonEncode(userJson)), + value.setString('token', userEntity.token), + value.setString('userId', userEntity.userId), + value.setString('nick', userEntity.name), + value.setString('mobile', userEntity.mobile), + }); + } + + isLogin() async { + SharedPreferences sharedPreferences = await SharedPreferences.getInstance(); + + if (sharedPreferences.getBool("isShowPrivacyPolicy") == null || + !sharedPreferences.getBool("isShowPrivacyPolicy")) { + showAlertDialog(); + } + + if (sharedPreferences.containsKey('token') && + sharedPreferences.getString("token") != null && + sharedPreferences.getString("token") != "") { + Navigator.of(context).popAndPushNamed('/router/main_page'); + } else {initController(); + + apiService = ApiService(Dio(), context: context); + isShowLogin = true; + setState(() {}); + } + } + + @override + void dispose() { + if (_timer != null && _timer.isActive) _timer.cancel(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + body:AnimatedCrossFade( + firstChild: Container( + color: Colors.white, + child: Image.asset( + "assets/image/ic_splash_bg.webp", + fit: BoxFit.fill, + ), + ), + layoutBuilder: (widgetFirst, keyFirst, widgetSecond, keySecond) { + return Stack( + clipBehavior: Clip.none, + children: [ + Positioned( + key: keySecond, + left: 0.0, + top: 0.0, + right: 0.0, + bottom: 0.0, + child: widgetSecond, + ), + Positioned( + key: keyFirst, + left: 0.0, + top: 0.0, + right: 0.0, + bottom: 0.0, + child: widgetFirst, + ), + ], + ); + }, + secondChild: substance(), + firstCurve: Curves.easeInQuart, + secondCurve: Curves.easeInQuart, + crossFadeState: + isShowLogin ? CrossFadeState.showSecond : CrossFadeState.showFirst, + duration: Duration(milliseconds: Platform.isIOS ? 1000 : 1000), + ) + ); + } + + void refresh() { + setState(() {}); + } + + Widget substance(){ + return Container( + child: Column( + children: [ + Expanded( + child:SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: double.infinity, + padding: EdgeInsets.only(left: 16.w,top:51+ MediaQuery.of(context).padding.top,right: 12.w), + child:Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "Hello,", + style: TextStyle( + fontWeight: MyFontWeight.regular, + fontSize: 40.sp, + color: Color(0xFF000000), + ), + ), + SizedBox(height:10.h,), + Text( + "欢迎来到一心回乡", + style: TextStyle( + fontWeight: MyFontWeight.regular, + fontSize: 20.sp, + color: Color(0xFF000000), + ), + ), + SizedBox(height:40.h,), + Text( + S.of(context).shoujihao, + style: TextStyle( + fontWeight: MyFontWeight.bold, + fontSize: 16.sp, + color: Color(0xFF181818), + ), + ), + Container( + height:30.h, + width: MediaQuery.of(context).size.width - 80.h, + // margin: EdgeInsets.only(top: 12.h), + child: TextField( + style: TextStyle( + height: 1.h, + fontSize: 16.sp, + color: statusPhoneTextColor, + ), + onChanged: (value) { + if (value != null && value.isNotEmpty) { + if (isPhone(value)) { + mobileStatus = 1; + } else { + mobileStatus = 2; + } + } else { + mobileStatus = 0; + } + setState(() {}); + }, + controller: _controllerPhone, + keyboardType: TextInputType.phone, + decoration: InputDecoration( + errorBorder: InputBorder.none, + focusedBorder: InputBorder.none, + enabledBorder: InputBorder.none, + hintText: "", + // contentPadding: EdgeInsets.only(top: 12, bottom: 12, left: 12), + hintStyle: TextStyle( + fontSize: 10.sp, + color: Color(0xFFA29E9E), + ), + ), + textInputAction: TextInputAction.next, + inputFormatters: [LengthLimitingTextInputFormatter(11)], + cursorColor: Colors.grey, + maxLines: 1, + ), + ), + Container( + height: 1.h, + width: MediaQuery.of(context).size.width - 80.h, + color: statusPhoneLineColor, + ), + SizedBox( + height:30.h, + child: Visibility( + visible: statusPhoneVisible, + child: Text( + S.of(context).phone_error, + style: TextStyle( + color: Color(0xFFF72626), + fontSize: 12.sp, + ), + ), + ), + ), + Text( + S.of(context).yanzhengma, + style: TextStyle( + fontWeight: MyFontWeight.bold, + fontSize: 16.sp, + color: Color(0xFF181818), + ), + ), + Container( + height:30.h, + width: MediaQuery.of(context).size.width - 80.h, + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Expanded( + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Expanded( + child: TextField( + style: TextStyle( + height: 1.h, + fontSize: 16.sp, + color: statusCodeTextColor, + ), + onChanged: (value) { + if (value != null && value.isNotEmpty) { + if (value.length == 6) { + verifyStatus = 1; + } else { + verifyStatus = 2; + } + } else { + verifyStatus = 0; + } + setState(() {}); + }, + controller: _controllerCode, + keyboardType: TextInputType.phone, + decoration: InputDecoration( + errorBorder: InputBorder.none, + focusedBorder: InputBorder.none, + enabledBorder: InputBorder.none, + hintText: "", + hintStyle: TextStyle( + fontSize: 10.sp, + color: Color(0xFFA29E9E), + ), + ), + textInputAction: TextInputAction.next, + inputFormatters: [ + LengthLimitingTextInputFormatter(6) + ], + cursorColor: Colors.grey, + maxLines: 1, + ), + flex: 1, + ), + Container( + height: 1.h, + color: statusCodeLineColor, + ), + ], + ), + flex: 4, + ), + SizedBox( + width: 17.h, + ), + Expanded( + child: Container( + alignment: Alignment.bottomCenter, + child: InkWell( + onTap: _sendCode, + child: BorderText( + text: btnText, + borderColor: Colors.transparent, + borderWidth: 1.w, + radius: 2, + padding: EdgeInsets.only( + left: 6.w, + right: 6.w, + ), + fontSize: 14.sp, + fontWeight: MyFontWeight.bold, + textColor: _sendCodeStatus == 0 + ? Color(0xFF32A060) + : Color(0xFFFF7A1A), + ), + ), + ), + flex: 2, + ) + ], + ), + ), + Visibility( + visible: statusCodeVisible, + child: Text( + S.of(context).code_error, + style: TextStyle( + color: Color(0xFFF72626), + fontSize: 12.sp, + ), + ), + ), + SizedBox(height: 51.h,), + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Checkbox( + value: checkStatus, + onChanged: (a) { + setState(() { + checkStatus = !checkStatus; + }); + }, + checkColor: Color(0xFFFFFFFF), + fillColor: MaterialStateProperty.all(Color(0xFF32A060)), + ), + Expanded(child: + Text.rich( + TextSpan(children: [ + TextSpan( + text: S.of(context).privacy_policy1, + style: TextStyle( + fontSize: 11.sp, + color: Color(0xFF010101), + ), + ), + TextSpan( + // text: S.of(context).privacy_policy2, + text: "《一心回乡用户协议》", + recognizer: TapGestureRecognizer() + ..onTap = () { + Navigator.of(context) + .pushNamed('/router/user_service_page'); + }, + style: TextStyle( + fontSize: 11.sp, + color: Color(0xFF32A060), + ), + ), + TextSpan( + text: "、", + style: TextStyle( + fontSize: 11.sp, + color: Colors.black, + ), + ), + TextSpan( + text: S.of(context).privacy_policy3, + recognizer: tapGestureRecognizer, + style: TextStyle( + fontSize: 11.sp, + color: Color(0xFF32A060), + ), + ), + TextSpan( + text: S.of(context).privacy_policy4, + style: TextStyle( + fontSize: 11.sp, + height: 1.2, + color: Color(0xFF010101), + ), + ), + ]), + )), + SizedBox(width: 30,) + ], + ), + GestureDetector( + onTap: (){ + _login(); + }, + child: Container( + width:double.infinity, + height: 57.h, + alignment: Alignment.center, + margin: EdgeInsets.only(top: 14.h,bottom:12.h), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(6), + color: Color(0xFF32A060), + ), + child: Text( + S.of(context).denglu, + style: TextStyle( + fontWeight: MyFontWeight.regular, + fontSize: 15.sp, + color: Color(0xFFFFFFFF), + ), + ), + ), + ), + GestureDetector( + onTap: (){ + print("11111"); + if (widget.arguments != null) { + Navigator.of(context).pop(); + } else { + Navigator.of(context).popAndPushNamed('/router/main_page'); + } + }, + child: Container( + width:double.infinity, + height: 57.h, + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(6), + border: Border.all( + color: Color(0xFF32A060), + width: 1, + ), + ), + child: Text( + S.of(context).youkedenglu, + style: TextStyle( + fontWeight: MyFontWeight.regular, + fontSize: 15.sp, + color: Color(0xFF32A060), + ), + ), + ), + ), + ], + ), + ), + ], + ), + ), + ), + Container( + width: double.infinity, + alignment: Alignment.bottomCenter, + child: Image.asset( + "assets/image/login_bott.webp", + fit: BoxFit.fill, + width: double.infinity, + height: 120.h, + ), + ) + ], + ), + ); + } + + showAlertDialog() { + //显示对话框 + showDialog( + context: context, + builder: (BuildContext context) { + return SimpleDialog( + titlePadding: EdgeInsets.all(10), + backgroundColor: Colors.transparent, + elevation: 0, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(6), + ), + children: [ + Stack( + alignment: Alignment.bottomCenter, + children: [ + Container( + alignment: Alignment.center, + width: double.infinity, + height: 305.h, + padding: EdgeInsets.only(left: 16.w, right: 16.w), + decoration: new BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + ), + child: Column( + children: [ + Padding( + padding: EdgeInsets.only(top: 24.h, bottom: 10.h), + child: Text( + S.of(context).xieyitanchuang, + style: TextStyle( + color: Color(0xff4D4D4D), + fontSize: 18.sp, + fontWeight: FontWeight.bold, + ), + ), + ), + Text.rich( + TextSpan(children: [ + TextSpan( + text: S.of(context).yinsizhengce1, + style: TextStyle( + fontWeight: MyFontWeight.medium, + fontSize: 14.sp, + height: 1.3.h, + color: Color(0xff727272), + ), + ), + TextSpan( + text: S.of(context).yinsixieyi, + style: TextStyle( + fontWeight: MyFontWeight.medium, + fontSize: 14.sp, + color: Color(0xff32A060)), + recognizer: TapGestureRecognizer() + ..onTap = () { + Navigator.of(context) + .popAndPushNamed('/router/treaty_page'); + }, + ), + ]), + ), + SizedBox( + height: 10.h, + ), + Text( + S.of(context).yinsizhengce2, + style: TextStyle( + color: Color(0xff727272), + fontSize: 14.sp, + height: 1.3.h, + fontWeight: MyFontWeight.medium, + ), + ), + SizedBox( + height: 16.h, + ), + ], + ), + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + GestureDetector( + onTap: () { + Navigator.of(context).pop(); + exit(0); + }, + child: Container( + height: 40.h, + alignment: Alignment.bottomCenter, + margin: EdgeInsets.only(bottom: 20.h), + child: BorderText( + padding: EdgeInsets.only( + top: 10.h, + bottom: 10.h, + left: 36.w, + right: 36.w, + ), + text: S.of(context).jujue, + fontSize: 12.sp, + textColor: Color(0xFF32A060), + borderColor: Color(0xFF32A060), + borderWidth: 1.w, + radius: 23, + ), + ), + ), + SizedBox( + width: 21.w, + ), + Container( + height: 40.h, + margin: EdgeInsets.only(bottom: 20.h), + alignment: Alignment.bottomCenter, + child: RoundButton( + text: S.of(context).tongyibingjixu, + textColor: Colors.white, + fontSize: 12.sp, + callback: () { + SharedPreferences.getInstance().then((value) { + value.setBool("isShowPrivacyPolicy", true); + }); + SharesdkPlugin.uploadPrivacyPermissionStatus( + 1, + (success) => { + Navigator.of(context).pop(), + }, + ); + }, + padding: EdgeInsets.only( + top: 10.h, + bottom: 10.h, + left: 21.5.w, + right: 21.5.w, + ), + backgroup: Color(0xff32A060), + radius: 23, + ), + ), + SizedBox( + height: 20.h, + ), + ], + ), + ], + ) + ], + ); + }, + ); + } + + bool isPhone(mobile) { + RegExp exp = RegExp( + r'^((13[0-9])|(14[0-9])|(15[0-9])|(16[0-9])|(17[0-9])|(18[0-9])|(19[0-9]))\d{8}$'); + return exp.hasMatch(mobile); + } + +} diff --git a/lib/main.dart b/lib/main.dart index 92aabe3b..4c780bae 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -44,6 +44,7 @@ import 'package:huixiang/order/order_history_page.dart'; import 'package:huixiang/order/store_selector_page.dart'; import 'package:huixiang/order/write_off_page.dart'; import 'package:huixiang/order/write_off_success_page.dart'; +import 'package:huixiang/qr/invite_friends.dart'; import 'package:huixiang/qr/qr_code_scan.dart'; import 'package:huixiang/qr/qr_share.dart'; import 'package:huixiang/setting/about_page.dart'; @@ -53,6 +54,8 @@ import 'package:huixiang/setting/logout_page.dart'; import 'package:huixiang/setting/permission_setting_page.dart'; import 'package:huixiang/setting/setting_page.dart'; import 'package:huixiang/setting/treaty_page.dart'; +import 'package:huixiang/store/report_assess%20.dart'; +import 'package:huixiang/store/shop__details_page.dart'; import 'package:huixiang/store/shopping/activity_prefecture_details.dart'; import 'package:huixiang/store/shopping/shopping_goods_details.dart'; import 'package:huixiang/store/shopping/shopping_home/bargain_details.dart'; @@ -90,11 +93,17 @@ import 'community/report/report_page.dart'; import 'community/report/report_success.dart'; import 'home/guide_page.dart'; import 'home/home_view/activity_list.dart'; +import 'home/start_page.dart'; +import 'home/welfare_page.dart'; +import 'login/new_login_page.dart'; import 'main_page.dart'; import 'message/system_details.dart'; import 'mine/edit_signature.dart'; import 'mine/invitation_record.dart'; import 'mine/manage_address_page.dart'; +import 'mine/mine_greenery.dart'; +import 'mine/mine_shop_details.dart'; +import 'mine/mine_shop_page.dart'; import 'mine/mine_view/community_follow.dart'; import 'mine/mine_vip/binding_assistant_card.dart'; import 'mine/mine_vip/legal_right_details.dart'; @@ -181,7 +190,8 @@ class MyApp extends StatelessWidget { return appLocale ?? locales[0]; }, supportedLocales: S.delegate.supportedLocales, - home: (isFirst ?? true) ? GuidePage() : LoginPage(), + home: (isFirst ?? true) ? GuidePage() : NewLoginPage(), + // home: StartPage(isFirst), builder: EasyLoading.init( builder: (context, widget) { // ScreenUtil.setContext(context); @@ -216,7 +226,7 @@ class MyApp extends StatelessWidget { return MaterialPageRoute( //未找到页面配置进入登录页 builder: (context) { - return LoginPage(); + return NewLoginPage(); }, settings: settings, ); @@ -292,6 +302,8 @@ Map routers = { PermissionSettingPage(), '/router/login_page': (context, {arguments}) => LoginPage(arguments: arguments), + '/router/new_login_page': (context, {arguments}) => + NewLoginPage(arguments: arguments), '/router/edit_name': (context, {arguments}) => EditName(arguments: arguments), '/router/edit_signature': (context, {arguments}) => EditSignature(arguments: arguments), '/router/mine_card_invalid': (context, {arguments}) => MineCardInvalidPage(), @@ -362,4 +374,18 @@ Map routers = { LogoutIng(), '/router/user_service_page': (context, {arguments}) => UserServicePage(), + '/router/welfare_page': (context, {arguments}) => + WelfarePage(), + '/router/invite_friends': (context, {arguments}) => + InviteFriends(), + '/router/report_assess': (context, {arguments}) => + ReportAssess(), + '/router/shop_details_page': (context, {arguments}) => + ShopDetailsPage(arguments:arguments,), + '/router/mine_greenery': (context, {arguments}) => + MineGreenery(), + '/router/mine_shop_page': (context, {arguments}) => + MineShopPage(), + '/router/mine_shop_details': (context, {arguments}) => + MineShopDetails(arguments:arguments,), }; diff --git a/lib/main_page.dart b/lib/main_page.dart index f821f904..102e6dce 100644 --- a/lib/main_page.dart +++ b/lib/main_page.dart @@ -45,6 +45,7 @@ class _MainPage extends State with WidgetsBindingObserver { List icons; final GlobalKey homePageKey = GlobalKey(); + final GlobalKey minePageKey = GlobalKey(); // List iconn; @override @@ -115,7 +116,7 @@ class _MainPage extends State with WidgetsBindingObserver { UnionPage(), // (Theme.of(context).platform == TargetPlatform.android) ? OrderPage() :CommunityPage(), CommunityPage(), - MinePage(), + MinePage(minePageKey), ]; icons = [ @@ -219,7 +220,10 @@ class _MainPage extends State with WidgetsBindingObserver { }, onReceiveNotificationResponse: (event) async { try{ if(jsonDecode(event["customMessage"])["typed"] == 6){ - HomePageState state = homePageKey.currentState; + // HomePageState state = homePageKey.currentState; + // state.queryMsgStats(); + + MinePageState state = minePageKey.currentState; state.queryMsgStats(); } }catch(ex){} @@ -429,7 +433,7 @@ class _MainPage extends State with WidgetsBindingObserver { style: TextStyle( fontSize: 10, fontWeight: MyFontWeight.semi_bold, - color: Color(isSelected ? 0xFF4C4C4C : 0xFFA29E9E), + color: Color(isSelected ? 0xFF32A060 : 0xFFC6C6C6), ), ), ], diff --git a/lib/mine/mine_greenery.dart b/lib/mine/mine_greenery.dart new file mode 100644 index 00000000..e9057a39 --- /dev/null +++ b/lib/mine/mine_greenery.dart @@ -0,0 +1,619 @@ +import 'dart:io'; + +import 'package:dio/dio.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_easyloading/flutter_easyloading.dart'; +import 'package:flutter_html/flutter_html.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; +import 'package:fluwx/fluwx.dart'; +import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/home/points_mall_view/points_goods_view.dart'; +import 'package:huixiang/retrofit/data/base_data.dart'; +import 'package:huixiang/retrofit/data/goods.dart'; +import 'package:huixiang/retrofit/data/page.dart'; +import 'package:huixiang/retrofit/data/recharge_list.dart'; +import 'package:huixiang/retrofit/data/user_info.dart'; +import 'package:huixiang/retrofit/data/vip_benefit_list.dart'; +import 'package:huixiang/retrofit/data/vip_rule_details.dart'; +import 'package:huixiang/retrofit/data/wx_pay.dart'; +import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/utils/flutter_utils.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/utils/min.dart'; +import 'package:huixiang/view_widget/classic_header.dart'; +import 'package:huixiang/view_widget/custom_image.dart'; +import 'package:huixiang/view_widget/item_input_widget.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; +import 'package:huixiang/view_widget/my_footer.dart'; +import 'package:huixiang/view_widget/round_button.dart'; +import 'package:pull_to_refresh/pull_to_refresh.dart'; +import 'package:shared_preferences/shared_preferences.dart'; + +class MineGreenery extends StatefulWidget { + @override + State createState() { + return _MineGreenery(); + } +} + +class _MineGreenery extends State { + ApiService apiService; + final RefreshController refreshController = RefreshController(); + final ScrollController scrollController = ScrollController(); + int pageNum = 1; + String categoryId; + bool orderDesc = true; + int orderType = 1; + List goods = []; + + @override + void initState() { + super.initState(); + + SharedPreferences.getInstance().then((value) => { + apiService = ApiService(Dio(), context: context, token: value.getString("token")), + pointGoodsList(), + }); + } + + pointGoodsList() async { + var param = { + "categoryId": categoryId ?? "", + "orderDesc": orderDesc, + "orderType": orderType, + "pageNum": pageNum, + "pageSize": 10, + "state": 1 + }; + BaseData> pageGoods = + await apiService.creditGoods(param).catchError((onError) { + refreshController.loadFailed(); + refreshController.refreshFailed(); + }); + EasyLoading.dismiss(); + if (pageGoods != null && pageGoods.isSuccess) { + setState(() { + if (pageNum == 1) { + goods.clear(); + } + goods.addAll(pageGoods.data.list); + }); + refreshController.refreshCompleted(); + refreshController.loadComplete(); + if (pageGoods.data.pageNum == pageGoods.data.pages) { + refreshController.loadNoData(); + } else { + pageNum += 1; + } + } else { + refreshController.loadFailed(); + refreshController.refreshFailed(); + } + } + + @override + Widget build(BuildContext context) { + return Container( + // color: Color(0xFF32A060), + child: SmartRefresher( + controller: refreshController, + enablePullDown: true, + enablePullUp: false, + header: MyHeader(), + footer: CustomFooter( + builder: (context, mode) { + return MyFooter(mode); + }, + ), + onRefresh: () { + setState(() { + pointGoodsList(); + }); + }, + physics: BouncingScrollPhysics(), + scrollController: scrollController, + child: Container(color: Color(0xFF32A060), + child: Stack( + children: [ + Container( + width: double.infinity, + height: 340.h, + decoration: BoxDecoration( + image: DecorationImage( + fit: BoxFit.cover, + image: AssetImage("assets/image/s_bg.webp"), + ), + ), + padding: EdgeInsets.only( + top: 23.h + MediaQuery.of(context).padding.top, + left: 14.w,right: 14.w), + child: + Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Spacer(), + Container( + alignment: Alignment.bottomCenter, + child:Column( + children: [ + Image.asset( + "assets/image/shu3.webp", + width: 225, + height: 225, + ), + Text( + "已获得2片绿叶", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFFFFFFFF), + ), + ), + ], + ) + ), + ], + ), + ), + Container( + child: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: double.infinity, + margin: EdgeInsets.only( + top: 23.h + MediaQuery.of(context).padding.top, + left: 14.w,right: 14.w), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + GestureDetector( + onTap: (){ + Navigator.of(context).pop(); + }, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Icon( + Icons.arrow_back_ios, + size: 24, + ), + Spacer(), + Text( + "我的绿叶", + style: TextStyle( + fontSize: 17.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF0D0D0D), + ), + ), + Spacer() + ], + ), + ), + goodsRecommendList(), + spreadImage(), + billDetailed(), + ], + ), + ), + ], + ), + ), + ) + ], + ), + ), + ), + ); + } + + + ///大家都在买 + Widget goodsRecommendList() { + return Container( + child: Stack( + children: [ + Container( + width: double.infinity, + height: 497.h, + margin: EdgeInsets.only(top:310.h), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all(Radius.circular(6)), + ), + padding: EdgeInsets.only(top:16.h), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded(child: + GridView.builder( + itemCount:goods == null ? 0 :goods.length, + padding: EdgeInsets.only( + left: 16.w, + right: 16.w, + top: 18.h, + bottom: 16.h, + ), + shrinkWrap: true, + physics: BouncingScrollPhysics(), + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + //一行的Widget数量 + crossAxisCount: 2, + //水平子Widget之间间距 + crossAxisSpacing: 11.w, + //垂直子Widget之间间距 + mainAxisSpacing: 16.w, + //子Widget宽高比例 0.59 + childAspectRatio: + 200 / (281 / 2 + (281 / 2) * AppUtils.textScale(context)), + ), + itemBuilder: (context, index) { + return GestureDetector( + onTap: () { + + }, + child: buildItem(goods[index]), + ); + }, + )), + ], + ), + ), + Container( + margin: EdgeInsets.only(top:295.h), + child: + Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + "assets/image/yz_l.webp", + fit: BoxFit.fill, + height: 20, + width: 21, + ), + Container( + width: 100.w, + height: 34.h, + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(8)), + gradient: new LinearGradient( + begin: Alignment.centerRight, + end: Alignment.centerLeft, + colors: [ + Color(0xFF32A060), + Color(0xFF9DF531), + ]), + ), + child: Text( + "大家都在买", + style: TextStyle( + fontSize: 15.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFFFFFFFF), + ), + ), + ), + Image.asset( + "assets/image/yz_r.webp", + fit: BoxFit.fill, + height: 20, + width: 21, + ), + ], + ), + ), + ], + ), + ); + } + + Widget buildItem(Goods goods) { + return Container( + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(4), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ) + ], + // color: Colors.white, + ), + child: Stack( + alignment: AlignmentDirectional.topEnd, + fit: StackFit.loose, + children: [ + Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + MImage( + goods.mainImgPath, + aspectRatio: 1.1, + fit: BoxFit.cover, + errorSrc: "assets/image/default_1.webp", + fadeSrc: "assets/image/default_1.webp", + ), + Expanded( + child: Container( + margin: EdgeInsets.only( + right: 12.w, + top: 10.h, + ),padding: EdgeInsets.only( + bottom: 8 + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + goods.name, + overflow: TextOverflow.ellipsis, + maxLines: 2, + style: TextStyle( + color: Color(0xFF0D0D0D), + fontWeight: MyFontWeight.regular, + fontSize: 13.sp, + ), + ), + Spacer(), + Expanded(child:Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + (goods?.price == null || goods.price == "0"?"":S.of(context).jifen_(goods.price)) + (goods?.money == null|| goods.money == "0.00" ?"":" + ${goods.money}元"), + style: TextStyle( + color: Color(0xFFE5600D), + fontSize: 16.sp, + fontWeight: MyFontWeight.semi_bold, + ), + ), + Text( + "+", + style: TextStyle( + color: Color(0xFFE5600D), + fontSize: 16.sp, + fontWeight: MyFontWeight.semi_bold, + ), + ), + Image.asset( + "assets/image/green_leaf.webp", + fit: BoxFit.cover, + width: 12, + height: 12, + ), + Text( + "+x100", + overflow: TextOverflow.ellipsis, + maxLines: 2, + style: TextStyle( + color: Color(0xFF32A060), + fontWeight: MyFontWeight.semi_bold, + fontSize: 16.sp, + ), + ), + ], + )), + ], + ), + ), + flex: 1, + ), + ], + ), + ], + ), + ); + } + + ///推广图 + Widget spreadImage() { + return Container( + margin: EdgeInsets.symmetric(vertical: 24.h), + child: GestureDetector( + onTap: (){ + Navigator.of(context).pushNamed('/router/invite_friends'); + }, + child:ClipRRect( + child:Image.asset( + "assets/image/icon_story_td.webp", + width:double.infinity, + fit: BoxFit.cover, + height:80.h, + ), + borderRadius: BorderRadius.circular(6), + ), + ), + ); + } + + ///收支明细 + Widget billDetailed() { + return Container( + child: Stack( + children: [ + Container( + width: double.infinity, + height: 260.h, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all(Radius.circular(6)), + ), + padding: EdgeInsets.only(top:16.h), + margin: EdgeInsets.only(bottom: 34.h,top: 16), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded(child: + ListView.builder( + padding: EdgeInsets.zero, + itemCount:6, + scrollDirection: Axis.vertical, + shrinkWrap: true, + physics: BouncingScrollPhysics(), + itemBuilder: (context, position) { + return GestureDetector( + onTap: () { + }, + child: billDetailedItem(), + ); + }, + ),) + ], + ), + ), + Container( + child: + Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + "assets/image/yz_l.webp", + fit: BoxFit.fill, + height: 20, + width: 21, + ), + Container( + width: 100.w, + height: 34.h, + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(8)), + gradient: new LinearGradient( + begin: Alignment.centerRight, + end: Alignment.centerLeft, + colors: [ + Color(0xFF32A060), + Color(0xFF9DF531), + ]), + ), + child: Text( + "绿叶收支明细", + style: TextStyle( + fontSize: 15.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFFFFFFFF), + ), + ), + ), + Image.asset( + "assets/image/yz_r.webp", + fit: BoxFit.fill, + height: 20, + width: 21, + ), + ], + ), + ), + ], + ), + ); + } + + ///收支明细 + Widget billDetailedItem() { + return Container( + width: double.infinity, + margin: EdgeInsets.only(top: 16.h), + padding: EdgeInsets.symmetric(horizontal: 14.w), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Text( + "购物得绿叶", + overflow: TextOverflow.ellipsis, + maxLines: 1, + style: TextStyle( + color: Color(0xFF262626), + fontWeight: MyFontWeight.semi_bold, + fontSize: 14.sp, + ), + ), + SizedBox(width:5.w,), + Text( + "(商品号1234567)", + overflow: TextOverflow.ellipsis, + maxLines: 1, + style: TextStyle( + color: Color(0xFF262626), + fontWeight: MyFontWeight.semi_bold, + fontSize: 14.sp, + ), + ), + ], + ), + SizedBox(height: 8.h,), + Text( + "2022-09-09 19:22:23", + overflow: TextOverflow.ellipsis, + maxLines: 1, + style: TextStyle( + color: Color(0xFF262626), + fontWeight: MyFontWeight.regular, + fontSize: 12.sp, + ), + ), + ], + ), + Row( + children: [ + Text( + "+12", + style: TextStyle( + color: Color(0xFF32A060), + fontWeight: MyFontWeight.bold, + fontSize: 15.sp, + ), + ), + Image.asset( + "assets/image/green_leaf.webp", + fit: BoxFit.cover, + width: 14, + height: 14, + ), + ], + ) + ], + ), + Container( + width: double.infinity, + height: 1.h, + color: Color(0xFFF2F2F2), + margin: EdgeInsets.only(top: 12.h), + ) + ], + ), + ); + } + +} diff --git a/lib/mine/mine_page.dart b/lib/mine/mine_page.dart index 9649d0d4..6a64e6ed 100644 --- a/lib/mine/mine_page.dart +++ b/lib/mine/mine_page.dart @@ -5,8 +5,10 @@ import 'package:flutter/material.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/main.dart'; +import 'package:huixiang/mine/mine_view/mine_calendar.dart'; import 'package:huixiang/mine/mine_view/mine_order.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; +import 'package:huixiang/retrofit/data/msg_stats.dart'; import 'package:huixiang/retrofit/data/rank.dart'; import 'package:huixiang/retrofit/data/social_info.dart'; import 'package:huixiang/retrofit/data/user_info.dart'; @@ -26,24 +28,27 @@ import 'mine_view/mine_view.dart'; import 'mine_view/wallet_coupon_view.dart'; class MinePage extends StatefulWidget { + + MinePage(Key key): super(key: key); @override State createState() { - return _MinePage(); + return MinePageState(); } } -class _MinePage extends State with AutomaticKeepAliveClientMixin { +class MinePageState extends State with AutomaticKeepAliveClientMixin { ApiService apiService; UserInfo userInfo; List ranks = []; SocialInfo infoNumber; final RefreshController _refreshController = RefreshController(); + int totalMsg = 0; _toUserInfo() async { SharedPreferences shared = await SharedPreferences.getInstance(); if (shared.getString("token") == null || shared.getString("token") == "") { Navigator.of(context) - .pushNamed('/router/login_page', arguments: {"login": "login"}); + .pushNamed('/router/new_login_page', arguments: {"login": "login"}); return; } // await Navigator.of(context).pushNamed('/router/user_info_page'); @@ -61,6 +66,7 @@ class _MinePage extends State with AutomaticKeepAliveClientMixin { void initState() { super.initState(); querySocialInfo(); + queryMsgStats(); eventBus.on().listen((event) { print("EventType: ${event.type}"); @@ -119,6 +125,7 @@ class _MinePage extends State with AutomaticKeepAliveClientMixin { _onRefresh() { // queryUserInfo(); querySocialInfo(); + queryMsgStats(); } ///个人社交信息(粉丝/关注数量/成就数量) @@ -142,11 +149,33 @@ class _MinePage extends State with AutomaticKeepAliveClientMixin { EasyLoading.dismiss(); } + ///消息数量 + queryMsgStats() async { + if (apiService == null) { + SharedPreferences value = await SharedPreferences.getInstance(); + apiService = ApiService( + Dio(), + context: context, + token: value.getString("token"), + ); + } + BaseData> baseData = await apiService.stats().catchError((onError) {}); + if (baseData != null && baseData.isSuccess) { + setState(() { + totalMsg = 0; + baseData.data.forEach((element) { + totalMsg += element.number; + }); + }); + } + EasyLoading.dismiss(); + } + @override Widget build(BuildContext context) { super.build(context); return Scaffold( - backgroundColor: Color(0xFFF7F7F7), + backgroundColor: Color(0xFFF9FAF7), body: Container( padding: EdgeInsets.only(bottom: 76.h), // margin: EdgeInsets.only(top: 40.h), @@ -194,6 +223,12 @@ class _MinePage extends State with AutomaticKeepAliveClientMixin { () { toIntegralPage(); }, + (){ + setState(() { + totalMsg =0; + }); + }, + totalMsg ), ///我的 VIP等级信息 @@ -208,20 +243,32 @@ class _MinePage extends State with AutomaticKeepAliveClientMixin { userInfo?.memberRankVo?.nextOrigin ?? 0, createTime: userInfo?.createTime ?? "", ), + + ], ), ), - ///关注度/粉丝/发布 - attention(), - - /// 钱包或领券中心 - WalletCoupon(), + // ///关注度/粉丝/发布 + // attention(), + // + // /// 钱包或领券中心 + // WalletCoupon(), + ///我的订单 MineOrderView(), + ///推广图 + spreadImage(), + ///我的 下面item MineItem(), + + ///我的成就 + attainment(), + + ///绿色足迹 + MineCalendar() ], ); }, @@ -236,6 +283,132 @@ class _MinePage extends State with AutomaticKeepAliveClientMixin { ); } + ///我的成就 + Widget attainment() { + return GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: (){ + Navigator.of(context).pushNamed( + '/router/mine_attainment_page', + arguments: {"userInfo": userInfo}, + ); + }, + child:Container( + margin: EdgeInsets.only(left:14,right:14,bottom:20), + padding: EdgeInsets.only(left:12, top:12, right:10,bottom: 12), + width: double.infinity, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ), + ], + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text( + S.of(context).wodechengjiu, + style: TextStyle( + fontWeight: MyFontWeight.bold, + fontSize: 15.sp, + color: Color(0xFF0D0D0D), + ), + ), + SizedBox(height: 9.h,), + Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Image.asset( + "assets/image/icon_attainment.webp", + width:54, + height:54, + fit: BoxFit.cover, + ), + SizedBox(width: 7.w,), + Expanded(child: + Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text( + "已解锁${infoNumber != null + ? infoNumber.achievementNumber.toString() + : "0"}个成就", + style: TextStyle( + fontWeight: MyFontWeight.regular, + fontSize: 14.sp, + color: Color(0xFF262626), + ), + ), + SizedBox(height:4.w,), + Text( + "完成任务解锁更多成就", + style: TextStyle( + fontWeight: MyFontWeight.regular, + fontSize: 12.sp, + color: Color(0xFF4D4D4D), + ), + ), + ], + )), + Container( + width: 60.w, + height: 19.h, + alignment: Alignment.center, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(10), + border: Border.all( + color: Color(0xFF32A060), + width: 1, + ), + ), + child: Text( + "全部成就", + style: TextStyle( + fontWeight: MyFontWeight.regular, + fontSize: 12.sp, + color: Color(0xFF32A060), + ), + ), + ) + ], + ) + ], + ), + ), + ); + } + + ///推广图 + Widget spreadImage() { + return Container( + margin: EdgeInsets.only(right:14.w,bottom:20.h,left: 14.w), + child: GestureDetector( + onTap: (){ + Navigator.of(context).pushNamed('/router/welfare_page'); + }, + child:ClipRRect( + child:Image.asset( + "assets/image/icon_story_td.webp", + width:double.infinity, + fit: BoxFit.cover, + height:80.h, + ), + borderRadius: BorderRadius.circular(6.w), + ), + ), + ); + } + ///横向的提示 Widget buildNotice() { return Container( diff --git a/lib/mine/mine_shop_details.dart b/lib/mine/mine_shop_details.dart new file mode 100644 index 00000000..7a06ce0c --- /dev/null +++ b/lib/mine/mine_shop_details.dart @@ -0,0 +1,593 @@ +import 'package:barcode_widget/barcode_widget.dart'; +import 'package:dio/dio.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_easyloading/flutter_easyloading.dart'; +import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/retrofit/data/base_data.dart'; +import 'package:huixiang/retrofit/data/page.dart'; +import 'package:huixiang/retrofit/data/product.dart'; +import 'package:huixiang/retrofit/data/user_bill.dart'; +import 'package:huixiang/retrofit/data/vip_card.dart'; +import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/store/scan.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/utils/location.dart'; +import 'package:huixiang/utils/painter_bg.dart'; +import 'package:huixiang/view_widget/custom_image.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; +import 'package:huixiang/view_widget/my_footer.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:pull_to_refresh/pull_to_refresh.dart'; +import 'package:shared_preferences/shared_preferences.dart'; + +class MineShopDetails extends StatefulWidget { + final Map arguments; + + MineShopDetails({this.arguments}); + + @override + State createState() { + return _MineShopDetails(); + } +} + +class _MineShopDetails extends State { + ApiService apiService; + int selectType = 0; + List userBill = []; + + @override + void dispose() { + super.dispose(); + refreshController.dispose(); + consumeRefreshController.dispose(); + Location.getInstance().stopLocation(); + } + + @override + void initState() { + super.initState(); + + vipDetail("", ""); + + // startLocation(); + queryDetail("bill_cate_point_sub"); + } + + + + VipCard vipCard; + final RefreshController refreshController = RefreshController(); + final RefreshController consumeRefreshController = RefreshController(); + int current = 1; + + vipDetail(latitude, longitude) async { + SharedPreferences value = await SharedPreferences.getInstance(); + if(apiService == null) + apiService = ApiService(Dio(), context: context, token: value.getString("token")); + BaseData baseData = await apiService.vipDetail({ + "id": widget.arguments["id"], + "latitude": "$latitude", + "longitude": "$longitude", + }).catchError((onError) {}); + if (baseData != null && baseData.isSuccess) { + vipCard = baseData.data; + refreshController.loadComplete(); + } else { + refreshController.loadFailed(); + } + print("object:object"); + setState(() {}); + } + + queryDetail(category) async { + SharedPreferences value = await SharedPreferences.getInstance(); + if(apiService == null) + apiService = ApiService(Dio(), context: context, token: value.getString("token")); + BaseData> baseData = await apiService.queryBillInfo({ + "current": current, + "model": {"category": category, "title": "bill_title_point", "type": ""}, + "order": "descending", + "size": 10, + "sort": "id" + }).catchError((onError) { + consumeRefreshController.loadFailed(); + consumeRefreshController.refreshFailed(); + }); + if (current == 1) userBill.clear(); + if (baseData != null && baseData.isSuccess) { + userBill.addAll(baseData.data.records); + consumeRefreshController.loadComplete(); + consumeRefreshController.refreshCompleted(); + if (current * 10 > int.tryParse(baseData.data.total)) { + consumeRefreshController.loadNoData(); + } else { + current += 1; + } + setState(() {}); + } else { + consumeRefreshController.loadFailed(); + consumeRefreshController.refreshFailed(); + } + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: MyAppBar( + title: "余额详情", + titleColor: Colors.black, + background: Colors.white, + brightness: Brightness.dark, + leadingColor: Colors.black, + ), + body: Column( + children: [ + buildVipCard(), + Container( + margin: EdgeInsets.only(left: 14.w), + child: + Row( + children: [ + GestureDetector( + onTap: (){ + setState(() { + selectType =0; + }); + }, + child: Column( + children: [ + Text( + "适用门店", + style: TextStyle( + color: Color(selectType == 0 ? 0xFF000000 : 0xFF868686), + fontSize: 15.sp, + fontWeight: MyFontWeight.medium, + ), + ), + SizedBox(height:8.h,), + if(selectType == 0) + Container( + width: 52.w, + height: 2.h, + color: Color(0xFF32A060), + ) + ], + ), + ), + SizedBox(width: 20.w,), + GestureDetector( + onTap: (){ + setState(() { + selectType = 1; + }); + }, + child: Column( + children: [ + Text( + "余额明细", + style: TextStyle( + color:Color(selectType == 1 ? 0xFF000000 : 0xFF868686), + fontSize: 15.sp, + fontWeight: MyFontWeight.medium, + ), + ), + SizedBox(height:8.h,), + if(selectType == 1) + Container( + width: 52.w, + height: 2.h, + color: Color(0xFF32A060), + ) + ], + ), + ), + ], + ), + ), + selectType == 0 ? + Expanded( + child: SmartRefresher( + controller: refreshController, + enablePullDown: false, + enablePullUp: false, + footer: CustomFooter( + builder: (context, mode) { + return MyFooter(mode); + }, + ), + physics: BouncingScrollPhysics(), + child: ListView.builder( + itemBuilder: (context, position) { + return GestureDetector( + onTap: () {}, + child: shopItem(vipCard.storeList[position]), + ); + }, + padding: EdgeInsets.symmetric(vertical: 1), + itemCount: (vipCard != null && vipCard.storeList != null) + ? vipCard.storeList.length + : 0, + ), + ), + ): + Expanded( + child: SmartRefresher( + controller: consumeRefreshController, + enablePullDown: false, + enablePullUp: true, + onRefresh:(){ + queryDetail("bill_cate_point_sub"); + }, + footer: CustomFooter( + builder: (context, mode) { + return MyFooter(mode); + }, + ), + physics: BouncingScrollPhysics(), + child: ListView.builder( + itemBuilder: (context, position) { + return GestureDetector( + onTap: () { + + }, + child: consumeItem(userBill[position]), + ); + }, + padding: EdgeInsets.symmetric(vertical: 1), + itemCount: userBill != null ? userBill.length : 0, + ), + ), + ), + ], + ), + ); + } + + int colorByName(String storeName) { + if (storeName == null) return 0xFF32A060; + if (storeName.contains("百年川椒") || storeName.contains("百年川椒")) { + return 0xFFC30D23; + } else if (storeName.contains("海峡姐妹") || storeName.contains("海峽姐妹")) { + return 0xFFE4C796; + } else if (storeName.contains("前进麦味") || storeName.contains("前進麥味")) { + return 0xFF265782; + } + return 0xFF32A060; + } + + Widget buildVipCard() { + return Container( + width:double.infinity, + // height:140.h, + margin: EdgeInsets.only(bottom:24.h,top: 14.h,left: 14.w,right: 14.w), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + decoration: BoxDecoration( + borderRadius: new BorderRadius.only( + topLeft: Radius.circular(6), + topRight: Radius.circular(6), + ), + color: Color(colorByName(vipCard?.tenantName ?? "")), + ), + padding: EdgeInsets.only(left: 12.w), + height: 62.h, + child: Row( + children: [ + MImage( + (vipCard?.storeList?.length ?? 0) > 0 + ? vipCard.storeList[0].logo + : "", + width: 38, + height: 38, + radius: BorderRadius.circular(100), + fit: BoxFit.cover, + errorSrc: "assets/image/default_1.webp", + fadeSrc: "assets/image/default_1.webp", + ), + SizedBox(width: 6,), + Text( + vipCard != null ? vipCard.tenantName : "", + style: TextStyle( + color: Color(0xFFFFFFFF), + fontSize: 15.sp, + fontWeight: MyFontWeight.medium, + ), + ), + ], + ), + ), + Container( + decoration: BoxDecoration( + borderRadius: new BorderRadius.only( + bottomRight: Radius.circular(6), + topRight: Radius.circular(6), + ), + color: Colors.white, + ), + padding: EdgeInsets.all(12.h), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "店铺余额(元)", + style: TextStyle( + color: Color(0xFF262626), + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + ), + ), + Text( + "No.${vipCard?.id ?? ""}", + style: TextStyle( + color: Color(0xFF262626), + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + ), + ), + ], + ), + SizedBox(height:4.h,), + Text( + "¥${vipCard != null ? vipCard.balance : ""}", + style: TextStyle( + color: Color(0xFF262626), + fontSize:24.sp, + fontWeight: MyFontWeight.bold, + ), + ), + ], + ), + ), + ], + ), + ); + } + + Widget shopItem(StoreListBean store) { + return Container( + decoration: BoxDecoration( + borderRadius: new BorderRadius.circular(6), + color: Colors.white, + ), + padding: EdgeInsets.all(12), + margin: EdgeInsets.symmetric(horizontal: 16.w, vertical: 8.h), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded( + flex: 1, + child: Text( + (store != null) ? store.storeName : "", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.semi_bold, + color: Colors.black, + ), + ), + ), + GestureDetector( + onTap: () { + // Navigator.of(context).pushNamed('/router/union_detail_page', + // arguments: {"id": store.id}); + if(store.posType.code == "NORMALSTORE") { + Scan.toScan( + context, + store.id, + store.tenantCode, + store.storeName, + ); + } else { + Navigator.of(context).pushNamed( + '/router/store_order', + arguments: { + "id": store.id, + "tenant": store.tenantCode, + "storeName": store.storeName + }, + ); + } + }, + child: Text( + S.of(context).chakan, + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xff32A060), + ), + ), + ), + Icon( + Icons.chevron_right, + color: Color(0xff32A060), + size: 16, + ), + ], + ), + SizedBox( + height: 8.h, + ), + Row( + children: [ + Text( + "${S.of(context).dizhi}: ", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xff353535), + ), + ), + Expanded( + child: Text( + store.address, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xff353535), + ), + ), + flex: 1, + ) + ], + ), + SizedBox( + height: 4.h, + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + flex: 1, + child: Text( + S.of(context).yingyeshijian((store.openStartTime == null && + store.openEndTime == null) + ? S.of(context).quantian + : "${store.openStartTime.substring(0, store.openStartTime.lastIndexOf(":"))} - ${store.openEndTime.substring(0, store.openEndTime.lastIndexOf(":"))}"), + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xff353535), + ), + ), + ), + Text( + (store.distance ?? 0) > 1000 + ? S.of(context).gongli( + ((store.distance ?? 0) / 1000 * 100).toInt() / 100.0) + : S + .of(context) + .mi(((store.distance ?? 0) * 100).toInt() / 100.0), + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xff868686), + ), + ), + ], + ), + ], + ), + ); + } + + Widget consumeItem(UserBill userBill){ + return Container( + decoration: BoxDecoration( + borderRadius: new BorderRadius.circular(6), + color: Colors.white, + ), + padding: EdgeInsets.all(12), + margin: EdgeInsets.symmetric(horizontal: 16.w, vertical: 8.h), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + userBill.name ?? "", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.semi_bold, + color: Colors.black, + ), + ), + SizedBox(height: 4,), + Text( + userBill.updateTime ?? "", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF4D4D4D), + ), + ), + ], + ), + Text( + "-${double.tryParse(userBill.number ?? "0").toInt().toString()}", + style: TextStyle( + fontSize: 18.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF4D4D4D), + ), + ), + ], + ), + ); + } + + bool isRemake = true; + + String totalPrice(orderInfo) { + if (orderInfo == null) return ""; + double totalPrice = (double.tryParse(orderInfo.orderSum) + + double.tryParse(orderInfo.postFee)); + if (orderInfo.orderDetail != null && + orderInfo.orderDetail.couponDTO != null) { + totalPrice -= double.tryParse(orderInfo.orderDetail.couponDTO.money); + } + return "$totalPrice"; + } + + List goodsItem(List products) { + if (products == null) return []; + if (products.length > 3) { + products = products.sublist(0, 3); + } + return products + .map( + (e) => Container( + margin: EdgeInsets.symmetric(horizontal: 2.w), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + MImage( + e.skuImg, + width: 75.w, + height: 75.h, + fit: BoxFit.contain, + errorSrc: "assets/image/default_1.webp", + fadeSrc: "assets/image/default_1.webp", + ), + SizedBox( + height: 4.h, + ), + if (isRemake) + Container( + width: 75.w, + child: Text( + e.productName, + maxLines: 1, + textAlign: TextAlign.center, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF353535), + ), + ), + ), + ], + ), + ), + ) + .toList(); + } +} diff --git a/lib/mine/mine_shop_page.dart b/lib/mine/mine_shop_page.dart new file mode 100644 index 00000000..a1be7f1a --- /dev/null +++ b/lib/mine/mine_shop_page.dart @@ -0,0 +1,243 @@ +import 'dart:convert'; + +import 'package:dio/dio.dart'; +import 'package:flutter/material.dart'; +import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/retrofit/data/base_data.dart'; +import 'package:huixiang/retrofit/data/page.dart'; +import 'package:huixiang/retrofit/data/user_bill.dart'; +import 'package:huixiang/retrofit/data/user_info.dart'; +import 'package:huixiang/retrofit/data/vip_card.dart'; +import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/view_widget/classic_header.dart'; +import 'package:huixiang/view_widget/custom_image.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; +import 'package:huixiang/view_widget/my_footer.dart'; +import 'package:huixiang/view_widget/no_data_view.dart'; +import 'package:huixiang/view_widget/round_button.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:pull_to_refresh/pull_to_refresh.dart'; +import 'package:shared_preferences/shared_preferences.dart'; + +class MineShopPage extends StatefulWidget { + @override + State createState() { + return _MineShopPage(); + } +} + +class _MineShopPage extends State { + List coupons = []; + ApiService apiService; + int current = 1; + RefreshController refreshController ; + + @override + void initState() { + super.initState(); + refreshController = RefreshController(); + + SharedPreferences.getInstance().then((value) { + apiService = + ApiService(Dio(), context: context, token: value.getString("token")); + queryVipCard(); + }); + + } + + _onRefresh() { + current = 1; + queryVipCard(); + } + + queryVipCard() async { + BaseData> baseData = + await apiService.vipList({}).catchError((error) { + refreshController.refreshFailed(); + }); + if (baseData != null && baseData.isSuccess) { + coupons.clear(); + coupons.addAll(baseData.data); + setState(() { + refreshController.refreshCompleted(); + }); + } else { + refreshController.refreshFailed(); + } + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: MyAppBar( + title: S.of(context).dianpuyue, + titleColor: Colors.black, + background: Colors.white, + leadingColor: Colors.black, + ), + body: SmartRefresher( + enablePullDown: true, + enablePullUp: false, + header: MyHeader(), + footer: CustomFooter( + builder: (context, mode) { + return MyFooter(mode); + }, + ), + controller: refreshController, + onRefresh: queryVipCard, + physics: BouncingScrollPhysics(), + child: (coupons != null && coupons.length > 0) + ? ListView.builder( + padding: EdgeInsets.symmetric(vertical: 8.h), + itemBuilder: (context, position) { + return GestureDetector( + onTap: () { + Navigator.of(context).pushNamed( + '/router/mine_shop_details', + arguments: {"id": coupons[position].id}); + }, + child: shopItem(coupons[position]), + ); + }, + itemCount: coupons != null ? coupons.length : 0, + ) + : NoDataView( + src: "assets/image/icon_empty.webp", + isShowBtn: false, + text: "还没有会员卡~", + fontSize: 16.sp, + margin: EdgeInsets.only(top: 120.h), + ), + ), + ); + } + + int colorByName(String storeName) { + if (storeName == null) return 0xFF32A060; + if (storeName.contains("百年川椒") || storeName.contains("百年川椒")) { + return 0xFFC30D23; + } else if (storeName.contains("海峡姐妹") || storeName.contains("海峽姐妹")) { + return 0xFFE4C796; + } else if (storeName.contains("前进麦味") || storeName.contains("前進麥味")) { + return 0xFF265782; + } + return 0xFF32A060; + } + + Widget shopItem(VipCard vipCard) { + return Container( + width:double.infinity, + // height:140.h, + margin: EdgeInsets.only(bottom: 12.h,top: 14.h,left: 14.w,right: 14.w), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + decoration: BoxDecoration( + borderRadius: new BorderRadius.only( + topLeft: Radius.circular(6), + topRight: Radius.circular(6), + ), + color: Color(colorByName(vipCard.tenantName)), + ), + padding: EdgeInsets.only(left: 12.w), + height: 62.h, + child: Row( + children: [ + MImage( + (vipCard?.storeList?.length ?? 0) > 0 + ? vipCard.storeList[0].logo + : "", + width: 38, + height: 38, + fit: BoxFit.cover, + radius: BorderRadius.circular(100), + errorSrc: "assets/image/default_1.webp", + fadeSrc: "assets/image/default_1.webp", + ), + SizedBox(width: 6,), + Text( + vipCard.tenantName ?? "", + style: TextStyle( + color: Color(0xFFFFFFFF), + fontSize: 15.sp, + fontWeight: MyFontWeight.medium, + ), + ), + ], + ), + ), + Container( + decoration: BoxDecoration( + borderRadius: new BorderRadius.only( + bottomRight: Radius.circular(6), + topRight: Radius.circular(6), + ), + color: Colors.white, + ), + padding: EdgeInsets.all(12.h), + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "店铺余额(元)", + style: TextStyle( + color: Color(0xFF262626), + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + ), + ), + Text( + "No.${vipCard.id}", + style: TextStyle( + color: Color(0xFF262626), + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + ), + ), + ], + ), + SizedBox(height:4.h,), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded(child: Text( + "¥${vipCard != null ? vipCard.balance : ""}", + style: TextStyle( + color: Color(0xFF262626), + fontSize:24.sp, + fontWeight: MyFontWeight.bold, + ), + )), + Text( + S.of(context).chakanxiangqing, + style: TextStyle( + color: Color(0xFF353535), + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + ), + ), + SizedBox(width: 2,), + Icon( + Icons.chevron_right, + size: 24, + color: Colors.black, + ), + ], + ), + ], + ), + ), + ], + ), + ); + } + +} diff --git a/lib/mine/mine_view/mine_calendar.dart b/lib/mine/mine_view/mine_calendar.dart new file mode 100644 index 00000000..cb82f96a --- /dev/null +++ b/lib/mine/mine_view/mine_calendar.dart @@ -0,0 +1,68 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/view_widget/login_tips_dialog.dart'; +import 'package:shared_preferences/shared_preferences.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:url_launcher/url_launcher.dart'; + +class MineCalendar extends StatefulWidget { + @override + State createState() { + return _MineCalendar(); + } +} + +class _MineCalendar extends State { + @override + Widget build(BuildContext context) { + return Container( + margin: EdgeInsets.fromLTRB(16.w, 10.h, 16.w, 28.h), + padding: EdgeInsets.only(top: 12.h,left: 12,right: 12), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ) + ], + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Expanded(child: Text( + "我的3月足迹日历", + style: TextStyle( + color: Color(0xFF0D0D0D), + fontWeight: MyFontWeight.semi_bold, + fontSize: 15.sp, + ), + ),), + Text( + "查看绿叶", + style: TextStyle( + color: Color(0xFF000000), + fontWeight: MyFontWeight.regular, + fontSize: 15.sp, + ), + ), + Icon( + Icons.navigate_next, + size: 24, + color: Colors.black, + ), + ], + ), + SizedBox(height: 12,) + ], + ), + ); + } +} diff --git a/lib/mine/mine_view/mine_item.dart b/lib/mine/mine_view/mine_item.dart index 22c898fa..647ddc91 100644 --- a/lib/mine/mine_view/mine_item.dart +++ b/lib/mine/mine_view/mine_item.dart @@ -38,7 +38,7 @@ class _MineItem extends State { Container( padding: EdgeInsets.only(left: 16,top:16,bottom:4), child: Text( - S.of(context).wodegongju, + "其他", style: TextStyle( color: Color(0xFF353535), fontWeight: MyFontWeight.semi_bold, @@ -48,7 +48,7 @@ class _MineItem extends State { ), Row( children: [ - ///我的动态 + // ///我的动态 // Expanded(child: // InkWell( // onTap: () { @@ -69,9 +69,71 @@ class _MineItem extends State { // ), // ), // ), - - ///兑换历史 - Expanded(child: InkWell( + // ///兑换历史 + // Expanded(child: InkWell( + // onTap: () { + // SharedPreferences.getInstance().then((value) { + // if (value.getString("token") == null || + // value.getString("token") == "") { + // LoginTipsDialog().show(context); + // return; + // } + // Navigator.of(context) + // .pushNamed('/router/exchange_history_page'); + // }); + // }, + // child: mineItem( + // S.of(context).duihuanlishi, + // "assets/image/icon_mine_records_of_consumption.webp", + // ), + // ),), + // ///我的卡券 + // Expanded(child: InkWell( + // onTap: () { + // SharedPreferences.getInstance().then((value) { + // if (value.getString("token") == null || + // value.getString("token") == "") { + // LoginTipsDialog().show(context); + // return; + // } + // Navigator.of(context).pushNamed('/router/mine_card'); + // }); + // }, + // child: mineItem( + // S.of(context).wodekaquan, + // "assets/image/icon_mine_card.webp", + // ), + // ),), + // ///管理地址 + // Expanded(child: InkWell( + // onTap: () { + // SharedPreferences.getInstance().then((value) { + // if (value.getString("token") == null || + // value.getString("token") == "") { + // LoginTipsDialog().show(context); + // return; + // } + // Navigator.of(context).pushNamed('/router/manage_address_page'); + // }); + // }, + // child: mineItem( + // S.of(context).guanlidizhi, + // "assets/image/icon_location_address.webp", + // ), + // ),), + // ///联系客服 + // Expanded(child: InkWell( + // onTap: () { + // showCallMobile(); + // }, + // child: mineItem( + // "联系客服", + // "assets/image/icon_mine_online_service.webp", + // ), + // ),), + ///优惠券 + Expanded(child: + InkWell( onTap: () { SharedPreferences.getInstance().then((value) { if (value.getString("token") == null || @@ -79,16 +141,16 @@ class _MineItem extends State { LoginTipsDialog().show(context); return; } - Navigator.of(context) - .pushNamed('/router/exchange_history_page'); + Navigator.of(context).pushNamed('/router/mine_card'); }); }, child: mineItem( - S.of(context).duihuanlishi, - "assets/image/icon_mine_records_of_consumption.webp", + S.of(context).youhuiquan, + "assets/image/coupon.webp", ), - ),), - ///我的卡券 + ), + ), + ///平台余额 Expanded(child: InkWell( onTap: () { SharedPreferences.getInstance().then((value) { @@ -97,15 +159,15 @@ class _MineItem extends State { LoginTipsDialog().show(context); return; } - Navigator.of(context).pushNamed('/router/mine_card'); + Navigator.of(context).pushNamed('/router/mine_wallet'); }); }, child: mineItem( - S.of(context).wodekaquan, - "assets/image/icon_mine_card.webp", + S.of(context).pingtaiyue, + "assets/image/platform_yue.webp", ), ),), - ///管理地址 + ///店铺余额 Expanded(child: InkWell( onTap: () { SharedPreferences.getInstance().then((value) { @@ -114,22 +176,29 @@ class _MineItem extends State { LoginTipsDialog().show(context); return; } - Navigator.of(context).pushNamed('/router/manage_address_page'); + Navigator.of(context).pushNamed('/router/mine_shop_page'); }); }, child: mineItem( - S.of(context).guanlidizhi, - "assets/image/icon_location_address.webp", + S.of(context).dianpuyue, + "assets/image/shop_yue.webp", ), ),), - ///联系客服 + ///我的评价 Expanded(child: InkWell( onTap: () { - showCallMobile(); + SharedPreferences.getInstance().then((value) { + if (value.getString("token") == null || + value.getString("token") == "") { + LoginTipsDialog().show(context); + return; + } + Navigator.of(context).pushNamed('/router/mine_shop_page'); + }); }, child: mineItem( - "联系客服", - "assets/image/icon_mine_online_service.webp", + "我的评价", + "assets/image/fan_kui.webp", ), ),), ], @@ -137,6 +206,7 @@ class _MineItem extends State { SizedBox(height: 10.h,), Row( children: [ + ///我的砍价 Expanded(child: InkWell( onTap: () { @@ -146,9 +216,10 @@ class _MineItem extends State { }, child: mineItem( S.of(context).wodekanjia, - "assets/image/icon_mine_records_of_consumption.webp", + "assets/image/bargain.webp", ), ),), + ///我的拼团 Expanded(child: InkWell( onTap: () { Navigator.of(context).pushNamed('/router/bargain_group_order', @@ -156,30 +227,68 @@ class _MineItem extends State { }, child: mineItem( S.of(context).wodepintuan, - "assets/image/kan_jia.webp", + "assets/image/collage.webp", ), ),), + ///商户入驻 Expanded(child: InkWell( onTap: () { - Navigator.of(context).pushNamed('/router/qr_share', arguments: {}); + }, child: mineItem( - S.of(context).tuiguangma, - "assets/image/pin_tuan.webp", + "商户入驻", + "assets/image/settled.webp", ), ),), - Expanded(child:InkWell( + ///发票管理 + Expanded(child: InkWell( onTap: () { - Navigator.of(context).pushNamed('/router/invitation_record', arguments: {}); + Navigator.of(context).pushNamed('/router/bargain_group_order', + arguments: {"type":1}); }, child: mineItem( - "邀请记录", - "assets/image/yao_q.webp", + "发票管理", + "assets/image/bill_gl.webp", ), ),), + // Expanded(child: InkWell( + // onTap: () { + // Navigator.of(context).pushNamed('/router/qr_share', arguments: {}); + // }, + // child: mineItem( + // S.of(context).tuiguangma, + // "assets/image/pin_tuan.webp", + // ), + // ),), + // Expanded(child:InkWell( + // onTap: () { + // Navigator.of(context).pushNamed('/router/invitation_record', arguments: {}); + // }, + // child: mineItem( + // "邀请记录", + // "assets/image/yao_q.webp", + // ), + // ),), ], ), SizedBox(height: 10.h,), + Row( + children: [ + ///帮助反馈 + Expanded(child: InkWell( + onTap: () { + Navigator.of(context).pushNamed('/router/help_feedback_page'); + }, + child: mineItem( + S.of(context).bangzhuyufankui, + "assets/image/fan_kui.webp", + ), + ),), + Expanded(child:Container(),), + Expanded(child:Container(),), + Expanded(child:Container(),), + ], + ), ], ), ); diff --git a/lib/mine/mine_view/mine_order.dart b/lib/mine/mine_view/mine_order.dart index bc826e3e..bc30a2ac 100644 --- a/lib/mine/mine_view/mine_order.dart +++ b/lib/mine/mine_view/mine_order.dart @@ -16,7 +16,7 @@ class _MineOrderView extends State { @override Widget build(BuildContext context) { return Container( - margin: EdgeInsets.fromLTRB(16.w, 10.h, 16.w, 6.h), + margin: EdgeInsets.only(left:16.w, bottom:20.h, right:16.w, top:10.h), padding: EdgeInsets.fromLTRB(20.w, 12.h, 20.w, 12.h), decoration: BoxDecoration( color: Colors.white, diff --git a/lib/mine/mine_view/mine_view.dart b/lib/mine/mine_view/mine_view.dart index 6a913b82..01835105 100644 --- a/lib/mine/mine_view/mine_view.dart +++ b/lib/mine/mine_view/mine_view.dart @@ -3,9 +3,12 @@ import 'dart:convert'; import 'package:dio/dio.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; +import 'package:flutter_svg/svg.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; +import 'package:huixiang/retrofit/data/msg_stats.dart'; import 'package:huixiang/retrofit/data/user_info.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/utils/font_weight.dart'; @@ -14,6 +17,7 @@ import 'package:huixiang/view_widget/custom_image.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:huixiang/view_widget/login_tips_dialog.dart'; import 'package:huixiang/view_widget/request_permission.dart'; +import 'package:huixiang/view_widget/round_button.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:shared_preferences/shared_preferences.dart'; // import 'package:qrscan/qrscan.dart' as scanner; @@ -22,8 +26,10 @@ class MineView extends StatefulWidget { final UserInfo userInfo; final GestureTapCallback toUserInfo; final GestureTapCallback toIntegralPage; + final Function messageZero; + final int totalMsg; - MineView(this.userInfo, this.toUserInfo, this.toIntegralPage); + MineView(this.userInfo, this.toUserInfo, this.toIntegralPage,this.messageZero,this.totalMsg); @override State createState() { @@ -52,6 +58,8 @@ class _MineView extends State { } } + + @override Widget build(BuildContext context) { return Column( @@ -62,6 +70,56 @@ class _MineView extends State { child: Row( mainAxisAlignment: MainAxisAlignment.end, children: [ + Container( + height: 24, + alignment: Alignment.center, + child: GestureDetector( + onTap: () { + Navigator.of(context).pushNamed('/router/system_msg_page').then((value) { + widget.messageZero(); + }); + }, + child: Container( + height: 24, + alignment:Alignment.center, + child:Stack( + children: [ + Image.asset( + "assets/image/icon_notices.webp", + width:32.w, + height: 32.h, + ), + if(widget.totalMsg != 0) + Container( + width:36, + alignment: Alignment.topRight, + child:Container( + width:22, + height:14, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(100), + border: Border.all( + width: 1, + color: Colors.white, + style: BorderStyle.solid, + ), + color:Color(0xFFFF441A), + ), + child:RoundButton( + text:widget.totalMsg.toString(), + textColor: Colors.white, + fontWeight: MyFontWeight.regular, + backgroup: Color(0xFFFF441A), + fontSize:8.sp, + radius: 100, + ) + ), + ) + ], + ), + ) + ) + ), InkWell( onTap: () { toScan(); @@ -262,16 +320,32 @@ class _MineView extends State { color: Color(0xFF2F2F2F), ), ) - : Text( - widget.userInfo == null - ? "" - : "我的积分:${widget.userInfo.points}", - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - color: Color(0xFF2F2F2F), - ), + : Row( + children: [ + Text( + "${S.of(context).guanzhu} 0", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF4D4D4D), + ), + ), + Container( + width: 1.w, + height: 12.h, + margin: EdgeInsets.symmetric(horizontal: 3.w), + color: Color(0xFF4D4D4D), + ), + Text( + "${S.of(context).fensi} 0", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF4D4D4D), ), + ), + ], + ), ], ), ), @@ -296,21 +370,28 @@ class _MineView extends State { child: Container( padding: EdgeInsets.only(top: 4, bottom: 4, right: 16,left: 7), decoration: BoxDecoration( - color: Color(0xFF87E8B0), borderRadius: BorderRadius.only(topLeft: Radius.circular(100),bottomLeft:Radius.circular(100)), + gradient: LinearGradient( + begin: Alignment.topLeft, + end: Alignment.bottomRight, + colors: [ + Color(0xFFACDD60), + Color(0xFF32A060), + ], + ), ), child: Row( mainAxisAlignment: MainAxisAlignment.end, children: [ Image.asset( - "assets/image/ji_fen.webp", + "assets/image/icon_gold_coin.webp", width: 16.w, height: 16.h, ), Text( - S.of(context).qiandaodejifen, + "天天领积分", style: TextStyle( - color: Colors.black, + color: Colors.white, fontSize: 12.sp, fontWeight: MyFontWeight.regular, ), diff --git a/lib/mine/mine_wallet_page.dart b/lib/mine/mine_wallet_page.dart index 9b5ffa5f..174fbb59 100644 --- a/lib/mine/mine_wallet_page.dart +++ b/lib/mine/mine_wallet_page.dart @@ -104,7 +104,7 @@ class _MineWalletPage extends State { Widget build(BuildContext context) { return Scaffold( appBar: MyAppBar( - title: S.of(context).wodeqianbao, + title: S.of(context).pingtaiyue, titleColor: Colors.black, background: Color(0xFFF7F7F7), leadingColor: Colors.black, @@ -158,7 +158,7 @@ class _MineWalletPage extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - S.of(context).lishijilu, + "消费记录", style: TextStyle( fontWeight: FontWeight.bold, color: Colors.black, @@ -290,36 +290,36 @@ class _MineWalletPage extends State { Align( alignment: Alignment.center, child: Text( - S.of(context).zhanghuyue, + "总资产", style: TextStyle( fontWeight: MyFontWeight.semi_bold, color: Color(0xFF353535), - fontSize: 20.sp, + fontSize: 16.sp, ), ), ), - GestureDetector( - onTap: () { - queryUserBalance(); - }, - child: Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Icon( - Icons.refresh, - size: 20, - color: Color(0xFF8A8A8A), - ), - Text( - S.of(context).shuaxin, - style: TextStyle( - color: Color(0xFF353535), - fontSize: 12.sp, - ), - ), - ], - ), - ), + // GestureDetector( + // onTap: () { + // queryUserBalance(); + // }, + // child: Row( + // mainAxisAlignment: MainAxisAlignment.end, + // children: [ + // Icon( + // Icons.refresh, + // size: 20, + // color: Color(0xFF8A8A8A), + // ), + // Text( + // S.of(context).shuaxin, + // style: TextStyle( + // color: Color(0xFF353535), + // fontSize: 12.sp, + // ), + // ), + // ], + // ), + // ), ], ), SizedBox( diff --git a/lib/mine/personal_page.dart b/lib/mine/personal_page.dart index 78348136..574daf5c 100644 --- a/lib/mine/personal_page.dart +++ b/lib/mine/personal_page.dart @@ -154,7 +154,7 @@ class _PersonalPage extends State with WidgetsBindingObserver { SharedPreferences shared = await SharedPreferences.getInstance(); if (shared.getString("token") == null || shared.getString("token") == "") { Navigator.of(context) - .pushNamed('/router/login_page', arguments: {"login": "login"}); + .pushNamed('/router/new_login_page', arguments: {"login": "login"}); return; } await Navigator.of(context).pushNamed('/router/user_info_page').then((value) { diff --git a/lib/mine/user_info_page.dart b/lib/mine/user_info_page.dart index 47da532b..da182e8b 100644 --- a/lib/mine/user_info_page.dart +++ b/lib/mine/user_info_page.dart @@ -68,29 +68,18 @@ class _UserInfoPage extends State { @override Widget build(BuildContext context) { return Scaffold( + backgroundColor: Color(0xFFFFFFFF), appBar: MyAppBar( - title: S.of(context).zhanghaoxinxi, + title: S.of(context).gerenxinxi, titleColor: Colors.black, - background: Color(0xFFF7F7F7), + background: Color(0xFFFFFFFF), leadingColor: Colors.black, ), body: Container( child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.max, children: [ - Container( - margin: EdgeInsets.only(left: 16.w), - child: Text( - S.of(context).gerenxinxi, - style: TextStyle( - fontWeight: FontWeight.bold, - color: Color(0xFF353535), - fontSize: 16.sp, - ), - ), - ), userInfo(), ], ), @@ -98,69 +87,9 @@ class _UserInfoPage extends State { ); } - Widget settingItem(left, right) { - return Container( - margin: EdgeInsets.fromLTRB(16, 8, 16, 8), - padding: EdgeInsets.fromLTRB(20, 16, 20, 16), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all(Radius.circular(8)), - boxShadow: [ - BoxShadow( - color: Colors.black.withAlpha(12), - offset: Offset(0, 3), - blurRadius: 14, - spreadRadius: 0, - ) - ],), - child: Row( - children: [ - Expanded( - child: Text( - left, - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 14.sp, - color: Color(0xFF353535), - ), - ), - flex: 1, - ), - Text( - right, - style: TextStyle( - fontSize: 12.sp, - color: Color(0xFF727272), - ), - ), - SizedBox( - width: 16.w, - ), - Icon( - Icons.keyboard_arrow_right, - size: 20, - ), - ], - ), - ); - } - Widget userInfo() { return Container( - margin: EdgeInsets.fromLTRB(16, 32, 16, 16), - padding: EdgeInsets.fromLTRB(20, 6, 20, 18), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all(Radius.circular(8)), - boxShadow: [ - BoxShadow( - color: Colors.black.withAlpha(12), - offset: Offset(0, 3), - blurRadius: 14, - spreadRadius: 0, - ), - ], - ), + margin: EdgeInsets.only(left:14.w,right: 14.w), child: Column( children: [ InkWell( @@ -168,6 +97,11 @@ class _UserInfoPage extends State { showImagePicker(); }, child: avatarItem(0, ""), + ),Container( + margin: EdgeInsets.symmetric(vertical: 12.h), + width: double.infinity, + height: 1, + color: Color(0xFFF2F2F2), ), InkWell( onTap: () { @@ -176,6 +110,12 @@ class _UserInfoPage extends State { child: avatarItem(1, (modifyInfo["nickname"]) == "" ? "回乡" : modifyInfo["nickname"]), ), + Container( + margin: EdgeInsets.symmetric(vertical: 12.h), + width: double.infinity, + height: 1, + color: Color(0xFFF2F2F2), + ), InkWell( onTap: () { editSignature(); @@ -183,6 +123,12 @@ class _UserInfoPage extends State { child:avatarItem(2, (modifyInfo["signature"]) == "" ? "还未编辑个性签名~" : modifyInfo["signature"]), ), + Container( + margin: EdgeInsets.symmetric(vertical: 12.h), + width: double.infinity, + height: 1, + color: Color(0xFFF2F2F2), + ), InkWell( onTap:(modifyInfo["birth"] == "")?showDateSelector:(){}, child: avatarItem( @@ -191,7 +137,19 @@ class _UserInfoPage extends State { ? modifyInfo["birth"] : S.of(context).wanshanshengrixinxi_yhq), ), + Container( + margin: EdgeInsets.symmetric(vertical: 12.h), + width: double.infinity, + height: 1, + color: Color(0xFFF2F2F2), + ), avatarItem(4, mobile), + Container( + margin: EdgeInsets.symmetric(vertical: 12.h), + width: double.infinity, + height: 1, + color: Color(0xFFF2F2F2), + ), avatarItem( 5, (age == null || age == "") @@ -394,7 +352,6 @@ class _UserInfoPage extends State { Widget avatarItem(type, value) { print("object: $value"); return Container( - margin: EdgeInsets.only(top: 14.h, bottom: 14.h), child: Row( children: [ Expanded( @@ -402,8 +359,8 @@ class _UserInfoPage extends State { itemLefts[type], style: TextStyle( fontWeight: FontWeight.bold, - fontSize: 14.sp, - color: Color(0xFF353535), + fontSize: 15.sp, + color: Color(0xFF1A1A1A), ), ), flex: 1, @@ -456,9 +413,9 @@ class _UserInfoPage extends State { maxLines: 1, overflow:TextOverflow.ellipsis, style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 14.sp, - color: Colors.black, + fontWeight: MyFontWeight.regular, + fontSize: 13.sp, + color: Color(0xFF4D4D4D), ), ); } else { @@ -468,9 +425,9 @@ class _UserInfoPage extends State { overflow:TextOverflow.ellipsis, textAlign: TextAlign.right, style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 14.sp, - color: Color(0xFF727272), + fontWeight: MyFontWeight.regular, + fontSize: 13.sp, + color: Color(0xFF4D4D4D), ), )); } diff --git a/lib/order/order_detail_page.dart b/lib/order/order_detail_page.dart index 6d703001..277b69c4 100644 --- a/lib/order/order_detail_page.dart +++ b/lib/order/order_detail_page.dart @@ -11,6 +11,7 @@ import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/order_info.dart'; import 'package:huixiang/retrofit/min_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/view_widget/icon_text.dart'; import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:shared_preferences/shared_preferences.dart'; @@ -46,6 +47,7 @@ class _OrderDetailPage extends State { ); queryDetails(); }); + } /// 小程序登录 @@ -504,6 +506,157 @@ class _OrderDetailPage extends State { } } + + ///评价弹窗 + assessShowBottomSheet() { + showModalBottomSheet( + builder: (BuildContext context) { + return buildBottomSheetWidget(context); + }, + backgroundColor: Colors.transparent, + context: context); + } + + Widget buildBottomSheetWidget(BuildContext context) { + return Container( + padding: EdgeInsets.only(top: 12), + decoration: new BoxDecoration( + color: Colors.white, + borderRadius: new BorderRadius.only( + topLeft: const Radius.circular(25.0), + topRight: const Radius.circular(25.0))), + child: Container( + width: 299, + height:299, + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded(child: + Align(alignment: Alignment.center, + child: Text( + "订单评价", + style: TextStyle( + fontWeight: MyFontWeight.bold, + fontSize: 15.sp, + color: Color(0xFF000000), + ), + ),)), + GestureDetector( + onTap: (){ + setState(() { + Navigator.of(context).pop(); + }); + }, + child: Icon( + Icons.clear, + color: Colors.black, + size: 18, + ), + ), + SizedBox(width: 14), + ], + ), + SizedBox(height: 12.h,), + Container( + width: double.infinity, + height: 1.h, + color: Color(0xFFF2F2F2), + margin: EdgeInsets.only(bottom: 43.h), + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + width: 92, + height: 92, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(16), + border: Border.all( + color: Color(0xFFF2F2F2), + width: 1, + ), + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + "assets/image/report_un.webp", + width:45, + height:45, + ), + SizedBox(height: 4,), + Text( + "不满意", + style: TextStyle( + fontWeight: MyFontWeight.regular, + fontSize: 12.sp, + color: Color(0xFF262626), + ), + ), + ], + ), + ), + Container( + width: 92, + height: 92, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(16), + border: Border.all( + color: Color(0xFFFFD549), + width: 1, + ), + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + "assets/image/report_h.webp", + width:45, + height:45, + ), + SizedBox(height: 4,), + Text( + "很满意", + style: TextStyle( + fontWeight: MyFontWeight.regular, + fontSize: 12.sp, + color: Color(0xFF262626), + ), + ), + ], + ), + ) + ], + ), + Container( + width:double.infinity, + height: 36.h, + alignment: Alignment.center, + margin: EdgeInsets.only(left: 14.w,right: 14.w,top: 50.h), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(6), + color: Color(0xFF32A060), + ), + child: Text( + S.of(context).queding, + style: TextStyle( + fontWeight: MyFontWeight.medium, + fontSize: 15.sp, + color: Color(0xFFFFFFFF), + ), + ), + ), + ], + ), + )); + } + Widget orderInfoItem(leftText, rightText) { return Container( margin: EdgeInsets.only(top: 8.h, bottom: 8.h), diff --git a/lib/qr/invite_friends.dart b/lib/qr/invite_friends.dart new file mode 100644 index 00000000..ad14e915 --- /dev/null +++ b/lib/qr/invite_friends.dart @@ -0,0 +1,653 @@ +import 'dart:convert'; + +import 'package:dio/dio.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/retrofit/data/article.dart'; +import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/utils/flutter_utils.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/view_widget/classic_header.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:huixiang/view_widget/my_footer.dart'; +import 'package:pull_to_refresh/pull_to_refresh.dart'; + +class InviteFriends extends StatefulWidget { + @override + State createState() { + return _InviteFriends(); + } +} + +class _InviteFriends extends State { + ApiService apiService; + final RefreshController refreshController = RefreshController(); + final ScrollController scrollController = ScrollController(); + Article article; + + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + return Stack( + children: [ + Scaffold( + backgroundColor: Color(0xFFF9FAF7), + appBar: AppBar( + backgroundColor: Colors.white, + leading: GestureDetector( + child: Icon( + Icons.clear, + color: Colors.black, + ), + onTap: () { + Navigator.of(context).pop(); + }), + title: Text( + "邀请好友", + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, + fontSize: 17.sp, + color: Color(0xFF000000), + ), + ), + centerTitle: true, + elevation: 0.0, + actions: [ + GestureDetector( + child: Container( + margin: EdgeInsets.only(right: 14), + padding:EdgeInsets.only(left:70,right: 20), + child: Icon( + Icons.more_horiz, + color: Colors.black, + ), + ), + onTap: () { + // Navigator.of(context).pop(); + // share(); + }) + ], + ), + body: SmartRefresher( + controller: refreshController, + enablePullDown: true, + enablePullUp: false, + header: MyHeader(), + footer: CustomFooter( + builder: (context, mode) { + return MyFooter(mode); + }, + ), + onRefresh: () { + setState(() {}); + }, + physics: BouncingScrollPhysics(), + scrollController: scrollController, + child: Container( + child: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: FutureBuilder( + // future: querySignInfo(), + builder: (context, snap) { + return Column( + children: [ + invite(), + + activityRule(), + + achievement(), + + mineInvite(), + ], + ); + }, + ), + ), + ), + ), + ), + ], + ); + } + + ///邀请图 + Widget invite(){ + return Container( + width:double.infinity, + height: 370.h, + margin: EdgeInsets.only(bottom:20.h), + child:Column( + children: [ + Image.asset( + "assets/image/icon_story_td.webp", + height: 300.h, + width:double.infinity, + fit: BoxFit.cover, + ), + SizedBox(height: 12.h,), + Container( + width: double.infinity, + height: 52.h, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(26), + color: Color(0xFF00E16F), + ), + margin: EdgeInsets.symmetric(horizontal:14.w), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + "assets/image/wx.webp", + height: 20, + width:20, + fit: BoxFit.fill, + ), + SizedBox(width:4.w,), + Text( + "邀请微信好友", + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, + fontSize: 16.sp, + color: Color(0xFFFFFFFF), + ), + ) + ], + ), + ) + ], + ), + ); + } + + ///活动规则 + Widget activityRule(){ + return Container( + width:double.infinity, + height: 173.h,decoration: BoxDecoration( + borderRadius: BorderRadius.circular(6), + color: Color(0xFFFFFFFF), + ), + margin: EdgeInsets.only(bottom:12.h,left:14.h,right: 14.h), + padding: EdgeInsets.only(top: 6.h,left: 6,right: 6), + child:Column( + children: [ + Container( + decoration: BoxDecoration( + image: DecorationImage( + fit: BoxFit.cover, + image: AssetImage("assets/image/invite_bj.webp"), + ), + ), + height: 54.h, + width:double.infinity, + alignment: Alignment.center, + child: Text( + "活动规则", + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, + fontSize: 16.sp, + color: Color(0xFF32A060), + ), + ) + ), + SizedBox(height: 17.h,), + Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + "assets/image/zu_tuan.webp", + width: 42, + height: 42, + fit: BoxFit.cover, + ), + Container( + width: 51, + child: Flex( + children: List.generate(8, (_) { + return SizedBox( + width: 3, + height: 1, + child: DecoratedBox( + decoration: + BoxDecoration(color: Color(0xFF32A060)), + ), + ); + }), + mainAxisAlignment: MainAxisAlignment.spaceBetween, + direction: Axis.horizontal, + ), + ), + ], + ), + SizedBox(height: 8.h), + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + width:46.w, + child: + Text( + "1.分享给微信好友", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF181818), + ), + ), + ), + Container( + width: 43, + child: Flex( + children: List.generate(0, (_) { + return SizedBox( + width: 3, + height: 1, + child: DecoratedBox( + decoration: BoxDecoration(color: Colors.white), + ), + ); + }), + mainAxisAlignment: MainAxisAlignment.spaceBetween, + direction: Axis.horizontal, + ), + ), + ], + ), + ], + ), + Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + "assets/image/zt_zf.webp", + width: 42, + height: 42, + fit: BoxFit.cover, + ), + Container( + width: 51, + child: Flex( + children: List.generate(8, (_) { + return SizedBox( + width: 3, + height: 1, + child: DecoratedBox( + decoration: + BoxDecoration(color: Color(0xFF32A060)), + ), + ); + }), + mainAxisAlignment: MainAxisAlignment.spaceBetween, + direction: Axis.horizontal, + ), + ), + ], + ), + SizedBox(height: 8.h), + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + width:46.w, + child: + Text( + "2.好友注册", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF181818), + ), + ), + ), + Container( + width: 43, + child: Flex( + children: List.generate(0, (_) { + return SizedBox( + width: 3, + height: 1, + child: DecoratedBox( + decoration: BoxDecoration(color: Colors.white), + ), + ); + }), + mainAxisAlignment: MainAxisAlignment.spaceBetween, + direction: Axis.horizontal, + ), + ), + ], + ), + ], + ), + Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + "assets/image/yq_zt.webp", + width: 42, + height: 42, + fit: BoxFit.cover, + ), + Container( + width: 51, + child: Flex( + children: List.generate(8, (_) { + return SizedBox( + width: 3, + height: 1, + child: DecoratedBox( + decoration: + BoxDecoration(color: Color(0xFF32A060)), + ), + ); + }), + mainAxisAlignment: MainAxisAlignment.spaceBetween, + direction: Axis.horizontal, + ), + ), + ], + ), + SizedBox(height: 8.h), + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + + Container( + width: 46.w, + child: + Text( + "3.邀请完成", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF181818), + ), + ), + ), + Container( + width: 43, + child: Flex( + children: List.generate(0, (_) { + return SizedBox( + width: 3, + height: 1, + child: DecoratedBox( + decoration: BoxDecoration(color: Colors.white), + ), + ); + }), + mainAxisAlignment: MainAxisAlignment.spaceBetween, + direction: Axis.horizontal, + ), + ), + ], + ), + ], + ), + Column( + children: [ + Image.asset( + "assets/image/zt_m.webp", + width: 42, + height: 42, + fit: BoxFit.cover, + ), + SizedBox(height: 8.h), + Container( + width: 46.w, + child: + Text( + "4.获得优惠券", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF181818), + ), + ), + ) + ], + ), + ], + ), + ], + ), + ); + } + + ///我的成就 + Widget achievement(){ + return Container( + width:double.infinity, + height: 150.h, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(6), + color: Color(0xFFFFFFFF), + ), + margin: EdgeInsets.only(bottom:12.h,left:14.h,right: 14.h), + padding: EdgeInsets.only(top: 6.h,left: 6,right: 6,bottom: 16.h), + child:Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + decoration: BoxDecoration( + image: DecorationImage( + fit: BoxFit.cover, + image: AssetImage("assets/image/invite_bj.webp"), + ), + ), + height: 54.h, + width:double.infinity, + alignment: Alignment.center, + child: Text( + "我的成就", + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, + fontSize: 16.sp, + color: Color(0xFF32A060), + ), + ) + ), + Row( + children: [ + Expanded(child:Column( + children: [ + Text( + "12", + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, + fontSize: 25.sp, + color: Color(0xFF000000), + ), + ), + SizedBox(height: 5.h,), + Text( + "今日邀请", + style: TextStyle( + fontWeight: MyFontWeight.regular, + fontSize: 12.sp, + color: Color(0xFF808080), + ), + ) + ], + )), + Expanded(child:Column( + children: [ + Text( + "100", + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, + fontSize: 25.sp, + color: Color(0xFF000000), + ), + ), + SizedBox(height: 5.h,), + Text( + "累积邀请", + style: TextStyle( + fontWeight: MyFontWeight.regular, + fontSize: 12.sp, + color: Color(0xFF808080), + ), + ) + ], + )) + ], + ), + ], + ), + ); + } + + ///我的邀请 + Widget mineInvite(){ + return Container( + width:double.infinity, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(6), + color: Color(0xFFFFFFFF), + ), + margin: EdgeInsets.only(bottom:12.h,left:14.h,right: 14.h), + padding: EdgeInsets.only(top: 6.h,left: 6,right: 6), + child:Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + decoration: BoxDecoration( + image: DecorationImage( + fit: BoxFit.cover, + image: AssetImage("assets/image/invite_bj.webp"), + ), + ), + height: 54.h, + width:double.infinity, + alignment: Alignment.center, + child: Text( + "我的邀请", + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, + fontSize: 16.sp, + color: Color(0xFF32A060), + ), + ) + ), + SizedBox(height:12.h,), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + S.of(context).shoujihao, + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, + fontSize:14.sp, + color: Color(0xFF000000), + ), + ), + Text( + S.of(context).jiangli, + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, + fontSize:14.sp, + color: Color(0xFF000000), + ), + ), + ],), + SizedBox(height:12.h,), + ListView.builder( + padding: EdgeInsets.zero, + itemCount:6, + scrollDirection: Axis.vertical, + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + itemBuilder: (context, position) { + return GestureDetector( + onTap: () { + }, + child: mineInviteItem(), + ); + }, + ), + ], + ), + ); + } + + Widget mineInviteItem(){ + return Container( + child:Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + AppUtils.phoneEncode("15392949097"), + style: TextStyle( + color: Color(0xFF000000), + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + ), + ), + SizedBox(height:8), + Text( + "注册时间:2021.09.08 12:12:12", + style: TextStyle( + color: Color(0xFF000000), + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + ), + ), + ], + ), + Text( + "新人全场减30优惠券*1", + style: TextStyle( + color: Color(0xFF353535), + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + ), + ), + ], + ), + Container( + width: double.infinity, + height: 1.h, + color: Color(0xFFF7F7F7), + margin: EdgeInsets.symmetric(vertical: 12.h), + ), + ], + ), + ); + } + +} diff --git a/lib/retrofit/min_api.dart b/lib/retrofit/min_api.dart index d518dcc5..0ef779fa 100644 --- a/lib/retrofit/min_api.dart +++ b/lib/retrofit/min_api.dart @@ -35,11 +35,11 @@ part 'min_api.g.dart'; // const base_url = "http://192.168.10.132:8765/app/";///詹云久 -// const base_url = "http://192.168.10.236:8766/app/"; ///费韬 +// const base_url = "http://192.168.10.236:8765/app/"; ///费韬 -// const base_url = "http://192.168.10.37:8766/app/"; +// const base_url = "http://192.168.10.37:8765/app/"; -const localBaseUrl = "http://192.168.10.236:8766/app/";///本地 +const localBaseUrl = "http://192.168.10.236:8765/app/";///本地 const serviceBaseUrl = "https://pos.api.lotus-wallet.com/app/";///线上 @@ -126,7 +126,7 @@ abstract class MinApiService { ); if (kReleaseMode) { - baseUrl = base_url; + baseUrl = serviceBaseUrl; } return _MinApiService(dio, baseUrl: baseUrl); } diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index 60e7b337..7ab0a849 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -88,8 +88,8 @@ abstract class ApiService { headers["Environment"] = "app"; } dio.options = BaseOptions( - connectTimeout: 10000, - receiveTimeout: 10000, + connectTimeout: 20000, + receiveTimeout: 20000, headers: headers, responseType: ResponseType.json, ); @@ -145,7 +145,7 @@ abstract class ApiService { ); if (kReleaseMode) { - baseUrl = base_url; + baseUrl = serviceBaseUrl; } return _ApiService(dio, baseUrl: baseUrl); } @@ -177,7 +177,7 @@ abstract class ApiService { /// 用户登录 @POST("/auth/platform/memberLogin") - Future> memberLogin(@Body() Map param); + Future memberLogin(@Body() Map param); ///发送验证码 @GET("/auth/sendVerify/{mobile}") diff --git a/lib/retrofit/retrofit_api.g.dart b/lib/retrofit/retrofit_api.g.dart index 68536369..cc353a1c 100644 --- a/lib/retrofit/retrofit_api.g.dart +++ b/lib/retrofit/retrofit_api.g.dart @@ -42,6 +42,7 @@ class _ApiService implements ApiService { method: 'POST', headers: {}, extra: _extra, + connectTimeout: 60000, baseUrl: baseUrl), data: _data); final value = BaseData.fromJson( @@ -75,7 +76,7 @@ class _ApiService implements ApiService { } @override - Future> memberLogin(param) async { + Future memberLogin(param) async { ArgumentError.checkNotNull(param, 'param'); const _extra = {}; final queryParameters = {}; @@ -90,9 +91,9 @@ class _ApiService implements ApiService { extra: _extra, baseUrl: baseUrl), data: _data); - final value = BaseData.fromJson( + final value = BaseData.fromJson( _result.data, - (json) => LoginInfo.fromJson(json), + (json) => json, ); return value; } diff --git a/lib/setting/logout_ing.dart b/lib/setting/logout_ing.dart index 04ffd1ad..1dc39add 100644 --- a/lib/setting/logout_ing.dart +++ b/lib/setting/logout_ing.dart @@ -451,7 +451,7 @@ class _LogoutIng extends State { sharedPreferences.setString("nick", ""); Navigator.of(context) - .pushNamedAndRemoveUntil('/router/login_page', (route) => false); + .pushNamedAndRemoveUntil('/router/new_login_page', (route) => false); // if (xgFlutterPlugin != null) { // xgFlutterPlugin.stopXg(); // } diff --git a/lib/setting/setting_page.dart b/lib/setting/setting_page.dart index 3af86255..184a324b 100644 --- a/lib/setting/setting_page.dart +++ b/lib/setting/setting_page.dart @@ -46,11 +46,26 @@ class _SettingPage extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: MyAppBar( - title: S.of(context).shezhi, - titleColor: Colors.black, - background: Color(0xFFF7F7F7), - leadingColor: Colors.black, + appBar: AppBar( + backgroundColor: Colors.white, + leading: GestureDetector( + child: Icon( + Icons.arrow_back_ios, + color: Colors.black, + ), + onTap: () { + Navigator.of(context).pop(); + }), + title: Text( + S.of(context).shezhi, + style: TextStyle( + fontWeight: MyFontWeight.regular, + fontSize: 17.sp, + color: Color(0xFF0D0D0D), + ), + ), + centerTitle: true, + elevation: 0.0, ), body: Container( decoration: new BoxDecoration( @@ -64,18 +79,19 @@ class _SettingPage extends State { mainAxisSize: MainAxisSize.max, children: [ SizedBox( - height: 24.h, + height: 16.h, ), - Container( - margin: EdgeInsets.only(left: 16), - child: Text( - S.of(context).shezhi, - style: TextStyle( - fontWeight: MyFontWeight.medium, - color: Color(0xFF353535), - fontSize: 16.sp, - ), - ), + GestureDetector( + child: settingSingleItem(S.of(context).gerenxinxi), + onTap: () { + Navigator.of(context).pushNamed('/router/user_info_page'); + }, + ), + GestureDetector( + child: settingSingleItem(S.of(context).shouhuodi), + onTap: () { + Navigator.of(context).pushNamed('/router/manage_address_page'); + }, ), SizedBox( height: 16.h, @@ -128,11 +144,8 @@ class _SettingPage extends State { Navigator.of(context).pushNamed('/router/permission_setting'); }, ), - GestureDetector( - child: settingSingleItem(S.of(context).bangzhuyufankui), - onTap: () { - Navigator.of(context).pushNamed('/router/help_feedback_page'); - }, + SizedBox( + height: 16.h, ), GestureDetector( child: settingItem(S.of(context).qinglihuancun, cacheTotal), @@ -140,16 +153,28 @@ class _SettingPage extends State { clearCache(); }, ), + SizedBox( + height: 16.h, + ), GestureDetector( - child: settingSingleItem(S.of(context).guanyu), + child: settingSingleItem("注销账号"), onTap: () { - Navigator.of(context).pushNamed('/router/about_page'); + Navigator.of(context).pushNamed('/router/logout_page'); }, ), + SizedBox( + height: 16.h, + ), + // GestureDetector( + // child: settingSingleItem(S.of(context).bangzhuyufankui), + // onTap: () { + // Navigator.of(context).pushNamed('/router/help_feedback_page'); + // }, + // ), GestureDetector( - child: settingSingleItem("注销账号"), + child: settingSingleItem(S.of(context).guanyu), onTap: () { - Navigator.of(context).pushNamed('/router/logout_page'); + Navigator.of(context).pushNamed('/router/about_page'); }, ), Expanded( @@ -242,7 +267,7 @@ class _SettingPage extends State { sharedPreferences.setString("nick", ""); Navigator.of(context) - .pushNamedAndRemoveUntil('/router/login_page', (route) => false); + .pushNamedAndRemoveUntil('/router/new_login_page', (route) => false); // if (xgFlutterPlugin != null) { // xgFlutterPlugin.stopXg(); // } @@ -250,27 +275,18 @@ class _SettingPage extends State { Widget settingItem(left, right) { return Container( - margin: EdgeInsets.fromLTRB(16, 8, 16, 8), padding: EdgeInsets.fromLTRB(20, 16, 20, 16), decoration: BoxDecoration( color: Colors.white, - borderRadius: BorderRadius.all(Radius.circular(8)), - boxShadow: [ - BoxShadow( - color: Colors.black.withAlpha(12), - offset: Offset(0, 3), - blurRadius: 14, - spreadRadius: 0, - ) - ]), + ), child: Row( children: [ Expanded( child: Text( left, style: TextStyle( - fontWeight: MyFontWeight.medium, - fontSize: 14.sp, + fontWeight: MyFontWeight.semi_bold, + fontSize: 15.sp, color: Color(0xFF353535), ), ), @@ -279,7 +295,7 @@ class _SettingPage extends State { Text( right, style: TextStyle( - fontSize: 12.sp, + fontSize: 13.sp, fontWeight: MyFontWeight.regular, color: Color(0xFF727272)), ), @@ -297,19 +313,9 @@ class _SettingPage extends State { Widget settingSingleItem(right) { return Container( - margin: EdgeInsets.fromLTRB(16, 8, 16, 8), padding: EdgeInsets.fromLTRB(20, 16, 20, 16), decoration: BoxDecoration( color: Colors.white, - borderRadius: BorderRadius.all(Radius.circular(8)), - boxShadow: [ - BoxShadow( - color: Colors.black.withAlpha(12), - offset: Offset(0, 3), - blurRadius: 14, - spreadRadius: 0, - ) - ], ), child: Row( children: [ @@ -317,9 +323,9 @@ class _SettingPage extends State { child: Text( right, style: TextStyle( - fontSize: 14.sp, + fontSize: 15.sp, color: Color(0xFF353535), - fontWeight: MyFontWeight.medium, + fontWeight: MyFontWeight.semi_bold, ), ), ), diff --git a/lib/store/report_assess .dart b/lib/store/report_assess .dart new file mode 100644 index 00000000..f837f99d --- /dev/null +++ b/lib/store/report_assess .dart @@ -0,0 +1,395 @@ +import 'dart:io'; + +import 'package:dio/dio.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_easyloading/flutter_easyloading.dart'; +import 'package:flutter_html/flutter_html.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; +import 'package:fluwx/fluwx.dart'; +import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/retrofit/data/base_data.dart'; +import 'package:huixiang/retrofit/data/recharge_list.dart'; +import 'package:huixiang/retrofit/data/user_info.dart'; +import 'package:huixiang/retrofit/data/vip_benefit_list.dart'; +import 'package:huixiang/retrofit/data/vip_rule_details.dart'; +import 'package:huixiang/retrofit/data/wx_pay.dart'; +import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/utils/flutter_utils.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/utils/min.dart'; +import 'package:huixiang/view_widget/classic_header.dart'; +import 'package:huixiang/view_widget/item_input_widget.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; +import 'package:huixiang/view_widget/my_footer.dart'; +import 'package:huixiang/view_widget/round_button.dart'; +import 'package:pull_to_refresh/pull_to_refresh.dart'; +import 'package:shared_preferences/shared_preferences.dart'; + +class ReportAssess extends StatefulWidget { + @override + State createState() { + return _ReportAssess(); + } +} + +class _ReportAssess extends State { + ApiService apiService; + TextEditingController editingController = TextEditingController(); + int textLength = 0; + final RefreshController refreshController = RefreshController(); + final ScrollController scrollController = ScrollController(); + + @override + void initState() { + super.initState(); + + SharedPreferences.getInstance().then((value) { + apiService = ApiService(Dio(), + context: context, token: value.getString("token"), pay: true); + }); + } + + @override + Widget build(BuildContext context) { + return Container( + color: Color(0xFFF9FAF7), + child: Scaffold( + appBar: MyAppBar( + title: "发布评价", + titleColor: Colors.black, + titleSize: 17.sp, + background: Color(0xFFFFFFFF), + leadingColor: Colors.black, + actions: [ + Container( + width: 46.w, + margin: EdgeInsets.only(right: 14,top: 14,bottom: 14), + decoration: BoxDecoration( + color: Color(0xFFB3B3B3), + borderRadius: BorderRadius.circular(4), + ), + alignment: Alignment.center, + child: Text( + S.of(context).fabu, + style: TextStyle( + fontWeight: MyFontWeight.bold, + fontSize: 14.sp, + color: Color(0xFFFFFFFF), + ), + ), + ) + ], + ), + body: SmartRefresher( + controller: refreshController, + enablePullDown: true, + enablePullUp: false, + header: MyHeader(), + footer: CustomFooter( + builder: (context, mode) { + return MyFooter(mode); + }, + ), + onRefresh: () {}, + physics: BouncingScrollPhysics(), + scrollController: scrollController, + child: Container( + child: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: double.infinity, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: double.infinity, + height: 1, + color: Color(0xFFF2F2F2), + ), + goodsAssessList(), + ], + ), + ), + ], + ), + ), + ), + ), + ), + ); + Scaffold( + appBar: MyAppBar( + title: "发布评价", + titleColor: Colors.black, + titleSize: 17.sp, + background: Color(0xFFFFFFFF), + leadingColor: Colors.black, + actions: [ + Container( + width: 46.w, + margin: EdgeInsets.only(right: 14,top: 14,bottom: 14), + decoration: BoxDecoration( + color: Color(0xFFB3B3B3), + borderRadius: BorderRadius.circular(4), + ), + alignment: Alignment.center, + child: Text( + S.of(context).fabu, + style: TextStyle( + fontWeight: MyFontWeight.bold, + fontSize: 14.sp, + color: Color(0xFFFFFFFF), + ), + ), + ) + ], + ), + body: Container( + height: double.infinity, + color: Color(0xFFFFFFFF), + child: Stack( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + width: double.infinity, + height: 1.h, + color: Color(0xFFF2F2F2), + ), + SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Container( + // margin: EdgeInsets.only(left: 14, right: 14, top: 13.h), + child:Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + goodsAssessList(), + ], + ), + ), + ) + ], + ), + ], + ), + ), + ); + } + + + ///评价列表 + Widget goodsAssessList() { + return Container( + // margin: EdgeInsets.only(right:14.w,bottom:20.h), + child:Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ListView.builder( + padding: EdgeInsets.zero, + itemCount:6, + scrollDirection: Axis.vertical, + shrinkWrap: true, + physics: BouncingScrollPhysics(), + itemBuilder: (context, position) { + return GestureDetector( + onTap: () { + }, + child: goodsAssessItem(), + ); + }, + ), + ], + ), + ); + } + + Widget goodsAssessItem(){ + return Container( + color: Colors.white, + padding: EdgeInsets.all(14), + margin: EdgeInsets.only(bottom: 20), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ClipRRect( + child: Image.asset( + "assets/image/icon_story_td.webp", + fit: BoxFit.fill, + height: 51, + width: 51, + ), + borderRadius: BorderRadius.circular(2), + ), + SizedBox(width: 8.w,), + Expanded(child:Container( + height: 51, + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "商品名称[生态小农]山林放养鸡蛋30枚/盒", + style: TextStyle( + fontSize: 13.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF353535), + ), + ), + Text( + "规格名称:套盒装", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF727272), + ), + ), + ], + ), + )), + ], + ), + goodsAssess(), + Container( + width: 80, + height: 80, + margin: EdgeInsets.only(bottom: 28.h), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(6), + border: Border.all( + color: Color(0xFFB3B3B3), + width: 1, + ), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset( + "assets/image/icon_upload.webp", + width:20, + height:20, + ), + SizedBox(height: 4,), + Text( + "上传照片", + style: TextStyle( + fontWeight: MyFontWeight.regular, + fontSize: 12.sp, + color: Color(0xFFB3B3B3), + ), + ), + ], + ), + ), + Text( + "满意度", + style: TextStyle( + fontWeight: MyFontWeight.bold, + fontSize: 15.sp, + color: Color(0xFF000000), + ), + ), + SizedBox(height: 16.h), + Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Column( + children: [ + Image.asset( + "assets/image/report_un.webp", + width:45, + height:45, + ), + SizedBox(height: 4,), + Text( + "不满意", + style: TextStyle( + fontWeight: MyFontWeight.regular, + fontSize: 12.sp, + color: Color(0xFF262626), + ), + ), + ], + )), + Expanded( + child: Column( + children: [ + Image.asset( + "assets/image/report_h.webp", + width:45, + height:45, + ), + Text( + "很满意", + style: TextStyle( + fontWeight: MyFontWeight.regular, + fontSize: 12.sp, + color: Color(0xFF262626), + ), + ), + ], + )), + ], + ) + ], + ), + ); + } + + ///商品评价 + Widget goodsAssess() { + return Container( + width: double.infinity, + height: 186.h, + margin: EdgeInsets.symmetric(vertical: 16.h), + color: Color(0xFFF7F7F7), + child: Column( + children: [ + Container( + margin: EdgeInsets.fromLTRB(12.w, 5.h, 12.w, 0), + alignment: Alignment.topLeft, + child: TextField( + maxLines: 6, + controller: editingController, + onChanged: (value) { + setState(() { + textLength = value.length; + }); + }, + decoration: InputDecoration( + border: InputBorder.none, + hintText: "您的评价,会使我们变得更好", + hintStyle: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFFB3B3B3), + ), + ), + ), + ), + ], + ), + ); + } + + + +} diff --git a/lib/store/shop__details_page.dart b/lib/store/shop__details_page.dart new file mode 100644 index 00000000..a9ed612c --- /dev/null +++ b/lib/store/shop__details_page.dart @@ -0,0 +1,376 @@ +import 'dart:convert'; + +import 'package:dio/dio.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_html/flutter_html.dart'; +import 'package:flutter_html/image_render.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; +import 'package:flutter_swiper/flutter_swiper.dart'; +import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/retrofit/data/base_data.dart'; +import 'package:huixiang/retrofit/data/goods.dart'; +import 'package:huixiang/retrofit/data/user_info.dart'; +import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/view_widget/border_text.dart'; +import 'package:huixiang/view_widget/classic_header.dart'; +import 'package:huixiang/view_widget/custom_image.dart'; +import 'package:huixiang/view_widget/my_footer.dart'; +import 'package:huixiang/view_widget/round_button.dart'; +import 'package:pull_to_refresh/pull_to_refresh.dart'; +import 'package:shared_preferences/shared_preferences.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +class ShopDetailsPage extends StatefulWidget { + final Map arguments; + + ShopDetailsPage({this.arguments}); + + @override + State createState() { + return _ShopDetailsPage(); + } +} + +class _ShopDetailsPage extends State { + ApiService apiService; + final ScrollController scrollController = ScrollController(); + final RefreshController refreshController = RefreshController(); + + @override + void initState() { + super.initState(); + + + } + + @override + Widget build(BuildContext context) { + return Scaffold( + body: Container( + child: Column( + children: [ + Expanded( + child: SmartRefresher( + controller: refreshController, + enablePullDown: true, + enablePullUp: false, + header: MyHeader(), + footer: CustomFooter( + builder: (context, mode) { + return MyFooter(mode); + }, + ), + onRefresh:(){ + setState(() { + }); + }, + physics: BouncingScrollPhysics(), + scrollController: scrollController, + child: Container( + child: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + buildProduct(), + Container( + padding: EdgeInsets.only(top: 16.h,left: 14.w,right: 14.w,bottom: 16.h), + margin: EdgeInsets.symmetric(vertical: 12.h), + width: double.infinity, + color: Colors.white, + child:Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "物流", + style: TextStyle( + fontSize:15.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFF000000), + ), + ), + Text( + "免邮费(吉林省、黑龙江省、西藏自治区、新疆维吾尔自治区、香港特别行政区除外)", + style: TextStyle( + fontSize:12.sp, + height: 1.5, + fontWeight: MyFontWeight.regular, + color: Color(0xFF4D4D4D), + ), + ), + ], + ), + ), + Container( + width: double.infinity, + padding: EdgeInsets.only(top: 16.h,left: 14.w,right: 14.w,bottom: 16.h), + color: Colors.white, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "商品详情", + style: TextStyle( + fontSize:15.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFF000000), + ), + ), + SizedBox(height: 14.h,), + Image.asset( + "assets/image/icon_story_td.webp", + width: double.infinity, + fit: BoxFit.cover, + height:99.h, + ), + ], + ), + ) + ], + ), + ), + ), + ), + flex: 1, + ), + ], + ), + ), + ); + } + + Widget buildProduct() { + return Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.vertical( + bottom: Radius.circular(8.h), + ), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ) + ], + color: Colors.white), + child: Column( + children: [ + swiper(), + Container( + padding: EdgeInsets.only(top: 16.h,left: 14.w,right: 14.w,bottom: 16.h), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + "¥19.00", + style: TextStyle( + fontSize:24.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFFF85400), + ), + ), + SizedBox(width: 2,), + Expanded(child: + Text( + "¥19.00", + style: TextStyle( + fontSize:16.sp, + decoration: TextDecoration.lineThrough, + fontWeight: MyFontWeight.regular, + color: Color(0xFFA29E9E), + ), + )), + GestureDetector( + onTap: (){ + showDeleteDialog(); + }, + child: Container( + width: 92.w, + height: 32.h, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(4), + color: Color(0xFF32A060), + ), + margin: EdgeInsets.only(bottom: 8), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + "assets/image/goods_shopp.webp", + fit: BoxFit.fill, + width: 18, + height: 18, + ), + SizedBox(width: 2,), + Text( + "加入购物车", + style: TextStyle( + fontSize:12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFFFFFFFF), + ), + ), + ], + ), + ), + ) + ], + ), + Text( + "手工啵啵奶茶", + style: TextStyle( + fontSize:15.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFF000000), + ), + ), + SizedBox(height: 12.h,), + Text( + "商品是为了出售而生产的劳动成果,是人类社会生产力发展到一定历史阶段的产物,是用于交换的劳动产品。", + style: TextStyle( + fontSize:12.sp, + height: 1.5, + fontWeight: MyFontWeight.regular, + color: Color(0xFF4D4D4D), + ), + ), + ], + ), + ), + ], + ), + ); + } + + Widget swiper() { + return Container( + child: AspectRatio( + aspectRatio: 1.3698, + child: Stack( + children: [ + Swiper( + pagination: SwiperPagination( + alignment: Alignment.bottomCenter, + builder: DotSwiperPaginationBuilder( + size: 8, + activeSize: 8, + space: 5, + activeColor: Colors.black, + color: Colors.black.withAlpha(76), + ), + ), + itemBuilder: (context, position) { + return Image.asset( + "assets/image/icon_story_td.webp", + fit: BoxFit.cover, + width: 24, + height: 24, + ); + }, + itemCount: 3, + ), + GestureDetector( + onTap: () { + Navigator.of(context).pop(); + }, + child: Container( + margin: EdgeInsets.only(left: 16, top: 52), + padding: EdgeInsets.all(5), + child: Icon( + Icons.arrow_back_ios, + size: 24, + color: Color(0xFF353535), + ), + ), + ), + ], + ), + ), + ); + } + + ///选择規格弹窗 + showDeleteDialog() { + showDialog( + context: context, + builder: (context) { + return AlertDialog( + content: Container( + width: MediaQuery.of(context).size.width - 84, + height:500.h, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ClipRRect( + child: Image.asset( + "assets/image/icon_story_td.webp", + fit: BoxFit.fill, //填充剩余空间 + height: 70.h, + width: 70, + ), + borderRadius: BorderRadius.circular(4), + ), + SizedBox(width: 10.w,), + Expanded(child:Container( + height: 70, + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + "手工啵啵奶茶", + style: TextStyle( + fontSize: 13.sp, + fontWeight: FontWeight.bold, + color: Color(0xFF000000), + ), + ), + Image.asset( + "assets/image/cancel.webp", + fit: BoxFit.cover, + height: 24, + width: 24, + ), + ], + ), + Text( + "¥19.00", + style: TextStyle( + fontSize: 12.sp, + fontWeight: FontWeight.bold, + color: Color(0xFFF65720), + ), + ), + ], + ), + )), + ], + ) + ], + ), + ), + ); + }, + ); + } +} diff --git a/lib/union/union_page.dart b/lib/union/union_page.dart index ff8c135d..236385a0 100644 --- a/lib/union/union_page.dart +++ b/lib/union/union_page.dart @@ -9,6 +9,8 @@ import 'package:flutter_baidu_mapapi_utils/flutter_baidu_mapapi_utils.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/main.dart'; +import 'package:huixiang/mine/coupons_page.dart'; +import 'package:huixiang/mine/vip_card_page.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/store.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; @@ -21,6 +23,7 @@ import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/icon_text.dart'; import 'package:huixiang/view_widget/item_title.dart'; import 'package:huixiang/view_widget/my_appbar.dart'; +import 'package:huixiang/view_widget/my_tab.dart'; import 'package:huixiang/view_widget/request_permission.dart'; import 'package:huixiang/view_widget/round_button.dart'; import 'package:permission_handler/permission_handler.dart'; @@ -41,6 +44,12 @@ class _UnionPage extends State with AutomaticKeepAliveClientMixin, WidgetsBindingObserver { final RefreshController refreshController = RefreshController(initialRefresh: false); + final RefreshController refreshController1 = + RefreshController(initialRefresh: false); + final RefreshController refreshController2 = + RefreshController(initialRefresh: false); + final RefreshController refreshController3 = + RefreshController(initialRefresh: false); ApiService apiService; bool isKeyBoardShow = false; BMFCoordinate latLng; @@ -219,126 +228,173 @@ class _UnionPage extends State @override Widget build(BuildContext context) { super.build(context); - return GestureDetector( - onTap: () { - FocusScope.of(context).requestFocus(FocusNode()); - }, + return DefaultTabController( + length: 4, child: Scaffold( - resizeToAvoidBottomInset: false, appBar: MyAppBar( - titleChild: buildSearchItem(), + title:"", leading: false, brightness: Brightness.light, - ), - body: Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Expanded(child:PreferredSize( - preferredSize: Size(double.infinity, 52.h), - child: Container( - padding: EdgeInsets.only(top:15.h), - color: Color(0xFFFAFAFA), - child: ItemTitle( - text: S.of(context).jingbilianmenghuiyuandian, - imgPath: "assets/image/icon_union_store.webp", - ), - ), - )), - GestureDetector( - onTap: (){ - setState(() { - var storeName = storeList.firstWhere((x)=>x.storeName == "一心回乡商城"); - if(storeName == null) - return; - Navigator.of(context).pushNamed( - '/router/shopping_mall_home', - arguments: { - "type":0, - "id":storeName.id, - "tenant": storeName.tenantCode, - "storeName":storeName.storeName - }, - ); - }); - }, - child:Container( - margin: EdgeInsets.only(right: 18), - height: 25.h, - width: 102.w, - color: Colors.white, - child:Row( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Text( - "一心回乡商城", - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - color: Colors.black, - ), - ), - Icon( - Icons.keyboard_arrow_right, - size: 16, - ), - ], - ), - ), - ), - ], + titleChild: PreferredSize( + preferredSize: Size(double.infinity, 38.h), + child: TabBar( + isScrollable: true, //可滚动 + indicatorColor: Color(0xff39B54A), + labelColor: Colors.black, + labelStyle: TextStyle( + fontSize: 18.sp, + fontWeight: FontWeight.bold, + ), + unselectedLabelStyle: TextStyle( + fontSize: 15.sp, + fontWeight: FontWeight.normal, ), - buildItem(), - ], + // controller: tabController, + //未选中文字颜色 + unselectedLabelColor: Color(0xffA29E9E), + indicatorSize: TabBarIndicatorSize.label, + //指示器与文字等宽 + tabs: [ + MyTab(text: S.of(context).quanbu), + MyTab(text:"吃"), + MyTab(text:"喝"), + MyTab(text:"玩"), + ], + ), + )), + body: TabBarView( + children: [buildItem(refreshController),buildItem(refreshController1), buildItem(refreshController2),buildItem(refreshController3),], ), ), ); + // GestureDetector( + // onTap: () { + // FocusScope.of(context).requestFocus(FocusNode()); + // }, + // child: Scaffold( + // backgroundColor: Colors.white, + // resizeToAvoidBottomInset: false, + // appBar: MyAppBar( + // // titleChild: buildSearchItem(), + // title: "", + // leading: false, + // background: Colors.white, + // brightness: Brightness.light, + // ), + // body: Column( + // children: [ + // // Row( + // // mainAxisAlignment: MainAxisAlignment.start, + // // crossAxisAlignment: CrossAxisAlignment.end, + // // children: [ + // // Expanded(child:PreferredSize( + // // preferredSize: Size(double.infinity, 52.h), + // // child: Container( + // // padding: EdgeInsets.only(top:15.h), + // // color: Color(0xFFFAFAFA), + // // child: ItemTitle( + // // text: S.of(context).jingbilianmenghuiyuandian, + // // imgPath: "assets/image/icon_union_store.webp", + // // ), + // // ), + // // )), + // // GestureDetector( + // // onTap: (){ + // // setState(() { + // // var storeName = storeList.firstWhere((x)=>x.storeName == "一心回乡商城"); + // // if(storeName == null) + // // return; + // // Navigator.of(context).pushNamed( + // // '/router/shopping_mall_home', + // // arguments: { + // // "type":0, + // // "id":storeName.id, + // // "tenant": storeName.tenantCode, + // // "storeName":storeName.storeName + // // }, + // // ); + // // }); + // // }, + // // child:Container( + // // margin: EdgeInsets.only(right: 18), + // // height: 25.h, + // // width: 102.w, + // // color: Colors.white, + // // child:Row( + // // mainAxisAlignment: MainAxisAlignment.center, + // // crossAxisAlignment: CrossAxisAlignment.center, + // // children: [ + // // Text( + // // "一心回乡商城", + // // style: TextStyle( + // // fontSize: 12.sp, + // // fontWeight: MyFontWeight.regular, + // // color: Colors.black, + // // ), + // // ), + // // Icon( + // // Icons.keyboard_arrow_right, + // // size: 16, + // // ), + // // ], + // // ), + // // ), + // // ), + // // ], + // // ), + // buildItem() + // ], + // ), + // ), + // ); } - Widget buildItem() { - return Container( - height: MediaQuery.of(context).size.height - - 103.h - - MediaQuery.of(context).padding.top, - child: SmartRefresher( - controller: refreshController, - enablePullUp: false, - enablePullDown: true, - physics: BouncingScrollPhysics(), - header: MyHeader(), - onRefresh: () { - startLocation(); - }, - child: ListView.builder( - itemCount: storeList == null ? 0 : storeList.length, - padding: EdgeInsets.only( - top: 8.h, - bottom: 84.h, /* + (375.h - 88.h) + 4.h*/ - ), - physics: NeverScrollableScrollPhysics(), - itemBuilder: (context, position) { - return InkWell( - onTap: () { - if (storeList[position].posType.code == "NORMALSTORE") { - showDeleteDialog(); - } else { - Navigator.of(context).pushNamed( - '/router/store_order', - arguments: { - "id": storeList[position].id, - "tenant": storeList[position].tenantCode, - "storeName": storeList[position].storeName + Widget buildItem(RefreshController refreshController) { + return Column( + children: [ + buildSearchItem(), + Container( + height: MediaQuery.of(context).size.height - + 103.h - + MediaQuery.of(context).padding.top, + child: SmartRefresher( + controller: refreshController, + enablePullUp: false, + enablePullDown: true, + physics: BouncingScrollPhysics(), + header: MyHeader(), + onRefresh: () { + startLocation(); + }, + child:ListView.builder( + itemCount: storeList == null ? 0 : storeList.length, + padding: EdgeInsets.only( + top: 8.h, + bottom: 84.h, /* + (375.h - 88.h) + 4.h*/ + ), + physics: NeverScrollableScrollPhysics(), + itemBuilder: (context, position) { + return InkWell( + onTap: () { + if (storeList[position].posType.code == "NORMALSTORE") { + showDeleteDialog(); + } else { + Navigator.of(context).pushNamed( + '/router/store_order', + arguments: { + "id": storeList[position].id, + "tenant": storeList[position].tenantCode, + "storeName": storeList[position].storeName + }, + ); + } }, + child: buildStoreItem(storeList[position], position), ); - } - }, - child: buildStoreItem(storeList[position], position), - ); - }), - ), + }) + ), + ) + ], ); } @@ -355,7 +411,7 @@ class _UnionPage extends State margin: EdgeInsets.fromLTRB(6.w, 0, 14.w, 0), padding: EdgeInsets.fromLTRB(0, 6.h, 0, 6.h), decoration: BoxDecoration( - color: Colors.white, + color: Color(0xFFF5FAF7), borderRadius: BorderRadius.circular(4), boxShadow: [ BoxShadow( @@ -473,7 +529,7 @@ class _UnionPage extends State Widget buildStoreItem(Store store, position) { return Container( margin: EdgeInsets.fromLTRB(16.w, 8.h, 16.w, 8.h), - padding: EdgeInsets.fromLTRB(20.w, 20.h, 20.w, 20.h), + // padding: EdgeInsets.fromLTRB(20.w, 20.h, 20.w, 20.h), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(8)), @@ -485,164 +541,116 @@ class _UnionPage extends State spreadRadius: 0, ) ]), - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, + width: double.infinity, + height: 223, + child: Stack( children: [ - MImage( - store.logo, - width: 100, - height: 100, - fit: BoxFit.cover, - errorSrc: "assets/image/default_1.webp", - fadeSrc: "assets/image/default_1.webp", + Positioned( + top: 0, + left: 0, + right: 0, + child: ClipRRect( + child: MImage( + store.facade, + width: double.infinity, + height: 140, + fit: BoxFit.cover, + errorSrc: "assets/image/default_1.webp", + fadeSrc: "assets/image/default_1.webp", + ), + borderRadius: BorderRadius.vertical( + top: Radius.circular(4), + ), + ), ), - SizedBox( - width: 8.w, + Positioned( + bottom: 0, + left: 0, + right: 0, + child: Container(), ), - Expanded( - flex: 1, + Positioned( + bottom: 16, + left: 12, + right: 0, child: Container( - // height: 100.h, - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, - crossAxisAlignment: CrossAxisAlignment.end, + height:95, + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.center, + MImage( + store.logo, + width: 57, + height: 57, + fit: BoxFit.cover, + isCircle: true, + errorSrc: "assets/image/default_1.webp", + fadeSrc: "assets/image/default_1.webp", + ), + SizedBox(width: 6.w,), + Expanded(child: + Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Expanded( - child: Text( - store.storeName, - overflow: TextOverflow.ellipsis, - style: TextStyle( - color: Colors.black, - fontSize: 14.sp, - fontWeight: FontWeight.bold, - ), - ), - flex: 1, + SizedBox( + height: 40.h, ), Text( - store.businessType, + store.storeName, overflow: TextOverflow.ellipsis, - textAlign: TextAlign.end, style: TextStyle( - color: Color(0xFFEDB12F), - fontWeight: FontWeight.w400, + color: Color(0xFF0D0D0D), fontSize: 14.sp, + fontWeight: MyFontWeight.bold, ), ), - ], - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Expanded( - child: Container( - child: Text( - store.couponVO == null - ? "" - : store.couponVO.bizType == 1 - ? S.of(context).manlijiandaijinquan( - double.tryParse( - store.couponVO.fullAmount) - .toInt(), - double.tryParse( - store.couponVO.discountAmount) - .toInt()) - : S.of(context).quanchangzhe( - store.couponVO.discountPercent), - style: TextStyle( - color: Color(0xFFFF7A1A), - fontWeight: FontWeight.w500, - fontSize: 12.sp, - ), - ), - ), + SizedBox( + height: 5.h, ), Text( - S.of(context).ren( - store == null ? "" : store.perCapitaConsumption), + "${S.of(context).dizhi}:${store.address}", + maxLines: 2, + overflow: TextOverflow.ellipsis, style: TextStyle( - color: Color(0xFF353535), - fontWeight: FontWeight.w400, + color: Color(0xFF4D4D4D), fontSize: 12.sp, + fontWeight: MyFontWeight.regular, ), ), ], + )), + Container( + width: 59.w, + height: 18.h, + alignment: Alignment.center, + margin: EdgeInsets.only(top:20.h), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(2), + color: Color(0xFF32A060), ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - padding: EdgeInsets.only(top: 3.h, left: 2, right: 2), - child: Image.asset( - "assets/image/icon_union_location_black.webp", - width: 14, - height: 14, - ), - ), - Expanded( - flex: 1, - child: Container( - padding: EdgeInsets.only(top: 2.h), - child: Text( - store.address, - overflow: TextOverflow.ellipsis, - maxLines: 2, - style: TextStyle( - color: Color(0xFF727272), - fontWeight: FontWeight.w400, - fontSize: 12.sp, - // height: 1.3.h, - ), - ), - ), - ), - ], - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - IconText( - (store.openStartTime == null && - store.openEndTime == null) - ? S.of(context).quantian - : "${store.openStartTime.substring(0, store.openStartTime.lastIndexOf(":"))} - ${store.openEndTime.substring(0, store.openEndTime.lastIndexOf(":"))}", - textStyle: TextStyle( - color: Color(0xFF727272), - fontSize: 12.sp, - ), - leftImage: "assets/image/icon_union_time.webp", - iconSize: 14.w, - ), - Visibility( - child: Text( - (store.distance ?? 0) > 1000 - ? S.of(context).gongli( - ((store.distance ?? 0) / 1000 * 100).toInt() / - 100.0) - : S.of(context).mi( - ((store.distance ?? 0) * 100).toInt() / - 100.0), - style: TextStyle( - color: Color(0xFF4C4C4C), - fontSize: 12.sp, - ), + child: Visibility( + child: Text( + (store.distance ?? 0) > 1000 + ? S.of(context).gongli( + ((store.distance ?? 0) / 1000 * 100).toInt() / + 100.0) + : S.of(context).mi( + ((store.distance ?? 0) * 100).toInt() / + 100.0), + style: TextStyle( + color: Color(0xFFFFFFFF), + fontSize: 10.sp, ), - visible: store.distance != null, ), - ], + visible: store.distance != null, + ), ), ], ), ), - ) + ), ], ), ); @@ -734,7 +742,7 @@ class _UnionPage extends State S.of(context).ninxiangjiquanxianweikaiqi, S.of(context).weilekaipaizhaoxuanzhetouxiang, S.of(context).kaiqiquanxian, - (result) async { + (result) async { if (result) { await openAppSettings(); } @@ -750,7 +758,12 @@ class _UnionPage extends State String tableId = uri.queryParameters["tableId"]; String tenantCode = uri.queryParameters["tenantCode"]; String shopId = uri.queryParameters["shopId"]; - if (tableId != null && tableId != "" && tenantCode != null && tenantCode != "" && shopId != null && shopId != "") { + if (tableId != null && + tableId != "" && + tenantCode != null && + tenantCode != "" && + shopId != null && + shopId != "") { Navigator.of(context).pushNamed( '/router/store_order', arguments: { diff --git a/lib/view_widget/item_title.dart b/lib/view_widget/item_title.dart index 8d9795a7..14c40786 100644 --- a/lib/view_widget/item_title.dart +++ b/lib/view_widget/item_title.dart @@ -15,7 +15,7 @@ class ItemTitle extends StatelessWidget { ItemTitle({ this.text, - this.imgPath, + this.imgPath = "", this.moreText = "", this.moreType = 0, this.items, @@ -44,14 +44,15 @@ class ItemTitle extends StatelessWidget { text, textAlign: TextAlign.center, style: TextStyle( - color: Colors.black, - fontSize: 16.sp, + color: Color(0xFF0D0D0D), + fontSize: 15.sp, fontWeight: FontWeight.bold, ), ), SizedBox( width: 8.w, ), + if(imgPath != "") Image.asset( imgPath, width: 24.w, diff --git a/lib/view_widget/login_tips_dialog.dart b/lib/view_widget/login_tips_dialog.dart index 9feeb194..ec56f4b5 100644 --- a/lib/view_widget/login_tips_dialog.dart +++ b/lib/view_widget/login_tips_dialog.dart @@ -33,7 +33,7 @@ class LoginTipsDialog { value.setString("nick", ""); }); Navigator.of(context).pushNamed( - '/router/login_page', + '/router/new_login_page', arguments: {"login": "login"}, ); }, diff --git a/lib/view_widget/mine_vip_view.dart b/lib/view_widget/mine_vip_view.dart index ce714903..6ec0d3c1 100644 --- a/lib/view_widget/mine_vip_view.dart +++ b/lib/view_widget/mine_vip_view.dart @@ -135,7 +135,7 @@ class MineVipView extends StatelessWidget { ), borderRadius: isUserVip ? BorderRadius.circular(8) - : BorderRadius.vertical(top: Radius.circular(8)), + : BorderRadius.circular(8), boxShadow: [ BoxShadow( color: Colors.black.withAlpha(12), diff --git a/lib/view_widget/my_appbar.dart b/lib/view_widget/my_appbar.dart index 2013cf3a..b03257d4 100644 --- a/lib/view_widget/my_appbar.dart +++ b/lib/view_widget/my_appbar.dart @@ -66,7 +66,7 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget { }, child: Container( alignment: Alignment.centerRight, - margin: EdgeInsets.only(left: 10), + margin: EdgeInsets.only(left: 12), padding: EdgeInsets.all(6), child: Icon( Icons.arrow_back_ios, @@ -81,14 +81,19 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget { leadingWidth: leading ? 56 : 10.w, title: ((title == null || title == "") && titleChild != null) ? titleChild - : Text( - title, - style: TextStyle( - color: titleColor, - fontWeight: FontWeight.bold, - fontSize: titleSize, - ), - ), + : Container( + width: double.infinity, + margin: EdgeInsets.only(right:34.w), + alignment: Alignment.center, + child: Text( + title, + style: TextStyle( + color: titleColor, + fontWeight: FontWeight.bold, + fontSize: titleSize, + ), + ), + ), actions: actions, bottom: bottom, );