Browse Source

Merge remote-tracking branch 'origin/dev'

master
fmk 3 years ago
parent
commit
81fb80d55d
  1. BIN
      assets/image/2x/home_activity.png
  2. BIN
      assets/image/3x/home_activity.png
  3. BIN
      assets/image/home_activity.png
  4. 12
      assets/svg/lianmeng.svg
  5. 9
      assets/svg/shequn.svg
  6. 10
      assets/svg/wode.svg
  7. 1
      lib/community/community_child_page.dart
  8. 26
      lib/community/community_view/community_dynamic.dart
  9. 8
      lib/home/home_view/featured_acticvity.dart
  10. 18
      lib/home/home_view/home_integral_store.dart
  11. 168
      lib/home/home_view/quick_order.dart
  12. 5
      lib/mine/fans_page.dart
  13. 8
      lib/mine/follow_page.dart
  14. 2
      lib/retrofit/data/follow_list.dart
  15. 66
      lib/settlement/settlement.dart
  16. 129
      lib/union/union_page.dart

BIN
assets/image/2x/home_activity.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
assets/image/3x/home_activity.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
assets/image/home_activity.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 811 B

12
assets/svg/lianmeng.svg

@ -1,17 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="30px" height="30px" viewBox="0 0 30 30" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>编组 12</title>
<title>编组 7</title>
<g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="首页" transform="translate(-126.000000, -1973.000000)">
<g id="编组-12" transform="translate(126.000000, 1973.000000)">
<g id="联盟门店" transform="translate(-126.000000, -733.000000)">
<g id="编组-7" transform="translate(126.000000, 733.000000)">
<g id="编组-13备份">
<rect id="矩形" x="0" y="0" width="30" height="30"></rect>
<rect id="矩形" x="2.04545455" y="2.04545455" width="25.9090909" height="25.9090909"></rect>
</g>
<g id="Icon-header-19" transform="translate(5.666886, 3.770117)" fill-rule="nonzero" stroke="#E6E6E6" stroke-width="2">
<g id="Icon-header-19" transform="translate(6.532840, 4.770117)" fill="#32A060" fill-rule="nonzero" stroke="#32A060" stroke-width="2">
<g id="编组">
<path d="M9.52674312,-1.15463402 L12.7967233,0.732737101 L6.37583452,11.8528979 L8.21019266,12.9447516 L4.10111532,20.063104 L-1,17.0736711 L-1,4.92196234 L9.52674312,-1.15463402 Z" id="路径"></path>
<path d="M15.067945,1.88132528 L20.0509931,4.93979948 L20.0509931,17.0780377 L9.52425002,23.154634 L6.25426983,21.2672629 L12.6956418,10.1116279 L10.9689717,8.98217392 L15.067945,1.88132528 Z" id="路径"></path>
<polygon id="路径" points="4.56034383 11.0976885 6.22803379 12.0903374 3.39843685 16.9921843 0 15.0005808 0 4.99941921 8.66070391 0 10.3914508 0.998954582"></polygon>
<polygon id="路径" points="14.018552 2.97363225 11.1889551 7.87547915 12.7587409 8.90231153 6.92763387 19.0010454 8.65838076 20 17.3190847 15.0005808 17.3190847 4.99941921"></polygon>
</g>
</g>
</g>

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

9
assets/svg/shequn.svg

