Browse Source

数据列表更改;

弹窗ui更改;
会员接口对接,生意总览接口对接,热销榜单接口对接
wr_2023_business
huixiang_app 1 year ago
parent
commit
0542533a39
  1. BIN
      assets/image/2x/icon_new_vip.webp
  2. BIN
      assets/image/2x/icon_vip_total.webp
  3. BIN
      assets/image/2x/ion_vip_recharge.webp
  4. BIN
      assets/image/3x/icon_new_vip.webp
  5. BIN
      assets/image/3x/icon_vip_total.webp
  6. BIN
      assets/image/3x/ion_vip_recharge.webp
  7. BIN
      assets/image/icon_new_vip.webp
  8. BIN
      assets/image/icon_vip_total.webp
  9. BIN
      assets/image/ion_vip_recharge.webp
  10. 25
      lib/business_system/home/business_home_page.dart
  11. 4
      lib/mine/mine_view/mine_item.dart
  12. 16
      lib/retrofit/business_api.dart
  13. 24
      lib/retrofit/business_api.g.dart
  14. 141
      lib/retrofit/data/vip_counts_info.dart

BIN
assets/image/2x/icon_new_vip.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
assets/image/2x/icon_vip_total.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
assets/image/2x/ion_vip_recharge.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
assets/image/3x/icon_new_vip.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
assets/image/3x/icon_vip_total.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
assets/image/3x/ion_vip_recharge.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
assets/image/icon_new_vip.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 758 B

BIN
assets/image/icon_vip_total.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 760 B

BIN
assets/image/ion_vip_recharge.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 780 B

25
lib/business_system/home/business_home_page.dart

@ -45,13 +45,13 @@ class _BusinessHomePage extends State<BusinessHomePage>
PopularSalesList popularSalesList;
List<OrderTrend> orderTrend = [];
List<LineChartSample2Data> lineChartSample2Data = [
LineChartSample2Data(0, 100, "2023-03-09"),
LineChartSample2Data(1, 200, "2023-03-10"),
LineChartSample2Data(2, 400, "2023-03-11"),
LineChartSample2Data(3, 10, "2023-03-12"),
LineChartSample2Data(4, 250, "2023-03-13"),
LineChartSample2Data(5, 175, "2023-03-14"),
LineChartSample2Data(6, 500, "2023-03-15")
LineChartSample2Data(0, 0, "2023-03-09"),
LineChartSample2Data(1, 0, "2023-03-10"),
LineChartSample2Data(2, 0, "2023-03-11"),
LineChartSample2Data(3, 0, "2023-03-12"),
LineChartSample2Data(4, 0, "2023-03-13"),
LineChartSample2Data(5, 0, "2023-03-14"),
LineChartSample2Data(6, 0, "2023-03-15")
];
@override
@ -80,7 +80,7 @@ class _BusinessHomePage extends State<BusinessHomePage>
: widget.businessLoginInfo.storeList[widget.selectStoreIndex].id);
queryDayAmount();
queryPopularList();
queryPopularList();
queryOrderTrend();
});
}
@ -127,7 +127,15 @@ class _BusinessHomePage extends State<BusinessHomePage>
BaseData<List<OrderTrend>> baseData =
await businessService.orderTrend().catchError((error) {});
if (baseData != null && baseData.isSuccess) {
double index = 0;
if(baseData.data.isNotEmpty){
orderTrend.clear();
}
orderTrend = baseData.data;
orderTrend.forEach((element) {
lineChartSample2Data.add(LineChartSample2Data(index,element.number,element.date));
index += 1;
});
}
} finally {
addLoadCount();
@ -495,6 +503,7 @@ class _BusinessHomePage extends State<BusinessHomePage>
SizedBox(
height: 18.h,
),
if(lineChartSample2Data.isNotEmpty)
LineChartSample2(lineChartSample2Data, "销售量"),
],
),

4
lib/mine/mine_view/mine_item.dart

