Commit b646ef319a405b093f1b40a74fa43aca4f2cfd2e

Authored by wdn127929
1 parent 905896f2

切换店铺

@@ -105,6 +105,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { @@ -105,6 +105,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
105 )); 105 ));
106 WidgetsBinding.instance.addPostFrameCallback((_) { 106 WidgetsBinding.instance.addPostFrameCallback((_) {
107 initPlatformState(); 107 initPlatformState();
  108 +
108 List<PullMarketingByUidSunModel> data = 109 List<PullMarketingByUidSunModel> data =
109 Provider.of<UserModel>(context, listen: false) 110 Provider.of<UserModel>(context, listen: false)
110 .pullMarketingByUidSunModel; 111 .pullMarketingByUidSunModel;
@@ -146,6 +147,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { @@ -146,6 +147,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
146 timer = Timer.periodic(Duration(minutes: 3), (_) { 147 timer = Timer.periodic(Duration(minutes: 3), (_) {
147 _getAllUnMessages(); 148 _getAllUnMessages();
148 }); 149 });
  150 + _getUnMsgNum();
149 }); 151 });
150 } 152 }
151 153
@@ -551,7 +553,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { @@ -551,7 +553,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
551 } 553 }
552 554
553 //获取未处理消息数目 555 //获取未处理消息数目
554 - bool _getUnMsgNum() { 556 + bool _getUnMsgNumUI() {
555 MessageModel messageModel = 557 MessageModel messageModel =
556 Provider.of<MessageModel>(context, listen: true); 558 Provider.of<MessageModel>(context, listen: true);
557 if (messageModel.onlineTotal + 559 if (messageModel.onlineTotal +
@@ -563,6 +565,16 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { @@ -563,6 +565,16 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
563 return false; 565 return false;
564 } 566 }
565 567
  568 + //三种分类各自的未读消息数目
  569 + _getUnMsgNum() async {
  570 + UserModel userModel = Provider.of<UserModel>(context, listen: false);
  571 + Map<String, String> params = {"sid": userModel.user.sellerid};
  572 + MessageModel messageModel =
  573 + Provider.of<MessageModel>(context, listen: false);
  574 + await messageModel.getUnMsgNum(context, params);
  575 + setState(() {});
  576 + }
  577 +
566 // 系统窗口相关改变回调 578 // 系统窗口相关改变回调
567 void didChangeMetrics() { 579 void didChangeMetrics() {
568 super.didChangeMetrics(); 580 super.didChangeMetrics();
@@ -628,7 +640,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { @@ -628,7 +640,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
628 decoration: BoxDecoration( 640 decoration: BoxDecoration(
629 borderRadius: BorderRadius.circular( 641 borderRadius: BorderRadius.circular(
630 ScreenUtil().setWidth(16)), 642 ScreenUtil().setWidth(16)),
631 - color: _getUnMsgNum() 643 + color: _getUnMsgNumUI()
632 ? MyColours.color_fa5151 644 ? MyColours.color_fa5151
633 : Colors.transparent), 645 : Colors.transparent),
634 ), 646 ),
@@ -651,7 +663,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { @@ -651,7 +663,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
651 decoration: BoxDecoration( 663 decoration: BoxDecoration(
652 borderRadius: BorderRadius.circular( 664 borderRadius: BorderRadius.circular(
653 ScreenUtil().setWidth(16)), 665 ScreenUtil().setWidth(16)),
654 - color: _getUnMsgNum() 666 + color: _getUnMsgNumUI()
655 ? MyColours.color_fa5151 667 ? MyColours.color_fa5151
656 : Colors.transparent), 668 : Colors.transparent),
657 ), 669 ),
@@ -23,10 +23,13 @@ import 'package:one_key/widgets/round_button.dart'; @@ -23,10 +23,13 @@ import 'package:one_key/widgets/round_button.dart';
23 import 'package:one_key/widgets/system_app_bar.dart'; 23 import 'package:one_key/widgets/system_app_bar.dart';
24 import 'package:one_key/widgets/v_empty_view.dart'; 24 import 'package:one_key/widgets/v_empty_view.dart';
25 import 'package:provider/provider.dart'; 25 import 'package:provider/provider.dart';
  26 +import 'package:tpns_flutter_plugin/tpns_flutter_plugin.dart';
26 27
27 class IfNeedCreateStore extends StatefulWidget { 28 class IfNeedCreateStore extends StatefulWidget {
28 final List<CheckSellerAccSunModel> data; 29 final List<CheckSellerAccSunModel> data;
29 - IfNeedCreateStore({Key key, this.data}) : super(key: key); 30 + final bool changeStatus;
  31 + IfNeedCreateStore({Key key, this.data, this.changeStatus = false})
  32 + : super(key: key);
30 33
31 @override 34 @override
32 _IfNeedCreateStoreState createState() => _IfNeedCreateStoreState(); 35 _IfNeedCreateStoreState createState() => _IfNeedCreateStoreState();
@@ -122,183 +125,211 @@ class _IfNeedCreateStoreState extends State<IfNeedCreateStore> @@ -122,183 +125,211 @@ class _IfNeedCreateStoreState extends State<IfNeedCreateStore>
122 @override 125 @override
123 Widget build(BuildContext context) { 126 Widget build(BuildContext context) {
124 otherLoginProvider = Provider.of<OtherLoginProvider>(context, listen: true); 127 otherLoginProvider = Provider.of<OtherLoginProvider>(context, listen: true);
125 - return Scaffold(  
126 - backgroundColor: Colors.white,  
127 - appBar: SystemAppBar(  
128 - '',  
129 - // leftTitle: '上一步',  
130 - onTap: () {  
131 - Navigator.of(context).pop();  
132 - },  
133 - ),  
134 - body: Container(  
135 - // margin: EdgeInsets.only(bottom: ScreenUtil().setWidth(40)),  
136 - padding:  
137 - EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(70)),  
138 - child: Consumer<OtherLoginProvider>(builder: (context, model, _) {  
139 - if (model.pageState != PageState.Success) {  
140 - if (model.pageState == PageState.Empty) {  
141 - return Container(  
142 - width: double.infinity,  
143 - padding: EdgeInsets.all(ScreenUtil().setWidth(40)),  
144 - child:  
145 - Column(crossAxisAlignment: CrossAxisAlignment.center, 128 + return WillPopScope(
  129 + onWillPop: () async {
  130 + if (widget.changeStatus) {
  131 + EventBus().emit('changeStatusColor');
  132 + }
  133 +
  134 + return true;
  135 + },
  136 + child: Scaffold(
  137 + backgroundColor: Colors.white,
  138 + appBar: SystemAppBar(
  139 + '',
  140 + // leftTitle: '上一步',
  141 + onTap: () {
  142 + if (widget.changeStatus) {
  143 + EventBus().emit('changeStatusColor');
  144 + }
  145 + Navigator.of(context).pop();
  146 + },
  147 + ),
  148 + body: Container(
  149 + // margin: EdgeInsets.only(bottom: ScreenUtil().setWidth(40)),
  150 + padding:
  151 + EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(70)),
  152 + child:
  153 + Consumer<OtherLoginProvider>(builder: (context, model, _) {
  154 + if (model.pageState != PageState.Success) {
  155 + if (model.pageState == PageState.Empty) {
  156 + return Container(
  157 + width: double.infinity,
  158 + padding: EdgeInsets.all(ScreenUtil().setWidth(40)),
  159 + child: Column(
  160 + crossAxisAlignment: CrossAxisAlignment.center,
146 // mainAxisAlignment: MainAxisAlignment.center, 161 // mainAxisAlignment: MainAxisAlignment.center,
147 children: [ 162 children: [
148 - VEmptyView(80),  
149 - Image.asset(  
150 - Utils.getImgPath('not_member'),  
151 - width: ScreenUtil().setWidth(120),  
152 - height: ScreenUtil().setWidth(120),  
153 - ),  
154 - VEmptyView(60),  
155 - Text(  
156 - '您还没有绑定任何店铺',  
157 - style: TextStyle(  
158 - fontSize: ScreenUtil().setSp(32),  
159 - color: MyColours.color_333333,  
160 - fontWeight: FontWeight.bold),  
161 - ),  
162 - VEmptyView(172),  
163 - InkWell(  
164 - onTap: () {  
165 - // if (!App.sp.containsKey('openid') ||  
166 - // App.sp.get("openid") == null ||  
167 - // App.sp.get("openid") == '') {  
168 - //跳转小程序  
169 - Utils.goMiniProgramCreatePage(context);  
170 - // } else {  
171 - // //跳转至新建店铺流程  
172 - // NavigatorUtil.goEnterStoreNamePage(context);  
173 - // }  
174 - },  
175 - child: Container(  
176 - width: double.infinity,  
177 - padding: EdgeInsets.symmetric(  
178 - horizontal: ScreenUtil().setWidth(40),  
179 - vertical: ScreenUtil().setWidth(18)),  
180 - decoration: BoxDecoration(  
181 - color: MyColours.color_24A4A8,  
182 - borderRadius: BorderRadius.circular(  
183 - ScreenUtil().setWidth(10))),  
184 - child: Text(  
185 - '创建店铺',  
186 - textAlign: TextAlign.center,  
187 - maxLines: 1,  
188 - overflow: TextOverflow.ellipsis,  
189 - style: TextStyle(  
190 - color: MyColours.color_ffffff,  
191 - fontSize: ScreenUtil().setSp(34)),  
192 - ),  
193 - )),  
194 - ]));  
195 - }  
196 - return ExceptionPage(  
197 - pageState: model.pageState,  
198 - callback: () {  
199 - _checkSellerAcc(showLoading: true);  
200 - },  
201 - emptyMsg: "",  
202 - emptyImg: "empty_search",  
203 - showMsg: "加载中,请稍后...",  
204 - );  
205 - } else {  
206 - return Column(  
207 - children: [  
208 - VEmptyView(40),  
209 - Text(  
210 - '请选择您要进入的店铺',  
211 - style: TextStyle(  
212 - fontSize: ScreenUtil().setWidth(32),  
213 - color: MyColours.color_333333,  
214 - fontWeight: FontWeight.bold),  
215 - ),  
216 - VEmptyView(100),  
217 - Expanded(  
218 - child: GridView.builder(  
219 - padding: EdgeInsets.only(  
220 - bottom: ScreenUtil().setWidth(50)),  
221 - // controller: widget.scrollController,  
222 - // padding: EdgeInsets.only(top: ScreenUtil().getAdapterSize(10)),  
223 - shrinkWrap: true,  
224 - itemCount: model.sellerList.length + 1,  
225 - cacheExtent: ScreenUtil().setWidth(197 * 2),  
226 - //SliverGridDelegateWithFixedCrossAxisCount 构建一个横轴固定数量Widget  
227 - gridDelegate:  
228 - SliverGridDelegateWithFixedCrossAxisCount(  
229 - //横轴元素个数  
230 - crossAxisCount: 2,  
231 - //纵轴间距  
232 - mainAxisSpacing: ScreenUtil().setWidth(50),  
233 - //横轴间距  
234 - crossAxisSpacing: ScreenUtil().setWidth(50),  
235 - //子组件宽高长度比例  
236 - childAspectRatio: 140 / 197),  
237 - itemBuilder: (BuildContext context, int index) {  
238 - if (index == model.sellerList.length) {  
239 - return InkWell( 163 + VEmptyView(80),
  164 + Image.asset(
  165 + Utils.getImgPath('not_member'),
  166 + width: ScreenUtil().setWidth(120),
  167 + height: ScreenUtil().setWidth(120),
  168 + ),
  169 + VEmptyView(60),
  170 + Text(
  171 + '您还没有绑定任何店铺',
  172 + style: TextStyle(
  173 + fontSize: ScreenUtil().setSp(32),
  174 + color: MyColours.color_333333,
  175 + fontWeight: FontWeight.bold),
  176 + ),
  177 + VEmptyView(172),
  178 + InkWell(
240 onTap: () { 179 onTap: () {
241 // if (!App.sp.containsKey('openid') || 180 // if (!App.sp.containsKey('openid') ||
242 // App.sp.get("openid") == null || 181 // App.sp.get("openid") == null ||
243 // App.sp.get("openid") == '') { 182 // App.sp.get("openid") == '') {
244 - // //跳转小程序  
245 - // Utils.goMiniProgramCreatePage(context); 183 + //跳转小程序
  184 + Utils.goMiniProgramCreatePage(context);
246 // } else { 185 // } else {
247 - //跳转至新建店铺流程  
248 - NavigatorUtil.goEnterStoreNamePage(  
249 - context); 186 + // //跳转至新建店铺流程
  187 + // NavigatorUtil.goEnterStoreNamePage(context);
250 // } 188 // }
251 }, 189 },
252 - child: DottedBorder(  
253 - dashPattern: [5, 5, 5, 5],  
254 - borderType: BorderType.RRect,  
255 - radius: Radius.circular(  
256 - ScreenUtil().setWidth(10)),  
257 - // padding: EdgeInsets.all(ScreenUtil().setWidth(70)),  
258 - color: MyColours.color_cccccc,  
259 - strokeWidth: ScreenUtil().setWidth(2),  
260 - child: ClipRRect(  
261 - borderRadius: BorderRadius.all(  
262 - Radius.circular(12)),  
263 - child: Container(  
264 - height:  
265 - ScreenUtil().setWidth(197 * 2),  
266 - width: ScreenUtil().setWidth(140 * 2),  
267 - child: Column(  
268 - mainAxisAlignment:  
269 - MainAxisAlignment.center,  
270 - children: [  
271 - Image.asset(  
272 - Utils.getImgPath('add_store'),  
273 - width: ScreenUtil()  
274 - .setWidth(32)),  
275 - VEmptyView(10),  
276 - Text(  
277 - '创建店铺',  
278 - style: TextStyle(  
279 - color:  
280 - MyColours.color_999999,  
281 - fontSize:  
282 - ScreenUtil().setSp(24)),  
283 - )  
284 - ],  
285 - ),  
286 - ), 190 + child: Container(
  191 + width: double.infinity,
  192 + padding: EdgeInsets.symmetric(
  193 + horizontal: ScreenUtil().setWidth(40),
  194 + vertical: ScreenUtil().setWidth(18)),
  195 + decoration: BoxDecoration(
  196 + color: MyColours.color_24A4A8,
  197 + borderRadius: BorderRadius.circular(
  198 + ScreenUtil().setWidth(10))),
  199 + child: Text(
  200 + '创建店铺',
  201 + textAlign: TextAlign.center,
  202 + maxLines: 1,
  203 + overflow: TextOverflow.ellipsis,
  204 + style: TextStyle(
  205 + color: MyColours.color_ffffff,
  206 + fontSize: ScreenUtil().setSp(34)),
287 ), 207 ),
288 - ));  
289 - }  
290 - return InkWell(  
291 - onTap: () {  
292 - _loginStore(context, model.sellerList[index]);  
293 - },  
294 - child: IfNeedCreateStoreItem(  
295 - model: model.sellerList[index]),  
296 - );  
297 - })),  
298 - // VEmptyView(40),  
299 - ],  
300 - );  
301 - }  
302 - }))); 208 + )),
  209 + ]));
  210 + }
  211 + return ExceptionPage(
  212 + pageState: model.pageState,
  213 + callback: () {
  214 + _checkSellerAcc(showLoading: true);
  215 + },
  216 + emptyMsg: "",
  217 + emptyImg: "empty_search",
  218 + showMsg: "加载中,请稍后...",
  219 + );
  220 + } else {
  221 + return Column(
  222 + children: [
  223 + VEmptyView(40),
  224 + Text(
  225 + '请选择您要进入的店铺',
  226 + style: TextStyle(
  227 + fontSize: ScreenUtil().setWidth(32),
  228 + color: MyColours.color_333333,
  229 + fontWeight: FontWeight.bold),
  230 + ),
  231 + VEmptyView(100),
  232 + Expanded(
  233 + child: GridView.builder(
  234 + padding: EdgeInsets.only(
  235 + bottom: ScreenUtil().setWidth(50)),
  236 + // controller: widget.scrollController,
  237 + // padding: EdgeInsets.only(top: ScreenUtil().getAdapterSize(10)),
  238 + shrinkWrap: true,
  239 + itemCount: model.sellerList.length + 1,
  240 + cacheExtent: ScreenUtil().setWidth(197 * 2),
  241 + //SliverGridDelegateWithFixedCrossAxisCount 构建一个横轴固定数量Widget
  242 + gridDelegate:
  243 + SliverGridDelegateWithFixedCrossAxisCount(
  244 + //横轴元素个数
  245 + crossAxisCount: 2,
  246 + //纵轴间距
  247 + mainAxisSpacing:
  248 + ScreenUtil().setWidth(50),
  249 + //横轴间距
  250 + crossAxisSpacing:
  251 + ScreenUtil().setWidth(50),
  252 + //子组件宽高长度比例
  253 + childAspectRatio: 140 / 197),
  254 + itemBuilder: (BuildContext context, int index) {
  255 + if (index == model.sellerList.length) {
  256 + return InkWell(
  257 + onTap: () {
  258 + // if (!App.sp.containsKey('openid') ||
  259 + // App.sp.get("openid") == null ||
  260 + // App.sp.get("openid") == '') {
  261 + // //跳转小程序
  262 + // Utils.goMiniProgramCreatePage(context);
  263 + // } else {
  264 + //跳转至新建店铺流程
  265 + NavigatorUtil.goEnterStoreNamePage(
  266 + context);
  267 + // }
  268 + },
  269 + child: DottedBorder(
  270 + dashPattern: [5, 5, 5, 5],
  271 + borderType: BorderType.RRect,
  272 + radius: Radius.circular(
  273 + ScreenUtil().setWidth(10)),
  274 + // padding: EdgeInsets.all(ScreenUtil().setWidth(70)),
  275 + color: MyColours.color_cccccc,
  276 + strokeWidth: ScreenUtil().setWidth(2),
  277 + child: ClipRRect(
  278 + borderRadius: BorderRadius.all(
  279 + Radius.circular(12)),
  280 + child: Container(
  281 + height: ScreenUtil()
  282 + .setWidth(197 * 2),
  283 + width: ScreenUtil()
  284 + .setWidth(140 * 2),
  285 + child: Column(
  286 + mainAxisAlignment:
  287 + MainAxisAlignment.center,
  288 + children: [
  289 + Image.asset(
  290 + Utils.getImgPath(
  291 + 'add_store'),
  292 + width: ScreenUtil()
  293 + .setWidth(32)),
  294 + VEmptyView(10),
  295 + Text(
  296 + '创建店铺',
  297 + style: TextStyle(
  298 + color: MyColours
  299 + .color_999999,
  300 + fontSize: ScreenUtil()
  301 + .setSp(24)),
  302 + )
  303 + ],
  304 + ),
  305 + ),
  306 + ),
  307 + ));
  308 + }
  309 + return InkWell(
  310 + onTap: () async {
  311 + UserModel userModel =
  312 + Provider.of<UserModel>(context,
  313 + listen: false);
  314 + bool success = await userModel
  315 + .loginOutOnly(context, {
  316 + "seller_code":
  317 + userModel.user.sellercode,
  318 + "account": userModel.user.account
  319 + });
  320 + if (success) {
  321 + _loginStore(
  322 + context, model.sellerList[index]);
  323 + }
  324 + },
  325 + child: IfNeedCreateStoreItem(
  326 + model: model.sellerList[index]),
  327 + );
  328 + })),
  329 + // VEmptyView(40),
  330 + ],
  331 + );
  332 + }
  333 + }))));
303 } 334 }
304 } 335 }
@@ -222,40 +222,23 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { @@ -222,40 +222,23 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
222 )), 222 )),
223 Positioned( 223 Positioned(
224 right: ScreenUtil().setWidth(40), 224 right: ScreenUtil().setWidth(40),
225 - bottom: ScreenUtil().setWidth(190), 225 + bottom: ScreenUtil().setWidth(156),
226 child: RoundButton( 226 child: RoundButton(
227 - image: Utils.getImgPath('edit'),  
228 - text: '店铺信息',  
229 - gradientStart: Color.fromRGBO(255, 255, 255, 0.1),  
230 - gradientEnd: Color.fromRGBO(255, 255, 255, 0.1),  
231 - borderColor: Color.fromRGBO(255, 255, 255, 0.2),  
232 - width: ScreenUtil().setWidth(195),  
233 - height: ScreenUtil().setWidth(60), 227 + text: '切换店铺',
  228 + gradientStart: MyColours.color_ffffff,
  229 + gradientEnd: MyColours.color_ffffff,
  230 + borderColor: MyColours.color_ffffff,
  231 + width: ScreenUtil().setWidth(150),
  232 + height: ScreenUtil().setWidth(56),
234 fontSize: 28, 233 fontSize: 28,
235 isBold: false, 234 isBold: false,
236 - imgWidth: 26, 235 + textColor: MyColours.color_199095,
  236 + radius: ScreenUtil().setWidth(20),
237 onPressed: () { 237 onPressed: () {
238 - NavigatorUtil.goStoreBaseInfoPage(context); 238 + NavigatorUtil.goIfNeedCreateStorePage(context,
  239 + changeStatus: true);
239 }, 240 },
240 )), 241 )),
241 - Positioned(  
242 - right: ScreenUtil().setWidth(40),  
243 - bottom: ScreenUtil().setWidth(110),  
244 - child: RoundButton(  
245 - image: Utils.getImgPath('edit'),  
246 - text: '个人信息',  
247 - gradientStart: Color.fromRGBO(255, 255, 255, 0.1),  
248 - gradientEnd: Color.fromRGBO(255, 255, 255, 0.1),  
249 - borderColor: Color.fromRGBO(255, 255, 255, 0.2),  
250 - width: ScreenUtil().setWidth(195),  
251 - height: ScreenUtil().setWidth(60),  
252 - fontSize: 28,  
253 - isBold: false,  
254 - imgWidth: 26,  
255 - onPressed: () {  
256 - NavigatorUtil.goBaseInfoPage(context);  
257 - },  
258 - ))  
259 ], 242 ],
260 ); 243 );
261 }), 244 }),
@@ -350,6 +333,32 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { @@ -350,6 +333,32 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
350 333
351 VEmptyView(40), 334 VEmptyView(40),
352 MyItem( 335 MyItem(
  336 + title: "个人信息",
  337 + content: "",
  338 + callback: () {
  339 + NavigatorUtil.goBaseInfoPage(context);
  340 + },
  341 + ),
  342 +
  343 + MyDivider(
  344 + double.infinity,
  345 + ScreenUtil().setHeight(1),
  346 + color: MyColours.color_f3f3f3,
  347 + ),
  348 + MyItem(
  349 + title: "店铺信息",
  350 + content: "",
  351 + callback: () {
  352 + NavigatorUtil.goStoreBaseInfoPage(context);
  353 + },
  354 + ),
  355 +
  356 + MyDivider(
  357 + double.infinity,
  358 + ScreenUtil().setHeight(1),
  359 + color: MyColours.color_f3f3f3,
  360 + ),
  361 + MyItem(
353 title: "短信管理", 362 title: "短信管理",
354 content: 363 content:
355 myModel.smsInfo.isNotEmpty ? '剩余${myModel.smsInfo}条' : '', 364 myModel.smsInfo.isNotEmpty ? '剩余${myModel.smsInfo}条' : '',
@@ -391,11 +400,6 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { @@ -391,11 +400,6 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
391 ScreenUtil().setHeight(1), 400 ScreenUtil().setHeight(1),
392 color: MyColours.color_f3f3f3, 401 color: MyColours.color_f3f3f3,
393 ), 402 ),
394 - MyDivider(  
395 - double.infinity,  
396 - ScreenUtil().setHeight(1),  
397 - color: MyColours.color_f3f3f3,  
398 - ),  
399 403
400 MyItem( 404 MyItem(
401 title: "员工管理", 405 title: "员工管理",
@@ -218,7 +218,7 @@ class UserModel with ChangeNotifier { @@ -218,7 +218,7 @@ class UserModel with ChangeNotifier {
218 if (baseResp != null && baseResp.code == Constant.status_success) {} 218 if (baseResp != null && baseResp.code == Constant.status_success) {}
219 } 219 }
220 220
221 - //版本更新弹框 221 + //退出登录弹框
222 showLoginOutDialog(BuildContext pageContext) { 222 showLoginOutDialog(BuildContext pageContext) {
223 showDialog( 223 showDialog(
224 context: pageContext, 224 context: pageContext,
@@ -327,6 +327,23 @@ class UserModel with ChangeNotifier { @@ -327,6 +327,23 @@ class UserModel with ChangeNotifier {
327 } 327 }
328 } 328 }
329 329
  330 + ///切换店铺时的退出登录
  331 + Future<bool> loginOutOnly(
  332 + BuildContext context, Map<String, String> params) async {
  333 + BaseResp<int> baseResp = await DioUtil()
  334 + .request<int>(context, Method.get, HttpUrl.login_out, data: params)
  335 + .catchError((error) {
  336 + print(error.toString());
  337 + });
  338 + if (baseResp.code != Constant.status_success) {
  339 + Utils.showToast(baseResp.msg ?? "切换店铺失败,请稍后重试");
  340 + return false;
  341 + } else {
  342 + XgFlutterPlugin().stopXg();
  343 + return true;
  344 + }
  345 + }
  346 +
330 /// 保存用户信息到 sp 347 /// 保存用户信息到 sp
331 saveUserInfo(User user) { 348 saveUserInfo(User user) {
332 _user = user; 349 _user = user;
@@ -281,9 +281,9 @@ class NavigatorUtil { @@ -281,9 +281,9 @@ class NavigatorUtil {
281 281
282 /// 是否新建店铺页面 282 /// 是否新建店铺页面
283 static Future<dynamic> goIfNeedCreateStorePage(BuildContext context, 283 static Future<dynamic> goIfNeedCreateStorePage(BuildContext context,
284 - {replace = false, bool noStore}) {  
285 - return _navigateTo(  
286 - context, "${Routes.if_need_create_store}?noStore=${noStore}", 284 + {replace = false, bool noStore, bool changeStatus = false}) {
  285 + return _navigateTo(context,
  286 + "${Routes.if_need_create_store}?noStore=${noStore}&changeStatus=${changeStatus}",
287 replace: replace); 287 replace: replace);
288 } 288 }
289 289
@@ -500,8 +500,11 @@ var ifNeedCreateStorePageHandler = new Handler( @@ -500,8 +500,11 @@ var ifNeedCreateStorePageHandler = new Handler(
500 handlerFunc: (BuildContext context, Map<String, List<Object>> params) { 500 handlerFunc: (BuildContext context, Map<String, List<Object>> params) {
501 // CouponSunModel couponSunModel = CouponSunModel.fromJson(json.decode( 501 // CouponSunModel couponSunModel = CouponSunModel.fromJson(json.decode(
502 // FluroConvertUtils.fluroCnParamsDecode(params["couponSunModel"].first))); 502 // FluroConvertUtils.fluroCnParamsDecode(params["couponSunModel"].first)));
  503 + bool changeStatus =
  504 + FluroConvertUtils.string2bool(params["changeStatus"].first);
503 return ChangeNotifierProvider<OtherLoginProvider>( 505 return ChangeNotifierProvider<OtherLoginProvider>(
504 - create: (_) => OtherLoginProvider(), child: IfNeedCreateStore()); 506 + create: (_) => OtherLoginProvider(),
  507 + child: IfNeedCreateStore(changeStatus: changeStatus));
505 }); 508 });
506 509
507 ///新建店铺页面 510 ///新建店铺页面
@@ -1173,13 +1176,13 @@ var myCustomerOrderPageHandle = new Handler( @@ -1173,13 +1176,13 @@ var myCustomerOrderPageHandle = new Handler(
1173 ///客情列表详情---再次预订 1176 ///客情列表详情---再次预订
1174 var tableManagerPageHandle = new Handler( 1177 var tableManagerPageHandle = new Handler(
1175 handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) { 1178 handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) {
1176 - Guest guest = Guest.fromJson(json 1179 + Guest guest = Guest.fromJson(json
1177 .decode(FluroConvertUtils.fluroCnParamsDecode(params["guest"].first))); 1180 .decode(FluroConvertUtils.fluroCnParamsDecode(params["guest"].first)));
1178 // UserHistoryEntity userHistoryEntity = UserHistoryEntity.fromJson(json.decode( 1181 // UserHistoryEntity userHistoryEntity = UserHistoryEntity.fromJson(json.decode(
1179 // FluroConvertUtils.fluroCnParamsDecode( 1182 // FluroConvertUtils.fluroCnParamsDecode(
1180 // params["userHistoryEntity"].first))); 1183 // params["userHistoryEntity"].first)));
1181 return ChangeNotifierProvider<TableManagerModel>( 1184 return ChangeNotifierProvider<TableManagerModel>(
1182 create: (_) => TableManagerModel(), 1185 create: (_) => TableManagerModel(),
1183 - child: TableManagerPage(guest:guest), 1186 + child: TableManagerPage(guest: guest),
1184 ); 1187 );
1185 }); 1188 });