Browse Source

首页,积分,我的成就,我的页面-其他,会员卡列表,店铺充值,订单列表,充值,门店列表,福利中心等板块,整体优化更改;

店铺充值:店铺充值列表,店铺充值接口都改为小程序接口;(支持微信支付宝)
新增店铺充值接口实体类;
dev
huixiang_app 1 year ago
parent
commit
b2d180cb0a
  1. 181
      lib/home/home_page.dart
  2. 774
      lib/home/welfare_page.dart
  3. 46
      lib/integral/integral_page.dart
  4. 56
      lib/integral/intergra_view/integral_task.dart
  5. 41
      lib/mine/mine_shop_page.dart
  6. 624
      lib/mine/mine_shop_recharge.dart
  7. 71
      lib/mine/mine_view/mine_item.dart
  8. 326
      lib/mine/mine_vip/mine_attainment_page.dart
  9. 906
      lib/mine/recharge_page.dart
  10. 354
      lib/order/order_history_page.dart
  11. 159
      lib/retrofit/data/member_recharge_list.dart
  12. 10
      lib/retrofit/min_api.dart
  13. 45
      lib/retrofit/min_api.g.dart
  14. 14
      lib/retrofit/retrofit_api.dart
  15. 4
      lib/retrofit/retrofit_api.g.dart
  16. 12
      lib/store/store_view/shop_goods.dart
  17. 65
      lib/union/union_list.dart
  18. 3
      lib/view_widget/my_appbar.dart
  19. 8
      lib/view_widget/recharge_details_dialog.dart

181
lib/home/home_page.dart

