Browse Source

Merge branch 'master' into dev

# Conflicts:
#	lib/store/store_view/store_order_list.dart
master
w-R 3 years ago
parent
commit
eb6df8f986
  1. 4
      lib/retrofit/min_api.dart
  2. 9
      lib/store/store_order.dart
  3. 27
      lib/store/store_view/store_order_list.dart

4
lib/retrofit/min_api.dart

@ -31,11 +31,15 @@ abstract class MinApiService {
String baseUrl, String baseUrl,
BuildContext context, BuildContext context,
String token, String token,
String tenant,
bool showLoading = true, bool showLoading = true,
bool pay = false, bool pay = false,
}) { }) {
Map<String, dynamic> headers = Map<String, dynamic> headers =
(token == null || token == "") ? {} : {'token': "Bearer $token"}; (token == null || token == "") ? {} : {'token': "Bearer $token"};
if (tenant != null && tenant != "") {
headers["tenant"] = tenant;
}
if (pay) { if (pay) {
headers["Environment"] = "app"; headers["Environment"] = "app";
} }

9
lib/store/store_order.dart

@ -116,8 +116,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
child: DefaultTabController( child: DefaultTabController(
length: 2, length: 2,
child: SmartRefresher( child: SmartRefresher(
controller: refreshController = controller: refreshController = RefreshController(initialRefresh: false),
RefreshController(initialRefresh: false),
enablePullDown: true, enablePullDown: true,
enablePullUp: false, enablePullUp: false,
header: MyHeader(), header: MyHeader(),
@ -132,8 +131,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
(BuildContext context, bool innerBoxIsScrolled) { (BuildContext context, bool innerBoxIsScrolled) {
return [ return [
SliverOverlapAbsorber( SliverOverlapAbsorber(
handle: NestedScrollView.sliverOverlapAbsorberHandleFor( handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
context),
sliver: SliverAppBar( sliver: SliverAppBar(
expandedHeight: (storeInfo != null && expandedHeight: (storeInfo != null &&
storeInfo.couponVOList != null) storeInfo.couponVOList != null)
@ -384,7 +382,6 @@ class _StoreOrderPage extends State<StoreOrderPage>
), ),
itemBuilder: (context, position) { itemBuilder: (context, position) {
return Container( return Container(
margin: EdgeInsets.only(left: 10.w, right: 10.w),
child: MImage( child: MImage(
(storeInfo != null && (storeInfo != null &&
storeInfo.bannerList != null && storeInfo.bannerList != null &&
@ -392,7 +389,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
? storeInfo.bannerList[position].imgUrl ? storeInfo.bannerList[position].imgUrl
: "", : "",
fit: BoxFit.cover, fit: BoxFit.cover,
radius: BorderRadius.circular(4), radius: BorderRadius.zero,
errorSrc: "assets/image/default_2_1.png", errorSrc: "assets/image/default_2_1.png",
fadeSrc: "assets/image/default_2_1.png", fadeSrc: "assets/image/default_2_1.png",
), ),

27
lib/store/store_view/store_order_list.dart

@ -1,6 +1,5 @@
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:huixiang/generated/l10n.dart'; 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';
@ -10,11 +9,9 @@ import 'package:huixiang/retrofit/data/findMiNiGroupList.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/miNiDetail.dart';
import 'package:huixiang/retrofit/data/store_info.dart'; import 'package:huixiang/retrofit/data/store_info.dart';
import 'package:huixiang/retrofit/data/user_entity.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/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';
@ -39,7 +36,24 @@ 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> {
List<testModel> temperatureStoreList = [
testModel("正常冰"),
testModel("少冰"),
testModel("多冰"),
testModel("去冰")
];
List<testModel> sweetnessStoreList = [testModel("正常糖"), testModel("5分糖")];
int isSelected = 0; int isSelected = 0;
int isChoice = 0; int isChoice = 0;
int tempClickIndex = 0; int tempClickIndex = 0;
@ -81,7 +95,7 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
Dio(), Dio(),
context: context, context: context,
token: minToken, token: minToken,
// tenant: tenant, tenant: tenant,
); );
appletGoods(); appletGoods();
// queryMiNiDetail(widget.arguments["id"]); // queryMiNiDetail(widget.arguments["id"]);
@ -119,7 +133,8 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height - (kToolbarHeight + 38 + 54.h), height: MediaQuery.of(context).size.height - (kToolbarHeight + 38 + 54.h),
margin: EdgeInsets.only( margin: EdgeInsets.only(
top: (MediaQuery.of(context).padding.top + 38 + kToolbarHeight)), top: (MediaQuery.of(context).padding.top + 38 + kToolbarHeight),
),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
@ -129,7 +144,7 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
child: ListView.builder( child: ListView.builder(
itemCount: appletProducts == null ? 0 : appletProducts.length, itemCount: appletProducts == null ? 0 : appletProducts.length,
controller: controller1, controller: controller1,
padding: EdgeInsets.zero, padding: EdgeInsets.only(top: 0, bottom: 25),
itemBuilder: (context, position) { itemBuilder: (context, position) {
return orderItem(appletProducts[position], position); return orderItem(appletProducts[position], position);
}, },

Loading…
Cancel
Save