Commit 941293342d45488e1c638eae969511733a42a533

Authored by wdn127929
1 parent 5e48db50

切换店铺页面调整

... ... @@ -12,14 +12,14 @@ if (flutterRoot == null) {
}
def flutterVersionCode = "351"
def flutterVersionCode = "352"
if (flutterVersionCode == null) {
flutterVersionCode = '351'
flutterVersionCode = '352'
}
def flutterVersionName = "3.5.1"
def flutterVersionName = "3.5.2"
if (flutterVersionName == null) {
flutterVersionName = '3.5.1'
flutterVersionName = '3.5.2'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
... ...
... ... @@ -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),
}
}))));
}
... ...
... ... @@ -3,6 +3,7 @@ import 'package:flutter_screenutil/screenutil.dart';
import 'package:one_key/models/check_seller_acc_model.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/utils/utils.dart';
import 'package:one_key/widgets/h_empty_view.dart';
import 'package:one_key/widgets/v_empty_view.dart';
class IfNeedCreateStoreItem extends StatefulWidget {
... ... @@ -16,62 +17,69 @@ class IfNeedCreateStoreItem extends StatefulWidget {
class _IfNeedCreateStoreItemState extends State<IfNeedCreateStoreItem> {
@override
Widget build(BuildContext context) {
return Stack(
children: [
Container(
decoration: BoxDecoration(
border: Border.all(
width: ScreenUtil().setWidth(2),
color: MyColours.color_D7F7F7),
borderRadius: BorderRadius.circular(ScreenUtil().setWidth(10))),
),
Positioned(
top: 0,
left: 0,
child: ClipRRect(
//圆角图片
borderRadius: BorderRadius.only(
topRight: Radius.circular(ScreenUtil().setWidth(10)),
topLeft: Radius.circular(ScreenUtil().setWidth(10))),
child: widget.model.sellerImage != ''
? Image.network(
widget.model.sellerImage,
fit: BoxFit.cover,
width: ScreenUtil().setWidth(140 * 2),
height: ScreenUtil().setWidth(140 * 2),
)
: Image.asset(
Utils.getImgPath('no_image'),
fit: BoxFit.cover,
width: ScreenUtil().setWidth(140 * 2),
height: ScreenUtil().setWidth(140 * 2),
),
)),
Positioned(
bottom: 0,
left: ScreenUtil().setWidth(20),
right: ScreenUtil().setWidth(20),
child: Padding(
child: Column(
children: [
Text('${widget.model.sellername}',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: ScreenUtil().setWidth(30),
color: MyColours.color_333333)),
VEmptyView(10),
Text('${widget.model.roleName}',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: ScreenUtil().setWidth(24),
color: MyColours.color_666666))
],
),
padding:
EdgeInsets.symmetric(vertical: ScreenUtil().setWidth(14))))
],
);
return Container(
height: ScreenUtil().setWidth(57 * 2),
padding: EdgeInsets.only(
left: ScreenUtil().setWidth(24 * 2),
right: ScreenUtil().setWidth(35 * 2)),
margin: EdgeInsets.only(bottom: ScreenUtil().setWidth(40)),
decoration: BoxDecoration(
color: MyColours.color_ffffff,
boxShadow: [
BoxShadow(
color: Color.fromRGBO(67, 142, 147, 0.3),
spreadRadius: ScreenUtil().setWidth(2),
blurRadius: ScreenUtil().setWidth(8))
],
border: Border.all(
width: ScreenUtil().setWidth(2), color: MyColours.color_438E93),
borderRadius: BorderRadius.circular(ScreenUtil().setWidth(16))),
child: Row(
children: [
// Positioned(
// top: 0,
// left: 0,
// child: ClipRRect(
// //圆角图片
// borderRadius: BorderRadius.only(
// topRight: Radius.circular(ScreenUtil().setWidth(10)),
// topLeft: Radius.circular(ScreenUtil().setWidth(10))),
// child: widget.model.sellerImage != ''
// ? Image.network(
// widget.model.sellerImage,
// fit: BoxFit.cover,
// width: ScreenUtil().setWidth(140 * 2),
// height: ScreenUtil().setWidth(140 * 2),
// )
// : Image.asset(
// Utils.getImgPath('no_image'),
// fit: BoxFit.cover,
// width: ScreenUtil().setWidth(140 * 2),
// height: ScreenUtil().setWidth(140 * 2),
// ),
// )),
Container(
width: ScreenUtil().setWidth(160 * 2),
child: Text('${widget.model.sellername}',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: ScreenUtil().setWidth(32),
color: MyColours.color_515151)),
),
Spacer(),
Text('${widget.model.roleName}',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: ScreenUtil().setWidth(32),
color: MyColours.color_999999)),
HEmptyView(40),
Image.asset(
Utils.getImgPath('enter_store_arrow_r'),
width: ScreenUtil().setWidth(20),
)
],
));
}
}
... ...
import 'package:flutter/material.dart';
class MyColours {
static const Color color_515151 = Color(0xff515151);
static const Color color_438E93 = Color(0xff438E93);
static const Color color_27262B = Color(0xff27262B);
static const Color color_BFC4D4 = Color(0xffBFC4D4);
... ...
... ... @@ -76,8 +76,10 @@ class SystemAppBar extends StatelessWidget implements PreferredSizeWidget {
child: Padding(
padding: EdgeInsets.only(right: ScreenUtil().setWidth(40)),
child: rightImgName.endsWith('png')
? Image.asset(Utils.getImgPath(rightImgName),
width: ScreenUtil().setWidth(40))
? Image.asset(
Utils.getImgPath(
rightImgName.replaceAll('.png', '')),
width: ScreenUtil().setWidth(48))
: Container(
// color: Colors.red,
alignment: Alignment.center,
... ...