Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
ethan
/
appframe
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit 578e3512
authored
2026-01-15 13:50:01 +0800
by
tanghuan
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
在线客服改为打开微信小程序
1 parent
382d1d21
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
8 deletions
lib/bloc/web_cubit.dart
lib/ui/pages/web_page.dart
lib/bloc/web_cubit.dart
View file @
578e351
...
@@ -17,6 +17,7 @@ import 'package:dio/dio.dart';
...
@@ -17,6 +17,7 @@ import 'package:dio/dio.dart';
import
'package:equatable/equatable.dart'
;
import
'package:equatable/equatable.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_bloc/flutter_bloc.dart'
;
import
'package:flutter_bloc/flutter_bloc.dart'
;
import
'package:fluwx/fluwx.dart'
;
import
'package:path_provider/path_provider.dart'
;
import
'package:path_provider/path_provider.dart'
;
import
'package:permission_handler/permission_handler.dart'
;
import
'package:permission_handler/permission_handler.dart'
;
import
'package:shared_preferences/shared_preferences.dart'
;
import
'package:shared_preferences/shared_preferences.dart'
;
...
@@ -199,6 +200,7 @@ class WebState extends Equatable {
...
@@ -199,6 +200,7 @@ class WebState extends Equatable {
class
WebCubit
extends
Cubit
<
WebState
>
with
WidgetsBindingObserver
{
class
WebCubit
extends
Cubit
<
WebState
>
with
WidgetsBindingObserver
{
late
final
MessageDispatcher
_dispatcher
;
late
final
MessageDispatcher
_dispatcher
;
late
final
WebViewController
_controller
;
late
final
WebViewController
_controller
;
late
final
Fluwx
_fluwx
;
HttpServer
?
_server
;
HttpServer
?
_server
;
PlayerService
?
_playerService
;
PlayerService
?
_playerService
;
RecorderService
?
_recorderService
;
RecorderService
?
_recorderService
;
...
@@ -272,6 +274,7 @@ class WebCubit extends Cubit<WebState> with WidgetsBindingObserver {
...
@@ -272,6 +274,7 @@ class WebCubit extends Cubit<WebState> with WidgetsBindingObserver {
_readH5ShowVersion
();
_readH5ShowVersion
();
// 初始化其它一些属性
// 初始化其它一些属性
_fluwx
=
getIt
.
get
<
Fluwx
>();
_playerService
=
getIt
.
get
<
PlayerService
>();
_playerService
=
getIt
.
get
<
PlayerService
>();
_playerService
?.
sendResponse
=
_sendResponse
;
_playerService
?.
sendResponse
=
_sendResponse
;
_recorderService
=
getIt
.
get
<
RecorderService
>();
_recorderService
=
getIt
.
get
<
RecorderService
>();
...
@@ -483,6 +486,19 @@ class WebCubit extends Cubit<WebState> with WidgetsBindingObserver {
...
@@ -483,6 +486,19 @@ class WebCubit extends Cubit<WebState> with WidgetsBindingObserver {
emit
(
state
.
copyWith
(
loaded:
true
));
emit
(
state
.
copyWith
(
loaded:
true
));
}
}
///
/// 跳转客服(微信小程序)
///
void
goCs
()
{
_fluwx
.
open
(
target:
MiniProgram
(
username:
'gh_0ed02e873abc'
,
path:
'/pages/agentChat/index?showAuthDirectly=1&agentId=eiXH0MAJmjgl'
,
miniProgramType:
WXMiniProgramType
.
release
,
),
);
}
void
goLogin
()
{
void
goLogin
()
{
router
.
go
(
'/loginMain'
);
router
.
go
(
'/loginMain'
);
}
}
...
...
lib/ui/pages/web_page.dart
View file @
578e351
...
@@ -320,14 +320,7 @@ class WebPage extends StatelessWidget {
...
@@ -320,14 +320,7 @@ class WebPage extends StatelessWidget {
title:
const
Text
(
'在线客服'
,
style:
TextStyle
(
fontSize:
14
)),
title:
const
Text
(
'在线客服'
,
style:
TextStyle
(
fontSize:
14
)),
onTap:
()
{
onTap:
()
{
Navigator
.
pop
(
ctx
);
Navigator
.
pop
(
ctx
);
router
.
push
(
ctx
.
read
<
WebCubit
>().
goCs
();
'/link'
,
extra:
{
'url'
:
'https://yuanqi.tencent.com/webim/#/chat/DKfyFo?appid=1970738784338535872&experience=true'
,
'title'
:
'在线客服'
},
);
},
},
contentPadding:
const
EdgeInsets
.
symmetric
(
horizontal:
16
,
vertical:
4
),
contentPadding:
const
EdgeInsets
.
symmetric
(
horizontal:
16
,
vertical:
4
),
trailing:
Icon
(
Icons
.
arrow_forward_ios
,
size:
14
),
trailing:
Icon
(
Icons
.
arrow_forward_ios
,
size:
14
),
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment