|
|
|
@ -8,6 +8,8 @@ import 'package:huixiang/generated/l10n.dart';
|
|
|
|
|
import 'package:huixiang/retrofit/data/activity.dart'; |
|
|
|
|
import 'package:huixiang/retrofit/data/base_data.dart'; |
|
|
|
|
import 'package:huixiang/retrofit/data/store_info.dart'; |
|
|
|
|
import 'package:huixiang/retrofit/data/user_entity.dart'; |
|
|
|
|
import 'package:huixiang/retrofit/min_api.dart'; |
|
|
|
|
import 'package:huixiang/retrofit/retrofit_api.dart'; |
|
|
|
|
import 'package:huixiang/store/store_view/store_activity.dart'; |
|
|
|
|
import 'package:huixiang/store/store_view/store_info.dart'; |
|
|
|
@ -38,6 +40,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
|
|
|
|
|
with TickerProviderStateMixin /*, AutomaticKeepAliveClientMixin */ { |
|
|
|
|
TabController tabcontroller; |
|
|
|
|
ApiService apiService; |
|
|
|
|
MinApiService minService; |
|
|
|
|
StoreInfo storeInfo; |
|
|
|
|
RefreshController refreshController; |
|
|
|
|
List<Widget> _widgetOptions; |
|
|
|
@ -63,9 +66,29 @@ class _StoreOrderPage extends State<StoreOrderPage>
|
|
|
|
|
), |
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
minLogin(); |
|
|
|
|
|
|
|
|
|
queryStoreInfo(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
minLogin() { |
|
|
|
|
apiService.minLogin(storeInfo.id) |
|
|
|
|
.catchError((onError){}).then((baseData) { |
|
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
|
UserEntity userEntity = UserEntity.fromJson(baseData.data); |
|
|
|
|
String minToken = userEntity.token; |
|
|
|
|
SharedPreferences.getInstance().then((value) => { |
|
|
|
|
value.setString('minToken', minToken), |
|
|
|
|
}); |
|
|
|
|
minService = MinApiService( |
|
|
|
|
Dio(), |
|
|
|
|
context: context, |
|
|
|
|
token: minToken, |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
queryStoreInfo() async { |
|
|
|
|
final SharedPreferences value = await SharedPreferences.getInstance(); |
|
|
|
|
apiService = ApiService( |
|
|
|
@ -73,7 +96,6 @@ class _StoreOrderPage extends State<StoreOrderPage>
|
|
|
|
|
context: context, |
|
|
|
|
token: value.getString('token'), |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
BaseData baseData = await apiService |
|
|
|
|
.queryStoreInfo(widget.arguments["id"]) |
|
|
|
|
.catchError((error) { |
|
|
|
|