默认地址删除显示问题;添加购物车弹窗;

pull/1/head
戴余标 3 years ago
parent 835a266194
commit 9b26dea775

@ -1,3 +1,4 @@
import 'package:aku_new_community/widget/others/user_tool.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -86,8 +87,8 @@ class AddressListPageState extends State<AddressListPage>
firstRefresh: true,
header: MaterialHeader(),
controller: _refreshController,
onRefresh: () async {
_addressModels = await Userfunc.getMyAddress();
onRefresh: () async { await UserTool.appProvider.getMyAddress();
_addressModels = UserTool.appProvider.addressModels;
_onload = false;
setState(() {});
},

@ -310,6 +310,8 @@ class AppProvider extends ChangeNotifier {
///
Future getMyAddress() async {
BaseModel model = await NetUtil().get(SAASAPI.market.address.myAddress);
print((model.data as List).length);
if ((model.data as List).length == 0) {
_addressModels.clear();
_defaultAddressModel=null;

@ -671,7 +671,7 @@ class _GoodDetailPageState extends State<GoodDetailPage> {
onTap: () async {
var re = await SearchFunc.addGoodsCar(_goodDetail!.id);
if (re) {
Get.back();
BotToast.showText(text: '已添加进购物车');
}
},
child: Container(

@ -79,7 +79,7 @@ class SearchFunc {
///
static Future<bool> addGoodsCar(int jcookGoodsId) async {
BaseModel model = await NetUtil().get(SAASAPI.market.shopCart.insert,
params: {'appGoodsPushId': jcookGoodsId}, showMessage: true);
params: {'appGoodsPushId': jcookGoodsId}, showMessage: false);
return model.success;
}

Loading…
Cancel
Save