From 90320b91fd5966fde4d61d748d9b35d5e4b1357f Mon Sep 17 00:00:00 2001 From: wurong <953969641@qq.com> Date: Sat, 19 Nov 2022 17:49:44 +0800 Subject: [PATCH 1/6] =?UTF-8?q?dev=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/settlement/settlement_view/activity_coupon_remarks.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/settlement/settlement_view/activity_coupon_remarks.dart b/lib/settlement/settlement_view/activity_coupon_remarks.dart index b9767cea..282f23ff 100644 --- a/lib/settlement/settlement_view/activity_coupon_remarks.dart +++ b/lib/settlement/settlement_view/activity_coupon_remarks.dart @@ -76,7 +76,7 @@ class _ActivityCouponRemarks extends State { mainAxisAlignment: MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.center, children: [ - if(!widget?.settleOrderInfo?.isRaise ?? false) + if(!(widget?.settleOrderInfo?.isRaise ?? false)) Row( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, From 5424d73c87d42499fba02e31a493a052bcee9a5f Mon Sep 17 00:00:00 2001 From: wurong <953969641@qq.com> Date: Fri, 24 Mar 2023 19:43:58 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E6=BB=91=E5=8A=A8=EF=BC=9B=20=E6=9B=B4?= =?UTF-8?q?=E6=94=B9=E5=8A=A8=E6=80=81=E4=B8=8A=E4=BC=A0=EF=BC=9B=20?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=85=A8=E5=B1=80=E6=B5=AE=E5=8A=A8=E5=8A=A0?= =?UTF-8?q?=E8=BD=BDloading=EF=BC=9B=20=E4=B8=8B=E5=8D=95-=E5=A4=9A?= =?UTF-8?q?=E8=A7=84=E6=A0=BC=E6=9B=B4=E6=94=B9=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/community/community_page.dart | 20 +++- lib/community/release_dynamic.dart | 100 +---------------- lib/order/order_detail_page.dart | 79 +++++++------- lib/settlement/settlement.dart | 2 +- lib/utils/upload_async.dart | 170 +++++++++++++++++++++++++++++ lib/vip/vip_page.dart | 6 +- lib/vip/vip_view/vip_top.dart | 4 +- pubspec.lock | 2 +- pubspec.yaml | 2 +- 9 files changed, 240 insertions(+), 145 deletions(-) create mode 100644 lib/utils/upload_async.dart diff --git a/lib/community/community_page.dart b/lib/community/community_page.dart index 61a91406..52ae871f 100644 --- a/lib/community/community_page.dart +++ b/lib/community/community_page.dart @@ -7,6 +7,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:huixiang/view_widget/my_tab.dart'; import '../generated/l10n.dart'; +import '../utils/upload_async.dart'; import 'community_course.dart'; import 'headlines/article_page.dart'; @@ -18,7 +19,7 @@ class CommunityPage extends StatefulWidget { } class _CommunityPage extends State - with SingleTickerProviderStateMixin,AutomaticKeepAliveClientMixin { + with SingleTickerProviderStateMixin,AutomaticKeepAliveClientMixin,UploadObserver { TabController tabcontroller; CommunityChildPage guanzhu,tuijian ; @@ -39,13 +40,20 @@ class _CommunityPage extends State @override void initState() { super.initState(); - + UploadInstance.instance.uploadObserverList.add(this); if (tabcontroller == null) tabcontroller = TabController(length: lables.length, vsync: this, initialIndex: 1); } + + @override + void dispose() { + super.dispose(); + UploadInstance.instance.uploadObserverList.remove(this); + } + void onChildScroll(){ if(scrollCount == 0){ setState(() { @@ -63,8 +71,8 @@ class _CommunityPage extends State }); } - _toRelease() async { - await Navigator.of(context).pushNamed('/router/release_dynamic'); + @override + void onUploadFinish(){ if(tabcontroller.index == 0){ CommunityChildPageState page = guanzhuKey.currentState; page.onRefresh(); @@ -74,6 +82,10 @@ class _CommunityPage extends State } } + _toRelease() async { + Navigator.of(context).pushNamed('/router/release_dynamic'); + } + @override Widget build(BuildContext context) { return Scaffold( diff --git a/lib/community/release_dynamic.dart b/lib/community/release_dynamic.dart index 5b279e4f..5268345a 100644 --- a/lib/community/release_dynamic.dart +++ b/lib/community/release_dynamic.dart @@ -1,21 +1,19 @@ +import 'dart:convert'; import 'dart:io'; import 'package:dio/dio.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/address.dart'; -import 'package:huixiang/retrofit/data/base_data.dart'; -import 'package:huixiang/retrofit/data/upload_result.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:image_pickers/image_pickers.dart'; import 'package:shared_preferences/shared_preferences.dart'; -import 'package:thumbnails/thumbnails.dart'; +import '../utils/upload_async.dart'; class ReleaseDynamic extends StatefulWidget { @override @@ -170,99 +168,9 @@ class _ReleaseDynamic extends State { SmartDialog.showToast("请输入您此刻的想法!"); return; } - EasyLoading.show(status: "上传中"); - fileUpload().then((value) async { - String subjectType = "text"; - if (dynamicType == 0) { - subjectType = "text"; - } else if (dynamicType == 1) { - subjectType = "image"; - } else if (dynamicType == 2) { - subjectType = "video"; - } - - List remoteImageUrls = []; - String remoteVideoUrl = ""; - String remoteVideoCoverImg = ""; - if (mediaPaths.length > 0) { - if (dynamicType == 1) { - remoteImageUrls = mediaPaths.map((e) => e.remotePath).toList(); - } else if (dynamicType == 2) { - remoteVideoUrl = mediaPaths[0].remotePath; - remoteVideoCoverImg = mediaPaths[0].thumbPath; - } - } - - BaseData baseData = await apiService.trend({ - "images": remoteImageUrls, - "subject": dynamicText, - "subjectType": subjectType, - "video": remoteVideoUrl, - "coverImg": remoteVideoCoverImg, - "latitude": "", - "location": addressController.text == "" ? "" : addressController.text, - "longitude": "", - }).catchError((onError) { - EasyLoading.dismiss(); - }); - if (baseData != null && baseData.isSuccess) { - SmartDialog.showToast("发布成功!"); - Future.delayed(Duration(seconds: 1), () { - Navigator.of(context).pop(true); - }); - } else { - SmartDialog.showToast(baseData.msg, alignment: Alignment.center); - } - EasyLoading.dismiss(); - }); - } - - ///文件上传 - Future fileUpload() async { - if (mediaPaths != null && mediaPaths.length > 0) { - await Future.forEach(mediaPaths, (element) async { - if ((element.remotePath == null || element.remotePath == "") && - (element != null && - element.path != null && - element.path != "" && - await File(element.path).exists())) { - File file = File(element.path); - if (dynamicType == 2) { - String thumbnail; - if (element.thumbPath != null && - element.thumbPath != "" && - await File(element.thumbPath).exists()) { - thumbnail = element.thumbPath; - } else { - thumbnail = await Thumbnails.getThumbnail( - videoFile: file.path, - imageType: ThumbFormat.JPEG, - quality: 10, - ); - } - if (thumbnail != null && - thumbnail != "" && - await File(thumbnail).exists()) { - BaseData baseData = await apiService.upload( - File(thumbnail), 123123123, dynamicType == 2); - if (baseData != null && baseData.isSuccess) { - UploadResult uploadResult = baseData.data; - mediaPaths[mediaPaths.indexOf(element)].thumbPath = - uploadResult.url; - } - } - } - BaseData baseData = - await apiService.upload(file, 123123123, dynamicType == 2); - if (baseData != null && baseData.isSuccess) { - UploadResult uploadResult = baseData.data; - mediaPaths[mediaPaths.indexOf(element)].remotePath = - uploadResult.url; - } - } - }); - } + UploadAsync.upload(dynamicType, mediaPaths, addressController.text, dynamicText); + Navigator.of(context).pop(); } Widget imageItem(Medias media) { diff --git a/lib/order/order_detail_page.dart b/lib/order/order_detail_page.dart index 37d61db5..73f52e6a 100644 --- a/lib/order/order_detail_page.dart +++ b/lib/order/order_detail_page.dart @@ -180,48 +180,51 @@ class _OrderDetailPage extends State { }, physics: BouncingScrollPhysics(), scrollController: ScrollController(), - child: Column( - children: [ - ///订单状态显示 - OrderStatus( - orderStatus, - isTakeOut, - sendStatus, - payStatus, - refundStatus, - title, - center, - orderInfo, - ), - - ///订单取货地址,或, 收货地址 - if(orderInfo != null && orderInfo.addressExt != null) - OrderAddress( - orderStatus, - isTakeOut, - sendStatus, - payStatus, - refundStatus, - title, - center, - paySelected, - _orderCancel, - orderInfo, - jumpState + child:SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Column( + children: [ + ///订单状态显示 + OrderStatus( + orderStatus, + isTakeOut, + sendStatus, + payStatus, + refundStatus, + title, + center, + orderInfo, ), - ///订单商品 - if(orderInfo != null) - OrderCommodity(orderInfo), + ///订单取货地址,或, 收货地址 + if(orderInfo != null && orderInfo.addressExt != null) + OrderAddress( + orderStatus, + isTakeOut, + sendStatus, + payStatus, + refundStatus, + title, + center, + paySelected, + _orderCancel, + orderInfo, + jumpState + ), - ///显示订单信息 - if(orderInfo != null) - OrderInfoView(orderInfo, isTakeOut), + ///订单商品 + if(orderInfo != null) + OrderCommodity(orderInfo), - Container( - height: 42.h, - ), - ], + ///显示订单信息 + if(orderInfo != null) + OrderInfoView(orderInfo, isTakeOut), + + Container( + height: 42.h, + ), + ], + ), ), ), ) diff --git a/lib/settlement/settlement.dart b/lib/settlement/settlement.dart index 23f86df5..c01378a2 100644 --- a/lib/settlement/settlement.dart +++ b/lib/settlement/settlement.dart @@ -518,7 +518,7 @@ class _Settlement extends State { placeOrderFirst.storeId = storeInfo.id; placeOrderFirst.subcribeTime = null; placeOrderFirst.tableId = "$tableId"; - for(int i = 0;i mediaPaths, + String addressText, String dynamicText) async { + SmartDialog.show( + widget: Container( + alignment: Alignment.centerRight, + margin: EdgeInsets.only( + right: 10.w, + ), + child: CircularProgressIndicator( + strokeWidth: 4.0, + backgroundColor: Colors.green, + // value: 0.4, + valueColor: new AlwaysStoppedAnimation(Colors.grey), + ), + ), + maskWidgetTemp: SizedBox(), + ); + var sp = await SharedPreferences.getInstance(); + ApiService apiService = ApiService( + Dio(), + token: sp.getString("token"), + showLoading: false, + ); + + fileUpload(apiService, mediaPaths, dynamicType).then((value) async { + String subjectType = "text"; + if (dynamicType == 0) { + subjectType = "text"; + } else if (dynamicType == 1) { + subjectType = "image"; + } else if (dynamicType == 2) { + subjectType = "video"; + } + + List remoteImageUrls = []; + String remoteVideoUrl = ""; + String remoteVideoCoverImg = ""; + if (mediaPaths.length > 0) { + if (dynamicType == 1) { + remoteImageUrls = mediaPaths.map((e) => e.remotePath).toList(); + } else if (dynamicType == 2) { + remoteVideoUrl = mediaPaths[0].remotePath; + remoteVideoCoverImg = mediaPaths[0].thumbPath; + } + } + + BaseData baseData = await apiService.trend({ + "images": remoteImageUrls, + "subject": dynamicText, + "subjectType": subjectType, + "video": remoteVideoUrl, + "coverImg": remoteVideoCoverImg, + "latitude": "", + "location": addressText, + "longitude": "", + }).catchError((onError) { + SmartDialog.dismiss(); + }); + if (baseData != null && baseData.isSuccess) { + SmartDialog.showToast("发布成功!"); + UploadInstance.instance.notifyAllObservers(); + } else { + SmartDialog.showToast(baseData.msg, alignment: Alignment.center); + } + SmartDialog.dismiss(); + }); + } + + ///文件上传 + static Future fileUpload( + ApiService apiService, List mediaPaths, int dynamicType) async { + if (mediaPaths != null && mediaPaths.length > 0) { + await Future.forEach(mediaPaths, (element) async { + if ((element.remotePath == null || element.remotePath == "") && + (element != null && + element.path != null && + element.path != "" && + await File(element.path).exists())) { + File file = File(element.path); + if (dynamicType == 2) { + String thumbnail; + if (element.thumbPath != null && + element.thumbPath != "" && + await File(element.thumbPath).exists()) { + thumbnail = element.thumbPath; + } else { + thumbnail = await Thumbnails.getThumbnail( + videoFile: file.path, + imageType: ThumbFormat.JPEG, + quality: 10, + ); + } + if (thumbnail != null && + thumbnail != "" && + await File(thumbnail).exists()) { + BaseData baseData = await apiService.upload( + File(thumbnail), 123123123, dynamicType == 2); + if (baseData != null && baseData.isSuccess) { + UploadResult uploadResult = baseData.data; + mediaPaths[mediaPaths.indexOf(element)].thumbPath = + uploadResult.url; + } + } + } + BaseData baseData = + await apiService.upload(file, 123123123, dynamicType == 2); + if (baseData != null && baseData.isSuccess) { + UploadResult uploadResult = baseData.data; + mediaPaths[mediaPaths.indexOf(element)].remotePath = + uploadResult.url; + } + } + }); + } + } +} + +abstract class UploadObserver { + void onUploadFinish(); +} + +class UploadInstance { + factory UploadInstance() => _getInstance(); + + static UploadInstance get instance => _getInstance(); + + static UploadInstance _instance; + + List _uploadObserverList; + + List get uploadObserverList => _uploadObserverList; + + set uploadObserverList(List value) { + _uploadObserverList = value; + } + + UploadInstance._internal() { + //单例初始化 + _uploadObserverList = []; + } + + static UploadInstance _getInstance() { + if (_instance == null) { + _instance = UploadInstance._internal(); + } + return _instance; + } + + void notifyAllObservers(){ + _uploadObserverList.forEach((element) { + element.onUploadFinish(); + }); + } +} diff --git a/lib/vip/vip_page.dart b/lib/vip/vip_page.dart index 90a25727..2b4939b6 100644 --- a/lib/vip/vip_page.dart +++ b/lib/vip/vip_page.dart @@ -59,12 +59,14 @@ class _VipPageState extends State with AutomaticKeepAliveClientMixin { await apiService.vipCardIndex().catchError((onError) { SmartDialog.showToast(AppUtils.dioErrorTypeToString(onError.type), alignment: Alignment.center); - _refreshController.refreshFailed();}); + _refreshController.loadFailed(); + _refreshController.refreshFailed(); + }); if (baseData != null && baseData.isSuccess) { vipHome = baseData.data; _refreshController.refreshCompleted(); + _refreshController.loadComplete(); }else{ - _refreshController.refreshFailed(); SmartDialog.showToast(baseData.msg ?? "", alignment: Alignment.center); } }finally{ diff --git a/lib/vip/vip_view/vip_top.dart b/lib/vip/vip_view/vip_top.dart index 54f11b73..41982fd1 100644 --- a/lib/vip/vip_view/vip_top.dart +++ b/lib/vip/vip_view/vip_top.dart @@ -51,7 +51,7 @@ class _VipTop extends State { }); } - recharge() async { + rechargeVIP() async { if (apiService == null) { SharedPreferences value = await SharedPreferences.getInstance(); apiService = ApiService(Dio(), @@ -895,7 +895,7 @@ class _VipTop extends State { GestureDetector( onTap: () { Navigator.of(context).pop(); - recharge(); + rechargeVIP(); }, child: Container( height: double.infinity, diff --git a/pubspec.lock b/pubspec.lock index 5589cb7d..f930e720 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -269,7 +269,7 @@ packages: name: flutter_smart_dialog url: "https://pub.flutter-io.cn" source: hosted - version: "2.1.6" + version: "3.5.0" flutter_spinkit: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index fd79f61e..f6b9acd2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -57,7 +57,7 @@ dependencies: event_bus: ^2.0.0 intl: ^0.17.0 shared_preferences: ^2.0.6 - flutter_smart_dialog: ^2.1.6 + flutter_smart_dialog: ^3.0.6 barcode_widget: ^2.0.1 qr_flutter: ^4.0.0 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 3/6] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E5=85=91=E6=8D=A2?= =?UTF-8?q?=E5=88=B8=E6=A0=B7=E5=BC=8F=EF=BC=9B=20=E6=9B=B4=E6=94=B9?= =?UTF-8?q?=E9=A2=86=E5=88=B8=E4=B8=AD=E5=BF=83=EF=BC=8C=E5=85=91=E6=8D=A2?= =?UTF-8?q?=E5=88=B8=E8=B7=B3=E8=BD=AC=EF=BC=9B=20=E5=8D=87=E7=BA=A7minSdk?= =?UTF-8?q?Version=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 From cf0dafb64d75aac41a7d73f23fbb50f0ccd773d2 Mon Sep 17 00:00:00 2001 From: wurong <953969641@qq.com> Date: Thu, 30 Mar 2023 09:38:24 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E8=B4=AD=E7=89=A9=E8=BD=A6=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3+storeId=E8=AF=B7=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/community/release_dynamic.dart | 3 +-- lib/main.dart | 3 --- lib/retrofit/min_api.dart | 4 ++-- lib/retrofit/min_api.g.dart | 5 ++-- lib/store/shop_details_page.dart | 2 +- lib/store/store_order.dart | 2 +- lib/utils/video_edit.dart | 37 ------------------------------ 7 files changed, 8 insertions(+), 48 deletions(-) delete mode 100644 lib/utils/video_edit.dart diff --git a/lib/community/release_dynamic.dart b/lib/community/release_dynamic.dart index a015d5b5..5268345a 100644 --- a/lib/community/release_dynamic.dart +++ b/lib/community/release_dynamic.dart @@ -225,8 +225,7 @@ class _ReleaseDynamic extends State { child: Text("视频"), onPressed: () { getImageOrVideo(GalleryMode.video); - // Navigator.of(context).pop(); - Navigator.of(context).popAndPushNamed('/router/video_edit'); + Navigator.of(context).pop(); }, isDefaultAction: true, isDestructiveAction: false, diff --git a/lib/main.dart b/lib/main.dart index d6c35ebc..7412841c 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -73,7 +73,6 @@ 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'; @@ -428,8 +427,6 @@ Map routers = { VipPayCode(), '/router/system_notice': (context, {arguments}) => SystemNotice(), - '/router/video_edit': (context, {arguments}) => - VideoEdit(), '/router/store_html': (context, {arguments}) => StoreHtml(arguments:arguments), }; diff --git a/lib/retrofit/min_api.dart b/lib/retrofit/min_api.dart index f7e60731..dc0384e3 100644 --- a/lib/retrofit/min_api.dart +++ b/lib/retrofit/min_api.dart @@ -150,8 +150,8 @@ abstract class MinApiService { Future>> getShoppingCart(@Query("tableId") int tableId); ///清空购物车商品 - @GET("shoppingcart/delCart") - Future> clearShoppingCart(); + @GET("shoppingcart/delCart?storeId={storeId}") + Future> clearShoppingCart(@Query("storeId") String storeId); ///修改购物车 @PUT("shoppingcart") diff --git a/lib/retrofit/min_api.g.dart b/lib/retrofit/min_api.g.dart index 2e4cd7a2..b27f12ef 100644 --- a/lib/retrofit/min_api.g.dart +++ b/lib/retrofit/min_api.g.dart @@ -131,12 +131,13 @@ class _MinApiService implements MinApiService { } @override - Future> clearShoppingCart() async { + Future> clearShoppingCart(storeId) async { + ArgumentError.checkNotNull(storeId, 'storeId'); const _extra = {}; final queryParameters = {}; final _data = {}; final _result = await _dio.request>( - 'shoppingcart/delCart', + 'shoppingcart/delCart?storeId=$storeId', queryParameters: queryParameters, options: RequestOptions( method: 'GET', diff --git a/lib/store/shop_details_page.dart b/lib/store/shop_details_page.dart index 305216f7..5e9ae062 100644 --- a/lib/store/shop_details_page.dart +++ b/lib/store/shop_details_page.dart @@ -302,7 +302,7 @@ class _ShopDetailsPage extends State { ///清空购物车 clearShopCar() async { - BaseData baseData = await minService.clearShoppingCart(); + BaseData baseData = await minService.clearShoppingCart(storeId); if (baseData.isSuccess) { shopCarGoods = null; setState(() {}); diff --git a/lib/store/store_order.dart b/lib/store/store_order.dart index 5491a73b..25dfbf5a 100644 --- a/lib/store/store_order.dart +++ b/lib/store/store_order.dart @@ -727,7 +727,7 @@ class _StoreOrderPage extends State ///清空购物车 clearShopCar() async { - BaseData baseData = await minService.clearShoppingCart(); + BaseData baseData = await minService.clearShoppingCart(storeId); if (baseData.isSuccess) { shopCarGoods = null; setState(() {}); diff --git a/lib/utils/video_edit.dart b/lib/utils/video_edit.dart deleted file mode 100644 index 84ee72c5..00000000 --- a/lib/utils/video_edit.dart +++ /dev/null @@ -1,37 +0,0 @@ -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" - )), - ); - } -} From cae0fa30e5d565b3eae42bfb1dc59c9931b43ab1 Mon Sep 17 00:00:00 2001 From: wurong <953969641@qq.com> Date: Thu, 30 Mar 2023 09:40:05 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E7=89=88=E6=9C=ACminSdkV?= =?UTF-8?q?ersion=2024=E6=94=B9=E5=9B=9E21?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- android/app/build.gradle | 2 +- pubspec.yaml | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index d3e582f3..f35fed4c 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -105,7 +105,7 @@ android { defaultConfig { applicationId "com.zsw.huixiang" - minSdkVersion 24 + minSdkVersion 21 targetSdkVersion 30 versionCode flutterVersionCode.toInteger() versionName flutterVersionName diff --git a/pubspec.yaml b/pubspec.yaml index d3ca452b..f6b9acd2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -105,8 +105,6 @@ dependencies: mqtt_client: ^9.6.8 - flutter_ffmpeg: ^0.4.2 - dev_dependencies: flutter_test: sdk: flutter From 1bceb875f35562de316a62778212958bdbf27c3a Mon Sep 17 00:00:00 2001 From: wurong <953969641@qq.com> Date: Thu, 30 Mar 2023 09:40:54 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E7=89=88=E6=9C=ACminSdkV?= =?UTF-8?q?ersion=2024=E6=94=B9=E5=9B=9E21?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pubspec.lock | 7 ------- 1 file changed, 7 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index 0b371072..f930e720 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -209,13 +209,6 @@ 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: