Browse Source

safety

master
fmk 3 years ago
parent
commit
2bc21fed79
  1. 3
      lib/retrofit/data/store_info.dart
  2. 41
      lib/store/store_order.dart
  3. 8
      lib/union/union_view/store_info.dart

3
lib/retrofit/data/store_info.dart

@ -17,6 +17,7 @@ class StoreInfo {
DeliveryInfo deliveryInfo; DeliveryInfo deliveryInfo;
String district; String district;
String headMobile; String headMobile;
String tel;
String headName; String headName;
String id; String id;
num isAutoSendRefundAddress; num isAutoSendRefundAddress;
@ -67,6 +68,7 @@ class StoreInfo {
: DeliveryInfo.fromJson(json['deliveryInfo'] as Map<String, dynamic>) : DeliveryInfo.fromJson(json['deliveryInfo'] as Map<String, dynamic>)
..district = json['district'] as String ..district = json['district'] as String
..headMobile = json['headMobile'] as String ..headMobile = json['headMobile'] as String
..tel = json['tel'] as String
..headName = json['headName'] as String ..headName = json['headName'] as String
..id = json['id'] as String ..id = json['id'] as String
..isVip = json['isVip'] ..isVip = json['isVip']
@ -115,6 +117,7 @@ class StoreInfo {
'deliveryInfo': this.deliveryInfo.toJson(), 'deliveryInfo': this.deliveryInfo.toJson(),
'district': this.district, 'district': this.district,
'headMobile': this.headMobile, 'headMobile': this.headMobile,
'tel': this.tel,
'headName': this.headName, 'headName': this.headName,
'id': this.id, 'id': this.id,
'isAutoSendRefundAddress': this.isAutoSendRefundAddress, 'isAutoSendRefundAddress': this.isAutoSendRefundAddress,

41
lib/store/store_order.dart

@ -24,7 +24,7 @@ class StoreOrderPage extends StatefulWidget {
} }
class _StoreOrderPage extends State<StoreOrderPage> class _StoreOrderPage extends State<StoreOrderPage>
with TickerProviderStateMixin, AutomaticKeepAliveClientMixin { with TickerProviderStateMixin/*, AutomaticKeepAliveClientMixin */{
TabController tabcontroller; TabController tabcontroller;
ApiService apiService; ApiService apiService;
StoreInfo storeInfo; StoreInfo storeInfo;
@ -34,8 +34,6 @@ class _StoreOrderPage extends State<StoreOrderPage>
void initState() { void initState() {
super.initState(); super.initState();
refreshController = RefreshController(initialRefresh: false);
queryStoreInfo(); queryStoreInfo();
} }
@ -72,13 +70,14 @@ class _StoreOrderPage extends State<StoreOrderPage>
child: DefaultTabController( child: DefaultTabController(
length: 2, length: 2,
child: SmartRefresher( child: SmartRefresher(
controller: refreshController, controller: refreshController =
RefreshController(initialRefresh: false),
enablePullDown: true, enablePullDown: true,
enablePullUp: false, enablePullUp: false,
header: MyHeader(), header: MyHeader(),
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
onRefresh: () { onRefresh: () {
setState(() {}); queryStoreInfo();
}, },
child: NestedScrollView( child: NestedScrollView(
headerSliverBuilder: headerSliverBuilder:
@ -88,10 +87,32 @@ class _StoreOrderPage extends State<StoreOrderPage>
handle: NestedScrollView.sliverOverlapAbsorberHandleFor( handle: NestedScrollView.sliverOverlapAbsorberHandleFor(
context), context),
sliver: SliverAppBar( sliver: SliverAppBar(
title: Text(""), title: Text(
expandedHeight: 365.h, "百年川椒",
style: TextStyle(
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 18.sp,
),
),
expandedHeight: (storeInfo != null && storeInfo.couponVOList != null) ? 425.h : 365.h,
floating: false, floating: false,
snap: false, snap: false,
leading: GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Container(
alignment: Alignment.centerRight,
margin: EdgeInsets.only(left: 10),
padding: EdgeInsets.all(6),
child: Icon(
Icons.arrow_back_ios,
color: Colors.black,
size: 24,
),
),
),
pinned: true, pinned: true,
flexibleSpace: FlexibleSpaceBar( flexibleSpace: FlexibleSpaceBar(
background: Stack( background: Stack(
@ -194,10 +215,12 @@ class _StoreOrderPage extends State<StoreOrderPage>
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
children: [ children: [
Container( Container(
color: Colors.white,
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.width, height: MediaQuery.of(context).size.width,
), ),
Container( Container(
color: Colors.white,
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.width, height: MediaQuery.of(context).size.width,
) )
@ -216,6 +239,6 @@ class _StoreOrderPage extends State<StoreOrderPage>
); );
} }
@override // @override
bool get wantKeepAlive => true; // bool get wantKeepAlive => true;
} }

8
lib/union/union_view/store_info.dart

@ -262,12 +262,12 @@ class _StoreInfos extends State<StoreInfos> {
title: Text(S.of(context).bodadianhua), title: Text(S.of(context).bodadianhua),
actions: [ actions: [
if (widget.storeInfo != null && if (widget.storeInfo != null &&
widget.storeInfo.headMobile != null && widget.storeInfo.tel != null &&
widget.storeInfo.headMobile != "") widget.storeInfo.tel != "")
CupertinoActionSheetAction( CupertinoActionSheetAction(
child: Text(widget.storeInfo.headMobile), child: Text(widget.storeInfo.tel),
onPressed: () { onPressed: () {
callMobile(widget.storeInfo.headMobile); callMobile(widget.storeInfo.tel);
Navigator.of(context).pop(); Navigator.of(context).pop();
}, },
isDefaultAction: true, isDefaultAction: true,

Loading…
Cancel
Save