Commit 0204e8810cf2f65ab2ec73a7613c26a7ec862fea

Authored by wdn127929
1 parent c2d37c26

检测微信收否绑定过手机号码

@@ -11,14 +11,14 @@ if (flutterRoot == null) { @@ -11,14 +11,14 @@ if (flutterRoot == null) {
11 throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 11 throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12 } 12 }
13 13
14 -def flutterVersionCode = "221" 14 +def flutterVersionCode = "220"
15 if (flutterVersionCode == null) { 15 if (flutterVersionCode == null) {
16 - flutterVersionCode = '221' 16 + flutterVersionCode = '220'
17 } 17 }
18 18
19 -def flutterVersionName = "2.2.1" 19 +def flutterVersionName = "2.2.0"
20 if (flutterVersionName == null) { 20 if (flutterVersionName == null) {
21 - flutterVersionName = '2.2.1' 21 + flutterVersionName = '2.2.0'
22 } 22 }
23 23
24 apply plugin: 'com.android.application' 24 apply plugin: 'com.android.application'
@@ -59,6 +59,7 @@ android { @@ -59,6 +59,7 @@ android {
59 VIVO_APPID: "103886384", 59 VIVO_APPID: "103886384",
60 VIVO_APPKEY:"5a04e5c3485c0b19a2911c95dcaff5d2", 60 VIVO_APPKEY:"5a04e5c3485c0b19a2911c95dcaff5d2",
61 PACKAGE_NAME : "com.naji.one_key",// 小米通道 61 PACKAGE_NAME : "com.naji.one_key",// 小米通道
  62 + AMAP_KEY : "dbced781d0acd36184d5b4b54da7188d"
62 ] 63 ]
63 } 64 }
64 65
@@ -109,4 +110,6 @@ dependencies { @@ -109,4 +110,6 @@ dependencies {
109 implementation 'com.tencent.tpns:xiaomi:1.2.0.3-release' // 小米推送 110 implementation 'com.tencent.tpns:xiaomi:1.2.0.3-release' // 小米推送
110 implementation 'com.tencent.tpns:oppo:1.2.0.3-release' // OPPO 推送 111 implementation 'com.tencent.tpns:oppo:1.2.0.3-release' // OPPO 推送
111 implementation 'com.tencent.tpns:vivo:1.2.0.3-release' // vivo 推送 112 implementation 'com.tencent.tpns:vivo:1.2.0.3-release' // vivo 推送
  113 + implementation 'com.amap.api:location:latest.integration'
  114 +
112 } 115 }
@@ -8,7 +8,10 @@ @@ -8,7 +8,10 @@
8 FlutterApplication and put your custom class here. --> 8 FlutterApplication and put your custom class here. -->
9 9
10 10
11 - 11 +<!--用于进行网络定位-->
  12 + <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"></uses-permission>
  13 +<!--用于访问GPS定位-->
  14 + <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"></uses-permission>
