|
|
@ -7,6 +7,8 @@ import 'package:huixiang/generated/l10n.dart'; |
|
|
|
import 'package:huixiang/retrofit/data/activity.dart'; |
|
|
|
import 'package:huixiang/retrofit/data/activity.dart'; |
|
|
|
import 'package:huixiang/retrofit/data/base_data.dart'; |
|
|
|
import 'package:huixiang/retrofit/data/base_data.dart'; |
|
|
|
import 'package:huixiang/retrofit/data/store_info.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/retrofit/retrofit_api.dart'; |
|
|
|
import 'package:huixiang/store/store_view/store_activity.dart'; |
|
|
|
import 'package:huixiang/store/store_view/store_activity.dart'; |
|
|
|
import 'package:huixiang/store/store_view/store_info.dart'; |
|
|
|
import 'package:huixiang/store/store_view/store_info.dart'; |
|
|
@ -37,6 +39,7 @@ class _StoreOrderPage extends State<StoreOrderPage> |
|
|
|
with TickerProviderStateMixin /*, AutomaticKeepAliveClientMixin */ { |
|
|
|
with TickerProviderStateMixin /*, AutomaticKeepAliveClientMixin */ { |
|
|
|
TabController tabcontroller; |
|
|
|
TabController tabcontroller; |
|
|
|
ApiService apiService; |
|
|
|
ApiService apiService; |
|
|
|
|
|
|
|
MinApiService minService; |
|
|
|
StoreInfo storeInfo; |
|
|
|
StoreInfo storeInfo; |
|
|
|
RefreshController refreshController; |
|
|
|
RefreshController refreshController; |
|
|
|
List<Widget> _widgetOptions; |
|
|
|
List<Widget> _widgetOptions; |
|
|
@ -65,6 +68,26 @@ class _StoreOrderPage extends State<StoreOrderPage> |
|
|
|
queryStoreInfo(); |
|
|
|
queryStoreInfo(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// 小程序登录 |
|
|
|
|
|
|
|
minLogin() { |
|
|
|
|
|
|
|
apiService.minLogin(widget.arguments["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 { |
|
|
|
queryStoreInfo() async { |
|
|
|
final SharedPreferences value = await SharedPreferences.getInstance(); |
|
|
|
final SharedPreferences value = await SharedPreferences.getInstance(); |
|
|
|
apiService = ApiService( |
|
|
|
apiService = ApiService( |
|
|
@ -73,6 +96,8 @@ class _StoreOrderPage extends State<StoreOrderPage> |
|
|
|
token: value.getString('token'), |
|
|
|
token: value.getString('token'), |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
minLogin(); |
|
|
|
|
|
|
|
|
|
|
|
BaseData baseData = await apiService |
|
|
|
BaseData baseData = await apiService |
|
|
|
.queryStoreInfo(widget.arguments["id"]) |
|
|
|
.queryStoreInfo(widget.arguments["id"]) |
|
|
|
.catchError((error) { |
|
|
|
.catchError((error) { |
|
|
|