Browse Source

商品一键置顶功能完成;

商品板块流程性能优化更改;
生意总览页面优化;
订单列表键盘与底部点击事件冲突的处理;
商品搜索流程优化更改;
wr_2023_business
wurong 1 year ago
parent
commit
5ad5f04975
  1. 21
      lib/business_system/business_scan_code.dart
  2. 8
      lib/business_system/goods/goods_search_page.dart
  3. 4
      lib/business_system/goods/on_sale/add_assort.dart
  4. 11
      lib/business_system/goods/on_sale/batch_shelf.dart
  5. 125
      lib/business_system/goods/on_sale/goods_sort.dart
  6. 19
      lib/business_system/goods/on_sale/on_sale_page.dart
  7. 5
      lib/business_system/home/home_view/donut_auto_label_chart.dart
  8. 7
      lib/business_system/home/home_view/my_arc_label_decorator.dart
  9. 25
      lib/business_system/home/home_view/my_line_chart.dart
  10. 2
      lib/business_system/home/overview/trade_goods.dart
  11. 9
      lib/business_system/home/overview/trade_order.dart
  12. 15
      lib/business_system/home/overview/trade_summary.dart
  13. 38
      lib/business_system/mine/business_mine_page.dart
  14. 8
      lib/business_system/order/business_order_page.dart
  15. 8
      lib/business_system/order/order_list.dart
  16. 5
      lib/retrofit/business_api.dart
  17. 22
      lib/retrofit/business_api.g.dart
  18. 11
      lib/view_widget/icon_text.dart

21
lib/business_system/business_scan_code.dart

