Browse Source

修改手机密码接口对接完成;

商品列表板块数据需求待确认,接口已确认,数据暂未对接;
流水日期选择已优化完成;
商品下架页面对接完成;
商品上下架接口已确认,为对接;
刷新时接口请求失败的状态更改;
wr_2023_business
wurong 1 year ago
parent
commit
8296149b67
  1. 121
      lib/business_system/date_select/date_picker.dart
  2. 2
      lib/business_system/goods/business_goods_page.dart
  3. 95
      lib/business_system/goods/off_shelf/off_shelf_page.dart
  4. 12
      lib/business_system/goods/on_sale/batch_shelf.dart
  5. 121
      lib/business_system/goods/on_sale/on_sale_page.dart
  6. 2
      lib/business_system/home/business_home_page.dart
  7. 39
      lib/business_system/home/flow_page.dart
  8. 1
      lib/business_system/mine/business_mine_page.dart
  9. 115
      lib/business_system/mine/security_setting.dart
  10. 2
      lib/business_system/order/order_list.dart
  11. 10
      lib/retrofit/business_api.dart
  12. 45
      lib/retrofit/business_api.g.dart
  13. 12
      lib/union/union_list.dart
  14. 14
      pubspec.lock
  15. 2
      pubspec.yaml

121
lib/business_system/date_select/date_picker.dart

@ -0,0 +1,121 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:widgetpicker/widgetpicker.dart';
import '../../generated/l10n.dart';
import '../../utils/font_weight.dart';
class DatePickerWidget extends StatelessWidget {
final _years = List.generate((DateTime.now().year - 2019 +1), (i) => "${i + 2019}");
final _months = List.generate(12, (i) => "${i + 1}");
final showChange;
DatePickerWidget({this.showChange = true});
@override
Widget build(BuildContext context) {
bool monOn = true;
String _currentYear = "${DateTime.now().year.toString()}";
String _currentMonth = "${DateTime.now().month.toString()}";
String _currentTimeStr =
"${_currentYear.replaceAll("", "")}-${_currentMonth.length == 2 ? "0${_currentMonth.replaceAll("", "")}" : _currentMonth.replaceAll("", "")}";
return StatefulBuilder(builder: (context1, state) {
return Container(
height: 260.h,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(8),
topRight: Radius.circular(8),
),
),
child: Column(
children: [
Container(
height: 50.h,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
InkWell(
onTap: () {
Navigator.of(context).pop();
},
child: Container(
child: Text(
S.of(context).quxiao,
style: TextStyle(
fontSize: 16,
fontWeight: MyFontWeight.semi_bold,
color: Colors.black),
),
margin: EdgeInsets.only(left: 6),
padding: EdgeInsets.all(10),
),
),
InkWell(
onTap: () {
Navigator.of(context).pop(_currentTimeStr);
},
child: Container(
child: Text(
S.of(context).queren,
style: TextStyle(
fontSize: 16,
fontWeight: MyFontWeight.semi_bold,
color:Color(0xFF30415B)),
),
margin: EdgeInsets.only(left: 6),
padding: EdgeInsets.all(10),
),
),
],
),
),
Container(
height: 2.h,
color: Color(0xFFF4F4F4),
),
Expanded(child: Container(
child:
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
WidgetPicker(
value: _currentYear,
options: _years,
textStyle: TextStyle(
fontSize: 16.sp, color: Color(0xFFDDDDDD),),
selectedTextStyle:
TextStyle(fontSize: 16.sp, color: Colors.black,fontWeight: MyFontWeight.medium),
onChanged: (value) => state(() => {
_currentYear = value,
_currentTimeStr = monOn
? "${_currentYear.replaceAll("", "")}-${_currentMonth.length == 2 ? "0${_currentMonth.replaceAll("", "")}" : _currentMonth.replaceAll("", "")}"
: "${_currentYear.replaceAll("", "")}"
}),
),
if (monOn)
WidgetPicker(
value: _currentMonth,
options: _months,
textStyle: TextStyle(
fontSize: 16.sp, color: Color(0xFFDDDDDD)),
selectedTextStyle:
TextStyle(fontSize: 16.sp, color: Colors.black,fontWeight: MyFontWeight.medium),
onChanged: (value) => state(() => {
_currentMonth = value,
_currentTimeStr = monOn
? "${_currentYear.replaceAll("", "")}-${_currentMonth.length == 2 ? "0${_currentMonth.replaceAll("", "")}" : _currentMonth.replaceAll("", "")}"
: "${_currentYear.replaceAll("", "")}"
}),
),
],
),
)),
],
),
);
});
}
}