@ -40,6 +40,7 @@ import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../retrofit/data/user_info.dart';
import '../utils/flutter_utils.dart';
import '../view_widget/channel_dialog.dart';
import '../view_widget/custom_image.dart';
import 'home_view/happy_help_farmers.dart';
@ -76,6 +77,7 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
List<Goods> goods = [];
List<GoodsCategory> gooodsCategorys = [];
List<BannerData> bannerData = [];
List<BannerData> activityBannerData = [];
List<Brand> brandData = [];
List<Article> articles = [];
Founder founder;
@ -87,6 +89,7 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
UserInfo userInfo;
dynamic mRaiseMoney = 0; //
int _loadCount = 0;
DioErrorType dioErrorType;
@override
void initState() {
@ -160,7 +163,9 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
try {
BaseData<PageInfo<BannerData>> baseData = await apiService.queryBanner({
"model": {"type": "HOME_PAGE"},
}).catchError((onError) {});
}).catchError((onError) {
dioErrorType = onError.type;
});
if (baseData != null && baseData.isSuccess) {
bannerData = baseData.data.records;
// if (bannerData.length > 0) swiperController.move(0, animation: false);
@ -170,12 +175,32 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
}
}
///banner
queryActivityBanner() async {
try {
BaseData<PageInfo<BannerData>> baseData = await apiService.queryBanner({
"model": {"type": "HOME_STORE_PAGE"},
}).catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
activityBannerData = baseData.data.records;
}
} finally {
addLoadCount();
}
}
addLoadCount() {
_loadCount += 1;
if (_loadCount == 6) {
if (_loadCount == 7) {
_loadCount = 0;
EasyLoading.dismiss();
if (refreshController.isRefresh) refreshController.refreshCompleted();
if (dioErrorType == null)
refreshController.refreshCompleted();
else {
SmartDialog.showToast(AppUtils.dioErrorTypeToString(dioErrorType),
alignment: Alignment.center);
refreshController.refreshFailed();
}
if (mounted) setState(() {});
}
}
@ -240,11 +265,11 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
goods = pageGoods.data.list;
}
} finally {
if(isRefresh)
addLoadCount();
if (isRefresh)
addLoadCount();
else {
EasyLoading.dismiss();
setState((){});
setState(() {});
}
}
}
@ -334,8 +359,10 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
token: value.getString("token"),
);
}
dioErrorType = null;
if (isFirstIn) queryActivity();
queryBanner();
queryActivityBanner();
queryRecommendRank();
queryGoodsCategory();
queryPointsProductList(true);
@ -627,50 +654,118 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
Widget spread() {
return Container(
width: double.infinity,
// margin: EdgeInsets.symmetric(horizontal:14.w),
height: 85.h,
child: Swiper(
pagination: SwiperPagination(
alignment: Alignment.bottomCenter,
margin: EdgeInsets.only(top: 5.h),
builder: DotSwiperPaginationBuilder(
size: 8.w,
activeSize: 8.w,
space: 5.w,
activeColor: Colors.white,
color: Colors.white.withAlpha(76),
),
),
autoplay: true,
duration: 1000,
autoplayDelay: 2000,
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
if (position == 0) {
Navigator.of(context).pushNamed('/router/invite_friends');
} else if (position == 1) {
Navigator.of(context).pushNamed('/router/trading_card_page');
}
},
child: Container(
margin: EdgeInsets.symmetric(horizontal: 14.w),
child: ClipRRect(
child: Image.asset(
spreadItem[position],
width: double.infinity,
fit: BoxFit.fill,
height: double.infinity,
child: bannerData != null && bannerData.isNotEmpty
? Swiper(
pagination: SwiperPagination(
alignment: Alignment.bottomCenter,
margin: EdgeInsets.only(top: 5.h),
builder: DotSwiperPaginationBuilder(
size: 8.w,
activeSize: 8.w,
space: 5.w,
activeColor: Colors.white,
color: Colors.white.withAlpha(76),
),
borderRadius: BorderRadius.circular(6.w),
),
autoplay: true,
duration: 1000,
autoplayDelay: 2000,
itemBuilder: (context, position) {
return InkWell(
onTap: () {
spreadBannerClick(activityBannerData[position]);
},
child: Container(
margin: EdgeInsets.symmetric(horizontal: 14.w),
child: MImage(
activityBannerData[position].imgUrl,
fit: BoxFit.cover,
radius: BorderRadius.circular(6),
errorSrc: "assets/image/default_2_1.webp",
fadeSrc: "assets/image/default_2_1.webp",
),
),
);
// GestureDetector(
// onTap: () {
// if (position == 0) {
// Navigator.of(context).pushNamed('/router/invite_friends');
// } else if (position == 1) {
// Navigator.of(context).pushNamed('/router/trading_card_page');
// }
// },
// child: Container(
// margin: EdgeInsets.symmetric(horizontal: 14.w),
// child: ClipRRect(
// child: Image.asset(
// spreadItem[position],
// width: double.infinity,
// fit: BoxFit.fill,
// height: double.infinity,
// ),
// borderRadius: BorderRadius.circular(6.w),
// ),
// ),
// );
},
itemCount: activityBannerData.length,
)
: Image.asset(
"assets/image/default_2_1.webp",
fit: BoxFit.cover,
),
);
},
itemCount: 2,
),
);
}
/// contentType 0123,4:,5:7
spreadBannerClick(BannerData activityBannerData) async {
switch (activityBannerData.contentType) {
case 1:
Navigator.of(context).pushNamed('/router/integral_store_page',
arguments: {"goodsId": activityBannerData.content});
break;
case 2:
Navigator.of(context).pushNamed('/router/web_page', arguments: {
"activityId": activityBannerData.content,
});
break;
case 3:
Navigator.of(context).pushNamed('/router/web_page', arguments: {
"articleId": activityBannerData.content,
});
break;
case 4:
String router = activityBannerData.content;
// String router = "/router/store_order?{\"id\":\"1512378184161558528\",\"tenant\":\"1188\",\"storeName\":\"农场煮意\"}";
if (router.contains("?")) {
String params = router.substring(router.indexOf("?") + 1);
Map map = jsonDecode(params);
Navigator.of(context).pushNamed(
router.substring(0, router.indexOf("?")),
arguments: map);
} else {
Navigator.of(context).pushNamed(router);
}
break;
case 5:
Navigator.of(context).pushNamed('/router/class_details', arguments: {
"id": activityBannerData.content,
});
break;
case 7:
String params = activityBannerData.content
.substring(activityBannerData.content.indexOf("?") + 1);
Map map = jsonDecode(params);
Navigator.of(context).pushNamed(
activityBannerData.content
.substring(0, activityBannerData.content.indexOf("?")),
arguments: map);
break;
}
}
final List<String> spreadItem = [
"assets/image/welfare_spread.webp",
"assets/image/welfare_yz.webp",

774
lib/home/welfare_page.dart

File diff suppressed because it is too large Load Diff

46
lib/integral/integral_page.dart

@ -19,10 +19,10 @@ import 'package:huixiang/view_widget/sign_in_widget.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../utils/flutter_utils.dart';
import 'intergra_view/integral_task.dart';
class IntegralPage extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _IntegralPage();
@ -51,13 +51,17 @@ class _IntegralPage extends State<IntegralPage> {
);
userInfo = UserInfo.fromJson(jsonDecode(value.getString("user")));
BaseData<List<Rank>> rankData = await apiService.rankList()
.catchError((onError) {});
BaseData<List<Rank>> rankData =
await apiService.rankList().catchError((onError) {
SmartDialog.showToast(AppUtils.dioErrorTypeToString(onError.type),
alignment: Alignment.center);
refreshController.refreshFailed();
});
if (rankData != null && rankData.isSuccess) {
ranks.clear();
ranks.addAll(rankData.data);
refreshController.refreshCompleted();
}else {
} else {
refreshController.refreshFailed();
}
@ -112,7 +116,9 @@ class _IntegralPage extends State<IntegralPage> {
Scaffold(
backgroundColor: Colors.transparent,
appBar: MyAppBar(
exit: (){Navigator.of(context).pop(signInfo.todayHasSignin ?? false);},
exit: () {
Navigator.of(context).pop(signInfo?.todayHasSignin ?? false);
},
background: Colors.transparent,
leadingColor: Colors.white,
title: "",
@ -124,7 +130,9 @@ class _IntegralPage extends State<IntegralPage> {
margin: EdgeInsets.only(right: 16.w),
child: GestureDetector(
onTap: () {
Navigator.of(context).pushNamed('/router/integral_detailed_page',arguments:{"titleType":2});
Navigator.of(context).pushNamed(
'/router/integral_detailed_page',
arguments: {"titleType": 2});
},
child: Text(
S.of(context).mingxi,
@ -137,17 +145,17 @@ class _IntegralPage extends State<IntegralPage> {
),
),
),
body:SmartRefresher(
body: SmartRefresher(
controller: refreshController,
enablePullDown: true,
enablePullUp: false,
header: MyHeader(),
header: MyHeader(color: Colors.white,),
footer: CustomFooter(
builder: (context, mode) {
return MyFooter(mode);
},
),
onRefresh:(){
onRefresh: () {
setState(() {
querySignInfo();
});
@ -163,9 +171,19 @@ class _IntegralPage extends State<IntegralPage> {
return Column(
children: [
/// VIP等级显示
IntegralVip(rankLevel, signInfo, userInfo,"${ (signInfo?.signInList?.length ) ?? "0"}",
((signInfo?.rewardList != null && signInfo.rewardList.length > (signInfo?.signInList?.length ?? 0)) ?
signInfo.rewardList[signInfo?.signInList?.length ?? 0]:0).toString()),
IntegralVip(
rankLevel,
signInfo,
userInfo,
"${(signInfo?.signInList?.length) ?? "0"}",
((signInfo?.rewardList != null &&
signInfo.rewardList.length >
(signInfo?.signInList?.length ??
0))
? signInfo.rewardList[
signInfo?.signInList?.length ?? 0]
: 0)
.toString()),
///
InForPoints(signInfo, _signIn),
@ -191,7 +209,9 @@ class _IntegralPage extends State<IntegralPage> {
SmartDialog.showToast("今日已签到了", alignment: Alignment.center);
return;
}
EasyLoading.show(status: S.of(context).zhengzaijiazai,maskType: EasyLoadingMaskType.black);
EasyLoading.show(
status: S.of(context).zhengzaijiazai,
maskType: EasyLoadingMaskType.black);
BaseData baseData = await apiService.signIn().catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
setState(() {});

56
lib/integral/intergra_view/integral_task.dart

@ -6,6 +6,8 @@ import 'package:huixiang/utils/font_weight.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/view_widget/round_button.dart';
import '../../view_widget/no_data_view.dart';
class IntegralTask extends StatefulWidget {
final SignInfo signInfo;
@ -57,28 +59,38 @@ class _IntegralTask extends State<IntegralTask> {
),
Expanded(
child: Container(
child: ListView.builder(
padding: EdgeInsets.only(left: 10.w, top: 20.h),
physics: BouncingScrollPhysics(),
// loop: false,
// pagination: SwiperPagination(
// alignment: Alignment.bottomCenter,
// builder: DotSwiperPaginationBuilder(
// size: 8,
// activeSize: 8,
// space: 5,
// activeColor: Colors.black,
// color: Colors.black.withAlpha(76),
// ),
// ),
itemBuilder: (context, position) {
return taskItem(widget.signInfo.taskList[position]);
},
itemCount: (widget.signInfo != null &&
widget.signInfo.taskList != null &&
widget.signInfo.taskList.length > 0)
? widget.signInfo.taskList.length
: 0),
child: (widget.signInfo != null &&
widget.signInfo.taskList != null &&
widget.signInfo.taskList.length > 0)
? ListView.builder(
padding: EdgeInsets.only(left: 10.w, top: 20.h),
physics: BouncingScrollPhysics(),
// loop: false,
// pagination: SwiperPagination(
// alignment: Alignment.bottomCenter,
// builder: DotSwiperPaginationBuilder(
// size: 8,
// activeSize: 8,
// space: 5,
// activeColor: Colors.black,
// color: Colors.black.withAlpha(76),
// ),
// ),
itemBuilder: (context, position) {
return taskItem(widget.signInfo.taskList[position]);
},
itemCount: (widget.signInfo != null &&
widget.signInfo.taskList != null &&
widget.signInfo.taskList.length > 0)
? widget.signInfo.taskList.length
: 0)
: NoDataView(
src: "assets/image/xiao_fei.webp",
isShowBtn: false,
text: "暂无任务可做~",
fontSize: 16.sp,
margin: EdgeInsets.only(left: 60.w, right: 60.w),
),
),
flex: 1,
)

41
lib/mine/mine_shop_page.dart

@ -2,6 +2,7 @@ import 'dart:convert';
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/page.dart';
@ -85,19 +86,25 @@ class _MineShopPage extends State<MineShopPage> with WidgetsBindingObserver{
super.dispose();
}
queryVipCard() async {
BaseData<List<VipCard>> baseData =
await apiService.vipList({}).catchError((error) {
refreshController.refreshFailed();
});
if (baseData != null && baseData.isSuccess) {
coupons.clear();
coupons.addAll(baseData.data);
setState(() {
refreshController.refreshCompleted();
queryVipCard({bool showLoading = true}) async {
try{
if(showLoading)EasyLoading.show(status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black);
BaseData<List<VipCard>> baseData =
await apiService.vipList({
"keywords":editingController.text,
}).catchError((error) {
refreshController.refreshFailed();
});
} else {
refreshController.refreshFailed();
if (baseData != null && baseData.isSuccess) {
coupons.clear();
coupons.addAll(baseData.data);
refreshController.refreshCompleted();
} else {
refreshController.refreshFailed();
}
}finally{
EasyLoading.dismiss();
setState(() {});
}
}
@ -109,6 +116,7 @@ class _MineShopPage extends State<MineShopPage> with WidgetsBindingObserver{
FocusScope.of(context).requestFocus(FocusNode());
},
child: Scaffold(
resizeToAvoidBottomInset: false,
appBar: MyAppBar(
title: "店铺充值",
titleColor: Colors.black,
@ -142,7 +150,13 @@ class _MineShopPage extends State<MineShopPage> with WidgetsBindingObserver{
onTap: () {
Navigator.of(context).pushNamed(
'/router/mine_shop_recharge',
arguments: {"id": coupons[position].id});
arguments: {
"id": coupons[position].id,
"tenantCode":coupons[position].tenantCode,
"storeId":coupons[position].storeList[0].id
}).then((value) {
queryVipCard(showLoading: false);
});
},
child: shopItem(coupons[position]),
);
@ -184,6 +198,7 @@ class _MineShopPage extends State<MineShopPage> with WidgetsBindingObserver{
textInputAction: TextInputAction.search,
onEditingComplete: () {
FocusScope.of(context).requestFocus(FocusNode());
queryVipCard();
},
controller: editingController,
cursorHeight: 25.h,

624
lib/mine/mine_shop_recharge.dart

@ -1,31 +1,34 @@
import 'package:barcode_widget/barcode_widget.dart';
import 'dart:io';
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bmflocation/flutter_bmflocation.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_html/flutter_html.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:fluwx/fluwx.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/page.dart';
import 'package:huixiang/retrofit/data/product.dart';
import 'package:huixiang/retrofit/data/user_bill.dart';
import 'package:huixiang/retrofit/data/vip_card.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/store/scan.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/utils/location.dart';
import 'package:huixiang/utils/painter_bg.dart';
import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:huixiang/view_widget/my_footer.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart';
import '../retrofit/data/member_recharge_list.dart';
import '../retrofit/data/rechargeActLists.dart';
import '../retrofit/data/wx_pay.dart';
import '../retrofit/min_api.dart';
import '../utils/flutter_utils.dart';
import '../utils/min.dart';
import '../view_widget/classic_header.dart';
import '../view_widget/my_footer.dart';
import '../view_widget/no_data_view.dart';
import '../view_widget/recharge_details_dialog.dart';
import 'package:tobias/tobias.dart' as tobias;
class MineShopRecharge extends StatefulWidget {
final Map<String, dynamic> arguments;
@ -40,203 +43,358 @@ class MineShopRecharge extends StatefulWidget {
class _MineShopRecharge extends State<MineShopRecharge> {
ApiService apiService;
MinApiService minService;
VipCard vipCard;
RechargeActLists rechargeActLists;
List<MemberRechargeList> memberRechargeList = [];
int selectIndex = 0;
double discount = 100;
var checkIndex = 2;
dynamic payListen;
int _loadCount = 0;
String tenant;
String storeId;
String minToken;
final RefreshController refreshController = RefreshController();
@override
void dispose() {
super.dispose();
refreshController.dispose();
if (payListen != null) payListen.cancel();
}
@override
void initState() {
super.initState();
vipDetail("", "");
storeId = widget.arguments["storeId"];
tenant = widget.arguments["tenantCode"];
_onRefresh();
payListen = weChatResponseEventHandler.listen((event) async {
print("payCallback: ${event.errCode}");
if (event.errCode == 0) {
SmartDialog.showToast("充值成功", alignment: Alignment.center);
} else {
SmartDialog.showToast("充值失败", alignment: Alignment.center);
}
vipDetail();
});
}
///
vipDetail(latitude, longitude) async {
SharedPreferences value = await SharedPreferences.getInstance();
if (apiService == null)
apiService =
ApiService(Dio(), context: context, token: value.getString("token"));
BaseData<VipCard> baseData = await apiService.vipDetail({
"id": widget.arguments["id"],
"latitude": "$latitude",
"longitude": "$longitude",
}).catchError((onError) {});
vipDetail({bool isSingle = true}) async {
try {
BaseData<VipCard> baseData = await apiService.vipDetail({
"id": widget.arguments["id"],
"latitude": "",
"longitude": "",
}).catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
vipCard = baseData.data;
}
} finally {
if(isSingle)
setState((){});
else
addLoadCount();
}
}
///
minLogin() async {
try {
var baseData = await apiService.minLogin(storeId).catchError((onError) {
debugPrint(onError.toString());
});
if (baseData != null && baseData.isSuccess) {
minToken = baseData.data["token"];
SharedPreferences.getInstance().then(
(value) => {
value.setString('minToken', minToken),
value.setString('tenant', tenant),
value.setString('storeId', storeId),
},
);
minService = MinApiService(
Dio(),
context: context,
token: minToken,
tenant: tenant,
storeId: storeId,
);
}
} finally {}
}
///
queryRechargeActList() async {
try {
BaseData<List<MemberRechargeList>> baseData =
await minService.memberRechargeList().catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
memberRechargeList = baseData.data;
}
} finally {
addLoadCount();
}
}
///
shopRecharge() async {
if (minService == null) await minLogin();
BaseData<dynamic> baseData = await minService.memberRecharge({
"money": 0,
"rechargeId": memberRechargeList[selectIndex].id,
"type": checkIndex == 2 ? "wechat" : "alipay",
}).catchError((error) {});
if (baseData != null && baseData.isSuccess) {
vipCard = baseData.data;
refreshController.loadComplete();
if (checkIndex == 2) {
if (Platform.isAndroid) {
if (!(await Min.isInitialize())) {
// app的充值支付使用同一个WXPayEntryActivity回调
// getPackage空指针
//
await Min.initialize();
}
}
WxPay wxPay = WxPay.fromJson(baseData.data);
await registerWxApi(
appId: wxPay.appId,
doOnAndroid: true,
universalLink: "https://hx.lotus-wallet.com/app/",
);
payWithWeChat(
appId: wxPay.appId,
partnerId: wxPay.partnerId,
prepayId: wxPay.prepayId,
packageValue: wxPay.packageValue,
nonceStr: wxPay.nonceStr,
timeStamp: int.tryParse(wxPay.timeStamp),
sign: wxPay.sign,
);
} else {
tobias.isAliPayInstalled().then((value) => {
//
if (!value)
{SmartDialog.showToast("请安装支付宝", alignment: Alignment.center)}
else
{
tobias.aliPay(baseData.data["body"]).then((payRes) {
if (payRes['resultStatus'] == 9000 ||
payRes['resultStatus'] == '9000') {
SmartDialog.showToast("充值成功",
alignment: Alignment.center);
} else {
SmartDialog.showToast(payRes['memo'],
alignment: Alignment.center);
}
vipDetail();
})
}
});
}
} else {
refreshController.loadFailed();
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}
}
_onRefresh() async {
EasyLoading.show(
status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black);
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService =
ApiService(Dio(), context: context, token: value.getString("token"));
}
if (minService == null) await minLogin();
vipDetail(isSingle: false);
queryRechargeActList();
}
addLoadCount() {
_loadCount += 1;
if (_loadCount == 2) {
_loadCount = 0;
EasyLoading.dismiss();
if (refreshController.isRefresh) refreshController.refreshCompleted();
if (mounted) setState(() {});
}
print("object:object");
setState(() {});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: MyAppBar(
title: "店铺充值",
titleColor: Colors.black,
background: Colors.white,
brightness: Brightness.dark,
leadingColor: Colors.black,
),
body:
Column(
children: [
shopRechargeCard(),
// NoDataView(
// src: "assets/image/xiao_fei.webp",
// isShowBtn: false,
// text: "当前店铺暂无充值套餐~",
// fontSize: 16.sp,
// margin: EdgeInsets.only(top: 120.h, left: 60.w, right: 60.w),
// ),
Expanded(child:ListView.builder(
padding: EdgeInsets.zero,
itemCount: 6,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
setState(() {
selectIndex = position;
});
},
child: rechargeItem(position));
},
)),
Container(
width: double.infinity,
margin: EdgeInsets.only(left: 16, right: 16),
padding: EdgeInsets.only(
top: 20.h,
bottom: 24.h,
),
child: Column(
mainAxisAlignment:
MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(bottom: 16.h),
child: Text(
S.of(context).zhifufangshi,
style: TextStyle(
fontSize: 16.sp,
color: Colors.black,
fontWeight: FontWeight.bold,
),
appBar: MyAppBar(
title: "店铺充值",
titleColor: Colors.black,
background: Colors.white,
brightness: Brightness.dark,
leadingColor: Colors.black,
),
body: SmartRefresher(
enablePullDown: true,
enablePullUp: false,
header: MyHeader(),
footer: CustomFooter(
builder: (context, mode) {
return MyFooter(mode);
},
),
controller: refreshController,
onRefresh: _onRefresh,
physics: BouncingScrollPhysics(),
child: Column(
children: [
shopRechargeCard(),
(memberRechargeList != null &&
(memberRechargeList?.length ?? 0) > 0)
? Expanded(
child: ListView.builder(
padding: EdgeInsets.zero,
itemCount: (memberRechargeList != null &&
(memberRechargeList?.length ?? 0) > 0)
? memberRechargeList.length
: 0,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
setState(() {
selectIndex = position;
});
},
child: rechargeItem(
memberRechargeList[position], position));
},
))
: NoDataView(
src: "assets/image/xiao_fei.webp",
isShowBtn: false,
text: "当前店铺暂无充值套餐~",
fontSize: 16.sp,
margin:
EdgeInsets.only(top: 90.h, left: 60.w, right: 60.w),
),
if (memberRechargeList != null &&
(memberRechargeList?.length ?? 0) > 0)
Container(
width: double.infinity,
margin: EdgeInsets.only(left: 16, right: 16),
padding: EdgeInsets.only(
top: 20.h,
bottom: 24.h,
),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
checkIndex = 2;
});
},
child: Row(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Image.asset(
"assets/image/icon_we_chat.webp"),
Expanded(
flex: 1,
child: Padding(
padding: EdgeInsets.only(left: 8.w),
child: Text(
S.of(context).weixinzhifu,
style: TextStyle(
fontSize: 14.sp,
color: Color(0xff353535),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(bottom: 16.h),
child: Text(
S.of(context).zhifufangshi,
style: TextStyle(
fontSize: 16.sp,
color: Colors.black,
fontWeight: FontWeight.bold,
),
),
),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
checkIndex = 2;
});
},
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Image.asset("assets/image/icon_we_chat.webp"),
Expanded(
flex: 1,
child: Padding(
padding: EdgeInsets.only(left: 8.w),
child: Text(
S.of(context).weixinzhifu,
style: TextStyle(
fontSize: 14.sp,
color: Color(0xff353535),
),
),
),
),
),
checkView(2),
],
),
checkView(2),
],
),
),
SizedBox(height: 10.h),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
checkIndex = 3;
});
},
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Image.asset("assets/image/icon_alipay.webp"),
Expanded(
flex: 1,
child: Padding(
padding: EdgeInsets.only(left: 8.w),
child: Text(
S.of(context).zhifubao,
style: TextStyle(
fontSize: 14.sp,
color: Color(0xff353535),
),
),
),
),
checkView(3),
],
),
),
],
),
SizedBox(height: 10.h),
GestureDetector(
),
if (memberRechargeList != null &&
(memberRechargeList?.length ?? 0) > 0)
Align(
alignment: Alignment.bottomCenter,
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
checkIndex = 3;
});
shopRecharge();
},
child: Row(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Image.asset(
"assets/image/icon_alipay.webp"),
Expanded(
flex: 1,
child: Padding(
padding: EdgeInsets.only(left: 8.w),
child: Text(
S.of(context).zhifubao,
style: TextStyle(
fontSize: 14.sp,
color: Color(0xff353535),
),
),
),
child: Container(
height: 56.h,
width: double.infinity,
alignment: Alignment.center,
decoration: BoxDecoration(
color: Color(0xFF32A060),
borderRadius: BorderRadius.circular(27),
),
margin: EdgeInsets.only(
top: 12.h, left: 16.w, right: 16.w, bottom: 21.h),
child: Text(
S.of(context).querenchongzhi,
style: TextStyle(
fontSize: 16.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
),
checkView(3),
],
),
),
],
),
),
Align(
alignment: Alignment.bottomCenter,
child: GestureDetector(
onTap: () {
},
child: Container(
height: 56.h,
width: double.infinity,
alignment: Alignment.center,
decoration: BoxDecoration(
color: Color(0xFF32A060),
borderRadius: BorderRadius.circular(27),
),
margin: EdgeInsets.only(
top: 12.h, left: 16.w, right: 16.w, bottom: 21.h),
child: Text(
S.of(context).querenchongzhi,
style: TextStyle(
fontSize: 16.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
),
),
),
),
),
)
],
),
);
)
],
),
));
}
///
@ -256,15 +414,15 @@ class _MineShopRecharge extends State<MineShopRecharge> {
Widget shopRechargeCard() {
return GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: (){
Navigator.of(context).pushNamed(
'/router/mine_shop_details',
onTap: () {
Navigator.of(context).pushNamed('/router/mine_shop_details',
arguments: {"id": widget.arguments["id"]});
},
child: Container(
width: double.infinity,
// height:140.h,
margin: EdgeInsets.only(bottom: 24.h, top: 14.h, left: 14.w, right: 14.w),
margin:
EdgeInsets.only(bottom: 24.h, top: 14.h, left: 14.w, right: 14.w),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
@ -350,14 +508,15 @@ class _MineShopRecharge extends State<MineShopRecharge> {
children: [
Expanded(
child: Text(
"${vipCard != null ? vipCard.balance : ""}",
style: TextStyle(
color: Color(0xFF262626),
fontSize: 24.sp,
fontFamily: 'JDZhengHT',
fontWeight: MyFontWeight.medium,
"${vipCard != null ? vipCard.balance : ""}",
style: TextStyle(
color: Color(0xFF262626),
fontSize: 24.sp,
fontFamily: 'JDZhengHT',
fontWeight: MyFontWeight.medium,
),
),
),),
),
Text(
"适用门店",
style: TextStyle(
@ -366,7 +525,9 @@ class _MineShopRecharge extends State<MineShopRecharge> {
fontWeight: MyFontWeight.regular,
),
),
SizedBox(width: 2,),
SizedBox(
width: 2,
),
Image.asset(
"assets/image/icon_right_z.webp",
width: 16,
@ -385,7 +546,7 @@ class _MineShopRecharge extends State<MineShopRecharge> {
}
///item
Widget rechargeItem(index) {
Widget rechargeItem(MemberRechargeList memberRechargeList, index) {
return Container(
width: double.infinity,
height: 69.h,
@ -393,12 +554,11 @@ class _MineShopRecharge extends State<MineShopRecharge> {
borderRadius: BorderRadius.circular(4),
border: Border.all(
color:
selectIndex == index ? Color(0xFF32A060) : Color(0xFFFAFAFA),
selectIndex == index ? Color(0xFF32A060) : Color(0xFFFAFAFA),
width: selectIndex == index ? 1 : 0,
),
color:
selectIndex == index ? Color(0XFFF0FAF4) : Colors.white),
margin: EdgeInsets.only(bottom: 14.h,left: 14.w,right: 14.w),
color: selectIndex == index ? Color(0XFFF0FAF4) : Colors.white),
margin: EdgeInsets.only(bottom: 14.h, left: 14.w, right: 14.w),
padding: EdgeInsets.only(left: 16),
child: Flex(
direction: Axis.horizontal,
@ -419,7 +579,7 @@ class _MineShopRecharge extends State<MineShopRecharge> {
),
TextSpan(
text:
"555",
"${AppUtils.calculateDouble(double.tryParse(memberRechargeList.rechargeMoney) ?? 0)}",
style: TextStyle(
fontSize: 18.sp,
fontFamily: 'JDZhengHT',
@ -435,7 +595,7 @@ class _MineShopRecharge extends State<MineShopRecharge> {
width: 1.w,
height: 37.h,
color:
selectIndex == index ? Color(0xFF32A060) : Color(0xFF979797),
selectIndex == index ? Color(0xFF32A060) : Color(0xFF979797),
margin: EdgeInsets.only(right: 16.w, left: 12),
),
Expanded(
@ -457,7 +617,7 @@ class _MineShopRecharge extends State<MineShopRecharge> {
),
TextSpan(
text:
"526",
"${AppUtils.calculateDouble((double.tryParse(memberRechargeList.rechargeMoney) ?? 0) + (double.tryParse(memberRechargeList.giftdMoney) ?? 0) + ((double.tryParse(memberRechargeList.rechargeMoney) ?? 0) - ((double.tryParse(memberRechargeList.rechargeMoney) ?? 0) * (discount / 100))))}",
style: TextStyle(
fontSize: 18.sp,
fontFamily: 'JDZhengHT',
@ -474,7 +634,8 @@ class _MineShopRecharge extends State<MineShopRecharge> {
GestureDetector(
onTap: () {
setState(() {
if (selectIndex == index) showRecharge(index);
if (selectIndex == index)
showRecharge(memberRechargeList, index);
});
},
child: Row(
@ -521,12 +682,93 @@ class _MineShopRecharge extends State<MineShopRecharge> {
}
///
showRecharge(index) {
showRecharge(MemberRechargeList memberRechargeList, index) {
showModalBottomSheet(
context: context,
backgroundColor: Colors.transparent,
builder: (context) {
return RechargeWidget(rechargeActLists.preferentialList[index]);
return Container(
padding: EdgeInsets.only(top: 12),
decoration: new BoxDecoration(
color: Colors.white,
borderRadius: new BorderRadius.only(
topLeft: const Radius.circular(25.0),
topRight: const Radius.circular(25.0))),
child: Container(
height: 355,
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Container(
margin: EdgeInsets.symmetric(vertical: 12.h),
alignment: Alignment.center,
child: Text(
"充值说明",
style: TextStyle(
fontWeight: MyFontWeight.bold,
fontSize: 15.sp,
color: Color(0xFF353535),
),
),
)),
GestureDetector(
onTap: () {
setState(() {
Navigator.of(context).pop();
});
},
child: Icon(
Icons.clear,
color: Colors.black,
size: 18,
),
),
SizedBox(width: 14),
],
),
SizedBox(
height: 12.h,
),
Container(
width: double.infinity,
height: 1.h,
color: Color(0xFFF2F2F2),
margin: EdgeInsets.only(bottom: 13.h),
),
Padding(
padding: EdgeInsets.only(left: 14),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Expanded(
child: Container(
color: Colors.white,
child: Html(
data: memberRechargeList?.remark ?? "",
customImageRenders: {
networkSourceMatcher():
networkImageRender(
loadingWidget: () {
return Container();
},
),
},
),
),
)
],
),
)
],
),
)));
});
}

71
lib/mine/mine_view/mine_item.dart

@ -224,7 +224,7 @@ class _MineItem extends State<MineItem> {
],
),
SizedBox(height: 12.h,),
if(isShowMore)
// if(isShowMore)
Row(
children: [
///
@ -314,9 +314,9 @@ class _MineItem extends State<MineItem> {
// ),),
],
),
if(isShowMore)
// if(isShowMore)
SizedBox(height: 12.h,),
if(isShowMore)
// if(isShowMore)
Row(
children: [
////
@ -345,38 +345,39 @@ class _MineItem extends State<MineItem> {
Expanded(child:Container(),),
],
),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
isShowMore = !isShowMore;
});
},
child: Container(
margin: EdgeInsets.symmetric(vertical: 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
children: [
Text(
(isShowMore != null && !isShowMore)?S.of(context).zhankai: S.of(context).shouqi,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF32A060),
),
),
Icon(
(isShowMore != null && !isShowMore)
? Icons.keyboard_arrow_down
: Icons.keyboard_arrow_up,
color: Color(0xFF32A060),
size: 18,
),
],
),),
)
///
// GestureDetector(
// behavior: HitTestBehavior.opaque,
// onTap: () {
// setState(() {
// isShowMore = !isShowMore;
// });
// },
// child: Container(
// margin: EdgeInsets.symmetric(vertical: 10),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.center,
// mainAxisSize: MainAxisSize.max,
// children: [
// Text(
// (isShowMore != null && !isShowMore)?S.of(context).zhankai: S.of(context).shouqi,
// style: TextStyle(
// fontSize: 12.sp,
// fontWeight: MyFontWeight.regular,
// color: Color(0xFF32A060),
// ),
// ),
// Icon(
// (isShowMore != null && !isShowMore)
// ? Icons.keyboard_arrow_down
// : Icons.keyboard_arrow_up,
// color: Color(0xFF32A060),
// size: 18,
// ),
// ],
// ),),
// )
],
),
);

326
lib/mine/mine_vip/mine_attainment_page.dart

@ -20,6 +20,8 @@ import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:shared_preferences/shared_preferences.dart';
import '../../view_widget/no_data_view.dart';
class MineAttainmentPage extends StatefulWidget {
final Map<String, dynamic> arguments;
@ -41,7 +43,6 @@ class _MineAttainmentPage extends State<MineAttainmentPage> {
SocialInfo infoNumber;
final RefreshController refreshController = RefreshController();
@override
void dispose() {
super.dispose();
@ -115,7 +116,7 @@ class _MineAttainmentPage extends State<MineAttainmentPage> {
);
BaseData<SocialInfo> baseData =
await apiService.socialInfo().catchError((onError) {});
await apiService.socialInfo().catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
setState(() {
infoNumber = baseData.data;
@ -125,7 +126,7 @@ class _MineAttainmentPage extends State<MineAttainmentPage> {
EasyLoading.dismiss();
}
_onRefresh(){
_onRefresh() {
queryAttainmentBadges();
querySocialInfo();
}
@ -140,151 +141,162 @@ class _MineAttainmentPage extends State<MineAttainmentPage> {
),
),
child: Scaffold(
backgroundColor: Colors.transparent,
appBar: MyAppBar(
title:S.of(context).wodechengjiu,
titleColor: Colors.black,
titleSize: 18.sp,
background: Colors.transparent,
leadingColor: Colors.black,
),
body: SmartRefresher(
controller: refreshController,
enablePullDown: true,
enablePullUp: false,
header: MyHeader(),
footer: CustomFooter(
builder: (context, mode) {
return MyFooter(mode);
},
),
onRefresh:(){
setState(() {
_onRefresh();
});
backgroundColor: Colors.transparent,
appBar: MyAppBar(
title: S.of(context).wodechengjiu,
titleColor: Colors.black,
titleSize: 18.sp,
background: Colors.transparent,
leadingColor: Colors.black,
),
body: SmartRefresher(
controller: refreshController,
enablePullDown: true,
enablePullUp: false,
header: MyHeader(),
footer: CustomFooter(
builder: (context, mode) {
return MyFooter(mode);
},
physics: BouncingScrollPhysics(),
child: Container(
child:
SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Column(
children: [
SizedBox(height: 24),
MImage(
userInfo?.headimg ?? "",
isCircle: true,
width: 58,
height: 58,
fit: BoxFit.cover,
errorSrc: "assets/image/default_user.webp",
fadeSrc: "assets/image/default_user.webp",
),
onRefresh: () {
setState(() {
_onRefresh();
});
},
physics: BouncingScrollPhysics(),
child: Container(
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Column(
children: [
SizedBox(height: 24),
MImage(
userInfo?.headimg ?? "",
isCircle: true,
width: 58,
height: 58,
fit: BoxFit.cover,
errorSrc: "assets/image/default_user.webp",
fadeSrc: "assets/image/default_user.webp",
),
SizedBox(height: 8),
Text(
userInfo?.nickname ?? S.of(context).denglu,
style: TextStyle(
fontSize: 16.sp,
fontWeight: FontWeight.bold,
color: Color(0xFF353535),
),
SizedBox(height: 8),
Text(
userInfo?.nickname ?? S.of(context).denglu,
style: TextStyle(
fontSize: 16.sp,
fontWeight: FontWeight.bold,
color: Color(0xFF353535),
),
),
SizedBox(height: 28),
Container(
margin: EdgeInsets.only(
left: 16, right: 16, top: 26, bottom: 8),
padding: EdgeInsets.all(20),
decoration: BoxDecoration(
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
],
borderRadius: BorderRadius.all(Radius.circular(8)),
),
SizedBox(height: 28),
Container(
margin:
EdgeInsets.only(left: 16, right: 16, top: 26, bottom: 8),
padding: EdgeInsets.all(20),
decoration: BoxDecoration(
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
],
borderRadius: BorderRadius.all(Radius.circular(8)),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Text(
S.of(context).chengjiuhuizhang,
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 14.sp,
color: Color(0xFF353535)),
),
SizedBox(width: 4),
Text(
"(",
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 14,
color: Color(0xFF353535)),
),
Text(
infoNumber != null ? infoNumber.achievementNumber.toString() :"0",
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 14,
color: Color(0xFF32A060)),
),
Text(
"/${vipBadgesList.length})",
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 14,
color: Color(0xFF353535)),
),
],
),
SizedBox(height: 12),
attainmentBadge(),
],
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Text(
S.of(context).chengjiuhuizhang,
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 14.sp,
color: Color(0xFF353535)),
),
SizedBox(width: 4),
Text(
"(",
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 14,
color: Color(0xFF353535)),
),
Text(
infoNumber != null
? infoNumber.achievementNumber.toString()
: "0",
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 14,
color: Color(0xFF32A060)),
),
Text(
"/${vipBadgesList.length})",
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 14,
color: Color(0xFF353535)),
),
],
),
SizedBox(height: 12),
attainmentBadge(),
],
),
],
),
),
],
),
),
),),
),
),
),
);
}
///
Widget attainmentBadge() {
return GridView.builder(
itemCount: vipBadgesList == null ? 0 : vipBadgesList.length,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
//Widget数量
crossAxisCount: 3,
//Widget之间间距
crossAxisSpacing: 13,
//Widget之间间距
mainAxisSpacing: 12,
//Widget宽高比例
childAspectRatio: AppUtils.textScale(context) > 1
? (1 - ((AppUtils.textScale(context) - 1)))
: 0.85,
),
itemBuilder: (context, index) {
return GestureDetector(
onTap: () {
setState(() {
queryAchievementDetail(index);
});
},
child: badgeItem(vipBadgesList[index]),
);
},
);
return (vipBadgesList != null && (vipBadgesList?.length ?? 0) > 0)
? GridView.builder(
itemCount: vipBadgesList == null ? 0 : vipBadgesList.length,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
//Widget数量
crossAxisCount: 3,
//Widget之间间距
crossAxisSpacing: 13,
//Widget之间间距
mainAxisSpacing: 12,
//Widget宽高比例
childAspectRatio: AppUtils.textScale(context) > 1
? (1 - ((AppUtils.textScale(context) - 1)))
: 0.85,
),
itemBuilder: (context, index) {
return GestureDetector(
onTap: () {
setState(() {
queryAchievementDetail(index);
});
},
child: badgeItem(vipBadgesList[index]),
);
},
)
: NoDataView(
src: "assets/image/xiao_fei.webp",
isShowBtn: false,
text: "当前暂无成就徽章~",
fontSize: 16.sp,
margin: EdgeInsets.only(left: 60.w, right: 60.w),
);
;
}
Widget badgeItem(VipBadgesList vipBadgesList) {
@ -358,7 +370,7 @@ class _MineAttainmentPage extends State<MineAttainmentPage> {
),
SizedBox(height: 10),
Text(
"${vipBadgesList.length >index ?vipBadgesList[index].name :""}${achievementDetail.length > checkPosition ?achievementDetail[checkPosition].name:""}徽章",
"${vipBadgesList.length > index ? vipBadgesList[index].name : ""}${achievementDetail.length > checkPosition ? achievementDetail[checkPosition].name : ""}徽章",
style: TextStyle(
fontSize: 16.sp,
fontWeight: MyFontWeight.semi_bold,
@ -369,7 +381,7 @@ class _MineAttainmentPage extends State<MineAttainmentPage> {
height: 6.h,
),
Text(
"${vipBadgesList.length >index ? vipBadgesList[index].name :""} ${AppUtils.calculateDouble(double.tryParse(achievementDetail.length > checkPosition ?achievementDetail[checkPosition].lessScore :"") ?? 0)} 即可升级",
"${vipBadgesList.length > index ? vipBadgesList[index].name : ""} ${AppUtils.calculateDouble(double.tryParse(achievementDetail.length > checkPosition ? achievementDetail[checkPosition].lessScore : "") ?? 0)} 即可升级",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
@ -392,27 +404,29 @@ class _MineAttainmentPage extends State<MineAttainmentPage> {
),
SizedBox(width: 8),
Column(
crossAxisAlignment:CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children:
achievementDetail[checkPosition].rewardList != null
? achievementDetail[checkPosition].rewardList.map((e) {
return Text(
rewardStr(e),
style: TextStyle(
fontWeight: MyFontWeight.regular,
fontSize: 12.sp,
color: Color(0xFF515151)),
);
}).toList()
: [],
achievementDetail[checkPosition].rewardList != null
? achievementDetail[checkPosition]
.rewardList
.map((e) {
return Text(
rewardStr(e),
style: TextStyle(
fontWeight: MyFontWeight.regular,
fontSize: 12.sp,
color: Color(0xFF515151)),
);
}).toList()
: [],
),
],
),
Expanded(
child: Container(
height: double.maxFinite,
margin: EdgeInsets.only(top:14),
margin: EdgeInsets.only(top: 14),
child: ListView.builder(
shrinkWrap: true,
scrollDirection: Axis.horizontal,
@ -443,12 +457,12 @@ class _MineAttainmentPage extends State<MineAttainmentPage> {
);
}
String rewardStr(RewardList rewardList){
if(rewardList.rewardType == 1)
String rewardStr(RewardList rewardList) {
if (rewardList.rewardType == 1)
return "积分:${rewardList.refId}";
else if(rewardList.rewardType == 2)
else if (rewardList.rewardType == 2)
return "平台余额:${rewardList.refId}";
else if(rewardList.rewardType == 3)
else if (rewardList.rewardType == 3)
return "平台兑换券:${rewardList.couponName}";
return "";
}

906
lib/mine/recharge_page.dart

File diff suppressed because it is too large Load Diff

354
lib/order/order_history_page.dart

@ -1,5 +1,6 @@
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/order/order_utils.dart';
@ -133,57 +134,29 @@ class OrderHistoryList extends StatefulWidget {
class _OrderHistoryList extends State<OrderHistoryList>
with AutomaticKeepAliveClientMixin {
final RefreshController refreshController = RefreshController();
@override
Widget build(BuildContext context) {
super.build(context);
return SmartRefresher(
controller: refreshController,
enablePullDown: true,
enablePullUp: true,
physics: BouncingScrollPhysics(),
header: MyHeader(),
footer: CustomFooter(
builder: (context, mode) {
return MyFooter(mode);
},
),
onRefresh: _onRefresh,
onLoading: queryOrder,
child: (orderInfos != null && orderInfos.length > 0)
? ListView.builder(
itemCount: orderInfos != null ? orderInfos.length : 0,
itemBuilder: (context, position) {
return InkWell(
onTap: () {
Navigator.of(context).pushNamed('/router/order_details',
arguments: {"id": orderInfos[position].id,"jumpState":2});
},
child: orderItem(orderInfos[position]),
);
})
: NoDataView(
src: "assets/image/ding_dan.webp",
isShowBtn: false,
text: "目前暂无订单,快去下一单吧~",
fontSize: 16.sp,
margin: EdgeInsets.only(top: 120),
),
);
}
bool isRemake = true;
ApiService apiService;
int current = 1;
List<OrderInfo> orderInfos = [];
UserInfo userInfo;
@override
void initState() {
super.initState();
SharedPreferences.getInstance().then((value) => {
apiService = ApiService(Dio(),
showLoading: true,
context: context,
token: value.getString("token")),
queryOrder(),
queryUserBalance(),
});
}
_onRefresh() {
current = 1;
queryOrder();
}
List<OrderInfo> orderInfos = [];
queryOrder() async {
BaseData<PageInfo<OrderInfo>> baseData = await apiService.orderList({
"current": current,
@ -214,24 +187,173 @@ class _OrderHistoryList extends State<OrderHistoryList>
}
setState(() {});
} else {
SmartDialog.showToast(baseData?.msg ?? "",alignment: Alignment.center);
if((baseData?.msg ?? "") != "")
SmartDialog.showToast(baseData.msg,alignment: Alignment.center);
refreshController.refreshFailed();
refreshController.loadFailed();
}
}
@override
void initState() {
super.initState();
SharedPreferences.getInstance().then((value) => {
apiService = ApiService(Dio(),
showLoading: true,
minLogin(OrderInfo orderInfo) {
apiService.minLogin(orderInfo.storeId).catchError((onError) {
debugPrint(onError);
}).then((baseData) {
if (baseData != null && baseData.isSuccess) {
Map<String, dynamic> minStoreInfo = baseData.data;
String minToken = minStoreInfo["token"];
String tenant = orderInfo.tenantCode;
String storeId = orderInfo.storeId;
SharedPreferences.getInstance().then(
(value) => {
value.setString('minToken', minToken),
value.setString('tenant', tenant),
value.setString('storeId', storeId),
},
);
paySelected(
orderInfo,
MinApiService(
Dio(),
context: context,
token: value.getString("token")),
queryOrder(),
queryUserBalance(),
});
token: minToken,
tenant: tenant,
storeId: storeId,
));
}
});
}
queryDetails(id) async {
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(Dio(),
context: context, token: value.getString("token"), showLoading: true);
}
BaseData<OrderInfo> baseData =
await apiService.orderDetail(id).catchError((error) {});
if (baseData != null && baseData.isSuccess) {
return baseData.data;
}
}
queryUserBalance() async {
BaseData<UserInfo> baseData =
await apiService.queryInfo().catchError((onError) {
});
if (baseData != null && baseData.isSuccess) {
userInfo = baseData.data;
if (mounted) setState(() {});
}else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}
}
paySelected(OrderInfo orderInfo, MinApiService minService) async {
var payChannel = await showModalBottomSheet(
context: context,
backgroundColor: Colors.transparent,
builder: (context) {
return OrderPaySelected(userInfo);
},
);
if (payChannel != null && payChannel > 0) {
orderInfo = await queryDetails(orderInfo.id);
OrderUtils.carryOnPay(
payChannel,
minService,
orderInfo,
(BaseData baseData) {
SmartDialog.showToast(
baseData?.msg == "ok" ? "订单支付成功" : baseData?.msg,
alignment: Alignment.center);
Future.delayed(Duration(seconds: 3), () {
_onRefresh();
});
},
);
}
}
payResult(BaseData baseData) {}
orderCancel(String orderId) async {
BaseData baseData =
await apiService.orderCancel(orderId).catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
SmartDialog.showToast("订单取消成功");
_onRefresh();
}else{
if(baseData.msg != null)
SmartDialog.showToast(baseData.msg,alignment: Alignment.center);
}
}
aginOrder(OrderInfo orderInfo) {
// Navigator.of(context).pushNamed(
// '/router/union_detail_page',
// arguments: {"id": storeId},
// );
// String storeId = (orderInfo != null &&
// orderInfo.storeVO != null)
// ? (orderInfo.storeVO.id ?? "")
// : "";
if (orderInfo.storeVO.posType.code == "NORMALSTORE") {
Scan.toScan(
context,
orderInfo.storeVO.id,
orderInfo.tenantCode,
orderInfo.storeVO.storeName,
);
} else {
Navigator.of(context).pushNamed(
'/router/store_order',
arguments: {
"id": orderInfo.storeVO.id,
"tenant": orderInfo.tenantCode,
"storeName": orderInfo.storeVO.storeName
},
);
}
}
@override
Widget build(BuildContext context) {
super.build(context);
return SmartRefresher(
controller: refreshController,
enablePullDown: true,
enablePullUp: true,
physics: BouncingScrollPhysics(),
header: MyHeader(),
footer: CustomFooter(
builder: (context, mode) {
return MyFooter(mode);
},
),
onRefresh: _onRefresh,
onLoading: queryOrder,
child: (orderInfos != null && orderInfos.length > 0)
? ListView.builder(
itemCount: orderInfos != null ? orderInfos.length : 0,
itemBuilder: (context, position) {
return InkWell(
onTap: () {
Navigator.of(context).pushNamed('/router/order_details',
arguments: {"id": orderInfos[position].id,"jumpState":2});
},
child: orderItem(orderInfos[position]),
);
})
: NoDataView(
src: "assets/image/ding_dan.webp",
isShowBtn: false,
text: "目前暂无订单,快去下一单吧~",
fontSize: 16.sp,
margin: EdgeInsets.only(top: 120),
),
);
}
String orderAllGoods(OrderInfo orderInfo) {
@ -536,130 +658,6 @@ class _OrderHistoryList extends State<OrderHistoryList>
);
}
minLogin(OrderInfo orderInfo) {
apiService.minLogin(orderInfo.storeId).catchError((onError) {
debugPrint(onError);
}).then((baseData) {
if (baseData != null && baseData.isSuccess) {
Map<String, dynamic> minStoreInfo = baseData.data;
String minToken = minStoreInfo["token"];
String tenant = orderInfo.tenantCode;
String storeId = orderInfo.storeId;
SharedPreferences.getInstance().then(
(value) => {
value.setString('minToken', minToken),
value.setString('tenant', tenant),
value.setString('storeId', storeId),
},
);
paySelected(
orderInfo,
MinApiService(
Dio(),
context: context,
token: minToken,
tenant: tenant,
storeId: storeId,
));
}
});
}
queryDetails(id) async {
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(Dio(),
context: context, token: value.getString("token"), showLoading: true);
}
BaseData<OrderInfo> baseData =
await apiService.orderDetail(id).catchError((error) {});
if (baseData != null && baseData.isSuccess) {
return baseData.data;
}
}
UserInfo userInfo;
queryUserBalance() async {
BaseData<UserInfo> baseData =
await apiService.queryInfo().catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
userInfo = baseData.data;
if (mounted) setState(() {});
}else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}
}
paySelected(OrderInfo orderInfo, MinApiService minService) async {
var payChannel = await showModalBottomSheet(
context: context,
backgroundColor: Colors.transparent,
builder: (context) {
return OrderPaySelected(userInfo);
},
);
if (payChannel != null && payChannel > 0) {
orderInfo = await queryDetails(orderInfo.id);
OrderUtils.carryOnPay(
payChannel,
minService,
orderInfo,
(BaseData baseData) {
SmartDialog.showToast(
baseData?.msg == "ok" ? "订单支付成功" : baseData?.msg,
alignment: Alignment.center);
Future.delayed(Duration(seconds: 3), () {
_onRefresh();
});
},
);
}
}
payResult(BaseData baseData) {}
orderCancel(String orderId) async {
BaseData baseData =
await apiService.orderCancel(orderId).catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
SmartDialog.showToast("订单取消成功");
_onRefresh();
}else{
if(baseData.msg != null)
SmartDialog.showToast(baseData.msg,alignment: Alignment.center);
}
}
aginOrder(OrderInfo orderInfo) {
// Navigator.of(context).pushNamed(
// '/router/union_detail_page',
// arguments: {"id": storeId},
// );
// String storeId = (orderInfo != null &&
// orderInfo.storeVO != null)
// ? (orderInfo.storeVO.id ?? "")
// : "";
if (orderInfo.storeVO.posType.code == "NORMALSTORE") {
Scan.toScan(
context,
orderInfo.storeVO.id,
orderInfo.tenantCode,
orderInfo.storeVO.storeName,
);
} else {
Navigator.of(context).pushNamed(
'/router/store_order',
arguments: {
"id": orderInfo.storeVO.id,
"tenant": orderInfo.tenantCode,
"storeName": orderInfo.storeVO.storeName
},
);
}
}
String totalPrice(orderInfo) {
if (orderInfo == null) return "";
double totalPrice = (double.tryParse(orderInfo.orderSum) +

159
lib/retrofit/data/member_recharge_list.dart

@ -0,0 +1,159 @@
/// id : "1681490552371019776"
/// rechargeMoney : "100.00"
/// giftdMoney : "10.00"
/// limitNum : 0
/// gitfdCouponId : null
/// startDate : null
/// endDate : null
/// startTime : null
/// endTime : null
/// tenantCode : "1175"
/// createTime : "2023-07-21 09:22:53"
/// isDeleted : 0
/// rechargeType : 0
/// remark : "充值100.00 赠送10.00"
/// sortValue : 0
/// useNum : 0
class MemberRechargeList {
MemberRechargeList({
String id,
String rechargeMoney,
String giftdMoney,
num limitNum,
dynamic gitfdCouponId,
dynamic startDate,
dynamic endDate,
dynamic startTime,
dynamic endTime,
String tenantCode,
String createTime,
num isDeleted,
num rechargeType,
String remark,
num sortValue,
num useNum,}){
_id = id;
_rechargeMoney = rechargeMoney;
_giftdMoney = giftdMoney;
_limitNum = limitNum;
_gitfdCouponId = gitfdCouponId;
_startDate = startDate;
_endDate = endDate;
_startTime = startTime;
_endTime = endTime;
_tenantCode = tenantCode;
_createTime = createTime;
_isDeleted = isDeleted;
_rechargeType = rechargeType;
_remark = remark;
_sortValue = sortValue;
_useNum = useNum;
}
MemberRechargeList.fromJson(dynamic json) {
_id = json['id'];
_rechargeMoney = json['rechargeMoney'];
_giftdMoney = json['giftdMoney'];
_limitNum = json['limitNum'];
_gitfdCouponId = json['gitfdCouponId'];
_startDate = json['startDate'];
_endDate = json['endDate'];
_startTime = json['startTime'];
_endTime = json['endTime'];
_tenantCode = json['tenantCode'];
_createTime = json['createTime'];
_isDeleted = json['isDeleted'];
_rechargeType = json['rechargeType'];
_remark = json['remark'];
_sortValue = json['sortValue'];
_useNum = json['useNum'];
}
String _id;
String _rechargeMoney;
String _giftdMoney;
num _limitNum;
dynamic _gitfdCouponId;
dynamic _startDate;
dynamic _endDate;
dynamic _startTime;
dynamic _endTime;
String _tenantCode;
String _createTime;
num _isDeleted;
num _rechargeType;
String _remark;
num _sortValue;
num _useNum;
MemberRechargeList copyWith({ String id,
String rechargeMoney,
String giftdMoney,
num limitNum,
dynamic gitfdCouponId,
dynamic startDate,
dynamic endDate,
dynamic startTime,
dynamic endTime,
String tenantCode,
String createTime,
num isDeleted,
num rechargeType,
String remark,
num sortValue,
num useNum,
}) => MemberRechargeList( id: id ?? _id,
rechargeMoney: rechargeMoney ?? _rechargeMoney,
giftdMoney: giftdMoney ?? _giftdMoney,
limitNum: limitNum ?? _limitNum,
gitfdCouponId: gitfdCouponId ?? _gitfdCouponId,
startDate: startDate ?? _startDate,
endDate: endDate ?? _endDate,
startTime: startTime ?? _startTime,
endTime: endTime ?? _endTime,
tenantCode: tenantCode ?? _tenantCode,
createTime: createTime ?? _createTime,
isDeleted: isDeleted ?? _isDeleted,
rechargeType: rechargeType ?? _rechargeType,
remark: remark ?? _remark,
sortValue: sortValue ?? _sortValue,
useNum: useNum ?? _useNum,
);
String get id => _id;
String get rechargeMoney => _rechargeMoney;
String get giftdMoney => _giftdMoney;
num get limitNum => _limitNum;
dynamic get gitfdCouponId => _gitfdCouponId;
dynamic get startDate => _startDate;
dynamic get endDate => _endDate;
dynamic get startTime => _startTime;
dynamic get endTime => _endTime;
String get tenantCode => _tenantCode;
String get createTime => _createTime;
num get isDeleted => _isDeleted;
num get rechargeType => _rechargeType;
String get remark => _remark;
num get sortValue => _sortValue;
num get useNum => _useNum;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = _id;
map['rechargeMoney'] = _rechargeMoney;
map['giftdMoney'] = _giftdMoney;
map['limitNum'] = _limitNum;
map['gitfdCouponId'] = _gitfdCouponId;
map['startDate'] = _startDate;
map['endDate'] = _endDate;
map['startTime'] = _startTime;
map['endTime'] = _endTime;
map['tenantCode'] = _tenantCode;
map['createTime'] = _createTime;
map['isDeleted'] = _isDeleted;
map['rechargeType'] = _rechargeType;
map['remark'] = _remark;
map['sortValue'] = _sortValue;
map['useNum'] = _useNum;
return map;
}
}

10
lib/retrofit/min_api.dart

@ -19,6 +19,7 @@ import 'data/activity_order_list.dart';
import 'data/findMiNiGroupList.dart';
import 'data/home_recommend_list.dart';
import 'data/launch_join_act.dart';
import 'data/member_recharge_list.dart';
import 'data/miNiDetail.dart';
import 'data/settleOrderInfo.dart';
import 'data/shoppingCart.dart';
@ -243,4 +244,13 @@ abstract class MinApiService {
@POST("promotion/useMemberCoupon")
Future<BaseData> useMemberCoupon(@Body() Map<String, dynamic> param);
///
@POST("/member/recharge")
Future<BaseData<dynamic>> memberRecharge(@Body() Map<String, dynamic> param);
///
@GET("/store/getRechargePreferential")
Future<BaseData<List<MemberRechargeList>>> memberRechargeList();
}

45
lib/retrofit/min_api.g.dart

@ -651,4 +651,49 @@ class _MinApiService implements MinApiService {
);
return value;
}
@override
Future<BaseData<dynamic>> memberRecharge(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>('//member/recharge',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<dynamic>.fromJson(
_result.data,
(json) => json as dynamic,
);
return value;
}
@override
Future<BaseData<List<MemberRechargeList>>> memberRechargeList() async {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/store/getRechargePreferential',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<List<MemberRechargeList>>.fromJson(
_result.data,
(json) => (json as List<dynamic>)
.map<MemberRechargeList>(
(i) => MemberRechargeList.fromJson(i as Map<String, dynamic>))
.toList());
return value;
}
}

