Browse Source

Merge remote-tracking branch 'origin/remove_uniapp' into remove_uniapp

ff_new
fmk 3 years ago
parent
commit
9f58ce17b7
  1. 38
      lib/community/community_child_list.dart
  2. 6
      lib/community/community_list.dart
  3. 3
      lib/community/community_view/community_dynamic.dart
  4. 9
      lib/community/new_community_details.dart
  5. 6
      lib/home/home_page.dart
  6. 4
      lib/main.dart
  7. 3
      lib/message/system_details.dart
  8. 39
      lib/message/system_message.dart
  9. 23
      lib/mine/manage_address_page.dart
  10. 86
      lib/mine/release_page.dart
  11. 8
      lib/retrofit/min_api.dart
  12. 2
      lib/retrofit/min_api.g.dart
  13. 8
      lib/retrofit/retrofit_api.dart
  14. 2
      lib/retrofit/retrofit_api.g.dart
  15. 47
      lib/settlement/settlement.dart
  16. 159
      lib/settlement/settlement_view/distribution.dart
  17. 4
      lib/settlement/settlement_view/settlement_order_commodity.dart
  18. 20
      lib/store/store_order.dart
  19. 2
      lib/store/store_view/store_info.dart
  20. 4
      lib/view_widget/new_people_reward.dart
  21. 10
      pubspec.lock
  22. 8
      pubspec.yaml

38
lib/community/community_child_list.dart

@ -39,7 +39,7 @@ class _CommunityChildList extends State<CommunityChildList> {
} }
_onRefresh() async { _onRefresh() async {
setState(() {}); queryCommunity();
} }
/// ///
@ -71,23 +71,25 @@ class _CommunityChildList extends State<CommunityChildList> {
refreshController.refreshCompleted(); refreshController.refreshCompleted();
refreshController.loadComplete(); refreshController.loadComplete();
if (baseData.isSuccess) { if (baseData.isSuccess) {
if (pageNum == 1) { setState(() {
comments.clear(); if (pageNum == 1) {
} comments.clear();
comments.addAll(baseData.data.list); }
// comments.sort((a,b)=>b.createTime.compareTo(a.createTime)); comments.addAll(baseData.data.list);
// print("comments: ${comments.length}"); // comments.sort((a,b)=>b.createTime.compareTo(a.createTime));
if (int.tryParse(baseData.data.total) < (pageNum * 10)) { // print("comments: ${comments.length}");
refreshController.loadNoData(); if (int.tryParse(baseData.data.total) < (pageNum * 10)) {
} refreshController.loadNoData();
}
});
} }
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return FutureBuilder( // return FutureBuilder(
future: queryCommunity(), // future: queryCommunity(),
builder: (context, position) { // builder: (context, position) {
return SmartRefresher( return SmartRefresher(
controller: refreshController, controller: refreshController,
enablePullDown: true, enablePullDown: true,
@ -102,7 +104,7 @@ class _CommunityChildList extends State<CommunityChildList> {
onRefresh: _onRefresh, onRefresh: _onRefresh,
onLoading: () { onLoading: () {
isLoadMore = true; isLoadMore = true;
setState(() {}); _onRefresh();
}, },
scrollController: scrollController, scrollController: scrollController,
child: Container( child: Container(
@ -119,9 +121,7 @@ class _CommunityChildList extends State<CommunityChildList> {
0, 0,
isList: true, isList: true,
exitFull: () { exitFull: () {
setState(() { _onRefresh();
_onRefresh();
});
}, },
), ),
], ],
@ -130,7 +130,7 @@ class _CommunityChildList extends State<CommunityChildList> {
), ),
), ),
); );
}, // },
); // );
} }
} }

6
lib/community/community_list.dart

@ -20,6 +20,7 @@ class CommunityList extends StatefulWidget {
final int commentType; final int commentType;
final bool isList; final bool isList;
final Function exitFull; final Function exitFull;
final Function removalDynamic;
CommunityList( CommunityList(
this.comments, this.comments,
@ -27,6 +28,7 @@ class CommunityList extends StatefulWidget {
this.commentType,{ this.commentType,{
this.isList = false, this.isList = false,
this.exitFull, this.exitFull,
this.removalDynamic
} }
); );
@ -98,6 +100,10 @@ class _CommunityList extends State<CommunityList> {
// exitFull: () { // exitFull: () {
// setState(() {}); // setState(() {});
// }, // },
}).then((value) {
widget.exitFull();
setState(() {
});
}); });
setState(() {}); setState(() {});
}, },