@ -49,12 +49,12 @@ class _MineItem extends State<MineItem> {
BusinessInstance.instance.businessToken = businessLoginInfo.token;
if (businessLoginInfo.storeList.length > 1) {
Navigator.of(context)
.pushReplacementNamed('/router/select_shop', arguments: {
.pushNamed('/router/select_shop', arguments: {
"businessLoginInfo": businessLoginInfo,
});
} else {
Navigator.of(context)
.pushReplacementNamed('/router/business_page', arguments: {
.pushNamed('/router/business_page', arguments: {
"businessLoginInfo": businessLoginInfo,
});
}

16
lib/retrofit/business_api.dart

@ -9,6 +9,7 @@ import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/retrofit/data/business_login_info.dart';
import 'package:huixiang/retrofit/data/day_count.dart';
import 'package:huixiang/retrofit/data/order_trend.dart';
import 'package:huixiang/retrofit/data/vip_counts_info.dart';
import 'package:retrofit/retrofit.dart';
import '../utils/flutter_utils.dart';
@ -18,9 +19,9 @@ import 'data/popular_sales_list.dart';
part 'business_api.g.dart';
///
// const localBaseUrl = "http://admin-api.test.yixinhuixiang.com/";
const localBaseUrl = "http://admin-api.test.yixinhuixiang.com/";
///
const localBaseUrl = "http://test-merchant.lotus-wallet.com/test-merchant/";
// const localBaseUrl = "http://test-merchant.lotus-wallet.com/test-merchant/";
///线
const serviceBaseUrl = "http://pos.tenant.lotus-wallet.com/test-merchant/";
@ -99,8 +100,8 @@ abstract class BusinessApiService {
}, onError: (DioError e) {
if (EasyLoading.isShow) EasyLoading.dismiss();
// SmartDialog.showToast("网络错误,请切换网络或稍后再试!", alignment: Alignment.center);
SmartDialog.showToast(AppUtils.dioErrorTypeToString(e.type),
alignment: Alignment.center);
// SmartDialog.showToast(AppUtils.dioErrorTypeToString(e.type),
// alignment: Alignment.center);
debugPrint("\n======================= 错误响应数据 =======================");
debugPrint("type = ${e.type}");
debugPrint("message = ${e.message}");
@ -134,11 +135,16 @@ abstract class BusinessApiService {
Future<BaseData<DayCount>> getDayCounts(@Body() Map<String, dynamic> param);
////
@GET("dashBoard/store/{offsetDay}")
@GET("dashBoard/store/?offsetDay={offsetDay}")
Future<BaseData<PopularSalesList>> popularList(
@Path("offsetDay") String offsetDay);
////
@GET("trend/orderTrend")
Future<BaseData<List<OrderTrend>>> orderTrend();
////
@GET("largeScreenReport/getDayCounts?date={date}")
Future<BaseData<VipCountsInfo>> vipCounts(
@Path("date") String date);
}

24
lib/retrofit/business_api.g.dart

@ -74,7 +74,7 @@ class _BusinessApiService implements BusinessApiService {
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'dashBoard/store/$offsetDay',
'dashBoard/store/?offsetDay=$offsetDay',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
@ -112,4 +112,26 @@ class _BusinessApiService implements BusinessApiService {
return value;
}
@override
Future<BaseData<VipCountsInfo>> vipCounts(date) async {
ArgumentError.checkNotNull(date, 'date');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'largeScreenReport/getDayCounts?date=$date',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<VipCountsInfo>.fromJson(
_result.data,
(json) => VipCountsInfo.fromJson(json),
);
return value;
}
}

141
lib/retrofit/data/vip_counts_info.dart

@ -0,0 +1,141 @@
/// dayMoney : "0"
/// yesterdayMoney : "0"
/// paySum : "0"
/// yesterdayPaySum : "0"
/// rechargeMoney : "0"
/// weekRechargeMoney : "0"
/// lastWeekRechargeMoney : "0"
/// orderNum : 0
/// yesterdayOrderNum : 0
/// memberNum : 21800
/// lastWeekMemberNum : 4
/// weekMemberNum : 1
/// newMemberNum : 0
/// yesterdayNewMemberNum : 0
class VipCountsInfo {
VipCountsInfo({
String dayMoney,
String yesterdayMoney,
String paySum,
String yesterdayPaySum,
String rechargeMoney,
String weekRechargeMoney,
String lastWeekRechargeMoney,
num orderNum,
num yesterdayOrderNum,
num memberNum,
num lastWeekMemberNum,
num weekMemberNum,
num newMemberNum,
num yesterdayNewMemberNum,}){
_dayMoney = dayMoney;
_yesterdayMoney = yesterdayMoney;
_paySum = paySum;
_yesterdayPaySum = yesterdayPaySum;
_rechargeMoney = rechargeMoney;
_weekRechargeMoney = weekRechargeMoney;
_lastWeekRechargeMoney = lastWeekRechargeMoney;
_orderNum = orderNum;
_yesterdayOrderNum = yesterdayOrderNum;
_memberNum = memberNum;
_lastWeekMemberNum = lastWeekMemberNum;
_weekMemberNum = weekMemberNum;
_newMemberNum = newMemberNum;
_yesterdayNewMemberNum = yesterdayNewMemberNum;
}
VipCountsInfo.fromJson(dynamic json) {
_dayMoney = json['dayMoney'];
_yesterdayMoney = json['yesterdayMoney'];
_paySum = json['paySum'];
_yesterdayPaySum = json['yesterdayPaySum'];
_rechargeMoney = json['rechargeMoney'];
_weekRechargeMoney = json['weekRechargeMoney'];
_lastWeekRechargeMoney = json['lastWeekRechargeMoney'];
_orderNum = json['orderNum'];
_yesterdayOrderNum = json['yesterdayOrderNum'];
_memberNum = json['memberNum'];
_lastWeekMemberNum = json['lastWeekMemberNum'];
_weekMemberNum = json['weekMemberNum'];
_newMemberNum = json['newMemberNum'];
_yesterdayNewMemberNum = json['yesterdayNewMemberNum'];
}
String _dayMoney;
String _yesterdayMoney;
String _paySum;
String _yesterdayPaySum;
String _rechargeMoney;
String _weekRechargeMoney;
String _lastWeekRechargeMoney;
num _orderNum;
num _yesterdayOrderNum;
num _memberNum;
num _lastWeekMemberNum;
num _weekMemberNum;
num _newMemberNum;
num _yesterdayNewMemberNum;
VipCountsInfo copyWith({ String dayMoney,
String yesterdayMoney,
String paySum,
String yesterdayPaySum,
String rechargeMoney,
String weekRechargeMoney,
String lastWeekRechargeMoney,
num orderNum,
num yesterdayOrderNum,
num memberNum,
num lastWeekMemberNum,
num weekMemberNum,
num newMemberNum,
num yesterdayNewMemberNum,
}) => VipCountsInfo( dayMoney: dayMoney ?? _dayMoney,
yesterdayMoney: yesterdayMoney ?? _yesterdayMoney,
paySum: paySum ?? _paySum,
yesterdayPaySum: yesterdayPaySum ?? _yesterdayPaySum,
rechargeMoney: rechargeMoney ?? _rechargeMoney,
weekRechargeMoney: weekRechargeMoney ?? _weekRechargeMoney,
lastWeekRechargeMoney: lastWeekRechargeMoney ?? _lastWeekRechargeMoney,
orderNum: orderNum ?? _orderNum,
yesterdayOrderNum: yesterdayOrderNum ?? _yesterdayOrderNum,
memberNum: memberNum ?? _memberNum,
lastWeekMemberNum: lastWeekMemberNum ?? _lastWeekMemberNum,
weekMemberNum: weekMemberNum ?? _weekMemberNum,
newMemberNum: newMemberNum ?? _newMemberNum,
yesterdayNewMemberNum: yesterdayNewMemberNum ?? _yesterdayNewMemberNum,
);
String get dayMoney => _dayMoney;
String get yesterdayMoney => _yesterdayMoney;
String get paySum => _paySum;
String get yesterdayPaySum => _yesterdayPaySum;
String get rechargeMoney => _rechargeMoney;
String get weekRechargeMoney => _weekRechargeMoney;
String get lastWeekRechargeMoney => _lastWeekRechargeMoney;
num get orderNum => _orderNum;
num get yesterdayOrderNum => _yesterdayOrderNum;
num get memberNum => _memberNum;
num get lastWeekMemberNum => _lastWeekMemberNum;
num get weekMemberNum => _weekMemberNum;
num get newMemberNum => _newMemberNum;
num get yesterdayNewMemberNum => _yesterdayNewMemberNum;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['dayMoney'] = _dayMoney;
map['yesterdayMoney'] = _yesterdayMoney;
map['paySum'] = _paySum;
map['yesterdayPaySum'] = _yesterdayPaySum;
map['rechargeMoney'] = _rechargeMoney;
map['weekRechargeMoney'] = _weekRechargeMoney;
map['lastWeekRechargeMoney'] = _lastWeekRechargeMoney;
map['orderNum'] = _orderNum;
map['yesterdayOrderNum'] = _yesterdayOrderNum;
map['memberNum'] = _memberNum;
map['lastWeekMemberNum'] = _lastWeekMemberNum;
map['weekMemberNum'] = _weekMemberNum;
map['newMemberNum'] = _newMemberNum;
map['yesterdayNewMemberNum'] = _yesterdayNewMemberNum;
return map;
}
}
Loading…
Cancel
Save