|
@@ -3,14 +3,17 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
import 'package:get/get.dart';
|
|
import 'package:get/get.dart';
|
|
|
import 'package:keyboard/base/base_view.dart';
|
|
import 'package:keyboard/base/base_view.dart';
|
|
|
import 'package:keyboard/data/bean/upload_info.dart';
|
|
import 'package:keyboard/data/bean/upload_info.dart';
|
|
|
|
|
+import '../../../../data/bean/image_viewer_item.dart';
|
|
|
import '../../../../data/bean/option_select_config.dart';
|
|
import '../../../../data/bean/option_select_config.dart';
|
|
|
import '../../../../data/bean/option_select_item.dart';
|
|
import '../../../../data/bean/option_select_item.dart';
|
|
|
import '../../../../resource/assets.gen.dart';
|
|
import '../../../../resource/assets.gen.dart';
|
|
|
import '../../../../resource/colors.gen.dart';
|
|
import '../../../../resource/colors.gen.dart';
|
|
|
import '../../../../resource/string.gen.dart';
|
|
import '../../../../resource/string.gen.dart';
|
|
|
-import '../../../../utils/upload/upload_state.dart';
|
|
|
|
|
|
|
+import '../../../../utils/prefix_util.dart';
|
|
|
|
|
+import '../../../../utils/upload/file_data_source_util.dart';
|
|
|
import '../../../../widget/actionbtn/action_btn.dart';
|
|
import '../../../../widget/actionbtn/action_btn.dart';
|
|
|
import '../../../../widget/gradient_text.dart';
|
|
import '../../../../widget/gradient_text.dart';
|
|
|
|
|
+import '../../image_viewer/image_viewer_page.dart';
|
|
|
import '../../intimacy_analyse_upload/popup/reply_mode_select_popup.dart';
|
|
import '../../intimacy_analyse_upload/popup/reply_mode_select_popup.dart';
|
|
|
import '../../intimacy_analyse_upload/widget/upload_item_widget.dart';
|
|
import '../../intimacy_analyse_upload/widget/upload_item_widget.dart';
|
|
|
import '../../widget/option_select_widget.dart';
|
|
import '../../widget/option_select_widget.dart';
|
|
@@ -34,20 +37,33 @@ class ScanImageReplyView extends BaseView<ScanImageReplyController> {
|
|
|
return Stack(
|
|
return Stack(
|
|
|
children: [
|
|
children: [
|
|
|
SingleChildScrollView(
|
|
SingleChildScrollView(
|
|
|
- child: Column(
|
|
|
|
|
- children: [
|
|
|
|
|
- // 上传截图的卡片
|
|
|
|
|
- _buildUploadScreenshotCard(false),
|
|
|
|
|
- SizedBox(height: 14.h),
|
|
|
|
|
- // 选项卡片
|
|
|
|
|
- _buildOptionCard(),
|
|
|
|
|
- SizedBox(height: 14.h),
|
|
|
|
|
- // 回复语气列表卡片
|
|
|
|
|
- _buildReplyToneListCard(),
|
|
|
|
|
- // 距离底部有一定间距
|
|
|
|
|
- SizedBox(height: 90.h),
|
|
|
|
|
- ],
|
|
|
|
|
- ),
|
|
|
|
|
|
|
+ child: Obx(() {
|
|
|
|
|
+ bool isSample = controller.uploadInfo.value == null;
|
|
|
|
|
+ if (isSample) {
|
|
|
|
|
+ return Column(
|
|
|
|
|
+ children: [
|
|
|
|
|
+ // 上传截图的卡片
|
|
|
|
|
+ _buildUploadScreenshotCard(true),
|
|
|
|
|
+ SizedBox(height: 14.h),
|
|
|
|
|
+ ],
|
|
|
|
|
+ );
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return Column(
|
|
|
|
|
+ children: [
|
|
|
|
|
+ // 上传截图的卡片
|
|
|
|
|
+ _buildUploadScreenshotCard(false),
|
|
|
|
|
+ SizedBox(height: 14.h),
|
|
|
|
|
+ // 选项卡片
|
|
|
|
|
+ _buildOptionCard(),
|
|
|
|
|
+ SizedBox(height: 14.h),
|
|
|
|
|
+ // 回复语气列表卡片
|
|
|
|
|
+ _buildReplyToneListCard(),
|
|
|
|
|
+ // 距离底部有一定间距
|
|
|
|
|
+ SizedBox(height: 90.h),
|
|
|
|
|
+ ],
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+ }),
|
|
|
),
|
|
),
|
|
|
// 上传截图按钮
|
|
// 上传截图按钮
|
|
|
Positioned.fill(
|
|
Positioned.fill(
|
|
@@ -120,7 +136,7 @@ class ScanImageReplyView extends BaseView<ScanImageReplyController> {
|
|
|
} else {
|
|
} else {
|
|
|
// 上传
|
|
// 上传
|
|
|
imageWidget = UploadItemWidget(
|
|
imageWidget = UploadItemWidget(
|
|
|
- imageUploadInfo: controller.uploadInfo.value,
|
|
|
|
|
|
|
+ imageUploadInfo: controller.uploadInfo.value!,
|
|
|
hasDeleteBtn: false,
|
|
hasDeleteBtn: false,
|
|
|
// 失败时的遮罩
|
|
// 失败时的遮罩
|
|
|
uploadFailMaskWidget: UploadFailMaskWidget(
|
|
uploadFailMaskWidget: UploadFailMaskWidget(
|
|
@@ -140,6 +156,19 @@ class ScanImageReplyView extends BaseView<ScanImageReplyController> {
|
|
|
),
|
|
),
|
|
|
onClickItemCallback: (UploadInfo uploadInfo) {
|
|
onClickItemCallback: (UploadInfo uploadInfo) {
|
|
|
// 预览图片
|
|
// 预览图片
|
|
|
|
|
+ ImageViewerItem imageViewerItem;
|
|
|
|
|
+ String src = FileDataSourceUtil.getFileDataSourceSrc(uploadInfo);
|
|
|
|
|
+ // 远程图片
|
|
|
|
|
+ if (PrefixUtil.isRemoteImage(src)) {
|
|
|
|
|
+ imageViewerItem = ImageViewerItem.network(src);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 本地图片
|
|
|
|
|
+ imageViewerItem = ImageViewerItem.file(src);
|
|
|
|
|
+ }
|
|
|
|
|
+ ImageViewerPage.start([imageViewerItem]);
|
|
|
|
|
+ },
|
|
|
|
|
+ onClickDeleteCallback: (UploadInfo uploadInfo) {
|
|
|
|
|
+ controller.deleteUploadInfo(uploadInfo);
|
|
|
},
|
|
},
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|