feat: 增加客服2
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
|
||||
import 'package:kaer_with_panels/app/widgets/hi_base_scaffold.dart';
|
||||
import 'package:kaer_with_panels/app/widgets/kr_simple_loading.dart';
|
||||
import '../controllers/kr_chatwoot_controller.dart';
|
||||
|
||||
/// 客服2(Chatwoot)视图页面
|
||||
class KRChatwootView extends GetView<KRChatwootController> {
|
||||
const KRChatwootView({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return HIBaseScaffold(
|
||||
showBack: true,
|
||||
topContentAreaHeight: 0,
|
||||
child: Stack(
|
||||
children: [
|
||||
InAppWebView(
|
||||
initialUrlRequest: URLRequest(
|
||||
url: WebUri(controller.kr_chatwootUrl),
|
||||
),
|
||||
initialSettings: InAppWebViewSettings(
|
||||
javaScriptEnabled: true,
|
||||
domStorageEnabled: true,
|
||||
allowsInlineMediaPlayback: true,
|
||||
),
|
||||
onLoadStart: (controller, url) {
|
||||
this.controller.kr_setLoading(true);
|
||||
},
|
||||
onLoadStop: (controller, url) {
|
||||
this.controller.kr_setLoading(false);
|
||||
},
|
||||
onReceivedError: (controller, request, error) {
|
||||
this.controller.kr_setLoading(false);
|
||||
},
|
||||
),
|
||||
Obx(() {
|
||||
if (controller.kr_isLoading.value) {
|
||||
return const Center(
|
||||
child: KRSimpleLoading(
|
||||
size: 40,
|
||||
),
|
||||
);
|
||||
}
|
||||
return const SizedBox.shrink();
|
||||
}),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user