diff --git a/assets/image/2x/icon_my_location.webp b/assets/image/2x/icon_my_location.webp new file mode 100644 index 00000000..5de6f82a Binary files /dev/null and b/assets/image/2x/icon_my_location.webp differ diff --git a/assets/image/3x/icon_my_location.webp b/assets/image/3x/icon_my_location.webp new file mode 100644 index 00000000..823454c8 Binary files /dev/null and b/assets/image/3x/icon_my_location.webp differ diff --git a/assets/image/icon_my_location.webp b/assets/image/icon_my_location.webp new file mode 100644 index 00000000..85b1d633 Binary files /dev/null and b/assets/image/icon_my_location.webp differ 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, + ), + ], + ), + ), + ], + ), + ), + ), + ); + } +}