Browse Source

Merge branch 'remove_uniapp' into dev

# Conflicts:
#	lib/retrofit/min_api.g.dart
#	lib/retrofit/retrofit_api.g.dart
#	lib/settlement/settlement_view/distribution.dart
zyh
w-R 3 years ago
parent
commit
40719d3f88
  1. 2
      lib/community/community_list.dart
  2. 7
      lib/home/home_page.dart
  3. 1
      lib/home/home_view/quick_order.dart
  4. 9
      lib/main.dart
  5. 5
      lib/message/system_details.dart
  6. 39
      lib/message/system_message.dart
  7. 23
      lib/mine/manage_address_page.dart
  8. 86
      lib/mine/release_page.dart
  9. 5
      lib/order/order_detail_page.dart
  10. 4
      lib/order/order_view/order_info.dart
  11. 31
      lib/order/order_view/order_status.dart
  12. 4
      lib/retrofit/min_api.dart
  13. 204
      lib/retrofit/min_api.g.dart
  14. 4
      lib/retrofit/retrofit_api.dart
  15. 2
      lib/retrofit/retrofit_api.g.dart
  16. 47
      lib/settlement/settlement.dart
  17. 159
      lib/settlement/settlement_view/distribution.dart
  18. 4
      lib/settlement/settlement_view/settlement_order_commodity.dart
  19. 2
      lib/store/store_view/store_info.dart
  20. 2
      pubspec.lock

2
lib/community/community_list.dart

