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; + } }