From 464f1f2377435ade8b61863d438b8cd04b04783d Mon Sep 17 00:00:00 2001 From: wurong <953969641@qq.com> Date: Wed, 29 Mar 2023 14:53:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E5=85=91=E6=8D=A2=E5=88=B8?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=EF=BC=9B=20=E6=9B=B4=E6=94=B9=E9=A2=86?= =?UTF-8?q?=E5=88=B8=E4=B8=AD=E5=BF=83=EF=BC=8C=E5=85=91=E6=8D=A2=E5=88=B8?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC=EF=BC=9B=20=E5=8D=87=E7=BA=A7minSdkVersion?= =?UTF-8?q?=E7=89=88=E6=9C=AC=EF=BC=9A21-24=EF=BC=9B=20=EF=BC=8824?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=AF=B9Android=206.0=20Marshmallow=20?= =?UTF-8?q?=E5=8F=8A=E4=BB=A5=E4=B8=8B=E7=89=88=E6=9C=AC=E4=B8=8D=E5=8F=AF?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- android/app/build.gradle | 2 +- lib/community/release_dynamic.dart | 3 +- lib/home/welfare_page.dart | 4 +- lib/main.dart | 3 + lib/order/write_off_page.dart | 176 +++++++++++++++-------------- lib/utils/video_edit.dart | 37 ++++++ pubspec.lock | 7 ++ pubspec.yaml | 2 + 8 files changed, 144 insertions(+), 90 deletions(-) create mode 100644 lib/utils/video_edit.dart diff --git a/android/app/build.gradle b/android/app/build.gradle index f35fed4c..d3e582f3 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -105,7 +105,7 @@ android { defaultConfig { applicationId "com.zsw.huixiang" - minSdkVersion 21 + minSdkVersion 24 targetSdkVersion 30 versionCode flutterVersionCode.toInteger() versionName flutterVersionName diff --git a/lib/community/release_dynamic.dart b/lib/community/release_dynamic.dart index 5268345a..a015d5b5 100644 --- a/lib/community/release_dynamic.dart +++ b/lib/community/release_dynamic.dart @@ -225,7 +225,8 @@ class _ReleaseDynamic extends State { child: Text("视频"), onPressed: () { getImageOrVideo(GalleryMode.video); - Navigator.of(context).pop(); + // Navigator.of(context).pop(); + Navigator.of(context).popAndPushNamed('/router/video_edit'); }, isDefaultAction: true, isDestructiveAction: false, diff --git a/lib/home/welfare_page.dart b/lib/home/welfare_page.dart index 990cb680..44298662 100644 --- a/lib/home/welfare_page.dart +++ b/lib/home/welfare_page.dart @@ -1,3 +1,5 @@ +import 'dart:convert'; + import 'package:dio/dio.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -627,7 +629,7 @@ class _WelfarePage extends State { '/router/write_off_page', arguments: { "couponId": cop.id, - "coupon": cop.toJson() + "coupon": jsonEncode(cop.toJson()), }); } else { showStoreSelector(cop.storeList); diff --git a/lib/main.dart b/lib/main.dart index d3e6be7a..81f8619e 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -72,6 +72,7 @@ import 'package:huixiang/store/store_view/product_meals_sku.dart'; import 'package:huixiang/test_page.dart'; import 'package:huixiang/union/location_map_page.dart'; import 'package:huixiang/utils/ImgCachePath.dart'; +import 'package:huixiang/utils/video_edit.dart'; import 'package:huixiang/vip/user_vip_service_page.dart'; import 'package:huixiang/web/web_page.dart'; @@ -426,4 +427,6 @@ Map routers = { VipPayCode(), '/router/system_notice': (context, {arguments}) => SystemNotice(), + '/router/video_edit': (context, {arguments}) => + VideoEdit(), }; diff --git a/lib/order/write_off_page.dart b/lib/order/write_off_page.dart index 9eba17ea..ef485ba0 100644 --- a/lib/order/write_off_page.dart +++ b/lib/order/write_off_page.dart @@ -104,14 +104,16 @@ class _WriteOffPage extends State { children: [ Container( alignment: Alignment.topCenter, - height: 530.h, + height: 470.h, + // height:530.h child: Stack( alignment: Alignment.topCenter, children: [ Image.asset( "assets/image/write_off_bg.webp", width: MediaQuery.of(context).size.width * 0.912, - height: 540.h, + height: 480.h, + // height:540.h fit: BoxFit.fill, ), LayoutBuilder(builder: (context, constraints) { @@ -163,47 +165,47 @@ class _WriteOffPage extends State { mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ - Text( - coupon != null - ? "${coupon["memberCouponId"].substring(0, 4)} " - "${coupon["memberCouponId"].substring(4, 8)} " - "${coupon["memberCouponId"].substring(8, 12)} " - "${coupon["memberCouponId"].substring(12, 16)} " - "${coupon["memberCouponId"].substring(16, coupon["memberCouponId"].length)}" - : "", - style: TextStyle( - fontSize: 14.sp, - wordSpacing: coupon == null - ? 10 - : (MediaQuery.of(context).size.width - - 64.w) / - (((coupon["memberCouponId"].length) * 4)), - letterSpacing: coupon == null - ? 8 - : (MediaQuery.of(context).size.width - - 64.w) / - (((coupon["memberCouponId"].length) * 4)), - fontWeight: MyFontWeight.semi_bold, - color: Color(0xFF353535), - ), - ), - SizedBox( - height: 15.h, - ), - BarcodeWidget( - barcode: Barcode.code128(useCode128C: true), - data: coupon != null ? coupon["memberCouponId"] : "", - height: 72.h, - color: Colors.black, - drawText: false, - ), - SizedBox( - height: 16.h, - ), + // Text( + // coupon != null + // ? "${coupon["memberCouponId"].substring(0, 4)} " + // "${coupon["memberCouponId"].substring(4, 8)} " + // "${coupon["memberCouponId"].substring(8, 12)} " + // "${coupon["memberCouponId"].substring(12, 16)} " + // "${coupon["memberCouponId"].substring(16, coupon["memberCouponId"].length)}" + // : "", + // style: TextStyle( + // fontSize: 14.sp, + // wordSpacing: coupon == null + // ? 10 + // : (MediaQuery.of(context).size.width - + // 64.w) / + // (((coupon["memberCouponId"].length) * 4)), + // letterSpacing: coupon == null + // ? 8 + // : (MediaQuery.of(context).size.width - + // 64.w) / + // (((coupon["memberCouponId"].length) * 4)), + // fontWeight: MyFontWeight.semi_bold, + // color: Color(0xFF353535), + // ), + // ), + // SizedBox( + // height: 15.h, + // ), + // BarcodeWidget( + // barcode: Barcode.code128(useCode128C: true), + // data: coupon != null ? coupon["memberCouponId"] : "", + // height: 72.h, + // color: Colors.black, + // drawText: false, + // ), + // SizedBox( + // height: 16.h, + // ), Expanded(child: QrImage( data: "{\"type\":\"wiped\",\"memberCouponId\":\"${coupon["memberCouponId"]}\"}", version: QrVersions.auto, - size: 200.w, + size: 250.w, gapless: true, ),), SizedBox( @@ -485,54 +487,54 @@ class _WriteOffPage extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, children: [ - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - width: 3.w, - height: 15.h, - margin: - EdgeInsets.fromLTRB(4.w, 7.h, 4.w, 7.h), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(3), - color: Color(0xFF20662A), - ), - ), - Text( - S.of(context).shiyongtiaojian, - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 14.sp, - color: Color(0xFF353535), - ), - ), - ], - ), + // Row( + // mainAxisAlignment: MainAxisAlignment.start, + // crossAxisAlignment: CrossAxisAlignment.center, + // children: [ + // Container( + // width: 3.w, + // height: 15.h, + // margin: + // EdgeInsets.fromLTRB(4.w, 7.h, 4.w, 7.h), + // decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(3), + // color: Color(0xFF20662A), + // ), + // ), + // Text( + // S.of(context).shiyongtiaojian, + // style: TextStyle( + // fontWeight: FontWeight.bold, + // fontSize: 14.sp, + // color: Color(0xFF353535), + // ), + // ), + // ], + // ), + // SizedBox(height:12.h,), + // Row( + // mainAxisAlignment: MainAxisAlignment.start, + // crossAxisAlignment: CrossAxisAlignment.center, + // children: [ + // SizedBox( + // width: 11.w, + // ), + // Expanded( + // child: Text( + // S + // .of(context) + // .qianwanghuixiangmendianduihuanhexiao, + // style: TextStyle( + // textBaseline: TextBaseline.alphabetic, + // fontSize: 14.sp, + // height: 1.5.h, + // color: Color(0xFF353535)), + // ), + // flex: 1, + // ), + // ], + // ), SizedBox(height:12.h,), - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - width: 11.w, - ), - Expanded( - child: Text( - S - .of(context) - .qianwanghuixiangmendianduihuanhexiao, - style: TextStyle( - textBaseline: TextBaseline.alphabetic, - fontSize: 14.sp, - height: 1.5.h, - color: Color(0xFF353535)), - ), - flex: 1, - ), - ], - ), - SizedBox(height:16.h,), Row( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center, diff --git a/lib/utils/video_edit.dart b/lib/utils/video_edit.dart new file mode 100644 index 00000000..84ee72c5 --- /dev/null +++ b/lib/utils/video_edit.dart @@ -0,0 +1,37 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; + +class VideoEdit extends StatefulWidget { + @override + State createState() { + return _VideoEdit(); + } +} + +class _VideoEdit extends State with WidgetsBindingObserver { + + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: Colors.black, + appBar: MyAppBar( + title:"视频编辑", + titleColor: Colors.black, + background: Color(0xFFFFFFFF), + leadingColor: Colors.black, + ), + body: Container( + width: MediaQuery.of(context).size.width, + height: MediaQuery.of(context).size.height, + alignment: Alignment.center, + child:Text("hdjhcd" + )), + ); + } +} diff --git a/pubspec.lock b/pubspec.lock index f930e720..0b371072 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -209,6 +209,13 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "3.0.5" + flutter_ffmpeg: + dependency: "direct main" + description: + name: flutter_ffmpeg + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.4.2" flutter_html: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index f6b9acd2..d3ca452b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -105,6 +105,8 @@ dependencies: mqtt_client: ^9.6.8 + flutter_ffmpeg: ^0.4.2 + dev_dependencies: flutter_test: sdk: flutter