소스 검색

[new]文件列表增加上拉加载更多上下拉刷新

zk 1 년 전
부모
커밋
0dd976f0cd

BIN
assets/images/icon_talk_analysis.webp


+ 2 - 0
assets/string/base/string.xml

@@ -69,4 +69,6 @@
     <string name="talk_traffic_remind_tips">以后不再提示</string>
     <string name="talk_upload_file_not_exist">文件不存在</string>
     <string name="talk_audio_loading">音频正在加载中</string>
+    <string name="talk_all">全部谈话</string>
+    <string name="talk_file_not_find">文件不存在</string>
 </resources>

+ 6 - 0
lib/data/api/atmob_api.dart

@@ -14,6 +14,7 @@ import 'package:electronic_assistant/data/api/request/talk_create_request.dart';
 import 'package:electronic_assistant/data/api/request/talk_delete_request.dart';
 import 'package:electronic_assistant/data/api/request/talk_file_request.dart';
 import 'package:electronic_assistant/data/api/request/talk_generate_request.dart';
+import 'package:electronic_assistant/data/api/request/talk_paginate_request.dart';
 import 'package:electronic_assistant/data/api/request/talk_query_request.dart';
 import 'package:electronic_assistant/data/api/request/talk_rename_request.dart';
 import 'package:electronic_assistant/data/api/request/talk_request.dart';
@@ -28,6 +29,7 @@ import 'package:electronic_assistant/data/api/response/login_response.dart';
 import 'package:electronic_assistant/data/api/response/talk_check_electric_response.dart';
 import 'package:electronic_assistant/data/api/response/talk_generate_response.dart';
 import 'package:electronic_assistant/data/api/response/talk_info_response.dart';
+import 'package:electronic_assistant/data/api/response/talk_paginate_response.dart';
 import 'package:electronic_assistant/data/api/response/talk_query_response.dart';
 import 'package:electronic_assistant/data/api/response/tasks_running_response.dart';
 import 'package:electronic_assistant/data/api/response/talk_original_response.dart';