12 <uses-permission android:name="android.permission.READ_CONTACTS" /> 15 <uses-permission android:name="android.permission.READ_CONTACTS" />
13 <uses-permission android:name="android.permission.WRITE_CONTACTS" /> 16 <uses-permission android:name="android.permission.WRITE_CONTACTS" />
14 <uses-permission android:name="android.permission.READ_CONTACTS"/> 17 <uses-permission android:name="android.permission.READ_CONTACTS"/>
@@ -79,9 +79,9 @@ PODS: @@ -79,9 +79,9 @@ PODS:
79 - Flutter 79 - Flutter
80 - sign_in_with_apple (0.0.1): 80 - sign_in_with_apple (0.0.1):
81 - Flutter 81 - Flutter
82 - - sqflite (0.0.2): 82 + - sqflite (0.0.1):
83 - Flutter 83 - Flutter
84 - - FMDB (>= 2.7.5) 84 + - FMDB (~> 2.7.2)
85 - TPNS-iOS (1.2.7.2) 85 - TPNS-iOS (1.2.7.2)
86 - tpns_flutter_plugin (1.0.4): 86 - tpns_flutter_plugin (1.0.4):
87 - Flutter 87 - Flutter
@@ -249,7 +249,7 @@ SPEC CHECKSUMS: @@ -249,7 +249,7 @@ SPEC CHECKSUMS:
249 Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96 249 Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96
250 shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d 250 shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d
251 sign_in_with_apple: 34f3f5456a45fd7ac5fb42905e2ad31dae061b4a 251 sign_in_with_apple: 34f3f5456a45fd7ac5fb42905e2ad31dae061b4a
252 - sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904 252 + sqflite: 4001a31ff81d210346b500c55b17f4d6c7589dd0
253 TPNS-iOS: 9b35473a4a0d07f2c2730ea1e66c6749c2b98095 253 TPNS-iOS: 9b35473a4a0d07f2c2730ea1e66c6749c2b98095
254 tpns_flutter_plugin: 8dbbee157aab91a878f64d056c1383726a6c5c4d 254 tpns_flutter_plugin: 8dbbee157aab91a878f64d056c1383726a6c5c4d
255 url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef 255 url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef
@@ -44,6 +44,7 @@ @@ -44,6 +44,7 @@
44 2DCAB49DF131E02F3BAF38E1 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; }; 44 2DCAB49DF131E02F3BAF38E1 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
45 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; }; 45 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
46 720060DA25B9912C0014BE3B /* tts_all.caf */ = {isa = PBXFileReference; lastKnownFileType = file; path = tts_all.caf; sourceTree = "<group>"; }; 46 720060DA25B9912C0014BE3B /* tts_all.caf */ = {isa = PBXFileReference; lastKnownFileType = file; path = tts_all.caf; sourceTree = "<group>"; };
  47 + 7206E2DB26200F770055D76E /* 一键订Debug.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "一键订Debug.entitlements"; sourceTree = "<group>"; };
47 72DFBB8C25BA6CBF00EE1E5D /* tts_cancel.caf */ = {isa = PBXFileReference; lastKnownFileType = file; path = tts_cancel.caf; sourceTree = "<group>"; }; 48 72DFBB8C25BA6CBF00EE1E5D /* tts_cancel.caf */ = {isa = PBXFileReference; lastKnownFileType = file; path = tts_cancel.caf; sourceTree = "<group>"; };
48 72DFBB8D25BA6CBF00EE1E5D /* tts_pay.caf */ = {isa = PBXFileReference; lastKnownFileType = file; path = tts_pay.caf; sourceTree = "<group>"; }; 49 72DFBB8D25BA6CBF00EE1E5D /* tts_pay.caf */ = {isa = PBXFileReference; lastKnownFileType = file; path = tts_pay.caf; sourceTree = "<group>"; };
49 72DFBB8E25BA6CBF00EE1E5D /* tts_new.caf */ = {isa = PBXFileReference; lastKnownFileType = file; path = tts_new.caf; sourceTree = "<group>"; }; 50 72DFBB8E25BA6CBF00EE1E5D /* tts_new.caf */ = {isa = PBXFileReference; lastKnownFileType = file; path = tts_new.caf; sourceTree = "<group>"; };
@@ -138,6 +139,7 @@ @@ -138,6 +139,7 @@
138 97C146F01CF9000F007C117D /* Runner */ = { 139 97C146F01CF9000F007C117D /* Runner */ = {
139 isa = PBXGroup; 140 isa = PBXGroup;
140 children = ( 141 children = (
  142 + 7206E2DB26200F770055D76E /* 一键订Debug.entitlements */,
141 EE6AF9002457DC0C0005E3B9 /* Runner.entitlements */, 143 EE6AF9002457DC0C0005E3B9 /* Runner.entitlements */,
142 EE6AF8FF2457DB720005E3B9 /* RunnerProfile.entitlements */, 144 EE6AF8FF2457DB720005E3B9 /* RunnerProfile.entitlements */,
143 97C146FA1CF9000F007C117D /* Main.storyboard */, 145 97C146FA1CF9000F007C117D /* Main.storyboard */,
@@ -611,7 +613,7 @@ @@ -611,7 +613,7 @@
611 buildSettings = { 613 buildSettings = {
612 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 614 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
613 CLANG_ENABLE_MODULES = YES; 615 CLANG_ENABLE_MODULES = YES;
614 - CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; 616 + CODE_SIGN_ENTITLEMENTS = "Runner/一键订Debug.entitlements";
615 CODE_SIGN_IDENTITY = "iPhone Developer"; 617 CODE_SIGN_IDENTITY = "iPhone Developer";
616 CODE_SIGN_STYLE = Automatic; 618 CODE_SIGN_STYLE = Automatic;
617 CURRENT_PROJECT_VERSION = 170; 619 CURRENT_PROJECT_VERSION = 170;
@@ -4,6 +4,10 @@ @@ -4,6 +4,10 @@
4 <dict> 4 <dict>
5 <key>aps-environment</key> 5 <key>aps-environment</key>
6 <string>development</string> 6 <string>development</string>
  7 + <key>com.apple.developer.applesignin</key>
  8 + <array>
  9 + <string>Default</string>
  10 + </array>
7 <key>com.apple.developer.associated-domains</key> 11 <key>com.apple.developer.associated-domains</key>
8 <array> 12 <array>
9 <string>applinks:xt04.colorcun.com</string> 13 <string>applinks:xt04.colorcun.com</string>
@@ -4,6 +4,10 @@ @@ -4,6 +4,10 @@
4 <dict> 4 <dict>
5 <key>aps-environment</key> 5 <key>aps-environment</key>
6 <string>development</string> 6 <string>development</string>
  7 + <key>com.apple.developer.applesignin</key>
  8 + <array>
  9 + <string>Default</string>
  10 + </array>
7 <key>com.apple.developer.associated-domains</key> 11 <key>com.apple.developer.associated-domains</key>
8 <array> 12 <array>
9 <string>applinks:xt04.colorcun.com</string> 13 <string>applinks:xt04.colorcun.com</string>
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
  3 +<plist version="1.0">
  4 +<dict>
  5 + <key>aps-environment</key>
  6 + <string>development</string>
  7 + <key>com.apple.developer.applesignin</key>
  8 + <array>
  9 + <string>Default</string>
  10 + </array>
  11 + <key>com.apple.developer.associated-domains</key>
  12 + <array>
  13 + <string>applinks:xt04.colorcun.com</string>
  14 + </array>
  15 +</dict>
  16 +</plist>
@@ -18,6 +18,7 @@ import 'package:one_key/provider/message_dialog_model.dart'; @@ -18,6 +18,7 @@ import 'package:one_key/provider/message_dialog_model.dart';
18 import 'package:intl/date_symbol_data_local.dart'; 18 import 'package:intl/date_symbol_data_local.dart';
19 import 'package:one_key/provider/notebook_detail_model.dart'; 19 import 'package:one_key/provider/notebook_detail_model.dart';
20 import 'package:one_key/provider/online_check_edit_provider.dart'; 20 import 'package:one_key/provider/online_check_edit_provider.dart';
  21 +import 'package:one_key/provider/other_login_provider.dart';
21 import 'package:one_key/provider/tools.dart'; 22 import 'package:one_key/provider/tools.dart';
22 import 'package:one_key/provider/upload_img_provider.dart'; 23 import 'package:one_key/provider/upload_img_provider.dart';
23 import 'package:one_key/utils/navigator_util.dart'; 24 import 'package:one_key/utils/navigator_util.dart';
@@ -155,7 +156,8 @@ class MyAppState extends State<MyApp> { @@ -155,7 +156,8 @@ class MyAppState extends State<MyApp> {
155 textTheme: 156 textTheme:
156 TextTheme(overline: TextStyle(decoration: TextDecoration.none)), 157 TextTheme(overline: TextStyle(decoration: TextDecoration.none)),
157 tooltipTheme: TooltipThemeData(verticalOffset: -100000)), 158 tooltipTheme: TooltipThemeData(verticalOffset: -100000)),
158 - home: LoginPage(), 159 + home: ChangeNotifierProvider<OtherLoginProvider>(
  160 + create: (_) => OtherLoginProvider(), child: LoginPage()),
159 onGenerateRoute: App.router.generator, 161 onGenerateRoute: App.router.generator,
160 ); 162 );
161 } 163 }
  1 +import 'package:json_annotation/json_annotation.dart';
  2 +
  3 +part 'checkbind_phone_model.g.dart';
  4 +
  5 +
  6 +@JsonSerializable()
  7 + class CheckbindPhoneModel extends Object {
  8 +
  9 + @JsonKey(name: 'ret')
  10 + int ret;
  11 +
  12 + @JsonKey(name: 'data')
  13 + CheckbindPhoneSunModel data;
  14 +
  15 + @JsonKey(name: 'msg')
  16 + String msg;
  17 +
  18 + CheckbindPhoneModel(this.ret,this.data,this.msg,);
  19 +
  20 + factory CheckbindPhoneModel.fromJson(Map<String, dynamic> srcJson) => _$CheckbindPhoneModelFromJson(srcJson);
  21 +
  22 + Map<String, dynamic> toJson() => _$CheckbindPhoneModelToJson(this);
  23 +
  24 +}
  25 +
  26 +
  27 +@JsonSerializable()
  28 + class CheckbindPhoneSunModel extends Object {
  29 +
  30 + @JsonKey(name: 'id')
  31 + String id;
  32 +
  33 + @JsonKey(name: 'nick_name')
  34 + String nickName;
  35 +
  36 + @JsonKey(name: 'role_id')
  37 + String roleId;
  38 +
  39 + @JsonKey(name: 'auth_user_id')
  40 + String authUserId;
  41 +
  42 + @JsonKey(name: 'seat_openid')
  43 + String seatOpenid;
  44 +
  45 + @JsonKey(name: 'sellerid')
  46 + String sellerid;
  47 +
  48 + @JsonKey(name: 'seller_code')
  49 + String sellerCode;
  50 +
  51 + @JsonKey(name: 'account')
  52 + String account;
  53 +
  54 + @JsonKey(name: 'phone')
  55 + String phone;
  56 +
  57 + @JsonKey(name: 'user_token')
  58 + String userToken;
  59 +
  60 + @JsonKey(name: 'registrationId')
  61 + String registrationId;
  62 +
  63 + @JsonKey(name: 'connection_id')
  64 + String connectionId;
  65 +
  66 + @JsonKey(name: 'alias')
  67 + String alias;
  68 +
  69 + @JsonKey(name: 'password')
  70 + String password;
  71 +
  72 + @JsonKey(name: 'is_on_call')
  73 + String isOnCall;
  74 +
  75 + @JsonKey(name: 'cdate')
  76 + String cdate;
  77 +
  78 + CheckbindPhoneSunModel(this.id,this.nickName,this.roleId,this.authUserId,this.seatOpenid,this.sellerid,this.sellerCode,this.account,this.phone,this.userToken,this.registrationId,this.connectionId,this.alias,this.password,this.isOnCall,this.cdate,);
  79 +
  80 + factory CheckbindPhoneSunModel.fromJson(Map<String, dynamic> srcJson) => _$CheckbindPhoneSunModelFromJson(srcJson);
  81 +
  82 + Map<String, dynamic> toJson() => _$CheckbindPhoneSunModelToJson(this);
  83 +
  84 +}
  85 +
  86 +
  1 +// GENERATED CODE - DO NOT MODIFY BY HAND
  2 +
  3 +part of 'checkbind_phone_model.dart';
  4 +
  5 +// **************************************************************************
  6 +// JsonSerializableGenerator
  7 +// **************************************************************************
  8 +
  9 +CheckbindPhoneModel _$CheckbindPhoneModelFromJson(Map<String, dynamic> json) {
  10 + return CheckbindPhoneModel(
  11 + json['ret'] as int,
  12 + json['data'] == null
  13 + ? null
  14 + : CheckbindPhoneSunModel.fromJson(
  15 + json['data'] as Map<String, dynamic>),
  16 + json['msg'] as String);
  17 +}
  18 +
  19 +Map<String, dynamic> _$CheckbindPhoneModelToJson(
  20 + CheckbindPhoneModel instance) =>
  21 + <String, dynamic>{
  22 + 'ret': instance.ret,
  23 + 'data': instance.data,
  24 + 'msg': instance.msg
  25 + };
  26 +
  27 +CheckbindPhoneSunModel _$CheckbindPhoneSunModelFromJson(
  28 + Map<String, dynamic> json) {
  29 + return CheckbindPhoneSunModel(
  30 + json['id'] as String,
  31 + json['nick_name'] as String,
  32 + json['role_id'] as String,
  33 + json['auth_user_id'] as String,
  34 + json['seat_openid'] as String,
  35 + json['sellerid'] as String,
  36 + json['seller_code'] as String,
  37 + json['account'] as String,
  38 + json['phone'] as String,
  39 + json['user_token'] as String,
  40 + json['registrationId'] as String,
  41 + json['connection_id'] as String,
  42 + json['alias'] as String,
  43 + json['password'] as String,
  44 + json['is_on_call'] as String,
  45 + json['cdate'] as String);
  46 +}
  47 +
  48 +Map<String, dynamic> _$CheckbindPhoneSunModelToJson(
  49 + CheckbindPhoneSunModel instance) =>
  50 + <String, dynamic>{
  51 + 'id': instance.id,
  52 + 'nick_name': instance.nickName,
  53 + 'role_id': instance.roleId,
  54 + 'auth_user_id': instance.authUserId,
  55 + 'seat_openid': instance.seatOpenid,
  56 + 'sellerid': instance.sellerid,
  57 + 'seller_code': instance.sellerCode,
  58 + 'account': instance.account,
  59 + 'phone': instance.phone,
  60 + 'user_token': instance.userToken,
  61 + 'registrationId': instance.registrationId,
  62 + 'connection_id': instance.connectionId,
  63 + 'alias': instance.alias,
  64 + 'password': instance.password,
  65 + 'is_on_call': instance.isOnCall,
  66 + 'cdate': instance.cdate
  67 + };
@@ -9,4 +9,5 @@ class StoreInfo { @@ -9,4 +9,5 @@ class StoreInfo {
9 String phone; //接单电话 9 String phone; //接单电话
10 String photoFront; //门头照片 10 String photoFront; //门头照片
11 List enviromentList; //店铺环境 11 List enviromentList; //店铺环境
  12 + String sellerid; //店铺id
12 } 13 }
  1 +class UserCreateStore {
  2 + UserCreateStore();
  3 +
  4 + String id; //uid
  5 + String nick_name; //
  6 + String role_id; //
  7 + String role_name;
  8 + String sellerid; //
  9 + String seller_code; //
  10 + String account; //
  11 +}
@@ -93,5 +93,10 @@ class HttpUrl { @@ -93,5 +93,10 @@ class HttpUrl {
93 "?service=App.User.CheckSellerAcc"; //APP微信登录后检测是否存在商家 93 "?service=App.User.CheckSellerAcc"; //APP微信登录后检测是否存在商家
94 static const String app_sendsms_wxSendSms = 94 static const String app_sendsms_wxSendSms =
95 "?service=App.SendSMS.WxSendSms"; //预订安排发短信 95 "?service=App.SendSMS.WxSendSms"; //预订安排发短信
96 - 96 + static const String add_seller_info =
  97 + "?service=App.Seller.AddSeller"; //添加商家信息
  98 + static const String get_seller_user_info =
  99 + "?service=App.Seller.GetUserData"; //添加商家信息和当前登录人的信息
  100 + static const String check_bind_phone =
  101 + "?service=App.User.CheckbindPhone"; //APP微信登录后检测是否绑定过手机号
97 } 102 }
  1 +import 'package:flutter/material.dart';
  2 +import 'package:flutter_screenutil/screenutil.dart';
  3 +import 'package:one_key/app.dart';
  4 +import 'package:one_key/models/get_seller_info_model.dart';
  5 +import 'package:one_key/models/user.dart';
  6 +import 'package:one_key/provider/book_set_time_model.dart';
  7 +import 'package:one_key/provider/create_store_model.dart';
  8 +import 'package:one_key/provider/user_model.dart';
  9 +import 'package:one_key/res/colors.dart';
  10 +import 'package:one_key/utils/utils.dart';
  11 +import 'package:one_key/widgets/round_button.dart';
  12 +import 'package:one_key/widgets/system_app_bar.dart';
  13 +import 'package:one_key/widgets/v_empty_view.dart';
  14 +import 'package:provider/provider.dart';
  15 +
  16 +class CompleteCreateStorePage extends StatefulWidget {
  17 + CompleteCreateStorePage({Key key}) : super(key: key);
  18 +
  19 + @override
  20 + _CompleteCreateStorePageState createState() =>
  21 + _CompleteCreateStorePageState();
  22 +}
  23 +
  24 +class _CompleteCreateStorePageState extends State<CompleteCreateStorePage> {
  25 + ///进入某个店铺
  26 + // _loginStore(context, CheckSellerAccSunModel sunModel) {
  27 + // UserModel userModel = Provider.of<UserModel>(context, listen: false);
  28 + // Map<String, dynamic> seller = sunModel.toJson();
  29 + // Map<String, dynamic> userMap = {
  30 + // "openid": seller['uid'],
  31 + // "account": seller['account'],
  32 + // "role_name": seller['role_name'],
  33 + // "sellerid": seller['id'],
  34 + // "sellercode": seller['seller_code'],
  35 + // "sellername": seller['sellername'],
  36 + // "sellerphone": seller['seller_tel'],
  37 + // "sellerAddr": '',
  38 + // "scatter": 0,
  39 + // "room": 0,
  40 + // "cassette": 0,
  41 + // "morning": "",
  42 + // "noon": "",
  43 + // "night": "",
  44 + // };
  45 + // userModel.saveUserInfo(User.fromJson(userMap));
  46 + // userModel.getSellerInfo(
  47 + // context,
  48 + // {"seller_id": seller['id'], "seller_openid": seller['openid']},
  49 + // userMap);
  50 + // }
  51 +
  52 + ///通过sellerid获取店铺和当前登录人的基本信息
  53 + _getSellerAndUserData() async {
  54 + CreateStoreModel createStoreModel =
  55 + Provider.of<CreateStoreModel>(context, listen: false);
  56 + Map<String, String> params = {
  57 + "sellerid": createStoreModel.storeInfo.sellerid,
  58 + "openid": App.sp.getString("openid")
  59 + };
  60 +
  61 + await createStoreModel.getStoreInfo(context, params);
  62 + GetSellerInfoSunModel infoSunModel =
  63 + await createStoreModel.getSellerById(context);
  64 + UserModel userModel = Provider.of<UserModel>(context, listen: false);
  65 + Map<String, dynamic> seller = infoSunModel.data.toJson();
  66 + Map<String, dynamic> userMap = {
  67 + "openid": createStoreModel.userCreateStore.id,
  68 + "account": createStoreModel.userCreateStore.account,
  69 + "role_name": createStoreModel.userCreateStore.role_name,
  70 + "sellerid": createStoreModel.userCreateStore.sellerid,
  71 + "sellercode": createStoreModel.userCreateStore.seller_code,
  72 + "sellername": seller['sellername'],
  73 + "sellerphone": seller['phone'],
  74 + "sellerAddr": '',
  75 + "scatter": 0,
  76 + "room": 0,
  77 + "cassette": 0,
  78 + "morning": "",
  79 + "noon": "",
  80 + "night": "",
  81 + };
  82 + userModel.saveUserInfo(User.fromJson(userMap));
  83 + userModel.getSellerInfo(
  84 + context,
  85 + {"seller_id": seller['id'], "seller_openid": seller['openid']},
  86 + userMap);
  87 + }
  88 +
  89 + @override
  90 + Widget build(BuildContext context) {
  91 + return Scaffold(
  92 + backgroundColor: Colors.white,
  93 + appBar: SystemAppBar(
  94 + '',
  95 + onTap: () {
  96 + Navigator.pop(context);
  97 + },
  98 + ),
  99 + body: InkWell(
  100 + onTap: () {
  101 + FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
  102 + },
  103 + child: Container(
  104 + padding: EdgeInsets.symmetric(
  105 + horizontal: ScreenUtil().setWidth(70),
  106 + vertical: ScreenUtil().setWidth(80)),
  107 + child: SingleChildScrollView(
  108 + child: Column(
  109 + crossAxisAlignment: CrossAxisAlignment.center,
  110 + children: [
  111 + Image.asset(
  112 + Utils.getImgPath('complete'),
  113 + width: ScreenUtil().setWidth(120),
  114 + ),
  115 + VEmptyView(60),
  116 + Text(
  117 + '店铺已创建成功',
  118 + style: TextStyle(
  119 + fontWeight: FontWeight.bold,
  120 + fontSize: ScreenUtil().setSp(32),
  121 + color: MyColours.color_333333),
  122 + ),
  123 + VEmptyView(220),
  124 + RoundButton(
  125 + radius: ScreenUtil().setWidth(10),
  126 + text: '继续创建桌位',
  127 + fontSize: 34,
  128 + gradientStart: MyColours.color_2AB5B7,
  129 + gradientEnd: MyColours.color_2AB5B7,
  130 + onPressed: () {},
  131 + isBold: false,
  132 + ),
  133 + VEmptyView(20),
  134 + RoundButton(
  135 + radius: ScreenUtil().setWidth(10),
  136 + text: '进入店铺',
  137 + fontSize: 34,
  138 + textColor: MyColours.color_2AB5B7,
  139 + gradientStart: Colors.white,
  140 + gradientEnd: Colors.white,
  141 + borderColor: MyColours.color_2AB5B7,
  142 + onPressed: () {
  143 + _getSellerAndUserData();
  144 + },
  145 + isBold: false,
  146 + ),
  147 + ])))));
  148 + }
  149 +}
@@ -102,48 +102,48 @@ class _EnterStoreAddressPageState extends State<EnterStoreAddressPage> { @@ -102,48 +102,48 @@ class _EnterStoreAddressPageState extends State<EnterStoreAddressPage> {
102 )), 102 )),
103 ), 103 ),
104 ), 104 ),
105 - VEmptyView(20),  
106 - TextField(  
107 - controller: _controller,  
108 - // textAlignVertical: TextAlignVertical.bottom,  
109 - maxLines: 1,  
110 - // //光标颜色  
111 - // cursorColor:  
112 - // widget.isSelect ? Colors.white : MyColours.color_199095,  
113 - //输入文本的样式  
114 - style: TextStyle(  
115 - color: MyColours.color_333333,  
116 - fontSize: ScreenUtil().setSp(28),  
117 - ),  
118 - // focusNode: _codeNode,  
119 - decoration: InputDecoration(  
120 - contentPadding: EdgeInsets.symmetric(  
121 - vertical: ScreenUtil().setWidth(32),  
122 - horizontal: ScreenUtil().setWidth(40)),  
123 - border: OutlineInputBorder(),  
124 - hintText: '请输入详细地址(选填)',  
125 - hintStyle: TextStyle(  
126 - color: MyColours.color_999999,  
127 - fontSize: ScreenUtil().setSp(28),  
128 - ),  
129 - enabledBorder: OutlineInputBorder(  
130 - borderSide: BorderSide(  
131 - color: MyColours.color_bff6f7,  
132 - width: ScreenUtil().setWidth(2))),  
133 - focusedBorder: OutlineInputBorder(  
134 - borderSide: BorderSide(  
135 - color: MyColours.color_bff6f7,  
136 - width: ScreenUtil().setWidth(2))),  
137 - ),  
138 - onChanged: (value) {  
139 - createStoreModel.storeInfo.addressDetail = value;  
140 - },  
141 - onEditingComplete: () {  
142 - FocusScope.of(context)  
143 - .requestFocus(FocusNode()); //点击空白处隐藏键盘  
144 - },  
145 - keyboardType: TextInputType.text,  
146 - ), 105 + // VEmptyView(20),
  106 + // TextField(
  107 + // controller: _controller,
  108 + // // textAlignVertical: TextAlignVertical.bottom,
  109 + // maxLines: 1,
  110 + // // //光标颜色
  111 + // // cursorColor:
  112 + // // widget.isSelect ? Colors.white : MyColours.color_199095,
  113 + // //输入文本的样式
  114 + // style: TextStyle(
  115 + // color: MyColours.color_333333,
  116 + // fontSize: ScreenUtil().setSp(28),
  117 + // ),
  118 + // // focusNode: _codeNode,
  119 + // decoration: InputDecoration(
  120 + // contentPadding: EdgeInsets.symmetric(
  121 + // vertical: ScreenUtil().setWidth(32),
  122 + // horizontal: ScreenUtil().setWidth(40)),
  123 + // border: OutlineInputBorder(),
  124 + // hintText: '请输入详细地址(选填)',
  125 + // hintStyle: TextStyle(
  126 + // color: MyColours.color_999999,
  127 + // fontSize: ScreenUtil().setSp(28),
  128 + // ),
  129 + // enabledBorder: OutlineInputBorder(
  130 + // borderSide: BorderSide(
  131 + // color: MyColours.color_bff6f7,
  132 + // width: ScreenUtil().setWidth(2))),
  133 + // focusedBorder: OutlineInputBorder(
  134 + // borderSide: BorderSide(
  135 + // color: MyColours.color_bff6f7,
  136 + // width: ScreenUtil().setWidth(2))),
  137 + // ),
  138 + // onChanged: (value) {
  139 + // createStoreModel.storeInfo.addressDetail = value;
  140 + // },
  141 + // onEditingComplete: () {
  142 + // FocusScope.of(context)
  143 + // .requestFocus(FocusNode()); //点击空白处隐藏键盘
  144 + // },
  145 + // keyboardType: TextInputType.text,
  146 + // ),
