diff --git a/.DS_Store b/.DS_Store index b77592f..c029c5b 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/bytedesk_demo/pubspec.yaml b/bytedesk_demo/pubspec.yaml index 8e70e47..0f06cbe 100644 --- a/bytedesk_demo/pubspec.yaml +++ b/bytedesk_demo/pubspec.yaml @@ -46,7 +46,7 @@ dependencies: # 请在ios/Podfile中添加:use_frameworks! vibration: ^1.7.3 # 在线客服 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. # Use with the CupertinoIcons class for iOS style icons. diff --git a/bytedesk_kefu/CHANGELOG.md b/bytedesk_kefu/CHANGELOG.md index 6cb0943..3a2ec34 100644 --- a/bytedesk_kefu/CHANGELOG.md +++ b/bytedesk_kefu/CHANGELOG.md @@ -1,5 +1,13 @@ # Upgrade Log +## 1.3.1 + +* optimize user experience + +## 1.3.0 + +* optimize user experience + ## 1.2.9 * optimize user experience diff --git a/bytedesk_kefu/example/android/.settings/org.eclipse.buildship.core.prefs b/bytedesk_kefu/example/android/.settings/org.eclipse.buildship.core.prefs index 5fc6763..99fd5b0 100644 --- a/bytedesk_kefu/example/android/.settings/org.eclipse.buildship.core.prefs +++ b/bytedesk_kefu/example/android/.settings/org.eclipse.buildship.core.prefs @@ -1,7 +1,7 @@ arguments= auto.sync=false build.scans.enabled=false -connection.gradle.distribution=GRADLE_DISTRIBUTION(VERSION(7.1.1)) +connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER) connection.project.dir= eclipse.preferences.version=1 gradle.user.home= diff --git a/bytedesk_kefu/lib/http/bytedesk_user_api.dart b/bytedesk_kefu/lib/http/bytedesk_user_api.dart index c90f02e..96a9430 100755 --- a/bytedesk_kefu/lib/http/bytedesk_user_api.dart +++ b/bytedesk_kefu/lib/http/bytedesk_user_api.dart @@ -387,11 +387,18 @@ class BytedeskUserHttpApi extends BytedeskBaseHttpApi { } // 一个接口同时设置:昵称、头像、备注 - Future updateProfile(String? nickname, String? avatar, String? description) async { + Future 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 = await this.httpClient.post(initUrl, headers: getHeaders(), body: body); //解决json解析中的乱码问题 @@ -630,14 +637,18 @@ class BytedeskUserHttpApi extends BytedeskBaseHttpApi { //将string类型数据 转换为json类型的数据 final responseJson = json.decode(utf8decoder.convert(initResponse.bodyBytes)); - print("responseJson $responseJson"); + print("checkAppVersion:"); + print(responseJson); // 判断token是否过期 if (responseJson.toString().contains('invalid_token')) { bytedeskEventBus.fire(InvalidTokenEventBus()); } // TODO: 根据status_code判断结果,并解析 - // 解析 - return App.fromJson(responseJson['data']); + int statusCode = responseJson['status_code']; + if (statusCode == 200) { + return App.fromJson(responseJson['data']); + } + return App(version: "0"); } // 通过token获取手机号 @@ -820,5 +831,4 @@ class BytedeskUserHttpApi extends BytedeskBaseHttpApi { print(responseJson); BytedeskUtils.clearUserCache(); } - } 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 1e9eb8b..0d4948d 100755 --- a/bytedesk_kefu/lib/ui/chat/page/chat_kf_page.dart +++ b/bytedesk_kefu/lib/ui/chat/page/chat_kf_page.dart @@ -711,7 +711,8 @@ class _ChatKFPageState extends State // String? timestamp = BytedeskUtils.formatedDateNow(); 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 Message message = new Message(); diff --git a/bytedesk_kefu/lib/ui/chat/widget/message_widget.dart b/bytedesk_kefu/lib/ui/chat/widget/message_widget.dart index c1e2594..53f1058 100755 --- a/bytedesk_kefu/lib/ui/chat/widget/message_widget.dart +++ b/bytedesk_kefu/lib/ui/chat/widget/message_widget.dart @@ -569,7 +569,8 @@ class MessageWidget extends StatelessWidget { ), ), Visibility( - visible: message.categories != null && message.categories!.length > 0, + visible: + message.categories != null && message.categories!.length > 0, // visible: false, child: Container( // color: Colors.black, @@ -579,8 +580,9 @@ class MessageWidget extends StatelessWidget { // 禁用ListView滑动,使用外层的ScrollView滑动 physics: const NeverScrollableScrollPhysics(), padding: EdgeInsets.all(0), - itemCount: - message.categories == null ? 0 : message.categories!.length, + itemCount: message.categories == null + ? 0 + : message.categories!.length, itemBuilder: (_, index) { // var category = message.categories![index]; @@ -601,8 +603,7 @@ class MessageWidget extends StatelessWidget { onTap: () => { // print(category.name), bytedeskEventBus.fire(QueryCategoryEventBus( - category.cid!, - category.name!)) + category.cid!, category.name!)) }), )); }, diff --git a/bytedesk_kefu/lib/util/bytedesk_constants.dart b/bytedesk_kefu/lib/util/bytedesk_constants.dart index 3d27e63..1a5ab58 100755 --- a/bytedesk_kefu/lib/util/bytedesk_constants.dart +++ b/bytedesk_kefu/lib/util/bytedesk_constants.dart @@ -45,13 +45,13 @@ class BytedeskConstants { // static const String httpBaseUrliOS = 'http://' + mqttHost + ':8000'; // static const String httpUploadUrl = 'http://' + 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 isSecure = true; // secure 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 String httpBaseUrl = 'https://' + mqttHost; static const String httpBaseUrlAndroid = 'https://' + mqttHost; diff --git a/bytedesk_kefu/pubspec.yaml b/bytedesk_kefu/pubspec.yaml index 955e271..c1a1b7e 100644 --- a/bytedesk_kefu/pubspec.yaml +++ b/bytedesk_kefu/pubspec.yaml @@ -1,6 +1,6 @@ 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. -version: 1.2.9 +version: 1.3.1 homepage: https://www.weikefu.net environment: @@ -49,7 +49,8 @@ dependencies: # https://pub.dev/packages/flutter_easyloading flutter_easyloading: ^3.0.3 # 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 device_info: ^2.0.3 # 查看大图 https://pub.dev/packages/photo_view @@ -77,7 +78,8 @@ dependencies: # audioplayers: ^0.16.1 # https://pub.dev/packages/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 flutter_cache_manager: ^3.3.0 # 保存图片到相册 @@ -86,7 +88,7 @@ dependencies: # https://pub.dev/packages/feedback # feedback: ^2.0.0-beta.0 # feedback: ^1.2.2 - # 替代 dart:html 以便于在APP上运行 + # 替代 dart:html 以便于在APP上运行, mqtt依赖 # https://pub.dev/packages/universal_html universal_html: ^2.0.8 # flutter_html依赖下列 @@ -111,7 +113,8 @@ dependencies: # Plugins for rendering the