2
lib/business_system/goods/business_goods_page.dart

@ -72,7 +72,7 @@ class _BusinessGoodsPage extends State<BusinessGoodsPage>
body: TabBarView(
children: [
OnSalePage(widget.storeId),
OffShelfPage(),],
OffShelfPage(widget.storeId)],
),
),
),),

95
lib/business_system/goods/off_shelf/off_shelf_page.dart

@ -1,14 +1,25 @@
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/my_footer.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../../../generated/l10n.dart';
import '../../../retrofit/business_api.dart';
import '../../../retrofit/data/base_data.dart';
import '../../../retrofit/data/business_goods.dart';
import '../../../utils/business_instance.dart';
import '../../../utils/flutter_utils.dart';
import '../../../utils/font_weight.dart';
class OffShelfPage extends StatefulWidget {
final String storeId;
OffShelfPage(this.storeId);
@override
State<StatefulWidget> createState() {
return _OffShelfPage();
@ -18,6 +29,10 @@ class OffShelfPage extends StatefulWidget {
class _OffShelfPage extends State<OffShelfPage> {
final RefreshController _refreshController = RefreshController();
var checkStatus = false;
int _pageIndex = 1;
BusinessApiService businessService;
List<AdminProductVoList> adminProductVoList = [];
String _total;
@override
void dispose() {
@ -28,9 +43,57 @@ class _OffShelfPage extends State<OffShelfPage> {
@override
void initState() {
super.initState();
_onRefresh();
}
_onRefresh({bool isShowLoad = true}) async {
if (isShowLoad)
EasyLoading.show(
status: S.current.zhengzaijiazai,
maskType: EasyLoadingMaskType.black);
await queryGoodsList();
EasyLoading.dismiss();
if (!mounted) return;
if (_refreshController.isRefresh) _refreshController.refreshCompleted();
setState(() {});
}
_onRefresh() async {}
///
queryGoodsList() async {
if (businessService == null) {
businessService = BusinessApiService(Dio(),
context: context,
token: BusinessInstance.instance.businessToken,
tenant: BusinessInstance.instance.businessTenant,
storeId: widget.storeId);
}
BaseData<BusinessGoods> baseData =
await businessService.findAdminProductLis({
"groupId": "",
"hasStock": 1,
"keyword": "",
"pageIndex": _pageIndex,
"pageSize": 10,
"status": "0"
}).catchError((error) {
SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type),
alignment: Alignment.center);
_refreshController.refreshFailed();
_refreshController.loadFailed();
});
if (!mounted) return;
if (baseData != null && baseData.isSuccess) {
adminProductVoList.addAll(baseData?.data?.adminProductVOList ?? []);
_total = baseData.data.total.toString();
if ((baseData?.data?.adminProductVOList ?? []).isEmpty ||
adminProductVoList.length == baseData.data.total)
_refreshController.loadNoData();
else
_refreshController.loadComplete();
} else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}
}
@override
Widget build(BuildContext context) {
@ -40,19 +103,14 @@ class _OffShelfPage extends State<OffShelfPage> {
alignment: Alignment.bottomCenter,
children: [
Column(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
goodsSearch(),
],
),
Expanded(
child: Container(
child: SmartRefresher(
controller: _refreshController,
enablePullDown: true,
enablePullUp: false,
enablePullUp: true,
header: MyHeader(),
physics: BouncingScrollPhysics(),
footer: CustomFooter(
@ -61,9 +119,13 @@ class _OffShelfPage extends State<OffShelfPage> {
},
),
onRefresh: () {
setState(() {
_pageIndex = 1;
adminProductVoList.clear();
_onRefresh();
},
onLoading: () {
_pageIndex++;
_onRefresh();
});
},
child: SingleChildScrollView(
physics: NeverScrollableScrollPhysics(),
@ -98,16 +160,17 @@ class _OffShelfPage extends State<OffShelfPage> {
),
],),),
ListView.builder(
itemCount:15,
itemCount:adminProductVoList?.length ?? 0,
physics: BouncingScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {},
child: shelfGoodsItem(),
child: shelfGoodsItem(adminProductVoList[position]),
);
},
),
if(adminProductVoList.length >= 10)
SizedBox(height:70.h,)
],
),
@ -198,7 +261,7 @@ class _OffShelfPage extends State<OffShelfPage> {
);
}
Widget shelfGoodsItem(){
Widget shelfGoodsItem(AdminProductVoList adminProductVoList){
return Container(
margin: EdgeInsets.only(bottom: 22.h),
padding: EdgeInsets.only(left: 5.w,),
@ -229,7 +292,7 @@ class _OffShelfPage extends State<OffShelfPage> {
children: [
Padding(padding:EdgeInsets.only(bottom:11.h,top: 2.h),
child: Text(
"台湾甄选手抓饺子三生",
adminProductVoList?.productName ?? "",
maxLines:1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
@ -241,7 +304,7 @@ class _OffShelfPage extends State<OffShelfPage> {
Row(
children: [
Text(
"库存4321",
"库存${adminProductVoList?.stock ?? 0}",
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
@ -250,7 +313,7 @@ class _OffShelfPage extends State<OffShelfPage> {
),
SizedBox(width: 8.w,),
Text(
"销量4321",
"销量${adminProductVoList?.sellCount ?? 0}",
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
@ -272,7 +335,7 @@ class _OffShelfPage extends State<OffShelfPage> {
),
),
TextSpan(
text: "19",
text: adminProductVoList?.price ?? "",
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,

12
lib/business_system/goods/on_sale/batch_shelf.dart

@ -3,6 +3,7 @@ import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../../../generated/l10n.dart';
import '../../../utils/font_weight.dart';
import '../../../view_widget/classic_header.dart';
import '../../../view_widget/my_footer.dart';
@ -36,6 +37,17 @@ class _BatchShelf extends State<BatchShelf> {
background: Colors.white,
leadingColor: Colors.black,
brightness: Brightness.dark,
action: Container(
alignment: Alignment.center,
child: Text(
S.of(context).queren,
style: TextStyle(
color: Color(0xFF30415B),
fontSize: 14.sp,
fontWeight: MyFontWeight.semi_bold,
),
),
),
),
body: SmartRefresher(
controller: refreshController,

121
lib/business_system/goods/on_sale/on_sale_page.dart

@ -3,11 +3,11 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/my_footer.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:shared_preferences/shared_preferences.dart';
import '../../../generated/l10n.dart';
import '../../../retrofit/business_api.dart';
@ -34,6 +34,7 @@ class _OnSalePage extends State<OnSalePage> {
BusinessApiService businessService;
ProductGroupList productGroupList;
BusinessGoods businessGoods;
int _loadCount = 0;
@override
void dispose() {
@ -44,29 +45,37 @@ class _OnSalePage extends State<OnSalePage> {
@override
void initState() {
super.initState();
_onRefresh();
}
_onRefresh({bool isShowLoad = true}) async {
if (isShowLoad)
_onRefresh() async {
EasyLoading.show(
status: S.current.zhengzaijiazai,
maskType: EasyLoadingMaskType.black);
await queryGroupList();
await queryGoodsList();
status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black);
SharedPreferences.getInstance().then((value) {
businessService = BusinessApiService(Dio(),
context: context,
token: BusinessInstance.instance.businessToken,
tenant: BusinessInstance.instance.businessTenant,
storeId: widget.storeId);
queryGroupList();
queryGoodsList();
});
}
addLoadCount() {
_loadCount += 1;
if (_loadCount == 2) {
_loadCount = 0;
EasyLoading.dismiss();
if (!mounted) return;
if (_refreshController.isRefresh) _refreshController.refreshCompleted();
if (!mounted)
setState(() {});
}
}
///
queryGroupList() async {
if (businessService == null) {
businessService = BusinessApiService(Dio(),
context: context,
token: BusinessInstance.instance.businessToken,
tenant: BusinessInstance.instance.businessTenant,
storeId: widget.storeId);
}
try{
BaseData<ProductGroupList> baseData =
await businessService.productGroup({
"current":1,
@ -81,6 +90,8 @@ class _OnSalePage extends State<OnSalePage> {
}).catchError((error) {
SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type),
alignment: Alignment.center);
_refreshController.refreshFailed();
_refreshController.loadFailed();
});
if (!mounted) return;
if (baseData != null && baseData.isSuccess) {
@ -88,17 +99,14 @@ class _OnSalePage extends State<OnSalePage> {
} else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}
}finally{
addLoadCount();
}
}
///
queryGoodsList() async {
if (businessService == null) {
businessService = BusinessApiService(Dio(),
context: context,
token: BusinessInstance.instance.businessToken,
tenant: BusinessInstance.instance.businessTenant,
storeId: widget.storeId);
}
try{
BaseData<BusinessGoods> baseData =
await businessService.findAdminProductLis({
"groupId": "",
@ -114,6 +122,8 @@ class _OnSalePage extends State<OnSalePage> {
businessGoods = baseData.data;
} else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}}finally{
addLoadCount();
}
}
@ -149,7 +159,7 @@ class _OnSalePage extends State<OnSalePage> {
return MyFooter(mode);
},
),
onRefresh: _onRefresh(),
onRefresh: _onRefresh,
child: SingleChildScrollView(
physics: NeverScrollableScrollPhysics(),
child: Container(
@ -230,8 +240,8 @@ class _OnSalePage extends State<OnSalePage> {
),
Image.asset(
"assets/image/business.webp",
width: 18,
height: 18,
width: 18.h,
height: 18.h,
),
],
),
@ -244,7 +254,7 @@ class _OnSalePage extends State<OnSalePage> {
Navigator.of(context).pushNamed('/router/goods_sort');
},
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.end,
children: [
Text(
"商品排序",
@ -259,39 +269,40 @@ class _OnSalePage extends State<OnSalePage> {
),
Image.asset(
"assets/image/bs_px.webp",
width: 18,
height: 18,
),
],
)),
),
Expanded(
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: (){
Navigator.of(context).pushNamed('/router/batch_shelf');},
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Text(
"批量下架",
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF30415B),
),
),
SizedBox(
width: 2.w,
),
Image.asset(
"assets/image/bs_xj.webp",
width: 18,
height: 18,
width: 18.h,
height: 18.h,
),
],
)),
),
//
// Expanded(
// child: GestureDetector(
// behavior: HitTestBehavior.opaque,
// onTap: (){
// Navigator.of(context).pushNamed('/router/batch_shelf');},
// child: Row(
// mainAxisAlignment: MainAxisAlignment.end,
// children: [
// Text(
// "批量下架",
// style: TextStyle(
// fontSize: 14.sp,
// fontWeight: MyFontWeight.semi_bold,
// color: Color(0xFF30415B),
// ),
// ),
// SizedBox(
// width: 2.w,
// ),
// Image.asset(
// "assets/image/bs_xj.webp",
// width: 18,
// height: 18,
// ),
// ],
// )),
// ),
],
),
),

2
lib/business_system/home/business_home_page.dart

@ -112,6 +112,8 @@ class _BusinessHomePage extends State<BusinessHomePage>
}).catchError((error) {
SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type),
alignment: Alignment.center);
refreshController.refreshFailed();
refreshController.loadFailed();
});
if (baseData != null && baseData.isSuccess) {
dayCount = baseData.data;

39
lib/business_system/home/flow_page.dart

@ -1,6 +1,5 @@
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:flutter_datetime_picker/flutter_datetime_picker.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/utils/font_weight.dart';
@ -19,6 +18,7 @@ import '../../utils/flutter_utils.dart';
import '../../view_widget/classic_header.dart';
import '../../view_widget/my_footer.dart';
import '../../view_widget/no_data_view.dart';
import '../date_select/date_picker.dart';
class FlowPage extends StatefulWidget {
final arguments;
@ -37,6 +37,8 @@ class _FlowPage extends State<FlowPage> {
BusinessApiService businessService;
List<DayFlowList> dayFlowList = [];
int _loadCount = 0;
String _datetime;
@override
void initState() {
@ -54,7 +56,7 @@ class _FlowPage extends State<FlowPage> {
token: BusinessInstance.instance.businessToken,
tenant: BusinessInstance.instance.businessTenant,
storeId: storeId);
queryDayFlow(DateFormat("yyyy-MM-dd").format(DateTime.now()), "0",
queryDayFlow(_datetime == null ? DateFormat("yyyy-MM-dd").format(DateTime.now()):(_datetime+"-01"), "0",
isSing: false);
});
}
@ -140,7 +142,7 @@ class _FlowPage extends State<FlowPage> {
child: Row(
children: [
Text(
DateFormat("yyyy年MM月").format(DateTime.now()),
_datetime == null ? DateFormat("yyyy年MM月").format(DateTime.now()) : "${_datetime.replaceAll("-", "")}",
style: TextStyle(
fontSize: 15.sp,
fontWeight: MyFontWeight.semi_bold,
@ -330,25 +332,16 @@ class _FlowPage extends State<FlowPage> {
));
}
showDateSelector() {
DatePicker.showDatePicker(context,
showTitleActions: true,
minTime: DateTime.now().subtract(const Duration(days: 360)),
maxTime: DateTime.now(),
theme: DatePickerTheme(
headerColor: Colors.white,
backgroundColor: Colors.white,
itemStyle: TextStyle(
color: Colors.black,
fontWeight: MyFontWeight.bold,
fontSize: 18),
doneStyle: TextStyle(color: Color(0xFF30415B), fontSize: 16.sp)),
onChanged: (date) {
print('change $date in time zone ' +
date.timeZoneOffset.inHours.toString());
}, onConfirm: (date) {
// "2023-09-04";
// setState(() {});
}, currentTime: DateTime.now(), locale: LocaleType.zh);
showDateSelector() async {
String dateTime = await showModalBottomSheet(
backgroundColor: Colors.transparent,
context: context,
builder: (_) {
return DatePickerWidget();
});
if (dateTime != null) {
_datetime = dateTime;
queryDayFlow(_datetime+"-01", "0");
}
}
}

1
lib/business_system/mine/business_mine_page.dart

@ -212,6 +212,7 @@ class _BusinessMinePage extends State<BusinessMinePage>
onTap: (){
Navigator.of(context).pushNamed('/router/security_setting',arguments:{
"storeId":widget.storeId,
"businessLoginInfo":widget.businessLoginInfo,
});
},
child: commonFunctionsItem("assets/image/bs_secure.webp", "安全设置", "登录手机号/密码")

115
lib/business_system/mine/security_setting.dart

@ -1,8 +1,16 @@
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:shared_preferences/shared_preferences.dart';
import '../../retrofit/business_api.dart';
import '../../retrofit/data/base_data.dart';
import '../../retrofit/data/business_login_info.dart';
import '../../utils/business_instance.dart';
import '../../utils/flutter_utils.dart';
import '../../utils/font_weight.dart';
import '../../view_widget/classic_header.dart';
import '../../view_widget/my_footer.dart';
@ -11,6 +19,7 @@ class SecuritySetting extends StatefulWidget {
final Map<String, dynamic> arguments;
SecuritySetting({this.arguments});
@override
State<StatefulWidget> createState() {
return _SecuritySetting();
@ -24,6 +33,9 @@ class _SecuritySetting extends State<SecuritySetting> {
final TextEditingController oldPasswordController = TextEditingController();
FocusNode _focusNode = FocusNode();
bool isKeyBoardShow = false;
BusinessLoginInfo businessLoginInfo;
BusinessApiService businessService;
String oldPassword;
@override
void initState() {
@ -42,6 +54,11 @@ class _SecuritySetting extends State<SecuritySetting> {
}
});
});
businessLoginInfo = widget.arguments["businessLoginInfo"];
if(oldPasswordController.text != "" && newPasswordController.text != ""){
oldPasswordController.text = "";
newPasswordController.text = "";
}
}
///
@ -51,6 +68,32 @@ class _SecuritySetting extends State<SecuritySetting> {
super.dispose();
}
///
modifyCode() async {
if (businessService == null) {
businessService = BusinessApiService(Dio(),
context: context,
token: BusinessInstance.instance.businessToken,
tenant: BusinessInstance.instance.businessTenant,
storeId: widget.arguments["storeId"]);
}
BaseData baseData = await businessService.modifyPassword({
"id": businessLoginInfo?.userId ?? "",
"account": businessLoginInfo?.account ?? "",
"password": newPasswordController.text,
"name": businessLoginInfo?.name ?? "",
}).catchError((error) {
SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type),
alignment: Alignment.center);
});
if (baseData != null && baseData.isSuccess) {
SmartDialog.showToast("修改成功", alignment: Alignment.center);
pageState = 1;
setState(() {});
} else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}
}
@override
Widget build(BuildContext context) {
@ -80,8 +123,7 @@ class _SecuritySetting extends State<SecuritySetting> {
return MyFooter(mode);
},
),
onRefresh: () {
},
onRefresh: () {},
physics: BouncingScrollPhysics(),
scrollController: ScrollController(),
child: SingleChildScrollView(
@ -104,17 +146,23 @@ class _SecuritySetting extends State<SecuritySetting> {
),
],
),
padding: EdgeInsets.only(top: 16.h,left: 16.w,right: 16.w,),
padding: EdgeInsets.only(
top: 16.h,
left: 16.w,
right: 16.w,
),
child: Column(
children: [
Row(
children: [
Expanded(child:Text(
Expanded(
child: Text(
"登录手机号",
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF808080),
fontWeight: MyFontWeight.medium),)),
fontWeight: MyFontWeight.medium),
)),
Text(
"134****7777",
maxLines: 2,
@ -123,7 +171,8 @@ class _SecuritySetting extends State<SecuritySetting> {
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF1A1A1A),
fontWeight: MyFontWeight.medium),),
fontWeight: MyFontWeight.medium),
),
],
),
Container(
@ -141,13 +190,14 @@ class _SecuritySetting extends State<SecuritySetting> {
},
child: Row(
children: [
Expanded(child:Text(
Expanded(
child: Text(
"修改登录密码",
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF808080),
fontWeight: MyFontWeight.medium),)),
fontWeight: MyFontWeight.medium),
)),
Image.asset(
"assets/image/icon_right_z.webp",
width: 16,
@ -166,15 +216,25 @@ class _SecuritySetting extends State<SecuritySetting> {
],
),
),
if(pageState == 2)
changePassword(),
if (pageState == 2) changePassword(),
if (pageState == 2)
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState((){
pageState = 1;
SharedPreferences.getInstance().then((value) {
oldPassword = value.getString("password");
});
if(oldPasswordController.text == ""){
SmartDialog.showToast("请输入旧密码", alignment: Alignment.center);
return;
}else if(newPasswordController.text == ""){
SmartDialog.showToast("请输入新密码", alignment: Alignment.center);
return;}else if(oldPasswordController.text != oldPassword){
SmartDialog.showToast("旧密码输入错误", alignment: Alignment.center);
return;
}else{
modifyCode();
}
},
child: Container(
width: double.infinity,
@ -183,8 +243,7 @@ class _SecuritySetting extends State<SecuritySetting> {
padding: EdgeInsets.symmetric(vertical: 16.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(27),
color: Color(0xFF30415B)
),
color: Color(0xFF30415B)),
child: Text(
"确认修改",
style: TextStyle(
@ -218,7 +277,11 @@ class _SecuritySetting extends State<SecuritySetting> {
),
],
),
padding: EdgeInsets.only(top: 16.h,left: 16.w,right: 16.w,),
padding: EdgeInsets.only(
top: 16.h,
left: 16.w,
right: 16.w,
),
child: Column(
children: [
Row(
@ -228,7 +291,8 @@ class _SecuritySetting extends State<SecuritySetting> {
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF808080),
fontWeight: MyFontWeight.medium),),
fontWeight: MyFontWeight.medium),
),
Expanded(
child: TextField(
controller: oldPasswordController,
@ -237,8 +301,7 @@ class _SecuritySetting extends State<SecuritySetting> {
hintStyle: TextStyle(
color: Color(0xFF808080),
fontSize: 14.sp,
fontWeight: MyFontWeight.regular
),
fontWeight: MyFontWeight.regular),
border: InputBorder.none,
contentPadding: EdgeInsets.only(left: 16.w),
),
@ -246,8 +309,7 @@ class _SecuritySetting extends State<SecuritySetting> {
style: TextStyle(
color: Color(0xFF808080),
fontSize: 14.sp,
fontWeight: MyFontWeight.regular
),
fontWeight: MyFontWeight.regular),
),
),
],
@ -265,7 +327,8 @@ class _SecuritySetting extends State<SecuritySetting> {
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF808080),
fontWeight: MyFontWeight.medium),),
fontWeight: MyFontWeight.medium),
),
Expanded(
child: TextField(
controller: newPasswordController,
@ -274,8 +337,7 @@ class _SecuritySetting extends State<SecuritySetting> {
hintStyle: TextStyle(
color: Color(0xFF808080),
fontSize: 14.sp,
fontWeight: MyFontWeight.regular
),
fontWeight: MyFontWeight.regular),
border: InputBorder.none,
contentPadding: EdgeInsets.only(left: 16.w),
),
@ -283,8 +345,7 @@ class _SecuritySetting extends State<SecuritySetting> {
style: TextStyle(
color: Color(0xFF808080),
fontSize: 14.sp,
fontWeight: MyFontWeight.regular
),
fontWeight: MyFontWeight.regular),
),
),
],
@ -299,6 +360,4 @@ class _SecuritySetting extends State<SecuritySetting> {
),
);
}
}

