master
jack ning 3 years ago
parent 8414606bfa
commit 6771eb9950

BIN
.DS_Store vendored

Binary file not shown.

@ -46,7 +46,7 @@ dependencies:
# 请在ios/Podfile中添加use_frameworks! # 请在ios/Podfile中添加use_frameworks!
vibration: ^1.7.3 vibration: ^1.7.3
# 在线客服 https://pub.dev/packages/bytedesk_kefu # 在线客服 https://pub.dev/packages/bytedesk_kefu
bytedesk_kefu: ^1.3.0 bytedesk_kefu: ^1.3.1
# The following adds the Cupertino Icons font to your application. # The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons. # Use with the CupertinoIcons class for iOS style icons.

@ -1,5 +1,13 @@
# Upgrade Log # Upgrade Log
## 1.3.1
* optimize user experience
## 1.3.0
* optimize user experience
## 1.2.9 ## 1.2.9
* optimize user experience * optimize user experience

@ -1,7 +1,7 @@
arguments= arguments=
auto.sync=false auto.sync=false
build.scans.enabled=false build.scans.enabled=false
connection.gradle.distribution=GRADLE_DISTRIBUTION(VERSION(7.1.1)) connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
connection.project.dir= connection.project.dir=
eclipse.preferences.version=1 eclipse.preferences.version=1
gradle.user.home= gradle.user.home=

@ -387,11 +387,18 @@ class BytedeskUserHttpApi extends BytedeskBaseHttpApi {
} }
// //
Future<User> updateProfile(String? nickname, String? avatar, String? description) async { Future<User> updateProfile(
String? nickname, String? avatar, String? description) async {
// //
var body = json.encode({"nickname": nickname, "avatar": avatar, "description": description, "client": client}); var body = json.encode({
"nickname": nickname,
"avatar": avatar,
"description": description,
"client": client
});
// //
final initUrl = Uri.http(BytedeskConstants.host, '/api/user/update/visitor/profile'); final initUrl =
Uri.http(BytedeskConstants.host, '/api/user/update/visitor/profile');
final initResponse = final initResponse =
await this.httpClient.post(initUrl, headers: getHeaders(), body: body); await this.httpClient.post(initUrl, headers: getHeaders(), body: body);
//json //json
@ -630,14 +637,18 @@ class BytedeskUserHttpApi extends BytedeskBaseHttpApi {
//string json //string json
final responseJson = final responseJson =
json.decode(utf8decoder.convert(initResponse.bodyBytes)); json.decode(utf8decoder.convert(initResponse.bodyBytes));
print("responseJson $responseJson"); print("checkAppVersion:");
print(responseJson);
// token // token
if (responseJson.toString().contains('invalid_token')) { if (responseJson.toString().contains('invalid_token')) {
bytedeskEventBus.fire(InvalidTokenEventBus()); bytedeskEventBus.fire(InvalidTokenEventBus());
} }
// TODO: status_code // TODO: status_code
// int statusCode = responseJson['status_code'];
return App.fromJson(responseJson['data']); if (statusCode == 200) {
return App.fromJson(responseJson['data']);
}
return App(version: "0");
} }
// token // token
@ -820,5 +831,4 @@ class BytedeskUserHttpApi extends BytedeskBaseHttpApi {
print(responseJson); print(responseJson);
BytedeskUtils.clearUserCache(); BytedeskUtils.clearUserCache();
} }
} }

@ -711,7 +711,8 @@ class _ChatKFPageState extends State<ChatKFPage>
// //
String? timestamp = BytedeskUtils.formatedDateNow(); String? timestamp = BytedeskUtils.formatedDateNow();
String? client = BytedeskUtils.getClient(); String? client = BytedeskUtils.getClient();
String? type = BytedeskConstants.MESSAGE_TYPE_ROBOT_RESULT; // String? type = BytedeskConstants.MESSAGE_TYPE_ROBOT_RESULT;
String? type = BytedeskConstants.MESSAGE_TYPE_ROBOT;
// //
// R // R
Message message = new Message(); Message message = new Message();

@ -569,7 +569,8 @@ class MessageWidget extends StatelessWidget {
), ),
), ),
Visibility( Visibility(
visible: message.categories != null && message.categories!.length > 0, visible:
message.categories != null && message.categories!.length > 0,
// visible: false, // visible: false,
child: Container( child: Container(
// color: Colors.black, // color: Colors.black,
@ -579,8 +580,9 @@ class MessageWidget extends StatelessWidget {
// ListView使ScrollView // ListView使ScrollView
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
padding: EdgeInsets.all(0), padding: EdgeInsets.all(0),
itemCount: itemCount: message.categories == null
message.categories == null ? 0 : message.categories!.length, ? 0
: message.categories!.length,
itemBuilder: (_, index) { itemBuilder: (_, index) {
// //
var category = message.categories![index]; var category = message.categories![index];
@ -601,8 +603,7 @@ class MessageWidget extends StatelessWidget {
onTap: () => { onTap: () => {
// print(category.name), // print(category.name),
bytedeskEventBus.fire(QueryCategoryEventBus( bytedeskEventBus.fire(QueryCategoryEventBus(
category.cid!, category.cid!, category.name!))
category.name!))
}), }),
)); ));
}, },

