update 0.3.8

master
jackning 4 years ago
parent b4f5717686
commit b425f89245

@ -20,6 +20,20 @@
<!-- - 提交工单 -->
<!-- - 意见反馈 -->
## 注意
- 修改安卓 android/build.gradle
```bash
# Android
buildscript {
...
dependencies {
classpath 'com.android.tools.build:gradle:3.5.4'
}
}
```
## 集成步骤
### 第一步
@ -50,8 +64,10 @@
| image1 | image2 | image3 |
| :----------: | :----------: | :----------: |
| <img src="./home.jpeg" width="250"> | <img src="./robot.jpeg" width="250"> | <img src="./notice.jpeg" width="250"> |
| <img src="./chat.png" width="250"> | <img src="./status.jpeg" width="250"> |<img src="./userinfo.jpeg" width="250"> |
| <img src="./chat.png" width="250"> | <img src="./shop.png" width="250"> |<img src="./postscript.png" width="250"> |
| <img src="./status.jpeg" width="250"> |<img src="./userinfo.jpeg" width="250"> ||
### 其他
- [下载 ApkDemo](https://bytedesk.oss-cn-shenzhen.aliyuncs.com/apk/bytedesk-android-sdk-demo.apk)
- 技术支持QQ 3群: 825257535

@ -65,7 +65,7 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
title: Text('联系客服'),
trailing: Icon(Icons.keyboard_arrow_right),
onTap: () {
//
//
Navigator.of(context)
.push(new MaterialPageRoute(builder: (context) {
return new ChatTypePage();
@ -188,6 +188,7 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
nickname: event.message.user.nickname,
content: event.message.content,
onReply: () {
//
OverlaySupportEntry.of(context).dismiss();
//
BytedeskKefu.startChatThread(context, event.message.thread, title: '客服会话');
@ -197,8 +198,12 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
}
} else if (event.message.type == BytedeskConstants.MESSAGE_TYPE_IMAGE) {
print('图片消息:' + event.message.imageUrl);
} else if (event.message.type == BytedeskConstants.MESSAGE_TYPE_VOICE) {
print('语音消息:' + event.message.voiceUrl);
} else if (event.message.type == BytedeskConstants.MESSAGE_TYPE_VIDEO) {
print('视频消息:' + event.message.imageUrl);
print('视频消息:' + event.message.videoUrl);
} else if (event.message.type == BytedeskConstants.MESSAGE_TYPE_FILE) {
print('文件消息:' + event.message.fileUrl);
} else {
print('其他类型消息');
}
@ -222,6 +227,7 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
// }
// }
//
void vibrate() async {
if (await Vibration.hasVibrator()) {
Vibration.vibrate();

@ -28,21 +28,21 @@ class _ChatTypePageState extends State<ChatTypePage> {
elevation: 0,
),
body: ListView(
children: ListTile.divideTiles(
context: context,
tiles: [
children: ListTile.divideTiles(context: context, tiles: [
ListTile(
title: Text('技能组客服'),
trailing: Icon(Icons.keyboard_arrow_right),
onTap: () {
BytedeskKefu.startWorkGroupChat(context, _workGroupWid, "技能组客服-默认人工");
BytedeskKefu.startWorkGroupChat(
context, _workGroupWid, "技能组客服-默认人工");
},
),
ListTile(
title: Text('技能组客服-机器人'),
trailing: Icon(Icons.keyboard_arrow_right),
onTap: () {
BytedeskKefu.startWorkGroupChat(context, _workGroupWidRobot, "技能组客服-默认机器人");
BytedeskKefu.startWorkGroupChat(
context, _workGroupWidRobot, "技能组客服-默认机器人");
},
),
ListTile(
@ -50,25 +50,60 @@ class _ChatTypePageState extends State<ChatTypePage> {
trailing: Icon(Icons.keyboard_arrow_right),
onTap: () {
// type/title/content/price/url/imageUrl/id/categoryCode
// 500
var custom = json.encode({
"type": BytedeskConstants.MESSAGE_TYPE_COMMODITY,
"title": "商品标题",
"content": "商品详情",
"price": "9.99",
"url": "https://item.m.jd.com/product/12172344.html",
"imageUrl": "https://bytedesk.oss-cn-shenzhen.aliyuncs.com/images/123.webp",
"id": 123,
"categoryCode": "100010003",
"client": "flutter"
"type": BytedeskConstants.MESSAGE_TYPE_COMMODITY, //
"title": "商品标题", // ,
"content": "商品详情", // ,
"price": "9.99", // ,
"url":
"https://item.m.jd.com/product/12172344.html", // url,
"imageUrl":
"https://bytedesk.oss-cn-shenzhen.aliyuncs.com/images/123.webp", //,
"id": 123, //
"categoryCode": "100010003", // ,
"client": "flutter" // ,
});
BytedeskKefu.startWorkGroupChatShop(
context, _workGroupWid, "技能组客服-电商", custom);
},
),
ListTile(
title: Text('技能组客服-电商-回调'),
trailing: Icon(Icons.keyboard_arrow_right),
onTap: () {
// type/title/content/price/url/imageUrl/id/categoryCode
// 500
var custom = json.encode({
"type": BytedeskConstants.MESSAGE_TYPE_COMMODITY, //
"title": "商品标题", // ,
"content": "商品详情", // ,
"price": "9.99", // ,
"url":
"https://item.m.jd.com/product/12172344.html", // url,
"imageUrl":
"https://bytedesk.oss-cn-shenzhen.aliyuncs.com/images/123.webp", //,
"id": 123, //
"categoryCode": "100010003", // ,
"client": "flutter", // ,
// key:value,
"other1": "", //
"other2": "", //
"other3": "", //
});
BytedeskKefu.startWorkGroupChatShopCallback(
context, _workGroupWid, "技能组客服-电商-回调", custom, (value) {
print('value为custom参数原样返回 $value');
//
});
BytedeskKefu.startWorkGroupChatShop(context, _workGroupWid, "技能组客服-电商", custom);
},
),
ListTile(
title: Text('技能组客服-附言'),
trailing: Icon(Icons.keyboard_arrow_right),
onTap: () {
BytedeskKefu.startWorkGroupChatPostscript(context, _workGroupWid, "技能组客服-附言", "随便说点什么吧,我会自动发送给客服");
BytedeskKefu.startWorkGroupChatPostscript(
context, _workGroupWid, "技能组客服-附言", "随便说点什么吧,我会自动发送给客服");
},
),
Container(
@ -78,7 +113,7 @@ class _ChatTypePageState extends State<ChatTypePage> {
title: Text('指定一对一客服'),
trailing: Icon(Icons.keyboard_arrow_right),
onTap: () {
BytedeskKefu.startAppointedChat(context, _agentUid, "指定客服");
BytedeskKefu.startAppointedChat(context, _agentUid, "指定一对一客服");
},
),
ListTile(
@ -86,25 +121,58 @@ class _ChatTypePageState extends State<ChatTypePage> {
trailing: Icon(Icons.keyboard_arrow_right),
onTap: () {
// type/title/content/price/url/imageUrl/id/categoryCode
// 500
var custom = json.encode({
"type": BytedeskConstants.MESSAGE_TYPE_COMMODITY,
"title": "商品标题",
"content": "商品详情",
"price": "9.99",
"url": "https://item.m.jd.com/product/12172344.html",
"imageUrl": "https://bytedesk.oss-cn-shenzhen.aliyuncs.com/images/123.webp",
"imageUrl":
"https://bytedesk.oss-cn-shenzhen.aliyuncs.com/images/123.webp",
"id": 123,
"categoryCode": "100010003",
"client": "flutter"
});
BytedeskKefu.startAppointedChatShop(context, _agentUid, "指定客服", custom);
BytedeskKefu.startAppointedChatShop(
context, _agentUid, "指定一对一客服-电商", custom);
},
),
ListTile(
title: Text('指定一对一客服-电商-回调'),
trailing: Icon(Icons.keyboard_arrow_right),
onTap: () {
// type/title/content/price/url/imageUrl/id/categoryCode
// 500
var custom = json.encode({
"type": BytedeskConstants.MESSAGE_TYPE_COMMODITY,
"title": "商品标题",
"content": "商品详情",
"price": "9.99",
"url": "https://item.m.jd.com/product/12172344.html",
"imageUrl":
"https://bytedesk.oss-cn-shenzhen.aliyuncs.com/images/123.webp",
"id": 123,
"categoryCode": "100010003",
"client": "flutter",
// key:value,
"other1": "", //
"other2": "", //
"other3": "", //
});
BytedeskKefu.startAppointedChatShopCallback(
context, _agentUid, "指定一对一客服-电商-回调", custom, (value) {
print('value为custom参数原样返回 $value');
//
});
},
),
ListTile(
title: Text('指定一对一客服-附言'),
trailing: Icon(Icons.keyboard_arrow_right),
onTap: () {
BytedeskKefu.startAppointedChatPostscript(context, _agentUid, "指定客服", "随便说点什么吧,我会自动发送给客服");
BytedeskKefu.startAppointedChatPostscript(
context, _agentUid, "指定一对一客服-附言", "随便说点什么吧,我会自动发送给客服");
},
),
Container(
@ -116,13 +184,13 @@ class _ChatTypePageState extends State<ChatTypePage> {
onTap: () {
print('h5 chat');
// : ->->()-> URL
String url = "http://www.bytedesk.com/chat?sub=vip&uid=201808221551193&wid=201807171659201&type=workGroup&aid=&hidenav=1&ph=ph";
String url =
"http://www.bytedesk.com/chat?sub=vip&uid=201808221551193&wid=201807171659201&type=workGroup&aid=&hidenav=1&ph=ph";
String title = 'H5在线客服演示';
BytedeskKefu.startH5Chat(context, url, title);
},
),
]
).toList(),
]).toList(),
),
);
}

@ -10,7 +10,9 @@ class HistoryThreadPage extends StatefulWidget {
_HistoryThreadPageState createState() => _HistoryThreadPageState();
}
// TODO: thread
class _HistoryThreadPageState extends State<HistoryThreadPage> {
//
int _page = 0;
int _size = 20;
List<Thread> _historyThreadList = [];
@ -20,7 +22,6 @@ class _HistoryThreadPageState extends State<HistoryThreadPage> {
_getVisitorThreads();
super.initState();
}
//
@override
Widget build(BuildContext context) {
@ -36,6 +37,10 @@ class _HistoryThreadPageState extends State<HistoryThreadPage> {
leading: Image.network(_historyThreadList[index].avatar),
title: Text('${_historyThreadList[index].nickname}, ${_historyThreadList[index].timestamp}'),
subtitle: Text('${_historyThreadList[index].content}'),
onTap: () {
//
BytedeskKefu.startChatThread(context, _historyThreadList[index]);
},
),
itemCount: _historyThreadList.length,
),
@ -52,7 +57,7 @@ class _HistoryThreadPageState extends State<HistoryThreadPage> {
}
Future<void> _onRefresh() async {
_page++;
_getVisitorThreads();
_page++;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 498 KiB

@ -28,7 +28,7 @@ dependencies:
# https://pub.dev/packages/event_bus
event_bus: ^1.1.1
# toast https://pub.dev/packages/fluttertoast
fluttertoast: ^7.1.1
fluttertoast: ^7.1.4
# 消息设置switch https://pub.dev/packages/list_tile_switch
list_tile_switch: ^0.0.2
# 应用内-顶部通知栏 https://pub.dev/packages/overlay_support/
@ -40,7 +40,7 @@ dependencies:
# 请在ios/Podfile中添加use_frameworks!
vibration: ^1.7.2
# https://pub.dev/packages/bytedesk_kefu
bytedesk_kefu: ^0.3.1
bytedesk_kefu: ^0.3.8
# The following adds the Cupertino Icons font to your application.

Binary file not shown.

After

Width:  |  Height:  |  Size: 357 KiB

Loading…
Cancel
Save