feat:为了上架,新增客服功能
This commit is contained in:
parent
dafb40954a
commit
8d149ef4b3
40
lib/login/login/app_get_version.dart
Normal file
40
lib/login/login/app_get_version.dart
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
class GetAppInfo {
|
||||||
|
GetAppInfo({this.errorCode, this.description, this.errorMsg, this.data});
|
||||||
|
|
||||||
|
GetAppInfo.fromJson(Map<String, dynamic> json) {
|
||||||
|
errorCode = json['errorCode'];
|
||||||
|
description = json['description'];
|
||||||
|
errorMsg = json['errorMsg'];
|
||||||
|
if (json['data'] is Map) {
|
||||||
|
data = Data.fromJson(json['data']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int? errorCode;
|
||||||
|
String? description;
|
||||||
|
String? errorMsg;
|
||||||
|
Data? data;
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['errorCode'] = errorCode;
|
||||||
|
data['description'] = description;
|
||||||
|
data['errorMsg'] = errorMsg;
|
||||||
|
data['data'] = this.data;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Data {
|
||||||
|
Data.fromJson(Map<String, dynamic> json) {
|
||||||
|
wechatServiceUrl = json['wechat_service_url'];
|
||||||
|
}
|
||||||
|
|
||||||
|
String? wechatServiceUrl;
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['wechat_service_url'] = wechatServiceUrl;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -3,6 +3,7 @@ import 'package:flutter/services.dart';
|
|||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/flavors.dart';
|
import 'package:star_lock/flavors.dart';
|
||||||
|
import 'package:star_lock/tools/customer_tool.dart';
|
||||||
|
|
||||||
import '../../appRouters.dart';
|
import '../../appRouters.dart';
|
||||||
import '../../app_settings/app_colors.dart';
|
import '../../app_settings/app_colors.dart';
|
||||||
@ -35,6 +36,12 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
|
|||||||
haveBack: false,
|
haveBack: false,
|
||||||
backgroundColor: AppColors.mainColor,
|
backgroundColor: AppColors.mainColor,
|
||||||
actionsList: [
|
actionsList: [
|
||||||
|
IconButton(
|
||||||
|
onPressed: CustomerTool.openCustomerService,
|
||||||
|
icon: Icon(
|
||||||
|
Icons.support_agent,
|
||||||
|
color: AppColors.mainColor,
|
||||||
|
)),
|
||||||
TextButton(
|
TextButton(
|
||||||
child: Text(
|
child: Text(
|
||||||
TranslationLoader.lanKeys!.register!.tr,
|
TranslationLoader.lanKeys!.register!.tr,
|
||||||
@ -239,7 +246,10 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
|
|||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
width: 10.sp,
|
width: 10.sp,
|
||||||
)),
|
)),
|
||||||
if (F.isLite) Container() else GestureDetector(
|
if (F.isLite)
|
||||||
|
Container()
|
||||||
|
else
|
||||||
|
GestureDetector(
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
// width: 150.w,
|
// width: 150.w,
|
||||||
height: 50.h,
|
height: 50.h,
|
||||||
@ -247,8 +257,7 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
|
|||||||
child: Center(
|
child: Center(
|
||||||
child: Text('演示模式'.tr,
|
child: Text('演示模式'.tr,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 22.sp,
|
fontSize: 22.sp, color: AppColors.mainColor)),
|
||||||
color: AppColors.mainColor)),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
|
|||||||
@ -1,9 +1,12 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
|
import 'package:flutter/widgets.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/flavors.dart';
|
import 'package:star_lock/flavors.dart';
|
||||||
import 'package:star_lock/login/login/starLock_login_state.dart';
|
import 'package:star_lock/login/login/starLock_login_state.dart';
|
||||||
|
import 'package:star_lock/tools/customer_tool.dart';
|
||||||
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
|
|
||||||
import '../../appRouters.dart';
|
import '../../appRouters.dart';
|
||||||
import '../../app_settings/app_colors.dart';
|
import '../../app_settings/app_colors.dart';
|
||||||
@ -33,7 +36,7 @@ class _StarLockLoginPageState extends State<StarLockLoginXHJPage> {
|
|||||||
backgroundColor: const Color(0xFFFFFFFF),
|
backgroundColor: const Color(0xFFFFFFFF),
|
||||||
body: ListView(
|
body: ListView(
|
||||||
padding: EdgeInsets.only(
|
padding: EdgeInsets.only(
|
||||||
top: 120.h,
|
top: 110.h,
|
||||||
),
|
),
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Padding(
|
Padding(
|
||||||
@ -41,13 +44,25 @@ class _StarLockLoginPageState extends State<StarLockLoginXHJPage> {
|
|||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Text(
|
Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Text(
|
||||||
'${"欢迎使用".tr}${F.title}',
|
'${"欢迎使用".tr}${F.title}',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: AppColors.darkGrayTextColor,
|
color: AppColors.darkGrayTextColor,
|
||||||
fontSize: 48.sp,
|
fontSize: 48.sp,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
IconButton(
|
||||||
|
onPressed: CustomerTool.openCustomerService,
|
||||||
|
icon: Icon(
|
||||||
|
Icons.support_agent,
|
||||||
|
color: AppColors.mainColor,
|
||||||
|
)),
|
||||||
|
],
|
||||||
|
),
|
||||||
SizedBox(height: 30.h),
|
SizedBox(height: 30.h),
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
|
|||||||
@ -10,6 +10,7 @@ import 'package:star_lock/flavors.dart';
|
|||||||
import 'package:star_lock/mine/mineSet/mineSet/mineSet_logic.dart';
|
import 'package:star_lock/mine/mineSet/mineSet/mineSet_logic.dart';
|
||||||
import 'package:star_lock/mine/mineSet/mineSet/mineSet_state.dart';
|
import 'package:star_lock/mine/mineSet/mineSet/mineSet_state.dart';
|
||||||
import 'package:star_lock/tools/appFirstEnterHandle.dart';
|
import 'package:star_lock/tools/appFirstEnterHandle.dart';
|
||||||
|
import 'package:star_lock/tools/customer_tool.dart';
|
||||||
import '../../../appRouters.dart';
|
import '../../../appRouters.dart';
|
||||||
import '../../../app_settings/app_colors.dart';
|
import '../../../app_settings/app_colors.dart';
|
||||||
import '../../../tools/commonItem.dart';
|
import '../../../tools/commonItem.dart';
|
||||||
@ -352,6 +353,12 @@ class _MineSetPageState extends State<MineSetPage> with WidgetsBindingObserver {
|
|||||||
action: () {
|
action: () {
|
||||||
logic.showToast('功能暂未开放'.tr);
|
logic.showToast('功能暂未开放'.tr);
|
||||||
}),
|
}),
|
||||||
|
CommonItem(
|
||||||
|
leftTitel: TranslationLoader.lanKeys!.supportStaff!.tr,
|
||||||
|
isHaveLine: widget.showAbout,
|
||||||
|
isHaveDirection: true,
|
||||||
|
action: CustomerTool.openCustomerService,
|
||||||
|
),
|
||||||
if (widget.showAbout)
|
if (widget.showAbout)
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.about!.tr,
|
leftTitel: TranslationLoader.lanKeys!.about!.tr,
|
||||||
|
|||||||
@ -239,4 +239,5 @@ abstract class Api {
|
|||||||
|
|
||||||
final String lockDataUploadUrl = '/lockRecords/lockDataUpload'; // 锁数据上传
|
final String lockDataUploadUrl = '/lockRecords/lockDataUpload'; // 锁数据上传
|
||||||
final String getNoticeTemplateURL = '/key/getNoticeTemplate'; //获取短信或者邮箱模板
|
final String getNoticeTemplateURL = '/key/getNoticeTemplate'; //获取短信或者邮箱模板
|
||||||
|
final String appGetAppInfoURL = '/app/getAppInfo'; //获取APP基本信息
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2122,6 +2122,11 @@ class ApiProvider extends BaseProvider {
|
|||||||
'keyId': keyId,
|
'keyId': keyId,
|
||||||
'channelType': channelType,
|
'channelType': channelType,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
// 获取App基本信息
|
||||||
|
Future<Response<dynamic>> getAppInfo() =>
|
||||||
|
post(appGetAppInfoURL.toUrl, jsonEncode(<String, int>{}),
|
||||||
|
isShowErrMsg: false);
|
||||||
}
|
}
|
||||||
|
|
||||||
extension ExtensionString on String {
|
extension ExtensionString on String {
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/blue/entity/lock_user_no_list_entity.dart';
|
import 'package:star_lock/blue/entity/lock_user_no_list_entity.dart';
|
||||||
|
import 'package:star_lock/login/login/app_get_version.dart';
|
||||||
import 'package:star_lock/login/selectCountryRegion/common/countryRegionEntity.dart';
|
import 'package:star_lock/login/selectCountryRegion/common/countryRegionEntity.dart';
|
||||||
import 'package:star_lock/main/lockDetail/authorizedAdmin/authorizedAdmin/notice_template_entity.dart';
|
import 'package:star_lock/main/lockDetail/authorizedAdmin/authorizedAdmin/notice_template_entity.dart';
|
||||||
import 'package:star_lock/main/lockDetail/doorLockLog/doorLockLog_entity.dart';
|
import 'package:star_lock/main/lockDetail/doorLockLog/doorLockLog_entity.dart';
|
||||||
@ -2150,4 +2151,11 @@ class ApiRepository {
|
|||||||
await apiProvider.getNoticeTemplate(lockId, keyId, channelType);
|
await apiProvider.getNoticeTemplate(lockId, keyId, channelType);
|
||||||
return NoticeTemplateEntity.fromJson(res.body);
|
return NoticeTemplateEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 电子钥匙获取短信模板
|
||||||
|
Future<GetAppInfo> getAppInfo() async {
|
||||||
|
final Response<dynamic> res =
|
||||||
|
await apiProvider.getAppInfo();
|
||||||
|
return GetAppInfo.fromJson(res.body);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,6 +8,9 @@ import 'package:star_lock/appRouters.dart';
|
|||||||
import 'package:star_lock/app_settings/app_colors.dart';
|
import 'package:star_lock/app_settings/app_colors.dart';
|
||||||
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
||||||
import 'package:star_lock/flavors.dart';
|
import 'package:star_lock/flavors.dart';
|
||||||
|
import 'package:star_lock/login/login/app_get_version.dart';
|
||||||
|
import 'package:star_lock/network/api_repository.dart';
|
||||||
|
import 'package:star_lock/tools/customer_tool.dart';
|
||||||
import 'package:star_lock/tools/storage.dart';
|
import 'package:star_lock/tools/storage.dart';
|
||||||
|
|
||||||
import '../versionUndate/versionUndateTool.dart';
|
import '../versionUndate/versionUndateTool.dart';
|
||||||
@ -41,6 +44,8 @@ class AppFirstEnterHandle {
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
final GetAppInfo entity = await ApiRepository.to.getAppInfo();
|
||||||
|
CustomerTool.init(entity.data?.wechatServiceUrl?? '');
|
||||||
}
|
}
|
||||||
|
|
||||||
//隐私协议弹窗
|
//隐私协议弹窗
|
||||||
|
|||||||
18
lib/tools/customer_tool.dart
Normal file
18
lib/tools/customer_tool.dart
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
|
|
||||||
|
//客服工具类
|
||||||
|
class CustomerTool {
|
||||||
|
static String _customerServiceUrl = '';
|
||||||
|
|
||||||
|
//初始化
|
||||||
|
static Future<void> init(String customerServiceUrl) async {
|
||||||
|
_customerServiceUrl = customerServiceUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
//打开客服
|
||||||
|
static void openCustomerService() {
|
||||||
|
if (_customerServiceUrl.isNotEmpty) {
|
||||||
|
launchUrl(Uri.parse(_customerServiceUrl));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user