From 6daab5f969ec0fe6918a8b3621ece5c0963a19cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=AB=A0=E6=96=87=E8=BD=A9?= <12812285557@qq.com> Date: Thu, 18 Aug 2022 17:18:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=87=8D=E5=A4=8D=E5=8F=91?= =?UTF-8?q?=E9=80=81=E8=AE=A2=E5=8D=95=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lib/ui/chat/page/chat_kf_page.dart | 26 ++++++++++++++----- bytedesk_kefu/lib/ui/widget/extra_item.dart | 2 +- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/bytedesk_kefu/lib/ui/chat/page/chat_kf_page.dart b/bytedesk_kefu/lib/ui/chat/page/chat_kf_page.dart index b44c342..506e348 100755 --- a/bytedesk_kefu/lib/ui/chat/page/chat_kf_page.dart +++ b/bytedesk_kefu/lib/ui/chat/page/chat_kf_page.dart @@ -123,16 +123,27 @@ class _ChatKFPageState extends State // String lastGoods = ''; + submit(){ + print('发生改变!!!!!!!!!!'); + print('customGoods'+customGoods); + print('BytedeskUtils.goodsInfo.value'+BytedeskUtils.goodsInfo.value); + if(customGoods==BytedeskUtils.goodsInfo.value) + return; + customGoods = BytedeskUtils.goodsInfo.value; + print('BytedeskUtils.goodsInfo.value'+BytedeskUtils.goodsInfo.value); + + + _goodsSubmitted(); + } + @override void initState() { BytedeskUtils.goodsInfo.addListener(() { - print('发生改变!!!!!!!!!!'); - print('customGoods'+customGoods); - print('BytedeskUtils.goodsInfo.value'+BytedeskUtils.goodsInfo.value); - customGoods = BytedeskUtils.goodsInfo.value; - print('BytedeskUtils.goodsInfo.value'+BytedeskUtils.goodsInfo.value); - _goodsSubmitted(); + + submit; + + }); @@ -687,7 +698,7 @@ class _ChatKFPageState extends State // 录制视频 handleCaptureVideo: _handleCaptureVideo, - handleShowOrders: _handleShowOrders, + handleShowOrders: widget.btnBack==null?null: _handleShowOrders, ), ); } @@ -1544,6 +1555,7 @@ class _ChatKFPageState extends State _debounce?.cancel(); _loadHistoryTimer?.cancel(); _resendTimer?.cancel(); + BytedeskUtils.goodsInfo.removeListener(() { submit;}); // bytedeskEventBus.destroy(); // FIXME: 只能取消监听,不能destroy super.dispose(); } diff --git a/bytedesk_kefu/lib/ui/widget/extra_item.dart b/bytedesk_kefu/lib/ui/widget/extra_item.dart index 51b2008..ea75c1f 100644 --- a/bytedesk_kefu/lib/ui/widget/extra_item.dart +++ b/bytedesk_kefu/lib/ui/widget/extra_item.dart @@ -129,7 +129,7 @@ class _ExtraItemsState extends State { Row( children: [ // TODO: 选择文件 - ExtraItem( + widget.handleShowOrders==null?SizedBox(): ExtraItem( title: "发送订单", image: AssetImage('assets/images/chat/extra_wallet.png'), onPressed: widget.handleShowOrders,