You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

746 lines
23 KiB

import 'dart:convert';
4 years ago
import 'package:dio/dio.dart';
4 years ago
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
3 years ago
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
4 years ago
import 'package:flutter_swiper/flutter_swiper.dart';
4 years ago
import 'package:huixiang/generated/l10n.dart';
3 years ago
import 'package:huixiang/home/home_view/discount_zone.dart';
3 years ago
import 'package:huixiang/home/home_view/home_banner.dart';
3 years ago
import 'package:huixiang/home/home_view/home_recommend_goods.dart';
import 'package:huixiang/home/home_view/top_selling_list.dart';
import 'package:huixiang/home/home_view/union_entry.dart';
import 'package:huixiang/home/home_view/welfare_core.dart';
3 years ago
import 'package:huixiang/home/points_mall_view/points_goods_title.dart';
import 'package:huixiang/home/points_mall_view/points_goods_view.dart';
4 years ago
import 'package:huixiang/main.dart';
import 'package:huixiang/retrofit/data/activity_pos.dart';
4 years ago
import 'package:huixiang/retrofit/data/article.dart';
import 'package:huixiang/retrofit/data/banner.dart';
4 years ago
import 'package:huixiang/retrofit/data/base_data.dart';
4 years ago
import 'package:huixiang/retrofit/data/brand.dart';
import 'package:huixiang/retrofit/data/coupon.dart';
4 years ago
import 'package:huixiang/retrofit/data/founder.dart';
import 'package:huixiang/retrofit/data/goods.dart';
3 years ago
import 'package:huixiang/retrofit/data/goods_category.dart';
import 'package:huixiang/retrofit/data/home_rank.dart';
import 'package:huixiang/retrofit/data/login_info.dart';
import 'package:huixiang/retrofit/data/msg_stats.dart';
4 years ago
import 'package:huixiang/retrofit/data/page.dart';
4 years ago
import 'package:huixiang/retrofit/retrofit_api.dart';
4 years ago
import 'package:huixiang/utils/event_type.dart';
3 years ago
import 'package:huixiang/view_widget/activity_coupons.dart';
import 'package:huixiang/view_widget/activity_poster.dart';
4 years ago
import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/invite_success_dialog.dart';
3 years ago
import 'package:huixiang/view_widget/request_permission.dart';
import 'package:permission_handler/permission_handler.dart';
4 years ago
import 'package:pull_to_refresh/pull_to_refresh.dart';
4 years ago
import 'package:shared_preferences/shared_preferences.dart';
3 years ago
import 'package:flutter_screenutil/flutter_screenutil.dart';
3 years ago
import '../retrofit/data/user_info.dart';
import '../utils/flutter_utils.dart';
import '../view_widget/channel_dialog.dart';
import 'home_view/happy_help_farmers.dart';
3 years ago
import 'home_view/shortcut_operation.dart';
4 years ago
class HomePage extends StatefulWidget {
final Function changeTab;
final String invite;
final List<InterviewCouponList> interviewCouponList;
final List<FirstLoginCouponList> firstLoginCouponList;
4 years ago
3 years ago
HomePage(Key key, this.changeTab,
{this.invite, this.interviewCouponList, this.firstLoginCouponList}): super(key: key);
4 years ago
4 years ago
@override
State<StatefulWidget> createState() {
3 years ago
return HomePageState();
4 years ago
}
}
3 years ago
class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
4 years ago
ApiService apiService;
@override
void initState() {
super.initState();
4 years ago
eventBus.on<EventType>().listen((event) {
4 years ago
if (event.type < 3) {
setState(() {});
4 years ago
}
4 years ago
});
queryActivity();
3 years ago
_onRefresh();
if ((widget.invite ?? "") != "" ||
widget.interviewCouponList != null &&
widget.interviewCouponList.length > 0) showInvite = true;
//判断新人弹窗
// if (widget.firstLoginCouponList != null && widget.firstLoginCouponList.length > 0)
// showNew = true;
}
///邀请成功
inviteShowAlertDialog(invite, InterviewCouponList interviewCouponList) {
//显示对话框
showDialog(
context: context,
builder: (BuildContext context) {
return InviteSuccessDialog(invite, interviewCouponList);
},
);
}
///活动海报弹窗
posterShowAlertDialog(ActivityPos activityPos,firstLoginCouponList) {
2 years ago
var today = DateTime.now().day;
SharedPreferences.getInstance().then((value) {
2 years ago
if(value.getInt("today")==today && (value.getString("ActivityPosCode") ?? "").contains("${activityPos.code}_${value.getString("userId")};"))
return;
value.setString("ActivityPosCode", "${(value.getString("ActivityPosCode")??"")}${activityPos.code}_${value.getString("userId")};");
2 years ago
value.setInt("today", today);
//显示对话框
showDialog(
context: context,
builder: (BuildContext context) {
return ActivityPoster(activityPos,firstLoginCouponList);
},
);
});
}
///推荐渠道弹窗
channelShowAlertDialog() {
//显示对话框
showDialog(
context: context,
builder: (BuildContext context) {
return ChannelDialog();
},
);
}
3 years ago
final SwiperController controller = SwiperController();
4 years ago
3 years ago
String categoryId;
int pageNum = 1;
3 years ago
int couponPageNum = 1;
bool showInvite = false;
bool showNew = false;
3 years ago
//排序类型枚举:1-自然排序,2-销量,3-价格
int orderType = 1;
//是否降序排列
bool orderDesc = true;
List<Goods> goods = [];
List<GoodsCategory> gooodsCategorys = [];
4 years ago
List<BannerData> bannerData = [];
List<Brand> brandData = [];
List<Article> articles = [];
List<Goods> gooods = [];
Founder founder;
3 years ago
bool isSigned = false;
int totalMsg = 0;
List<Coupon> coupons = [];
int state = 1;
HomeRank homeRank;
UserInfo userInfo;
dynamic mRaiseMoney = 0;//众筹金余额
4 years ago
queryHome() async {
3 years ago
// EasyLoading.show(status: S.of(context).zhengzaijiazai);
3 years ago
final SharedPreferences value = await SharedPreferences.getInstance();
3 years ago
apiService = ApiService(Dio(),
context: context, token: value.getString('token'), showLoading: false);
3 years ago
3 years ago
final BaseData brand =
await apiService.queryHomeBrand().catchError((onError) {
SmartDialog.showToast(AppUtils.dioErrorTypeToString(onError.type),
alignment: Alignment.center);
4 years ago
refreshController.refreshFailed();
});
if (brand != null && brand.isSuccess) {
4 years ago
brandData.clear();
brandData.addAll((brand.data["brandList"] as List<dynamic>)
.map((e) => Brand.fromJson(e))
.toList());
founder = Founder.fromJson(brand.data["founder"]);
}
3 years ago
final BaseData<PageInfo<Article>> article = await apiService.queryArticle({
4 years ago
"pageNum": 1,
3 years ago
"pageSize": 3,
4 years ago
"searchKey": "",
4 years ago
"state": 1,
4 years ago
"type": 2
}).catchError((onError) {
refreshController.refreshFailed();
});
articles.clear();
if (article != null && article.isSuccess) {
3 years ago
articles.addAll(article.data.list);
4 years ago
}
final BaseData<HomeRank> rank = await apiService.recommendRank().catchError((onError) {});
if (rank != null && rank.isSuccess) {
homeRank = rank.data;
}
3 years ago
final BaseData<PageInfo<Goods>> goodsData = await apiService.creditGoods({
4 years ago
"orderDesc": true,
"orderType": 1,
"pageNum": 1,
"pageSize": 10,
"state": 1
3 years ago
}).catchError((onError) {
refreshController.refreshFailed();
4 years ago
});
if (goodsData != null && goodsData.isSuccess) {
gooods.clear();
3 years ago
gooods.addAll(goodsData.data.list);
4 years ago
}
3 years ago
3 years ago
BaseData<PageInfo<GoodsCategory>> dataCategory =
await apiService.goodsCategory({
"current": 1,
"map": {},
"model": {"pageNum": 1, "pageSize": 20, "searchKey": ""},
"order": "descending",
"size": 20,
"sort": "sortOrder"
}).catchError((onError) {
refreshController.loadFailed();
refreshController.refreshFailed();
});
if (dataCategory != null &&
dataCategory.isSuccess &&
dataCategory.data != null &&
dataCategory.data.records != null &&
dataCategory.data.records.length > 0) {
gooodsCategorys.clear();
gooodsCategorys.add(GoodsCategory(name: S.of(context).quanbu));
gooodsCategorys.addAll(dataCategory.data.records);
}
var param = {
"categoryId": categoryId ?? "",
"orderDesc": orderDesc,
"orderType": orderType,
"pageNum": pageNum,
"pageSize": 10,
"state": 1
};
BaseData<PageInfo<Goods>> pageGoods =
await apiService.creditGoods(param).catchError((onError) {
refreshController.loadFailed();
refreshController.refreshFailed();
});
EasyLoading.dismiss();
if (pageGoods != null && pageGoods.isSuccess) {
if (pageNum == 1) {
goods.clear();
}
goods.addAll(pageGoods.data.list);
refreshController.refreshCompleted();
refreshController.loadComplete();
if (pageGoods.data.pageNum == pageGoods.data.pages) {
refreshController.loadNoData();
} else {
pageNum += 1;
}
} else {
refreshController.loadFailed();
refreshController.refreshFailed();
}
3 years ago
final BaseData<PageInfo<BannerData>> baseData =
await apiService.queryBanner({
3 years ago
"model": {"type": "HOME_PAGE"},
}).catchError((onError) {
refreshController.refreshFailed();
});
if (baseData != null && baseData.isSuccess) {
3 years ago
bannerData.clear();
bannerData.addAll(baseData.data.records);
4 years ago
refreshController.refreshCompleted();
3 years ago
if (bannerData.length > 0) controller.move(0, animation: false);
4 years ago
} else {
refreshController.refreshFailed();
}
3 years ago
EasyLoading.dismiss();
if (showInvite) {
inviteShowAlertDialog(widget.invite, widget.interviewCouponList[0]);
showInvite = false;
}
//判断新人弹窗
// if (showNew) {
// newShowAlertDialog(widget.firstLoginCouponList);
// showNew = false;
// }
4 years ago
}
///查询会员信息
queryUserBalance() async {
BaseData<UserInfo> baseData =
await apiService.queryInfo().catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
userInfo = baseData.data;
mRaiseMoney = double.tryParse(userInfo.raiseMoney);
if (mounted) setState(() {});
}
}
3 years ago
///消息数量
// queryMsgStats() async {
// if (apiService == null) {
// SharedPreferences value = await SharedPreferences.getInstance();
// apiService = ApiService(
// Dio(),
// context: context,
// token: value.getString("token"),
// );
// }
// BaseData<List<MsgStats>> baseData = await apiService.stats().catchError((onError) {});
// if (baseData != null && baseData.isSuccess) {
// // setState(() {
// totalMsg = 0;
// baseData.data.forEach((element) {
// totalMsg += element.number;
// // });
// });
// }
// EasyLoading.dismiss();
// }
///活动弹窗
queryActivity() async {
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
3 years ago
showLoading: true
);
}
BaseData<ActivityPos> baseData =
await apiService.appPopup().catchError((onError) {
});
if (baseData != null && baseData.isSuccess) {
if(baseData.data?.enabled ?? true)
posterShowAlertDialog(baseData.data,widget.firstLoginCouponList);
}
}
///核销用户优惠券
queryWiped(memberCouponId) async {
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
);
}
3 years ago
BaseData baseData = await apiService.wiped(memberCouponId).catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
SmartDialog.showToast("核销成功", alignment: Alignment.center);
} else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}
}
queryCoupon() async {
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
);
}
BaseData<PageInfo<Coupon>> baseData = await apiService.queryCoupon({
"centre": true,
3 years ago
"pageNum": couponPageNum,
"pageSize": 10,
"searchKey": "",
"state": 0
}).catchError((onError) {
refreshController.refreshFailed();
refreshController.loadFailed();
});
3 years ago
if (couponPageNum == 1) coupons.clear();
if (baseData != null && baseData.isSuccess) {
coupons.addAll(baseData.data.list);
refreshController.refreshCompleted();
refreshController.loadComplete();
if (baseData.data.pageNum == baseData.data.pages) {
refreshController.loadNoData();
} else {
3 years ago
couponPageNum += 1;
}
setState(() {});
3 years ago
}
else {
refreshController.refreshFailed();
refreshController.loadFailed();
}
}
_onRefresh() async{
await queryHome();
await queryUserBalance();
3 years ago
// queryMsgStats();
await queryCoupon();
}
4 years ago
@override
void dispose() {
super.dispose();
3 years ago
if (refreshController != null) refreshController.dispose();
4 years ago
}
3 years ago
final RefreshController refreshController = RefreshController();
4 years ago
4 years ago
@override
Widget build(BuildContext context) {
4 years ago
super.build(context);
3 years ago
return Column(
children: [
3 years ago
// MyAppBar(
// title: "首页",
// leading: false,
// actions: [
// Container(
// height: 24,
// alignment: Alignment.center,
// margin: EdgeInsets.only(
// right: 12.w,
// ),
// child: GestureDetector(
// onTap: () {
// Navigator.of(context).pushNamed('/router/system_msg_page').then((value) {
// setState(() {
// totalMsg = 0;
// });
// });
// // Navigator.of(context).pushNamed('/router/web_turntable_activity');
// },
// child: Container(
// height: 24,
// alignment:Alignment.center,
// child:Stack(
// children: [
// SvgPicture.asset(
// "assets/svg/tixing.svg",
// width: 24,
// height: 24,
// ),
// if(totalMsg != 0)
// Container(
// width:36,
// alignment: Alignment.topRight,
// child:Container(
// width:22,
// height:14,
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(100),
// border: Border.all(
// width: 1,
// color: Colors.white,
// style: BorderStyle.solid,
// ),
// color:Color(0xFFFF441A),
// ),
// child:RoundButton(
// text:totalMsg.toString(),
// textColor: Colors.white,
// fontWeight: MyFontWeight.regular,
// backgroup: Color(0xFFFF441A),
// fontSize:8.sp,
// radius: 100,
// )
// ),
// )
// ],
// ),
// )
// )
// ),
// Container(
// margin: EdgeInsets.only(right: 16.w),
// child: GestureDetector(
// onTap: () {
// toScan();
// },
// child: SvgPicture.asset(
// "assets/svg/saoyisao.svg",
// width: 24,
// height: 24,
// ),
// ),
// ),
// ],
// ),
3 years ago
Expanded(
child: Container(
child: SmartRefresher(
controller: refreshController,
enablePullDown: true,
enablePullUp: false,
header: MyHeader(),
physics: BouncingScrollPhysics(),
onRefresh: () {
3 years ago
setState(() {_onRefresh();
});
3 years ago
},
child: SingleChildScrollView(
physics: NeverScrollableScrollPhysics(),
child: FutureBuilder(
future: queryHome(),
builder: (context, snapshot) {
return Column(
children: [
///banner
HomeBanner(bannerData, controller),
3 years ago
///吃喝玩
UnionEntry((int jpIndex) {
widget.changeTab(1,jpIndex);
}),
3 years ago
///快捷操作
ShortcutOperation((int jpIndex) {
widget.changeTab(1,jpIndex);
}),
3 years ago
///推广图
spread(),
3 years ago
// ///签到
// SignView(isSigned, (value) {
// setState(() {
// isSigned = value;
// });
// }),
3 years ago
///特惠专区
DiscountZone(coupons),
3 years ago
///特惠专区-推荐商品展示
HomeRecommendGoods(homeRank),
3 years ago
///助农专区
if(mRaiseMoney != 0)
HappyHelpFarmers(),
///福利中心
WelfareCore(),
3 years ago
///吃喝玩商品热销榜
TopSellingList(homeRank),
3 years ago
// ///店铺推荐
// QuickOrder(),
3 years ago
// ///超级优惠券
// CouponView(),
3 years ago
// ///精选活动
// FeaturedActivity(),
3 years ago
// ///积分商城
// HomeIntegralStore(gooods),
///积分商品头Tab
PointsGoodsTitle(
gooodsCategorys,
3 years ago
(orderType, orderDesc) {
this.orderType = orderType;
this.orderDesc = orderDesc;
setState(() {});
},
3 years ago
(index) {
categoryId = gooodsCategorys[index].id;
pageNum = 1;
setState(() {});
},
),
///积分商品列表
PointGoods(
goods,
3 years ago
(index) {
_toDetails(index);
},
),
],
);})
3 years ago
),
),
),
4 years ago
),
3 years ago
SizedBox(
height: 80.h,
3 years ago
),
],
);
}
3 years ago
Widget spread(){
return Container(
width: double.infinity,
1.动态详情,评论-已显示全部—修改; 2.新增加集换卡详情页面; 3.语言-增加部分文本语言并更改; 4.回乡VIP板块更改;原本的VIP卡逻辑暂时不用,换成用户充值200即成为会员,该页面ui调整;(原来逻辑未删减,暂保留不使用) 5.16进制渐变色值的方法,改变亮度暂定统一为95; 6.首页ui调整;邀请好友图片处,原单一图片现更改为轮播效果,新增集换卡引导也放在此处; 7.积分明细页面更改;共用一个页面根据积分跟集换卡的入口,传对应的值,查看对应的数据; 8.积分明细跳转路径更改,新增一个类型带入路径中跳转传入; 9.更改测试版本服务地址; 10.我的页面跟首页更改一致,单一图片改轮播效果; 11.会员中心,会员卡部分更改;将原有写法去掉,重写了会员卡的使用显示,并优化了该页面数据的显示; 12.我的页面,vip等级显示更改; 13.会员卡列表等级接口,实体类新增部分字段;(原定位分数已不用,更改为originScore,后期若用的原字段,需要修改) 14.订单结算页,支付类型更换时queryOrderInfo()接口中。优惠类型做了调整更改;(改修改需要多测试下,尝试多种情况看下,是否有问题;有可能部分情况没有预判到) 15.点单页结算跳转,vipLevelName,vipLevelName字段做了非空判断; 16.UserInfo实体类新增isVip字段;(主要用于查看用户数据是查询该用户是否已是vip卡状态) 17.福利兑换中心页面,我的信息部分ui做调整,新增集换卡数量的显示;
2 years ago
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),
3 years ago
),
),
1.动态详情,评论-已显示全部—修改; 2.新增加集换卡详情页面; 3.语言-增加部分文本语言并更改; 4.回乡VIP板块更改;原本的VIP卡逻辑暂时不用,换成用户充值200即成为会员,该页面ui调整;(原来逻辑未删减,暂保留不使用) 5.16进制渐变色值的方法,改变亮度暂定统一为95; 6.首页ui调整;邀请好友图片处,原单一图片现更改为轮播效果,新增集换卡引导也放在此处; 7.积分明细页面更改;共用一个页面根据积分跟集换卡的入口,传对应的值,查看对应的数据; 8.积分明细跳转路径更改,新增一个类型带入路径中跳转传入; 9.更改测试版本服务地址; 10.我的页面跟首页更改一致,单一图片改轮播效果; 11.会员中心,会员卡部分更改;将原有写法去掉,重写了会员卡的使用显示,并优化了该页面数据的显示; 12.我的页面,vip等级显示更改; 13.会员卡列表等级接口,实体类新增部分字段;(原定位分数已不用,更改为originScore,后期若用的原字段,需要修改) 14.订单结算页,支付类型更换时queryOrderInfo()接口中。优惠类型做了调整更改;(改修改需要多测试下,尝试多种情况看下,是否有问题;有可能部分情况没有预判到) 15.点单页结算跳转,vipLevelName,vipLevelName字段做了非空判断; 16.UserInfo实体类新增isVip字段;(主要用于查看用户数据是查询该用户是否已是vip卡状态) 17.福利兑换中心页面,我的信息部分ui做调整,新增集换卡数量的显示;
2 years ago
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,
),
borderRadius: BorderRadius.circular(6.w),
),
),
);
},
itemCount:2,
3 years ago
),
);
}
1.动态详情,评论-已显示全部—修改; 2.新增加集换卡详情页面; 3.语言-增加部分文本语言并更改; 4.回乡VIP板块更改;原本的VIP卡逻辑暂时不用,换成用户充值200即成为会员,该页面ui调整;(原来逻辑未删减,暂保留不使用) 5.16进制渐变色值的方法,改变亮度暂定统一为95; 6.首页ui调整;邀请好友图片处,原单一图片现更改为轮播效果,新增集换卡引导也放在此处; 7.积分明细页面更改;共用一个页面根据积分跟集换卡的入口,传对应的值,查看对应的数据; 8.积分明细跳转路径更改,新增一个类型带入路径中跳转传入; 9.更改测试版本服务地址; 10.我的页面跟首页更改一致,单一图片改轮播效果; 11.会员中心,会员卡部分更改;将原有写法去掉,重写了会员卡的使用显示,并优化了该页面数据的显示; 12.我的页面,vip等级显示更改; 13.会员卡列表等级接口,实体类新增部分字段;(原定位分数已不用,更改为originScore,后期若用的原字段,需要修改) 14.订单结算页,支付类型更换时queryOrderInfo()接口中。优惠类型做了调整更改;(改修改需要多测试下,尝试多种情况看下,是否有问题;有可能部分情况没有预判到) 15.点单页结算跳转,vipLevelName,vipLevelName字段做了非空判断; 16.UserInfo实体类新增isVip字段;(主要用于查看用户数据是查询该用户是否已是vip卡状态) 17.福利兑换中心页面,我的信息部分ui做调整,新增集换卡数量的显示;
2 years ago
final List<String> spreadItem = [
"assets/image/welfare_spread.webp",
"assets/image/welfare_yz.webp",
];
///扫码
3 years ago
toScan() async {
if (await Permission.camera.isPermanentlyDenied) {
showCupertinoDialog(
context: context,
builder: (context) {
return RequestPermission(
"assets/image/icon_camera_permission_tips.webp",
3 years ago
S.of(context).ninxiangjiquanxianweikaiqi,
S.of(context).weilekaipaizhaoxuanzhetouxiang,
S.of(context).kaiqiquanxian,
(result) async {
3 years ago
if (result) {
await openAppSettings();
}
},
heightRatioWithWidth: 0.82,
);
});
} else if (await Permission.camera.isGranted) {
// http://pos.app.gznl.top/placeorder/?tableId=1315903669597634560&tenantCode=1166&shopId=1300372027722432512
3 years ago
var result = await Navigator.of(context).pushNamed('/router/qr_scan');
if(result.toString().contains("type\":\"coupon")){
///活动优惠券赠送弹窗
activityShowAlertDialog(result.toString());
return;
}if(result.toString().contains("type\":\"wiped")){
///核销券
queryWiped(jsonDecode(result.toString())["memberCouponId"]);
return;
}
3 years ago
// String result = await scanner.scan();
3 years ago
Uri uri = Uri.parse(result);
String tableId = uri.queryParameters["tableId"];
String tenantCode = uri.queryParameters["tenantCode"];
String shopId = uri.queryParameters["shopId"];
if (tableId != null &&
tableId != "" &&
tenantCode != null &&
tenantCode != "" &&
shopId != null &&
shopId != "") {
3 years ago
Navigator.of(context).pushNamed(
'/router/store_order',
arguments: {
"id": shopId,
"tenant": tenantCode,
"storeName": "",
"tableId": int.tryParse(tableId),
},
);
}
} else {
showCupertinoDialog(
context: context,
builder: (context) {
return RequestPermission(
"assets/image/icon_camera_permission_tips.webp",
S.of(context).ninxiangjiquanxianweikaiqi,
S.of(context).weilekaipaizhaoxuanzhetouxiang,
S.of(context).kaiqiquanxian,
(result) async {
if (result) {
await Permission.camera.request();
}
},
heightRatioWithWidth: 0.82,
);
});
3 years ago
}
}
3 years ago
_toDetails(index) async {
Navigator.of(context).pushNamed(
'/router/integral_store_page',
arguments: {"goodsId": goods[index].id},
4 years ago
);
}
activityShowAlertDialog(String result) {
3 years ago
//显示对话框
showDialog(
context: context,
builder: (BuildContext context) {
return ActivityCoupons(result);
3 years ago
},
);
}
4 years ago
@override
bool get wantKeepAlive => true;
4 years ago
}