更新在线客服
This commit is contained in:
@@ -4,7 +4,7 @@ flutter.sdk=C:\\dev\\flutter
|
|||||||
flutter.buildMode=release
|
flutter.buildMode=release
|
||||||
flutter.versionName=1.0.0
|
flutter.versionName=1.0.0
|
||||||
flutter.versionCode=1
|
flutter.versionCode=1
|
||||||
flutter.minSdkVersion=21
|
flutter.minSdkVersion=22
|
||||||
flutter.targetSdkVersion=35
|
flutter.targetSdkVersion=35
|
||||||
flutter.compileSdkVersion=35
|
flutter.compileSdkVersion=35
|
||||||
flutter.ndkVersion=28.0.12433566
|
flutter.ndkVersion=28.0.12433566
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
[
|
[
|
||||||
"assets/miniapp/mhtControl_1.0.0.zip"
|
"assets/miniapp/mhtControl_1.0.28.zip"
|
||||||
]
|
]
|
||||||
BIN
assets/miniapp/mhtControl_1.0.28.zip
Normal file
BIN
assets/miniapp/mhtControl_1.0.28.zip
Normal file
Binary file not shown.
@@ -2,9 +2,11 @@ class CommonVariables {
|
|||||||
static bool isNetWorkOn = false;
|
static bool isNetWorkOn = false;
|
||||||
static String supabaseUrl = "https://zhmht.swes.com.cn:3443";
|
static String supabaseUrl = "https://zhmht.swes.com.cn:3443";
|
||||||
// 企业微信客服拉起的url地址
|
// 企业微信客服拉起的url地址
|
||||||
static String wxKfUrl = "https://work.weixin.qq.com/kfid/kfcab6a07e8aac68945";
|
// static String wxKfUrl = "https://work.weixin.qq.com/kfid/kfcab6a07e8aac68945";
|
||||||
|
static String wxKfUrl = "https://work.weixin.qq.com/kfid/kfc7d2337b9c07b1269";
|
||||||
// 企业微信ID
|
// 企业微信ID
|
||||||
static String wxCorpId = "wwc17348c75dbde1dc";
|
// static String wxCorpId = "wwc17348c75dbde1dc";
|
||||||
|
static String wxCorpId = "ww51feda6026280cd0";
|
||||||
//ICP备案号
|
//ICP备案号
|
||||||
static String ICPRightCode = "皖ICP备2024068219号-1A";
|
static String ICPRightCode = "皖ICP备2024068219号-1A";
|
||||||
//公司名称
|
//公司名称
|
||||||
|
|||||||
@@ -140,10 +140,13 @@ Future<void> initWX() async {
|
|||||||
Fluwx fluwx = Fluwx();
|
Fluwx fluwx = Fluwx();
|
||||||
fluwx.registerApi(
|
fluwx.registerApi(
|
||||||
//请填写自己的微信appid
|
//请填写自己的微信appid
|
||||||
appId: "wxeb2688220799e2c5",
|
// appId: "wxeb2688220799e2c5",//太和
|
||||||
|
appId: "wx929c548fea6af9c7",//眠花糖
|
||||||
doOnAndroid: true,
|
doOnAndroid: true,
|
||||||
doOnIOS: true,
|
doOnIOS: true,
|
||||||
universalLink: "https://app.he-info.com/theh/");
|
// universalLink: "https://app.he-info.com/theh/",
|
||||||
|
universalLink: "https://zhmht.swes.com.cn/app/",
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Timer? _messageTimer;
|
Timer? _messageTimer;
|
||||||
|
|||||||
@@ -3,7 +3,9 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_svg/svg.dart';
|
import 'package:flutter_svg/svg.dart';
|
||||||
import 'package:flutterflow_ui/flutterflow_ui.dart';
|
import 'package:flutterflow_ui/flutterflow_ui.dart';
|
||||||
|
import 'package:fluwx/fluwx.dart';
|
||||||
import 'package:vbvs_app/common/color/appConstants.dart';
|
import 'package:vbvs_app/common/color/appConstants.dart';
|
||||||
|
import 'package:vbvs_app/common/util/CommonVariables.dart';
|
||||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||||
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
|
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
|
||||||
@@ -13,6 +15,8 @@ import 'package:vbvs_app/controller/theme_controller/ThemeController.dart';
|
|||||||
import 'package:vbvs_app/controller/user_info_controller.dart';
|
import 'package:vbvs_app/controller/user_info_controller.dart';
|
||||||
import 'dart:ui' as ui;
|
import 'dart:ui' as ui;
|
||||||
|
|
||||||
|
import 'package:vbvs_app/pages/mh_page/user/controller/mht_login_controller.dart';
|
||||||
|
|
||||||
class NewMinePage extends StatefulWidget {
|
class NewMinePage extends StatefulWidget {
|
||||||
const NewMinePage({super.key});
|
const NewMinePage({super.key});
|
||||||
|
|
||||||
@@ -299,10 +303,17 @@ class _MinePageState extends State<NewMinePage> {
|
|||||||
'问题与帮助', '常见的问题汇总,如:智能床连接流程、如何查看睡眠报告',
|
'问题与帮助', '常见的问题汇总,如:智能床连接流程、如何查看睡眠报告',
|
||||||
path: "/issueListpage"),
|
path: "/issueListpage"),
|
||||||
_buildListTile(
|
_buildListTile(
|
||||||
'assets/img/icon/customer_service.svg',
|
'assets/img/icon/customer_service.svg',
|
||||||
'在线客服',
|
'在线客服',
|
||||||
'购买和使用智能床过程中,如果遇到疑问可与客服进行联系',
|
'购买和使用智能床过程中,如果遇到疑问可与客服进行联系',
|
||||||
path: ""),
|
path: "",
|
||||||
|
onTap: () async {
|
||||||
|
MHTLoginController mhtLoginController =
|
||||||
|
Get.find<MHTLoginController>();
|
||||||
|
await mhtLoginController
|
||||||
|
.openWeChatCustomerService(context);
|
||||||
|
},
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -334,85 +345,89 @@ class _MinePageState extends State<NewMinePage> {
|
|||||||
String svgPath,
|
String svgPath,
|
||||||
String title,
|
String title,
|
||||||
String subtitle, {
|
String subtitle, {
|
||||||
// VoidCallback? onTap,
|
|
||||||
String? path,
|
String? path,
|
||||||
bool showTopLine = false,
|
bool showTopLine = false,
|
||||||
|
VoidCallback? onTap, // ✅ 新增可选 onTap 参数
|
||||||
}) {
|
}) {
|
||||||
return ClickableContainer(
|
return ClickableContainer(
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
highlightColor: Colors.white,
|
highlightColor: Colors.white,
|
||||||
padding: EdgeInsets.all(0.rpx),
|
padding: EdgeInsets.all(0.rpx),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
|
if (onTap != null) {
|
||||||
|
onTap(); // ✅ 使用外部传入的 onTap
|
||||||
|
} else {
|
||||||
if (path == null || path.isEmpty) {
|
if (path == null || path.isEmpty) {
|
||||||
TopSlideNotification.show(context, text: "待开发功能".tr);
|
TopSlideNotification.show(context, text: "待开发功能".tr);
|
||||||
} else {
|
} else {
|
||||||
Get.toNamed(path);
|
Get.toNamed(path);
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
child: Container(
|
},
|
||||||
decoration: BoxDecoration(
|
child: Container(
|
||||||
border: Border(
|
decoration: BoxDecoration(
|
||||||
top: showTopLine
|
border: Border(
|
||||||
? BorderSide(color: Color(0xFF929699), width: 0.5.rpx)
|
top: showTopLine
|
||||||
: BorderSide.none,
|
? BorderSide(color: Color(0xFF929699), width: 0.5.rpx)
|
||||||
bottom: BorderSide(color: Color(0xFF929699), width: 0.5.rpx),
|
: BorderSide.none,
|
||||||
),
|
bottom: BorderSide(color: Color(0xFF929699), width: 0.5.rpx),
|
||||||
),
|
),
|
||||||
height: 116.rpx,
|
),
|
||||||
child: Padding(
|
height: 116.rpx,
|
||||||
padding: EdgeInsets.fromLTRB(40.rpx, 0.rpx, 40.rpx, 0.rpx),
|
child: Padding(
|
||||||
child: Row(
|
padding: EdgeInsets.fromLTRB(40.rpx, 0.rpx, 40.rpx, 0.rpx),
|
||||||
children: [
|
child: Row(
|
||||||
Container(
|
children: [
|
||||||
|
SvgPicture.asset(
|
||||||
|
svgPath,
|
||||||
|
width: 42.rpx,
|
||||||
|
height: 42.rpx,
|
||||||
|
),
|
||||||
|
SizedBox(width: 30.rpx),
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
title,
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 30.rpx,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
subtitle,
|
||||||
|
style: TextStyle(
|
||||||
|
color: Color(0xFF929699),
|
||||||
|
fontSize: 20.rpx,
|
||||||
|
),
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
softWrap: true,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
ClickableContainer(
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
highlightColor: Colors.transparent,
|
||||||
|
padding: EdgeInsets.only(right: 0),
|
||||||
|
onTap: () {},
|
||||||
|
child: Container(
|
||||||
|
height: 30.rpx,
|
||||||
|
width: 30.rpx,
|
||||||
child: SvgPicture.asset(
|
child: SvgPicture.asset(
|
||||||
svgPath,
|
'assets/img/icon/expand.svg',
|
||||||
width: 42.rpx,
|
color: Colors.white,
|
||||||
height: 42.rpx,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(width: 30.rpx),
|
),
|
||||||
Expanded(
|
],
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center, // 垂直方向居中对齐
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
title,
|
|
||||||
style: TextStyle(
|
|
||||||
color: Colors.white,
|
|
||||||
fontSize: 30.rpx,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
// SizedBox(height: 6.rpx), // 加点间距
|
|
||||||
Text(
|
|
||||||
subtitle,
|
|
||||||
style: TextStyle(
|
|
||||||
color: Color(0xFF929699),
|
|
||||||
fontSize: 20.rpx,
|
|
||||||
),
|
|
||||||
maxLines: 1,
|
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
softWrap: true, // 允许换行
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
ClickableContainer(
|
|
||||||
backgroundColor: Colors.transparent,
|
|
||||||
highlightColor: Colors.transparent,
|
|
||||||
padding: EdgeInsets.only(right: 0),
|
|
||||||
onTap: () {},
|
|
||||||
child: Container(
|
|
||||||
height: 30.rpx,
|
|
||||||
width: 30.rpx,
|
|
||||||
child: SvgPicture.asset(
|
|
||||||
'assets/img/icon/expand.svg',
|
|
||||||
color: Colors.white,
|
|
||||||
))),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
));
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildSettingButton() {
|
Widget _buildSettingButton() {
|
||||||
|
|||||||
@@ -6,11 +6,14 @@ import 'package:fluwx/fluwx.dart';
|
|||||||
import 'package:get_storage/get_storage.dart';
|
import 'package:get_storage/get_storage.dart';
|
||||||
import 'package:json_annotation/json_annotation.dart';
|
import 'package:json_annotation/json_annotation.dart';
|
||||||
import 'package:vbvs_app/common/color/ServiceConstant.dart';
|
import 'package:vbvs_app/common/color/ServiceConstant.dart';
|
||||||
|
import 'package:vbvs_app/common/color/app_uri_status.dart';
|
||||||
|
import 'package:vbvs_app/common/util/CommonVariables.dart';
|
||||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||||
import 'package:vbvs_app/common/util/requestWithLog.dart';
|
import 'package:vbvs_app/common/util/requestWithLog.dart';
|
||||||
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
|
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
|
||||||
import 'package:vbvs_app/controller/time/countdown_controller.dart';
|
import 'package:vbvs_app/controller/time/countdown_controller.dart';
|
||||||
import 'package:vbvs_app/controller/user_info_controller.dart';
|
import 'package:vbvs_app/controller/user_info_controller.dart';
|
||||||
|
import 'package:vbvs_app/model/api_response.dart';
|
||||||
import 'package:vbvs_app/model/user_data.dart';
|
import 'package:vbvs_app/model/user_data.dart';
|
||||||
import 'package:vbvs_app/pages/mh_page/user/controller/mht_register_controller.dart';
|
import 'package:vbvs_app/pages/mh_page/user/controller/mht_register_controller.dart';
|
||||||
|
|
||||||
@@ -247,12 +250,54 @@ class MHTLoginController extends GetControllerEx<LoginModel> {
|
|||||||
// await repository.logout();
|
// await repository.logout();
|
||||||
}
|
}
|
||||||
|
|
||||||
loginByWechatCode(String code) async {
|
Future<int> loginByWechatCode(String code) async {
|
||||||
// return await repository.loginByWechatCode(code);
|
String serviceAddress = ServiceConstant.service_address;
|
||||||
|
String serviceName = ServiceConstant.server_service;
|
||||||
|
String serviceApi = ServiceConstant.login;
|
||||||
|
String queryUrl = "${serviceAddress}${serviceName}${serviceApi}";
|
||||||
|
String? language = "";
|
||||||
|
var data = {
|
||||||
|
"type": 2,
|
||||||
|
"password": code,
|
||||||
|
"khCode": "mht",
|
||||||
|
};
|
||||||
|
ApiResponse apiResponse = await requestWithLog(
|
||||||
|
logTitle: "微信登录",
|
||||||
|
method: MyHttpMethod.post,
|
||||||
|
queryUrl: queryUrl,
|
||||||
|
data: data);
|
||||||
|
if (apiResponse.code == HttpStatusCodes.ok) {
|
||||||
|
UserInfoController userInfoController = Get.find();
|
||||||
|
userInfoController.model.login = 1;
|
||||||
|
userInfoController.model.user = UserModel.fromJson(apiResponse.data);
|
||||||
|
String token = apiResponse.rawResponse.headers['token']!.first;
|
||||||
|
EasyDartModule.dio.token = token;
|
||||||
|
final box = GetStorage();
|
||||||
|
box.write('token', token); // 存储 token
|
||||||
|
box.write('user', userInfoController.model.user!.toJson()); // 存储用户信息
|
||||||
|
}
|
||||||
|
return apiResponse.code!;
|
||||||
}
|
}
|
||||||
|
|
||||||
//注销账号
|
//注销账号
|
||||||
deletedAccount() async {
|
deletedAccount() async {
|
||||||
// return await repository.deletedAccount();
|
// return await repository.deletedAccount();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> openWeChatCustomerService(BuildContext context) async {
|
||||||
|
bool isWeChatInstalled = await fluwx.isWeChatInstalled;
|
||||||
|
if (!isWeChatInstalled) {
|
||||||
|
TopSlideNotification.show(context,
|
||||||
|
text: "请先安装微信APP,再联系客服".tr,
|
||||||
|
textColor: themeController.currentColor.sc9);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
TopSlideNotification.show(
|
||||||
|
context,
|
||||||
|
text: "正在打开微信客服...".tr,
|
||||||
|
);
|
||||||
|
await fluwx.open(
|
||||||
|
target: CustomerServiceChat(
|
||||||
|
corpId: CommonVariables.wxCorpId, url: CommonVariables.wxKfUrl));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,8 +91,8 @@ class MHTLoginPage extends GetView<MHTLoginController> {
|
|||||||
textColor: themeController.currentColor.sc9);
|
textColor: themeController.currentColor.sc9);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String msg = await controller.loginByWechatCode(code);
|
int rescode = await controller.loginByWechatCode(code);
|
||||||
if (msg.isEmpty) {
|
if (rescode == 1) {
|
||||||
// TODO 操作全部跳转页面前成功以后移除监听,防止重复监听,其他方式登录成功也需要移出监听
|
// TODO 操作全部跳转页面前成功以后移除监听,防止重复监听,其他方式登录成功也需要移出监听
|
||||||
controller.fluwxCancelable?.cancel();
|
controller.fluwxCancelable?.cancel();
|
||||||
// 登录成功移出网络检查监听
|
// 登录成功移出网络检查监听
|
||||||
@@ -1785,25 +1785,29 @@ class MHTLoginPage extends GetView<MHTLoginController> {
|
|||||||
borderRadius: 999.rpx,
|
borderRadius: 999.rpx,
|
||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
//loginController.model.isIos == true &&
|
// loginController.model.isIos == true &&
|
||||||
// if (loginController
|
MHTRegisterController
|
||||||
// .model.register_agree ==
|
registerController = Get.find();
|
||||||
// null ||
|
if (registerController
|
||||||
// loginController
|
.model.register_agree ==
|
||||||
// .model.register_agree !=
|
null ||
|
||||||
// true) {
|
registerController
|
||||||
// TopSlideNotification.show(
|
.model.register_agree !=
|
||||||
// context,
|
true) {
|
||||||
// text: "登录页.未同意协议".tr,
|
TopSlideNotification.show(
|
||||||
// textColor:
|
context,
|
||||||
// themeController.currentColor.sc9,
|
text: "登录页.未同意协议".tr,
|
||||||
// );
|
textColor:
|
||||||
// return;
|
themeController.currentColor.sc9,
|
||||||
// }
|
);
|
||||||
// await loginController
|
return;
|
||||||
// .wxLoginSendAuth(context);
|
}
|
||||||
TopSlideNotification.show(context,
|
MHTLoginController loginController =
|
||||||
text: "测试阶段,暂不支持".tr);
|
Get.find();
|
||||||
|
await loginController
|
||||||
|
.wxLoginSendAuth();
|
||||||
|
// TopSlideNotification.show(context,
|
||||||
|
// text: "测试阶段,暂不支持".tr);
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 90.rpx,
|
width: 90.rpx,
|
||||||
|
|||||||
10
pubspec.yaml
10
pubspec.yaml
@@ -7,6 +7,16 @@ version: 1.0.0+1
|
|||||||
environment:
|
environment:
|
||||||
sdk: ^3.5.4
|
sdk: ^3.5.4
|
||||||
|
|
||||||
|
fluwx:
|
||||||
|
app_id: 'wx929c548fea6af9c7' #填写自己的 WeChat app id.
|
||||||
|
debug_logging: false # Logging in debug mode.
|
||||||
|
android:
|
||||||
|
# interrupt_wx_request: true # Defaults to true.
|
||||||
|
# flutter_activity: 'MainActivity' # Defaults to app's launcher
|
||||||
|
ios:
|
||||||
|
universal_link: https://zhmht.swes.com.cn
|
||||||
|
no_pay: true # Set to true to disable payment.
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
qr_flutter: ^4.1.0
|
qr_flutter: ^4.1.0
|
||||||
flutter:
|
flutter:
|
||||||
|
|||||||
Reference in New Issue
Block a user