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 'package:dio/dio.dart';
import 'package:flare_flutter/flare_testing.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.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 'data/findMiNiGroupList.dart';
import 'data/page.dart';
import 'data/miNiDetail.dart';
part 'min_api.g.dart';
// const base_url = "https://pos.platform.lotus-wallet.com/app/"; ///
@ -118,5 +118,10 @@ abstract class MinApiService {
@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;
@override
Future<BaseData<List<FindMiNiGroupList>>> findMiNiGroupList(param) async {
Future<BaseData<List<FindMiNiGroupList>>> findMiNiGroupList(
param, header) async {
ArgumentError.checkNotNull(param, 'param');
ArgumentError.checkNotNull(header, 'header');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _header= <String, dynamic>{};
_header.addAll(header ?? <String,dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>(
'product/findMiNiGroupList',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
headers: _header,
extra: _extra,
baseUrl: baseUrl),
data: _data);
@ -40,4 +44,26 @@ class _MinApiService implements MinApiService {
.toList());
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/base_data.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/min_api.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/store/store_view/product_sku.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/round_button.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> {
int isSelected = 0;
@ -89,6 +81,7 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
tenant: tenant,
);
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
Widget build(BuildContext context) {
return Container(
@ -193,6 +196,8 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
color: Colors.white,
padding: EdgeInsets.only(right: 16.w, bottom: 10.h, top: 10.h),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
SizedBox(width: 12.w),
MImage(
@ -300,7 +305,8 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
true
? GestureDetector(
onTap: () {
showStoreSelector(productListBean);
// showStoreSelector(productListBean);
queryMiNiDetail(productListBean.id);
},
child: RoundButton(
width: 49.w,
@ -357,16 +363,13 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
}
///
showStoreSelector(ProductListBean productListBean) {
showStoreSelector(MiNiDetail miNiDetail) {
showModalBottomSheet(
context: context,
backgroundColor: Colors.transparent,
builder: (context) {
return StatefulBuilder(builder: (context1, state) {
return ProductSku(productListBean);
});
},
);
}
}

2
pubspec.lock

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

Loading…
Cancel
Save