3
lib/community/community_view/community_dynamic.dart

@ -406,8 +406,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
); );
}, },
child: MImage( child: MImage(
cnt["images"][position] cnt["images"][position],
.replaceAll(".jpg", ".jpg?imageView2/0/q/75"),
fit: BoxFit.cover, fit: BoxFit.cover,
aspectRatio: 1, aspectRatio: 1,
radius: BorderRadius.circular(1), radius: BorderRadius.circular(1),

9
lib/community/new_community_details.dart

@ -121,7 +121,12 @@ class _NewCommunityDetails extends State<NewCommunityDetails> with WidgetsBindin
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AnnotatedRegion<SystemUiOverlayStyle>( return WillPopScope(
onWillPop: () async {
Navigator.of(context).pop(true);
return false;
},
child:AnnotatedRegion<SystemUiOverlayStyle>(
value: SystemUiOverlayStyle.light, value: SystemUiOverlayStyle.light,
child: Material(child: Scaffold( child: Material(child: Scaffold(
appBar: MyAppBar( appBar: MyAppBar(
@ -318,7 +323,7 @@ class _NewCommunityDetails extends State<NewCommunityDetails> with WidgetsBindin
), ),
), ),
),) ),)
); ));
} }
/// ///

6
lib/home/home_page.dart

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

4
lib/main.dart

