|
|
@ -119,12 +119,14 @@ class _ChatKFPageState extends State<ChatKFPage>
|
|
|
|
String goodPrice = '';
|
|
|
|
String goodPrice = '';
|
|
|
|
String goodUrl = '';
|
|
|
|
String goodUrl = '';
|
|
|
|
bool showGood = false;
|
|
|
|
bool showGood = false;
|
|
|
|
|
|
|
|
String customGoods = '';
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
void initState() {
|
|
|
|
if (widget.custom != null &&
|
|
|
|
customGoods = widget.custom??'';
|
|
|
|
widget.custom!.trim().length > 0){
|
|
|
|
if (
|
|
|
|
|
|
|
|
customGoods.trim().length > 0){
|
|
|
|
showGood = true;
|
|
|
|
showGood = true;
|
|
|
|
Map<String, dynamic> json = jsonDecode(widget.custom??"");
|
|
|
|
Map<String, dynamic> json = jsonDecode(customGoods);
|
|
|
|
json.forEach((key, value) {
|
|
|
|
json.forEach((key, value) {
|
|
|
|
//typeOne等所对应的数组数据
|
|
|
|
//typeOne等所对应的数组数据
|
|
|
|
if(key=='title'){
|
|
|
|
if(key=='title'){
|
|
|
@ -216,7 +218,11 @@ class _ChatKFPageState extends State<ChatKFPage>
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
super.build(context);
|
|
|
|
super.build(context);
|
|
|
|
//
|
|
|
|
//
|
|
|
|
return Scaffold (
|
|
|
|
return GestureDetector(
|
|
|
|
|
|
|
|
onTap: (){
|
|
|
|
|
|
|
|
FocusScope.of(context).requestFocus(FocusNode());
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
child: Scaffold (
|
|
|
|
appBar: AppBar(
|
|
|
|
appBar: AppBar(
|
|
|
|
title: Text(_title ?? '请求中, 请稍后...',style: TextStyle(color: Color(0xFF333333),fontSize: 16),),
|
|
|
|
title: Text(_title ?? '请求中, 请稍后...',style: TextStyle(color: Color(0xFF333333),fontSize: 16),),
|
|
|
|
backgroundColor: Colors.white,
|
|
|
|
backgroundColor: Colors.white,
|
|
|
@ -598,7 +604,7 @@ class _ChatKFPageState extends State<ChatKFPage>
|
|
|
|
SizedBox(width: 30,),
|
|
|
|
SizedBox(width: 30,),
|
|
|
|
GestureDetector(
|
|
|
|
GestureDetector(
|
|
|
|
onTap: (){
|
|
|
|
onTap: (){
|
|
|
|
showGood = false;
|
|
|
|
//showGood = false;
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
_goodsSubmitted();
|
|
|
|
_goodsSubmitted();
|
|
|
@ -633,7 +639,8 @@ class _ChatKFPageState extends State<ChatKFPage>
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),):SizedBox(),
|
|
|
|
),):SizedBox(),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
)));
|
|
|
|
))),
|
|
|
|
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Widget _chatInput() {
|
|
|
|
Widget _chatInput() {
|
|
|
@ -690,6 +697,8 @@ class _ChatKFPageState extends State<ChatKFPage>
|
|
|
|
print('_handleShowOrders');
|
|
|
|
print('_handleShowOrders');
|
|
|
|
if(widget.customCallback!=null){
|
|
|
|
if(widget.customCallback!=null){
|
|
|
|
widget.customCallback!('点击订单');
|
|
|
|
widget.customCallback!('点击订单');
|
|
|
|
|
|
|
|
customGoods = BytedeskUtils.goodsInfo;
|
|
|
|
|
|
|
|
_goodsSubmitted();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -784,9 +793,9 @@ class _ChatKFPageState extends State<ChatKFPage>
|
|
|
|
|
|
|
|
|
|
|
|
// 发送商品消息
|
|
|
|
// 发送商品消息
|
|
|
|
void _goodsSubmitted() {
|
|
|
|
void _goodsSubmitted() {
|
|
|
|
|
|
|
|
print(customGoods);
|
|
|
|
if (widget.custom != null &&
|
|
|
|
if (
|
|
|
|
widget.custom!.trim().length > 0) {
|
|
|
|
customGoods.trim().length > 0) {
|
|
|
|
|
|
|
|
|
|
|
|
if (_bdMqtt.isConnected()) {
|
|
|
|
if (_bdMqtt.isConnected()) {
|
|
|
|
if (_currentThread == null) {
|
|
|
|
if (_currentThread == null) {
|
|
|
@ -795,7 +804,7 @@ class _ChatKFPageState extends State<ChatKFPage>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 长连接正常情况下,调用长连接接口
|
|
|
|
// 长连接正常情况下,调用长连接接口
|
|
|
|
_bdMqtt.sendCommodityMessage(
|
|
|
|
_bdMqtt.sendCommodityMessage(
|
|
|
|
widget.custom!, _currentThread!);
|
|
|
|
customGoods, _currentThread!);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|