147 VEmptyView(160), 147 VEmptyView(160),
148 RoundButton( 148 RoundButton(
149 text: '下一步', 149 text: '下一步',
@@ -154,7 +154,8 @@ class _EnterStoreAddressPageState extends State<EnterStoreAddressPage> { @@ -154,7 +154,8 @@ class _EnterStoreAddressPageState extends State<EnterStoreAddressPage> {
154 fontSize: 28, 154 fontSize: 28,
155 isBold: false, 155 isBold: false,
156 onPressed: () { 156 onPressed: () {
157 - NavigatorUtil.goEnterStorePositionPage(context); 157 + NavigatorUtil.goEnterStorePhonePage(context);
  158 + // NavigatorUtil.goEnterStorePositionPage(context);
158 }, 159 },
159 ) 160 )
160 ]))))); 161 ])))));
1 import 'package:flutter/material.dart'; 1 import 'package:flutter/material.dart';
2 import 'package:flutter_screenutil/screenutil.dart'; 2 import 'package:flutter_screenutil/screenutil.dart';
  3 +import 'package:one_key/app.dart';
3 import 'package:one_key/pages/create_store/video_widget.dart'; 4 import 'package:one_key/pages/create_store/video_widget.dart';
4 import 'package:one_key/pages/online_check/img_picker_widget.dart'; 5 import 'package:one_key/pages/online_check/img_picker_widget.dart';
  6 +import 'package:one_key/provider/create_store_model.dart';
5 import 'package:one_key/provider/upload_img_provider.dart'; 7 import 'package:one_key/provider/upload_img_provider.dart';
6 import 'package:one_key/res/colors.dart'; 8 import 'package:one_key/res/colors.dart';
7 import 'package:one_key/utils/navigator_util.dart'; 9 import 'package:one_key/utils/navigator_util.dart';
8 import 'package:one_key/utils/upload_image_util.dart'; 10 import 'package:one_key/utils/upload_image_util.dart';
  11 +import 'package:one_key/utils/utils.dart';
9 import 'package:one_key/widgets/round_button.dart'; 12 import 'package:one_key/widgets/round_button.dart';
10 import 'package:one_key/widgets/system_app_bar.dart'; 13 import 'package:one_key/widgets/system_app_bar.dart';
11 import 'package:one_key/widgets/v_empty_view.dart'; 14 import 'package:one_key/widgets/v_empty_view.dart';
@@ -19,10 +22,12 @@ class EnterStoreEnvironmentPage extends StatefulWidget { @@ -19,10 +22,12 @@ class EnterStoreEnvironmentPage extends StatefulWidget {
19 _EnterStoreEnvironmentPageState(); 22 _EnterStoreEnvironmentPageState();
20 } 23 }
21 24
22 -class _EnterStoreEnvironmentPageState extends State<EnterStoreEnvironmentPage> with AutomaticKeepAliveClientMixin { 25 +class _EnterStoreEnvironmentPageState extends State<EnterStoreEnvironmentPage>
  26 + with AutomaticKeepAliveClientMixin {
23 @override 27 @override
24 bool get wantKeepAlive => true; 28 bool get wantKeepAlive => true;
25 ScrollController _controller = ScrollController(); 29 ScrollController _controller = ScrollController();
  30 +
26 @override 31 @override
27 Widget build(BuildContext context) { 32 Widget build(BuildContext context) {
28 return Scaffold( 33 return Scaffold(
@@ -76,11 +81,11 @@ class _EnterStoreEnvironmentPageState extends State<EnterStoreEnvironmentPage> w @@ -76,11 +81,11 @@ class _EnterStoreEnvironmentPageState extends State<EnterStoreEnvironmentPage> w
76 fontSize: 28, 81 fontSize: 28,
77 isBold: false, 82 isBold: false,
78 onPressed: () { 83 onPressed: () {
  84 + // _addStoreInfo();
79 // NavigatorUtil.goEnterStoreAddressPage( 85 // NavigatorUtil.goEnterStoreAddressPage(
80 // context); 86 // context);
81 }, 87 },
82 )) 88 ))
83 ]))))); 89 ])))));
84 - ;  
85 } 90 }
86 } 91 }
@@ -6,6 +6,7 @@ import 'package:one_key/provider/user_model.dart'; @@ -6,6 +6,7 @@ import 'package:one_key/provider/user_model.dart';
6 import 'package:one_key/res/colors.dart'; 6 import 'package:one_key/res/colors.dart';
7 import 'package:one_key/route/route_handles.dart'; 7 import 'package:one_key/route/route_handles.dart';
8 import 'package:one_key/utils/navigator_util.dart'; 8 import 'package:one_key/utils/navigator_util.dart';
  9 +import 'package:one_key/utils/utils.dart';
9 import 'package:one_key/widgets/round_button.dart'; 10 import 'package:one_key/widgets/round_button.dart';
10 import 'package:one_key/widgets/system_app_bar.dart'; 11 import 'package:one_key/widgets/system_app_bar.dart';
11 import 'package:one_key/widgets/v_empty_view.dart'; 12 import 'package:one_key/widgets/v_empty_view.dart';
@@ -27,6 +28,54 @@ class _EnterStorePhonePageState extends State<EnterStorePhonePage> { @@ -27,6 +28,54 @@ class _EnterStorePhonePageState extends State<EnterStorePhonePage> {
27 super.initState(); 28 super.initState();
28 } 29 }
29 30
  31 + ///添加商家信息
  32 + _addStoreInfo() async {
  33 + CreateStoreModel createStoreModel =
  34 + Provider.of<CreateStoreModel>(context, listen: false);
  35 + // UploadImageProvider uploadImageProvider =
  36 + // Provider.of<UploadImageProvider>(context, listen: false);
  37 + if (createStoreModel.storeInfo.name == null ||
  38 + createStoreModel.storeInfo.name.trim().length == 0) {
  39 + Utils.showToast('请填写店铺名称!');
  40 + return;
  41 + }
  42 + if (createStoreModel.storeInfo.address == null ||
  43 + createStoreModel.storeInfo.address.trim().length == 0) {
  44 + Utils.showToast('请选择店铺地址!');
  45 + return;
  46 + }
  47 + if (createStoreModel.storeInfo.phone == null ||
  48 + createStoreModel.storeInfo.phone.trim().length == 0) {
  49 + Utils.showToast('请填写店铺接单电话!');
  50 + return;
  51 + }
  52 + Map<String, String> params = {
  53 + "name": createStoreModel.storeInfo.name,
  54 + "phone": createStoreModel.storeInfo.phone,
  55 + "map_address": createStoreModel.storeInfo.address,
  56 + "long": createStoreModel.storeInfo.lng.toString(),
  57 + "lat": createStoreModel.storeInfo.lat.toString(),
  58 + };
  59 + // print(App.sp.getString("unionid"));
  60 + // if (uploadImageProvider.imageListFront.length > 0) {
  61 + // params["file"] = uploadImageProvider.imageListFront[0].qiniuUrl;
  62 + // }
  63 + // if (uploadImageProvider.imageListDenvironment.length > 0) {
  64 + // List<String> temp = [];
  65 + // for (var i = 0;
  66 + // i < uploadImageProvider.imageListDenvironment.length;
  67 + // i++) {
  68 + // temp.add(uploadImageProvider.imageListDenvironment[i].qiniuUrl);
  69 + // }
  70 + // params["image"] = Utils.listToStringEnglish(temp);
  71 + // }
  72 + bool success = await createStoreModel.addStoreInfo(context, params);
  73 + if (success) {
  74 + //跳转至完成页面
  75 + NavigatorUtil.goCompleteStorePage(context);
  76 + }
  77 + }
  78 +
