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

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

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

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

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

Loading…
Cancel
Save