@ -1,12 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="30px" height="30px" viewBox="0 0 30 30" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>编组 13备份</title>
<title>编组 9</title>
<g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="首页" transform="translate(-219.000000, -1973.000000)">
<g id="编组-13备份" transform="translate(219.000000, 1973.000000)">
<g id="推荐" transform="translate(-219.000000, -1992.000000)">
<g id="编组-13备份" transform="translate(219.000000, 1992.000000)">
<rect id="矩形" x="0" y="0" width="30" height="30"></rect>
<rect id="矩形" x="2.04545455" y="2.04545455" width="25.9090909" height="25.9090909"></rect>
<path d="M24,4 C25.1045695,4 26,4.8954305 26,6 L26,20 C26,21.1045695 25.1045695,22 24,22 L8,22 L4.99044723,25.0095528 C4.88440486,25.1155951 4.73636429,25.1684402 4.58714198,25.153518 C4.31237005,25.1260408 4.11189806,24.8810194 4.13937525,24.6062475 L4.13937525,24.6062475 L4.47138513,21.2897716 C4.17728107,20.9415593 4,20.4914828 4,20 L4,6 C4,4.8954305 4.8954305,4 6,4 L24,4 Z M8,11 C6.8954305,11 6,11.8954305 6,13 C6,14.1045695 6.8954305,15 8,15 C9.1045695,15 10,14.1045695 10,13 C10,11.8954305 9.1045695,11 8,11 Z M22,11 C20.8954305,11 20,11.8954305 20,13 C20,14.1045695 20.8954305,15 22,15 C23.1045695,15 24,14.1045695 24,13 C24,11.8954305 23.1045695,11 22,11 Z M15,11 C13.8954305,11 13,11.8954305 13,13 C13,14.1045695 13.8954305,15 15,15 C16.1045695,15 17,14.1045695 17,13 C17,11.8954305 16.1045695,11 15,11 Z" id="形状结合" stroke="#E6E6E6" stroke-width="2"></path>
<path d="M4.5,21 L4.13937525,24.6062475 C4.11189806,24.8810194 4.31237005,25.1260408 4.58714198,25.153518 C4.73636429,25.1684402 4.88440486,25.1155951 4.99044723,25.0095528 L8,22 L8,22 L4.5,21 Z" id="路径-23" fill="#32A060"></path>
<path d="M24,4 C25.1045695,4 26,4.8954305 26,6 L26,20 C26,21.1045695 25.1045695,22 24,22 L6,22 C4.8954305,22 4,21.1045695 4,20 L4,6 C4,4.8954305 4.8954305,4 6,4 L24,4 Z M8,11 C6.8954305,11 6,11.8954305 6,13 C6,14.1045695 6.8954305,15 8,15 C9.1045695,15 10,14.1045695 10,13 C10,11.8954305 9.1045695,11 8,11 Z M22,11 C20.8954305,11 20,11.8954305 20,13 C20,14.1045695 20.8954305,15 22,15 C23.1045695,15 24,14.1045695 24,13 C24,11.8954305 23.1045695,11 22,11 Z M15,11 C13.8954305,11 13,11.8954305 13,13 C13,14.1045695 13.8954305,15 15,15 C16.1045695,15 17,14.1045695 17,13 C17,11.8954305 16.1045695,11 15,11 Z" id="形状结合" fill="#32A060"></path>
</g>
</g>
</g>

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

10
assets/svg/wode.svg

@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="30px" height="30px" viewBox="0 0 30 30" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>编组 32备份</title>
<title>编组 33</title>
<g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="首页" transform="translate(-313.000000, -1973.000000)">
<g id="编组-32备份" transform="translate(313.000000, 1973.000000)">
<g id="我的修改" transform="translate(-313.000000, -858.000000)">
<g id="编组-32" transform="translate(313.000000, 858.000000)">
<rect id="矩形" x="0" y="0" width="30" height="30"></rect>
<rect id="矩形" x="2.04545455" y="2.04545455" width="25.9090909" height="25.9090909"></rect>
<rect id="矩形" fill="#000000" fill-rule="nonzero" opacity="0" x="2" y="3" width="25" height="25"></rect>
<circle id="椭圆形" stroke="#E6E6E6" stroke-width="2" cx="15" cy="10" r="5"></circle>
<path d="M20.7149057,15.5992029 C23.0441653,17.0182332 24.8045748,19.2785874 25.5740039,21.958135 C25.8514072,22.9241961 26,23.9447452 26,25 L26,25 L4,25 C4,24.005236 4.13204538,23.0413129 4.37956453,22.1248022 C5.12294706,19.3722152 6.90790434,17.0472889 9.28551031,15.5989495 C10.7375158,17.0805099 12.7613787,18 15,18 C17.1674571,18 19.1335928,17.1380406 20.5743206,15.7382083 Z" id="形状结合" stroke="#E6E6E6" stroke-width="2"></path>
<circle id="椭圆形" fill="#32A060" cx="15" cy="10" r="6"></circle>
<path d="M20.7149057,15.5992029 C23.0441653,17.0182332 24.8045748,19.2785874 25.5740039,21.958135 C25.8514072,22.9241961 26,23.9447452 26,25 L26,25 L4,25 C4,24.005236 4.13204538,23.0413129 4.37956453,22.1248022 C5.12294706,19.3722152 6.90790434,17.0472889 9.28551031,15.5989495 C10.7375158,17.0805099 12.7613787,18 15,18 C17.1674571,18 19.1335928,17.1380406 20.5743206,15.7382083 Z" id="形状结合" fill="#32A060"></path>
</g>
</g>
</g>

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

