Browse Source

Merge branches 'dev' and 'master' of https://git.lotus-wallet.com/fmk/huixiang_app

 Conflicts:
	lib/retrofit/min_api.g.dart
	lib/store/store_order.dart
	lib/store/store_view/store_order_list.dart
master
fmk 3 years ago
parent
commit
cdf36c2830
  1. 472
      lib/retrofit/data/miNiDetail.dart
  2. 9
      lib/retrofit/min_api.dart
  3. 30
      lib/retrofit/min_api.g.dart
  4. 35
      lib/store/store_view/store_order_list.dart
  5. 2
      pubspec.lock

472
lib/retrofit/data/miNiDetail.dart

File diff suppressed because one or more lines are too long

9
lib/retrofit/min_api.dart

@ -1,6 +1,7 @@
import 'dart:convert'; import 'dart:convert';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flare_flutter/flare_testing.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart';
@ -11,8 +12,7 @@ import 'package:huixiang/view_widget/login_tips_dialog.dart';
import 'package:retrofit/retrofit.dart'; import 'package:retrofit/retrofit.dart';
import 'data/findMiNiGroupList.dart'; import 'data/findMiNiGroupList.dart';
import 'data/page.dart'; import 'data/miNiDetail.dart';
part 'min_api.g.dart'; part 'min_api.g.dart';
// const base_url = "https://pos.platform.lotus-wallet.com/app/"; /// // const base_url = "https://pos.platform.lotus-wallet.com/app/"; ///
@ -118,5 +118,10 @@ abstract class MinApiService {
@Body() Map<String, dynamic> param); @Body() Map<String, dynamic> param);
////
@GET("/product/queryMiNiProductDetail?id={id}")
Future<BaseData<MiNiDetail>> miNiDetail(@Path("id") String id);
} }

30
lib/retrofit/min_api.g.dart

@ -17,18 +17,22 @@ class _MinApiService implements MinApiService {
String baseUrl; String baseUrl;
@override @override
Future<BaseData<List<FindMiNiGroupList>>> findMiNiGroupList(param) async { Future<BaseData<List<FindMiNiGroupList>>> findMiNiGroupList(
param, header) async {
ArgumentError.checkNotNull(param, 'param'); ArgumentError.checkNotNull(param, 'param');
ArgumentError.checkNotNull(header, 'header');
const _extra = <String, dynamic>{}; const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{}; final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{}; final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{}); _data.addAll(param ?? <String, dynamic>{});
final _header= <String, dynamic>{};
_header.addAll(header ?? <String,dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>( final _result = await _dio.request<Map<String, dynamic>>(
'product/findMiNiGroupList', 'product/findMiNiGroupList',
queryParameters: queryParameters, queryParameters: queryParameters,
options: RequestOptions( options: RequestOptions(
method: 'POST', method: 'POST',
headers: <String, dynamic>{}, headers: _header,
extra: _extra, extra: _extra,
baseUrl: baseUrl), baseUrl: baseUrl),
data: _data); data: _data);
@ -40,4 +44,26 @@ class _MinApiService implements MinApiService {
.toList()); .toList());
return value; return value;
} }
@override
Future<BaseData<MiNiDetail>> miNiDetail(id) async {
ArgumentError.checkNotNull(id, 'id');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/product/queryMiNiProductDetail?id=$id',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<MiNiDetail>.fromJson(
_result.data,
(json) => MiNiDetail.fromMap(json),
);
return value;
}
} }

35
lib/store/store_view/store_order_list.dart

@ -4,11 +4,13 @@ import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/activity.dart'; import 'package:huixiang/retrofit/data/activity.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/findMiNiGroupList.dart'; import 'package:huixiang/retrofit/data/findMiNiGroupList.dart';
import 'package:huixiang/retrofit/data/miNiDetail.dart';
import 'package:huixiang/retrofit/data/store_info.dart'; import 'package:huixiang/retrofit/data/store_info.dart';
import 'package:huixiang/retrofit/min_api.dart'; import 'package:huixiang/retrofit/min_api.dart';
import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/store/store_view/product_sku.dart'; import 'package:huixiang/store/store_view/product_sku.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/utils/min.dart';
import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/round_button.dart'; import 'package:huixiang/view_widget/round_button.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -33,16 +35,6 @@ class StoreOrderListPage extends StatefulWidget {
} }
} }
class testModel {
String name;
bool isSelected;
testModel(String name) {
this.name = name;
this.isSelected = false;
}
}
class _StoreOrderListPage extends State<StoreOrderListPage> { class _StoreOrderListPage extends State<StoreOrderListPage> {
int isSelected = 0; int isSelected = 0;
@ -89,6 +81,7 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
tenant: tenant, tenant: tenant,
); );
appletGoods(); appletGoods();
// queryMiNiDetail(widget.arguments["id"]);
} }
}); });
} }
@ -110,6 +103,16 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
} }
} }
///
queryMiNiDetail(String id) async {
BaseData<MiNiDetail> baseData = await minService.miNiDetail(id);
if (baseData != null && baseData.isSuccess) {
setState(() {
showStoreSelector(baseData.data);
});
}
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
@ -193,6 +196,8 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
color: Colors.white, color: Colors.white,
padding: EdgeInsets.only(right: 16.w, bottom: 10.h, top: 10.h), padding: EdgeInsets.only(right: 16.w, bottom: 10.h, top: 10.h),
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
SizedBox(width: 12.w), SizedBox(width: 12.w),
MImage( MImage(
@ -300,7 +305,8 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
true true
? GestureDetector( ? GestureDetector(
onTap: () { onTap: () {
showStoreSelector(productListBean); // showStoreSelector(productListBean);
queryMiNiDetail(productListBean.id);
}, },
child: RoundButton( child: RoundButton(
width: 49.w, width: 49.w,
@ -357,16 +363,13 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
} }
/// ///
showStoreSelector(ProductListBean productListBean) { showStoreSelector(MiNiDetail miNiDetail) {
showModalBottomSheet( showModalBottomSheet(
context: context, context: context,
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
builder: (context) { builder: (context) {
return StatefulBuilder(builder: (context1, state) { return StatefulBuilder(builder: (context1, state) {
return ProductSku(productListBean); return ProductSku(productListBean);
});
},
);
}
} }

2
pubspec.lock

@ -388,7 +388,7 @@ packages:
name: flutter_smart_dialog name: flutter_smart_dialog
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.3.1" version: "2.3.6"
flutter_spinkit: flutter_spinkit:
dependency: "direct main" dependency: "direct main"
description: description:

Loading…
Cancel
Save