From 0d98c93d0032b42939728fb3d86e963f37e4237e Mon Sep 17 00:00:00 2001 From: wurong <953969641@qq.com> Date: Tue, 24 Oct 2023 14:37:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=A0=B8=E9=94=80=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=EF=BC=9B=20=E8=AE=A2=E5=8D=95=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=A0=B8=E9=94=80=E6=98=BE=E7=A4=BA=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/business_system/home/select_shop.dart | 1 - lib/business_system/mine/merchant_info.dart | 3 -- .../order/order_write_off.dart | 12 +++-- lib/retrofit/business_api.dart | 10 +++++ lib/retrofit/business_api.g.dart | 44 +++++++++++++++++++ 5 files changed, 63 insertions(+), 7 deletions(-) diff --git a/lib/business_system/home/select_shop.dart b/lib/business_system/home/select_shop.dart index 97df863d..e10a421b 100644 --- a/lib/business_system/home/select_shop.dart +++ b/lib/business_system/home/select_shop.dart @@ -3,7 +3,6 @@ import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:shimmer/shimmer.dart'; import '../../generated/l10n.dart'; import '../../retrofit/data/business_login_info.dart'; diff --git a/lib/business_system/mine/merchant_info.dart b/lib/business_system/mine/merchant_info.dart index 74d53e64..5017513b 100644 --- a/lib/business_system/mine/merchant_info.dart +++ b/lib/business_system/mine/merchant_info.dart @@ -1,12 +1,9 @@ import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/retrofit/data/business_store_list.dart'; import 'package:huixiang/view_widget/my_appbar.dart'; -import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:shimmer/shimmer.dart'; import '../../generated/l10n.dart'; import '../../retrofit/business_api.dart'; import '../../retrofit/data/base_data.dart'; diff --git a/lib/business_system/order/order_write_off.dart b/lib/business_system/order/order_write_off.dart index 18604872..85fbcceb 100644 --- a/lib/business_system/order/order_write_off.dart +++ b/lib/business_system/order/order_write_off.dart @@ -24,6 +24,7 @@ class _OrderWriteOff extends State { var writeOffCheck = false; List tickets; String productName; + int nameIndex = 0; @override void initState() { @@ -132,9 +133,9 @@ class _OrderWriteOff extends State { SizedBox( height: 12.h, ), - basicInfoItem("票券名称:",productName ?? ""), + basicInfoItem("票券名称:",tickets[nameIndex].name ?? ""), basicInfoItem("用户名称::",widget?.arguments["userName"] ?? ""), - basicInfoItem("票券编号::","177777622222223"), + basicInfoItem("票券编号::",tickets[nameIndex].code ?? ""), basicInfoItem("订单编号::",widget?.arguments["orderCode"] ?? ""), ], ), @@ -219,7 +220,11 @@ class _OrderWriteOff extends State { physics: BouncingScrollPhysics(), itemBuilder: (context, position) { return GestureDetector( - onTap: () {}, + onTap: () { + setState((){ + nameIndex = position; + }); + }, child: writeOffInfoItem(tickets[position]), ); }, @@ -277,6 +282,7 @@ class _OrderWriteOff extends State { )) ], ), + if(tickets.state != 1) Align( alignment: Alignment.centerRight, child:Container( diff --git a/lib/retrofit/business_api.dart b/lib/retrofit/business_api.dart index 5470d0a4..cd0580a9 100644 --- a/lib/retrofit/business_api.dart +++ b/lib/retrofit/business_api.dart @@ -247,4 +247,14 @@ abstract class BusinessApiService { Future> upload(@Part(name: "file") File data, @Part(name: "folderId") int folderId); + ///单个核销 + @POST("ticket/wiped") + Future wiped( + @Body() Map param); + + ///批量核销 + @POST("ticket/wipedBatch") + Future wipedBatch( + @Body() Map param); + } diff --git a/lib/retrofit/business_api.g.dart b/lib/retrofit/business_api.g.dart index 6513d479..f8f9fdb3 100644 --- a/lib/retrofit/business_api.g.dart +++ b/lib/retrofit/business_api.g.dart @@ -552,4 +552,48 @@ class _BusinessApiService implements BusinessApiService { ); return value; } + + @override + Future wiped(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>('ticket/wiped', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => json == null ? null : json, + ); + return value; + } + + @override + Future wipedBatch(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>('ticket/wipedBatch', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => json == null ? null : json, + ); + return value; + } }