1
lib/community/community_child_page.dart

@ -7,7 +7,6 @@ import 'package:huixiang/retrofit/data/page.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/my_footer.dart';
import 'package:image_pickers/image_pickers.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart';

26
lib/community/community_view/community_dynamic.dart

@ -110,11 +110,11 @@ class _CommunityDynamic extends State<CommunityDynamic> {
}
////
_vipFollow(followId) async {
_vipFollow(followId,isFollow) async {
BaseData baseData = await apiService.follow(followId);
if (baseData != null && baseData.isSuccess) {
widget.exitFull();
SmartDialog.showToast("关注成功", alignment: Alignment.center);
SmartDialog.showToast(isFollow?"关注成功":"取关成功", alignment: Alignment.center);
setState(() {});
} else {
// SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
@ -210,7 +210,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
if (widget.commentType == 0) {
widget.comment.selfFollow =
!(widget.comment.selfFollow ?? false);
_vipFollow(widget.comment.memberInfo?.mid);
_vipFollow(widget.comment.memberInfo?.mid,widget.comment.selfFollow ?? false);
} else {
showDeleteDialog();
}
@ -219,7 +219,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
child: (widget.commentType == 0)
? Container(
width: 56.w,
height: 21.h,
height: 25.h,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(11.w),
@ -246,11 +246,11 @@ class _CommunityDynamic extends State<CommunityDynamic> {
size: 15,
),
))
: Icon(
Icons.close,
color: Colors.black,
size: 16,
),
: Padding(padding: EdgeInsets.all(20),child:Icon(
Icons.close,
color: Colors.black,
size: 16,
),),
),
],
),
@ -322,14 +322,18 @@ class _CommunityDynamic extends State<CommunityDynamic> {
if (subjectInfo.type == "image" && subjectInfo.images.length > 0) {
if (subjectInfo.images.length == 1) {
itemWidget = Container(
child: MImage(
child: InkWell(
onTap: () {
ImagePickers.previewImages(subjectInfo.images,0);
},
child: MImage(
subjectInfo.images[0],
fit: BoxFit.cover,
width: MediaQuery.of(context).size.width / 1.5,
height: MediaQuery.of(context).size.width / 1.5,
errorSrc: "assets/image/default_2_1.png",
fadeSrc: "assets/image/default_2_1.png",
),
)),
);
} else {
itemWidget = GridView.builder(

8
lib/home/home_view/featured_acticvity.dart

@ -55,7 +55,7 @@ class _FeaturedActivity extends State<FeaturedActivity> {
children: [
ItemTitle(
text: "精选活动",
imgPath: "assets/image/icon_points_mall.png",
imgPath: "assets/image/home_activity.png",
moreText: S.of(context).chakangengduo,
onTap: () {
Navigator.of(context).pushNamed('/router/activity_list');
@ -157,7 +157,7 @@ class _FeaturedActivity extends State<FeaturedActivity> {
}
Widget stackItem(double textSize, Activity activity) {
return Column(
return Container(color: Color.fromARGB(80, 0, 0, 0),child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -180,7 +180,7 @@ class _FeaturedActivity extends State<FeaturedActivity> {
height: 2,
),
Text(
activity.viceTitle,
activity?.viceTitle??"",
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 12.sp,
@ -223,6 +223,6 @@ class _FeaturedActivity extends State<FeaturedActivity> {
),
),
],
);
));
}
}

18
lib/home/home_view/home_integral_store.dart

@ -44,14 +44,18 @@ class _HomeIntegralStore extends State<HomeIntegralStore> {
color: Colors.white,
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ItemTitle(
text: "大家都在兑换",
imgPath: "assets/image/icon_points_mall.png",
),
SizedBox(
height: 10.h,
),
Padding(padding: EdgeInsets.only(left: 16,bottom: 10),child: Text(
"大家都在兑换",
textAlign: TextAlign.end,
style: TextStyle(
color: Colors.black,
fontSize: 16.sp,
fontWeight: FontWeight.bold,
),
),),
Divider(
thickness: 1,
color: Color(0xffF2F2F2),

168
lib/home/home_view/quick_order.dart

@ -1,17 +1,24 @@
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart';
import 'package:flutter_baidu_mapapi_map/flutter_baidu_mapapi_map.dart';
import 'package:flutter_baidu_mapapi_utils/flutter_baidu_mapapi_utils.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/store/scan.dart';
import 'package:huixiang/utils/location.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/store.dart';
import 'package:huixiang/retrofit/retrofit_api.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/item_title.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/view_widget/request_permission.dart';
import 'package:huixiang/view_widget/round_button.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:shared_preferences/shared_preferences.dart';
class QuickOrder extends StatefulWidget {
@ -168,14 +175,18 @@ class _QuickOrder extends State<QuickOrder> {
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
Navigator.of(context).pushNamed(
'/router/store_order',
arguments: {
"id": storeList[position].id,
"tenant": storeList[position].tenantCode,
"storeName": storeList[position].storeName
},
);
if (storeList[position].posType.code == "NORMALSTORE") {
showDeleteDialog();
} else {
Navigator.of(context).pushNamed(
'/router/store_order',
arguments: {
"id": storeList[position].id,
"tenant": storeList[position].tenantCode,
"storeName": storeList[position].storeName
},
);
}
},
child: storeItem(storeList[position],position),
);
@ -254,22 +265,23 @@ class _QuickOrder extends State<QuickOrder> {
errorSrc: "assets/image/default_1.png",
fadeSrc: "assets/image/default_1.png",
),
Text(
Padding(padding: EdgeInsets.only(left: 10,right: 10),child:Text(
store.storeName,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 14.sp,
fontSize: 13.sp,
fontWeight: MyFontWeight.medium,
color: Colors.black,
),
),
Text(
store?.remark ??"",
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF868686),
),
),
),),
// Text(
// store?.remark ??"",
// style: TextStyle(
// fontSize: 10.sp,
// fontWeight: MyFontWeight.medium,
// color: Color(0xFF868686),
// ),
// ),
SizedBox(
height: 5,
),
@ -281,4 +293,122 @@ class _QuickOrder extends State<QuickOrder> {
),
);
}
///
showDeleteDialog() {
showDialog(
context: context,
builder: (context) {
return AlertDialog(
content: Container(
width: MediaQuery.of(context).size.width - 84,
height: 110.h,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
"您即将进行扫码点餐",
style: TextStyle(
fontSize: 17.sp,
fontWeight: FontWeight.bold,
color: Colors.black,
),
),
SizedBox(
height: 30.h,
),
Row(
children: [
Expanded(
child: InkWell(
child: BorderText(
text: "取消",
textColor: Color(0xFF32A060),
fontSize: 16.sp,
fontWeight: FontWeight.bold,
borderColor: Color(0xFF32A060),
radius: 4,
padding: EdgeInsets.all(12),
borderWidth: 1,
),
onTap: () {
Navigator.of(context).pop();
},
),
flex: 1,
),
SizedBox(
width: 16.w,
),
Expanded(
child: InkWell(
child: RoundButton(
text: "确定",
textColor: Colors.white,
radius: 4,
padding: EdgeInsets.all(12),
backgroup: Color(0xFF32A060),
fontSize: 16.sp,
fontWeight: FontWeight.bold,
),
onTap: () {
toScan();
Navigator.of(context).pop();
},
),
flex: 1,
),
],
)
],
),
),
);
},
);
}
///
toScan() async {
if (await Permission.camera.isPermanentlyDenied) {
showCupertinoDialog(
context: context,
builder: (context) {
return RequestPermission(
"assets/image/icon_camera_permission_tips.png",
S.of(context).ninxiangjiquanxianweikaiqi,
S.of(context).weilekaipaizhaoxuanzhetouxiang,
S.of(context).kaiqiquanxian,
(result) async {
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
var result = await Navigator.of(context).pushNamed('/router/qr_scan');
// String result = await scanner.scan();
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 != "") {
Navigator.of(context).pushNamed(
'/router/store_order',
arguments: {
"id": shopId,
"tenant": tenantCode,
"storeName": "",
"tableId": int.tryParse(tableId),
},
);
}
} else {
await Permission.camera.request();
}
}
}

5
lib/mine/fans_page.dart

@ -109,7 +109,7 @@ class _FansPage extends State<FansPage> {
},
),
controller: _refreshController,
// onRefresh: ,
onRefresh: (){_queryFollowList();},
physics: BouncingScrollPhysics(),
child: ListView.builder(
itemCount: list == null ? 0 : list.length,
@ -166,11 +166,10 @@ class _FansPage extends State<FansPage> {
)),
Container(
width: 56.w,
height: 21.h,
height: 25.h,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(11.w),
color: Color(0xFF32A060),
),
child: GestureDetector(
onTap: () {

8
lib/mine/follow_page.dart

@ -110,7 +110,7 @@ class _FollowPage extends State<FollowPage> {
},
),
controller: _refreshController,
// onRefresh: ,
onRefresh: (){_queryFollowList();},
physics: BouncingScrollPhysics(),
child: ListView.builder(
itemCount: list == null ? 0 : list.length,
@ -165,8 +165,8 @@ class _FollowPage extends State<FollowPage> {
),
)),
Container(
width: 69.w,
height: 21.h,
width: 56.w,
height: 25.h,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(11.w),
color: Color(0xFFE6E6E6),
@ -191,7 +191,7 @@ class _FollowPage extends State<FollowPage> {
"已关注",
style: TextStyle(
color: Color(0xFF808080),
fontSize: 12.sp,
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
),
),

2
lib/retrofit/data/follow_list.dart

@ -116,7 +116,7 @@ class FollowList {
class ListData {
ListData({
String mid,
bool isFollow,
bool isFollow,
String nickname,
String avatar,}){
_mid = mid;

66
lib/settlement/settlement.dart

@ -236,10 +236,13 @@ class _Settlement extends State<Settlement> {
} else {
///
BaseData<DownOrder> baseData;
if (parentId == "") { //
if (placeOrder) { //
if (parentId == "") {
//
if (placeOrder) {
//
querySettlement();
} else { //
} else {
//
baseData = await minService
.placeOrderFirst(placeOrderFirst.toJson())
.catchError((error) {
@ -247,9 +250,11 @@ class _Settlement extends State<Settlement> {
});
}
} else {
if (placeOrder) { //
if (placeOrder) {
//
querySettlement();
} else { //
} else {
//
baseData = await minService
.addOrder(placeOrderFirst.toJson())
.catchError((error) {
@ -270,7 +275,9 @@ class _Settlement extends State<Settlement> {
///
querySettlement() async {
placeOrderFirst.id = parentId != "" ? parentId : downOrder.id;
placeOrderFirst.orderProductVOList = downOrder == null ? minOrderInfo.orderProductVOList : downOrder.orderProductVOList;
placeOrderFirst.orderProductVOList = downOrder == null
? minOrderInfo.orderProductVOList
: downOrder.orderProductVOList;
if (placeOrderFirst.payChannel == 1) {
if (!(await Min.isInitialize())) {
// app的充值支付使用同一个WXPayEntryActivity回调
@ -309,7 +316,11 @@ class _Settlement extends State<Settlement> {
if (baseData != null && baseData.isSuccess) {
toOrderDetails(placeOrderFirst.id);
} else {
SmartDialog.show(widget: Tips((){}, text: "${baseData.msg}",));
SmartDialog.show(
widget: Tips(
() {},
text: "${baseData.msg}",
));
}
}
}
@ -386,26 +397,27 @@ class _Settlement extends State<Settlement> {
////
ActivityCouponRemarks(
couponCart,
activityCart,
settleOrderInfo,
coupons,
promotions,
couponCount(),
placeOrder,
remakers,
(){
Navigator.of(context).pushNamed(
'/router/edit_remarks_page',
arguments: {},
).then((value) => {setState(() {
if(value != null)
remakers = value;
})});
}
),
if (placeOrder) ///
couponCart,
activityCart,
settleOrderInfo,
coupons,
promotions,
couponCount(),
placeOrder,
remakers, () {
Navigator.of(context).pushNamed(
'/router/edit_remarks_page',
arguments: {},
).then((value) => {
setState(() {
if (value != null) remakers = value;
})
});
}),
if (placeOrder)
///
PayMethod(payChannelCheck),
],
),

129
lib/union/union_page.dart

@ -16,11 +16,15 @@ import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/store/scan.dart';
import 'package:huixiang/utils/event_type.dart';
import 'package:huixiang/utils/location.dart';
import 'package:huixiang/view_widget/border_text.dart';
import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/icon_text.dart';
import 'package:huixiang/view_widget/item_title.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:huixiang/view_widget/request_permission.dart';
import 'package:huixiang/view_widget/round_button.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter/rendering.dart';
@ -273,12 +277,7 @@ class _UnionPage extends State<UnionPage>
return InkWell(
onTap: () {
if (storeList[position].posType.code == "NORMALSTORE") {
Scan.toScan(
context,
storeList[position].id,
storeList[position].tenantCode,
storeList[position].storeName,
);
showDeleteDialog();
} else {
Navigator.of(context).pushNamed(
'/router/store_order',
@ -606,6 +605,124 @@ class _UnionPage extends State<UnionPage>
);
}
///
showDeleteDialog() {
showDialog(
context: context,
builder: (context) {
return AlertDialog(
content: Container(
width: MediaQuery.of(context).size.width - 84,
height: 110.h,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
"您即将进行扫码点餐",
style: TextStyle(
fontSize: 17.sp,
fontWeight: FontWeight.bold,
color: Colors.black,
),
),
SizedBox(
height: 30.h,
),
Row(
children: [
Expanded(
child: InkWell(
child: BorderText(
text: "取消",
textColor: Color(0xFF32A060),
fontSize: 16.sp,
fontWeight: FontWeight.bold,
borderColor: Color(0xFF32A060),
radius: 4,
padding: EdgeInsets.all(12),
borderWidth: 1,
),
onTap: () {
Navigator.of(context).pop();
},
),
flex: 1,
),
SizedBox(
width: 16.w,
),
Expanded(
child: InkWell(
child: RoundButton(
text: "确定",
textColor: Colors.white,
radius: 4,
padding: EdgeInsets.all(12),
backgroup: Color(0xFF32A060),
fontSize: 16.sp,
fontWeight: FontWeight.bold,
),
onTap: () {
toScan();
Navigator.of(context).pop();
},
),
flex: 1,
),
],
)
],
),
),
);
},
);
}
///
toScan() async {
if (await Permission.camera.isPermanentlyDenied) {
showCupertinoDialog(
context: context,
builder: (context) {
return RequestPermission(
"assets/image/icon_camera_permission_tips.png",
S.of(context).ninxiangjiquanxianweikaiqi,
S.of(context).weilekaipaizhaoxuanzhetouxiang,
S.of(context).kaiqiquanxian,
(result) async {
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
var result = await Navigator.of(context).pushNamed('/router/qr_scan');
// String result = await scanner.scan();
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 != "") {
Navigator.of(context).pushNamed(
'/router/store_order',
arguments: {
"id": shopId,
"tenant": tenantCode,
"storeName": "",
"tableId": int.tryParse(tableId),
},
);
}
} else {
await Permission.camera.request();
}
}
@override
bool get wantKeepAlive => true;
}

Loading…
Cancel
Save