Commit 5e48db507533f087a1049ec634e7bc12e93c97e0

Authored by wdn127929
1 parent b0e6987e

切换店铺,本地缓存

... ... @@ -12,14 +12,14 @@ if (flutterRoot == null) {
}
def flutterVersionCode = "350"
def flutterVersionCode = "351"
if (flutterVersionCode == null) {
flutterVersionCode = '350'
flutterVersionCode = '351'
}
def flutterVersionName = "3.5.0"
def flutterVersionName = "3.5.1"
if (flutterVersionName == null) {
flutterVersionName = '3.5.0'
flutterVersionName = '3.5.1'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
... ...
... ... @@ -119,7 +119,7 @@ class _IfNeedCreateStoreState extends State<IfNeedCreateStore>
///点击某个店铺
_clickStore(context, CheckSellerAccSunModel sunModel) async {
Map<String, dynamic> seller = sunModel.toJson();
await _getCustomerActivityBaseinfo(seller['id'], seller['uid']);
//判断进入个人信息还是直接进入主页
if (name == '' || phone == '') {
... ... @@ -134,7 +134,7 @@ class _IfNeedCreateStoreState extends State<IfNeedCreateStore>
///进入某个店铺
_loginStore(context, CheckSellerAccSunModel sunModel) {
UserModel userModel = Provider.of<UserModel>(context, listen: false);
userModel.accountLogin = false;
App.sp.setBool("accountLogin", false);
Map<String, dynamic> seller = sunModel.toJson();
Map<String, dynamic> userMap = {
"openid": seller['uid'],
... ...
... ... @@ -220,8 +220,7 @@ class _BaseInfoPageState extends State<BaseInfoPage> {
///进入某个店铺
_loginStore(context, CheckSellerAccSunModel sunModel) {
UserModel userModel = Provider.of<UserModel>(context, listen: false);
userModel.accountLogin = false;
App.sp.setBool("accountLogin", false);
Map<String, dynamic> seller = sunModel.toJson();
Map<String, dynamic> userMap = {
"openid": seller['uid'],
... ... @@ -239,6 +238,7 @@ class _BaseInfoPageState extends State<BaseInfoPage> {
"noon": "",
"night": "",
};
UserModel userModel = Provider.of<UserModel>(context, listen: false);
userModel.saveUserInfo(User.fromJson(userMap));
userModel.getSellerInfo(
context,
... ...
... ... @@ -233,15 +233,12 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
height: ScreenUtil().setWidth(56),
fontSize: 28,
isBold: false,
textColor:
Provider.of<UserModel>(context, listen: false)
.accountLogin
? MyColours.color_999999
: MyColours.color_199095,
textColor: App.sp.getBool("accountLogin")
? MyColours.color_999999
: MyColours.color_199095,
radius: ScreenUtil().setWidth(20),
onPressed: () {
if (Provider.of<UserModel>(context, listen: false)
.accountLogin) {
if (App.sp.getBool("accountLogin")) {
return;
}
NavigatorUtil.goIfNeedCreateStorePage(context,
... ...
... ... @@ -25,7 +25,7 @@ class UserModel with ChangeNotifier {
String _registrationId; //极光推送registrationId
String _token; //信鸽推送token
List<PullMarketingByUidSunModel> pullMarketingByUidSunModel;
bool accountLogin = false;
// bool accountLogin = false;
User get user => _user;
... ... @@ -63,9 +63,9 @@ class UserModel with ChangeNotifier {
// return baseResp.msg ?? '用户名密码错误,请重新输入';
} else {
if (acclogin) {
accountLogin = true;
App.sp.setBool("accountLogin", true);
} else {
accountLogin = false;
App.sp.setBool("accountLogin", false);
}
Map<String, dynamic> seller = baseResp.data[0]["seller"];
Map<String, dynamic> user = baseResp.data[0]["user"];
... ... @@ -332,7 +332,7 @@ class UserModel with ChangeNotifier {
App.sp.remove("unionid");
}
App.sp.setBool("isLogin", false);
XgFlutterPlugin().stopXg();
// XgFlutterPlugin().stopXg();
NavigatorUtil.goLoginPage(context);
}
}
... ... @@ -349,7 +349,7 @@ class UserModel with ChangeNotifier {
Utils.showToast(baseResp.msg ?? "切换店铺失败,请稍后重试");
return false;
} else {
XgFlutterPlugin().stopXg();
// XgFlutterPlugin().stopXg();
return true;
}
}
... ...