@ -20,6 +20,7 @@ class CommunityList extends StatefulWidget {
final int commentType;
final bool isList;
final Function exitFull;
final Function removalDynamic;
CommunityList(
this.comments,
@ -27,6 +28,7 @@ class CommunityList extends StatefulWidget {
this.commentType,{
this.isList = false,
this.exitFull,
this.removalDynamic
}
);

7
lib/home/home_page.dart

@ -304,8 +304,11 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
),
child: GestureDetector(
onTap: () {
Navigator.of(context).pushNamed('/router/system_msg_page');
Navigator.of(context).pushNamed('/router/system_msg_page').then((value) {
setState(() {
totalMsg = 0;
});
});
},
child: Container(
height: 24,

1
lib/home/home_view/quick_order.dart

@ -260,6 +260,7 @@ class _QuickOrder extends State<QuickOrder> {
width: 32,
height: 32,
fit: BoxFit.cover,
isCircle: true,
errorSrc: "assets/image/default_1.png",
fadeSrc: "assets/image/default_1.png",
),

9
lib/main.dart

@ -176,7 +176,11 @@ class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ScreenUtilInit(
return MediaQuery(
data: const MediaQueryData(
size: Size(375, 812),
),
child:ScreenUtilInit(
designSize: Size(375, 812),
builder: () => MaterialApp(
debugShowCheckedModeBanner: false,
@ -208,6 +212,7 @@ class MyApp extends StatelessWidget {
home: (isFirst ?? true) ? GuidePage() : LoginPage(),
builder: EasyLoading.init(
builder: (context, widget) {
ScreenUtil.setContext(context);
return MediaQuery(
data: MediaQuery.of(context).copyWith(
textScaleFactor: AppUtils.textScale(context),
@ -238,7 +243,7 @@ class MyApp extends StatelessWidget {
);
},
),
);
));
}
}

5
lib/message/system_details.dart

@ -4,20 +4,17 @@ import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/article.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/message.dart';
import 'package:huixiang/retrofit/data/page.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/comment_menu.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:huixiang/view_widget/my_footer.dart';
import 'package:huixiang/view_widget/no_data_view.dart';
import 'package:huixiang/view_widget/round_button.dart';
import 'package:huixiang/web/web_view/comment_list.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -95,7 +92,7 @@ class _SystemDetails extends State<SystemDetails> {
}
}
///
////
_vipFollow(followId,isFollow) async {
BaseData baseData = await apiService.follow(followId);
if (baseData != null && baseData.isSuccess) {

39
lib/message/system_message.dart

@ -124,7 +124,12 @@ class _SystemMessagePage extends State<SystemMessagePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
return WillPopScope(
onWillPop: () async {
Navigator.of(context).pop(true);
return false;
},
child:Scaffold(
appBar: MyAppBar(
background: Colors.white,
leadingColor: Colors.black,
@ -187,7 +192,7 @@ class _SystemMessagePage extends State<SystemMessagePage> {
),
),
);
));
}
Widget newsSurvey(){
@ -199,7 +204,11 @@ class _SystemMessagePage extends State<SystemMessagePage> {
Expanded(child: GestureDetector(
onTap: (){
Navigator.of(context)
.pushNamed('/router/system_details',arguments: {"msgType":5});
.pushNamed('/router/system_details',arguments: {"msgType":5}).then((value) {
setState(() {
msgNumber["5"] = 0;
});
});
},
child:Column(
children: [
@ -255,7 +264,11 @@ class _SystemMessagePage extends State<SystemMessagePage> {
GestureDetector(
onTap: (){
Navigator.of(context)
.pushNamed('/router/system_details',arguments: {"msgType":6});
.pushNamed('/router/system_details',arguments: {"msgType":6}).then((value) {
setState(() {
msgNumber["6"] = 0;
});
});
},
child: Column(
children: [
@ -310,7 +323,11 @@ class _SystemMessagePage extends State<SystemMessagePage> {
GestureDetector(
onTap: (){
Navigator.of(context)
.pushNamed('/router/system_details',arguments: {"msgType":4});
.pushNamed('/router/system_details',arguments: {"msgType":4}).then((value) {
setState(() {
msgNumber["4"] = 0;
});
});
},
child:Column(
children: [
@ -401,10 +418,18 @@ class _SystemMessagePage extends State<SystemMessagePage> {
onTap: () {
if(messages[position].typed == 2)
Navigator.of(context)
.pushNamed('/router/system_details',arguments: {"msgType":2});
.pushNamed('/router/system_details',arguments: {"msgType":2}).then((value) {
setState(() {
msgNumber["2"] = 0;
});
});
else if(messages[position].typed == 3)
Navigator.of(context)
.pushNamed('/router/system_details',arguments: {"msgType":3});
.pushNamed('/router/system_details',arguments: {"msgType":3}).then((value) {
setState(() {
msgNumber["3"] = 0;
});
});
},
child: buildMessageItem(messages[position]),
);

23
lib/mine/manage_address_page.dart

@ -1,6 +1,7 @@
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/address.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
@ -346,15 +347,15 @@ class _ManageAddressPage extends State<ManageAddressPage> {
}
}
changeCheck(value, position) async {
if (value) {
addressList[checkIndex].isDefault = false;
checkIndex = position;
addressList[position].isDefault = true;
BaseData baseData =
await apiService.updateAddress(addressList[position].toJson());
if (baseData != null && baseData.isSuccess) {}
setState(() {});
}
}
// changeCheck(value, position) async {
// if (value) {
// addressList[checkIndex].isDefault = false;
// checkIndex = position;
// addressList[position].isDefault = true;
// BaseData baseData =
// await apiService.updateAddress(addressList[position].toJson());
// if (baseData != null && baseData.isSuccess) {}
// setState(() {});
// }
// }
}

86
lib/mine/release_page.dart

@ -3,6 +3,7 @@ import 'dart:convert';
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:huixiang/community/community_list.dart';
import 'package:huixiang/community/community_view/community_dynamic.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/retrofit/data/article.dart';
@ -25,24 +26,25 @@ class ReleasePage extends StatefulWidget {
class _ReleasePage extends State<ReleasePage> {
RefreshController refreshController = RefreshController();
final ScrollController scrollController = ScrollController();
ApiService apiService;
int pageNum = 0;
String userId;
bool isLoadMore = false;
List<Article> articles = [];
List<ComunityComment> comments = [];
@override
void initState() {
super.initState();
_onRefresh();
}
_onRefresh() async {
pageNum = 0;
setState(() {});
queryCommunity();
}
///
queryCommunity() async {
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
@ -53,7 +55,10 @@ class _ReleasePage extends State<ReleasePage> {
token: value.getString("token"),
);
}
pageNum += 1;
if(isLoadMore){
pageNum += 1;
isLoadMore = false;
}else pageNum = 1;
BaseData<PageInfo<ComunityComment>> baseData = await apiService.trendList({
"onlyFollow": false,
"onlyMe": true,
@ -69,23 +74,9 @@ class _ReleasePage extends State<ReleasePage> {
refreshController.loadComplete();
if (baseData.isSuccess) {
if (pageNum == 1) {
articles.clear();
comments.clear();
}
baseData.data.list.forEach((element) {
var article = Article();
article.id = element.id;
article.content = jsonEncode(element.subjectInfo);
article.mainTitle =element.subject;
article.liked = element.selfFollow;
article.authorHeadImg = element.memberInfo?.avatar;
article.authorName = element.memberInfo?.nickname;
article.createTime = element.createTime;
article.updateUser = element.memberInfo?.mid;
article.viewers = element?.viewers;
article.likes = element?.likes;
article.comments = element?.comments;
articles.add(article);
});
comments.addAll(baseData.data.list);
// print("comments: ${comments.length}");
if (int.tryParse(baseData.data.total) < (pageNum * 10)) {
refreshController.loadNoData();
@ -119,34 +110,35 @@ class _ReleasePage extends State<ReleasePage> {
),
onRefresh: _onRefresh,
onLoading: () {
setState(() {});
isLoadMore = true;
_onRefresh();
},
child: ListView.builder(
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, position) {
return InkWell(
child: CommunityDynamic(
articles[position],
1,
exitFull: (){setState(() {
_onRefresh();
});},
removalDynamic: () {
_onRefresh();
},
scrollController: scrollController,
child: Container(
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Container(
// color: Color(0xFFF7F7F7),
// margin: EdgeInsets.only(top: 16.h),
child: Column(
children: [
CommunityList(
comments,
userId,
1,
isList: true,
exitFull: () {
_onRefresh();
},
removalDynamic: () {
_onRefresh();
},
),
],
),
onTap: () {
Navigator.of(context).pushNamed(
'/router/community_details',
arguments: {
"businessId": articles[position].id,"userId":userId,
},
);
},
);
},
itemCount: articles.length,
)),
),
),
),),
);
},
);

5
lib/order/order_detail_page.dart

@ -1,7 +1,6 @@
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:fluwx/fluwx.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/order/order_view/order_address.dart';
import 'package:huixiang/order/order_view/order_commodity.dart';
@ -10,12 +9,8 @@ import 'package:huixiang/order/order_view/order_pay_selected.dart';
import 'package:huixiang/order/order_view/order_status.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/order_info.dart';
import 'package:huixiang/retrofit/data/placeOrderFirst.dart';
import 'package:huixiang/retrofit/data/wx_pay.dart';
import 'package:huixiang/retrofit/min_api.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/settlement/settlement_view/pay_method.dart';
import 'package:huixiang/utils/min.dart';
import 'package:huixiang/view_widget/icon_text.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:shared_preferences/shared_preferences.dart';

4
lib/order/order_view/order_info.dart

@ -45,8 +45,8 @@ class _OrderInfoView extends State<OrderInfoView> {
S.of(context).dingdanhao, widget.orderInfo != null ? widget.orderInfo.id : ""),
orderInfoItem(S.of(context).xiadanshijian,
widget.orderInfo != null ? widget.orderInfo.createTime : ""),
// orderInfoItem(S.of(context).peisongfangshi, orderInfo != null ? orderInfo.createTime : ""),
orderInfoItem(S.of(context).peisongfangshi,"美团配送"),
orderInfoItem(S.of(context).peisongfangshi,(widget.orderInfo != null && widget.orderInfo.logisticsName != "") ? widget.orderInfo.logisticsName : "美团配送"),
// orderInfoItem(S.of(context).peisongfangshi,"美团配送"),
orderInfoItem(
S.of(context).beizhuxinxi,
widget.orderInfo != null

31
lib/order/order_view/order_status.dart

@ -166,18 +166,21 @@ class _OrderStatus extends State<OrderStatus> {
}
}
return [
AspectRatio(
aspectRatio: 1,
child: BorderText(
text: hour,
textColor: Colors.white,
fontSize: 21.sp,
fontWeight: FontWeight.bold,
borderColor: Colors.white,
borderWidth: 1,
padding: EdgeInsets.all(2),
),
),
Container(
alignment: Alignment.center,
child: AspectRatio(
aspectRatio: 1,
child: BorderText(
text: hour,
textColor: Colors.white,
fontSize:16.sp,
fontWeight: FontWeight.bold,
borderColor: Colors.white,
borderWidth: 1,
// padding: EdgeInsets.all(2),
),
),
),
SizedBox(
width: 8.w,
),
@ -196,11 +199,11 @@ class _OrderStatus extends State<OrderStatus> {
child: BorderText(
text: minute,
textColor: Colors.white,
fontSize: 21.sp,
fontSize:16.sp,
fontWeight: FontWeight.bold,
borderColor: Colors.white,
borderWidth: 1,
padding: EdgeInsets.all(2),
// padding: EdgeInsets.all(2),
),
),
];

4
lib/retrofit/min_api.dart

@ -34,8 +34,8 @@ part 'min_api.g.dart';
// const base_url = "http://user.prod.kunqi.lotus-wallet.com/app/"; ///222
// const baseUrl = "http://user.prod.kunqi.lotus-wallet.com/app/"; ///222
// const base_url = "http://192.168.10.236:8765/app/";///
// const baseUrl = "http://192.168.10.236:8765/app/";///
const base_url = "http://192.168.10.236:8765/app/";///
const baseUrl = "http://192.168.10.236:8765/app/";///
const base_url = "http://192.168.10.88:8765/app/";///

204
lib/retrofit/min_api.g.dart

@ -9,7 +9,7 @@ part of 'min_api.dart';
class _MinApiService implements MinApiService {
_MinApiService(this._dio, {this.baseUrl}) {
ArgumentError.checkNotNull(_dio, '_dio');
baseUrl ??= 'http://192.168.10.88:8765/app/';
baseUrl ??= 'http://192.168.10.236:8765/app/';
}
final Dio _dio;
@ -400,206 +400,4 @@ class _MinApiService implements MinApiService {
);
return value;
}
@override
Future<BaseData<List<HomeRecommendList>>> recommendList() async {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'product/recommendList',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<List<HomeRecommendList>>.fromJson(
_result.data,
(json) => (json as List<dynamic>)
.map<HomeRecommendList>((i) => HomeRecommendList.fromJson(i as Map<String, dynamic>))
.toList());
return value;
}
@override
Future<BaseData<ShoppingHomeConfig>> homeConfig() async {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'store/homeConfig',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<ShoppingHomeConfig>.fromJson(
_result.data,
(json) => ShoppingHomeConfig.fromJson(json),
);
return value;
}
@override
Future<BaseData<ActivityAreaList>> findActListByType(allDay,type) async {
ArgumentError.checkNotNull(allDay, 'allDay');
ArgumentError.checkNotNull(type, 'type');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/actTemplate/findActListByType?allDay=$allDay&type=$type',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<ActivityAreaList>.fromJson(
_result.data,
(json) => ActivityAreaList.fromJson(json),
);
return value;
}
@override
Future<BaseData<ActivityDetails>> viewProduct(actProductId,type) async {
ArgumentError.checkNotNull(actProductId, 'actProductId');
ArgumentError.checkNotNull(type, 'type');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'actTemplate/viewProduct?actProductId=$actProductId&type=$type',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<ActivityDetails>.fromJson(
_result.data,
(json) => ActivityDetails.fromJson(json),
);
return value;
}
@override
Future<BaseData<dynamic>> launchAct(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>>('actTemplate/launchAct',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<dynamic>.fromJson(
_result.data,
(json) => json as dynamic,
);
return value;
}
@override
Future<BaseData<dynamic>> joinAct(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>>('actTemplate/joinAct',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<dynamic>.fromJson(
_result.data,
(json) => json as dynamic,
);
return value;
}
@override
Future<BaseData<dynamic>> actPay(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>>('actTemplate/actPay',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<dynamic>.fromJson(
_result.data,
(json) => json as dynamic,
);
return value;
}
@override
Future<BaseData<List<ActivityOrderList>>> showMyActList(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>>('actTemplate/showMyActList',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<List<ActivityOrderList>>.fromJson(
_result.data,
(json) => (json as List<dynamic>)
.map<ActivityOrderList>(
(i) => ActivityOrderList.fromJson(i as Map<String, dynamic>))
.toList());
return value;
}
@override
Future<BaseData<ActivityActRecordDetails>> showOneAct(actRecordId) async {
ArgumentError.checkNotNull(actRecordId, 'actRecordId');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'actTemplate/showOneAct?actRecordId=$actRecordId',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<ActivityActRecordDetails>.fromJson(
_result.data,
(json) => ActivityActRecordDetails.fromJson(json),
);
return value;
}
}

4
lib/retrofit/retrofit_api.dart

@ -61,8 +61,8 @@ part 'retrofit_api.g.dart';
// const base_url = "http://platform.prod.kunqi.lotus-wallet.com/app/"; ///222
// const baseUrl = "http://platform.prod.kunqi.lotus-wallet.com/app/"; ///222
// const base_url = "http://192.168.10.236:8766/app/"; ///
// const baseUrl = "http://192.168.10.236:8766/app/"; ///
const base_url = "http://192.168.10.236:8766/app/"; ///
const baseUrl = "http://192.168.10.236:8766/app/"; ///
// const base_url = "http://192.168.10.37:8766/app/";
// const baseUrl = "http://192.168.10.37:8766/app/";

2
lib/retrofit/retrofit_api.g.dart

@ -9,7 +9,7 @@ part of 'retrofit_api.dart';
class _ApiService implements ApiService {
_ApiService(this._dio, {this.baseUrl}) {
ArgumentError.checkNotNull(_dio, '_dio');
baseUrl ??= 'http://192.168.10.88:8766/app/';
baseUrl ??= 'http://192.168.10.236:8766/app/';
}
final Dio _dio;

47
lib/settlement/settlement.dart

@ -137,6 +137,7 @@ class _Settlement extends State<Settlement> {
queryOrderDetails(parentId);
}
});
}
}
@ -154,7 +155,9 @@ class _Settlement extends State<Settlement> {
}
queryAddress(int selectedBtn) async {
this.selectedBtn = selectedBtn;
setState(() {
this.selectedBtn = selectedBtn;
});
if (address != null) {
queryOrderInfo(address.id, selectedBtn, null, 0, null);
return;
@ -167,7 +170,10 @@ class _Settlement extends State<Settlement> {
double.tryParse(storeInfo.longitude),
);
if (baseDate != null && baseDate.isSuccess) {
address = baseDate.data[0];
setState(() {
address = baseDate.data[0];
});
for (int i = 1; i < baseDate.data.length; i++) {
Address address1 = baseDate.data[i];
@ -191,7 +197,9 @@ class _Settlement extends State<Settlement> {
double mi1 = await BMFCalculateUtils.getLocationDistance(
bmfCoordinate, coordinate1);
if (mi1 < mi) {
address = address1;
setState(() {
address = address1;
});
}
}
@ -199,6 +207,23 @@ class _Settlement extends State<Settlement> {
}
}
///
selectedAddress(String addId) async {
BaseData<List<Address>> baseDate =
await minService.queryAddress().catchError((error) {});
if (baseDate != null && baseDate.isSuccess) {
setState(() {
baseDate.data.forEach((element) {
if(element.id == addId)
address = element;
});
});
queryOrderInfo(address.id, selectedBtn, null, 0, null);
}
}
PlaceOrderFirst placeOrderFirst;
DownOrder downOrder;
@ -399,10 +424,24 @@ class _Settlement extends State<Settlement> {
child: Column(
children: [
DistributionMode(
queryOrderInfo,
(addressId,
isTake,
memberCouponId,
orderId,
promotionId){
setState(() {
this.selectedBtn = 0;
});
queryOrderInfo(addressId,
isTake,
memberCouponId,
orderId,
promotionId);
},
queryAddress,
storeInfo,
address,
selectedAddress
),
SizedBox(

159
lib/settlement/settlement_view/distribution.dart

@ -20,11 +20,12 @@ class DistributionMode extends StatefulWidget {
String promotionId,
) queryOrderInfo;
final Function(int selectedBtn) queryAddress;
final Function(String addId) selectedNewAddress;
final StoreInfo storeInfo;
final Address address;
DistributionMode(
this.queryOrderInfo, this.queryAddress, this.storeInfo, this.address);
DistributionMode(this.queryOrderInfo, this.queryAddress, this.storeInfo,
this.address, this.selectedNewAddress);
@override
State<StatefulWidget> createState() {
@ -86,7 +87,7 @@ class _DistributionMode extends State<DistributionMode> {
@override
Widget build(BuildContext context) {
return Container(
height: 147.h,
height: 150.h,
margin: EdgeInsets.only(
left: 16,
right: 16,
@ -126,10 +127,13 @@ class _DistributionMode extends State<DistributionMode> {
Expanded(
flex: 1,
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
selectedBtn = 0;
widget.queryOrderInfo(
null, selectedBtn, null, 0, null);
setState(() {
selectedBtn = 0;
widget.queryOrderInfo(
null, selectedBtn, null, 0, null);
});
},
child: Container(
height: 50.h,
@ -149,8 +153,10 @@ class _DistributionMode extends State<DistributionMode> {
flex: 1,
child: GestureDetector(
onTap: () {
selectedBtn = 1;
widget.queryAddress(selectedBtn);
setState(() {
selectedBtn = 1;
widget.queryAddress(selectedBtn);
});
},
child: Container(
height: 50.h,
@ -252,7 +258,7 @@ class _DistributionMode extends State<DistributionMode> {
Column(
children: [
RoundButton(
width: 41.w,
// width: 41.w,
height: 13,
text: distance.length > 3
? "${distance}km"
@ -280,74 +286,97 @@ class _DistributionMode extends State<DistributionMode> {
],
),
)
: Container(
width: double.infinity,
padding: EdgeInsets.only(left: 16, right: 16, top: 15),
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
"assets/image/icon_permission_location.png",
height: 24.h,
width: 24.w,
),
Text(
"张先生",
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 15.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF4C4C4C),
: GestureDetector(
onTap: () {
setState(() {
Navigator.of(context).pushNamed(
'/router/manage_address_page',
arguments: {"isSelector": true}).then((value) {
widget.selectedNewAddress((value as Map)["id"]);
});
});
},
child: Container(
width: double.infinity,
padding: EdgeInsets.only(left: 16, right: 16, top: 15),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
"assets/image/icon_permission_location.png",
height: 24.h,
width: 24.w,
),
),
SizedBox(
width: 13,
),
Expanded(
child: Text(
"12309090909",
Text(
widget?.address?.username ?? "",
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 15.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF4C4C4C),
),
),
),
InkWell(
onTap: () {
setState(() {
Navigator.of(context).popAndPushNamed(
'/router/manage_address_page');
});
},
child: Icon(
Icons.keyboard_arrow_right,
size: 24,
SizedBox(
width: 13,
),
Expanded(
child: Text(
widget?.address?.phone ?? "",
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 15.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF4C4C4C),
),
),
),
InkWell(
onTap: () {
setState(() {
Navigator.of(context).pushNamed(
'/router/manage_address_page',
arguments: {
"isSelector": true
}).then((value) {
widget.selectedNewAddress(
(value as Map)["id"]);
});
});
},
child: Container(
padding:EdgeInsets.symmetric(horizontal:15.w,vertical: 5.h),
child: Icon(
Icons.keyboard_arrow_right,
size: 24,
),
)),
],
),
Padding(
padding: EdgeInsets.only(top: 4, left: 25),
child: Text(
(widget?.address?.city ?? "") +
(widget?.address?.area ?? "") +
(widget?.address?.address ?? ""),
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF727272),
),
),
],
),
Padding(
padding: EdgeInsets.only(top: 4, left: 25),
child: Text(
"武昌区中国铁建凯德1818蓝调步行街中北路109附33门牌号05",
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF727272),
),
),
),
],
],
),
),
),
)
],
),
],

4
lib/settlement/settlement_view/settlement_order_commodity.dart

@ -94,8 +94,8 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
: S.of(context).yunfei,
"",
(widget.minOrderInfo != null)
? "+${widget.minOrderInfo?.postFee ?? "0"}"
: "+${widget.settleOrderInfo?.postAge ?? "0"}",
? "+ ${widget.minOrderInfo?.postFee ?? "0"}"
: "+ ${widget.settleOrderInfo?.postAge ?? "0"}",
),
);
}

2
lib/store/store_view/store_info.dart

@ -30,7 +30,7 @@ class _StoreInfoView extends State<StoreInfoView> {
top: 5.h,
bottom: 6.h,
),
height: 140.h,
height: 143.h,
padding: EdgeInsets.all(12.w),
decoration: BoxDecoration(
color: Colors.white,

2
pubspec.lock

@ -255,7 +255,7 @@ packages:
name: flutter_screenutil
url: "https://pub.flutter-io.cn"
source: hosted
version: "5.1.0"
version: "5.1.1"
flutter_smart_dialog:
dependency: "direct main"
description:

Loading…
Cancel
Save