@@ -117,6 +119,10 @@ abstract class AtmobApi {
   Future<BaseResponse<TalkQueryResponse>> talkQuery(
       @Body() TalkQueryRequest request);
 
+  @POST("/project/secretary/v1/talk/page")
+  Future<BaseResponse<TalkPaginateResponse>> talkPagePaginate(
+      @Body() TalkPaginateRequest request);
+
   @MultiPart()
   @POST("/project/secretary/v1/talk/generate")
   Future<BaseResponse<TalkGenerateResponse>> uploadTalkFile(

+ 25 - 0
lib/data/api/request/talk_paginate_request.dart

@@ -0,0 +1,25 @@
+import 'package:electronic_assistant/base/app_base_request.dart';
+import 'package:json_annotation/json_annotation.dart';
+
+part 'talk_paginate_request.g.dart';
+
+@JsonSerializable()
+class TalkPaginateRequest extends AppBaseRequest {
+  @JsonKey(name: 'page')
+  int page;
+
+  @JsonKey(name: 'pageSize')
+  int pageSize;
+
+  @JsonKey(name: 'searchKeyword')
+  String? searchKeyword;
+
+  @JsonKey(name: 'sortType')
+  int? sortType;
+
+  TalkPaginateRequest(this.page, this.pageSize,
+      {this.searchKeyword, this.sortType});
+
+  @override
+  Map<String, dynamic> toJson() => _$TalkPaginateRequestToJson(this);
+}

+ 18 - 0
lib/data/api/response/talk_paginate_response.dart

@@ -0,0 +1,18 @@
+import 'package:electronic_assistant/data/bean/talks.dart';
+import 'package:json_annotation/json_annotation.dart';
+
+part 'talk_paginate_response.g.dart';
+
+@JsonSerializable()
+class TalkPaginateResponse {
+  @JsonKey(name: 'count')
+  int count;
+
+  @JsonKey(name: 'list')
+  List<TalkBean>? list;
+
+  TalkPaginateResponse(this.count, this.list);
+
+  factory TalkPaginateResponse.fromJson(Map<String, dynamic> json) =>
+      _$TalkPaginateResponseFromJson(json);
+}

+ 39 - 2
lib/data/repositories/talk_repository.dart

@@ -1,24 +1,61 @@
 import 'dart:io';
 
-import 'package:dio/dio.dart';
 import 'package:electronic_assistant/data/api/atmob_api.dart';
 import 'package:electronic_assistant/data/api/request/talk_create_request.dart';
 import 'package:electronic_assistant/data/api/request/talk_delete_request.dart';
 import 'package:electronic_assistant/data/api/request/talk_file_request.dart';
-import 'package:get/get_state_manager/src/rx_flutter/rx_disposable.dart';
+import 'package:get/get.dart';
 
 import '../../utils/http_handler.dart';
 import '../api/request/talk_generate_request.dart';
+import '../api/request/talk_paginate_request.dart';
 import '../api/request/talk_rename_request.dart';
 import '../api/request/talk_request.dart';
 import '../api/response/talk_check_electric_response.dart';
 import '../api/response/talk_info_response.dart';
+import '../api/response/talk_paginate_response.dart';
 import '../bean/talk_original.dart';
 import '../bean/talks.dart';
 
 class TalkRepository {
   TalkRepository._();
 
+  final RxList<Rxn<TalkBean>> _talkList = <Rxn<TalkBean>>[].obs;
+
+  RxList<Rxn<TalkBean>> get talkList => _talkList;
+
+  void addNewTalkData(TalkBean talkInfo) {
+    _talkList.insert(0, Rxn<TalkBean>(talkInfo));
+  }
+
+  clearTalkList() {
+    _talkList.clear();
+  }
+
+  Future<TalkPaginateResponse> requestTalkPagePaginate(int page, int pageSize,
+      {String? searchKeyword, int? sortType = 1}) {
+    return talkPagePaginate(page, pageSize,
+            searchKeyword: searchKeyword, sortType: sortType)
+        .then((response) {
+      if (page == 1) {
+        _talkList.clear();
+      }
+      if (response.list != null) {
+        _talkList.addAll(response.list!.map((e) => Rxn<TalkBean>(e)).toList());
+      }
+      return response;
+    });
+  }
+
+  ///sortType 1:按创建时间倒序 2:按更新时间倒序
+  Future<TalkPaginateResponse> talkPagePaginate(int page, int pageSize,
+      {String? searchKeyword, int? sortType = 1}) {
+    return atmobApi
+        .talkPagePaginate(TalkPaginateRequest(page, pageSize,
+            searchKeyword: searchKeyword, sortType: sortType))
+        .then(HttpHandler.handle(false));
+  }
+
   Future<List<TalkOriginal>> talkOriginal(String? talkId) {
     return atmobApi
         .talkOriginal(TalkRequest(talkId))

+ 45 - 3
lib/module/files/controller.dart

@@ -1,9 +1,51 @@
 import 'package:electronic_assistant/base/base_controller.dart';
+import 'package:electronic_assistant/data/repositories/talk_repository.dart';
+import 'package:electronic_assistant/utils/error_handler.dart';
+import 'package:flutter/widgets.dart';
+import 'package:get/get_rx/src/rx_types/rx_types.dart';
+import 'package:pull_to_refresh/pull_to_refresh.dart';
+
+import '../../data/bean/talks.dart';
 
 class FilesController extends BaseController {
+  final refreshController = RefreshController(initialRefresh: false);
+
+  int page = 1;
+
+  int pageSize = 10;
+
   @override
-  void onInit() {
-    // TODO: implement onInit
-    super.onInit();
+  void onReady() {
+    super.onReady();
+    onRefreshData();
+  }
+
+  RxList<Rxn<TalkBean>> get talkList => talkRepository.talkList;
+
+  void requestTalkData({int page = 1}) {
+    talkRepository.requestTalkPagePaginate(page, pageSize).then((response) {
+      debugPrint("requestTalkData-response-$response");
+      if (talkRepository.talkList.length >= response.count) {
+        debugPrint("requestTalkData-没有更多数据了");
+        refreshController.loadNoData();
+      } else {
+        refreshController.loadComplete();
+      }
+      refreshController.refreshCompleted();
+    }).catchError((error) {
+      debugPrint("requestTalkData-catchError-$error");
+      refreshController.loadFailed();
+      refreshController.refreshFailed();
+      ErrorHandler.toastError(error);
+    });
+  }
+
+  void onRefreshData() {
+    page = 1;
+    requestTalkData(page: page);
+  }
+
+  void onLoadMoreTalkData() {
+    requestTalkData(page: ++page);
   }
 }

+ 157 - 129
lib/module/files/view.dart

@@ -1,11 +1,17 @@
 import 'package:electronic_assistant/base/base_page.dart';
+import 'package:electronic_assistant/data/bean/talks.dart';
+import 'package:electronic_assistant/dialog/alert_dialog.dart';
 import 'package:electronic_assistant/module/files/controller.dart';
+import 'package:electronic_assistant/module/talk/view.dart';
 import 'package:electronic_assistant/resource/colors.gen.dart';
+import 'package:electronic_assistant/resource/string.gen.dart';
 import 'package:electronic_assistant/router/app_pages.dart';
+import 'package:electronic_assistant/utils/expand.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter_screenutil/flutter_screenutil.dart';
 import 'package:get/get.dart';
 import 'package:get/get_core/src/get_main.dart';
+import 'package:pull_to_refresh/pull_to_refresh.dart';
 
 import '../../resource/assets.gen.dart';
 
@@ -22,83 +28,93 @@ class FilesPage extends BasePage<FilesController> {
     return Scaffold(
       backgroundColor: const Color.fromRGBO(246, 245, 248, 1),
       appBar: AppBar(
-        title: const Text('文件夹'),
+        title: Text(StringName.talkAll.tr),
         backgroundColor: const Color.fromRGBO(246, 245, 248, 1),
         scrolledUnderElevation: 0,
-        actions: [
-          IconButton(
-            onPressed: () {},
-            icon: ImageIcon(Assets.images.iconFilesNewDir.provider()),
-          ),
-          IconButton(
-            onPressed: () {},
-            icon: ImageIcon(Assets.images.iconMore.provider()),
-          ),
-        ],
+        // actions: [
+        //   IconButton(
+        //     onPressed: () {},
+        //     icon: ImageIcon(Assets.images.iconFilesNewDir.provider()),
+        //   ),
+        //   IconButton(
+        //     onPressed: () {},
+        //     icon: ImageIcon(Assets.images.iconMore.provider()),
+        //   ),
+        // ],
       ),
       body: Column(
         children: [
-          Column(
-            children: [
-              GestureDetector(
-                onTap: () {
-                  Get.toNamed(RoutePath.fileSearch);
-                },
-                child: Container(
-                  margin: EdgeInsets.symmetric(horizontal: 12.w),
-                  padding:
-                      EdgeInsets.symmetric(horizontal: 10.w, vertical: 8.w),
-                  height: 36.w,
-                  decoration: BoxDecoration(
-                    color: Colors.white,
-                    borderRadius: BorderRadius.circular(8.w),
-                  ),
-                  child: TextField(
-                    maxLines: 1,
-                    textAlignVertical: TextAlignVertical.center,
-                    textInputAction: TextInputAction.search,
-                    decoration: InputDecoration(
-                        hintText: '搜索所有文件标题 / 内容',
-                        border: InputBorder.none,
-                        icon: ImageIcon(Assets.images.iconSearch.provider()),
-                        iconColor: const Color.fromRGBO(95, 95, 97, 1),
-                        enabled: false),
-                    style: TextStyle(fontSize: 14.sp),
-                  ),
-                ),
-              ),
-            ],
-          ),
+          // Column(
+          //   children: [
+          //     GestureDetector(
+          //       onTap: () {
+          //         Get.toNamed(RoutePath.fileSearch);
+          //       },
+          //       child: Container(
+          //         margin: EdgeInsets.symmetric(horizontal: 12.w),
+          //         padding:
+          //             EdgeInsets.symmetric(horizontal: 10.w, vertical: 8.w),
+          //         height: 36.w,
+          //         decoration: BoxDecoration(
+          //           color: Colors.white,
+          //           borderRadius: BorderRadius.circular(8.w),
+          //         ),
+          //         child: TextField(
+          //           maxLines: 1,
+          //           textAlignVertical: TextAlignVertical.center,
+          //           textInputAction: TextInputAction.search,
+          //           decoration: InputDecoration(
+          //               hintText: '搜索所有文件标题 / 内容',
+          //               border: InputBorder.none,
+          //               icon: ImageIcon(Assets.images.iconSearch.provider()),
+          //               iconColor: const Color.fromRGBO(95, 95, 97, 1),
+          //               enabled: false),
+          //           style: TextStyle(fontSize: 14.sp),
+          //         ),
+          //       ),
+          //     ),
+          //   ],
+          // ),
           Expanded(
               child: Padding(
-                  padding: EdgeInsets.only(top: 16.w, left: 12.w, right: 12.w),
-                  child: CustomScrollView(
-                    slivers: [
-                      SliverAnimatedGrid(
-                        itemBuilder: _buildDirItem,
-                        gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
-                          crossAxisCount: 2,
-                          crossAxisSpacing: 8.w,
-                          mainAxisSpacing: 8.w,
-                          childAspectRatio: 164 / 65,
-                        ),
-                        initialItemCount: 10,
-                      ),
-                      SliverToBoxAdapter(
-                        child: Padding(
-                            padding: EdgeInsets.only(top: 20.w, bottom: 12.w),
-                            child: Text('全部谈话',
-                                style: TextStyle(
-                                    fontSize: 14.sp,
-                                    color: ColorName.secondaryTextColor,
-                                    fontWeight: FontWeight.bold))),
-                      ),
-                      SliverAnimatedList(
+            // padding: EdgeInsets.only(top: 16.w, left: 12.w, right: 12.w),
+            padding: EdgeInsets.only(left: 12.w, right: 12.w),
+            child: SmartRefresher(
+              enablePullUp: true,
+              enablePullDown: true,
+              controller: controller.refreshController,
+              onRefresh: controller.onRefreshData,
+              onLoading: controller.onLoadMoreTalkData,
+              child: CustomScrollView(
+                slivers: [
+                  // SliverAnimatedGrid(
+                  //   itemBuilder: _buildDirItem,
+                  //   gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
+                  //     crossAxisCount: 2,
+                  //     crossAxisSpacing: 8.w,
+                  //     mainAxisSpacing: 8.w,
+                  //     childAspectRatio: 164 / 65,
+                  //   ),
+                  //   initialItemCount: 10,
+                  // ),
+                  // SliverToBoxAdapter(
+                  //   child: Padding(
+                  //       padding: EdgeInsets.only(top: 20.w, bottom: 12.w),
+                  //       child: Text(StringName.talkAll.tr,
+                  //           style: TextStyle(
+                  //               fontSize: 14.sp,
+                  //               color: ColorName.secondaryTextColor,
+                  //               fontWeight: FontWeight.bold))),
+                  // ),
+                  Obx(() {
+                    return SliverList.builder(
                         itemBuilder: _buildFileItem,
-                        initialItemCount: 20,
-                      )
-                    ],
-                  )))
+                        itemCount: controller.talkList.length);
+                  }),
+                ],
+              ),
+            ),
+          ))
         ],
       ),
     );
@@ -146,68 +162,80 @@ class FilesPage extends BasePage<FilesController> {
     );
   }
 
-  Widget _buildFileItem(
-      BuildContext context, int index, Animation<double> animation) {
+  Widget _buildFileItem(BuildContext context, int index) {
+    TalkBean? talkBean = controller.talkList[index].value;
+    if (talkBean == null) {
+      return Container();
+    }
     return Padding(
         padding: EdgeInsets.only(bottom: 8.w),
-        child: Container(
-          decoration: BoxDecoration(
-            color: Colors.white,
-            borderRadius: BorderRadius.circular(8.w),
-          ),
-          padding: EdgeInsets.symmetric(horizontal: 10.w, vertical: 14.w),
-          child: Row(
-            crossAxisAlignment: CrossAxisAlignment.start,
-            children: [
-              Image(
-                  image: Assets.images.iconFilesFile.provider(),
-                  width: 28.w,
-                  height: 32.w),
-              Expanded(
-                  child: Padding(
-                padding: EdgeInsets.symmetric(horizontal: 8.w),
-                child: Column(
-                  crossAxisAlignment: CrossAxisAlignment.start,
-                  children: [
-                    Text('文件标题',
-                        maxLines: 1,
-                        overflow: TextOverflow.ellipsis,
-                        style: TextStyle(
-                            fontSize: 14.sp,
-                            color: ColorName.primaryTextColor,
-                            fontWeight: FontWeight.bold)),
-                    Text(
-                        '这个群,现在由我管理。目的是把你们训练成一个个社会高薪人士,从本周起,hhhhhhhhhhhhh已经开始执行军事化理...',
-                        maxLines: 2,
-                        overflow: TextOverflow.ellipsis,
-                        style: TextStyle(
-                            fontSize: 12.sp,
-                            color: ColorName.secondaryTextColor)),
-                    Container(
-                      margin: EdgeInsets.only(top: 6.w),
-                      child: Row(
-                        crossAxisAlignment: CrossAxisAlignment.center,
-                        children: [
-                          Text("1m12s",
-                              style: TextStyle(
-                                  fontSize: 12.sp,
-                                  color: ColorName.tertiaryTextColor)),
-                          Text("  |  ",
-                              style: TextStyle(
-                                  fontSize: 12.sp,
-                                  color: ColorName.tertiaryTextColor,
-                                  fontWeight: FontWeight.bold)),
-                          Text("2021-09-09 12:00:00",
-                              style: TextStyle(
-                                  fontSize: 12.sp,
-                                  color: ColorName.tertiaryTextColor)),
-                        ],
-                      ),
-                    )
-                  ],
-                ),
-              )),
-            ],
+        child: GestureDetector(
+          onTap: () {
+            TalkPage.start(talkBean);
+          },
+          child: Container(
+            decoration: BoxDecoration(
+              color: Colors.white,
+              borderRadius: BorderRadius.circular(8.w),
+            ),
+            padding: EdgeInsets.symmetric(horizontal: 10.w, vertical: 14.w),
+            child: Row(
+              crossAxisAlignment: CrossAxisAlignment.start,
+              children: [
+                Image(
+                    image: (talkBean.status == TalkStatus.analysing ||
+                            talkBean.status == TalkStatus.waitAnalysis)
+                        ? Assets.images.iconTalkAnalysis.provider()
+                        : Assets.images.iconFilesFile.provider(),
+                    width: 28.w,
+                    height: 32.w),
+                Expanded(
+                    child: Padding(
+                  padding: EdgeInsets.symmetric(horizontal: 8.w),
+                  child: Column(
+                    crossAxisAlignment: CrossAxisAlignment.start,
+                    children: [
+                      Text(talkBean.title.orEmpty,
+                          maxLines: 1,
+                          overflow: TextOverflow.ellipsis,
+                          style: TextStyle(
+                              fontSize: 14.sp,
+                              color: ColorName.primaryTextColor,
+                              fontWeight: FontWeight.bold)),
+                      Text(talkBean.summary.orEmpty,
+                          maxLines: 2,
+                          overflow: TextOverflow.ellipsis,
+                          style: TextStyle(
+                              fontSize: 12.sp,
+                              color: talkBean.status == TalkStatus.analysisFail
+                                  ? "#F5574E".toColor()
+                                  : ColorName.secondaryTextColor)),
+                      Container(
+                        margin: EdgeInsets.only(top: 6.w),
+                        child: Row(
+                          crossAxisAlignment: CrossAxisAlignment.center,
+                          children: [
+                            Text(talkBean.duration.toFormattedDuration(),
+                                style: TextStyle(
+                                    fontSize: 12.sp,
+                                    color: ColorName.tertiaryTextColor)),
+                            Text("  |  ",
+                                style: TextStyle(
+                                    fontSize: 12.sp,
+                                    color: ColorName.tertiaryTextColor,
+                                    fontWeight: FontWeight.bold)),
+                            Text(talkBean.createTime.orEmpty,
+                                style: TextStyle(
+                                    fontSize: 12.sp,
+                                    color: ColorName.tertiaryTextColor)),
+                          ],
+                        ),
+                      )
+                    ],
+                  ),
+                )),
+              ],
+            ),
           ),
         ));
   }

+ 3 - 0
lib/module/home/controller.dart

@@ -8,6 +8,7 @@ import 'package:electronic_assistant/resource/string.gen.dart';
 import 'package:electronic_assistant/utils/event_bus.dart';
 import 'package:electronic_assistant/utils/toast_util.dart';
 import 'package:electronic_assistant/widget/pull_to_refresh.dart';
+import 'package:flutter/cupertino.dart';
 import 'package:get/get.dart';
 import '../../data/bean/agenda.dart';
 import '../../data/repositories/account_repository.dart';
@@ -27,6 +28,8 @@ class HomePageController extends BaseController {
 
   final refreshController = PullToRefreshController();
 
+  BuildContext? todoTargetContext;
+
   @override
   void onReady() {
     super.onReady();

+ 3 - 5
lib/module/home/view.dart

@@ -22,9 +22,7 @@ import '../task/task_item_view.dart';
 import 'controller.dart';
 
 class HomePage extends BasePage<HomePageController> {
-  HomePage({super.key});
-
-  BuildContext? todoTargetContext;
+  const HomePage({super.key});
 
   @override
   Widget buildBody(BuildContext context) {
@@ -292,7 +290,7 @@ class HomePage extends BasePage<HomePageController> {
                             color: ColorName.colorPrimary,
                             fontWeight: FontWeight.bold)),
                     Builder(builder: (context) {
-                      todoTargetContext = context;
+                      controller.todoTargetContext = context;
                       return Text(StringName.homeTalkQuickAudio.tr,
                           style: TextStyle(
                               fontSize: 10.sp,
@@ -456,7 +454,7 @@ class HomePage extends BasePage<HomePageController> {
 
   void showUnfinishedRecordPopup() {
     SmartDialog.showAttach(
-      targetContext: todoTargetContext,
+      targetContext: controller.todoTargetContext,
       alignment: Alignment.bottomRight,
       animationType: SmartAnimationType.fade,
       clickMaskDismiss: true,

+ 1 - 1
lib/module/main/view.dart

@@ -19,7 +19,7 @@ class MainTabPage extends BasePage<MainController> {
   MainTabPage({super.key});
 
   final pages = [
-    HomePage(),
+    const HomePage(),
     const FilesPage(),
   ];
 

+ 2 - 0
lib/module/record/controller.dart

@@ -184,6 +184,8 @@ class RecordController extends BaseController {
     talkRepository
         .talkCreate(_lastRecordId, currentDuration.value.toInt())
         .then((talkInfo) async {
+      //添加新的录音到最新记录
+      talkRepository.addNewTalkData(talkInfo);
       File pcmFile = await _getCurrentRecordFile();
       if (pcmFile.existsSync()) {
         File wavFile = await getRecordFile(talkInfo.id);

+ 12 - 1
lib/module/talk/controller.dart

@@ -36,6 +36,10 @@ class TalkController extends BaseController {
 
   final double sliderMax = 1;
 
+  bool? audioFileIsExist;
+
+  bool? isUploadedFile;
+
   final isAudioPlaying = false.obs;
 
   final audioProgressValue = 0.0.obs;
@@ -115,7 +119,9 @@ class TalkController extends BaseController {
     try {
       File file = await RecordController.getRecordFile(id);
       await _audioPlayer.setAudioSource(AudioSource.uri(file.uri));
+      audioFileIsExist = true;
     } catch (e) {
+      audioFileIsExist = false;
       debugPrint('音频设置异常 == $e');
     }
   }
@@ -133,6 +139,10 @@ class TalkController extends BaseController {
   }
 
   void clickPlayAudio() {
+    if (audioFileIsExist != true) {
+      ToastUtil.showToast(StringName.talkFileNotFind.tr);
+      return;
+    }
     if (isAudioLoading) {
       ToastUtil.showToast(StringName.talkAudioLoading.tr);
       return;
@@ -256,11 +266,12 @@ class TalkController extends BaseController {
     String? talkId = talkBean.value?.id;
     double? duration = talkBean.value?.duration;
 
-    if (talkId == null || duration == null) {
+    if (talkId == null || duration == null || isUploadedFile == true) {
       return;
     }
     talkRepository.uploadTalkFile(talkId, duration, file).then((taskId) {
       ToastUtil.showToast('提交成功,小听正在分析谈话,请稍后');
+      isUploadedFile = true;
       talkBean.value?.taskId = taskId;
       talkBean.value?.status = TalkStatus.analysing;
       taskRepository.addTask(taskId);

+ 6 - 1
lib/module/talk/original/view.dart

@@ -1,4 +1,5 @@
 import 'package:electronic_assistant/base/base_page.dart';
+import 'package:electronic_assistant/data/bean/talks.dart';
 import 'package:electronic_assistant/resource/colors.gen.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter_screenutil/flutter_screenutil.dart';
@@ -18,7 +19,11 @@ class OriginalView extends BasePage<OriginalController> {
 
   Widget buildOriginalContentView() {
     return Obx(() {
-      if (controller.originalList.isEmpty) {
+      if (controller.originalList.isEmpty &&
+          controller.talkController.talkBean.value?.status ==
+              TalkStatus.analysisFail) {
+        return getTalkFailView();
+      } else if (controller.originalList.isEmpty) {
         return getTalkLoadingView();
       } else {
         return ListView.builder(

+ 2 - 3
lib/router/app_pages.dart

@@ -1,3 +1,4 @@
+import 'package:electronic_assistant/module/files/controller.dart';
 import 'package:electronic_assistant/module/main/controller.dart';
 import 'package:electronic_assistant/module/store/controller.dart';
 import 'package:electronic_assistant/module/store/view.dart';
@@ -67,6 +68,7 @@ class AppBinding extends Bindings {
     lazyPut(() => SummaryController());
     lazyPut(() => TodoController());
     lazyPut(() => StoreController());
+    lazyPut(() => FilesController());
   }
 
   void lazyPut<S>(InstanceBuilderCallback<S> builder) {
@@ -84,9 +86,6 @@ final generalPages = [
   GetPage(name: RoutePath.task, page: () => const TaskPage()),
   GetPage(name: RoutePath.taskSearch, page: () => const TaskSearchPage()),
   GetPage(name: RoutePath.record, page: () => const RecordPage()),
-  GetPage(name: RoutePath.talkDetail, page: () => const TalkPage()),
-  GetPage(name: RoutePath.record, page: () => const RecordPage()),
-  GetPage(name: RoutePath.talkDetail, page: () => const TalkPage()),
   GetPage(name: RoutePath.store, page: () => const StorePage()),
   GetPage(name: RoutePath.talkDetail, page: () => const TalkPage()),
 ];