修复重复发送订单的bug

master
章文轩 2 years ago
parent ca167b983b
commit 6daab5f969

@ -123,16 +123,27 @@ class _ChatKFPageState extends State<ChatKFPage>
// String lastGoods = ''; // String lastGoods = '';
@override submit(){
void initState() {
BytedeskUtils.goodsInfo.addListener(() {
print('发生改变!!!!!!!!!!'); print('发生改变!!!!!!!!!!');
print('customGoods'+customGoods); print('customGoods'+customGoods);
print('BytedeskUtils.goodsInfo.value'+BytedeskUtils.goodsInfo.value); print('BytedeskUtils.goodsInfo.value'+BytedeskUtils.goodsInfo.value);
if(customGoods==BytedeskUtils.goodsInfo.value)
return;
customGoods = BytedeskUtils.goodsInfo.value; customGoods = BytedeskUtils.goodsInfo.value;
print('BytedeskUtils.goodsInfo.value'+BytedeskUtils.goodsInfo.value); print('BytedeskUtils.goodsInfo.value'+BytedeskUtils.goodsInfo.value);
_goodsSubmitted(); _goodsSubmitted();
}
@override
void initState() {
BytedeskUtils.goodsInfo.addListener(() {
submit;
}); });
@ -687,7 +698,7 @@ class _ChatKFPageState extends State<ChatKFPage>
// //
handleCaptureVideo: _handleCaptureVideo, handleCaptureVideo: _handleCaptureVideo,
handleShowOrders: _handleShowOrders, handleShowOrders: widget.btnBack==null?null: _handleShowOrders,
), ),
); );
} }
@ -1544,6 +1555,7 @@ class _ChatKFPageState extends State<ChatKFPage>
_debounce?.cancel(); _debounce?.cancel();
_loadHistoryTimer?.cancel(); _loadHistoryTimer?.cancel();
_resendTimer?.cancel(); _resendTimer?.cancel();
BytedeskUtils.goodsInfo.removeListener(() { submit;});
// bytedeskEventBus.destroy(); // FIXME: destroy // bytedeskEventBus.destroy(); // FIXME: destroy
super.dispose(); super.dispose();
} }

@ -129,7 +129,7 @@ class _ExtraItemsState extends State<ExtraItems> {
Row( Row(
children: [ children: [
// TODO: // TODO:
ExtraItem( widget.handleShowOrders==null?SizedBox(): ExtraItem(
title: "发送订单", title: "发送订单",
image: AssetImage('assets/images/chat/extra_wallet.png'), image: AssetImage('assets/images/chat/extra_wallet.png'),
onPressed: widget.handleShowOrders, onPressed: widget.handleShowOrders,

Loading…
Cancel
Save