Browse Source

图片优化;

下单bug更改;
ff_new
w-R 3 years ago
parent
commit
8711f4fe5b
  1. 38
      lib/community/community_child_list.dart
  2. 4
      lib/community/community_list.dart
  3. 3
      lib/community/community_view/community_dynamic.dart
  4. 9
      lib/community/new_community_details.dart
  5. 4
      lib/main.dart
  6. 12
      lib/retrofit/min_api.dart
  7. 2
      lib/retrofit/min_api.g.dart
  8. 10
      lib/retrofit/retrofit_api.dart
  9. 2
      lib/retrofit/retrofit_api.g.dart
  10. 20
      lib/store/store_order.dart
  11. 4
      lib/view_widget/new_people_reward.dart

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> {
), ),
), ),
); );
}, // },
); // );
} }
} }

4
lib/community/community_list.dart

@ -98,6 +98,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
), ),
), ),
),) ),)
); ));
} }
/// ///

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();

12
lib/retrofit/min_api.dart

@ -21,19 +21,19 @@ import 'data/shoppingCart.dart';
part 'min_api.g.dart'; part 'min_api.g.dart';
// const base_url = "https://pos.api.lotus-wallet.com/app/"; /// const base_url = "https://pos.api.lotus-wallet.com/app/"; ///
// const baseUrl = "https://pos.api.lotus-wallet.com/app/"; /// const baseUrl = "https://pos.api.lotus-wallet.com/app/"; ///
// 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 ??= 'https://pos.api.lotus-wallet.com/app/';
} }
final Dio _dio; final Dio _dio;

10
lib/retrofit/retrofit_api.dart

@ -54,14 +54,14 @@ import 'data/wx_pay.dart';
part 'retrofit_api.g.dart'; part 'retrofit_api.g.dart';
// const base_url = "https://pos.platform.lotus-wallet.com/app/"; /// const base_url = "https://pos.platform.lotus-wallet.com/app/"; ///
// const baseUrl = "https://pos.platform.lotus-wallet.com/app/"; /// const baseUrl = "https://pos.platform.lotus-wallet.com/app/"; ///
// 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,7 +70,7 @@ 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)

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 ??= 'https://pos.platform.lotus-wallet.com/app/';
} }
final Dio _dio; final Dio _dio;

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) {

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,

Loading…
Cancel
Save