2
lib/business_system/order/order_list.dart

@ -101,6 +101,8 @@ class _OrderList extends State<OrderList> {
}).catchError((error) {
SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type),
alignment: Alignment.center);
_refreshController.refreshFailed();
_refreshController.loadFailed();
});
if (!mounted) return;
if (baseData != null && baseData.isSuccess) {

10
lib/retrofit/business_api.dart

@ -204,4 +204,14 @@ abstract class BusinessApiService {
Future<BaseData<BusinessGoods>> findAdminProductLis(
@Body() Map<String, dynamic> param);
///
@PUT("user")
Future<BaseData> modifyPassword(
@Body() Map<String, dynamic> param);
///
@POST("product/update")
Future<BaseData> goodsUpdate(
@Body() Map<String, dynamic> param);
}

45
lib/retrofit/business_api.g.dart

@ -367,4 +367,49 @@ class _BusinessApiService implements BusinessApiService {
return value;
}
@override
Future<BaseData> modifyPassword(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>('user',
queryParameters: queryParameters,
options: RequestOptions(
method: 'PUT',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(
_result.data,
(json) => json == null ? null : json,
);
return value;
}
@override
Future<BaseData> goodsUpdate(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>('product/update',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(
_result.data,
(json) => json == null ? null : json,
);
return value;
}
}

12
lib/union/union_list.dart

@ -114,6 +114,18 @@ class _UnionList extends State<UnionList> with AutomaticKeepAliveClientMixin {
return InkWell(
onTap: () {
{
// if (storeList[position].storeName == "一心回乡商城") {
// Navigator.of(context).pushNamed(
// '/router/shopping_mall_home',
// arguments: {
// "type": 0,
// "id": storeList[position].id,
// "tenant": storeList[position].tenantCode,
// "storeName":storeList[position].storeName
// },
// );
// }
// else
Navigator.of(context).pushNamed(
'/router/store_order',
arguments: {

14
pubspec.lock

@ -434,6 +434,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.0"
infinite_listview:
dependency: transitive
description:
name: infinite_listview
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.0"
intl:
dependency: "direct main"
description:
@ -1050,6 +1057,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.14"
widgetpicker:
dependency: "direct main"
description:
name: widgetpicker
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.1.1"
win32:
dependency: transitive
description:

2
pubspec.yaml

@ -123,6 +123,8 @@ dependencies:
# 时间选择器
flutter_datetime_picker: ^1.5.1
widgetpicker: ^0.1.1
syncfusion_flutter_datepicker: ^19.4.38

Loading…
Cancel
Save