@ -45,13 +45,13 @@ class BytedeskConstants {
// static const String httpBaseUrliOS = 'http://' + mqttHost + ':8000'; // static const String httpBaseUrliOS = 'http://' + mqttHost + ':8000';
// static const String httpUploadUrl = 'http://' + mqttHost + ':8000'; // static const String httpUploadUrl = 'http://' + mqttHost + ':8000';
// static const String host = mqttHost + ':8000'; // static const String host = mqttHost + ':8000';
// static const String mqttHost = '192.168.0.102'; // static const String mqttHost = '192.168.0.103';
// 线 // 线
static const bool isDebug = false; // false; static const bool isDebug = false; // false;
static const bool isSecure = true; // secure static const bool isSecure = true; // secure
static const bool isWebSocketWss = true; static const bool isWebSocketWss = true;
static const String webSocketWssUrl = 'wss://flutter.bytedesk.com/websocket'; static const String webSocketWssUrl = 'wss://' + mqttHost + '/websocket';
static const int mqttPort = 13883; // secure static const int mqttPort = 13883; // secure
static const String httpBaseUrl = 'https://' + mqttHost; static const String httpBaseUrl = 'https://' + mqttHost;
static const String httpBaseUrlAndroid = 'https://' + mqttHost; static const String httpBaseUrlAndroid = 'https://' + mqttHost;

@ -1,6 +1,6 @@
name: bytedesk_kefu name: bytedesk_kefu
description: the best app chat sdk in china, you can chat with the agent freely at anytime. the agent can chat with the visitor by web/pc/mac/ios/android client. description: the best app chat sdk in china, you can chat with the agent freely at anytime. the agent can chat with the visitor by web/pc/mac/ios/android client.
version: 1.2.9 version: 1.3.1
homepage: https://www.weikefu.net homepage: https://www.weikefu.net
environment: environment:
@ -49,7 +49,8 @@ dependencies:
# https://pub.dev/packages/flutter_easyloading # https://pub.dev/packages/flutter_easyloading
flutter_easyloading: ^3.0.3 flutter_easyloading: ^3.0.3
# H5-webchat https://pub.dev/packages/webview_flutter # H5-webchat https://pub.dev/packages/webview_flutter
webview_flutter: ^3.0.2 # webview_flutter: ^3.0.2
webview_flutter: ^2.0.4
# https://pub.dev/packages/device_info # https://pub.dev/packages/device_info
device_info: ^2.0.3 device_info: ^2.0.3
# 查看大图 https://pub.dev/packages/photo_view # 查看大图 https://pub.dev/packages/photo_view
@ -77,7 +78,8 @@ dependencies:
# audioplayers: ^0.16.1 # audioplayers: ^0.16.1
# https://pub.dev/packages/flutter_html # https://pub.dev/packages/flutter_html
# https://github.com/Sub6Resources/flutter_html # https://github.com/Sub6Resources/flutter_html
flutter_html: ^3.0.0-alpha.3 # flutter_html: ^3.0.0-alpha.3 # bug界面不能及时更新
flutter_html: ^2.2.1
# https://pub.dev/packages/flutter_cache_manager # https://pub.dev/packages/flutter_cache_manager
flutter_cache_manager: ^3.3.0 flutter_cache_manager: ^3.3.0
# 保存图片到相册 # 保存图片到相册
@ -86,7 +88,7 @@ dependencies:
# https://pub.dev/packages/feedback # https://pub.dev/packages/feedback
# feedback: ^2.0.0-beta.0 # feedback: ^2.0.0-beta.0
# feedback: ^1.2.2 # feedback: ^1.2.2
# 替代 dart:html 以便于在APP上运行 # 替代 dart:html 以便于在APP上运行, mqtt依赖
# https://pub.dev/packages/universal_html # https://pub.dev/packages/universal_html
universal_html: ^2.0.8 universal_html: ^2.0.8
# flutter_html依赖下列 # flutter_html依赖下列
@ -111,7 +113,8 @@ dependencies:
# Plugins for rendering the <audio> tag. # Plugins for rendering the <audio> tag.
# chewie_audio: ^1.0.0+1 # chewie_audio: ^1.0.0+1
# Plugins for rendering the <svg> tag. # Plugins for rendering the <svg> tag.
flutter_svg: ^1.0.3 # flutter_svg: ^1.0.3
flutter_svg: ^0.23.0+1
flutter_web_plugins: flutter_web_plugins:
sdk: flutter sdk: flutter

Loading…
Cancel
Save