30 @override 79 @override
31 Widget build(BuildContext context) { 80 Widget build(BuildContext context) {
32 return Scaffold( 81 return Scaffold(
@@ -102,7 +151,7 @@ class _EnterStorePhonePageState extends State<EnterStorePhonePage> { @@ -102,7 +151,7 @@ class _EnterStorePhonePageState extends State<EnterStorePhonePage> {
102 }), 151 }),
103 VEmptyView(160), 152 VEmptyView(160),
104 RoundButton( 153 RoundButton(
105 - text: '下一步', 154 + text: '完成',
106 gradientStart: MyColours.color_199095, 155 gradientStart: MyColours.color_199095,
107 gradientEnd: MyColours.color_199095, 156 gradientEnd: MyColours.color_199095,
108 // borderColor: MyColours.color_999999, 157 // borderColor: MyColours.color_999999,
@@ -110,7 +159,8 @@ class _EnterStorePhonePageState extends State<EnterStorePhonePage> { @@ -110,7 +159,8 @@ class _EnterStorePhonePageState extends State<EnterStorePhonePage> {
110 fontSize: 28, 159 fontSize: 28,
111 isBold: false, 160 isBold: false,
112 onPressed: () { 161 onPressed: () {
113 - NavigatorUtil.goEnterStoreFrontPhotoPage(context); 162 + _addStoreInfo();
  163 + // NavigatorUtil.goEnterStoreFrontPhotoPage(context);
114 }, 164 },
115 ) 165 )
116 ]))))); 166 ])))));
@@ -35,6 +35,7 @@ class _MapChoicePointPageState extends State<MapChoicePointPage> { @@ -35,6 +35,7 @@ class _MapChoicePointPageState extends State<MapChoicePointPage> {
35 @override 35 @override
36 void initState() { 36 void initState() {
37 super.initState(); 37 super.initState();
  38 +
38 WidgetsBinding.instance.addPostFrameCallback((_) async { 39 WidgetsBinding.instance.addPostFrameCallback((_) async {
39 _requestLocationPermission(); 40 _requestLocationPermission();
40 }); 41 });
@@ -42,7 +43,7 @@ class _MapChoicePointPageState extends State<MapChoicePointPage> { @@ -42,7 +43,7 @@ class _MapChoicePointPageState extends State<MapChoicePointPage> {
42 43
43 /// 获取定位权限 44 /// 获取定位权限
44 _requestLocationPermission() async { 45 _requestLocationPermission() async {
45 - final location = await AmapLocation.instance.fetchLocation( 46 + Location location = await AmapLocation.instance.fetchLocation(
46 // needAddress: true, 47 // needAddress: true,
47 // mode: LocationAccuracy.High, 48 // mode: LocationAccuracy.High,
48 // timeout: Duration(seconds: 10) 49 // timeout: Duration(seconds: 10)
1 import 'dart:async'; 1 import 'dart:async';
2 2
3 -import 'package:common_utils/common_utils.dart';  
4 import 'package:flutter/material.dart'; 3 import 'package:flutter/material.dart';
5 import 'package:flutter_screenutil/screenutil.dart'; 4 import 'package:flutter_screenutil/screenutil.dart';
6 -import 'package:one_key/app.dart';  
7 import 'package:one_key/models/store_info.dart'; 5 import 'package:one_key/models/store_info.dart';
8 import 'package:one_key/provider/create_store_model.dart'; 6 import 'package:one_key/provider/create_store_model.dart';
9 import 'package:one_key/provider/other_login_provider.dart'; 7 import 'package:one_key/provider/other_login_provider.dart';
@@ -18,7 +16,8 @@ import 'package:one_key/widgets/v_empty_view.dart'; @@ -18,7 +16,8 @@ import 'package:one_key/widgets/v_empty_view.dart';
18 import 'package:provider/provider.dart'; 16 import 'package:provider/provider.dart';
19 17
20 class BindingPhone extends StatefulWidget { 18 class BindingPhone extends StatefulWidget {
21 - BindingPhone({Key key}) : super(key: key); 19 + final bool wechat;
  20 + BindingPhone({Key key, this.wechat = true}) : super(key: key);
22 21
23 @override 22 @override
24 _BindingPhoneState createState() => _BindingPhoneState(); 23 _BindingPhoneState createState() => _BindingPhoneState();
@@ -272,34 +271,48 @@ class _BindingPhoneState extends State<BindingPhone> { @@ -272,34 +271,48 @@ class _BindingPhoneState extends State<BindingPhone> {
272 fontSize: 34, 271 fontSize: 34,
273 isBold: false, 272 isBold: false,
274 onPressed: () async { 273 onPressed: () async {
275 - // if (phone == null || phone.trim().length == 0) {  
276 - // Utils.showToast('请输入手机号码');  
277 - // return;  
278 - // }  
279 - // if (code == null || code.trim().length == 0) {  
280 - // Utils.showToast('请输入验证码');  
281 - // return;  
282 - // }  
283 - // if (model.code != null && !codeEnabled) {  
284 - // Utils.showToast('验证码已失效,请重新获取');  
285 - // return;  
286 - // }  
287 - // if (model.code == null) {  
288 - // Utils.showToast('请获取验证码');  
289 - // return;  
290 - // }  
291 - // if (model.code != code) {  
292 - // Utils.showToast('您输入的验证码不正确,请重新输入');  
293 - // return;  
294 - // }  
295 - CreateStoreModel createStoreModel =  
296 - Provider.of<CreateStoreModel>(context,  
297 - listen: false); 274 + if (phone == null || phone.trim().length == 0) {
  275 + Utils.showToast('请输入手机号码');
  276 + return;
  277 + }
  278 + if (code == null || code.trim().length == 0) {
  279 + Utils.showToast('请输入验证码');
  280 + return;
  281 + }
  282 + if (model.code != null && !codeEnabled) {
  283 + Utils.showToast('验证码已失效,请重新获取');
  284 + return;
  285 + }
  286 + if (model.code == null) {
  287 + Utils.showToast('请获取验证码');
  288 + return;
  289 + }
  290 + if (model.code != code) {
  291 + Utils.showToast('您输入的验证码不正确,请重新输入');
  292 + return;
  293 + }
  294 + if (widget.wechat) {
  295 + CreateStoreModel createStoreModel =
  296 + Provider.of<CreateStoreModel>(context,
  297 + listen: false);
298 298
299 - createStoreModel.storeInfo = StoreInfo();  
300 - //新建店铺默认接单电话号码  
301 - createStoreModel.storeInfo.phone = phone;  
302 - NavigatorUtil.goIfNeedCreateStorePage(context); 299 + createStoreModel.storeInfo = StoreInfo();
  300 + //新建店铺默认接单电话号码
  301 + createStoreModel.storeInfo.phone = phone;
  302 + NavigatorUtil.goIfNeedCreateStorePage(
  303 + context);
  304 + } else {
  305 + Map<String, String> params = {
  306 + "seller_code": '001297',
  307 + "alias": "ssahdahgdafgahjkhakjgh",
  308 + "account": "0001",
  309 + "password": "123456"
  310 + };
  311 + UserModel userModel = UserModel();
  312 + userModel
  313 + .login(context, params)
  314 + .then((value) {});
  315 + }
303 }, 316 },
304 ) 317 )
305 318
@@ -94,7 +94,8 @@ class _IfNeedCreateStoreState extends State<IfNeedCreateStore> { @@ -94,7 +94,8 @@ class _IfNeedCreateStoreState extends State<IfNeedCreateStore> {
94 Navigator.pop(context); 94 Navigator.pop(context);
95 }, 95 },
96 ), 96 ),
97 - body: Padding( 97 + body: Container(
  98 + // margin: EdgeInsets.only(bottom: ScreenUtil().setWidth(40)),
98 padding: 99 padding:
99 EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(70)), 100 EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(70)),
100 child: Consumer<OtherLoginProvider>(builder: (context, model, _) { 101 child: Consumer<OtherLoginProvider>(builder: (context, model, _) {
@@ -171,6 +172,8 @@ class _IfNeedCreateStoreState extends State<IfNeedCreateStore> { @@ -171,6 +172,8 @@ class _IfNeedCreateStoreState extends State<IfNeedCreateStore> {
171 VEmptyView(100), 172 VEmptyView(100),
172 Expanded( 173 Expanded(
173 child: GridView.builder( 174 child: GridView.builder(
  175 + padding: EdgeInsets.only(
  176 + bottom: ScreenUtil().setWidth(50)),
174 // controller: widget.scrollController, 177 // controller: widget.scrollController,
175 // padding: EdgeInsets.only(top: ScreenUtil().getAdapterSize(10)), 178 // padding: EdgeInsets.only(top: ScreenUtil().getAdapterSize(10)),
176 shrinkWrap: true, 179 shrinkWrap: true,
@@ -248,112 +251,3 @@ class _IfNeedCreateStoreState extends State<IfNeedCreateStore> { @@ -248,112 +251,3 @@ class _IfNeedCreateStoreState extends State<IfNeedCreateStore> {
248 }))); 251 })));
249 } 252 }
250 } 253 }
251 -  
252 -// body:  
253 -// return Padding(  
254 -// padding: EdgeInsets.fromLTRB(ScreenUtil().setWidth(40), 0,  
255 -// ScreenUtil().setWidth(40), ScreenUtil().setWidth(40)),  
256 -// child: EasyRefresh.custom(  
257 -// // controller: _controller,  
258 -// slivers: [  
259 -// SliverList(  
260 -// delegate: SliverChildBuilderDelegate(  
261 -// (BuildContext context, int index) {  
262 -// return Container(  
263 -// child: Container(  
264 -// alignment: Alignment.centerLeft,  
265 -// height: ScreenUtil().setWidth(90),  
266 -// child: InkWell(  
267 -// onTap: () {  
268 -// //跳转至新建店铺流程  
269 -// NavigatorUtil.goEnterStoreNamePage(context);  
270 -// },  
271 -// child: Text(  
272 -// '不是我的店铺,我要重新建店',  
273 -// textAlign: TextAlign.center,  
274 -// style: TextStyle(  
275 -// color: MyColours.color_199095,  
276 -// fontSize: ScreenUtil().setSp(30)),  
277 -// ),  
278 -// )),  
279 -// );  
280 -// }, childCount: 1),  
281 -// ),  
282 -// SliverList(  
283 -// delegate: SliverChildBuilderDelegate(  
284 -// (BuildContext context, int index) {  
285 -// return DottedBorder(  
286 -// borderType: BorderType.RRect,  
287 -// radius: Radius.circular(ScreenUtil().setWidth(10)),  
288 -// // padding: EdgeInsets.all(ScreenUtil().setWidth(70)),  
289 -// color: MyColours.color_cccccc,  
290 -// strokeWidth: ScreenUtil().setWidth(2),  
291 -// child: ClipRRect(  
292 -// borderRadius: BorderRadius.all(Radius.circular(12)),  
293 -// child: Container(  
294 -// height: ScreenUtil().setWidth(197 * 2),  
295 -// width: ScreenUtil().setWidth(140 * 2),  
296 -// color: Colors.amber,  
297 -// ),  
298 -// ),  
299 -// );  
300 -// }, childCount: 1),  
301 -// ),  
302 -// SliverList(  
303 -// delegate: SliverChildBuilderDelegate(  
304 -// (BuildContext context, int index) {  
305 -// return ListTile(  
306 -// onTap: () {  
307 -// UserModel userModel = Provider.of<UserModel>(  
308 -// context,  
309 -// listen: false);  
310 -// Map<String, dynamic> seller =  
311 -// model.sellerList[index].toJson();  
312 -// Map<String, dynamic> daily =  
313 -// jsonDecode(model.sellerList[index].daily);  
314 -// Map<String, dynamic> user = {};  
315 -// user['sellerAddr'] = seller['real_address'] ??  
316 -// seller['map_address'];  
317 -// // user['scatter'] = baseResp.data['scatter'];  
318 -// // user['room'] = baseResp.data['room'];  
319 -// // user['cassette'] = baseResp.data['cassette'];  
320 -// user['morning'] = daily['morning'];  
321 -// user['noon'] = daily['noon'];  
322 -// user['night'] = daily['night'];  
323 -// userModel.saveUserInfo(User.fromJson(user));  
324 -// App.sp.setBool("isLogin", true);  
325 -// App.sp.setString("is_call_tel",  
326 -// seller['is_call_tel'].toString());  
327 -// NavigatorUtil.goHomePage(context);  
328 -// },  
329 -// leading: Container(  
330 -// width: ScreenUtil().setWidth(70),  
331 -// height: ScreenUtil().setWidth(70),  
332 -// decoration: BoxDecoration(  
333 -// shape: BoxShape.circle,  
334 -// image: DecorationImage(  
335 -// image: NetworkImage(  
336 -// '${model.sellerList[index].sellerImage}'),  
337 -// fit: BoxFit.cover))),  
338 -// title: Text(  
339 -// '${model.sellerList[index].sellername}',  
340 -// style: TextStyle(  
341 -// color: MyColours.color_333333,  
342 -// fontSize: ScreenUtil().setSp(28),  
343 -// ),  
344 -// ));  
345 -// }, childCount: model.sellerList.length),  
346 -// )  
347 -// ],  
348 -// onRefresh: () async {  
349 -// // offset = 0;  
350 -// // getMessage(showLoading: false);  
351 -// },  
352 -// onLoad: () async {  
353 -// // offset++;  
354 -// // getMessage(showLoading: false);  
355 -// },  
356 -// ));  
357 -// }  
358 -// }));  
359 -// }}  
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; @@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
2 import 'package:flutter_screenutil/screenutil.dart'; 2 import 'package:flutter_screenutil/screenutil.dart';
3 import 'package:one_key/models/check_seller_acc_model.dart'; 3 import 'package:one_key/models/check_seller_acc_model.dart';
4 import 'package:one_key/res/colors.dart'; 4 import 'package:one_key/res/colors.dart';
  5 +import 'package:one_key/utils/utils.dart';
5 import 'package:one_key/widgets/v_empty_view.dart'; 6 import 'package:one_key/widgets/v_empty_view.dart';
6 7
7 class IfNeedCreateStoreItem extends StatefulWidget { 8 class IfNeedCreateStoreItem extends StatefulWidget {
@@ -32,12 +33,19 @@ class _IfNeedCreateStoreItemState extends State<IfNeedCreateStoreItem> { @@ -32,12 +33,19 @@ class _IfNeedCreateStoreItemState extends State<IfNeedCreateStoreItem> {
32 borderRadius: BorderRadius.only( 33 borderRadius: BorderRadius.only(
33 topRight: Radius.circular(ScreenUtil().setWidth(10)), 34 topRight: Radius.circular(ScreenUtil().setWidth(10)),
34 topLeft: Radius.circular(ScreenUtil().setWidth(10))), 35 topLeft: Radius.circular(ScreenUtil().setWidth(10))),
35 - child: Image.network(  
36 - widget.model.sellerImage,  
37 - fit: BoxFit.cover,  
38 - width: ScreenUtil().setWidth(140 * 2),  
39 - height: ScreenUtil().setWidth(140 * 2),  
40 - ), 36 + child: widget.model.sellerImage != ''
  37 + ? Image.network(
  38 + widget.model.sellerImage,
  39 + fit: BoxFit.cover,
  40 + width: ScreenUtil().setWidth(140 * 2),
  41 + height: ScreenUtil().setWidth(140 * 2),
  42 + )
  43 + : Image.asset(
  44 + Utils.getImgPath('no_image'),
  45 + fit: BoxFit.cover,
  46 + width: ScreenUtil().setWidth(140 * 2),
  47 + height: ScreenUtil().setWidth(140 * 2),
  48 + ),
41 )), 49 )),
42 Positioned( 50 Positioned(
43 bottom: 0, 51 bottom: 0,
@@ -4,12 +4,17 @@ import 'dart:io'; @@ -4,12 +4,17 @@ import 'dart:io';
4 4
5 import 'package:common_utils/common_utils.dart'; 5 import 'package:common_utils/common_utils.dart';
6 import 'package:dio/dio.dart'; 6 import 'package:dio/dio.dart';
  7 +import 'package:flutter/cupertino.dart';
7 import 'package:flutter/material.dart'; 8 import 'package:flutter/material.dart';
8 import 'package:flutter_screenutil/flutter_screenutil.dart'; 9 import 'package:flutter_screenutil/flutter_screenutil.dart';
9 import 'package:fluwx/fluwx.dart' as fluwx; 10 import 'package:fluwx/fluwx.dart' as fluwx;
10 import 'package:fluwx/fluwx.dart'; 11 import 'package:fluwx/fluwx.dart';
11 import 'package:one_key/app.dart'; 12 import 'package:one_key/app.dart';
  13 +import 'package:one_key/models/checkbind_phone_model.dart';
  14 +import 'package:one_key/models/store_info.dart';
12 import 'package:one_key/net/dio_util.dart'; 15 import 'package:one_key/net/dio_util.dart';
  16 +import 'package:one_key/provider/create_store_model.dart';
  17 +import 'package:one_key/provider/other_login_provider.dart';
13 import 'package:one_key/provider/user_model.dart'; 18 import 'package:one_key/provider/user_model.dart';
14 import 'package:one_key/res/colors.dart'; 19 import 'package:one_key/res/colors.dart';
15 import 'package:one_key/utils/navigator_util.dart'; 20 import 'package:one_key/utils/navigator_util.dart';
@@ -46,6 +51,7 @@ class LoginState extends State<LoginPage> with WidgetsBindingObserver { @@ -46,6 +51,7 @@ class LoginState extends State<LoginPage> with WidgetsBindingObserver {
46 51
47 bool _check = true; 52 bool _check = true;
48 StreamSubscription<BaseWeChatResponse> _wxlogin; 53 StreamSubscription<BaseWeChatResponse> _wxlogin;
  54 + OtherLoginProvider otherLoginProvider;
49 55
50 @override 56 @override
51 void initState() { 57 void initState() {
@@ -169,8 +175,20 @@ class LoginState extends State<LoginPage> with WidgetsBindingObserver { @@ -169,8 +175,20 @@ class LoginState extends State<LoginPage> with WidgetsBindingObserver {
169 //判断是否已经绑定手机号码 ******调用接口******* 175 //判断是否已经绑定手机号码 ******调用接口*******
170 //有,通过手机号吗或者opened查找店铺信息进行登陆 176 //有,通过手机号吗或者opened查找店铺信息进行登陆
171 //没有,跳转至绑定手机号码页面 177 //没有,跳转至绑定手机号码页面
172 -  
173 - NavigatorUtil.goBindingPhonePage(context); 178 + Map<String, String> params = {
  179 + "unionid": responseData["unionid"],
  180 + };
  181 + CheckbindPhoneSunModel model =
  182 + await otherLoginProvider.checkbindPhone(context, params);
  183 + if (model != null) {
  184 + CreateStoreModel createStoreModel =
  185 + Provider.of<CreateStoreModel>(context, listen: false);
  186 + createStoreModel.storeInfo = StoreInfo();
  187 + createStoreModel.storeInfo.phone = model.phone;
  188 + NavigatorUtil.goIfNeedCreateStorePage(context);
  189 + } else {
  190 + NavigatorUtil.goBindingPhonePage(context);
  191 + }
174 192
175 // _getUserInfo(responseData["access_token"], responseData["openid"]); 193 // _getUserInfo(responseData["access_token"], responseData["openid"]);
176 } 194 }
@@ -240,28 +258,52 @@ class LoginState extends State<LoginPage> with WidgetsBindingObserver { @@ -240,28 +258,52 @@ class LoginState extends State<LoginPage> with WidgetsBindingObserver {
240 // } 258 // }
241 } 259 }
242 260
  261 + _showLoading(BuildContext context) {
  262 + showGeneralDialog(
  263 + context: context,
  264 + barrierDismissible: false,
  265 + barrierLabel:
  266 + MaterialLocalizations.of(context).modalBarrierDismissLabel,
  267 + transitionDuration: const Duration(milliseconds: 150),
  268 + pageBuilder: (BuildContext context, Animation animation,
  269 + Animation secondaryAnimation) {
  270 + return Align(
  271 + child: ClipRRect(
  272 + borderRadius: BorderRadius.circular(10),
  273 + child: Container(
  274 + width: 80,
  275 + height: 80,
  276 + child: CupertinoActivityIndicator(),
  277 + ),
  278 + ),
  279 + );
  280 + }).then((v) {});
  281 + }
  282 +
243 ///苹果登陆 283 ///苹果登陆
244 _iosLogin() async { 284 _iosLogin() async {
245 - // String info = await Utils.getDeviceInfoSystem();  
246 - // int systemInfo = info.compareTo('13');  
247 - // if (systemInfo < 0) {  
248 - // Utils.showToast('该系统版本不支持苹果登录');  
249 - // return;  
250 - // }  
251 - // final credential = await SignInWithApple.getAppleIDCredential(  
252 - // scopes: [  
253 - // AppleIDAuthorizationScopes.email,  
254 - // AppleIDAuthorizationScopes.fullName,  
255 - // ],  
256 - // webAuthenticationOptions: WebAuthenticationOptions(  
257 - // // TODO: Set the `clientId` and `redirectUri` arguments to the values you entered in the Apple Developer portal during the setup  
258 - // clientId: 'com.naji.zdap',  
259 - // redirectUri: Uri.parse(  
260 - // 'https://flutter-sign-in-with-apple-example.glitch.me/callbacks/sign_in_with_apple',  
261 - // ),  
262 - // ),  
263 - // ); 285 + String info = await Utils.getDeviceInfoSystem();
  286 + int systemInfo = info.compareTo('13');
  287 + if (systemInfo < 0) {
  288 + Utils.showToast('该系统版本不支持苹果登录');
  289 + return;
  290 + }
  291 + final credential = await SignInWithApple.getAppleIDCredential(
  292 + scopes: [
  293 + AppleIDAuthorizationScopes.email,
  294 + AppleIDAuthorizationScopes.fullName,
  295 + ],
  296 + webAuthenticationOptions: WebAuthenticationOptions(
  297 + // TODO: Set the `clientId` and `redirectUri` arguments to the values you entered in the Apple Developer portal during the setup
  298 + clientId: 'com.naji.reserveLine',
  299 + redirectUri: Uri.parse(
  300 + 'https://flutter-sign-in-with-apple-example.glitch.me/callbacks/sign_in_with_apple',
  301 + ),
  302 + ),
  303 + );
264 // _showLoading(context); 304 // _showLoading(context);
  305 + print(credential.userIdentifier);
  306 + NavigatorUtil.goBindingPhonePage(context, wechat: false);
265 // String mdString = Utils.generateMd5(credential.userIdentifier); 307 // String mdString = Utils.generateMd5(credential.userIdentifier);
266 // String temp = mdString.substring(8, mdString.length - 2); 308 // String temp = mdString.substring(8, mdString.length - 2);
267 // String openid = 'IOSID_$temp'; 309 // String openid = 'IOSID_$temp';
@@ -269,7 +311,7 @@ class LoginState extends State<LoginPage> with WidgetsBindingObserver { @@ -269,7 +311,7 @@ class LoginState extends State<LoginPage> with WidgetsBindingObserver {
269 // App.sp.setString("unionid", ''); 311 // App.sp.setString("unionid", '');
270 // print(openid.length); 312 // print(openid.length);
271 313
272 - // // 第一次授权 314 + // 第一次授权
273 // if (ObjectUtil.isNotEmpty(credential.familyName)) { 315 // if (ObjectUtil.isNotEmpty(credential.familyName)) {
274 // Map param = { 316 // Map param = {
275 // 'openid': openid, 317 // 'openid': openid,
@@ -295,8 +337,9 @@ class LoginState extends State<LoginPage> with WidgetsBindingObserver { @@ -295,8 +337,9 @@ class LoginState extends State<LoginPage> with WidgetsBindingObserver {
295 337
296 @override 338 @override
297 Widget build(BuildContext context) { 339 Widget build(BuildContext context) {
298 - // TODO: implement build  
299 ScreenUtil.init(context, width: 750, height: 1334); 340 ScreenUtil.init(context, width: 750, height: 1334);
  341 + otherLoginProvider =
  342 + Provider.of<OtherLoginProvider>(context, listen: false);
300 final Size size = MediaQuery.of(context).size; 343 final Size size = MediaQuery.of(context).size;
301 App.screenWidth = size.width; 344 App.screenWidth = size.width;
302 App.screenHeight = size.height; 345 App.screenHeight = size.height;
  1 +import 'dart:convert';
  2 +
1 import 'package:flutter/material.dart'; 3 import 'package:flutter/material.dart';
  4 +import 'package:one_key/constant/constant.dart';
  5 +import 'package:one_key/constant/error.dart';
  6 +import 'package:one_key/models/get_seller_info_model.dart';
2 import 'package:one_key/models/store_info.dart'; 7 import 'package:one_key/models/store_info.dart';
  8 +import 'package:one_key/models/user_create_store.dart';
  9 +import 'package:one_key/net/base_resp.dart';
  10 +import 'package:one_key/net/dio_util.dart';
  11 +import 'package:one_key/net/http_url.dart';
  12 +import 'package:one_key/utils/utils.dart';
3 13
4 /** 14 /**
5 - * 第三方登陆 15 + * 新建店铺
6 */ 16 */
7 class CreateStoreModel extends ChangeNotifier { 17 class CreateStoreModel extends ChangeNotifier {
8 StoreInfo storeInfo; //新建店铺基本信息 18 StoreInfo storeInfo; //新建店铺基本信息
  19 + UserCreateStore userCreateStore;
  20 +
  21 + ///添加商家信息
  22 + Future<dynamic> addStoreInfo(BuildContext context, Map<String, String> params,
  23 + {isShowLoading = true}) async {
  24 + BaseResp<dynamic> baseResp = await DioUtil()
  25 + .request<dynamic>(context, Method.get, HttpUrl.add_seller_info,
  26 + data: params, showLoading: isShowLoading)
  27 + .catchError((error) {
  28 + print(error.toString());
  29 + if (error is MyError) {}
  30 + return false;
  31 + });
  32 + if (baseResp.code == Constant.status_success) {
  33 + // getStoreInfo(context, {});
  34 + if (baseResp.data != null) {
  35 + storeInfo.sellerid = baseResp.data['sellerid'];
  36 + return true;
  37 + } else {
  38 + // Utils.showToast(baseResp.msg ?? "修改失败");
  39 + return false;
  40 + }
  41 + } else {
  42 + if (baseResp != null) {
  43 + if (baseResp.msg == '非法请求:手机号已存在') {
  44 + Utils.showToast('接单电话已存在,请重新填写接单电话');
  45 + } else {
  46 + Utils.showToast(baseResp.msg ?? "");
  47 + }
  48 + }
  49 + return false;
  50 + }
  51 + }
  52 +
  53 + Future<dynamic> getStoreInfo(BuildContext context, Map<String, String> params,
  54 + {isShowLoading = true}) async {
  55 + BaseResp<dynamic> baseResp = await DioUtil()
  56 + .request<dynamic>(context, Method.get, HttpUrl.get_seller_user_info,
  57 + data: params, showLoading: isShowLoading)
  58 + .catchError((error) {
  59 + print(error.toString());
  60 + if (error is MyError) {}
  61 + return false;
  62 + });
  63 + if (baseResp.code == Constant.status_success) {
  64 + if (baseResp.data != null) {
  65 + List<dynamic> temp = baseResp.data;
  66 + if (temp.length > 0) {
  67 + Map<String, dynamic> data = {};
  68 + data = temp[0];
  69 + print(data.keys);
  70 + print(data);
  71 + // print(data[0]);
  72 + userCreateStore = UserCreateStore();
  73 + userCreateStore.id = data['uid'].toString();
  74 + userCreateStore.account = data['account'].toString();
  75 + userCreateStore.nick_name = data['nick_name'].toString();
  76 + userCreateStore.role_id = data['role_id'].toString();
  77 + userCreateStore.seller_code = data['seller_code'].toString();
  78 + userCreateStore.sellerid = data['sellerid'].toString();
  79 + userCreateStore.role_name = data['role_name'].toString();
  80 + return true;
  81 + }
  82 +
  83 + // coupons = baseResp.data['aid'].split('');
  84 + return false;
  85 + } else {
  86 + // Utils.showToast(baseResp.msg ?? "修改失败");
  87 + return false;
  88 + }
  89 + } else {
  90 + if (baseResp != null) {
  91 + // Utils.showToast(baseResp.msg ?? "");
  92 + }
  93 + return false;
  94 + }
  95 + }
  96 +
  97 + ///根据商家ID获取商家信息
  98 + Future<GetSellerInfoSunModel> getSellerById(BuildContext context) async {
  99 + Map<String, String> params = {
  100 + "sellerid": storeInfo.sellerid,
  101 + };
  102 + BaseResp<Map<String, dynamic>> baseResp = await DioUtil()
  103 + .request<Map<String, dynamic>>(
  104 + context, Method.get, HttpUrl.get_seller_info,
  105 + data: params)
  106 + .catchError((error) {
  107 + print(error.toString());
  108 + });
  109 + GetSellerInfoSunModel itemModel;
  110 + if (baseResp == null) return itemModel;
  111 + if (baseResp.code == Constant.status_success) {
  112 + if (int.parse(baseResp.status) != Constant.status_success) {
  113 + Utils.showToast(baseResp.msg ?? "");
  114 + return itemModel;
  115 + }
  116 + if (baseResp.responseData['data'] != null) {
  117 + itemModel = GetSellerInfoModel.fromJson(baseResp.responseData).data;
  118 + print(itemModel);
  119 + } else {
  120 + Utils.showToast(baseResp.msg ?? "");
  121 + }
  122 + return itemModel;
  123 + }
  124 + }
9 } 125 }
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; @@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
2 import 'package:one_key/constant/constant.dart'; 2 import 'package:one_key/constant/constant.dart';
3 import 'package:one_key/constant/state.dart'; 3 import 'package:one_key/constant/state.dart';
4 import 'package:one_key/models/check_seller_acc_model.dart'; 4 import 'package:one_key/models/check_seller_acc_model.dart';
  5 +import 'package:one_key/models/checkbind_phone_model.dart';
5 import 'package:one_key/models/phone_code_model.dart'; 6 import 'package:one_key/models/phone_code_model.dart';
6 import 'package:one_key/net/base_resp.dart'; 7 import 'package:one_key/net/base_resp.dart';
7 import 'package:one_key/net/dio_util.dart'; 8 import 'package:one_key/net/dio_util.dart';
@@ -66,4 +67,32 @@ class OtherLoginProvider extends ChangeNotifier { @@ -66,4 +67,32 @@ class OtherLoginProvider extends ChangeNotifier {
66 notifyListeners(); 67 notifyListeners();
67 return sellerList; 68 return sellerList;
68 } 69 }
  70 +
  71 + /// APP微信登录后检测是否绑定过手机号
  72 + Future<CheckbindPhoneSunModel> checkbindPhone(
  73 + BuildContext context, Map<String, String> params,
  74 + {isShowLoading = true}) async {
  75 + BaseResp<Map<String, dynamic>> baseResp = await DioUtil()
  76 + .request<Map<String, dynamic>>(
  77 + context, Method.get, HttpUrl.check_bind_phone,
  78 + data: params, showLoading: false)
  79 + .catchError((error) {});
  80 + CheckbindPhoneSunModel checkbindPhoneSunModel;
  81 + if (baseResp.code == Constant.status_success) {
  82 + if (baseResp.data == null) {
  83 + return checkbindPhoneSunModel;
  84 + } else {
  85 + //解析解析
  86 + checkbindPhoneSunModel =
  87 + CheckbindPhoneModel.fromJson(baseResp.responseData).data;
  88 + return checkbindPhoneSunModel;
  89 + }
  90 + } else {
  91 + if (baseResp != null) {
  92 + Utils.showToast(baseResp.msg ?? "");
  93 + }
  94 + return checkbindPhoneSunModel;
  95 + ;
  96 + }
  97 + }
69 } 98 }
1 -  
2 -  
3 import 'package:common_utils/common_utils.dart'; 1 import 'package:common_utils/common_utils.dart';
4 import 'package:flutter/material.dart'; 2 import 'package:flutter/material.dart';
5 import 'package:one_key/constant/constant.dart'; 3 import 'package:one_key/constant/constant.dart';
@@ -19,8 +17,7 @@ import 'package:provider/provider.dart'; @@ -19,8 +17,7 @@ import 'package:provider/provider.dart';
19 17
20 import 'notebook_model.dart'; 18 import 'notebook_model.dart';
21 19
22 -class TableManagerModel with ChangeNotifier{  
23 - 20 +class TableManagerModel with ChangeNotifier {
24 List<Area> areas = []; //区域列表 21 List<Area> areas = []; //区域列表
25 22
26 List<t.Table> selectTables = []; //选择的桌位 23 List<t.Table> selectTables = []; //选择的桌位
@@ -28,13 +25,13 @@ class TableManagerModel with ChangeNotifier{ @@ -28,13 +25,13 @@ class TableManagerModel with ChangeNotifier{
28 List<TableOuter> tableOuterList = []; //区域-桌位列表 25 List<TableOuter> tableOuterList = []; //区域-桌位列表
29 26
30 Map<String, List<t.Table>> areaTableMap = {}; //区域-桌位Map 27 Map<String, List<t.Table>> areaTableMap = {}; //区域-桌位Map
31 - List<t.Table> currentTables=[];//当前显示的区域-桌位 28 + List<t.Table> currentTables = []; //当前显示的区域-桌位
32 29
33 Map<String, Notebook> tableMap = {}; //记录已预订桌位对应的订单 30 Map<String, Notebook> tableMap = {}; //记录已预订桌位对应的订单
34 31
35 String currentArea; //当前选中区域 32 String currentArea; //当前选中区域
36 33
37 - DateTime dateTime=DateTime.now(); 34 + DateTime dateTime = DateTime.now();
38 35
39 String dateText = ""; //当前显示日期时间 36 String dateText = ""; //当前显示日期时间
40 int currTimeIndex = 1; //当前选中时间段 37 int currTimeIndex = 1; //当前选中时间段
@@ -51,18 +48,25 @@ class TableManagerModel with ChangeNotifier{ @@ -51,18 +48,25 @@ class TableManagerModel with ChangeNotifier{
51 initTime(BuildContext context) async { 48 initTime(BuildContext context) async {
52 userModel = Provider.of<UserModel>(context, listen: false); 49 userModel = Provider.of<UserModel>(context, listen: false);
53 dateTime = DateTime.now(); 50 dateTime = DateTime.now();
54 - dateText = "${dateTime.year}年 "+Utils.addZeroNumber(dateTime.month) + 51 + dateText = "${dateTime.year}年 " +
  52 + Utils.addZeroNumber(dateTime.month) +
55 "月" + 53 "月" +
56 Utils.addZeroNumber(dateTime.day) + 54 Utils.addZeroNumber(dateTime.day) +
57 "日" + 55 "日" +
58 " 今天"; 56 " 今天";
59 morning = 57 morning =
60 - userModel.user.morning.isEmpty ? "00:00-00:00" : userModel.user.morning; 58 + userModel.user.morning.isEmpty ? "00:00-00:00" : userModel.user.morning;
61 noon = userModel.user.noon.isEmpty ? "00:00-00:00" : userModel.user.noon; 59 noon = userModel.user.noon.isEmpty ? "00:00-00:00" : userModel.user.noon;
62 night = userModel.user.night.isEmpty ? "00:00-00:00" : userModel.user.night; 60 night = userModel.user.night.isEmpty ? "00:00-00:00" : userModel.user.night;
63 - userModel.user.morning.isEmpty?dailyMap.putIfAbsent("morning", ()=>""):dailyMap.putIfAbsent("morning", () => _getHourAndMinute(morning,1));  
64 - userModel.user.noon.isEmpty?dailyMap.putIfAbsent("noon", ()=>""):dailyMap.putIfAbsent("noon", () => _getHourAndMinute(noon,2));  
65 - userModel.user.night.isEmpty?dailyMap.putIfAbsent("night", ()=>""):dailyMap.putIfAbsent("night", () => _getHourAndMinute(night,3)); 61 + userModel.user.morning.isEmpty
  62 + ? dailyMap.putIfAbsent("morning", () => "")
  63 + : dailyMap.putIfAbsent("morning", () => _getHourAndMinute(morning, 1));
  64 + userModel.user.noon.isEmpty
  65 + ? dailyMap.putIfAbsent("noon", () => "")
  66 + : dailyMap.putIfAbsent("noon", () => _getHourAndMinute(noon, 2));
  67 + userModel.user.night.isEmpty
  68 + ? dailyMap.putIfAbsent("night", () => "")
  69 + : dailyMap.putIfAbsent("night", () => _getHourAndMinute(night, 3));
66 if (dateTime.isBefore(DateTime.parse(dateTime.year.toString() + 70 if (dateTime.isBefore(DateTime.parse(dateTime.year.toString() +
67 "-" + 71 "-" +
68 Utils.addZeroNumber(dateTime.month) + 72 Utils.addZeroNumber(dateTime.month) +
@@ -74,13 +78,13 @@ class TableManagerModel with ChangeNotifier{ @@ -74,13 +78,13 @@ class TableManagerModel with ChangeNotifier{
74 //未过早市 78 //未过早市
75 currTimeIndex = 1; 79 currTimeIndex = 1;
76 } else if (dateTime.isAfter(DateTime.parse(dateTime.year.toString() + 80 } else if (dateTime.isAfter(DateTime.parse(dateTime.year.toString() +
77 - "-" +  
78 - Utils.addZeroNumber(dateTime.month) +  
79 - "-" +  
80 - Utils.addZeroNumber(dateTime.day) +  
81 - " " +  
82 - morning.split("-")[1] +  
83 - ":00")) && 81 + "-" +
  82 + Utils.addZeroNumber(dateTime.month) +
  83 + "-" +
  84 + Utils.addZeroNumber(dateTime.day) +
  85 + " " +
  86 + morning.split("-")[1] +
  87 + ":00")) &&
84 dateTime.isBefore(DateTime.parse(dateTime.year.toString() + 88 dateTime.isBefore(DateTime.parse(dateTime.year.toString() +
85 "-" + 89 "-" +
86 Utils.addZeroNumber(dateTime.month) + 90 Utils.addZeroNumber(dateTime.month) +
@@ -92,13 +96,13 @@ class TableManagerModel with ChangeNotifier{ @@ -92,13 +96,13 @@ class TableManagerModel with ChangeNotifier{
92 //过了早市,未过午市 96 //过了早市,未过午市
93 currTimeIndex = 2; 97 currTimeIndex = 2;
94 } else if (dateTime.isAfter(DateTime.parse(dateTime.year.toString() + 98 } else if (dateTime.isAfter(DateTime.parse(dateTime.year.toString() +
95 - "-" +  
96 - Utils.addZeroNumber(dateTime.month) +  
97 - "-" +  
98 - Utils.addZeroNumber(dateTime.day) +  
99 - " " +  
100 - noon.split("-")[1] +  
101 - ":00")) && 99 + "-" +
  100 + Utils.addZeroNumber(dateTime.month) +
  101 + "-" +
  102 + Utils.addZeroNumber(dateTime.day) +
  103 + " " +
  104 + noon.split("-")[1] +
  105 + ":00")) &&
102 dateTime.isBefore(DateTime.parse(dateTime.year.toString() + 106 dateTime.isBefore(DateTime.parse(dateTime.year.toString() +
103 "-" + 107 "-" +
104 Utils.addZeroNumber(dateTime.month) + 108 Utils.addZeroNumber(dateTime.month) +
@@ -113,52 +117,72 @@ class TableManagerModel with ChangeNotifier{ @@ -113,52 +117,72 @@ class TableManagerModel with ChangeNotifier{
113 //过了晚市 117 //过了晚市
114 currTimeIndex = 3; 118 currTimeIndex = 3;
115 } 119 }
116 - await getTableList(context);  
117 - getReserveList(context); 120 + List temp = await getTableList(context);
  121 + if (temp.length > 0) {
  122 + getReserveList(context);
  123 + } else {
  124 + pageState = PageState.Empty;
  125 + notifyListeners();
  126 + }
118 } 127 }
119 128
120 - getCurrDdateStr(){  
121 - String currSelectTime="";  
122 - int timeMillsNow=DateTime.now().millisecondsSinceEpoch;  
123 - if(currTimeIndex==1){  
124 - List<String> mornings=_getHourAndMinute(morning, 1);  
125 - for(String temp in mornings){  
126 - if(timeMillsNow<=DateUtil.getDateMsByTimeStr(DateUtil.formatDate(dateTime).replaceRange(11,19, "$temp:00"))){  
127 - currSelectTime=temp; 129 + getCurrDdateStr() {
  130 + String currSelectTime = "";
  131 + int timeMillsNow = DateTime.now().millisecondsSinceEpoch;
  132 + if (currTimeIndex == 1) {
  133 + List<String> mornings = _getHourAndMinute(morning, 1);
  134 + for (String temp in mornings) {
  135 + if (timeMillsNow <=
  136 + DateUtil.getDateMsByTimeStr(DateUtil.formatDate(dateTime)
  137 + .replaceRange(11, 19, "$temp:00"))) {
  138 + currSelectTime = temp;
128 break; 139 break;
129 } 140 }
130 } 141 }
131 - }else if(currTimeIndex==2){  
132 - List<String> noons=_getHourAndMinute(noon, 2);  
133 - for(String temp in noons){  
134 - if(timeMillsNow<=DateUtil.getDateMsByTimeStr(DateUtil.formatDate(dateTime).replaceRange(11,19, "$temp:00"))){  
135 - currSelectTime=temp;  
136 - if(noons.contains("12:30")&&DateUtil.getDateMsByTimeStr(DateUtil.formatDate(dateTime).replaceRange(11,19, "$temp:00"))<DateUtil.getDateMsByTimeStr(DateUtil.formatDate(dateTime).replaceRange(11,19, "12:30:00"))){  
137 - currSelectTime="12:30"; 142 + } else if (currTimeIndex == 2) {
  143 + List<String> noons = _getHourAndMinute(noon, 2);
  144 + for (String temp in noons) {
  145 + if (timeMillsNow <=
  146 + DateUtil.getDateMsByTimeStr(DateUtil.formatDate(dateTime)
  147 + .replaceRange(11, 19, "$temp:00"))) {
  148 + currSelectTime = temp;
  149 + if (noons.contains("12:30") &&
  150 + DateUtil.getDateMsByTimeStr(DateUtil.formatDate(dateTime)
  151 + .replaceRange(11, 19, "$temp:00")) <
  152 + DateUtil.getDateMsByTimeStr(DateUtil.formatDate(dateTime)
  153 + .replaceRange(11, 19, "12:30:00"))) {
  154 + currSelectTime = "12:30";
138 } 155 }
139 break; 156 break;
140 } 157 }
141 } 158 }
142 - }else{  
143 - List<String> nights=_getHourAndMinute(night, 3);  
144 - for(String temp in nights){  
145 - if(timeMillsNow<=DateUtil.getDateMsByTimeStr(DateUtil.formatDate(dateTime).replaceRange(11,19, "$temp:00"))){  
146 - currSelectTime=temp;  
147 - if(nights.contains("18:30")&&DateUtil.getDateMsByTimeStr(DateUtil.formatDate(dateTime).replaceRange(11,19, "$temp:00"))<DateUtil.getDateMsByTimeStr(DateUtil.formatDate(dateTime).replaceRange(11,19, "18:30:00"))){  
148 - currSelectTime="18:30"; 159 + } else {
  160 + List<String> nights = _getHourAndMinute(night, 3);
  161 + for (String temp in nights) {
  162 + if (timeMillsNow <=
  163 + DateUtil.getDateMsByTimeStr(DateUtil.formatDate(dateTime)
  164 + .replaceRange(11, 19, "$temp:00"))) {
  165 + currSelectTime = temp;
  166 + if (nights.contains("18:30") &&
  167 + DateUtil.getDateMsByTimeStr(DateUtil.formatDate(dateTime)
  168 + .replaceRange(11, 19, "$temp:00")) <
  169 + DateUtil.getDateMsByTimeStr(DateUtil.formatDate(dateTime)
  170 + .replaceRange(11, 19, "18:30:00"))) {
  171 + currSelectTime = "18:30";
149 } 172 }
150 break; 173 break;
151 } 174 }
152 } 175 }
153 } 176 }
154 LogUtil.v("currSelectTime:$currSelectTime"); 177 LogUtil.v("currSelectTime:$currSelectTime");
155 - String ddateStr=DateUtil.getDateMsByTimeStr(DateUtil.formatDate(dateTime).replaceRange(11,19, "$currSelectTime:00")).toString();  
156 - return ddateStr.substring(0,10); 178 + String ddateStr = DateUtil.getDateMsByTimeStr(DateUtil.formatDate(dateTime)
  179 + .replaceRange(11, 19, "$currSelectTime:00"))
  180 + .toString();
  181 + return ddateStr.substring(0, 10);
157 } 182 }
158 183
159 //根据获取时间 11:00-12:30 获取30分钟间隔组装的数组 184 //根据获取时间 11:00-12:30 获取30分钟间隔组装的数组
160 - _getHourAndMinute(  
161 - String hourAndMinuteStr, int mnd) { 185 + _getHourAndMinute(String hourAndMinuteStr, int mnd) {
162 List tempDate = hourAndMinuteStr.split("-"); 186 List tempDate = hourAndMinuteStr.split("-");
163 String beginDate = tempDate[0]; 187 String beginDate = tempDate[0];
164 String endDate = tempDate[1]; 188 String endDate = tempDate[1];
@@ -211,7 +235,7 @@ class TableManagerModel with ChangeNotifier{ @@ -211,7 +235,7 @@ class TableManagerModel with ChangeNotifier{
211 Map<String, String> params = {"sellerid": userModel.user.sellerid}; 235 Map<String, String> params = {"sellerid": userModel.user.sellerid};
212 BaseResp<List> baseResp = await DioUtil() 236 BaseResp<List> baseResp = await DioUtil()
213 .request<List>(context, Method.get, HttpUrl.table_list, 237 .request<List>(context, Method.get, HttpUrl.table_list,
214 - data: params,showLoading: false) 238 + data: params, showLoading: false)
215 .catchError((error) { 239 .catchError((error) {
216 print(error.toString()); 240 print(error.toString());
217 if (error is MyError) { 241 if (error is MyError) {
@@ -229,17 +253,22 @@ class TableManagerModel with ChangeNotifier{ @@ -229,17 +253,22 @@ class TableManagerModel with ChangeNotifier{
229 } 253 }
230 notifyListeners(); 254 notifyListeners();
231 }); 255 });
232 - tableOuterList=[];  
233 - if(baseResp.code==Constant.status_success){ 256 + tableOuterList = [];
  257 + if (baseResp.code == Constant.status_success) {
  258 + if (baseResp.data.length == 0) {
  259 + pageState = PageState.ConnectivityError;
  260 + notifyListeners();
  261 + }
234 if ((baseResp.data[0] as List).isEmpty) { 262 if ((baseResp.data[0] as List).isEmpty) {
235 pageState = PageState.Empty; 263 pageState = PageState.Empty;
236 notifyListeners(); 264 notifyListeners();
  265 + return [];
237 } 266 }
238 - tableOuterList=(baseResp.data[0] as List).map((value){  
239 - TableOuter tableOuter=TableOuter();  
240 - tableOuter.name=value["name"];  
241 - tableOuter.list=(value["list"] as List).map((table){  
242 - return t.Table.fromJson(table as Map<String,dynamic>); 267 + tableOuterList = (baseResp.data[0] as List).map((value) {
  268 + TableOuter tableOuter = TableOuter();
  269 + tableOuter.name = value["name"];
  270 + tableOuter.list = (value["list"] as List).map((table) {
  271 + return t.Table.fromJson(table as Map<String, dynamic>);
243 }).toList(); 272 }).toList();
244 return tableOuter; 273 return tableOuter;
245 }).toList(); 274 }).toList();
@@ -283,21 +312,21 @@ class TableManagerModel with ChangeNotifier{ @@ -283,21 +312,21 @@ class TableManagerModel with ChangeNotifier{
283 String _getRdate() { 312 String _getRdate() {
284 //一天开始时间 313 //一天开始时间
285 double startDay = (DateTime.parse((dateTime.year.toString() + 314 double startDay = (DateTime.parse((dateTime.year.toString() +
286 - "-" +  
287 - Utils.addZeroNumber(dateTime.month) +  
288 - "-" +  
289 - Utils.addZeroNumber(dateTime.day) +  
290 - " 00:00:00"))  
291 - .millisecondsSinceEpoch) / 315 + "-" +
  316 + Utils.addZeroNumber(dateTime.month) +
  317 + "-" +
  318 + Utils.addZeroNumber(dateTime.day) +
  319 + " 00:00:00"))
  320 + .millisecondsSinceEpoch) /
292 1000; 321 1000;
293 //一天结束时间 322 //一天结束时间
294 double endDay = (DateTime.parse((dateTime.year.toString() + 323 double endDay = (DateTime.parse((dateTime.year.toString() +
295 - "-" +  
296 - Utils.addZeroNumber(dateTime.month) +  
297 - "-" +  
298 - Utils.addZeroNumber(dateTime.day) +  
299 - " 23:59:59"))  
300 - .millisecondsSinceEpoch) / 324 + "-" +
  325 + Utils.addZeroNumber(dateTime.month) +
  326 + "-" +
  327 + Utils.addZeroNumber(dateTime.day) +
  328 + " 23:59:59"))
  329 + .millisecondsSinceEpoch) /
301 1000; 330 1000;
302 return startDay.floor().toString() + "-" + endDay.floor().toString(); 331 return startDay.floor().toString() + "-" + endDay.floor().toString();
303 } 332 }
@@ -312,7 +341,8 @@ class TableManagerModel with ChangeNotifier{ @@ -312,7 +341,8 @@ class TableManagerModel with ChangeNotifier{
312 table.sign = ""; 341 table.sign = "";
313 table.notebookId = ""; 342 table.notebookId = "";
314 table.reserver = ""; 343 table.reserver = "";
315 - if (table.tablestatus == "0") {//没有用餐中 344 + if (table.tablestatus == "0") {
  345 + //没有用餐中
316 if (tableMap["${table.id}"] != null) { 346 if (tableMap["${table.id}"] != null) {
317 Notebook notebook = tableMap["${table.id}"]; 347 Notebook notebook = tableMap["${table.id}"];
318 table.sign = notebook.status; 348 table.sign = notebook.status;
@@ -325,7 +355,8 @@ class TableManagerModel with ChangeNotifier{ @@ -325,7 +355,8 @@ class TableManagerModel with ChangeNotifier{
325 count++; 355 count++;
326 } 356 }
327 } 357 }
328 - } else {//用餐中 358 + } else {
  359 + //用餐中
329 table.sign = "2"; 360 table.sign = "2";
330 table.notebookId = ""; 361 table.notebookId = "";
331 } 362 }
@@ -337,16 +368,17 @@ class TableManagerModel with ChangeNotifier{ @@ -337,16 +368,17 @@ class TableManagerModel with ChangeNotifier{
337 areas.add(area); 368 areas.add(area);
338 } 369 }
339 currentArea = areaTableMap.keys.first; 370 currentArea = areaTableMap.keys.first;
340 - currentTables=areaTableMap[currentArea]; 371 + currentTables = areaTableMap[currentArea];
341 pageState = PageState.Success; 372 pageState = PageState.Success;
342 notifyListeners(); 373 notifyListeners();
343 } 374 }
344 375
345 //生成日期文本 376 //生成日期文本
346 - createDateText(BuildContext context,DateTime day) { 377 + createDateText(BuildContext context, DateTime day) {
347 if (Utils.isOneDay(day, dateTime)) return; //日期没变 378 if (Utils.isOneDay(day, dateTime)) return; //日期没变
348 DateTime dateNow = DateTime.now(); 379 DateTime dateNow = DateTime.now();
349 - dateText = "${day.year}年 "+Utils.addZeroNumber(day.month) + 380 + dateText = "${day.year}年 " +
  381 + Utils.addZeroNumber(day.month) +
350 "月" + 382 "月" +
351 Utils.addZeroNumber(day.day) + 383 Utils.addZeroNumber(day.day) +
352 "日"; 384 "日";
@@ -364,18 +396,19 @@ class TableManagerModel with ChangeNotifier{ @@ -364,18 +396,19 @@ class TableManagerModel with ChangeNotifier{
364 } 396 }
365 397
366 //获取桌位数据 398 //获取桌位数据
367 - Future<dynamic> setSwitchStatus(BuildContext context,Map<String,String> params) async { 399 + Future<dynamic> setSwitchStatus(
  400 + BuildContext context, Map<String, String> params) async {
368 BaseResp<dynamic> baseResp = await DioUtil() 401 BaseResp<dynamic> baseResp = await DioUtil()
369 .request<dynamic>(context, Method.get, HttpUrl.set_switch_status, 402 .request<dynamic>(context, Method.get, HttpUrl.set_switch_status,
370 - data: params,showLoading: true) 403 + data: params, showLoading: true)
371 .catchError((error) { 404 .catchError((error) {
372 print(error.toString()); 405 print(error.toString());
373 }); 406 });
374 - if(baseResp==null)return null;  
375 - if(baseResp.code==Constant.status_success){ 407 + if (baseResp == null) return null;
  408 + if (baseResp.code == Constant.status_success) {
376 return baseResp.data; 409 return baseResp.data;
377 - }else{ 410 + } else {
378 Utils.showToast(baseResp.msg); 411 Utils.showToast(baseResp.msg);
379 } 412 }
380 } 413 }
381 -}  
  414 +}
@@ -85,4 +85,5 @@ class MyColours { @@ -85,4 +85,5 @@ class MyColours {
85 static const Color color_EEDBC4 = Color(0xffEEDBC4); 85 static const Color color_EEDBC4 = Color(0xffEEDBC4);
86 static const Color color_BA9953 = Color(0xffBA9953); 86 static const Color color_BA9953 = Color(0xffBA9953);
87 static const Color color_D7F7F7 = Color(0xffD7F7F7); 87 static const Color color_D7F7F7 = Color(0xffD7F7F7);
  88 + static const Color color_2AB5B7 = Color(0xff2AB5B7);
88 } 89 }
@@ -10,6 +10,7 @@ import 'package:one_key/pages/coupon/coupon_edit_page.dart'; @@ -10,6 +10,7 @@ import 'package:one_key/pages/coupon/coupon_edit_page.dart';
10 import 'package:one_key/pages/coupon/coupon_history_page.dart'; 10 import 'package:one_key/pages/coupon/coupon_history_page.dart';
11 import 'package:one_key/pages/coupon/coupon_page.dart'; 11 import 'package:one_key/pages/coupon/coupon_page.dart';
12 import 'package:one_key/pages/coupon/coupon_selecet_page.dart'; 12 import 'package:one_key/pages/coupon/coupon_selecet_page.dart';
  13 +import 'package:one_key/pages/create_store/complete_create_store.dart';
13 import 'package:one_key/pages/create_store/create_store.dart'; 14 import 'package:one_key/pages/create_store/create_store.dart';
14 import 'package:one_key/pages/create_store/enter_store_address.dart'; 15 import 'package:one_key/pages/create_store/enter_store_address.dart';
15 import 'package:one_key/pages/create_store/enter_store_environment.dart'; 16 import 'package:one_key/pages/create_store/enter_store_environment.dart';
@@ -42,6 +43,7 @@ import 'package:one_key/pages/table/select_table_page.dart'; @@ -42,6 +43,7 @@ import 'package:one_key/pages/table/select_table_page.dart';
42 import 'package:one_key/pages/webview/webview_page.dart'; 43 import 'package:one_key/pages/webview/webview_page.dart';
43 import 'package:one_key/provider/book_set_time_model.dart'; 44 import 'package:one_key/provider/book_set_time_model.dart';
44 import 'package:one_key/provider/choose_table_model.dart'; 45 import 'package:one_key/provider/choose_table_model.dart';
  46 +import 'package:one_key/provider/create_store_model.dart';
45 import 'package:one_key/provider/notebook_detail_change_model.dart'; 47 import 'package:one_key/provider/notebook_detail_change_model.dart';
46 import 'package:one_key/provider/notebook_detail_model.dart'; 48 import 'package:one_key/provider/notebook_detail_model.dart';
47 import 'package:one_key/provider/order_food_provider.dart'; 49 import 'package:one_key/provider/order_food_provider.dart';
@@ -54,7 +56,8 @@ import 'package:provider/provider.dart'; @@ -54,7 +56,8 @@ import 'package:provider/provider.dart';
54 // 登录页 56 // 登录页
55 var loginHandler = new Handler( 57 var loginHandler = new Handler(
56 handlerFunc: (BuildContext context, Map<String, List<Object>> params) { 58 handlerFunc: (BuildContext context, Map<String, List<Object>> params) {
57 - return LoginPage(); 59 + return ChangeNotifierProvider<OtherLoginProvider>(
  60 + create: (_) => OtherLoginProvider(), child: LoginPage());
58 }); 61 });
59 62
60 // 跳转到主页 63 // 跳转到主页
@@ -291,9 +294,9 @@ var bindingPhonePageHandler = new Handler( @@ -291,9 +294,9 @@ var bindingPhonePageHandler = new Handler(
291 handlerFunc: (BuildContext context, Map<String, List<Object>> params) { 294 handlerFunc: (BuildContext context, Map<String, List<Object>> params) {
292 // CouponSunModel couponSunModel = CouponSunModel.fromJson(json.decode( 295 // CouponSunModel couponSunModel = CouponSunModel.fromJson(json.decode(
293 // FluroConvertUtils.fluroCnParamsDecode(params["couponSunModel"].first))); 296 // FluroConvertUtils.fluroCnParamsDecode(params["couponSunModel"].first)));
294 - 297 + bool wechat = FluroConvertUtils.string2bool(params["wechat"].first);
295 return ChangeNotifierProvider<OtherLoginProvider>( 298 return ChangeNotifierProvider<OtherLoginProvider>(
296 - create: (_) => OtherLoginProvider(), child: BindingPhone()); 299 + create: (_) => OtherLoginProvider(), child: BindingPhone(wechat: wechat));
297 }); 300 });
298 301
299 ///是否新建店铺页面 302 ///是否新建店铺页面
@@ -302,8 +305,7 @@ var ifNeedCreateStorePageHandler = new Handler( @@ -302,8 +305,7 @@ var ifNeedCreateStorePageHandler = new Handler(
302 // CouponSunModel couponSunModel = CouponSunModel.fromJson(json.decode( 305 // CouponSunModel couponSunModel = CouponSunModel.fromJson(json.decode(
303 // FluroConvertUtils.fluroCnParamsDecode(params["couponSunModel"].first))); 306 // FluroConvertUtils.fluroCnParamsDecode(params["couponSunModel"].first)));
304 return ChangeNotifierProvider<OtherLoginProvider>( 307 return ChangeNotifierProvider<OtherLoginProvider>(
305 - create: (_) => OtherLoginProvider(),  
306 - child: IfNeedCreateStore()); 308 + create: (_) => OtherLoginProvider(), child: IfNeedCreateStore());
307 }); 309 });
308 310
309 ///新建店铺页面 311 ///新建店铺页面
@@ -401,3 +403,13 @@ var enterStoreEnvironmentPageHandler = new Handler( @@ -401,3 +403,13 @@ var enterStoreEnvironmentPageHandler = new Handler(
401 // return ChangeNotifierProvider<UploadImageProvider>( 403 // return ChangeNotifierProvider<UploadImageProvider>(
402 // create: (_) => UploadImageProvider(), child: EnterStoreEnvironmentPage()); 404 // create: (_) => UploadImageProvider(), child: EnterStoreEnvironmentPage());
403 }); 405 });
  406 +
  407 +///店铺环境
  408 +var completeCreateStorePageHandler = new Handler(
  409 + handlerFunc: (BuildContext context, Map<String, List<Object>> params) {
  410 + // CouponSunModel couponSunModel = CouponSunModel.fromJson(json.decode(
  411 + // FluroConvertUtils.fluroCnParamsDecode(params["couponSunModel"].first)));
  412 + // String urlStr = FluroConvertUtils.fluroCnParamsDecode(params["urlStr"].first);
  413 +
  414 + return CompleteCreateStorePage();
  415 +});
@@ -39,9 +39,8 @@ class Routes { @@ -39,9 +39,8 @@ class Routes {
39 static String enter_store_time = "/enter_store_time"; //店铺营业时间 39 static String enter_store_time = "/enter_store_time"; //店铺营业时间
40 static String enter_store_phone = "/enter_store_phone"; //接单电话 40 static String enter_store_phone = "/enter_store_phone"; //接单电话
41 static String enter_store_front_photo = "/enter_store_front_photo"; //门头照片 41 static String enter_store_front_photo = "/enter_store_front_photo"; //门头照片
42 - static String enter_store_environment = "/enter_store_environment"; //店铺环境  
43 -  
44 - 42 + static String enter_store_environment = "/enter_store_environment"; //店铺环境
  43 + static String complete_create_store = "/complete_create_store"; //创建店铺完成
45 44
46 static void configureRoutes(FluroRouter router) { 45 static void configureRoutes(FluroRouter router) {
47 router.notFoundHandler = new Handler( 46 router.notFoundHandler = new Handler(
@@ -84,10 +83,13 @@ class Routes { @@ -84,10 +83,13 @@ class Routes {
84 router.define(enter_store_position, handler: enterStorePositionPageHandler); 83 router.define(enter_store_position, handler: enterStorePositionPageHandler);
85 router.define(enter_store_time, handler: enterStoreTimePageHandler); 84 router.define(enter_store_time, handler: enterStoreTimePageHandler);
86 router.define(enter_store_phone, handler: enterStorePhonePageHandler); 85 router.define(enter_store_phone, handler: enterStorePhonePageHandler);
87 - router.define(enter_store_front_photo, handler: enterStoreFrontPhotoPageHandler);  
88 - router.define(enter_store_environment, handler: enterStoreEnvironmentPageHandler);  
89 -  
90 - 86 + router.define(enter_store_front_photo,
  87 + handler: enterStoreFrontPhotoPageHandler);
  88 + router.define(enter_store_environment,
  89 + handler: enterStoreEnvironmentPageHandler);
  90 + router.define(complete_create_store,
  91 + handler: completeCreateStorePageHandler);
91 92
  93 +
92 } 94 }
93 } 95 }
@@ -197,8 +197,9 @@ class NavigatorUtil { @@ -197,8 +197,9 @@ class NavigatorUtil {
197 197
198 /// 绑定手机号吗页面 198 /// 绑定手机号吗页面
199 static Future<dynamic> goBindingPhonePage(BuildContext context, 199 static Future<dynamic> goBindingPhonePage(BuildContext context,
200 - {replace = false}) {  
201 - return _navigateTo(context, "${Routes.binding_phone}", replace: replace); 200 + {replace = false, bool wechat = true}) {
  201 + return _navigateTo(context, "${Routes.binding_phone}?wechat=${wechat}",
  202 + replace: replace);
202 } 203 }
203 204
204 /// 是否新建店铺页面 205 /// 是否新建店铺页面
@@ -276,4 +277,11 @@ class NavigatorUtil { @@ -276,4 +277,11 @@ class NavigatorUtil {
276 return _navigateTo(context, "${Routes.enter_store_environment}", 277 return _navigateTo(context, "${Routes.enter_store_environment}",
277 replace: replace); 278 replace: replace);
278 } 279 }
  280 +
  281 + /// 新建店铺完成页面
  282 + static Future<dynamic> goCompleteStorePage(BuildContext context,
  283 + {replace = false}) {
  284 + return _navigateTo(context, "${Routes.complete_create_store}",
  285 + replace: replace);
  286 + }
279 } 287 }
@@ -100,6 +100,7 @@ dependencies: @@ -100,6 +100,7 @@ dependencies:
100 photo: ^0.4.8 100 photo: ^0.4.8
101 #苹果登陆 101 #苹果登陆
102 sign_in_with_apple: ^2.5.1 102 sign_in_with_apple: ^2.5.1
  103 + # sign_in_with_apple: ^3.0.0
103 # video_thumbnail: ^0.2.5 104 # video_thumbnail: ^0.2.5
104 video_player: ^1.0.1 105 video_player: ^1.0.1
105 chewie: 106 chewie: