diff --git a/lib/home/help_farmers/help_farmers_page.dart b/lib/home/help_farmers/help_farmers_page.dart index 06121fef..00f95d6d 100644 --- a/lib/home/help_farmers/help_farmers_page.dart +++ b/lib/home/help_farmers/help_farmers_page.dart @@ -50,8 +50,7 @@ class _HelpFarmersPage extends State { ///助农列表 queryConfig() async { try { - BaseListData? baseData = - await apiService?.getConfig().catchError((error) { + BaseListData? baseData = await apiService?.getConfig().catchError((error) { networkStatus = -1; refreshController.refreshFailed(); return BaseListData()..isSuccess = false; @@ -97,6 +96,7 @@ class _HelpFarmersPage extends State { SliverAppBar( pinned: true, backgroundColor: Color(0xFF32A060), + surfaceTintColor: Colors.transparent, elevation: 0, leading: GestureDetector( onTap: () { diff --git a/lib/home/home_view/home_recommend_goods.dart b/lib/home/home_view/home_recommend_goods.dart index 7f3bc417..15eda867 100644 --- a/lib/home/home_view/home_recommend_goods.dart +++ b/lib/home/home_view/home_recommend_goods.dart @@ -56,7 +56,8 @@ class _HomeRecommendGoods extends State { return GestureDetector( onTap: () { String storeId = widget.homeRank!.CommodityZone![position].storeId ?? ""; - miniLogin(apiService!, storeId, (token) { + String tenant = widget.homeRank!.CommodityZone![position].tenantCode ?? ""; + miniLogin(apiService!, tenant, storeId, (token) { Navigator.of(context).pushNamed( '/router/store_order', arguments: { diff --git a/lib/home/home_view/top_selling_list.dart b/lib/home/home_view/top_selling_list.dart index e07e96be..565ff12d 100644 --- a/lib/home/home_view/top_selling_list.dart +++ b/lib/home/home_view/top_selling_list.dart @@ -125,7 +125,9 @@ class _TopSellingList extends State { onTap: () { String storeId = widget.homeRank!.CommodityList![index] .goodList![position].storeId ?? ""; - miniLogin(apiService!, storeId, (token) { + String tenant = widget.homeRank!.CommodityList![index] + .goodList![position].tenantCode ?? ""; + miniLogin(apiService!, tenant, storeId, (token) { Navigator.of(context).pushNamed( '/router/store_order', arguments: { diff --git a/lib/im/chat_details_page.dart b/lib/im/chat_details_page.dart index d3c4ddb4..f69ac7d2 100644 --- a/lib/im/chat_details_page.dart +++ b/lib/im/chat_details_page.dart @@ -346,7 +346,7 @@ class _ChatDetailsPage extends State showCamera: false, compressSize: 500, uiConfig: UIConfig( - uiThemeColor: Color(0xFFFFFFFF), + uiThemeColor: Color(0xFFAAAAAA), ), cropConfig: CropConfig( enableCrop: false, @@ -835,65 +835,70 @@ class _ChatDetailsPage extends State crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.center, children: [ - if (message.state == 3) - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(100), - color: Color(0xFFFF441A), - ), - width: 20, - height: 20, - alignment: Alignment.center, - child: Text( - "!", - textAlign: TextAlign.left, - style: TextStyle( - color: Colors.white, - fontSize: 17.sp, - fontWeight: MyFontWeight.regular, - ), - ), - ), - if (message.state == 3) - SizedBox( - width: 12.w, - ), Expanded( child: Container( alignment: Alignment.centerRight, - child: InkWell( - onLongPress: () { - showMessageMenu(context, _buttonKey, message, index, loadanimatedListKey); - }, - child: Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(6), - color: Color(0xFF32A060), - boxShadow: [ - BoxShadow( - color: Color(0xFFA8A3A3).withAlpha(12), - offset: Offset(0, 4), - blurRadius: 4, - spreadRadius: 0, + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + if (message.state == 3) + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(100), + color: Color(0xFFFF441A), + ), + width: 20, + height: 20, + alignment: Alignment.center, + child: Text( + "!", + textAlign: TextAlign.left, + style: TextStyle( + color: Colors.white, + fontSize: 17.sp, + fontWeight: MyFontWeight.regular, + ), + ), + ), + if (message.state == 3) + SizedBox( + width: 12.w, + ), + InkWell( + onLongPress: () { + showMessageMenu(context, _buttonKey, message, index, loadanimatedListKey); + }, + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(6), + color: Color(0xFF32A060), + boxShadow: [ + BoxShadow( + color: Color(0xFFA8A3A3).withAlpha(12), + offset: Offset(0, 4), + blurRadius: 4, + spreadRadius: 0, + ), + ], + ), + key: _buttonKey, + padding: EdgeInsets.symmetric( + vertical: 6.h, + horizontal: 12.w, + ), + child: Text( + tex = message.content, + textAlign: TextAlign.left, + style: TextStyle( + height: 1.2, + color: Colors.white, + fontSize: 17.sp, + fontWeight: MyFontWeight.medium, + ), ), - ], - ), - key: _buttonKey, - padding: EdgeInsets.symmetric( - vertical: 6.h, - horizontal: 12.w, - ), - child: Text( - tex = message.content, - textAlign: TextAlign.left, - style: TextStyle( - height: 1.2, - color: Colors.white, - fontSize: 17.sp, - fontWeight: MyFontWeight.medium, ), ), - ), + ], ), ), ), diff --git a/lib/im/im_view/im_page.dart b/lib/im/im_view/im_page.dart index 4a5dced6..e3ffe5b1 100644 --- a/lib/im/im_view/im_page.dart +++ b/lib/im/im_view/im_page.dart @@ -515,77 +515,78 @@ class _IMPage extends State implements OnChatMessage { width: 12.w, ), Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Expanded( - child: Text( - !contactMap.containsKey(conversationId) - ? "" - : contactMap[conversationId]?.nickname ?? "", - // overflow: TextOverflow.fade, - maxLines: 1, - style: TextStyle( - fontSize: 16.sp, - color: Color(0xFF060606), - fontWeight: MyFontWeight.semi_bold, + child: SizedBox( + height: 54, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Row( + children: [ + Expanded( + child: Text( + !contactMap.containsKey(conversationId) + ? "" + : contactMap[conversationId]?.nickname ?? "", + // overflow: TextOverflow.fade, + maxLines: 1, + style: TextStyle( + fontSize: 16.sp, + color: Color(0xFF060606), + fontWeight: MyFontWeight.semi_bold, + ), ), ), - ), - Text( - lastMessageMap[conversationId]?.time != null - ? AppUtils.timeFormatter( - DateTime.fromMillisecondsSinceEpoch(int.parse( - lastMessageMap[conversationId]?.time ?? ""))) - : "", - style: TextStyle( - fontSize: 12.sp, - color: Color(0xFFA29E9E), - fontWeight: MyFontWeight.regular, - ), - ), - ], - ), - SizedBox( - height: 7.h, - ), - Row( - children: [ - Expanded( - child: Text( - messageContent(lastMessageMap[conversationId]!), - maxLines: 1, - overflow: TextOverflow.ellipsis, + Text( + lastMessageMap[conversationId]?.time != null + ? AppUtils.timeFormatter( + DateTime.fromMillisecondsSinceEpoch(int.parse( + lastMessageMap[conversationId]?.time ?? ""))) + : "", style: TextStyle( fontSize: 12.sp, - color: Color(0xFF353535), + color: Color(0xFFA29E9E), fontWeight: MyFontWeight.regular, ), ), - ), - if (unreadCountMap[conversationId] != null && - unreadCountMap[conversationId]! > 0) - Container( - width: 16, - height: 16, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(100), - color: Color(0xFFFF441A), - ), - child: RoundButton( - text: "${unreadCountMap[conversationId]}", - textColor: Colors.white, - fontWeight: MyFontWeight.regular, - backgroup: Color(0xFFFF441A), - fontSize: 10.sp, - radius: 100, + ], + ), + Row( + children: [ + Expanded( + child: Text( + messageContent(lastMessageMap[conversationId]!), + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 12.sp, + color: Color(0xFF353535), + fontWeight: MyFontWeight.regular, + ), ), ), - ], - ), - ], + if (unreadCountMap[conversationId] != null && + unreadCountMap[conversationId]! > 0) + Container( + width: 16, + height: 16, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(100), + color: Color(0xFFFF441A), + ), + child: RoundButton( + text: "${unreadCountMap[conversationId]}", + textColor: Colors.white, + fontWeight: MyFontWeight.regular, + backgroup: Color(0xFFFF441A), + fontSize: 10.sp, + radius: 100, + ), + ), + ], + ), + ], + ), ), ), ], diff --git a/lib/mine/mine_shop_details.dart b/lib/mine/mine_shop_details.dart index e6cbcbcd..71913faa 100644 --- a/lib/mine/mine_shop_details.dart +++ b/lib/mine/mine_shop_details.dart @@ -681,7 +681,8 @@ class _MineShopDetails extends State { ); } else { String storeId = store.id ?? ""; - miniLogin(apiService!, storeId, (token) { + String tenant = store.tenantCode ?? ""; + miniLogin(apiService!, tenant, storeId, (token) { Navigator.of(context).pushNamed( '/router/store_order', arguments: { diff --git a/lib/mine/mine_shop_recharge.dart b/lib/mine/mine_shop_recharge.dart index 738b5086..14478819 100644 --- a/lib/mine/mine_shop_recharge.dart +++ b/lib/mine/mine_shop_recharge.dart @@ -840,7 +840,8 @@ class _MineShopRecharge extends State { ); } else { String storeId = store.id ?? ""; - miniLogin(apiService!, storeId, (token) { + String tenant = store.tenantCode ?? ""; + miniLogin(apiService!, tenant, storeId, (token) { Navigator.of(context).pushNamed( '/router/store_order', arguments: { diff --git a/lib/mine/mine_view/mine_view.dart b/lib/mine/mine_view/mine_view.dart index 186236bf..41ee794d 100644 --- a/lib/mine/mine_view/mine_view.dart +++ b/lib/mine/mine_view/mine_view.dart @@ -196,8 +196,8 @@ class _MineView extends State { if (tableId != "" && tenantCode != "" && shopId != "") { - String storeId = shopId ?? ""; - miniLogin(apiService!, storeId, (token) { + String storeId = shopId; + miniLogin(apiService!, tenantCode, storeId, (token) { Navigator.of(context).pushNamed( '/router/store_order', arguments: { diff --git a/lib/mine/vip_detail_page.dart b/lib/mine/vip_detail_page.dart index a680f5ec..6a4cb3d5 100644 --- a/lib/mine/vip_detail_page.dart +++ b/lib/mine/vip_detail_page.dart @@ -445,7 +445,8 @@ class _VipDetailPage extends State { ); } else { String storeId = store.id ?? ""; - miniLogin(apiService!, storeId, (token) { + String tenant = store.tenantCode ?? ""; + miniLogin(apiService!, tenant, storeId, (token) { Navigator.of(context).pushNamed( '/router/store_order', arguments: { diff --git a/lib/order/order_history_page.dart b/lib/order/order_history_page.dart index 5b71ea41..30ae8b41 100644 --- a/lib/order/order_history_page.dart +++ b/lib/order/order_history_page.dart @@ -298,7 +298,8 @@ class _OrderHistoryList extends State ); } else { String storeId = orderInfo.storeVO?.id ?? ""; - miniLogin(apiService!, storeId, (token) { + String tenant = orderInfo.tenantCode ?? ""; + miniLogin(apiService!, tenant, storeId, (token) { Navigator.of(context).pushNamed( '/router/store_order', arguments: { diff --git a/lib/order/order_view/order_address.dart b/lib/order/order_view/order_address.dart index 71171af4..28f468c7 100644 --- a/lib/order/order_view/order_address.dart +++ b/lib/order/order_view/order_address.dart @@ -268,7 +268,8 @@ class _OrderAddress extends State { Navigator.of(context).pop(); } else if (widget.jumpState == 2) { String storeId = widget.orderInfo?.storeVO?.id ?? ""; - miniLogin(widget.apiService!, storeId, (token) { + String tenant = widget.orderInfo?.tenantCode ?? ""; + miniLogin(widget.apiService!, tenant, storeId, (token) { Navigator.of(context).pushNamed( '/router/store_order', arguments: { diff --git a/lib/retrofit/min_api.dart b/lib/retrofit/min_api.dart index 8b9220d9..faf44057 100644 --- a/lib/retrofit/min_api.dart +++ b/lib/retrofit/min_api.dart @@ -58,8 +58,8 @@ abstract class MinApiService { baseUrl = kReleaseMode ? serviceMiniBaseUrl : localMiniBaseUrl; headers["Environment"] = "app"; dio.options = BaseOptions( - connectTimeout: 18000.milliseconds, - receiveTimeout: 18000.milliseconds, + connectTimeout: 36000.milliseconds, + receiveTimeout: 36000.milliseconds, headers: headers, responseType: ResponseType.json, ); @@ -68,14 +68,11 @@ abstract class MinApiService { RequestOptions options, RequestInterceptorHandler handler, ) { - debugPrint( - "\n======================= Min_请求数据 ======================="); + debugPrint("\n======================= Min_请求数据 ======================="); debugPrint("method = ${options.method.toString()}"); debugPrint("url = ${options.uri.toString()}"); debugPrint("headers = ${options.headers}"); - if (showLoading && - !SmartDialog.checkExist( - dialogTypes: {SmartAllDialogType.loading})) { + if (showLoading && !SmartDialog.checkExist(dialogTypes: {SmartAllDialogType.loading})) { AppUtils.cancelCloseLoading(); //是否显示loading S.current.zhengzaijiazai.loading; @@ -102,8 +99,7 @@ abstract class MinApiService { if (map["code"] == 40005 || map["code"] == 40001) { LoginTipsDialog.instance.show(context); } - debugPrint( - "======================= Min_响应数据结束 =======================\n"); + debugPrint("======================= Min_响应数据结束 =======================\n"); if (map["code"] == 0) { handler.next(response); } else { @@ -121,8 +117,7 @@ abstract class MinApiService { if (SmartDialog.checkExist(dialogTypes: {SmartAllDialogType.loading})) { AppUtils.closeLoading(); } - debugPrint( - "\n======================= Min_错误响应数据 ======================="); + debugPrint("\n======================= Min_错误响应数据 ======================="); debugPrint("type = ${e.type}"); debugPrint("message = ${e.message}"); debugPrint("\n"); diff --git a/lib/retrofit/min_api.g.dart b/lib/retrofit/min_api.g.dart index 1353de1c..f16677f8 100644 --- a/lib/retrofit/min_api.g.dart +++ b/lib/retrofit/min_api.g.dart @@ -14,7 +14,7 @@ class _MinApiService implements MinApiService { this.baseUrl, this.errorLogger, }) { - baseUrl ??= 'http://192.168.10.54:8765/app/'; + baseUrl ??= serviceMiniBaseUrl; } final Dio _dio; diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index 5118a349..bf80f9d4 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -73,7 +73,7 @@ import 'package:retrofit/retrofit.dart'; part 'retrofit_api.g.dart'; -@RestApi(baseUrl: kDebugMode ? serviceBaseUrl : localBaseUrl) +@RestApi(baseUrl: kReleaseMode ? serviceBaseUrl : localBaseUrl) abstract class ApiService { factory ApiService( Dio dio, { @@ -90,8 +90,7 @@ abstract class ApiService { headers["Environment"] = "app"; } print("软件当前运行的模式 kReleaseMode:" + (kReleaseMode ? "发布模式" : "调试模式")); - baseUrl = kDebugMode ? serviceBaseUrl : localBaseUrl; - if (kDebugMode) baseUrl = serviceBaseUrl; + baseUrl = kReleaseMode ? serviceBaseUrl : localBaseUrl; if (isIp) baseUrl = ipBaseUrl; dio.options = BaseOptions( connectTimeout: 30000.milliseconds, diff --git a/lib/store/scan.dart b/lib/store/scan.dart index 3f80207e..4616e2de 100644 --- a/lib/store/scan.dart +++ b/lib/store/scan.dart @@ -35,7 +35,7 @@ class Scan { if (table?.isNotEmpty ?? false) { int? tableId = int.tryParse(table!); String storeId = id ?? ""; - miniLogin(apiService!, storeId, (token) { + miniLogin(apiService, tenantCode, storeId, (token) { Navigator.of(context).pushNamed( '/router/store_order', arguments: { diff --git a/lib/store/shop/shop_scroll_coordinator.dart b/lib/store/shop/shop_scroll_coordinator.dart index 64223c30..bb05937f 100644 --- a/lib/store/shop/shop_scroll_coordinator.dart +++ b/lib/store/shop/shop_scroll_coordinator.dart @@ -73,33 +73,28 @@ class ShopScrollCoordinator { /// 当前页面Header最大程度展开状态 PageExpandState pageExpand = PageExpandState.NotExpand; - set (PageExpandState value) { - pageExpand = value; - pageExpandChange?.call(); - } /// 当手指离开屏幕 void onPointerUp(PointerUpEvent event) { final double _pagePixels = _pageScrollPosition.pixels; if (0.0 < _pagePixels && _pagePixels < (_pageInitialOffset ?? 0)) { if (pageExpand == PageExpandState.NotExpand - && (_pageInitialOffset ?? 0) - _pagePixels > _scrollRedundancy && _pageScrollPosition.userScrollDirection == ScrollDirection.forward) { + && (_pageInitialOffset ?? 0) - _pagePixels > _scrollRedundancy) { _pageScrollPosition.animateTo( 0.0, duration: const Duration(milliseconds: 400), curve: Curves.ease, - ).then((_) => set(PageExpandState.Expanded)); - } else if (pageExpand == PageExpandState.Expanded && _pageScrollPosition.userScrollDirection == ScrollDirection.reverse) { + ); + } else if (pageExpand == PageExpandState.Expanded) { pageExpand = PageExpandState.Expanding; _pageScrollPosition.animateTo((_pageInitialOffset ?? 0), duration: const Duration(milliseconds: 400), curve: Curves.ease, - ).then((_) => set(PageExpandState.NotExpand)); + ); } } } - Function()? pageExpandChange; /// 更新用户滑动方向 void updateUserScrollDirection(ShopScrollPosition? position, ScrollDirection? value) { diff --git a/lib/store/shop_details_page.dart b/lib/store/shop_details_page.dart index c2c38dd9..5a8caa09 100644 --- a/lib/store/shop_details_page.dart +++ b/lib/store/shop_details_page.dart @@ -1335,7 +1335,7 @@ class _ShopDetailsPage extends State { (tenantCode?.isNotEmpty ?? false) && (shopId?.isNotEmpty ?? false)) { String storeId = shopId ?? ""; - miniLogin(apiService!, storeId, (token) { + miniLogin(apiService!, tenantCode ?? "", storeId, (token) { Navigator.of(context).pushNamed( '/router/store_order', arguments: { diff --git a/lib/store/store_order.dart b/lib/store/store_order.dart index 57fa1a4c..5c210ac2 100644 --- a/lib/store/store_order.dart +++ b/lib/store/store_order.dart @@ -87,6 +87,9 @@ class _StoreOrderPage extends State tabcontroller = TabController(length: 1, vsync: this); _pageScrollController = _shopCoordinator.pageScrollController(0); + _shopCoordinator.pinnedHeaderSliverHeightBuilder = () { + return View.of(context).padding.top + 38; + }; apiService = ApiService( Dio(), diff --git a/lib/store/store_view/store_order_list.dart b/lib/store/store_view/store_order_list.dart index 18c7ecc6..1afcd3f8 100644 --- a/lib/store/store_view/store_order_list.dart +++ b/lib/store/store_view/store_order_list.dart @@ -61,7 +61,7 @@ class _StoreOrderListPage extends State { List? appletProducts; List productListBeans = []; int currentIndex = 0; - double _viewportDimension = 0; + late ShopScrollCoordinator _shopCoordinator; late ShopScrollController _listScrollController1; @@ -74,7 +74,7 @@ class _StoreOrderListPage extends State { _listScrollController1 = _shopCoordinator.newChildScrollController(); _listScrollController2 = _shopCoordinator.newChildScrollController(); _listScrollController2.addListener(() { - _viewportDimension = _listScrollController2.position.viewportDimension; + for (int i = 0; i < (appletProducts?.length ?? 0); i++) { if (currentIndex != i && _listScrollController2.offset >= (appletProducts?[i].goodsIndex ?? 0) && (i == (appletProducts?.length ?? 0) - 1 || _listScrollController2.offset < (appletProducts?[i + 1].goodsIndex ?? 0))) { @@ -141,7 +141,7 @@ class _StoreOrderListPage extends State { width: 100, child: ListView.builder( itemCount: appletProducts?.length ?? 0, - physics: AlwaysScrollableScrollPhysics(), + physics: ClampingScrollPhysics(), controller: _listScrollController1, padding: EdgeInsets.only(top: 0, bottom: 12.h), itemBuilder: (context, position) { @@ -154,7 +154,7 @@ class _StoreOrderListPage extends State { itemCount: appletProducts?.length ?? 0, padding: EdgeInsets.only(top: 0), controller: _listScrollController2, - physics: AlwaysScrollableScrollPhysics(), + physics: ClampingScrollPhysics(), itemBuilder: (context, position) { return rightOrderItem(position); }, diff --git a/lib/union/union_list.dart b/lib/union/union_list.dart index 215dbbcd..54540f4b 100644 --- a/lib/union/union_list.dart +++ b/lib/union/union_list.dart @@ -133,7 +133,8 @@ class _UnionList extends State with AutomaticKeepAliveClientMixin { return InkWell( onTap: () { String storeId = storeList![position].id ?? ""; - miniLogin(apiService!, storeId, (token) { + String tenant = storeList![position].tenantCode ?? ""; + miniLogin(apiService!, tenant, storeId, (token) { Navigator.of(context).pushNamed( '/router/store_order', arguments: { diff --git a/lib/utils/app_util.dart b/lib/utils/app_util.dart index 8eb7ad65..22777778 100644 --- a/lib/utils/app_util.dart +++ b/lib/utils/app_util.dart @@ -8,9 +8,12 @@ import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/utils/flutter_utils.dart'; import 'package:huixiang/utils/shared_preference.dart'; -miniLogin(ApiService apiService, String storeId, Function(String token) callback) async { +miniLogin(ApiService apiService, String tenant, String storeId, Function(String token) callback) async { apiService.minLogin(storeId).then((baseData) async { if (baseData.isSuccess ?? false) { + Map minStoreInfo = baseData.data; + String minToken = minStoreInfo["token"]; + SharedInstance.instance.saveMini(minToken, tenant, storeId); callback.call(baseData.data["token"]); } }, onError: (error) { diff --git a/lib/utils/shared_preference.dart b/lib/utils/shared_preference.dart index 0a1d80b6..c8f3874d 100644 --- a/lib/utils/shared_preference.dart +++ b/lib/utils/shared_preference.dart @@ -71,7 +71,7 @@ class SharedInstance { } void saveMini(minToken, tenant, storeId) { - _storage?.setString('minToken', minToken); + _storage?.setString('miniToken', minToken); _storage?.setString('tenant', tenant); _storage?.setString('storeId', storeId); } diff --git a/lib/view_widget/login_tips.dart b/lib/view_widget/login_tips.dart index 1609fe36..5e9658a1 100644 --- a/lib/view_widget/login_tips.dart +++ b/lib/view_widget/login_tips.dart @@ -21,103 +21,105 @@ class LoginTips extends StatelessWidget { // width: 0.7867.sw, // height: 0.7867.sw / (Platform.isAndroid ? 0.86 : 0.9), width:double.infinity, - height:MediaQuery.of(context).size.width / 1, margin: EdgeInsets.symmetric(horizontal:28.w), padding: EdgeInsets.symmetric(vertical: 20.h, horizontal: 24.w), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(8), ), - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisSize: MainAxisSize.max, - children: [ - Image.asset( - "assets/image/icon_login_tips.webp", - // width: 0.7867.sw * 0.6, - // height: 0.7867.sw * 0.6 * 0.7, - fit: BoxFit.fill, - ), - SizedBox( - height: 20.w, - ), - Container( - alignment: Alignment.centerLeft, - child: Text( - S.of(context).ninweidenglu, - textAlign: TextAlign.start, + child: IntrinsicHeight( + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisSize: MainAxisSize.max, + children: [ + Image.asset( + "assets/image/icon_login_tips.webp", + // width: 0.7867.sw * 0.6, + // height: 0.7867.sw * 0.6 * 0.7, + fit: BoxFit.fill, + ), + SizedBox( + height: 20.w, + ), + Container( + alignment: Alignment.centerLeft, + child: Text( + S.of(context).ninweidenglu, + textAlign: TextAlign.start, + style: TextStyle( + fontSize: 14.sp, + fontWeight: FontWeight.bold, + color: Colors.black, + ), + ), + ), + SizedBox( + height: 3.w, + ), + Text( + S.of(context).weilegeiningenghaodefuwu, style: TextStyle( - fontSize: 14.sp, - fontWeight: FontWeight.bold, - color: Colors.black, + fontSize: 12.sp, + color: Color(0xFF727272), ), ), - ), - SizedBox( - height: 3.w, - ), - Text( - S.of(context).weilegeiningenghaodefuwu, - style: TextStyle( - fontSize: 12.sp, - color: Color(0xFF727272), + SizedBox( + height: 20.w, ), - ), - SizedBox( - height: 20.w, - ), - Row( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - child: InkWell( - onTap: () { - SmartDialog.dismiss(); - }, - child: BorderText( - text: S.of(context).quxiao, - textColor: Color(0xFF32A060), - borderWidth: 1.w, - borderColor: Color(0xFF32A060), - padding: EdgeInsets.all(12.w), - fontSize: 16.sp, - fontWeight: FontWeight.bold, - radius: 4, + Row( + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + child: InkWell( + onTap: () { + SmartDialog.dismiss(); + }, + child: BorderText( + text: S.of(context).quxiao, + textColor: Color(0xFF32A060), + borderWidth: 1.w, + borderColor: Color(0xFF32A060), + padding: EdgeInsets.all(12.w), + fontSize: 16.sp, + fontWeight: FontWeight.bold, + radius: 4, + ), ), + flex: 1, ), - flex: 1, - ), - SizedBox( - width: 13.w, - ), - Expanded( - child: InkWell( - onTap: () { - click?.call(); - SmartDialog.dismiss(); - }, - child: RoundButton( - text: S.of(context).qudenglu, - textColor: Colors.white, - padding: EdgeInsets.all(12.w), - fontSize: 16.sp, - backgroup: Color(0xFF32A060), - fontWeight: FontWeight.bold, - radius: 4, + SizedBox( + width: 13.w, + ), + Expanded( + child: InkWell( + onTap: () { + click?.call(); + SmartDialog.dismiss(); + }, + child: RoundButton( + text: S.of(context).qudenglu, + textColor: Colors.white, + padding: EdgeInsets.all(12.w), + fontSize: 16.sp, + backgroup: Color(0xFF32A060), + fontWeight: FontWeight.bold, + radius: 4, + ), ), + flex: 1, ), - flex: 1, - ), - ], - ), - ], + ], + ), + ], + ), ), ), ), ), onWillPop: () async { return Future.value(false); - }); + }, + ); } } diff --git a/lib/view_widget/selector_store_dialog.dart b/lib/view_widget/selector_store_dialog.dart index cfd26d53..2ead40f1 100644 --- a/lib/view_widget/selector_store_dialog.dart +++ b/lib/view_widget/selector_store_dialog.dart @@ -151,7 +151,8 @@ class _SelectorStoreWidget extends State { // } else { String storeId = widget.stores[selectIndex].id ?? ""; - miniLogin(apiService!, storeId, (token) { + String tenant = widget.stores[selectIndex].tenantCode ?? ""; + miniLogin(apiService!, tenant, storeId, (token) { Navigator.of(context).pushReplacementNamed( '/router/store_order', arguments: { diff --git a/lib/vip/vip_view/vip_goods_discount.dart b/lib/vip/vip_view/vip_goods_discount.dart index 2443501a..83416477 100644 --- a/lib/vip/vip_view/vip_goods_discount.dart +++ b/lib/vip/vip_view/vip_goods_discount.dart @@ -173,7 +173,8 @@ class _VipGoodsDiscount extends State { return GestureDetector( onTap: () { // String storeId = widget.vipCardHome.productVips?[position].storeId ?? ""; - // miniLogin(apiService!, storeId, (token) { + // String tenant = widget.vipCardHome.productVips?[position].tenantCode ?? ""; + // miniLogin(apiService!, tenant, storeId, (token) { // Navigator.of(context).pushReplacementNamed( // '/router/store_order', // arguments: { diff --git a/lib/web/web_view/web_content.dart b/lib/web/web_view/web_content.dart index 65edbfdf..4e92f3ac 100644 --- a/lib/web/web_view/web_content.dart +++ b/lib/web/web_view/web_content.dart @@ -69,7 +69,8 @@ class _WebContent extends State { onLinkTap: (url, attributes, element) { if(attributes.containsKey("storeid")){ String storeId = attributes["storeid"] ?? ""; - miniLogin(widget.apiService!, storeId, (token) { + String tenant = attributes["tenantcode"] ?? ""; + miniLogin(widget.apiService!, tenant, storeId, (token) { Navigator.of(context).pushReplacementNamed( '/router/store_order', arguments: { @@ -85,7 +86,8 @@ class _WebContent extends State { onAnchorTap: (url, attributes, element) { if(attributes.containsKey("storeid")){ String storeId = attributes["storeid"] ?? ""; - miniLogin(widget.apiService!, storeId, (token) { + String tenant = attributes["tenantcode"] ?? ""; + miniLogin(widget.apiService!, tenant, storeId, (token) { Navigator.of(context).pushReplacementNamed( '/router/store_order', arguments: { diff --git a/pubspec.lock b/pubspec.lock index 96bcd59d..a4cef059 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -761,10 +761,10 @@ packages: dependency: "direct main" description: name: image_pickers - sha256: "79de5abf134256eb148565d45c4e0bee406399f353b8d56de18b52c4c509faa6" + sha256: "43b3098d1d0cee1bbddd919814cee83582d40842f9fc41c1af3c7174dce5a3c9" url: "https://pub.dev" source: hosted - version: "2.0.4+8" + version: "2.0.5+2" infinite_listview: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 54954af1..6326a43e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -95,7 +95,7 @@ dependencies: url_launcher: ^6.3.1 #多图, 裁剪 - image_pickers: 2.0.4+8 + image_pickers: ^2.0.5+2 scan: ^1.6.0 path_provider: ^2.1.4