|
|
|
@ -5,6 +5,7 @@ import 'package:dio/dio.dart';
|
|
|
|
|
import 'package:flutter/cupertino.dart'; |
|
|
|
|
import 'package:flutter/material.dart'; |
|
|
|
|
import 'package:flutter/rendering.dart'; |
|
|
|
|
import 'package:flutter_easyloading/flutter_easyloading.dart'; |
|
|
|
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; |
|
|
|
|
import 'package:flutter_swiper/flutter_swiper.dart'; |
|
|
|
|
import 'package:huixiang/generated/l10n.dart'; |
|
|
|
@ -49,21 +50,14 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
|
|
|
|
|
refreshController.dispose(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
void initState() { |
|
|
|
|
super.initState(); |
|
|
|
|
|
|
|
|
|
SharedPreferences.getInstance().then((value) => { |
|
|
|
|
apiService = ApiService(Dio(), |
|
|
|
|
context: context, token: value.getString('token')), |
|
|
|
|
queryStoreInfo(), |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
StoreInfo storeInfo; |
|
|
|
|
List<Activity> activitys; |
|
|
|
|
|
|
|
|
|
queryStoreInfo() async { |
|
|
|
|
final SharedPreferences value = await SharedPreferences.getInstance(); |
|
|
|
|
apiService = |
|
|
|
|
ApiService(Dio(), context: context, token: value.getString('token')); |
|
|
|
|
|
|
|
|
|
BaseData baseData = await apiService |
|
|
|
|
.queryStoreInfo(widget.arguments["id"]) |
|
|
|
|
.catchError((error) { |
|
|
|
@ -75,278 +69,293 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
|
|
|
|
|
activitys = storeInfo.informationVOPageVO.list |
|
|
|
|
.map((e) => Activity.fromJson(e)) |
|
|
|
|
.toList(); |
|
|
|
|
if (mounted) setState(() {}); |
|
|
|
|
} else { |
|
|
|
|
refreshController.refreshFailed(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
RefreshController refreshController = RefreshController(); |
|
|
|
|
final RefreshController refreshController = RefreshController(); |
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
Widget build(BuildContext context) { |
|
|
|
|
return Scaffold( |
|
|
|
|
appBar: MyAppBar( |
|
|
|
|
background: Color(0xFFF7F7F7), |
|
|
|
|
title: storeInfo == null ? "" : storeInfo.storeName, |
|
|
|
|
title: storeInfo == null ? widget.arguments["storeName"] : storeInfo.storeName, |
|
|
|
|
titleColor: Colors.black87, |
|
|
|
|
titleSize: 18.sp, |
|
|
|
|
leadingColor: Colors.black, |
|
|
|
|
), |
|
|
|
|
body: Column( |
|
|
|
|
children: [ |
|
|
|
|
Expanded( |
|
|
|
|
child: SmartRefresher( |
|
|
|
|
controller: refreshController, |
|
|
|
|
enablePullDown: true, |
|
|
|
|
enablePullUp: false, |
|
|
|
|
header: MyHeader(), |
|
|
|
|
physics: BouncingScrollPhysics(), |
|
|
|
|
onRefresh: queryStoreInfo, |
|
|
|
|
child: SingleChildScrollView( |
|
|
|
|
physics: NeverScrollableScrollPhysics(), |
|
|
|
|
child: Column( |
|
|
|
|
children: [ |
|
|
|
|
AspectRatio( |
|
|
|
|
aspectRatio: 1, |
|
|
|
|
child: Container( |
|
|
|
|
margin: EdgeInsets.fromLTRB(16, 20, 16, 8), |
|
|
|
|
padding: EdgeInsets.fromLTRB(10, 20, 10, 14), |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Colors.white, |
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(8)), |
|
|
|
|
boxShadow: [ |
|
|
|
|
BoxShadow( |
|
|
|
|
color: Colors.black.withAlpha(25), |
|
|
|
|
offset: Offset(0, 1), |
|
|
|
|
blurRadius: 12, |
|
|
|
|
spreadRadius: 0, |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
child: Column( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceAround, |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
children: [ |
|
|
|
|
AspectRatio( |
|
|
|
|
aspectRatio: 1.8, |
|
|
|
|
child: buildSwiper(), |
|
|
|
|
body: FutureBuilder( |
|
|
|
|
future: queryStoreInfo(), |
|
|
|
|
builder: (context, snapshot) { |
|
|
|
|
return Column( |
|
|
|
|
children: [ |
|
|
|
|
Expanded( |
|
|
|
|
child: SmartRefresher( |
|
|
|
|
controller: refreshController, |
|
|
|
|
enablePullDown: true, |
|
|
|
|
enablePullUp: false, |
|
|
|
|
header: MyHeader(), |
|
|
|
|
physics: BouncingScrollPhysics(), |
|
|
|
|
onRefresh: queryStoreInfo, |
|
|
|
|
child: SingleChildScrollView( |
|
|
|
|
physics: NeverScrollableScrollPhysics(), |
|
|
|
|
child: Column( |
|
|
|
|
children: [ |
|
|
|
|
AspectRatio( |
|
|
|
|
aspectRatio: 1, |
|
|
|
|
child: Container( |
|
|
|
|
margin: EdgeInsets.fromLTRB(16, 20, 16, 8), |
|
|
|
|
padding: EdgeInsets.fromLTRB(10, 20, 10, 14), |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Colors.white, |
|
|
|
|
borderRadius: BorderRadius.circular(8), |
|
|
|
|
boxShadow: [ |
|
|
|
|
BoxShadow( |
|
|
|
|
color: Colors.black.withAlpha(25), |
|
|
|
|
offset: Offset(0, 1), |
|
|
|
|
blurRadius: 12, |
|
|
|
|
spreadRadius: 0, |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
Expanded( |
|
|
|
|
child: Container( |
|
|
|
|
margin: EdgeInsets.only( |
|
|
|
|
left: 10.w, |
|
|
|
|
right: 10.w, |
|
|
|
|
top: 16.h, |
|
|
|
|
child: Column( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceAround, |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
children: [ |
|
|
|
|
AspectRatio( |
|
|
|
|
aspectRatio: 1.8, |
|
|
|
|
child: buildSwiper(), |
|
|
|
|
), |
|
|
|
|
child: Column( |
|
|
|
|
mainAxisAlignment: |
|
|
|
|
MainAxisAlignment.spaceBetween, |
|
|
|
|
crossAxisAlignment: |
|
|
|
|
CrossAxisAlignment.start, |
|
|
|
|
children: [ |
|
|
|
|
Row( |
|
|
|
|
Expanded( |
|
|
|
|
child: Container( |
|
|
|
|
margin: EdgeInsets.only( |
|
|
|
|
left: 10.w, |
|
|
|
|
right: 10.w, |
|
|
|
|
top: 16.h, |
|
|
|
|
), |
|
|
|
|
child: Column( |
|
|
|
|
mainAxisAlignment: |
|
|
|
|
MainAxisAlignment.spaceBetween, |
|
|
|
|
crossAxisAlignment: |
|
|
|
|
CrossAxisAlignment.start, |
|
|
|
|
children: [ |
|
|
|
|
Row( |
|
|
|
|
children: [ |
|
|
|
|
Text( |
|
|
|
|
storeInfo != null |
|
|
|
|
? storeInfo.storeName |
|
|
|
|
: "", |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 16.sp, |
|
|
|
|
color: Colors.black, |
|
|
|
|
fontWeight: FontWeight.w500, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Expanded( |
|
|
|
|
child: Container( |
|
|
|
|
alignment: |
|
|
|
|
Alignment.centerRight, |
|
|
|
|
child: Text( |
|
|
|
|
S.of(context).ren( |
|
|
|
|
storeInfo != null |
|
|
|
|
? storeInfo |
|
|
|
|
.perCapitaConsumption |
|
|
|
|
: "", |
|
|
|
|
), |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 14.sp, |
|
|
|
|
fontWeight: FontWeight.w400, |
|
|
|
|
color: Color(0xFF353535), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
Text( |
|
|
|
|
storeInfo != null |
|
|
|
|
? storeInfo.storeName |
|
|
|
|
? storeInfo.address |
|
|
|
|
: "", |
|
|
|
|
maxLines: 2, |
|
|
|
|
textAlign: TextAlign.justify, |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 16.sp, |
|
|
|
|
color: Colors.black, |
|
|
|
|
fontWeight: FontWeight.w500, |
|
|
|
|
color: Color(0xFF353535), |
|
|
|
|
fontWeight: FontWeight.w400, |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Row( |
|
|
|
|
children: itemServer( |
|
|
|
|
storeInfo != null |
|
|
|
|
? storeInfo.businessService |
|
|
|
|
: "", |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Expanded( |
|
|
|
|
child: Container( |
|
|
|
|
alignment: Alignment.centerRight, |
|
|
|
|
child: Text( |
|
|
|
|
S.of(context).ren( |
|
|
|
|
storeInfo != null |
|
|
|
|
? storeInfo |
|
|
|
|
.perCapitaConsumption |
|
|
|
|
: "", |
|
|
|
|
Row( |
|
|
|
|
mainAxisAlignment: |
|
|
|
|
MainAxisAlignment.spaceBetween, |
|
|
|
|
crossAxisAlignment: |
|
|
|
|
CrossAxisAlignment.end, |
|
|
|
|
children: [ |
|
|
|
|
Expanded( |
|
|
|
|
child: Text( |
|
|
|
|
S.of(context).yingyeshijian(storeInfo == |
|
|
|
|
null |
|
|
|
|
? "" |
|
|
|
|
: (storeInfo.openStartTime == |
|
|
|
|
null && |
|
|
|
|
storeInfo |
|
|
|
|
.openEndTime == |
|
|
|
|
null) |
|
|
|
|
? S.of(context).quantian |
|
|
|
|
: "${storeInfo.openStartTime.substring(0, storeInfo.openStartTime.lastIndexOf(":"))} " |
|
|
|
|
"- ${storeInfo.openEndTime.substring(0, storeInfo.openEndTime.lastIndexOf(":"))}"), |
|
|
|
|
style: TextStyle( |
|
|
|
|
color: Color(0xFF353535), |
|
|
|
|
fontWeight: FontWeight.w400, |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 14.sp, |
|
|
|
|
fontWeight: FontWeight.w400, |
|
|
|
|
color: Color(0xFF353535), |
|
|
|
|
), |
|
|
|
|
SizedBox( |
|
|
|
|
width: 16.w, |
|
|
|
|
), |
|
|
|
|
InkWell( |
|
|
|
|
onTap: () { |
|
|
|
|
if (storeInfo == null || |
|
|
|
|
storeInfo.latitude == |
|
|
|
|
null || |
|
|
|
|
storeInfo.longitude == |
|
|
|
|
null || |
|
|
|
|
storeInfo.latitude == "" || |
|
|
|
|
storeInfo.longitude == "") |
|
|
|
|
return; |
|
|
|
|
Navigator.of(context).pushNamed( |
|
|
|
|
'/router/location_map', |
|
|
|
|
arguments: { |
|
|
|
|
"lat": storeInfo.latitude, |
|
|
|
|
"lng": |
|
|
|
|
storeInfo.longitude, |
|
|
|
|
"storeName": |
|
|
|
|
storeInfo.storeName, |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
child: Image.asset( |
|
|
|
|
"assets/image/icon_union_location.png", |
|
|
|
|
width: 24.w, |
|
|
|
|
height: 24.h, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
Text( |
|
|
|
|
storeInfo != null |
|
|
|
|
? storeInfo.address |
|
|
|
|
: "", |
|
|
|
|
maxLines: 2, |
|
|
|
|
textAlign: TextAlign.justify, |
|
|
|
|
style: TextStyle( |
|
|
|
|
color: Color(0xFF353535), |
|
|
|
|
fontWeight: FontWeight.w400, |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Row( |
|
|
|
|
children: itemServer( |
|
|
|
|
storeInfo != null |
|
|
|
|
? storeInfo.businessService : "", |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Row( |
|
|
|
|
mainAxisAlignment: |
|
|
|
|
MainAxisAlignment.spaceBetween, |
|
|
|
|
crossAxisAlignment: |
|
|
|
|
CrossAxisAlignment.end, |
|
|
|
|
children: [ |
|
|
|
|
Expanded( |
|
|
|
|
child: Text( |
|
|
|
|
S.of(context).yingyeshijian(storeInfo == null |
|
|
|
|
? "" : (storeInfo.openStartTime == null && storeInfo.openEndTime == null) |
|
|
|
|
? S.of(context).quantian |
|
|
|
|
: "${storeInfo.openStartTime.substring(0, storeInfo.openStartTime.lastIndexOf(":"))} " |
|
|
|
|
"- ${storeInfo.openEndTime.substring(0, storeInfo.openEndTime.lastIndexOf(":"))}"), |
|
|
|
|
style: TextStyle( |
|
|
|
|
color: Color(0xFF353535), |
|
|
|
|
fontWeight: FontWeight.w400, |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
SizedBox( |
|
|
|
|
width: 16.w, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
SizedBox( |
|
|
|
|
width: 16.w, |
|
|
|
|
), |
|
|
|
|
InkWell( |
|
|
|
|
onTap: () { |
|
|
|
|
if (storeInfo == null || |
|
|
|
|
storeInfo.latitude == null || |
|
|
|
|
storeInfo.longitude == null || |
|
|
|
|
storeInfo.latitude == "" || |
|
|
|
|
storeInfo.longitude == "") |
|
|
|
|
return; |
|
|
|
|
Navigator.of(context).pushNamed( |
|
|
|
|
'/router/location_map', |
|
|
|
|
arguments: { |
|
|
|
|
"lat": storeInfo.latitude, |
|
|
|
|
"lng": storeInfo.longitude, |
|
|
|
|
"storeName": |
|
|
|
|
storeInfo.storeName, |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
child: Image.asset( |
|
|
|
|
"assets/image/icon_union_location.png", |
|
|
|
|
width: 24.w, |
|
|
|
|
height: 24.h, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
SizedBox( |
|
|
|
|
width: 16.w, |
|
|
|
|
), |
|
|
|
|
InkWell( |
|
|
|
|
onTap: () { |
|
|
|
|
showCallMobile(); |
|
|
|
|
}, |
|
|
|
|
child: Image.asset( |
|
|
|
|
"assets/image/icon_union_call.png", |
|
|
|
|
width: 24, |
|
|
|
|
height: 24, |
|
|
|
|
), |
|
|
|
|
InkWell( |
|
|
|
|
onTap: () { |
|
|
|
|
showCallMobile(); |
|
|
|
|
}, |
|
|
|
|
child: Image.asset( |
|
|
|
|
"assets/image/icon_union_call.png", |
|
|
|
|
width: 24, |
|
|
|
|
height: 24, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
flex: 1, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
flex: 1, |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
buildVip(), |
|
|
|
|
Container( |
|
|
|
|
margin: EdgeInsets.only(top: 10.h, bottom: 10.h), |
|
|
|
|
child: ItemTitle( |
|
|
|
|
text: S.of(context).youhuiquan, |
|
|
|
|
imgPath: "assets/image/icon_union_coupons.png", |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
(storeInfo != null && storeInfo.couponVOList != null) |
|
|
|
|
? buildCoupon() |
|
|
|
|
: Container( |
|
|
|
|
width: double.infinity, |
|
|
|
|
height: 50.h, |
|
|
|
|
alignment: Alignment.center, |
|
|
|
|
child: Text( |
|
|
|
|
S.of(context).zanwuyouhuiquankelingqu, |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 14.sp, |
|
|
|
|
fontWeight: FontWeight.bold, |
|
|
|
|
color: Color(0xFFA0A0A0), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
buildVip(), |
|
|
|
|
Container( |
|
|
|
|
margin: EdgeInsets.only(top: 10.h, bottom: 10.h), |
|
|
|
|
child: ItemTitle( |
|
|
|
|
text: S.of(context).youhuiquan, |
|
|
|
|
imgPath: "assets/image/icon_union_coupons.png", |
|
|
|
|
), |
|
|
|
|
Container( |
|
|
|
|
margin: EdgeInsets.only(top: 20.h, bottom: 20.h), |
|
|
|
|
child: ItemTitle( |
|
|
|
|
text: S.of(context).xindianhuodong, |
|
|
|
|
imgPath: "assets/image/icon_union_start_store.png", |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
(activitys != null && activitys.length > 0) |
|
|
|
|
? Container( |
|
|
|
|
margin: EdgeInsets.only(bottom: 30.h), |
|
|
|
|
child: AspectRatio( |
|
|
|
|
aspectRatio: 1.55, |
|
|
|
|
child: buildSwiper2Bottom(), |
|
|
|
|
), |
|
|
|
|
) |
|
|
|
|
: Container( |
|
|
|
|
width: double.infinity, |
|
|
|
|
height: 30.h, |
|
|
|
|
margin: EdgeInsets.only(bottom: 30.h), |
|
|
|
|
alignment: Alignment.center, |
|
|
|
|
child: Text( |
|
|
|
|
S.of(context).muqianzanwuxingdianhuodong, |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 14.sp, |
|
|
|
|
fontWeight: FontWeight.bold, |
|
|
|
|
color: Color(0xFFA0A0A0), |
|
|
|
|
), |
|
|
|
|
(storeInfo != null && storeInfo.couponVOList != null) |
|
|
|
|
? buildCoupon() |
|
|
|
|
: Container( |
|
|
|
|
width: double.infinity, |
|
|
|
|
height: 50.h, |
|
|
|
|
alignment: Alignment.center, |
|
|
|
|
child: Text( |
|
|
|
|
S.of(context).zanwuyouhuiquankelingqu, |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 14.sp, |
|
|
|
|
fontWeight: FontWeight.bold, |
|
|
|
|
color: Color(0xFFA0A0A0), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Container( |
|
|
|
|
margin: EdgeInsets.only(top: 20.h, bottom: 20.h), |
|
|
|
|
child: ItemTitle( |
|
|
|
|
text: S.of(context).xindianhuodong, |
|
|
|
|
imgPath: "assets/image/icon_union_start_store.png", |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
flex: 1, |
|
|
|
|
), |
|
|
|
|
InkWell( |
|
|
|
|
onTap: _loginMin, |
|
|
|
|
child: Container( |
|
|
|
|
padding: EdgeInsets.only(top: 16.h, bottom: 16.h), |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: isEnable() ? Color(0xFF32A060) : Color(0xFFD8D8D8), |
|
|
|
|
borderRadius: BorderRadius.vertical( |
|
|
|
|
top: Radius.circular(4), |
|
|
|
|
), |
|
|
|
|
(activitys != null && activitys.length > 0) |
|
|
|
|
? Container( |
|
|
|
|
margin: EdgeInsets.only(bottom: 30.h), |
|
|
|
|
child: AspectRatio( |
|
|
|
|
aspectRatio: 1.55, |
|
|
|
|
child: buildSwiper2Bottom(), |
|
|
|
|
), |
|
|
|
|
) |
|
|
|
|
: Container( |
|
|
|
|
width: double.infinity, |
|
|
|
|
height: 30.h, |
|
|
|
|
margin: EdgeInsets.only(bottom: 30.h), |
|
|
|
|
alignment: Alignment.center, |
|
|
|
|
child: Text( |
|
|
|
|
S.of(context).muqianzanwuxingdianhuodong, |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 14.sp, |
|
|
|
|
fontWeight: FontWeight.bold, |
|
|
|
|
color: Color(0xFFA0A0A0), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
flex: 1, |
|
|
|
|
), |
|
|
|
|
alignment: Alignment.center, |
|
|
|
|
child: Text( |
|
|
|
|
isEnable() |
|
|
|
|
? S.of(context).jinrushangdian |
|
|
|
|
: S.of(context).zanwuxianshangjindian, |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 16.sp, |
|
|
|
|
color: isEnable() ? Colors.white : Color(0xFFA0A0A0), |
|
|
|
|
fontWeight: FontWeight.bold, |
|
|
|
|
InkWell( |
|
|
|
|
onTap: _loginMin, |
|
|
|
|
child: Container( |
|
|
|
|
padding: EdgeInsets.only(top: 16.h, bottom: 16.h), |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: isEnable() ? Color(0xFF32A060) : Color(0xFFD8D8D8), |
|
|
|
|
borderRadius: BorderRadius.vertical( |
|
|
|
|
top: Radius.circular(4), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
alignment: Alignment.center, |
|
|
|
|
child: Text( |
|
|
|
|
isEnable() |
|
|
|
|
? S.of(context).jinrushangdian |
|
|
|
|
: S.of(context).zanwuxianshangjindian, |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 16.sp, |
|
|
|
|
color: isEnable() ? Colors.white : Color(0xFFA0A0A0), |
|
|
|
|
fontWeight: FontWeight.bold, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
], |
|
|
|
|
); |
|
|
|
|
}, |
|
|
|
|
), |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
@ -793,9 +802,8 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
|
|
|
|
|
? activitys[position].coverImg |
|
|
|
|
: "", |
|
|
|
|
aspectRatio: 2.2, |
|
|
|
|
radius: BorderRadius.only( |
|
|
|
|
topRight: Radius.circular(8), |
|
|
|
|
topLeft: Radius.circular(8), |
|
|
|
|
radius: BorderRadius.vertical( |
|
|
|
|
top: Radius.circular(8), |
|
|
|
|
), |
|
|
|
|
fit: BoxFit.cover, |
|
|
|
|
errorSrc: "assets/image/default_2_1.png", |
|
|
|
@ -911,26 +919,12 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
|
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//{"uid":"1412687522458238976", |
|
|
|
|
// "userInfo":{"headimg":"https:\/\/pos.upload.gznl.top\/admin\/2021\/07\/4ed055e5-5341-4080-a6f0-fe97c62d078f.jpg", |
|
|
|
|
// "balance":null, |
|
|
|
|
// "money":"0.00", |
|
|
|
|
// "phone":"13800138000", |
|
|
|
|
// "isBind":true, |
|
|
|
|
// "nickname":"你这橘子洋气呀" |
|
|
|
|
// }, |
|
|
|
|
// "baseURL":"https:\/\/pos-test.api.lotus-wallet.com\/app\/", |
|
|
|
|
// "shopId":"1344490596986781696", |
|
|
|
|
// "tenantCode":"1177", |
|
|
|
|
// "position":"30.554638,114.34394500000002", |
|
|
|
|
// "token":"Bearer eyJ0eXAiOiJKc29uV2ViVG9rZW4iLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX3R5cGUiOiJNSU5JIiwibmFtZSI6IiIsInRva2VuX3R5cGUiOiJ0b2tlbiIsInVzZXJpZCI6IjE0MTI2ODc1MjI0NTgyMzg5NzYiLCJhY2NvdW50IjoiIiwiZXhwIjoxNjI2Nzk1Nzc0LCJuYmYiOjE2MjY3NjY5NzR9.cggcx_vqTozKS-z9uygjV4uA2yHQ4eWssMAngd2c-i0"} |
|
|
|
|
printMin() async { |
|
|
|
|
String miniAppId = storeInfo.mini.miniAppId; |
|
|
|
|
print("print isExistsApp: ${await Min.isExistsApp(miniAppId)}"); |
|
|
|
|
print("print getAppBasePath: ${await Min.getAppBasePath(miniAppId)}"); |
|
|
|
|
print("print currentPageUrl: ${await Min.currentPageUrl()}"); |
|
|
|
|
print("print runingAppid: ${await Min.runingAppid()}"); |
|
|
|
|
// print("print getAppVersionInfo: ${await Min.getAppVersionInfo(miniAppId)}"); |
|
|
|
|
debugPrint("print isExistsApp: ${await Min.isExistsApp(miniAppId)}"); |
|
|
|
|
debugPrint("print getAppBasePath: ${await Min.getAppBasePath(miniAppId)}"); |
|
|
|
|
debugPrint("print currentPageUrl: ${await Min.currentPageUrl()}"); |
|
|
|
|
debugPrint("print runingAppid: ${await Min.runingAppid()}"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
_loginMin() async { |
|
|
|
@ -1008,67 +1002,20 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
|
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Function state; |
|
|
|
|
double progressValue = 0; |
|
|
|
|
String downText = "正在下载中..."; |
|
|
|
|
|
|
|
|
|
downloadWgt(appid, savePath) async { |
|
|
|
|
downText = S.of(context).zhengzaixiazaizhong; |
|
|
|
|
showCupertinoDialog( |
|
|
|
|
context: context, |
|
|
|
|
barrierDismissible: true, |
|
|
|
|
builder: (context) { |
|
|
|
|
return Material( |
|
|
|
|
type: MaterialType.transparency, |
|
|
|
|
child: StatefulBuilder(builder: (context, status) { |
|
|
|
|
state = status; |
|
|
|
|
return Center( |
|
|
|
|
child: Container( |
|
|
|
|
width: 130.w, |
|
|
|
|
height: 130.h, |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
borderRadius: BorderRadius.circular(8), |
|
|
|
|
color: Colors.white, |
|
|
|
|
), |
|
|
|
|
child: Column( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly, |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center, |
|
|
|
|
children: [ |
|
|
|
|
SizedBox( |
|
|
|
|
height: 40.h, |
|
|
|
|
width: 40.w, |
|
|
|
|
child: CircularProgressIndicator( |
|
|
|
|
value: progressValue, |
|
|
|
|
backgroundColor: Colors.yellow, |
|
|
|
|
color: Colors.blue, |
|
|
|
|
valueColor: AlwaysStoppedAnimation<Color>(Colors.red), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Text( |
|
|
|
|
downText, |
|
|
|
|
style: TextStyle( |
|
|
|
|
color: Colors.black, |
|
|
|
|
fontSize: 16.sp, |
|
|
|
|
fontWeight: FontWeight.bold, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
); |
|
|
|
|
}), |
|
|
|
|
); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
Response response = await Dio() |
|
|
|
|
.download(storeInfo.mini.miniDownloadUrl, savePath, |
|
|
|
|
onReceiveProgress: (progress, max) { |
|
|
|
|
progressValue = progress.toDouble() / max.toDouble(); |
|
|
|
|
// print("print progressValue: $progressValue"); |
|
|
|
|
state(() {}); |
|
|
|
|
EasyLoading.showProgress(progressValue, status: downText); |
|
|
|
|
}); |
|
|
|
|
if (response.statusCode == 200) { |
|
|
|
|
downText = "下载完成"; |
|
|
|
|
EasyLoading.showProgress(progressValue, status: downText); |
|
|
|
|
SharedPreferences.getInstance().then((value) { |
|
|
|
|
value.setStringList( |
|
|
|
|
"miniAppid", |
|
|
|
@ -1077,15 +1024,12 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
|
|
|
|
|
: []) |
|
|
|
|
..add(appid)); |
|
|
|
|
}); |
|
|
|
|
state(() {}); |
|
|
|
|
Future.delayed(Duration(seconds: 1), () { |
|
|
|
|
if (Navigator.canPop(context)) { |
|
|
|
|
Navigator.of(context).pop(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
print("print 下载失败"); |
|
|
|
|
} |
|
|
|
|
Future.delayed(Duration(seconds: 1), () { |
|
|
|
|
EasyLoading.dismiss(); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
List<Widget> itemServer(String businessService) { |
|
|
|
@ -1112,7 +1056,7 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
|
|
|
|
|
showCallMobile() { |
|
|
|
|
showCupertinoModalPopup( |
|
|
|
|
context: context, |
|
|
|
|
builder: (contetx) { |
|
|
|
|
builder: (context) { |
|
|
|
|
return CupertinoActionSheet( |
|
|
|
|
title: Text(S.of(context).bodadianhua), |
|
|
|
|
actions: [ |
|
|
|
|