@ -100,9 +100,9 @@ void main() async {
Locale locale; Locale locale;
if (sharedPreferences.containsKey("language") && if (sharedPreferences.containsKey("language") &&
sharedPreferences.getString("language") == "zh") { sharedPreferences.getString("language") == "zh") {
locale = Locale.fromSubtags(languageCode: 'zh', countryCode: 'CN');
} else {
locale = Locale.fromSubtags(languageCode: 'zh', countryCode: 'TW'); locale = Locale.fromSubtags(languageCode: 'zh', countryCode: 'TW');
} else {
locale = Locale.fromSubtags(languageCode: 'zh', countryCode: 'CH');
} }
ImgCachePath(); ImgCachePath();
initSdk(); initSdk();

3
lib/message/system_details.dart

@ -4,20 +4,17 @@ import 'package:dio/dio.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.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/base_data.dart';
import 'package:huixiang/retrofit/data/message.dart'; import 'package:huixiang/retrofit/data/message.dart';
import 'package:huixiang/retrofit/data/page.dart'; import 'package:huixiang/retrofit/data/page.dart';
import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/classic_header.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/custom_image.dart';
import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:huixiang/view_widget/my_footer.dart'; import 'package:huixiang/view_widget/my_footer.dart';
import 'package:huixiang/view_widget/no_data_view.dart'; import 'package:huixiang/view_widget/no_data_view.dart';
import 'package:huixiang/view_widget/round_button.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:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';

39
lib/message/system_message.dart

@ -124,7 +124,12 @@ class _SystemMessagePage extends State<SystemMessagePage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return WillPopScope(
onWillPop: () async {
Navigator.of(context).pop(true);
return false;
},
child:Scaffold(
appBar: MyAppBar( appBar: MyAppBar(
background: Colors.white, background: Colors.white,
leadingColor: Colors.black, leadingColor: Colors.black,
@ -187,7 +192,7 @@ class _SystemMessagePage extends State<SystemMessagePage> {
), ),
), ),
); ));
} }
Widget newsSurvey(){ Widget newsSurvey(){
@ -199,7 +204,11 @@ class _SystemMessagePage extends State<SystemMessagePage> {
Expanded(child: GestureDetector( Expanded(child: GestureDetector(
onTap: (){ onTap: (){
Navigator.of(context) 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( child:Column(
children: [ children: [
@ -255,7 +264,11 @@ class _SystemMessagePage extends State<SystemMessagePage> {
GestureDetector( GestureDetector(
onTap: (){ onTap: (){
Navigator.of(context) 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( child: Column(
children: [ children: [
@ -310,7 +323,11 @@ class _SystemMessagePage extends State<SystemMessagePage> {
GestureDetector( GestureDetector(
onTap: (){ onTap: (){
Navigator.of(context) 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( child:Column(
children: [ children: [
@ -401,10 +418,18 @@ class _SystemMessagePage extends State<SystemMessagePage> {
onTap: () { onTap: () {
if(messages[position].typed == 2) if(messages[position].typed == 2)
Navigator.of(context) 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) else if(messages[position].typed == 3)
Navigator.of(context) 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]), child: buildMessageItem(messages[position]),
); );

23
lib/mine/manage_address_page.dart

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

86
lib/mine/release_page.dart

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

8
lib/retrofit/min_api.dart

@ -28,12 +28,12 @@ part 'min_api.g.dart';
// const base_url = "http://user.prod.kunqi.lotus-wallet.com/app/"; ///222 // const base_url = "http://user.prod.kunqi.lotus-wallet.com/app/"; ///222
// const baseUrl = "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 base_url = "http://192.168.10.236:8765/app/";///
const baseUrl = "http://192.168.10.236:8765/app/";/// // const baseUrl = "http://192.168.10.236:8765/app/";///
// const base_url = "http://192.168.10.142:8765/app/";/// const base_url = "http://192.168.10.88:8765/app/";///
// const baseUrl = "http://192.168.10.142:8765/app/";/// const baseUrl = "http://192.168.10.88:8765/app/";///
// const base_url = "http://192.168.10.37:8766/app/"; // const base_url = "http://192.168.10.37:8766/app/";

2
lib/retrofit/min_api.g.dart

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

8
lib/retrofit/retrofit_api.dart

@ -60,8 +60,8 @@ part 'retrofit_api.g.dart';
// const base_url = "http://platform.prod.kunqi.lotus-wallet.com/app/"; ///222 // const base_url = "http://platform.prod.kunqi.lotus-wallet.com/app/"; ///222
// const baseUrl = "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 base_url = "http://192.168.10.236:8766/app/"; ///
const baseUrl = "http://192.168.10.236:8766/app/"; /// // const baseUrl = "http://192.168.10.236:8766/app/"; ///
// const base_url = "http://192.168.10.159:8766/app/"; /// // const base_url = "http://192.168.10.159:8766/app/"; ///
// const baseUrl = "http://192.168.10.159:8766/app/"; /// // const baseUrl = "http://192.168.10.159:8766/app/"; ///
@ -70,8 +70,8 @@ const baseUrl = "http://192.168.10.236:8766/app/"; ///费韬
// const baseUrl = "http://192.168.10.37:8766/app/"; // const baseUrl = "http://192.168.10.37:8766/app/";
// const base_url = "http://192.168.10.142:8766/app/";/// const base_url = "http://192.168.10.88:8766/app/";///
// const baseUrl = "http://192.168.10.142:8766/app/";/// const baseUrl = "http://192.168.10.142:8766/app/";///
@RestApi(baseUrl: baseUrl) @RestApi(baseUrl: baseUrl)
abstract class ApiService { abstract class ApiService {

2
lib/retrofit/retrofit_api.g.dart

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

47
lib/settlement/settlement.dart

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

159
lib/settlement/settlement_view/distribution.dart

@ -20,11 +20,12 @@ class DistributionMode extends StatefulWidget {
String promotionId, String promotionId,
) queryOrderInfo; ) queryOrderInfo;
final Function(int selectedBtn) queryAddress; final Function(int selectedBtn) queryAddress;
final Function(String addId) selectedNewAddress;
final StoreInfo storeInfo; final StoreInfo storeInfo;
final Address address; final Address address;
DistributionMode( DistributionMode(this.queryOrderInfo, this.queryAddress, this.storeInfo,
this.queryOrderInfo, this.queryAddress, this.storeInfo, this.address); this.address, this.selectedNewAddress);
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -86,7 +87,7 @@ class _DistributionMode extends State<DistributionMode> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
height: 143.h, height: 150.h,
margin: EdgeInsets.only( margin: EdgeInsets.only(
left: 16, left: 16,
right: 16, right: 16,
@ -126,10 +127,13 @@ class _DistributionMode extends State<DistributionMode> {
Expanded( Expanded(
flex: 1, flex: 1,
child: GestureDetector( child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () { onTap: () {
selectedBtn = 0; setState(() {
widget.queryOrderInfo( selectedBtn = 0;
null, selectedBtn, null, 0, null); widget.queryOrderInfo(
null, selectedBtn, null, 0, null);
});
}, },
child: Container( child: Container(
height: 50.h, height: 50.h,
@ -149,8 +153,10 @@ class _DistributionMode extends State<DistributionMode> {
flex: 1, flex: 1,
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
selectedBtn = 1; setState(() {
widget.queryAddress(selectedBtn); selectedBtn = 1;
widget.queryAddress(selectedBtn);
});
}, },
child: Container( child: Container(
height: 50.h, height: 50.h,
@ -252,7 +258,7 @@ class _DistributionMode extends State<DistributionMode> {
Column( Column(
children: [ children: [
RoundButton( RoundButton(
width: 41.w, // width: 41.w,
height: 13, height: 13,
text: distance.length > 3 text: distance.length > 3
? "${distance}km" ? "${distance}km"
@ -280,74 +286,97 @@ class _DistributionMode extends State<DistributionMode> {
], ],
), ),
) )
: Container( : GestureDetector(
width: double.infinity, onTap: () {
padding: EdgeInsets.only(left: 16, right: 16, top: 15), setState(() {
child: Column( Navigator.of(context).pushNamed(
children: [ '/router/manage_address_page',
Row( arguments: {"isSelector": true}).then((value) {
mainAxisAlignment: MainAxisAlignment.spaceBetween, widget.selectedNewAddress((value as Map)["id"]);
crossAxisAlignment: CrossAxisAlignment.center, });
children: [ });
Image.asset( },
"assets/image/icon_permission_location.png", child: Container(
height: 24.h, width: double.infinity,
width: 24.w, padding: EdgeInsets.only(left: 16, right: 16, top: 15),
), child: Column(
Text( mainAxisAlignment: MainAxisAlignment.start,
"张先生", crossAxisAlignment: CrossAxisAlignment.start,
overflow: TextOverflow.ellipsis, children: [
style: TextStyle( Row(
fontSize: 15.sp, mainAxisAlignment: MainAxisAlignment.spaceBetween,
fontWeight: MyFontWeight.medium, crossAxisAlignment: CrossAxisAlignment.center,
color: Color(0xFF4C4C4C), children: [
Image.asset(
"assets/image/icon_permission_location.png",
height: 24.h,
width: 24.w,
), ),
), Text(
SizedBox( widget?.address?.username ?? "",
width: 13,
),
Expanded(
child: Text(
"12309090909",
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle( style: TextStyle(
fontSize: 15.sp, fontSize: 15.sp,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
color: Color(0xFF4C4C4C), color: Color(0xFF4C4C4C),
), ),
), ),
), SizedBox(
InkWell( width: 13,
onTap: () { ),
setState(() { Expanded(
Navigator.of(context).popAndPushNamed( child: Text(
'/router/manage_address_page'); widget?.address?.phone ?? "",
}); overflow: TextOverflow.ellipsis,
}, maxLines: 2,
child: Icon( style: TextStyle(
Icons.keyboard_arrow_right, fontSize: 15.sp,
size: 24, 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, : S.of(context).yunfei,
"", "",
(widget.minOrderInfo != null) (widget.minOrderInfo != null)
? "+${widget.minOrderInfo?.postFee ?? "0"}" ? "+ ${widget.minOrderInfo?.postFee ?? "0"}"
: "+${widget.settleOrderInfo?.postAge ?? "0"}", : "+ ${widget.settleOrderInfo?.postAge ?? "0"}",
), ),
); );
} }

20
lib/store/store_order.dart

@ -656,6 +656,16 @@ class _StoreOrderPage extends State<StoreOrderPage>
/// ///
_queryMiNiDetail(String id, int count) async { _queryMiNiDetail(String id, int count) async {
EasyLoading.show(status: S.current.zhengzaijiazai); EasyLoading.show(status: S.current.zhengzaijiazai);
if(count < 0){
shopCarGoods.shoppingCartSkuItemList.forEach((element) {
if(element.productId == id){
shopCartReduce(element);
setState(() {
});
}
});
return;
}
BaseData<MiNiDetail> baseData = await minService.miNiDetail(id); BaseData<MiNiDetail> baseData = await minService.miNiDetail(id);
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
showStoreSelector(baseData.data, id, count); showStoreSelector(baseData.data, id, count);
@ -805,11 +815,13 @@ class _StoreOrderPage extends State<StoreOrderPage>
BaseData<List<ShoppingCart>> baseDate = BaseData<List<ShoppingCart>> baseDate =
await minService.shoppingCartSingle(shopCarTemp); await minService.shoppingCartSingle(shopCarTemp);
if (baseDate.isSuccess) { if (baseDate.isSuccess) {
EasyLoading.dismiss();
this.shopCarGoods = await queryShopCar(); this.shopCarGoods = await queryShopCar();
if (shopCartKey != null) { if (shopCartKey?.currentState != null) {
shopCartKey.currentState.setState(() {}); shopCartKey.currentState.setState(() {});
} }
setState(() {}); setState(() {
});
} }
return this.shopCarGoods; return this.shopCarGoods;
} }
@ -868,9 +880,9 @@ class _StoreOrderPage extends State<StoreOrderPage>
} }
ShoppingCartSkuItemListBean shopSkuItem = shopCarGoods ShoppingCartSkuItemListBean shopSkuItem = shopCarGoods
.shoppingCartSkuItemList .shoppingCartSkuItemList
.firstWhere((element) => skuId == element.skuId); .firstWhere((element) => skuId == element.id);
int shopSkuIndex = shopCarGoods.shoppingCartSkuItemList int shopSkuIndex = shopCarGoods.shoppingCartSkuItemList
.indexWhere((element) => skuId == element.skuId); .indexWhere((element) => skuId == element.id);
if (shopSkuItem != null) { if (shopSkuItem != null) {
if (shopSkuItem.buyNum > 1) { if (shopSkuItem.buyNum > 1) {

2
lib/store/store_view/store_info.dart

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

4
lib/view_widget/new_people_reward.dart

@ -108,7 +108,7 @@ class _NewPeopleReward extends State<NewPeopleReward> {
Widget rewardItem(FirstLoginCouponList firstLoginCouponList) { Widget rewardItem(FirstLoginCouponList firstLoginCouponList) {
return Container( return Container(
height:80.h, height:90.h,
width: double.infinity, width: double.infinity,
decoration: BoxDecoration( decoration: BoxDecoration(
image: DecorationImage( image: DecorationImage(
@ -167,7 +167,7 @@ class _NewPeopleReward extends State<NewPeopleReward> {
Text( Text(
firstLoginCouponList.couponName, firstLoginCouponList.couponName,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
maxLines: 2, maxLines: 1,
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,

10
pubspec.lock

@ -708,12 +708,10 @@ packages:
tpns_flutter_plugin: tpns_flutter_plugin:
dependency: "direct main" dependency: "direct main"
description: description:
path: "." name: tpns_flutter_plugin
ref: "V1.1.2" url: "https://pub.flutter-io.cn"
resolved-ref: b814d62f4b82422459f786671f23dd535062d503 source: hosted
url: "git://github.com/TencentCloud/TPNS-Flutter-Plugin" version: "1.1.0"
source: git
version: "1.1.2"
transformer_page_view: transformer_page_view:
dependency: transitive dependency: transitive
description: description:

8
pubspec.yaml

@ -19,10 +19,10 @@ dependencies:
keframe: ^2.0.2 #滑动组件卡顿优化 keframe: ^2.0.2 #滑动组件卡顿优化
tpns_flutter_plugin: tpns_flutter_plugin: ^1.0.8
git: # git:
url: git://github.com/TencentCloud/TPNS-Flutter-Plugin # url: git://github.com/TencentCloud/TPNS-Flutter-Plugin
ref: V1.1.2 # ref: V1.1.2
like_button: ^2.0.2 like_button: ^2.0.2
cupertino_icons: ^1.0.2 cupertino_icons: ^1.0.2

Loading…
Cancel
Save