From 80716186181102749062d81659f013ea5ba00032 Mon Sep 17 00:00:00 2001 From: fmk Date: Mon, 16 Aug 2021 19:21:07 +0800 Subject: [PATCH] UI --- assets/image/2x/icon_my_location.webp | Bin 0 -> 1916 bytes assets/image/3x/icon_my_location.webp | Bin 0 -> 3290 bytes assets/image/icon_my_location.webp | Bin 0 -> 990 bytes lib/generated/intl/messages_en.dart | 5 +- lib/generated/intl/messages_zh_CN.dart | 5 +- lib/generated/intl/messages_zh_Hans_CN.dart | 5 +- lib/generated/intl/messages_zh_Hant_CN.dart | 5 +- lib/generated/intl/messages_zh_TW.dart | 5 +- lib/generated/l10n.dart | 34 ++- lib/l10n/intl_en.arb | 6 +- lib/l10n/intl_zh_CN.arb | 5 +- lib/l10n/intl_zh_Hans_CN.arb | 5 +- lib/l10n/intl_zh_Hant_CN.arb | 5 +- lib/l10n/intl_zh_TW.arb | 5 +- lib/mine/user_info_page.dart | 2 +- lib/mine/vip_card_page.dart | 10 +- lib/mine/vip_detail_page.dart | 10 +- lib/setting/about_page.dart | 3 +- lib/union/location_map_page.dart | 125 +++++++--- lib/union/store_details_page.dart | 156 +++++++----- lib/union/union_details_page.dart | 141 ++++++----- lib/union/union_page.dart | 258 +++++--------------- lib/utils/flutter_utils.dart | 8 + lib/utils/location.dart | 132 ++++++++++ lib/view_widget/comment_menu.dart | 99 ++++++++ lib/view_widget/store_title_tab.dart | 1 + lib/view_widget/tips_dialog.dart | 105 ++++++++ 27 files changed, 752 insertions(+), 383 deletions(-) create mode 100644 assets/image/2x/icon_my_location.webp create mode 100644 assets/image/3x/icon_my_location.webp create mode 100644 assets/image/icon_my_location.webp create mode 100644 lib/utils/location.dart create mode 100644 lib/view_widget/comment_menu.dart create mode 100644 lib/view_widget/tips_dialog.dart diff --git a/assets/image/2x/icon_my_location.webp b/assets/image/2x/icon_my_location.webp new file mode 100644 index 0000000000000000000000000000000000000000..5de6f82a857bdf0f75b727906ff5eff528f98785 GIT binary patch literal 1916 zcmV-?2ZQ)hN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)~)_24b4JpS-fU54WyDv|up-g&LY zd?J)`&rJ5$@95Wd5s)|ZH> zOY~acYF8que9Jbm7c|yf7=jfpqBye-)7&GELWSG>C=)XW3B^-jH` zEO1M?GKS;I^9 zr>=Ikr*hNwuEeuS%5E^6HEpp>6CW!Xae&qERy?33iNBSM?B2klkEyZSN)qq;@5l8i z|H)GJF5XsL0B};m z`Tk#kG8yW_ZaZ{72}^>IfHgKDEP;xt1`r7ugajB5M!yP(V4?>89B~AUvfe-hVVqfM z?#~=5g;YX0fCawb&_WCjkwB3Gb^%l+N)su)5=9GpD_fq!+!7j^7g*qkD@Q!+vRnyKU_QIOxpVeNl0P8ZB8lK+~b|3@R!!+D{=Pyg3}kYN7@%8>^9PZyB}`_KCc5#7IaD@54e zDW6a=_)Awp#noSVwUA-IwI^ik{Vrad37(hLNBy(>^;!Q|y$GJO%}@0sn&(BM_$P7k zENJ>awS#_qt(brs`r$jy%q)8%NS@w{35idFX0goH%O(pHWJ$2z)}@*)HylDn$Sl-23c1D+r4BB7_M0 z5(T%$nW-WOoZ(sz1w|F5D(q_v`>^K}VZff!??n)AI4w}$qjxPJ8aPGN_qe`9K3dm< zFHtG}3aN-n{_h3D2T~FAMeb4Ns*Y4d87x%#`H9pgDj_`*3}vJu=!+bo^o7(HO1xKi zAHw@Wx2*Q+me)S>`XiYCUFh?_yzvGuzN(>)HC%kf8&C4a&$iE+FYx9^y!jw){>z*1 z^VTp5ZSSJgyWAiRDRtX}u_U%l=vK)o(_eKH2DPm;3}kz6R@l3h_RU3YvS^{iD4m>%JB1ewo^Rx?Mf{biwuq MZ+`C&TB!X&1L(^b literal 0 HcmV?d00001 diff --git a/lib/generated/intl/messages_en.dart b/lib/generated/intl/messages_en.dart index 62f35b41..ed8838f7 100644 --- a/lib/generated/intl/messages_en.dart +++ b/lib/generated/intl/messages_en.dart @@ -208,6 +208,7 @@ class MessageLookup extends MessageLookupByLibrary { "hexiaochenggong" : MessageLookupByLibrary.simpleMessage("核销成功"), "hexiaomaxiangqing" : MessageLookupByLibrary.simpleMessage("核销码详情"), "huangjinhuiyuan" : MessageLookupByLibrary.simpleMessage("黄金会员"), + "huifu" : MessageLookupByLibrary.simpleMessage("回复"), "huifu_" : m8, "huixiangrenyimendian" : MessageLookupByLibrary.simpleMessage("适用于:一心回乡任意门店"), "huixiangtoutiao" : MessageLookupByLibrary.simpleMessage("回乡头条"), @@ -358,6 +359,7 @@ class MessageLookup extends MessageLookupByLibrary { "querenchongzhi" : MessageLookupByLibrary.simpleMessage("确认充值"), "querenduihuan" : MessageLookupByLibrary.simpleMessage("确认兑换"), "querenshouhuo" : MessageLookupByLibrary.simpleMessage("确认收货"), + "querenyaoshanchudangqianpinglunma" : MessageLookupByLibrary.simpleMessage("确认要删除当前评论?"), "quhexiao" : MessageLookupByLibrary.simpleMessage("去核销"), "quhuozhong" : MessageLookupByLibrary.simpleMessage("取货中"), "qujianma" : MessageLookupByLibrary.simpleMessage("取件码"), @@ -381,6 +383,7 @@ class MessageLookup extends MessageLookupByLibrary { "ruheqiandao" : MessageLookupByLibrary.simpleMessage("如何签到?"), "ruheqiandao1" : MessageLookupByLibrary.simpleMessage("1.点击净弼,进入首页,点击上方的去签到。\n2.点击我的,进入我的页面,点击上方的积分详情,进入后即可签到。"), "send_code" : MessageLookupByLibrary.simpleMessage("发送验证"), + "shanchu" : MessageLookupByLibrary.simpleMessage("删除"), "shanchudingdan" : MessageLookupByLibrary.simpleMessage("删除一单"), "shangjiaquan" : MessageLookupByLibrary.simpleMessage("商家券"), "shangjiaqueren" : MessageLookupByLibrary.simpleMessage("商家确认"), @@ -534,7 +537,7 @@ class MessageLookup extends MessageLookupByLibrary { "zailaiyidan" : MessageLookupByLibrary.simpleMessage("再来一单"), "zaixiankefu" : MessageLookupByLibrary.simpleMessage("在线客服"), "zanbuzhichixianshangdiancan" : MessageLookupByLibrary.simpleMessage("暂不支持线上点餐"), - "zanwuxianshangjindian" : MessageLookupByLibrary.simpleMessage("暂无线上进店"), + "zanwuxianshangjindian" : MessageLookupByLibrary.simpleMessage("暂无线上门店"), "zanwuyouhuiquankelingqu" : MessageLookupByLibrary.simpleMessage("暂无优惠券可领取"), "zhanghaoshouquan" : MessageLookupByLibrary.simpleMessage("账号授权"), "zhanghaoxinxi" : MessageLookupByLibrary.simpleMessage("账号信息"), diff --git a/lib/generated/intl/messages_zh_CN.dart b/lib/generated/intl/messages_zh_CN.dart index d91967a2..91d22c28 100644 --- a/lib/generated/intl/messages_zh_CN.dart +++ b/lib/generated/intl/messages_zh_CN.dart @@ -207,6 +207,7 @@ class MessageLookup extends MessageLookupByLibrary { "hexiaochenggong" : MessageLookupByLibrary.simpleMessage("核销成功"), "hexiaomaxiangqing" : MessageLookupByLibrary.simpleMessage("核销码详情"), "huangjinhuiyuan" : MessageLookupByLibrary.simpleMessage("黄金会员"), + "huifu" : MessageLookupByLibrary.simpleMessage("回复"), "huifu_" : m8, "huixiangrenyimendian" : MessageLookupByLibrary.simpleMessage("适用于:一心回乡任意门店"), "huixiangtoutiao" : MessageLookupByLibrary.simpleMessage("回乡头条"), @@ -357,6 +358,7 @@ class MessageLookup extends MessageLookupByLibrary { "querenchongzhi" : MessageLookupByLibrary.simpleMessage("确认充值"), "querenduihuan" : MessageLookupByLibrary.simpleMessage("确认兑换"), "querenshouhuo" : MessageLookupByLibrary.simpleMessage("确认收货"), + "querenyaoshanchudangqianpinglunma" : MessageLookupByLibrary.simpleMessage("确认要删除当前评论?"), "quhexiao" : MessageLookupByLibrary.simpleMessage("去核销"), "quhuozhong" : MessageLookupByLibrary.simpleMessage("取货中"), "qujianma" : MessageLookupByLibrary.simpleMessage("取件码"), @@ -380,6 +382,7 @@ class MessageLookup extends MessageLookupByLibrary { "ruheqiandao" : MessageLookupByLibrary.simpleMessage("如何签到?"), "ruheqiandao1" : MessageLookupByLibrary.simpleMessage("1.点击净弼,进入首页,点击上方的去签到。\n2.点击我的,进入我的页面,点击上方的积分详情,进入后即可签到。"), "send_code" : MessageLookupByLibrary.simpleMessage("发送验证"), + "shanchu" : MessageLookupByLibrary.simpleMessage("删除"), "shanchudingdan" : MessageLookupByLibrary.simpleMessage("删除一单"), "shangjiaquan" : MessageLookupByLibrary.simpleMessage("商家券"), "shangjiaqueren" : MessageLookupByLibrary.simpleMessage("商家确认"), @@ -533,7 +536,7 @@ class MessageLookup extends MessageLookupByLibrary { "zailaiyidan" : MessageLookupByLibrary.simpleMessage("再来一单"), "zaixiankefu" : MessageLookupByLibrary.simpleMessage("在线客服"), "zanbuzhichixianshangdiancan" : MessageLookupByLibrary.simpleMessage("暂不支持线上点餐"), - "zanwuxianshangjindian" : MessageLookupByLibrary.simpleMessage("暂无线上进店"), + "zanwuxianshangjindian" : MessageLookupByLibrary.simpleMessage("暂无线上门店"), "zanwuyouhuiquankelingqu" : MessageLookupByLibrary.simpleMessage("暂无优惠券可领取"), "zhanghaoshouquan" : MessageLookupByLibrary.simpleMessage("账号授权"), "zhanghuyue" : MessageLookupByLibrary.simpleMessage("账户余额"), diff --git a/lib/generated/intl/messages_zh_Hans_CN.dart b/lib/generated/intl/messages_zh_Hans_CN.dart index 8abd6c90..b2b69bfe 100644 --- a/lib/generated/intl/messages_zh_Hans_CN.dart +++ b/lib/generated/intl/messages_zh_Hans_CN.dart @@ -207,6 +207,7 @@ class MessageLookup extends MessageLookupByLibrary { "hexiaochenggong" : MessageLookupByLibrary.simpleMessage("核销成功"), "hexiaomaxiangqing" : MessageLookupByLibrary.simpleMessage("核销码详情"), "huangjinhuiyuan" : MessageLookupByLibrary.simpleMessage("黄金会员"), + "huifu" : MessageLookupByLibrary.simpleMessage("回复"), "huifu_" : m8, "huixiangrenyimendian" : MessageLookupByLibrary.simpleMessage("适用于:一心回乡任意门店"), "huixiangtoutiao" : MessageLookupByLibrary.simpleMessage("回乡头条"), @@ -357,6 +358,7 @@ class MessageLookup extends MessageLookupByLibrary { "querenchongzhi" : MessageLookupByLibrary.simpleMessage("确认充值"), "querenduihuan" : MessageLookupByLibrary.simpleMessage("确认兑换"), "querenshouhuo" : MessageLookupByLibrary.simpleMessage("确认收货"), + "querenyaoshanchudangqianpinglunma" : MessageLookupByLibrary.simpleMessage("确认要删除当前评论?"), "quhexiao" : MessageLookupByLibrary.simpleMessage("去核销"), "quhuozhong" : MessageLookupByLibrary.simpleMessage("取货中"), "qujianma" : MessageLookupByLibrary.simpleMessage("取件码"), @@ -380,6 +382,7 @@ class MessageLookup extends MessageLookupByLibrary { "ruheqiandao" : MessageLookupByLibrary.simpleMessage("如何签到?"), "ruheqiandao1" : MessageLookupByLibrary.simpleMessage("1.点击净弼,进入首页,点击上方的去签到。\n2.点击我的,进入我的页面,点击上方的积分详情,进入后即可签到。"), "send_code" : MessageLookupByLibrary.simpleMessage("发送验证"), + "shanchu" : MessageLookupByLibrary.simpleMessage("删除"), "shanchudingdan" : MessageLookupByLibrary.simpleMessage("删除一单"), "shangjiaquan" : MessageLookupByLibrary.simpleMessage("商家券"), "shangjiaqueren" : MessageLookupByLibrary.simpleMessage("商家确认"), @@ -533,7 +536,7 @@ class MessageLookup extends MessageLookupByLibrary { "zailaiyidan" : MessageLookupByLibrary.simpleMessage("再来一单"), "zaixiankefu" : MessageLookupByLibrary.simpleMessage("在线客服"), "zanbuzhichixianshangdiancan" : MessageLookupByLibrary.simpleMessage("暂不支持线上点餐"), - "zanwuxianshangjindian" : MessageLookupByLibrary.simpleMessage("暂无线上进店"), + "zanwuxianshangjindian" : MessageLookupByLibrary.simpleMessage("暂无线上门店"), "zanwuyouhuiquankelingqu" : MessageLookupByLibrary.simpleMessage("暂无优惠券可领取"), "zhanghaoshouquan" : MessageLookupByLibrary.simpleMessage("账号授权"), "zhanghuyue" : MessageLookupByLibrary.simpleMessage("账户余额"), diff --git a/lib/generated/intl/messages_zh_Hant_CN.dart b/lib/generated/intl/messages_zh_Hant_CN.dart index 44d2ba50..9b15cb4c 100644 --- a/lib/generated/intl/messages_zh_Hant_CN.dart +++ b/lib/generated/intl/messages_zh_Hant_CN.dart @@ -207,6 +207,7 @@ class MessageLookup extends MessageLookupByLibrary { "hexiaochenggong" : MessageLookupByLibrary.simpleMessage("核銷成功"), "hexiaomaxiangqing" : MessageLookupByLibrary.simpleMessage("核銷碼詳情"), "huangjinhuiyuan" : MessageLookupByLibrary.simpleMessage("黃金會員"), + "huifu" : MessageLookupByLibrary.simpleMessage("回復"), "huifu_" : m8, "huixiangrenyimendian" : MessageLookupByLibrary.simpleMessage("适用于:一心回乡任意门店"), "huixiangtoutiao" : MessageLookupByLibrary.simpleMessage("回鄉頭條"), @@ -357,6 +358,7 @@ class MessageLookup extends MessageLookupByLibrary { "querenchongzhi" : MessageLookupByLibrary.simpleMessage("確認充值"), "querenduihuan" : MessageLookupByLibrary.simpleMessage("确认兑换"), "querenshouhuo" : MessageLookupByLibrary.simpleMessage("確認收貨"), + "querenyaoshanchudangqianpinglunma" : MessageLookupByLibrary.simpleMessage("確認要刪除當前評論嗎?"), "quhexiao" : MessageLookupByLibrary.simpleMessage("去核銷"), "quhuozhong" : MessageLookupByLibrary.simpleMessage("取貨中"), "qujianma" : MessageLookupByLibrary.simpleMessage("取件碼"), @@ -380,6 +382,7 @@ class MessageLookup extends MessageLookupByLibrary { "ruheqiandao" : MessageLookupByLibrary.simpleMessage("如何簽到?"), "ruheqiandao1" : MessageLookupByLibrary.simpleMessage("1.點擊淨弼,進入首頁,點擊上方的去簽到。\n2.點擊我的,進入我的頁面,點擊上方的積分詳情,進入後即可簽到。"), "send_code" : MessageLookupByLibrary.simpleMessage("發送驗證碼"), + "shanchu" : MessageLookupByLibrary.simpleMessage("刪除"), "shanchudingdan" : MessageLookupByLibrary.simpleMessage("刪除訂單"), "shangjiaquan" : MessageLookupByLibrary.simpleMessage("商家券"), "shangjiaqueren" : MessageLookupByLibrary.simpleMessage("商家確認"), @@ -533,7 +536,7 @@ class MessageLookup extends MessageLookupByLibrary { "zailaiyidan" : MessageLookupByLibrary.simpleMessage("再來一單"), "zaixiankefu" : MessageLookupByLibrary.simpleMessage("在線客服"), "zanbuzhichixianshangdiancan" : MessageLookupByLibrary.simpleMessage("暫不支持線上點餐"), - "zanwuxianshangjindian" : MessageLookupByLibrary.simpleMessage("暫無綫上進店"), + "zanwuxianshangjindian" : MessageLookupByLibrary.simpleMessage("暫無綫上門店"), "zanwuyouhuiquankelingqu" : MessageLookupByLibrary.simpleMessage("暫無優惠券可領取"), "zhanghaoshouquan" : MessageLookupByLibrary.simpleMessage("賬號授權"), "zhanghaoxinxi" : MessageLookupByLibrary.simpleMessage("賬號信息"), diff --git a/lib/generated/intl/messages_zh_TW.dart b/lib/generated/intl/messages_zh_TW.dart index eb195766..83fca203 100644 --- a/lib/generated/intl/messages_zh_TW.dart +++ b/lib/generated/intl/messages_zh_TW.dart @@ -207,6 +207,7 @@ class MessageLookup extends MessageLookupByLibrary { "hexiaochenggong" : MessageLookupByLibrary.simpleMessage("核銷成功"), "hexiaomaxiangqing" : MessageLookupByLibrary.simpleMessage("核銷碼詳情"), "huangjinhuiyuan" : MessageLookupByLibrary.simpleMessage("黃金會員"), + "huifu" : MessageLookupByLibrary.simpleMessage("回復"), "huifu_" : m8, "huixiangrenyimendian" : MessageLookupByLibrary.simpleMessage("适用于:一心回乡任意门店"), "huixiangtoutiao" : MessageLookupByLibrary.simpleMessage("回鄉頭條"), @@ -357,6 +358,7 @@ class MessageLookup extends MessageLookupByLibrary { "querenchongzhi" : MessageLookupByLibrary.simpleMessage("確認充值"), "querenduihuan" : MessageLookupByLibrary.simpleMessage("确认兑换"), "querenshouhuo" : MessageLookupByLibrary.simpleMessage("確認收貨"), + "querenyaoshanchudangqianpinglunma" : MessageLookupByLibrary.simpleMessage("確認要刪除當前評論嗎?"), "quhexiao" : MessageLookupByLibrary.simpleMessage("去核銷"), "quhuozhong" : MessageLookupByLibrary.simpleMessage("取貨中"), "qujianma" : MessageLookupByLibrary.simpleMessage("取件碼"), @@ -380,6 +382,7 @@ class MessageLookup extends MessageLookupByLibrary { "ruheqiandao" : MessageLookupByLibrary.simpleMessage("如何簽到?"), "ruheqiandao1" : MessageLookupByLibrary.simpleMessage("1.點擊淨弼,進入首頁,點擊上方的去簽到。\n2.點擊我的,進入我的頁面,點擊上方的積分詳情,進入後即可簽到。"), "send_code" : MessageLookupByLibrary.simpleMessage("發送驗證碼"), + "shanchu" : MessageLookupByLibrary.simpleMessage("刪除"), "shanchudingdan" : MessageLookupByLibrary.simpleMessage("刪除訂單"), "shangjiaquan" : MessageLookupByLibrary.simpleMessage("商家券"), "shangjiaqueren" : MessageLookupByLibrary.simpleMessage("商家確認"), @@ -533,7 +536,7 @@ class MessageLookup extends MessageLookupByLibrary { "zailaiyidan" : MessageLookupByLibrary.simpleMessage("再來一單"), "zaixiankefu" : MessageLookupByLibrary.simpleMessage("在線客服"), "zanbuzhichixianshangdiancan" : MessageLookupByLibrary.simpleMessage("暫不支持線上點餐"), - "zanwuxianshangjindian" : MessageLookupByLibrary.simpleMessage("暫無綫上進店"), + "zanwuxianshangjindian" : MessageLookupByLibrary.simpleMessage("暫無綫上門店"), "zanwuyouhuiquankelingqu" : MessageLookupByLibrary.simpleMessage("暫無優惠券可領取"), "zhanghaoshouquan" : MessageLookupByLibrary.simpleMessage("賬號授權"), "zhanghaoxinxi" : MessageLookupByLibrary.simpleMessage("賬號信息"), diff --git a/lib/generated/l10n.dart b/lib/generated/l10n.dart index d10d09ae..bdf2ef63 100644 --- a/lib/generated/l10n.dart +++ b/lib/generated/l10n.dart @@ -4465,10 +4465,10 @@ class S { ); } - /// `暂无线上进店` + /// `暂无线上门店` String get zanwuxianshangjindian { return Intl.message( - '暂无线上进店', + '暂无线上门店', name: 'zanwuxianshangjindian', desc: '', args: [], @@ -4625,6 +4625,36 @@ class S { ); } + /// `删除` + String get shanchu { + return Intl.message( + '删除', + name: 'shanchu', + desc: '', + args: [], + ); + } + + /// `回复` + String get huifu { + return Intl.message( + '回复', + name: 'huifu', + desc: '', + args: [], + ); + } + + /// `确认要删除当前评论?` + String get querenyaoshanchudangqianpinglunma { + return Intl.message( + '确认要删除当前评论?', + name: 'querenyaoshanchudangqianpinglunma', + desc: '', + args: [], + ); + } + /// `并使用本机号码登录` String get privacy_policy4 { return Intl.message( diff --git a/lib/l10n/intl_en.arb b/lib/l10n/intl_en.arb index 0e8a11d5..b0f5ba64 100644 --- a/lib/l10n/intl_en.arb +++ b/lib/l10n/intl_en.arb @@ -463,7 +463,7 @@ "wuliudanhao": "物流单号:", "yiqianshou": "已签收", "jinrushangdian": "进入商店", - "zanwuxianshangjindian": "暂无线上进店", + "zanwuxianshangjindian": "暂无线上门店", "fankuilizi": "您可以在这里输入反馈内容,例如产品建议,功能异常等", "qingshuruyouxiaoshoujihaoma": "请输入您的有效手机号", "ruhelingquyouhuiquan": "如何领取优惠券?", @@ -481,7 +481,9 @@ "xihuan_": "喜欢({xihuan})", "pinglun_": "评论({pinglun})", "liuxianinjingcaidepinglunba": "留下您精彩的评论吧", - + "shanchu": "删除", + "huifu": "回复", + "querenyaoshanchudangqianpinglunma": "确认要删除当前评论?", "privacy_policy4": "并使用本机号码登录" } \ No newline at end of file diff --git a/lib/l10n/intl_zh_CN.arb b/lib/l10n/intl_zh_CN.arb index 01aac491..a4aa7857 100644 --- a/lib/l10n/intl_zh_CN.arb +++ b/lib/l10n/intl_zh_CN.arb @@ -464,7 +464,7 @@ "wuliudanhao": "物流单号:", "yiqianshou": "已签收", "jinrushangdian": "进入商店", - "zanwuxianshangjindian": "暂无线上进店", + "zanwuxianshangjindian": "暂无线上门店", "fankuilizi": "您可以在这里输入反馈内容,例如产品建议,功能异常等", "qingshuruyouxiaoshoujihaoma": "请输入您的有效手机号", "ruhelingquyouhuiquan": "如何领取优惠券?", @@ -482,6 +482,9 @@ "xihuan_": "喜欢({xihuan})", "pinglun_": "评论({pinglun})", "liuxianinjingcaidepinglunba": "留下您精彩的评论吧", + "shanchu": "删除", + "huifu": "回复", + "querenyaoshanchudangqianpinglunma": "确认要删除当前评论?", diff --git a/lib/l10n/intl_zh_Hans_CN.arb b/lib/l10n/intl_zh_Hans_CN.arb index f4597a81..0b1c4ab8 100644 --- a/lib/l10n/intl_zh_Hans_CN.arb +++ b/lib/l10n/intl_zh_Hans_CN.arb @@ -464,7 +464,7 @@ "wuliudanhao": "物流单号:", "yiqianshou": "已签收", "jinrushangdian": "进入商店", - "zanwuxianshangjindian": "暂无线上进店", + "zanwuxianshangjindian": "暂无线上门店", "fankuilizi": "您可以在这里输入反馈内容,例如产品建议,功能异常等", "qingshuruyouxiaoshoujihaoma": "请输入您的有效手机号", "ruhelingquyouhuiquan": "如何领取优惠券?", @@ -482,6 +482,9 @@ "xihuan_": "喜欢({xihuan})", "pinglun_": "评论({pinglun})", "liuxianinjingcaidepinglunba": "留下您精彩的评论吧", + "shanchu": "删除", + "huifu": "回复", + "querenyaoshanchudangqianpinglunma": "确认要删除当前评论?", diff --git a/lib/l10n/intl_zh_Hant_CN.arb b/lib/l10n/intl_zh_Hant_CN.arb index aa196aa8..b9311e2f 100644 --- a/lib/l10n/intl_zh_Hant_CN.arb +++ b/lib/l10n/intl_zh_Hant_CN.arb @@ -458,7 +458,7 @@ "wuliudanhao": "物流單號:", "yiqianshou": "已簽收", "jinrushangdian": "進入商店", - "zanwuxianshangjindian": "暫無綫上進店", + "zanwuxianshangjindian": "暫無綫上門店", "fankuilizi": "您可以在這裡輸入迴響內容,例如產品建議,功能异常等", "qingshuruyouxiaoshoujihaoma": "請輸入您的有效手機號", "ruhelingquyouhuiquan": "如何領取優惠券?", @@ -476,6 +476,9 @@ "xihuan_": "喜歡({xihuan})", "pinglun_": "評論({pinglun})", "liuxianinjingcaidepinglunba": "留下您精彩的評論吧", + "shanchu": "刪除", + "huifu": "回復", + "querenyaoshanchudangqianpinglunma": "確認要刪除當前評論嗎?", "privacy_policy4": "并使用本機號碼登錄" diff --git a/lib/l10n/intl_zh_TW.arb b/lib/l10n/intl_zh_TW.arb index e8bcdaa0..62172989 100644 --- a/lib/l10n/intl_zh_TW.arb +++ b/lib/l10n/intl_zh_TW.arb @@ -456,7 +456,7 @@ "wuliudanhao": "物流單號:", "yiqianshou": "已簽收", "jinrushangdian": "進入商店", - "zanwuxianshangjindian": "暫無綫上進店", + "zanwuxianshangjindian": "暫無綫上門店", "fankuilizi": "您可以在這裡輸入迴響內容,例如產品建議,功能异常等", "qingshuruyouxiaoshoujihaoma": "請輸入您的有效手機號", "ruhelingquyouhuiquan": "如何領取優惠券?", @@ -474,6 +474,9 @@ "xihuan_": "喜歡({xihuan})", "pinglun_": "評論({pinglun})", "liuxianinjingcaidepinglunba": "留下您精彩的評論吧", + "shanchu": "刪除", + "huifu": "回復", + "querenyaoshanchudangqianpinglunma": "確認要刪除當前評論嗎?", "privacy_policy4": "并使用本機號碼登錄" diff --git a/lib/mine/user_info_page.dart b/lib/mine/user_info_page.dart index e838bfb0..b5dc1eec 100644 --- a/lib/mine/user_info_page.dart +++ b/lib/mine/user_info_page.dart @@ -109,7 +109,7 @@ class _UserInfoPage extends State { blurRadius: 14, spreadRadius: 0, ) - ]), + ],), child: Row( children: [ Expanded( diff --git a/lib/mine/vip_card_page.dart b/lib/mine/vip_card_page.dart index c47727d6..2202bced 100644 --- a/lib/mine/vip_card_page.dart +++ b/lib/mine/vip_card_page.dart @@ -195,7 +195,7 @@ class _VipCardPage extends State { color: Colors.black, ), ), - ]), + ],), textDirection: TextDirection.ltr, ), ], @@ -224,7 +224,7 @@ class _VipCardPage extends State { color: Colors.black, ), ), - ]), + ],), ), ], ), @@ -247,7 +247,7 @@ class _VipCardPage extends State { color: Colors.black, ), ), - ]), + ],), ), ), Text.rich( @@ -260,7 +260,7 @@ class _VipCardPage extends State { color: Color(0Xff353535), ), ), - ]), + ],), ), Text.rich( TextSpan(children: [ @@ -272,7 +272,7 @@ class _VipCardPage extends State { color: Color(0Xff353535), ), ), - ]), + ],), ), ], ), diff --git a/lib/mine/vip_detail_page.dart b/lib/mine/vip_detail_page.dart index ed6a8091..780173c9 100644 --- a/lib/mine/vip_detail_page.dart +++ b/lib/mine/vip_detail_page.dart @@ -174,7 +174,7 @@ class _VipDetailPage extends State { blurRadius: 14, spreadRadius: 0, ) - ]), + ],), child: Stack( // alignment: Alignment.center, children: [ @@ -326,7 +326,7 @@ class _VipDetailPage extends State { color: Colors.black, ), ), - ]), + ],), ), SizedBox( height: 5.h, @@ -414,7 +414,7 @@ class _VipDetailPage extends State { fontWeight: FontWeight.bold, color: Colors.black, ), - )), + ),), GestureDetector( onTap: () { Navigator.of(context).pushNamed('/router/union_detail_page', @@ -442,7 +442,7 @@ class _VipDetailPage extends State { Row( children: [ Text( - "地址:", + "", style: TextStyle( fontSize: 12.sp, fontWeight: FontWeight.w400, @@ -450,7 +450,7 @@ class _VipDetailPage extends State { ), ), Text( - "楚河汉街第一街区万达总部国际C座对面", + "", overflow: TextOverflow.ellipsis, style: TextStyle( fontSize: 12.sp, diff --git a/lib/setting/about_page.dart b/lib/setting/about_page.dart index e078f32f..9be338b6 100644 --- a/lib/setting/about_page.dart +++ b/lib/setting/about_page.dart @@ -81,8 +81,7 @@ class _AboutPage extends State { GestureDetector( child: settingSingleItem(S.of(context).geiwopingfen), onTap: () { - Navigator.of(context) - .pushNamed('/router/help_feedback_page'); + }, ), GestureDetector( diff --git a/lib/union/location_map_page.dart b/lib/union/location_map_page.dart index 46f384a3..33b219ea 100644 --- a/lib/union/location_map_page.dart +++ b/lib/union/location_map_page.dart @@ -1,17 +1,16 @@ - -import 'dart:io'; import 'dart:ui'; - import 'package:flutter/material.dart'; import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart'; import 'package:flutter_baidu_mapapi_map/flutter_baidu_mapapi_map.dart'; +import 'package:flutter_baidu_mapapi_utils/flutter_baidu_mapapi_utils.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/utils/flutter_utils.dart'; +import 'package:huixiang/utils/location.dart'; import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; - class LocationMap extends StatefulWidget { - final Map arguments; LocationMap({this.arguments}); @@ -20,15 +19,64 @@ class LocationMap extends StatefulWidget { State createState() { return _LocationMap(); } - } - class _LocationMap extends State { + @override + void initState() { + super.initState(); + + startLocation(); + } + + void startLocation() async { + Location.getInstance().aMapFlutterLocation.onResultCallback().listen((event) { + if (event != null && + event["latitude"] != null && + event["longitude"] != null) { + print("location: $event"); + if (event["latitude"] is String && event["longitude"] is String) { + myLatLng = BMFCoordinate(double.tryParse(event["latitude"]), + double.tryParse(event["longitude"])); + } else { + myLatLng = BMFCoordinate(event["latitude"], event["longitude"]); + } + AppUtils.coordConvert(myLatLng).then((value) { + this.myLatLng = value; + locationShow(); + }); + } + }); + Location.getInstance().prepareLoc(); + Location.getInstance().startLocation(context); + } + + locationShow() { + BMFLocation location = BMFLocation( + coordinate: myLatLng, + altitude: 0, + horizontalAccuracy: 5, + verticalAccuracy: -1.0, + speed: -1.0, + course: -1.0, + ); + BMFUserLocation userLocation = BMFUserLocation( + location: location, + ); + setState(() { + _mapController.updateLocationData(userLocation); + }); + } + + @override + void dispose() { + super.dispose(); + Location.getInstance().sotpLocation(); + } + @override Widget build(BuildContext context) { - latLng = BMFCoordinate(double.tryParse(widget.arguments["lat"]), double.tryParse(widget.arguments["lng"])); return Scaffold( appBar: MyAppBar( background: Color(0xFFF7F7F7), @@ -40,7 +88,10 @@ class _LocationMap extends State { body: Container( child: BMFMapWidget( mapOptions: BMFMapOptions( - center: latLng, + center: BMFCoordinate( + double.tryParse(widget.arguments["lat"]), + double.tryParse(widget.arguments["lng"]), + ), showZoomControl: false, showMapScaleBar: false, zoomLevel: 12, @@ -53,6 +104,7 @@ class _LocationMap extends State { BMFMapController _mapController; BMFCoordinate latLng; + BMFCoordinate myLatLng; BMFMarker bmfMarker; onMapCreated(BMFMapController controller) { @@ -60,29 +112,42 @@ class _LocationMap extends State { setState(() { _mapController.showUserLocation(true); _mapController.setCustomMapStyle('assets/map_style/chatian.sty', 0); - if (bmfMarker == null && _mapController != null) { - bmfMarker = BMFMarker( - position: latLng, - centerOffset: BMFPoint(0.5, 0.7), - enabled: false, - icon: "assets/image/icon_map_marker.png", - draggable: false, - ); - _mapController.addMarker(bmfMarker); - } - _mapController.updateMapOptions( - BMFMapOptions( - center: latLng, - zoomLevel: 15, - ), + BMFUserLocationDisplayParam displayParam = BMFUserLocationDisplayParam( + locationViewOffsetX: 0, + locationViewOffsetY: 0, + accuracyCircleFillColor: Colors.red, + accuracyCircleStrokeColor: Colors.blue, + isAccuracyCircleShow: true, + locationViewImage: 'assets/image/icon_my_location.png', + locationViewHierarchy: + BMFLocationViewHierarchy.LOCATION_VIEW_HIERARCHY_BOTTOM, ); + _mapController.updateLocationViewWithParam(displayParam); + addMarker(); }); } + addMarker() async { + // latLng = await AppUtils.coordConvert(BMFCoordinate(double.tryParse(widget.arguments["lat"]), + // double.tryParse(widget.arguments["lng"]))); + latLng = BMFCoordinate(double.tryParse(widget.arguments["lat"]), + double.tryParse(widget.arguments["lng"])); + + if (bmfMarker == null && _mapController != null) { + bmfMarker = BMFMarker( + position: latLng, + centerOffset: BMFPoint(0.5, 0.7), + enabled: false, + icon: "assets/image/icon_map_marker.png", + draggable: false, + ); + _mapController.addMarker(bmfMarker); + } + _mapController.updateMapOptions( + BMFMapOptions( + center: latLng, + zoomLevel: 15, + ), + ); + } } - - - - - - diff --git a/lib/union/store_details_page.dart b/lib/union/store_details_page.dart index c6d98697..430d996c 100644 --- a/lib/union/store_details_page.dart +++ b/lib/union/store_details_page.dart @@ -14,10 +14,12 @@ import 'package:huixiang/retrofit/data/article.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/view_widget/comment_menu.dart'; import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/login_tips.dart'; import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/share_dialog.dart'; +import 'package:huixiang/view_widget/tips_dialog.dart'; import 'package:like_button/like_button.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:shared_preferences/shared_preferences.dart'; @@ -214,18 +216,22 @@ class _StoreDetailsPage extends State return; } - BaseData baseData = - await apiService.commentLike(id).catchError((onError) {}); + BaseData baseData = await apiService.commentLike(id).catchError((onError) {}); if (baseData != null && baseData.isSuccess) { setState(() { memberList.forEach((element) { if (element.id == id) { - element.likes += 1; - element.liked = true; + if (element.liked) { + element.likes -= 1; + element.liked = false; + } else { + element.likes += 1; + element.liked = true; + } } }); }); - } else { + }/* else { if (baseData.msg == "您已点过赞") { setState(() { memberList.forEach((element) { @@ -234,9 +240,8 @@ class _StoreDetailsPage extends State } }); }); - } else - SmartDialog.showToast(baseData.msg, alignment: Alignment.center); - } + } else SmartDialog.showToast(baseData.msg, alignment: Alignment.center); + }*/ } //给文章/活动点赞 @@ -458,23 +463,27 @@ class _StoreDetailsPage extends State child: Row( children: [ Text( - S - .of(context) - .pinglun_(commentTotal.toString()), - style: TextStyle( - fontSize: 16.sp, - fontWeight: FontWeight.bold, - color: Color(0xff1A1A1A))), + S + .of(context) + .pinglun_(commentTotal.toString()), + style: TextStyle( + fontSize: 16.sp, + fontWeight: FontWeight.bold, + color: Color(0xff1A1A1A), + ), + ), SizedBox( width: 16.w, ), Text( - S.of(context).xihuan_( - "${article?.likes ?? activity?.likes ?? "0"}"), - style: TextStyle( - fontSize: 16.sp, - fontWeight: FontWeight.bold, - color: Color(0xff1A1A1A))), + S.of(context).xihuan_( + "${article?.likes ?? activity?.likes ?? "0"}"), + style: TextStyle( + fontSize: 16.sp, + fontWeight: FontWeight.bold, + color: Color(0xff1A1A1A), + ), + ), ], ), ), @@ -485,18 +494,17 @@ class _StoreDetailsPage extends State memberList != null ? memberList.length : 0, scrollDirection: Axis.vertical, itemBuilder: (context, position) { - return GestureDetector( - onTap: () {}, - child: commentItem(memberList[position], - position, memberList.length, () { - FocusScope.of(context) - .requestFocus(commentFocus); - parenId = memberList[position].id; - setState(() { - hintText = S.of(context).huifu_( - "${memberList[position].username}"); - }); - }), + return Material( + color: Colors.white, + child: InkWell( + onTap: () { + showPressMenu( + memberList[position].createUser, + memberList[position]); + }, + child: commentItem(memberList[position], + position, memberList.length), + ), ); }, ), @@ -519,6 +527,48 @@ class _StoreDetailsPage extends State ); } + showPressMenu(String userId, memberComment) { + if (isKeyBoardShow) { + setState(() { + hintText = S.of(context).liuxianinjingcaidepinglunba; + }); + FocusScope.of(context).requestFocus(FocusNode()); + return; + } + SharedPreferences.getInstance().then((value) { + showModalBottomSheet( + context: context, + backgroundColor: Colors.transparent, + builder: (context) { + return CommentMenu( + (type) { + print("click: $type"); + if (type == "huifu") { + reply(memberComment); + } else if (type == "shanchu") { + delComment(); + } + }, + isSelf: userId == value.getString("userId"), + ); + }); + }); + } + + delComment() { + SmartDialog.show(widget: Tips(() { + SmartDialog.dismiss(); + })); + } + + reply(memberComment) { + FocusScope.of(context).requestFocus(commentFocus); + parenId = memberComment.id; + setState(() { + hintText = S.of(context).huifu_("${memberComment.username}"); + }); + } + Widget commentWidget() { return Container( padding: EdgeInsets.all(16), @@ -530,9 +580,9 @@ class _StoreDetailsPage extends State offset: Offset(0, 2), blurRadius: 14, spreadRadius: 0, - ) + ), ], - borderRadius: new BorderRadius.only( + borderRadius: BorderRadius.only( topLeft: Radius.circular(8.0), topRight: Radius.circular(8.0), ), @@ -549,7 +599,7 @@ class _StoreDetailsPage extends State child: Column( children: [ Container( - margin: const EdgeInsets.fromLTRB(4, 0, 4, 0), + margin: EdgeInsets.fromLTRB(4, 0, 4, 0), alignment: Alignment.topLeft, child: TextField( maxLines: 8, @@ -660,8 +710,7 @@ class _StoreDetailsPage extends State ); } - Widget commentItem(MemberCommentList memberList, int index, int max, - GestureTapCallback callback) { + Widget commentItem(MemberCommentList memberList, int index, int max) { return Container( padding: EdgeInsets.symmetric(vertical: 8.w), child: Column( @@ -750,7 +799,7 @@ class _StoreDetailsPage extends State await queryCommentLike(memberList.id); return (memberList == null || memberList.liked == null) ? false - : memberList.liked; + : !memberList.liked; }, likeCount: memberList.likes, countBuilder: (int count, bool isLiked, String text) { @@ -768,26 +817,15 @@ class _StoreDetailsPage extends State ), ), Container( - padding: EdgeInsets.only( - left: 68, - right: 16, - ), - child: Material( - color: Colors.white, - child: InkWell( - onTap: callback, - child: Container( - padding: EdgeInsets.symmetric(vertical: 16.h), - child: Align( - alignment: Alignment.centerLeft, - child: Text( - memberList.content, - style: TextStyle( - fontSize: 14.sp, - color: Color(0xff1A1A1A), - ), - ), - ), + padding: + EdgeInsets.only(left: 68, right: 16, top: 16.h, bottom: 16.h), + child: Align( + alignment: Alignment.centerLeft, + child: Text( + memberList.content, + style: TextStyle( + fontSize: 14.sp, + color: Color(0xff1A1A1A), ), ), ), diff --git a/lib/union/union_details_page.dart b/lib/union/union_details_page.dart index dc888043..3c48befc 100644 --- a/lib/union/union_details_page.dart +++ b/lib/union/union_details_page.dart @@ -174,7 +174,7 @@ class _UnionDetailsPage extends State { ), ), ), - ) + ), ], ), Text( @@ -202,21 +202,23 @@ class _UnionDetailsPage extends State { CrossAxisAlignment.end, children: [ Expanded( - child: Text( - S.of(context).yingyeshijian(storeInfo == - null - ? "" - : (storeInfo.openStartTime == - null && - storeInfo.openEndTime == - null) - ? S.of(context).quantian - : "${storeInfo.openStartTime.substring(0, storeInfo.openStartTime.lastIndexOf(":"))} - ${storeInfo.openEndTime.substring(0, storeInfo.openEndTime.lastIndexOf(":"))}"), - style: TextStyle( - color: Color(0xFF353535), - fontSize: 12.sp, + child: Text( + S.of(context).yingyeshijian(storeInfo == + null + ? "" + : (storeInfo.openStartTime == + null && + storeInfo + .openEndTime == + null) + ? S.of(context).quantian + : "${storeInfo.openStartTime.substring(0, storeInfo.openStartTime.lastIndexOf(":"))} - ${storeInfo.openEndTime.substring(0, storeInfo.openEndTime.lastIndexOf(":"))}"), + style: TextStyle( + color: Color(0xFF353535), + fontSize: 12.sp, + ), ), - )), + ), SizedBox( width: 16.w, ), @@ -255,14 +257,14 @@ class _UnionDetailsPage extends State { width: 24.w, height: 24.h, ), - ) + ), ], ), ], ), ), flex: 1, - ) + ), ], ), ), @@ -392,64 +394,71 @@ class _UnionDetailsPage extends State { mainAxisAlignment: MainAxisAlignment.spaceAround, crossAxisAlignment: CrossAxisAlignment.center, children: [ - Row( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.baseline, - textBaseline: TextBaseline.alphabetic, - children: [ - Text( - S.of(context).huiyuanyue, - style: TextStyle( - fontSize: 16.sp, - fontWeight: FontWeight.bold, - color: Colors.white, + Expanded( + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.baseline, + textBaseline: TextBaseline.alphabetic, + children: [ + Text( + S.of(context).huiyuanyue, + style: TextStyle( + fontSize: 16.sp, + fontWeight: FontWeight.bold, + color: Colors.white, + ), ), - ), - SizedBox( - width: 8.w, - ), - Text( - "¥${(storeInfo != null && storeInfo.memberSource != null) ? storeInfo.memberSource.balance : ""}", - style: TextStyle( - fontSize: 14.sp, - fontWeight: FontWeight.bold, - color: Colors.white, + SizedBox( + width: 8.w, ), - ), - ], + Text( + "¥${(storeInfo != null && storeInfo.memberSource != null) ? storeInfo.memberSource.balance : ""}", + style: TextStyle( + fontSize: 14.sp, + fontWeight: FontWeight.bold, + color: Colors.white, + ), + ), + ], + ), + flex: 1, ), Container( color: Colors.white, width: 1.w, height: 20.h, ), - Row( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.baseline, - textBaseline: TextBaseline.alphabetic, - children: [ - Text( - S.of(context).huiyuanjifen, - style: TextStyle( - fontSize: 16.sp, - fontWeight: FontWeight.bold, - color: Colors.white, + Expanded( + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.baseline, + textBaseline: TextBaseline.alphabetic, + children: [ + Text( + S.of(context).huiyuanjifen, + style: TextStyle( + fontSize: 16.sp, + fontWeight: FontWeight.bold, + color: Colors.white, + ), ), - ), - SizedBox( - width: 8.w, - ), - Text( - (storeInfo != null && storeInfo.memberSource != null) - ? "${storeInfo.memberSource.integral}" - : "", - style: TextStyle( - fontSize: 14.sp, - fontWeight: FontWeight.bold, - color: Colors.white, + SizedBox( + width: 8.w, ), - ), - ], + Text( + (storeInfo != null && + storeInfo.memberSource != null) + ? "${storeInfo.memberSource.integral}" + : "", + style: TextStyle( + fontSize: 14.sp, + fontWeight: FontWeight.bold, + color: Colors.white, + ), + ), + ], + ), + flex: 1, ), ], ), @@ -711,7 +720,7 @@ class _UnionDetailsPage extends State { ), ], ), - ) + ), ], ), ), diff --git a/lib/union/union_page.dart b/lib/union/union_page.dart index 62d085ad..63470a74 100644 --- a/lib/union/union_page.dart +++ b/lib/union/union_page.dart @@ -17,6 +17,7 @@ import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/store.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/utils/event_type.dart'; +import 'package:huixiang/utils/location.dart'; import 'package:huixiang/view_widget/classic_header.dart'; import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/icon_text.dart'; @@ -38,15 +39,14 @@ class UnionPage extends StatefulWidget { class _UnionPage extends State with AutomaticKeepAliveClientMixin, WidgetsBindingObserver { - LocationFlutterPlugin aMapFlutterLocation; - RefreshController refreshController = - RefreshController(initialRefresh: false); + + RefreshController refreshController = RefreshController(initialRefresh: false); @override void dispose() { super.dispose(); WidgetsBinding.instance.removeObserver(this); - aMapFlutterLocation.stopLocation(); + Location.getInstance().aMapFlutterLocation.stopLocation(); refreshController.dispose(); } @@ -77,76 +77,58 @@ class _UnionPage extends State @override void initState() { super.initState(); - WidgetsBinding.instance.addObserver(this); - if (aMapFlutterLocation == null) { - aMapFlutterLocation = LocationFlutterPlugin(); - aMapFlutterLocation.onResultCallback().listen((event) { - if (event != null && - event["latitude"] != null && - event["longitude"] != null) { - print("location: $event"); - if (event["latitude"] is String && event["longitude"] is String) { - latLng = BMFCoordinate(double.tryParse(event["latitude"]), - double.tryParse(event["longitude"])); - } else { - latLng = BMFCoordinate(event["latitude"], event["longitude"]); - } - BMFCalculateUtils.coordConvert( - coordinate: latLng, - fromType: BMF_COORD_TYPE.COMMON, - toType: BMF_COORD_TYPE.BD09LL) - .then((value) { - this.latLng = value; - saveLatLng( - value, event["province"], event["city"], event["district"]); - queryStore( - "${value.latitude}", - "${value.longitude}", - event["province"], - event["city"], - event["district"], - editingController.text); - if (_mapController != null) - _mapController.updateMapOptions(BMFMapOptions( - center: value, - zoomLevel: 15, - )); - }); - } - }); - - eventBus.on().listen((event) { - print("object: UnionPage"); - if (event.type < 3) { - setState(() {}); + Location.getInstance().aMapFlutterLocation.onResultCallback().listen((event) { + print("value: "); + if (event != null && + event["latitude"] != null && + event["longitude"] != null) { + print("location: $event"); + if (event["latitude"] is String && event["longitude"] is String) { + latLng = BMFCoordinate(double.tryParse(event["latitude"]), + double.tryParse(event["longitude"])); + } else { + latLng = BMFCoordinate(event["latitude"], event["longitude"]); } - }); - } + BMFCalculateUtils.coordConvert( + coordinate: latLng, + fromType: BMF_COORD_TYPE.BD09LL, + toType: BMF_COORD_TYPE.COMMON) + .then((value) { + this.latLng = value; + saveLatLng( + value, event["province"], event["city"], event["district"]); + print("value: ${value.latitude} " + "${value.longitude}",); + queryStore( + "${value.latitude}", + "${value.longitude}", + event["province"], + event["city"], + event["district"], + editingController.text); + if (_mapController != null) + _mapController.updateMapOptions(BMFMapOptions( + center: value, + zoomLevel: 15, + )); + }); + } + }); - aMapFlutterLocation.prepareLoc({ - "coorType": "bd09ll", - "isNeedAddres": false, - "isNeedAltitude": false, - "isNeedLocationPoiList": false, - "isNeedLocationDescribe": false, - "isNeedNewVersionRgc": false, - "scanspan": 0, - "openGps": true, - "locationMode": 2, - }, { - "locationMode": "kCLLocationAccuracyBest", - "locationTimeout": 10, - "reGeocodeTimeout": 10, - "activityType": "CLActivityTypeAutomotiveNavigation", - "BMKLocationCoordinateType": "BMKLocationCoordinateTypeBMK09LL", - "BMKLocationCoordinateType": "BMKLocationCoordinateTypeBMK09LL", - "isNeedNewVersionRgc": false, + eventBus.on().listen((event) { + print("object: UnionPage"); + if (event.type < 3) { + setState(() {}); + } }); getLatLng(); - startLocation(); + Location.getInstance().prepareLoc(); + Location.getInstance().startLocation(context).then((value) { + refreshController.refreshCompleted(); + }); } BMFCoordinate latLng; @@ -224,24 +206,8 @@ class _UnionPage extends State } else { refreshController.refreshFailed(); } - // _mapController.setCustomMapStyle('assets/map_style/chatian.sty', 0); } - // buildMarker() async { - // markers.clear(); - // markers.addAll(storeList.map((element) => BMFMarker( - // position: BMFCoordinate(double.tryParse(element.latitude), - // double.tryParse(element.longitude)), - // centerOffset: BMFPoint(0.5, 0.9), - // enabled: false, - // icon: "assets/image/icon_map_marker.png", - // draggable: false, - // ))); - // if (mounted) setState(() {}); - // } - // - // List markers = []; - @override Widget build(BuildContext context) { super.build(context); @@ -271,44 +237,6 @@ class _UnionPage extends State buildItem(), ], ), - // body: NestedScrollView( - // physics: PageScrollPhysics(), - // headerSliverBuilder: (context, inner) { - // return [ - // SliverOverlapAbsorber( - // sliver: buildSliverAppBar(BMFMapWidget( - // mapOptions: BMFMapOptions( - // center: BMFCoordinate(30.553111, 114.342366), - // zoomLevel: 12, - // ), - // onBMFMapCreated: onMapCreated, - // // customStyleOptions: _customStyleOptions, - // // gestureRecognizers: >[ - // // Factory( - // // () => EagerGestureRecognizer()), - // // ].toSet(), - // )), - // handle: - // NestedScrollView.sliverOverlapAbsorberHandleFor(context), - // ) - // ]; - // }, - // body: Builder( - // builder: (context) { - // return CustomScrollView( - // physics: NeverScrollableScrollPhysics(), - // slivers: [ - // SliverOverlapInjector( - // handle: NestedScrollView.sliverOverlapAbsorberHandleFor( - // context), - // ), - // SliverToBoxAdapter( - // child: - // ), - // ], - // ); - // }, - // ),), ), ); } @@ -325,7 +253,10 @@ class _UnionPage extends State physics: BouncingScrollPhysics(), header: MyHeader(), onRefresh: () { - startLocation(); + print("object: ${Location.getInstance().aMapFlutterLocation == null}"); + Location.getInstance().startLocation(context).then((value) { + refreshController.refreshCompleted(); + }); }, child: ListView.builder( itemCount: storeList == null ? 0 : storeList.length, @@ -346,85 +277,6 @@ class _UnionPage extends State ); } - startLocation() async { - if (!(await Permission.locationWhenInUse.serviceStatus.isEnabled)) { - enableLocation(); - refreshController.refreshCompleted(); - return; - } - - if (await Permission.location.isPermanentlyDenied) { - requestDialog(); - refreshController.refreshCompleted(); - } else if (await Permission.location.isGranted) { - SmartDialog.showLoading( - msg: S.of(context).zhengzaijiazai, - animationDurationTemp: Duration(seconds: 1)); - aMapFlutterLocation.startLocation(); - Future.delayed(Duration(seconds: 6), () { - SmartDialog.dismiss(); - refreshController.refreshCompleted(); - }); - } else if (await Permission.location.isUndetermined) { - await Permission.location.request(); - refreshController.refreshCompleted(); - } else { - if (Platform.isIOS) { - //去设置中心 - requestDialog(); - } else { - await Permission.location.request(); - } - refreshController.refreshCompleted(); - } - } - - enableLocation() { - showCupertinoDialog( - context: context, - builder: (context) { - return RequestPermission( - "assets/image/icon_permission_location_bg.png", - S.of(context).nindingweigongnengweikaiqi, - S.of(context).weilexiangnintuijianfujindemendianxinxi, - S.of(context).dakaidingwei, - (result) async { - if (result) { - final AndroidIntent intent = AndroidIntent( - action: 'action_location_source_settings', - package: "com.zsw.huixiang"); - await intent.launch(); - // startLocation(); - } - }, - heightRatioWithWidth: 0.82, - ); - }, - ); - } - - requestDialog() { - showCupertinoDialog( - context: context, - builder: (context) { - return RequestPermission( - "assets/image/icon_permission_location_bg.png", - S.of(context).nindingweiquanxianweiyunxu, - S.of(context).weilexiangnintuijianfujindemendianxinxi, - S.of(context).kaiqiquanxian, - (result) async { - if (result) { - await openAppSettings(); - if (await Permission.location.isGranted) { - startLocation(); - } - } - }, - heightRatioWithWidth: 0.82, - ); - }); - } - BMFMapController _mapController; TextEditingController editingController = TextEditingController(); @@ -452,7 +304,9 @@ class _UnionPage extends State child: TextField( textInputAction: TextInputAction.search, onEditingComplete: () { - startLocation(); + Location.getInstance().startLocation(context).then((value) { + refreshController.refreshCompleted(); + }); }, controller: editingController, cursorHeight: 30.h, diff --git a/lib/utils/flutter_utils.dart b/lib/utils/flutter_utils.dart index 7aea7957..6c6d7da4 100644 --- a/lib/utils/flutter_utils.dart +++ b/lib/utils/flutter_utils.dart @@ -1,11 +1,19 @@ import 'dart:io'; import 'package:flutter/cupertino.dart'; +import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart'; +import 'package:flutter_baidu_mapapi_utils/flutter_baidu_mapapi_utils.dart'; import 'package:intl/intl.dart'; import 'package:path_provider/path_provider.dart'; class AppUtils { + static Future coordConvert(BMFCoordinate latLng) async { + return BMFCalculateUtils.coordConvert( + coordinate: latLng, + fromType: BMF_COORD_TYPE.BD09LL, + toType: BMF_COORD_TYPE.COMMON); + } static double textScale(context) { double textScaleFactor = MediaQuery.of(context).textScaleFactor; diff --git a/lib/utils/location.dart b/lib/utils/location.dart new file mode 100644 index 00000000..0468b758 --- /dev/null +++ b/lib/utils/location.dart @@ -0,0 +1,132 @@ + + + +import 'dart:io'; + +import 'package:android_intent_plus/android_intent.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter_bmflocation/bdmap_location_flutter_plugin.dart'; +import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/view_widget/request_permission.dart'; +import 'package:permission_handler/permission_handler.dart'; + +class Location { + + static Location _instance; + + Location._internal() { + aMapFlutterLocation = LocationFlutterPlugin(); + } + + static Location getInstance() { + if (_instance == null) { + _instance = Location._internal(); + } + return _instance; + } + + LocationFlutterPlugin aMapFlutterLocation; + + prepareLoc() { + aMapFlutterLocation.prepareLoc({ + "coorType": "bd09ll", + "isNeedAddres": false, + "isNeedAltitude": false, + "isNeedLocationPoiList": false, + "isNeedLocationDescribe": false, + "isNeedNewVersionRgc": false, + "scanspan": 0, + "openGps": true, + "locationMode": 2, + }, { + "locationMode": "kCLLocationAccuracyBest", + "locationTimeout": 10, + "reGeocodeTimeout": 10, + "activityType": "CLActivityTypeAutomotiveNavigation", + "BMKLocationCoordinateType": "BMKLocationCoordinateTypeBMK09LL", + "isNeedNewVersionRgc": false, + }); + } + + Future startLocation(context) async { + if (!(await Permission.locationWhenInUse.serviceStatus.isEnabled)) { + enableLocation(context); + print("object1111"); + return; + } + if (await Permission.location.isPermanentlyDenied) { + requestDialog(context); + print("object2222"); + } else if (await Permission.location.isGranted) { + aMapFlutterLocation.startLocation(); + print("object3333"); + } else if (await Permission.location.isUndetermined) { + await Permission.location.request(); + print("object44444"); + } else { + print("object5555"); + if (Platform.isIOS) { + //去设置中心 + requestDialog(context); + } else { + await Permission.location.request(); + } + } + } + + void sotpLocation() { + aMapFlutterLocation.stopLocation(); + } + + enableLocation(context) { + showCupertinoDialog( + context: context, + builder: (context) { + return RequestPermission( + "assets/image/icon_permission_location_bg.png", + S.of(context).nindingweigongnengweikaiqi, + S.of(context).weilexiangnintuijianfujindemendianxinxi, + S.of(context).dakaidingwei, + (result) async { + if (result) { + final AndroidIntent intent = AndroidIntent( + action: 'action_location_source_settings', + package: "com.zsw.huixiang"); + await intent.launch(); + // startLocation(); + } + }, + heightRatioWithWidth: 0.82, + ); + }, + ); + } + + requestDialog(context) { + showCupertinoDialog( + context: context, + builder: (context) { + return RequestPermission( + "assets/image/icon_permission_location_bg.png", + S.of(context).nindingweiquanxianweiyunxu, + S.of(context).weilexiangnintuijianfujindemendianxinxi, + S.of(context).kaiqiquanxian, + (result) async { + if (result) { + await openAppSettings(); + if (await Permission.location.isGranted) { + startLocation(context); + } + } + }, + heightRatioWithWidth: 0.82, + ); + }); + } + +} + + + + + diff --git a/lib/view_widget/comment_menu.dart b/lib/view_widget/comment_menu.dart new file mode 100644 index 00000000..947c30c8 --- /dev/null +++ b/lib/view_widget/comment_menu.dart @@ -0,0 +1,99 @@ +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:flutter/material.dart'; +import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/view_widget/separator.dart'; + +class CommentMenu extends StatefulWidget { + final bool isSelf; + + final Function(String type) clickType; + + CommentMenu( + this.clickType, { + this.isSelf = false, + }); + + @override + State createState() { + return _CommentMenu(); + } +} + +class _CommentMenu extends State { + @override + Widget build(BuildContext context) { + return Container( + height: widget.isSelf ? 224.h : 164.h, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.vertical(top: Radius.circular(8)), + ), + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + InkWell( + onTap: () { + Navigator.of(context).pop(); + widget.clickType("huifu"); + }, + child: Container( + padding: EdgeInsets.all(20.h), + child: Text( + S.of(context).huifu, + style: TextStyle( + fontWeight: MyFontWeight.medium, + fontSize: 16.sp, + color: Color(0xFF353535), + ), + ), + ), + ), + Container( + height: 1.h, + color: Color(0xFFF7F7F7), + ), + if (widget.isSelf) + InkWell( + onTap: () { + Navigator.of(context).pop(); + widget.clickType("shanchu"); + }, + child: Container( + padding: EdgeInsets.all(20.h), + child: Text( + S.of(context).shanchu, + style: TextStyle( + fontWeight: MyFontWeight.medium, + fontSize: 16.sp, + color: Color(0xFF353535), + ), + ), + ), + ), + if (widget.isSelf) + Container( + height: 1.h, + color: Color(0xFFF7F7F7), + ), + InkWell( + onTap: () { + Navigator.of(context).pop(); + }, + child: Container( + padding: EdgeInsets.all(20.h), + child: Text( + S.of(context).quxiao, + style: TextStyle( + fontWeight: MyFontWeight.medium, + fontSize: 16.sp, + color: Color(0xFF727272), + ), + ), + ), + ), + ], + ), + ); + } +} diff --git a/lib/view_widget/store_title_tab.dart b/lib/view_widget/store_title_tab.dart index 68ab45db..2547ecfc 100644 --- a/lib/view_widget/store_title_tab.dart +++ b/lib/view_widget/store_title_tab.dart @@ -116,6 +116,7 @@ class _StoreTitleTab extends State { } scrollTab(index) { + if (_globalKeys[index].currentContext == null) return; RenderBox renderBox = _globalKeys[index].currentContext.findRenderObject(); Offset nextOffset = renderBox?.localToGlobal(Offset.zero); double widgetWidth = renderBox.size.width; diff --git a/lib/view_widget/tips_dialog.dart b/lib/view_widget/tips_dialog.dart new file mode 100644 index 00000000..793a1671 --- /dev/null +++ b/lib/view_widget/tips_dialog.dart @@ -0,0 +1,105 @@ +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:flutter/material.dart'; +import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/utils/font_weight.dart'; + +class Tips extends StatefulWidget { + final Function tips; + + Tips(this.tips); + + @override + State createState() { + return _Tips(); + } +} + +class _Tips extends State { + @override + Widget build(BuildContext context) { + return Material( + type: MaterialType.transparency, + child: Center( + child: Container( + width: MediaQuery.of(context).size.width - 80.w, + height: 146.h, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + ), + child: Column( + children: [ + Container( + width: double.infinity, + height: 90.h, + alignment: Alignment.center, + child: Text( + S.of(context).querenyaoshanchudangqianpinglunma, + style: TextStyle( + fontSize: 17.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF353535), + ), + ), + ), + Container( + color: Color(0x1A000000), + height: 1.h, + ), + Container( + height: 55.h, + child: Row( + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + child: InkWell( + onTap: widget.tips, + child: Container( + width: double.infinity, + height: 90.h, + alignment: Alignment.center, + child: Text( + S.of(context).quxiao, + style: TextStyle( + fontSize: 17.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF353535), + ), + ), + ), + ), + flex: 1, + ), + Container( + color: Color(0x1A000000), + width: 1.h, + ), + Expanded( + child: InkWell( + onTap: widget.tips, + child: Container( + width: double.infinity, + height: 90.h, + alignment: Alignment.center, + child: Text( + S.of(context).queren, + style: TextStyle( + fontSize: 17.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF32A060), + ), + ), + ), + ), + flex: 1, + ), + ], + ), + ), + ], + ), + ), + ), + ); + } +}