14
lib/retrofit/retrofit_api.dart

@ -6,7 +6,6 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/activity.dart';
import 'package:huixiang/retrofit/data/article.dart';
@ -14,12 +13,10 @@ import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/comunity_comment.dart';
import 'package:huixiang/retrofit/data/coupon.dart';
import 'package:huixiang/retrofit/data/farmers_list.dart';
import 'package:huixiang/retrofit/data/login_info.dart';
import 'package:huixiang/retrofit/data/order_info.dart';
import 'package:huixiang/view_widget/login_tips_dialog.dart';
import 'package:retrofit/retrofit.dart';
import '../utils/flutter_utils.dart';
import 'data/achievement_detail_list.dart';
import 'data/activity_pos.dart';
import 'data/address.dart';
@ -50,7 +47,6 @@ import 'data/msg_stats.dart';
import 'data/page.dart';
import 'data/rank.dart';
import 'data/rechargeActLists.dart';
import 'data/recharge_list.dart';
import 'data/second_card_list.dart';
import 'data/sign_info.dart';
import 'data/social_info.dart';
@ -89,6 +85,8 @@ abstract class ApiService {
if (pay) {
headers["Environment"] = "app";
}
if (kReleaseMode)
baseUrl = serviceBaseUrl;
if (isIp) baseUrl = ipBaseUrl;
dio.options = BaseOptions(
connectTimeout: 60000,
@ -150,10 +148,6 @@ abstract class ApiService {
debugPrint("\n");
}),
);
if (kReleaseMode) {
baseUrl = serviceBaseUrl;
}
return _ApiService(dio, baseUrl: baseUrl);
}
@ -230,8 +224,8 @@ abstract class ApiService {
Future<BaseData<dynamic>> recharge(@Body() Map<String, dynamic> param);
///
@GET("/wallet/rechargeActList")
Future<BaseData<RechargeActLists>> rechargeActList();
@GET("/wallet/rechargeActList?tenantCode={tenantCode}")
Future<BaseData<RechargeActLists>> rechargeActList(@Path("tenantCode") String tenantCode);
///
@GET("/coupon/receive?couponId={couponId}")

4
lib/retrofit/retrofit_api.g.dart

@ -322,12 +322,12 @@ class _ApiService implements ApiService {
}
@override
Future<BaseData<RechargeActLists>> rechargeActList() async {
Future<BaseData<RechargeActLists>> rechargeActList(tenantCode) async {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/wallet/rechargeActList',
'/wallet/rechargeActList?tenantCode=$tenantCode',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',

12
lib/store/store_view/shop_goods.dart

@ -359,7 +359,7 @@ class _ShopGoods extends State<ShopGoods> {
// SmartDialog.showToast("库存不足",
// alignment: Alignment.center);
// } else
if (_jumpType == -1)
if (_jumpType == -1)
queryMiNiDetail(widget.productListBean.id);
else if (_jumpType == 0)
widget.add(widget.shoppingCartSkuItemListBean);
@ -497,6 +497,7 @@ class _ShopGoods extends State<ShopGoods> {
SizedBox(
height: 4.h,
),
///VIP价格
// if (widget.productListBean.vipPrice != null)
// Row(
@ -645,9 +646,12 @@ class _ShopGoods extends State<ShopGoods> {
//
// http://miniscan.lotus-wallet.com/placeorder?tenant_code=1194&table_id=1669609340031467520&store_id=1637659387134738432
Uri uri = Uri.parse(result);
String tableId = uri.queryParameters["tableId"] ?? uri.queryParameters["table_id"];
String tenantCode = uri.queryParameters["tenantCode"] ?? uri.queryParameters["tenant_code"];
String shopId = uri.queryParameters["shopId"] ?? uri.queryParameters["store_id"];
String tableId =
uri.queryParameters["tableId"] ?? uri.queryParameters["table_id"];
String tenantCode = uri.queryParameters["tenantCode"] ??
uri.queryParameters["tenant_code"];
String shopId =
uri.queryParameters["shopId"] ?? uri.queryParameters["store_id"];
if (tableId != null &&
tableId != "" &&
tenantCode != null &&

65
lib/union/union_list.dart

@ -75,11 +75,14 @@ class _UnionList extends State<UnionList> with AutomaticKeepAliveClientMixin {
}).catchError((error) {
SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type),
alignment: Alignment.center);
_refreshController.refreshFailed();
});
if (baseData != null && baseData.isSuccess) {
storeList = baseData.data;
_refreshController.refreshCompleted();
} else {
_refreshController.refreshFailed();
}
_refreshController.refreshCompleted();
EasyLoading.dismiss();
setState(() {});
}
@ -299,25 +302,28 @@ class _UnionList extends State<UnionList> with AutomaticKeepAliveClientMixin {
children: []..addAll(
itemServer(store != null ? store.businessService : "")),
),
SizedBox(height: store.businessService == ""?40.h:23.h),
if(storeList[position].productShow != null)
Container(
height: 100.h,
child: ListView.builder(
padding: EdgeInsets.zero,
itemCount: (storeList[position].productShow?.length ??0) > 3 ?3:storeList[position].productShow?.length ?? 0,
scrollDirection: Axis.horizontal,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, index) {
return GestureDetector(
onTap: () {},
child: unionGoodsItem(
storeList[position].productShow[index]),
);
},
SizedBox(height: store.businessService == "" ? 40.h : 23.h),
if (storeList[position].productShow != null)
Container(
height: 100.h,
child: ListView.builder(
padding: EdgeInsets.zero,
itemCount:
(storeList[position].productShow?.length ?? 0) > 3
? 3
: storeList[position].productShow?.length ?? 0,
scrollDirection: Axis.horizontal,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, index) {
return GestureDetector(
onTap: () {},
child: unionGoodsItem(
storeList[position].productShow[index]),
);
},
),
),
),
],
))
],
@ -352,7 +358,6 @@ class _UnionList extends State<UnionList> with AutomaticKeepAliveClientMixin {
.toList();
}
///
Widget unionGoodsItem(ProductShow productShow) {
return Container(
width: 74.w,
@ -369,16 +374,18 @@ class _UnionList extends State<UnionList> with AutomaticKeepAliveClientMixin {
errorSrc: "assets/image/default_1.webp",
fadeSrc: "assets/image/default_1.webp",
),
Padding(padding:EdgeInsets.only(top: 8.h),
child: Text(
productShow?.productName ?? "",
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Color(0xFFA29E9E),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
Padding(
padding: EdgeInsets.only(top: 8.h),
child: Text(
productShow?.productName ?? "",
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Color(0xFFA29E9E),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
),
),
),),
),
],
),
);

3
lib/view_widget/my_appbar.dart

@ -70,8 +70,7 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget {
},
child: Container(
alignment: Alignment.centerRight,
margin: EdgeInsets.only(left: 12,),
padding: EdgeInsets.all(6),
padding: EdgeInsets.only(top: 6.h,bottom: 6.h,left:20.w,right:6.w),
child: Icon(
Icons.arrow_back_ios,
color: leadingColor,

8
lib/view_widget/recharge_details_dialog.dart

@ -1,15 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_html/flutter_html.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/coupon.dart';
import 'package:huixiang/retrofit/data/recharge_list.dart';
import 'package:huixiang/retrofit/data/store.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/store/scan.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/border_text.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/round_button.dart';
import '../retrofit/data/rechargeActLists.dart';

Loading…
Cancel
Save