@ -53,7 +53,6 @@ class _BusinessScanCode extends State<BusinessScanCode>
onCapture: (data) {
if (data != null && data != "") {
// Navigator.of(context).pop(data);
}
},
),
@ -70,17 +69,17 @@ class _BusinessScanCode extends State<BusinessScanCode>
child: Container(
margin: EdgeInsets.only(left:12.w,right: 16.w,top: 16.h),
child:Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(child:Text(
S.of(context).saoma,
style: TextStyle(
color: Colors.white,
fontSize: 18.sp,
fontWeight: FontWeight.bold,
),
)),
// Expanded(child:Text(
// S.of(context).saoma,
// style: TextStyle(
// color: Colors.white,
// fontSize: 18.sp,
// fontWeight: FontWeight.bold,
// ),
// )),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
@ -91,7 +90,7 @@ class _BusinessScanCode extends State<BusinessScanCode>
child: Text(
S.of(context).xiangce,
style: TextStyle(
color: Colors.black,
color: Colors.white,
fontSize: 18.sp,
fontWeight: FontWeight.bold,
),

8
lib/business_system/goods/goods_search_page.dart

@ -137,6 +137,10 @@ class _GoodsSearchPage extends State<GoodsSearchPage>
///
queryGoodsUpdate() async {
try{
EasyLoading.show(
status: S.current.zhengzaijiazai,
maskType: EasyLoadingMaskType.black);
if (businessService == null) {
businessService = BusinessApiService(Dio(),
context: context,
@ -153,10 +157,12 @@ class _GoodsSearchPage extends State<GoodsSearchPage>
if (baseData != null && baseData.isSuccess) {
_pageIndex = 1;
adminProductVoList.clear();
await _onRefresh();
await _onRefresh(isShowLoad: false);
SmartDialog.showToast(widget.arguments["onSaleStatus"] == "1"?"商品下架成功":"商品上架成功", alignment: Alignment.center);
} else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}}finally{
EasyLoading.dismiss();
}
}

4
lib/business_system/goods/on_sale/add_assort.dart

@ -61,6 +61,7 @@ class _AddAssort extends State<AddAssort> {
///-/
querySaveProductGroup() async {
try{
EasyLoading.show(
status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black);
if (businessService == null) {
@ -80,7 +81,6 @@ class _AddAssort extends State<AddAssort> {
editingSortController.text == "" ? "1" : editingSortController.text,
}).catchError((error) {});
if (baseData != null && baseData.isSuccess) {
EasyLoading.dismiss();
Navigator.of(context).pop();
if (name == "添加分类")
showProductTipDialog();
@ -89,6 +89,8 @@ class _AddAssort extends State<AddAssort> {
alignment: Alignment.center);
} else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}}finally{
EasyLoading.dismiss();
}
}

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

@ -154,6 +154,10 @@ class _BatchShelf extends State<BatchShelf> {
}
queryGoodsUpdate() async {
try{
EasyLoading.show(
status: S.current.zhengzaijiazai,
maskType: EasyLoadingMaskType.black);
if (businessService == null) {
businessService = BusinessApiService(Dio(),
context: context,
@ -171,12 +175,17 @@ class _BatchShelf extends State<BatchShelf> {
adminProductVoList.clear();
await queryGoodsList(groupIndex == -1
? ""
: productGroupList?.records[groupIndex]?.id ?? "");
: productGroupList?.records[groupIndex]?.id ?? "", isSing: false);
setState(() {});
SmartDialog.showToast("商品下架成功", alignment: Alignment.center);
} else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}
}
finally{
EasyLoading.dismiss();
}
}
@override
Widget build(BuildContext context) {

125
lib/business_system/goods/on_sale/goods_sort.dart

@ -20,11 +20,13 @@ import '../../../view_widget/classic_header.dart';
import '../../../view_widget/custom_image.dart';
import '../../../view_widget/my_footer.dart';
import '../../../view_widget/no_data_view.dart';
import '../../../view_widget/settlement_tips_dialog.dart';
class GoodsSort extends StatefulWidget {
final Map<String, dynamic> arguments;
GoodsSort({this.arguments});
@override
State<StatefulWidget> createState() {
return _GoodsSort();
@ -42,7 +44,6 @@ class _GoodsSort extends State<GoodsSort> {
int groupIndex = -1;
bool _shimmer = true;
@override
void initState() {
super.initState();
@ -61,13 +62,17 @@ class _GoodsSort extends State<GoodsSort> {
status: S.current.zhengzaijiazai,
maskType: EasyLoadingMaskType.black);
SharedPreferences.getInstance().then((value) {
businessService = BusinessApiService(Dio(),
businessService = BusinessApiService(
Dio(),
context: context,
token: BusinessInstance.instance.businessToken,
tenant: BusinessInstance.instance.businessTenant,
storeId: widget.arguments["storeId"],);
storeId: widget.arguments["storeId"],
);
queryProductGroupList();
queryGoodsList(groupIndex != -1 ? productGroupList.records[groupIndex].id : "", isSing: false);
queryGoodsList(
groupIndex != -1 ? productGroupList.records[groupIndex].id : "",
isSing: false);
});
}
@ -153,6 +158,37 @@ class _GoodsSort extends State<GoodsSort> {
}
}
////
goodsSortTop(id) async {
try{
EasyLoading.show(
status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black);
if (businessService == null) {
businessService = BusinessApiService(Dio(),
context: context,
token: BusinessInstance.instance.businessToken,
tenant: BusinessInstance.instance.businessTenant,
storeId: widget.arguments["storeId"]);
}
BaseData baseData = await businessService.productSortTop({
"id": id,
}).catchError((error) {});
if (baseData != null && baseData.isSuccess) {
_pageIndex = 1;
adminProductVoList.clear();
await queryGoodsList(groupIndex == -1
? ""
: productGroupList?.records[groupIndex]?.id ?? "",isSing: false);
SmartDialog.showToast("商品置顶成功", alignment: Alignment.center);
setState(() {});
} else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}
}finally{
EasyLoading.dismiss();
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
@ -164,7 +200,7 @@ class _GoodsSort extends State<GoodsSort> {
leadingColor: Colors.black,
brightness: Brightness.dark,
),
body:Row(
body: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -193,11 +229,12 @@ class _GoodsSort extends State<GoodsSort> {
groupIndex = position;
_pageIndex = 1;
adminProductVoList.clear();
queryGoodsList(productGroupList?.records[position].id,);
queryGoodsList(
productGroupList?.records[position].id,
);
},
child: sortLeftItem(
productGroupList.records[position],
position),
productGroupList.records[position], position),
);
},
),
@ -207,8 +244,7 @@ class _GoodsSort extends State<GoodsSort> {
child: SmartRefresher(
controller: _refreshController,
enablePullDown: true,
enablePullUp:
adminProductVoList.length != 0 ? true : false,
enablePullUp: adminProductVoList.length != 0 ? true : false,
header: MyHeader(
color: Color(0xFF30415B),
),
@ -243,32 +279,30 @@ class _GoodsSort extends State<GoodsSort> {
: ((adminProductVoList == null ||
adminProductVoList.length == 0)
? NoDataView(
src:
"assets/image/bs_no data_logo.webp",
src: "assets/image/bs_no data_logo.webp",
isShowBtn: false,
text: "该分组暂无添加商品",
fontSize: 16.sp,
margin: EdgeInsets.all(20.h),
)
: ListView.builder(
itemCount:
adminProductVoList?.length ?? 0,
itemCount: adminProductVoList?.length ?? 0,
controller: controller,
physics: BouncingScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, position) {
return sortGoodsItem(adminProductVoList[position]);
return sortGoodsItem(
adminProductVoList[position]);
},
)))),
),
],
),
);
}
///list
Widget sortLeftItem(Records records, index){
Widget sortLeftItem(Records records, index) {
return Container(
color: groupIndex == index ? Colors.white : Color(0xFFFAFAFA),
alignment: Alignment.center,
@ -296,7 +330,7 @@ class _GoodsSort extends State<GoodsSort> {
}
///List
Widget sortGoodsItem(AdminProductVoList adminProductVoList){
Widget sortGoodsItem(AdminProductVoList adminProductVoList) {
return Container(
margin: EdgeInsets.only(bottom: 21.h),
padding: EdgeInsets.only(left: 16.w, right: 14.w),
@ -309,16 +343,21 @@ class _GoodsSort extends State<GoodsSort> {
fit: BoxFit.cover,
radius: BorderRadius.circular(4),
),
SizedBox(width:12.w,),
Expanded(child:Column(
SizedBox(
width: 12.w,
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(padding:EdgeInsets.only(bottom:11.h,top: 2.h),
Padding(
padding: EdgeInsets.only(bottom: 11.h, top: 2.h),
child: Row(
children: [
Expanded(child: Text(
Expanded(
child: Text(
adminProductVoList?.productName ?? "",
maxLines:1,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 14.sp,
@ -326,16 +365,34 @@ class _GoodsSort extends State<GoodsSort> {
color: Color(0xFF000000),
),
)),
Text(
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
if (widget.arguments["storeId"] == "0") {
SmartDialog.show(
widget: SettlementTips(
() {},
text: "当前为所有门店状态,置顶商品时,请将门店切换至对应门店操作!",
color: Color(0xFF30415B),
));
} else {
goodsSortTop(adminProductVoList.id);
}
},
child: Padding(
padding: EdgeInsets.only(left:10.w,top: 2.h,bottom: 2.h),
child: Text(
"置顶",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFFF4524D),
),
)
),
))
],
),),
),
),
Row(
children: [
Text(
@ -346,7 +403,9 @@ class _GoodsSort extends State<GoodsSort> {
color: Color(0xFFA29E9E),
),
),
SizedBox(width: 8.w,),
SizedBox(
width: 8.w,
),
Text(
"销量${adminProductVoList?.sellCount ?? 0}",
style: TextStyle(
@ -357,7 +416,9 @@ class _GoodsSort extends State<GoodsSort> {
),
],
),
SizedBox(height:7.h,),
SizedBox(
height: 7.h,
),
Text.rich(
TextSpan(
children: [
@ -433,7 +494,8 @@ class _GoodsSort extends State<GoodsSort> {
Padding(
padding: EdgeInsets.only(bottom: 11.h, top: 2.h),
child: Row(
children: [Shimmer.fromColors(
children: [
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
@ -446,7 +508,7 @@ class _GoodsSort extends State<GoodsSort> {
),
),
SizedBox(
width:10.w,
width: 10.w,
),
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
@ -459,7 +521,8 @@ class _GoodsSort extends State<GoodsSort> {
width: 24.w,
height: 20.h,
),
),],
),
],
),
),
Row(

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

@ -309,7 +309,10 @@ class _OnSalePage extends State<OnSalePage> {
behavior: HitTestBehavior.opaque,
onTap: () {
Navigator.of(context).pushNamed('/router/goods_assort',
arguments: {"storeId": widget.storeId});
arguments: {"storeId": widget.storeId}).then((value) {
adminProductVoList.clear();
_onRefresh();
});
},
child: Container(
color: Color(0xFFEDEDED),
@ -346,7 +349,10 @@ class _OnSalePage extends State<OnSalePage> {
behavior: HitTestBehavior.opaque,
onTap: () {
Navigator.of(context).pushNamed('/router/goods_sort',
arguments: {"storeId": widget.storeId});
arguments: {"storeId": widget.storeId}).then((value) {
adminProductVoList.clear();
_onRefresh();
});
},
child: Container(
color: Color(0xFFEDEDED),
@ -383,7 +389,10 @@ class _OnSalePage extends State<OnSalePage> {
behavior: HitTestBehavior.opaque,
onTap: () {
Navigator.of(context).pushNamed('/router/batch_shelf',
arguments: {"storeId": widget.storeId});
arguments: {"storeId": widget.storeId}).then((value) {
adminProductVoList.clear();
_onRefresh();
});
},
child: Container(
color: Color(0xFFEDEDED),
@ -434,7 +443,9 @@ class _OnSalePage extends State<OnSalePage> {
}).then((value) => {
_pageIndex = 1,
adminProductVoList.clear(),
_onRefresh(isShowLoad: false),
queryGoodsList(groupIndex == -1
? ""
: productGroupList?.records[groupIndex]?.id ?? "")
});
},
child: Container(

5
lib/business_system/home/home_view/donut_auto_label_chart.dart

@ -10,8 +10,9 @@ import 'my_arc_label_decorator.dart';
class DonutAutoLabelChart extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<String> defaultLabelText;
DonutAutoLabelChart(this.seriesList, {this.animate = false});
DonutAutoLabelChart(this.seriesList,this.defaultLabelText, {this.animate = false});
@override
Widget build(BuildContext context) {
@ -21,7 +22,7 @@ class DonutAutoLabelChart extends StatelessWidget {
arcWidth: 15,
strokeWidthPx: 0,
arcRendererDecorators: [
new MyArcLabelDecorator(MediaQuery.of(context).size.width)
new MyArcLabelDecorator(MediaQuery.of(context).size.width,defaultLabelText)
]));
}
}

7
lib/business_system/home/home_view/my_arc_label_decorator.dart

@ -49,7 +49,7 @@ class MyArcLabelDecorator<D> extends ArcRendererDecorator<D> {
Color.fromHex(code: "#21CCFF"),
Color.fromHex(code: "#313CA9")
];
static final _defaultLabelText = ["收款(0.00%)", "退款(0.00%)"];
// static final _defaultLabelText = ["收款(0.00%)", "退款(0.00%)"];
static final _defaultOutsideLabelStyle =
TextStyleSpec(fontSize: 14, color: Color.fromHex(code: "#333333"),);
static final _defaultTextLabelStyle =
@ -89,7 +89,10 @@ class MyArcLabelDecorator<D> extends ArcRendererDecorator<D> {
final double mediaQueryWidth;
final List<String> defaultLabelText;
MyArcLabelDecorator(this.mediaQueryWidth,
this.defaultLabelText,
{TextStyleSpec insideLabelStyleSpec,
TextStyleSpec outsideLabelStyleSpec,
ArcLabelLeaderLineStyleSpec leaderLineStyleSpec,
@ -193,7 +196,7 @@ class MyArcLabelDecorator<D> extends ArcRendererDecorator<D> {
..maxWidthStrategy = MaxWidthStrategy.ellipsize;
final labelTextElement = graphicsFactory
.createTextElement(_defaultLabelText[i])
.createTextElement(defaultLabelText[i])
..maxWidthStrategy = MaxWidthStrategy.ellipsize;
var calculatedLabelPosition = calculateLabelPosition(

25
lib/business_system/home/home_view/my_line_chart.dart

@ -8,7 +8,8 @@ class LineChartSample2 extends StatefulWidget {
final List<LineChartSample2Data> lineChartSample2Data;
final String tipName;
LineChartSample2(this.lineChartSample2Data,this.tipName, {Key key}) : super(key: key);
LineChartSample2(this.lineChartSample2Data, this.tipName, {Key key})
: super(key: key);
@override
State<LineChartSample2> createState() => _LineChartSample2State();
@ -28,9 +29,12 @@ class _LineChartSample2State extends State<LineChartSample2> {
}
Widget bottomTitleWidgets(double value, TitleMeta meta) {
if(value%1 != 0)
if ((meta.appliedInterval <= 1 &&
double.parse(meta.formattedValue) % 1 != 0) ||
(meta.appliedInterval > 1 &&
double.parse(meta.formattedValue) % meta.appliedInterval != 0))
return Text("");
String text = widget.lineChartSample2Data[value.toInt()].time ?? "";
String text = widget.lineChartSample2Data[int.parse(meta.formattedValue)].time ?? "";
if (text.length == 10)
text = text.substring(5, 10);
else if (text.length == 7) text = text.substring(2, 7);
@ -73,13 +77,15 @@ class _LineChartSample2State extends State<LineChartSample2> {
} else {
text = value.toInt().toString();
}
return Padding(padding:EdgeInsets.only(right:2.w),
return Padding(
padding: EdgeInsets.only(right: 2.w),
child: Text(text,
style: const TextStyle(
fontWeight: MyFontWeight.light,
fontSize: 10,
color: Color(0xFF999999)),
textAlign: TextAlign.right),);
textAlign: TextAlign.right),
);
}
LineChartData mainData() {
@ -168,14 +174,15 @@ class _LineChartSample2State extends State<LineChartSample2> {
},
touchTooltipData: LineTouchTooltipData(
tooltipBgColor: Color(0xFF3D3D3D),
tooltipPadding: const EdgeInsets.symmetric(vertical:5,horizontal:6),
tooltipPadding:
const EdgeInsets.symmetric(vertical: 5, horizontal: 6),
tooltipMargin: 5,
tooltipRoundedRadius: 2,
tooltipHorizontalAlignment: FLHorizontalAlignment.center,
getTooltipItems: (touchedSpots) {
return touchedSpots.map((LineBarSpot touchedSpot) {
return LineTooltipItem(
'${(widget.lineChartSample2Data[touchedSpot.x.toInt()].time ?? "").substring(5,10)}',
'${(widget.lineChartSample2Data[touchedSpot.x.toInt()].time ?? "").substring(5, 10)}',
const TextStyle(
color: Colors.white,
fontWeight: MyFontWeight.light,
@ -183,7 +190,7 @@ class _LineChartSample2State extends State<LineChartSample2> {
textAlign: TextAlign.start,
children: [
TextSpan(
text: '\n${widget?.tipName??""}: ',
text: '\n${widget?.tipName ?? ""}: ',
style: const TextStyle(
color: Colors.white,
fontWeight: MyFontWeight.medium,
@ -209,7 +216,7 @@ class _LineChartSample2State extends State<LineChartSample2> {
.toList(),
isCurved: false,
color: Color(0xFF165DFF),
barWidth:2.5,
barWidth: 2.5,
dotData: FlDotData(
show: false,
getDotPainter: (spot, percent, barData, index) {

2
lib/business_system/home/overview/trade_goods.dart

@ -601,7 +601,7 @@ class _TradeGoods extends State<TradeGoods> {
}
},
child: Container(
width: 194.w,
width: 200.w,
alignment: Alignment.center,
padding: EdgeInsets.all(8),
decoration: BoxDecoration(

9
lib/business_system/home/overview/trade_order.dart

@ -52,6 +52,7 @@ class _TradeOrder extends State<TradeOrder> {
LineChartSample2Data(5, 0, "2023-03-14"),
LineChartSample2Data(6, 0, "2023-03-15")
];
int dateIndex = 0;
String selectedDate = "";
String dayDate = "${DateFormat("yyyy年MM月dd日").format(DateTime.now())}";
@ -76,7 +77,7 @@ class _TradeOrder extends State<TradeOrder> {
@override
void initState() {
super.initState();
_onRefresh();
// _onRefresh();
}
_onRefresh() async {
@ -246,8 +247,7 @@ class _TradeOrder extends State<TradeOrder> {
border:
Border.all(color: Color(0xFFCFD0D1), width: 1.w),
),
margin: EdgeInsets.only(
top: 16.h, right: 20.w, left: 20.w, bottom: 12.h),
margin: EdgeInsets.only(top: 16.h, right: 20.w, left: 20.w, bottom: 12.h),
child: Row(
children: [
Expanded(
@ -618,7 +618,8 @@ class _TradeOrder extends State<TradeOrder> {
fontSize: 16.sp,
margin: EdgeInsets.all(20.h),
)
: Padding(
:
Padding(
padding: EdgeInsets.symmetric(horizontal: 20.w),
child: LineChartSample2(lineChartSample2DataOrderAmount, "金额"),
),

15
lib/business_system/home/overview/trade_summary.dart

@ -497,7 +497,7 @@ class _TradeSummary extends State<TradeSummary> {
}
},
child: Container(
width: 194.w,
width: 200.w,
alignment: Alignment.center,
padding: EdgeInsets.all(8),
decoration: BoxDecoration(
@ -581,7 +581,8 @@ class _TradeSummary extends State<TradeSummary> {
} else if (dateIndex == 3) {
return (customDate == "" || customDate == null)
? "${customDateNum ?? ""}(今日)"
: ("${customDate.substring(0,11)} ""${customDate.substring(21,34)}");
: ("${customDate.substring(0, 11)} "
"${customDate.substring(21, 34)}");
}
}
@ -848,6 +849,9 @@ class _TradeSummary extends State<TradeSummary> {
labelAccessorFn: (LinearSales row, _) =>
'${(row.sales / 100)}',
)
], [
"收款(${AppUtils.calculateDouble((tradeSummaryList?.collectionAmount == "0" && tradeSummaryList?.refundAmount == "0") ? 50 : (double.parse(tradeSummaryList?.collectionAmount ?? "0") / (double.parse(tradeSummaryList?.collectionAmount ?? "0") + double.parse(tradeSummaryList?.refundAmount ?? "0")) * 100))}%)",
"退款(${AppUtils.calculateDouble((tradeSummaryList?.collectionAmount == "0" && tradeSummaryList?.refundAmount == "0") ? 50 : (double.parse(tradeSummaryList?.refundAmount ?? "0") / (double.parse(tradeSummaryList?.collectionAmount ?? "0") + double.parse(tradeSummaryList?.refundAmount ?? "0")) * 100))}%)"
]),
),
if (expensesSelect == 1)
@ -869,12 +873,12 @@ class _TradeSummary extends State<TradeSummary> {
colorFn: (LinearSales sales, __) => sales.color,
domainFn: (LinearSales sales, _) => sales.year,
measureFn: (LinearSales sales, _) => sales.sales,
data: [
new LinearSales(
0,
tradeSummaryList?.collectionCount ?? 0,
charts.Color.fromHex(code: "#313CA9")),
charts.Color.fromHex(code: "#313CA9"),
),
new LinearSales(2, tradeSummaryList?.refundCount ?? 0,
charts.Color.fromHex(code: "#30415B")),
],
@ -882,6 +886,9 @@ class _TradeSummary extends State<TradeSummary> {
labelAccessorFn: (LinearSales row, _) =>
'${(row.sales)}',
),
], [
"收款(${AppUtils.calculateDouble((tradeSummaryList?.collectionCount == 0 && tradeSummaryList?.refundCount == 0) ? 50 : ((tradeSummaryList?.collectionCount ?? 0) / ((tradeSummaryList?.collectionCount ?? 0) + (tradeSummaryList?.refundCount ?? 0)) * 100))}%)",
"退款(${AppUtils.calculateDouble((tradeSummaryList?.collectionCount == 0 && tradeSummaryList?.refundCount == 0) ? 50 : ((tradeSummaryList?.refundCount ?? 0) / ((tradeSummaryList?.collectionCount ?? 0) + (tradeSummaryList?.refundCount ?? 0)) * 100))}%)"
]),
),
],

38
lib/business_system/mine/business_mine_page.dart

@ -38,7 +38,6 @@ class _BusinessMinePage extends State<BusinessMinePage>
List<Records> records = [];
double visiblePercentage;
@override
void initState() {
super.initState();
@ -62,8 +61,9 @@ class _BusinessMinePage extends State<BusinessMinePage>
tenant: BusinessInstance.instance.businessTenant,
storeId: widget.storeId);
}
BaseData<BusinessStoreList> baseData =
await businessService.getStoreList(BusinessInstance.instance.businessTenant,"1","100").catchError((error) {
BaseData<BusinessStoreList> baseData = await businessService
.getStoreList(BusinessInstance.instance.businessTenant, "1", "100")
.catchError((error) {
SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type),
alignment: Alignment.center);
refreshController.refreshFailed();
@ -86,8 +86,7 @@ class _BusinessMinePage extends State<BusinessMinePage>
key: Key('my-widget-key'),
onVisibilityChanged: (visibilityInfo) {
visiblePercentage = visibilityInfo.visibleFraction;
if(visiblePercentage == 1)
queryStoreList();
if (visiblePercentage == 1) queryStoreList();
},
child: Column(
children: [
@ -105,10 +104,9 @@ class _BusinessMinePage extends State<BusinessMinePage>
},
),
onRefresh: () {
if (widget.businessLoginInfo != null){
if (widget.businessLoginInfo != null) {
queryStoreList();
}
else
} else
refreshController.refreshFailed();
},
child: SingleChildScrollView(
@ -267,22 +265,20 @@ class _BusinessMinePage extends State<BusinessMinePage>
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
if(widget.businessLoginInfo.storeList.length > 1){
Navigator.of(context)
.pushNamed('/router/select_shop', arguments: {
"routeSource":"门店设置",
"records":records
});
}else{
if (widget.businessLoginInfo.storeList.length > 1) {
Navigator.of(context).pushNamed('/router/select_shop',
arguments: {"routeSource": "门店设置", "records": records});
} else {
Navigator.of(context)
.pushNamed('/router/merchant_info',arguments: {
.pushNamed('/router/merchant_info', arguments: {
"storeId": widget.storeId,
"storeName": records[0].storeName,
"records": records[0],
});
}
},
child: commonFunctionsItem("assets/image/bs_shop_logo.webp", "门店设置",""),
child: commonFunctionsItem(
"assets/image/bs_shop_logo.webp", "门店设置", ""),
),
Container(
width: double.infinity,
@ -374,7 +370,13 @@ class _BusinessMinePage extends State<BusinessMinePage>
SizedBox(
height: 20.h,
),
commonFunctionsItem("assets/image/bs_user.webp", "关于我们", ""),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
Navigator.of(context).pushNamed('/router/user_service_page');
},
child:
commonFunctionsItem("assets/image/bs_user.webp", "关于我们", ""))
],
),
);

8
lib/business_system/order/business_order_page.dart

@ -120,13 +120,13 @@ class _BusinessOrderPage extends State<BusinessOrderPage>
body: TabBarView(
children: [
OrderList(_allKey[0], 0, widget.storeId,
editingController.text, selectTime()),
editingController.text, selectTime(),MediaQuery.of(context).viewInsets.bottom != 0 ? isKeyBoardShow = true: isKeyBoardShow = false),
OrderList(_allKey[1], 1, widget.storeId,
editingController.text, selectTime()),
editingController.text, selectTime(),MediaQuery.of(context).viewInsets.bottom != 0 ? isKeyBoardShow = true: isKeyBoardShow = false),
OrderList(_allKey[2], 2, widget.storeId,
editingController.text, selectTime()),
editingController.text, selectTime(),MediaQuery.of(context).viewInsets.bottom != 0 ? isKeyBoardShow = true: isKeyBoardShow = false),
OrderList(_allKey[3], 3, widget.storeId,
editingController.text, selectTime()),
editingController.text, selectTime(),MediaQuery.of(context).viewInsets.bottom != 0 ? isKeyBoardShow = true: isKeyBoardShow = false),
],
),
),

8
lib/business_system/order/order_list.dart

@ -23,8 +23,9 @@ class OrderList extends StatefulWidget {
final String storeId;
final String keyword;
final String time;
final bool isKeyBoardShow;
OrderList(Key key, this.status, this.storeId, this.keyword, this.time)
OrderList(Key key, this.status, this.storeId, this.keyword, this.time,this.isKeyBoardShow)
: super(key: key);
@override
@ -169,12 +170,15 @@ class _OrderList extends State<OrderList> {
return GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
if(widget.isKeyBoardShow){
return;
}else{
Navigator.of(context).pushNamed(
'/router/business_order_detail',
arguments: {
"id": adminOrderDTOList[position].id,
"storeId": widget.storeId
});
});}
},
child: orderItem(adminOrderDTOList[position]),
);

5
lib/retrofit/business_api.dart

@ -252,4 +252,9 @@ abstract class BusinessApiService {
Future<BaseData> wipedBatchs(
@Body() String param);
////
@POST("product/productSortTop")
Future<BaseData> productSortTop(
@Body() Map<String, dynamic> param);
}

22
lib/retrofit/business_api.g.dart

@ -572,4 +572,26 @@ class _BusinessApiService implements BusinessApiService {
);
return value;
}
@override
Future<BaseData> productSortTop(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/productSortTop',
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;
}
}

11
lib/view_widget/icon_text.dart

@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'custom_image.dart';
@ -38,7 +39,7 @@ class IconText extends StatelessWidget {
if (leftIcon != null) {
widgets.add(
Padding(
padding: EdgeInsets.only(left: 2),
padding: EdgeInsets.only(left: 2.w),
child: Icon(
leftIcon,
size: iconSize,
@ -48,7 +49,7 @@ class IconText extends StatelessWidget {
);
} else if (leftImage != null && leftImage != "") {
widgets.add(Padding(
padding: EdgeInsets.only(left: 2),
padding: EdgeInsets.only(left: 2.w),
child: leftImage.startsWith("http")
? MImage(
leftImage,
@ -79,7 +80,7 @@ class IconText extends StatelessWidget {
child: Text(
text,
overflow: overFlow,
maxLines: 2,
// maxLines: 2,
textAlign: TextAlign.start,
style: textStyle,
),
@ -100,7 +101,7 @@ class IconText extends StatelessWidget {
if (rightIcon != null) {
widgets.add(
Padding(
padding: EdgeInsets.only(left: 2),
padding: EdgeInsets.only(left: 2.w),
child: Icon(
rightIcon,
size: iconSize,
@ -111,7 +112,7 @@ class IconText extends StatelessWidget {
} else if (rightImage != null && rightImage != "") {
widgets.add(
Padding(
padding: EdgeInsets.only(left: 2),
padding: EdgeInsets.only(left: 2.w),
child: rightImage.startsWith("http")
? Image.network(
rightImage,

Loading…
Cancel
Save