|
...
|
...
|
@@ -173,205 +173,224 @@ class _IfNeedCreateStoreState extends State<IfNeedCreateStore> |
|
|
|
},
|
|
|
|
child: Scaffold(
|
|
|
|
backgroundColor: Colors.white,
|
|
|
|
appBar: SystemAppBar(
|
|
|
|
'',
|
|
|
|
// leftTitle: '上一步',
|
|
|
|
onTap: () {
|
|
|
|
if (widget.changeStatus) {
|
|
|
|
EventBus().emit('changeStatusColor');
|
|
|
|
}
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
},
|
|
|
|
),
|
|
|
|
appBar: SystemAppBar('选择店铺',
|
|
|
|
// leftTitle: '上一步',
|
|
|
|
onTap: () {
|
|
|
|
if (widget.changeStatus) {
|
|
|
|
EventBus().emit('changeStatusColor');
|
|
|
|
}
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
},
|
|
|
|
rightImgName: 'add_check_store.png',
|
|
|
|
onTapRight: () {
|
|
|
|
if (otherLoginProvider.pageState != PageState.Success) {
|
|
|
|
// if (!App.sp.containsKey('openid') ||
|
|
|
|
// App.sp.get("openid") == null ||
|
|
|
|
// App.sp.get("openid") == '') {
|
|
|
|
//跳转小程序
|
|
|
|
Utils.goMiniProgramCreatePage(context);
|
|
|
|
// } else {
|
|
|
|
// //跳转至新建店铺流程
|
|
|
|
// NavigatorUtil.goEnterStoreNamePage(context);
|
|
|
|
// }
|
|
|
|
} else {
|
|
|
|
// if (!App.sp.containsKey('openid') ||
|
|
|
|
// App.sp.get("openid") == null ||
|
|
|
|
// App.sp.get("openid") == '') {
|
|
|
|
// //跳转小程序
|
|
|
|
// Utils.goMiniProgramCreatePage(context);
|
|
|
|
// } else {
|
|
|
|
//跳转至新建店铺流程
|
|
|
|
NavigatorUtil.goEnterStoreNamePage(context);
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
body: Container(
|
|
|
|
// margin: EdgeInsets.only(bottom: ScreenUtil().setWidth(40)),
|
|
|
|
padding:
|
|
|
|
EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(70)),
|
|
|
|
EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(48)),
|
|
|
|
child:
|
|
|
|
Consumer<OtherLoginProvider>(builder: (context, model, _) {
|
|
|
|
if (model.pageState != PageState.Success) {
|
|
|
|
if (model.pageState == PageState.Empty) {
|
|
|
|
return Container(
|
|
|
|
width: double.infinity,
|
|
|
|
padding: EdgeInsets.all(ScreenUtil().setWidth(40)),
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
VEmptyView(80),
|
|
|
|
Image.asset(
|
|
|
|
Utils.getImgPath('not_member'),
|
|
|
|
width: ScreenUtil().setWidth(120),
|
|
|
|
height: ScreenUtil().setWidth(120),
|
|
|
|
),
|
|
|
|
VEmptyView(60),
|
|
|
|
Text(
|
|
|
|
'您还没有绑定任何店铺',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(32),
|
|
|
|
color: MyColours.color_333333,
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
),
|
|
|
|
VEmptyView(172),
|
|
|
|
InkWell(
|
|
|
|
onTap: () {
|
|
|
|
// if (!App.sp.containsKey('openid') ||
|
|
|
|
// App.sp.get("openid") == null ||
|
|
|
|
// App.sp.get("openid") == '') {
|
|
|
|
//跳转小程序
|
|
|
|
Utils.goMiniProgramCreatePage(context);
|
|
|
|
// } else {
|
|
|
|
// //跳转至新建店铺流程
|
|
|
|
// NavigatorUtil.goEnterStoreNamePage(context);
|
|
|
|
// }
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
width: double.infinity,
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(40),
|
|
|
|
vertical: ScreenUtil().setWidth(18)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: MyColours.color_24A4A8,
|
|
|
|
borderRadius: BorderRadius.circular(
|
|
|
|
ScreenUtil().setWidth(10))),
|
|
|
|
child: Text(
|
|
|
|
'创建店铺',
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
maxLines: 1,
|
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
fontSize: ScreenUtil().setSp(34)),
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
]));
|
|
|
|
}
|
|
|
|
// if (model.pageState == PageState.Empty) {
|
|
|
|
// return Container(
|
|
|
|
// width: double.infinity,
|
|
|
|
// padding: EdgeInsets.all(ScreenUtil().setWidth(40)),
|
|
|
|
// child: Column(
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
// // mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
// children: [
|
|
|
|
// VEmptyView(80),
|
|
|
|
// Image.asset(
|
|
|
|
// Utils.getImgPath('not_member'),
|
|
|
|
// width: ScreenUtil().setWidth(120),
|
|
|
|
// height: ScreenUtil().setWidth(120),
|
|
|
|
// ),
|
|
|
|
// VEmptyView(60),
|
|
|
|
// Text(
|
|
|
|
// '您还没有绑定任何店铺',
|
|
|
|
// style: TextStyle(
|
|
|
|
// fontSize: ScreenUtil().setSp(32),
|
|
|
|
// color: MyColours.color_333333,
|
|
|
|
// fontWeight: FontWeight.bold),
|
|
|
|
// ),
|
|
|
|
// VEmptyView(172),
|
|
|
|
// InkWell(
|
|
|
|
// onTap: () {
|
|
|
|
// // if (!App.sp.containsKey('openid') ||
|
|
|
|
// // App.sp.get("openid") == null ||
|
|
|
|
// // App.sp.get("openid") == '') {
|
|
|
|
// //跳转小程序
|
|
|
|
// Utils.goMiniProgramCreatePage(context);
|
|
|
|
// // } else {
|
|
|
|
// // //跳转至新建店铺流程
|
|
|
|
// // NavigatorUtil.goEnterStoreNamePage(context);
|
|
|
|
// // }
|
|
|
|
// },
|
|
|
|
// child: Container(
|
|
|
|
// width: double.infinity,
|
|
|
|
// padding: EdgeInsets.symmetric(
|
|
|
|
// horizontal: ScreenUtil().setWidth(40),
|
|
|
|
// vertical: ScreenUtil().setWidth(18)),
|
|
|
|
// decoration: BoxDecoration(
|
|
|
|
// color: MyColours.color_24A4A8,
|
|
|
|
// borderRadius: BorderRadius.circular(
|
|
|
|
// ScreenUtil().setWidth(10))),
|
|
|
|
// child: Text(
|
|
|
|
// '创建店铺',
|
|
|
|
// textAlign: TextAlign.center,
|
|
|
|
// maxLines: 1,
|
|
|
|
// overflow: TextOverflow.ellipsis,
|
|
|
|
// style: TextStyle(
|
|
|
|
// color: MyColours.color_ffffff,
|
|
|
|
// fontSize: ScreenUtil().setSp(34)),
|
|
|
|
// ),
|
|
|
|
// )),
|
|
|
|
// ]));
|
|
|
|
// }
|
|
|
|
return ExceptionPage(
|
|
|
|
pageState: model.pageState,
|
|
|
|
callback: () {
|
|
|
|
_checkSellerAcc(showLoading: true);
|
|
|
|
},
|
|
|
|
emptyMsg: "",
|
|
|
|
emptyMsg: "您还没有绑定任何店铺",
|
|
|
|
emptyImg: "empty_search",
|
|
|
|
showMsg: "加载中,请稍后...",
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
return Column(
|
|
|
|
children: [
|
|
|
|
VEmptyView(40),
|
|
|
|
Text(
|
|
|
|
'请选择您要进入的店铺',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setWidth(32),
|
|
|
|
color: MyColours.color_333333,
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
),
|
|
|
|
VEmptyView(100),
|
|
|
|
Expanded(
|
|
|
|
child: GridView.builder(
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
bottom: ScreenUtil().setWidth(50)),
|
|
|
|
// controller: widget.scrollController,
|
|
|
|
// padding: EdgeInsets.only(top: ScreenUtil().getAdapterSize(10)),
|
|
|
|
shrinkWrap: true,
|
|
|
|
itemCount: model.sellerList.length + 1,
|
|
|
|
cacheExtent: ScreenUtil().setWidth(197 * 2),
|
|
|
|
//SliverGridDelegateWithFixedCrossAxisCount 构建一个横轴固定数量Widget
|
|
|
|
gridDelegate:
|
|
|
|
SliverGridDelegateWithFixedCrossAxisCount(
|
|
|
|
//横轴元素个数
|
|
|
|
crossAxisCount: 2,
|
|
|
|
//纵轴间距
|
|
|
|
mainAxisSpacing:
|
|
|
|
ScreenUtil().setWidth(50),
|
|
|
|
//横轴间距
|
|
|
|
crossAxisSpacing:
|
|
|
|
ScreenUtil().setWidth(50),
|
|
|
|
//子组件宽高长度比例
|
|
|
|
childAspectRatio: 140 / 197),
|
|
|
|
itemBuilder: (BuildContext context, int index) {
|
|
|
|
if (index == model.sellerList.length) {
|
|
|
|
return InkWell(
|
|
|
|
onTap: () {
|
|
|
|
// if (!App.sp.containsKey('openid') ||
|
|
|
|
// App.sp.get("openid") == null ||
|
|
|
|
// App.sp.get("openid") == '') {
|
|
|
|
// //跳转小程序
|
|
|
|
// Utils.goMiniProgramCreatePage(context);
|
|
|
|
// } else {
|
|
|
|
//跳转至新建店铺流程
|
|
|
|
NavigatorUtil.goEnterStoreNamePage(
|
|
|
|
context);
|
|
|
|
// }
|
|
|
|
},
|
|
|
|
child: DottedBorder(
|
|
|
|
dashPattern: [5, 5, 5, 5],
|
|
|
|
borderType: BorderType.RRect,
|
|
|
|
radius: Radius.circular(
|
|
|
|
ScreenUtil().setWidth(10)),
|
|
|
|
// padding: EdgeInsets.all(ScreenUtil().setWidth(70)),
|
|
|
|
color: MyColours.color_cccccc,
|
|
|
|
strokeWidth: ScreenUtil().setWidth(2),
|
|
|
|
child: ClipRRect(
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
Radius.circular(12)),
|
|
|
|
child: Container(
|
|
|
|
height: ScreenUtil()
|
|
|
|
.setWidth(197 * 2),
|
|
|
|
width: ScreenUtil()
|
|
|
|
.setWidth(140 * 2),
|
|
|
|
child: Column(
|
|
|
|
mainAxisAlignment:
|
|
|
|
MainAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
Image.asset(
|
|
|
|
Utils.getImgPath(
|
|
|
|
'add_store'),
|
|
|
|
width: ScreenUtil()
|
|
|
|
.setWidth(32)),
|
|
|
|
VEmptyView(10),
|
|
|
|
Text(
|
|
|
|
'创建店铺',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours
|
|
|
|
.color_999999,
|
|
|
|
fontSize: ScreenUtil()
|
|
|
|
.setSp(24)),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
));
|
|
|
|
return
|
|
|
|
// VEmptyView(40),
|
|
|
|
// Text(
|
|
|
|
// '请选择您要进入的店铺',
|
|
|
|
// style: TextStyle(
|
|
|
|
// fontSize: ScreenUtil().setWidth(32),
|
|
|
|
// color: MyColours.color_333333,
|
|
|
|
// fontWeight: FontWeight.bold),
|
|
|
|
// ),
|
|
|
|
// VEmptyView(100),
|
|
|
|
ListView.builder(
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
top: ScreenUtil().setWidth(50),
|
|
|
|
bottom: ScreenUtil().setWidth(20)),
|
|
|
|
// controller: widget.scrollController,
|
|
|
|
// padding: EdgeInsets.only(top: ScreenUtil().getAdapterSize(10)),
|
|
|
|
shrinkWrap: true,
|
|
|
|
itemCount: model.sellerList.length,
|
|
|
|
// cacheExtent: ScreenUtil().setWidth(197 * 2),
|
|
|
|
//SliverGridDelegateWithFixedCrossAxisCount 构建一个横轴固定数量Widget
|
|
|
|
// gridDelegate:
|
|
|
|
// SliverGridDelegateWithFixedCrossAxisCount(
|
|
|
|
// //横轴元素个数
|
|
|
|
// crossAxisCount: 2,
|
|
|
|
// //纵轴间距
|
|
|
|
// mainAxisSpacing:
|
|
|
|
// ScreenUtil().setWidth(50),
|
|
|
|
// //横轴间距
|
|
|
|
// crossAxisSpacing:
|
|
|
|
// ScreenUtil().setWidth(50),
|
|
|
|
// //子组件宽高长度比例
|
|
|
|
// childAspectRatio: 140 / 197),
|
|
|
|
itemBuilder: (BuildContext context, int index) {
|
|
|
|
// if (index == model.sellerList.length) {
|
|
|
|
// return InkWell(
|
|
|
|
// onTap: () {
|
|
|
|
// // if (!App.sp.containsKey('openid') ||
|
|
|
|
// // App.sp.get("openid") == null ||
|
|
|
|
// // App.sp.get("openid") == '') {
|
|
|
|
// // //跳转小程序
|
|
|
|
// // Utils.goMiniProgramCreatePage(context);
|
|
|
|
// // } else {
|
|
|
|
// //跳转至新建店铺流程
|
|
|
|
// NavigatorUtil.goEnterStoreNamePage(
|
|
|
|
// context);
|
|
|
|
// // }
|
|
|
|
// },
|
|
|
|
// child: DottedBorder(
|
|
|
|
// dashPattern: [5, 5, 5, 5],
|
|
|
|
// borderType: BorderType.RRect,
|
|
|
|
// radius: Radius.circular(
|
|
|
|
// ScreenUtil().setWidth(10)),
|
|
|
|
// // padding: EdgeInsets.all(ScreenUtil().setWidth(70)),
|
|
|
|
// color: MyColours.color_cccccc,
|
|
|
|
// strokeWidth: ScreenUtil().setWidth(2),
|
|
|
|
// child: ClipRRect(
|
|
|
|
// borderRadius: BorderRadius.all(
|
|
|
|
// Radius.circular(12)),
|
|
|
|
// child: Container(
|
|
|
|
// height: ScreenUtil()
|
|
|
|
// .setWidth(197 * 2),
|
|
|
|
// width: ScreenUtil()
|
|
|
|
// .setWidth(140 * 2),
|
|
|
|
// child: Column(
|
|
|
|
// mainAxisAlignment:
|
|
|
|
// MainAxisAlignment.center,
|
|
|
|
// children: [
|
|
|
|
// Image.asset(
|
|
|
|
// Utils.getImgPath(
|
|
|
|
// 'add_store'),
|
|
|
|
// width: ScreenUtil()
|
|
|
|
// .setWidth(32)),
|
|
|
|
// VEmptyView(10),
|
|
|
|
// Text(
|
|
|
|
// '创建店铺',
|
|
|
|
// style: TextStyle(
|
|
|
|
// color: MyColours
|
|
|
|
// .color_999999,
|
|
|
|
// fontSize: ScreenUtil()
|
|
|
|
// .setSp(24)),
|
|
|
|
// )
|
|
|
|
// ],
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// ));
|
|
|
|
// }
|
|
|
|
return InkWell(
|
|
|
|
onTap: () async {
|
|
|
|
if (widget.changeStatus) {
|
|
|
|
UserModel userModel =
|
|
|
|
Provider.of<UserModel>(context,
|
|
|
|
listen: false);
|
|
|
|
bool success = await userModel.loginOutOnly(
|
|
|
|
context, {
|
|
|
|
"seller_code": userModel.user.sellercode,
|
|
|
|
"account": userModel.user.account
|
|
|
|
});
|
|
|
|
if (success) {
|
|
|
|
_clickStore(
|
|
|
|
context, model.sellerList[index]);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
_clickStore(
|
|
|
|
context, model.sellerList[index]);
|
|
|
|
}
|
|
|
|
return InkWell(
|
|
|
|
onTap: () async {
|
|
|
|
if (widget.changeStatus) {
|
|
|
|
UserModel userModel =
|
|
|
|
Provider.of<UserModel>(context,
|
|
|
|
listen: false);
|
|
|
|
bool success = await userModel
|
|
|
|
.loginOutOnly(context, {
|
|
|
|
"seller_code":
|
|
|
|
userModel.user.sellercode,
|
|
|
|
"account": userModel.user.account
|
|
|
|
});
|
|
|
|
if (success) {
|
|
|
|
_clickStore(
|
|
|
|
context, model.sellerList[index]);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
_clickStore(
|
|
|
|
context, model.sellerList[index]);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
child: IfNeedCreateStoreItem(
|
|
|
|
model: model.sellerList[index]),
|
|
|
|
);
|
|
|
|
})),
|
|
|
|
// VEmptyView(40),
|
|
|
|
],
|
|
|
|
);
|
|
|
|
},
|
|
|
|
child: IfNeedCreateStoreItem(
|
|
|
|
model: model.sellerList[index]),
|
|
|
|
);
|
|
|
|
});
|
|
|
|
// VEmptyView(40),
|
|
|
|
|
|
|
|
}
|
|
|
|
}))));
|
|
|
|
}
|
...
|
...
|
|