Browse Source

小程序接口 操作 token修改

dart3_last
fff 3 days ago
parent
commit
b4aa9354c4
  1. 4
      lib/home/help_farmers/help_farmers_page.dart
  2. 3
      lib/home/home_view/home_recommend_goods.dart
  3. 4
      lib/home/home_view/top_selling_list.dart
  4. 113
      lib/im/chat_details_page.dart
  5. 125
      lib/im/im_view/im_page.dart
  6. 3
      lib/mine/mine_shop_details.dart
  7. 3
      lib/mine/mine_shop_recharge.dart
  8. 4
      lib/mine/mine_view/mine_view.dart
  9. 3
      lib/mine/vip_detail_page.dart
  10. 3
      lib/order/order_history_page.dart
  11. 3
      lib/order/order_view/order_address.dart
  12. 17
      lib/retrofit/min_api.dart
  13. 2
      lib/retrofit/min_api.g.dart
  14. 5
      lib/retrofit/retrofit_api.dart
  15. 2
      lib/store/scan.dart
  16. 13
      lib/store/shop/shop_scroll_coordinator.dart
  17. 2
      lib/store/shop_details_page.dart
  18. 3
      lib/store/store_order.dart
  19. 8
      lib/store/store_view/store_order_list.dart
  20. 3
      lib/union/union_list.dart
  21. 5
      lib/utils/app_util.dart
  22. 2
      lib/utils/shared_preference.dart
  23. 158
      lib/view_widget/login_tips.dart
  24. 3
      lib/view_widget/selector_store_dialog.dart
  25. 3
      lib/vip/vip_view/vip_goods_discount.dart
  26. 6
      lib/web/web_view/web_content.dart
  27. 4
      pubspec.lock
  28. 2
      pubspec.yaml

4
lib/home/help_farmers/help_farmers_page.dart

@ -50,8 +50,7 @@ class _HelpFarmersPage extends State<HelpFarmersPage> {
/// ///
queryConfig() async { queryConfig() async {
try { try {
BaseListData<Farmers>? baseData = BaseListData<Farmers>? baseData = await apiService?.getConfig().catchError((error) {
await apiService?.getConfig().catchError((error) {
networkStatus = -1; networkStatus = -1;
refreshController.refreshFailed(); refreshController.refreshFailed();
return BaseListData<Farmers>()..isSuccess = false; return BaseListData<Farmers>()..isSuccess = false;
@ -97,6 +96,7 @@ class _HelpFarmersPage extends State<HelpFarmersPage> {
SliverAppBar( SliverAppBar(
pinned: true, pinned: true,
backgroundColor: Color(0xFF32A060), backgroundColor: Color(0xFF32A060),
surfaceTintColor: Colors.transparent,
elevation: 0, elevation: 0,
leading: GestureDetector( leading: GestureDetector(
onTap: () { onTap: () {

3
lib/home/home_view/home_recommend_goods.dart

@ -56,7 +56,8 @@ class _HomeRecommendGoods extends State<HomeRecommendGoods> {
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {
String storeId = widget.homeRank!.CommodityZone![position].storeId ?? ""; 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( Navigator.of(context).pushNamed(
'/router/store_order', '/router/store_order',
arguments: { arguments: {

4
lib/home/home_view/top_selling_list.dart

@ -125,7 +125,9 @@ class _TopSellingList extends State<TopSellingList> {
onTap: () { onTap: () {
String storeId = widget.homeRank!.CommodityList![index] String storeId = widget.homeRank!.CommodityList![index]
.goodList![position].storeId ?? ""; .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( Navigator.of(context).pushNamed(
'/router/store_order', '/router/store_order',
arguments: { arguments: {

113
lib/im/chat_details_page.dart

@ -346,7 +346,7 @@ class _ChatDetailsPage extends State<ChatDetailsPage>
showCamera: false, showCamera: false,
compressSize: 500, compressSize: 500,
uiConfig: UIConfig( uiConfig: UIConfig(
uiThemeColor: Color(0xFFFFFFFF), uiThemeColor: Color(0xFFAAAAAA),
), ),
cropConfig: CropConfig( cropConfig: CropConfig(
enableCrop: false, enableCrop: false,
@ -835,65 +835,70 @@ class _ChatDetailsPage extends State<ChatDetailsPage>
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ 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( Expanded(
child: Container( child: Container(
alignment: Alignment.centerRight, alignment: Alignment.centerRight,
child: InkWell( child: Row(
onLongPress: () { mainAxisAlignment: MainAxisAlignment.end,
showMessageMenu(context, _buttonKey, message, index, loadanimatedListKey); children: [
}, if (message.state == 3)
child: Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6), borderRadius: BorderRadius.circular(100),
color: Color(0xFF32A060), color: Color(0xFFFF441A),
boxShadow: [ ),
BoxShadow( width: 20,
color: Color(0xFFA8A3A3).withAlpha(12), height: 20,
offset: Offset(0, 4), alignment: Alignment.center,
blurRadius: 4, child: Text(
spreadRadius: 0, "!",
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,
), ),
), ),
), ],
), ),
), ),
), ),

125
lib/im/im_view/im_page.dart

@ -515,77 +515,78 @@ class _IMPage extends State<IMPage> implements OnChatMessage {
width: 12.w, width: 12.w,
), ),
Expanded( Expanded(
child: Column( child: SizedBox(
crossAxisAlignment: CrossAxisAlignment.start, height: 54,
children: [ child: Column(
Row( crossAxisAlignment: CrossAxisAlignment.start,
children: [ mainAxisAlignment: MainAxisAlignment.spaceAround,
Expanded( children: [
child: Text( Row(
!contactMap.containsKey(conversationId) children: [
? "" Expanded(
: contactMap[conversationId]?.nickname ?? "", child: Text(
// overflow: TextOverflow.fade, !contactMap.containsKey(conversationId)
maxLines: 1, ? ""
style: TextStyle( : contactMap[conversationId]?.nickname ?? "",
fontSize: 16.sp, // overflow: TextOverflow.fade,
color: Color(0xFF060606), maxLines: 1,
fontWeight: MyFontWeight.semi_bold, style: TextStyle(
fontSize: 16.sp,
color: Color(0xFF060606),
fontWeight: MyFontWeight.semi_bold,
),
), ),
), ),
), Text(
Text( lastMessageMap[conversationId]?.time != null
lastMessageMap[conversationId]?.time != null ? AppUtils.timeFormatter(
? AppUtils.timeFormatter( DateTime.fromMillisecondsSinceEpoch(int.parse(
DateTime.fromMillisecondsSinceEpoch(int.parse( lastMessageMap[conversationId]?.time ?? "")))
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,
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
color: Color(0xFF353535), color: Color(0xFFA29E9E),
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
), ),
), ),
), ],
if (unreadCountMap[conversationId] != null && ),
unreadCountMap[conversationId]! > 0) Row(
Container( children: [
width: 16, Expanded(
height: 16, child: Text(
decoration: BoxDecoration( messageContent(lastMessageMap[conversationId]!),
borderRadius: BorderRadius.circular(100), maxLines: 1,
color: Color(0xFFFF441A), overflow: TextOverflow.ellipsis,
), style: TextStyle(
child: RoundButton( fontSize: 12.sp,
text: "${unreadCountMap[conversationId]}", color: Color(0xFF353535),
textColor: Colors.white, fontWeight: MyFontWeight.regular,
fontWeight: MyFontWeight.regular, ),
backgroup: Color(0xFFFF441A),
fontSize: 10.sp,
radius: 100,
), ),
), ),
], 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,
),
),
],
),
],
),
), ),
), ),
], ],

3
lib/mine/mine_shop_details.dart

@ -681,7 +681,8 @@ class _MineShopDetails extends State<MineShopDetails> {
); );
} else { } else {
String storeId = store.id ?? ""; String storeId = store.id ?? "";
miniLogin(apiService!, storeId, (token) { String tenant = store.tenantCode ?? "";
miniLogin(apiService!, tenant, storeId, (token) {
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
'/router/store_order', '/router/store_order',
arguments: { arguments: {

3
lib/mine/mine_shop_recharge.dart

@ -840,7 +840,8 @@ class _MineShopRecharge extends State<MineShopRecharge> {
); );
} else { } else {
String storeId = store.id ?? ""; String storeId = store.id ?? "";
miniLogin(apiService!, storeId, (token) { String tenant = store.tenantCode ?? "";
miniLogin(apiService!, tenant, storeId, (token) {
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
'/router/store_order', '/router/store_order',
arguments: { arguments: {

4
lib/mine/mine_view/mine_view.dart

@ -196,8 +196,8 @@ class _MineView extends State<MineView> {
if (tableId != "" && if (tableId != "" &&
tenantCode != "" && tenantCode != "" &&
shopId != "") { shopId != "") {
String storeId = shopId ?? ""; String storeId = shopId;
miniLogin(apiService!, storeId, (token) { miniLogin(apiService!, tenantCode, storeId, (token) {
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
'/router/store_order', '/router/store_order',
arguments: { arguments: {

3
lib/mine/vip_detail_page.dart

@ -445,7 +445,8 @@ class _VipDetailPage extends State<VipDetailPage> {
); );
} else { } else {
String storeId = store.id ?? ""; String storeId = store.id ?? "";
miniLogin(apiService!, storeId, (token) { String tenant = store.tenantCode ?? "";
miniLogin(apiService!, tenant, storeId, (token) {
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
'/router/store_order', '/router/store_order',
arguments: { arguments: {

3
lib/order/order_history_page.dart

@ -298,7 +298,8 @@ class _OrderHistoryList extends State<OrderHistoryList>
); );
} else { } else {
String storeId = orderInfo.storeVO?.id ?? ""; String storeId = orderInfo.storeVO?.id ?? "";
miniLogin(apiService!, storeId, (token) { String tenant = orderInfo.tenantCode ?? "";
miniLogin(apiService!, tenant, storeId, (token) {
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
'/router/store_order', '/router/store_order',
arguments: { arguments: {

3
lib/order/order_view/order_address.dart

@ -268,7 +268,8 @@ class _OrderAddress extends State<OrderAddress> {
Navigator.of(context).pop(); Navigator.of(context).pop();
} else if (widget.jumpState == 2) { } else if (widget.jumpState == 2) {
String storeId = widget.orderInfo?.storeVO?.id ?? ""; 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( Navigator.of(context).pushNamed(
'/router/store_order', '/router/store_order',
arguments: { arguments: {

17
lib/retrofit/min_api.dart

@ -58,8 +58,8 @@ abstract class MinApiService {
baseUrl = kReleaseMode ? serviceMiniBaseUrl : localMiniBaseUrl; baseUrl = kReleaseMode ? serviceMiniBaseUrl : localMiniBaseUrl;
headers["Environment"] = "app"; headers["Environment"] = "app";
dio.options = BaseOptions( dio.options = BaseOptions(
connectTimeout: 18000.milliseconds, connectTimeout: 36000.milliseconds,
receiveTimeout: 18000.milliseconds, receiveTimeout: 36000.milliseconds,
headers: headers, headers: headers,
responseType: ResponseType.json, responseType: ResponseType.json,
); );
@ -68,14 +68,11 @@ abstract class MinApiService {
RequestOptions options, RequestOptions options,
RequestInterceptorHandler handler, RequestInterceptorHandler handler,
) { ) {
debugPrint( debugPrint("\n======================= Min_请求数据 =======================");
"\n======================= Min_请求数据 =======================");
debugPrint("method = ${options.method.toString()}"); debugPrint("method = ${options.method.toString()}");
debugPrint("url = ${options.uri.toString()}"); debugPrint("url = ${options.uri.toString()}");
debugPrint("headers = ${options.headers}"); debugPrint("headers = ${options.headers}");
if (showLoading && if (showLoading && !SmartDialog.checkExist(dialogTypes: {SmartAllDialogType.loading})) {
!SmartDialog.checkExist(
dialogTypes: {SmartAllDialogType.loading})) {
AppUtils.cancelCloseLoading(); AppUtils.cancelCloseLoading();
//loading //loading
S.current.zhengzaijiazai.loading; S.current.zhengzaijiazai.loading;
@ -102,8 +99,7 @@ abstract class MinApiService {
if (map["code"] == 40005 || map["code"] == 40001) { if (map["code"] == 40005 || map["code"] == 40001) {
LoginTipsDialog.instance.show(context); LoginTipsDialog.instance.show(context);
} }
debugPrint( debugPrint("======================= Min_响应数据结束 =======================\n");
"======================= Min_响应数据结束 =======================\n");
if (map["code"] == 0) { if (map["code"] == 0) {
handler.next(response); handler.next(response);
} else { } else {
@ -121,8 +117,7 @@ abstract class MinApiService {
if (SmartDialog.checkExist(dialogTypes: {SmartAllDialogType.loading})) { if (SmartDialog.checkExist(dialogTypes: {SmartAllDialogType.loading})) {
AppUtils.closeLoading(); AppUtils.closeLoading();
} }
debugPrint( debugPrint("\n======================= Min_错误响应数据 =======================");
"\n======================= Min_错误响应数据 =======================");
debugPrint("type = ${e.type}"); debugPrint("type = ${e.type}");
debugPrint("message = ${e.message}"); debugPrint("message = ${e.message}");
debugPrint("\n"); debugPrint("\n");

2
lib/retrofit/min_api.g.dart

@ -14,7 +14,7 @@ class _MinApiService implements MinApiService {
this.baseUrl, this.baseUrl,
this.errorLogger, this.errorLogger,
}) { }) {
baseUrl ??= 'http://192.168.10.54:8765/app/'; baseUrl ??= serviceMiniBaseUrl;
} }
final Dio _dio; final Dio _dio;

5
lib/retrofit/retrofit_api.dart

@ -73,7 +73,7 @@ import 'package:retrofit/retrofit.dart';
part 'retrofit_api.g.dart'; part 'retrofit_api.g.dart';
@RestApi(baseUrl: kDebugMode ? serviceBaseUrl : localBaseUrl) @RestApi(baseUrl: kReleaseMode ? serviceBaseUrl : localBaseUrl)
abstract class ApiService { abstract class ApiService {
factory ApiService( factory ApiService(
Dio dio, { Dio dio, {
@ -90,8 +90,7 @@ abstract class ApiService {
headers["Environment"] = "app"; headers["Environment"] = "app";
} }
print("软件当前运行的模式 kReleaseMode:" + (kReleaseMode ? "发布模式" : "调试模式")); print("软件当前运行的模式 kReleaseMode:" + (kReleaseMode ? "发布模式" : "调试模式"));
baseUrl = kDebugMode ? serviceBaseUrl : localBaseUrl; baseUrl = kReleaseMode ? serviceBaseUrl : localBaseUrl;
if (kDebugMode) baseUrl = serviceBaseUrl;
if (isIp) baseUrl = ipBaseUrl; if (isIp) baseUrl = ipBaseUrl;
dio.options = BaseOptions( dio.options = BaseOptions(
connectTimeout: 30000.milliseconds, connectTimeout: 30000.milliseconds,

2
lib/store/scan.dart

@ -35,7 +35,7 @@ class Scan {
if (table?.isNotEmpty ?? false) { if (table?.isNotEmpty ?? false) {
int? tableId = int.tryParse(table!); int? tableId = int.tryParse(table!);
String storeId = id ?? ""; String storeId = id ?? "";
miniLogin(apiService!, storeId, (token) { miniLogin(apiService, tenantCode, storeId, (token) {
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
'/router/store_order', '/router/store_order',
arguments: { arguments: {

13
lib/store/shop/shop_scroll_coordinator.dart

@ -73,33 +73,28 @@ class ShopScrollCoordinator {
/// Header最大程度展开状态 /// Header最大程度展开状态
PageExpandState pageExpand = PageExpandState.NotExpand; PageExpandState pageExpand = PageExpandState.NotExpand;
set (PageExpandState value) {
pageExpand = value;
pageExpandChange?.call();
}
/// ///
void onPointerUp(PointerUpEvent event) { void onPointerUp(PointerUpEvent event) {
final double _pagePixels = _pageScrollPosition.pixels; final double _pagePixels = _pageScrollPosition.pixels;
if (0.0 < _pagePixels && _pagePixels < (_pageInitialOffset ?? 0)) { if (0.0 < _pagePixels && _pagePixels < (_pageInitialOffset ?? 0)) {
if (pageExpand == PageExpandState.NotExpand if (pageExpand == PageExpandState.NotExpand
&& (_pageInitialOffset ?? 0) - _pagePixels > _scrollRedundancy && _pageScrollPosition.userScrollDirection == ScrollDirection.forward) { && (_pageInitialOffset ?? 0) - _pagePixels > _scrollRedundancy) {
_pageScrollPosition.animateTo( _pageScrollPosition.animateTo(
0.0, 0.0,
duration: const Duration(milliseconds: 400), duration: const Duration(milliseconds: 400),
curve: Curves.ease, curve: Curves.ease,
).then((_) => set(PageExpandState.Expanded)); );
} else if (pageExpand == PageExpandState.Expanded && _pageScrollPosition.userScrollDirection == ScrollDirection.reverse) { } else if (pageExpand == PageExpandState.Expanded) {
pageExpand = PageExpandState.Expanding; pageExpand = PageExpandState.Expanding;
_pageScrollPosition.animateTo((_pageInitialOffset ?? 0), _pageScrollPosition.animateTo((_pageInitialOffset ?? 0),
duration: const Duration(milliseconds: 400), duration: const Duration(milliseconds: 400),
curve: Curves.ease, curve: Curves.ease,
).then((_) => set(PageExpandState.NotExpand)); );
} }
} }
} }
Function()? pageExpandChange;
/// ///
void updateUserScrollDirection(ShopScrollPosition? position, ScrollDirection? value) { void updateUserScrollDirection(ShopScrollPosition? position, ScrollDirection? value) {

2
lib/store/shop_details_page.dart

@ -1335,7 +1335,7 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
(tenantCode?.isNotEmpty ?? false) && (tenantCode?.isNotEmpty ?? false) &&
(shopId?.isNotEmpty ?? false)) { (shopId?.isNotEmpty ?? false)) {
String storeId = shopId ?? ""; String storeId = shopId ?? "";
miniLogin(apiService!, storeId, (token) { miniLogin(apiService!, tenantCode ?? "", storeId, (token) {
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
'/router/store_order', '/router/store_order',
arguments: { arguments: {

3
lib/store/store_order.dart

@ -87,6 +87,9 @@ class _StoreOrderPage extends State<StoreOrderPage>
tabcontroller = TabController(length: 1, vsync: this); tabcontroller = TabController(length: 1, vsync: this);
_pageScrollController = _shopCoordinator.pageScrollController(0); _pageScrollController = _shopCoordinator.pageScrollController(0);
_shopCoordinator.pinnedHeaderSliverHeightBuilder = () {
return View.of(context).padding.top + 38;
};
apiService = ApiService( apiService = ApiService(
Dio(), Dio(),

8
lib/store/store_view/store_order_list.dart

@ -61,7 +61,7 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
List<FindMiniGroup>? appletProducts; List<FindMiniGroup>? appletProducts;
List<ProductListBean> productListBeans = []; List<ProductListBean> productListBeans = [];
int currentIndex = 0; int currentIndex = 0;
double _viewportDimension = 0;
late ShopScrollCoordinator _shopCoordinator; late ShopScrollCoordinator _shopCoordinator;
late ShopScrollController _listScrollController1; late ShopScrollController _listScrollController1;
@ -74,7 +74,7 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
_listScrollController1 = _shopCoordinator.newChildScrollController(); _listScrollController1 = _shopCoordinator.newChildScrollController();
_listScrollController2 = _shopCoordinator.newChildScrollController(); _listScrollController2 = _shopCoordinator.newChildScrollController();
_listScrollController2.addListener(() { _listScrollController2.addListener(() {
_viewportDimension = _listScrollController2.position.viewportDimension;
for (int i = 0; i < (appletProducts?.length ?? 0); i++) { for (int i = 0; i < (appletProducts?.length ?? 0); i++) {
if (currentIndex != i && _listScrollController2.offset >= (appletProducts?[i].goodsIndex ?? 0) && if (currentIndex != i && _listScrollController2.offset >= (appletProducts?[i].goodsIndex ?? 0) &&
(i == (appletProducts?.length ?? 0) - 1 || _listScrollController2.offset < (appletProducts?[i + 1].goodsIndex ?? 0))) { (i == (appletProducts?.length ?? 0) - 1 || _listScrollController2.offset < (appletProducts?[i + 1].goodsIndex ?? 0))) {
@ -141,7 +141,7 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
width: 100, width: 100,
child: ListView.builder( child: ListView.builder(
itemCount: appletProducts?.length ?? 0, itemCount: appletProducts?.length ?? 0,
physics: AlwaysScrollableScrollPhysics(), physics: ClampingScrollPhysics(),
controller: _listScrollController1, controller: _listScrollController1,
padding: EdgeInsets.only(top: 0, bottom: 12.h), padding: EdgeInsets.only(top: 0, bottom: 12.h),
itemBuilder: (context, position) { itemBuilder: (context, position) {
@ -154,7 +154,7 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
itemCount: appletProducts?.length ?? 0, itemCount: appletProducts?.length ?? 0,
padding: EdgeInsets.only(top: 0), padding: EdgeInsets.only(top: 0),
controller: _listScrollController2, controller: _listScrollController2,
physics: AlwaysScrollableScrollPhysics(), physics: ClampingScrollPhysics(),
itemBuilder: (context, position) { itemBuilder: (context, position) {
return rightOrderItem(position); return rightOrderItem(position);
}, },

3
lib/union/union_list.dart

@ -133,7 +133,8 @@ class _UnionList extends State<UnionList> with AutomaticKeepAliveClientMixin {
return InkWell( return InkWell(
onTap: () { onTap: () {
String storeId = storeList![position].id ?? ""; String storeId = storeList![position].id ?? "";
miniLogin(apiService!, storeId, (token) { String tenant = storeList![position].tenantCode ?? "";
miniLogin(apiService!, tenant, storeId, (token) {
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
'/router/store_order', '/router/store_order',
arguments: { arguments: {

5
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/flutter_utils.dart';
import 'package:huixiang/utils/shared_preference.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 { apiService.minLogin(storeId).then((baseData) async {
if (baseData.isSuccess ?? false) { if (baseData.isSuccess ?? false) {
Map<String, dynamic> minStoreInfo = baseData.data;
String minToken = minStoreInfo["token"];
SharedInstance.instance.saveMini(minToken, tenant, storeId);
callback.call(baseData.data["token"]); callback.call(baseData.data["token"]);
} }
}, onError: (error) { }, onError: (error) {

2
lib/utils/shared_preference.dart

@ -71,7 +71,7 @@ class SharedInstance {
} }
void saveMini(minToken, tenant, storeId) { void saveMini(minToken, tenant, storeId) {
_storage?.setString('minToken', minToken); _storage?.setString('miniToken', minToken);
_storage?.setString('tenant', tenant); _storage?.setString('tenant', tenant);
_storage?.setString('storeId', storeId); _storage?.setString('storeId', storeId);
} }

158
lib/view_widget/login_tips.dart

@ -21,103 +21,105 @@ class LoginTips extends StatelessWidget {
// width: 0.7867.sw, // width: 0.7867.sw,
// height: 0.7867.sw / (Platform.isAndroid ? 0.86 : 0.9), // height: 0.7867.sw / (Platform.isAndroid ? 0.86 : 0.9),
width:double.infinity, width:double.infinity,
height:MediaQuery.of(context).size.width / 1,
margin: EdgeInsets.symmetric(horizontal:28.w), margin: EdgeInsets.symmetric(horizontal:28.w),
padding: EdgeInsets.symmetric(vertical: 20.h, horizontal: 24.w), padding: EdgeInsets.symmetric(vertical: 20.h, horizontal: 24.w),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
), ),
child: Column( child: IntrinsicHeight(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, child: Column(
crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.center,
children: [ mainAxisSize: MainAxisSize.max,
Image.asset( children: [
"assets/image/icon_login_tips.webp", Image.asset(
// width: 0.7867.sw * 0.6, "assets/image/icon_login_tips.webp",
// height: 0.7867.sw * 0.6 * 0.7, // width: 0.7867.sw * 0.6,
fit: BoxFit.fill, // height: 0.7867.sw * 0.6 * 0.7,
), fit: BoxFit.fill,
SizedBox( ),
height: 20.w, SizedBox(
), height: 20.w,
Container( ),
alignment: Alignment.centerLeft, Container(
child: Text( alignment: Alignment.centerLeft,
S.of(context).ninweidenglu, child: Text(
textAlign: TextAlign.start, 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( style: TextStyle(
fontSize: 14.sp, fontSize: 12.sp,
fontWeight: FontWeight.bold, color: Color(0xFF727272),
color: Colors.black,
), ),
), ),
), SizedBox(
SizedBox( height: 20.w,
height: 3.w,
),
Text(
S.of(context).weilegeiningenghaodefuwu,
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF727272),
), ),
), Row(
SizedBox( mainAxisSize: MainAxisSize.max,
height: 20.w, children: [
), Expanded(
Row( child: InkWell(
mainAxisSize: MainAxisSize.max, onTap: () {
children: [ SmartDialog.dismiss();
Expanded( },
child: InkWell( child: BorderText(
onTap: () { text: S.of(context).quxiao,
SmartDialog.dismiss(); textColor: Color(0xFF32A060),
}, borderWidth: 1.w,
child: BorderText( borderColor: Color(0xFF32A060),
text: S.of(context).quxiao, padding: EdgeInsets.all(12.w),
textColor: Color(0xFF32A060), fontSize: 16.sp,
borderWidth: 1.w, fontWeight: FontWeight.bold,
borderColor: Color(0xFF32A060), radius: 4,
padding: EdgeInsets.all(12.w), ),
fontSize: 16.sp,
fontWeight: FontWeight.bold,
radius: 4,
), ),
flex: 1,
), ),
flex: 1, SizedBox(
), width: 13.w,
SizedBox( ),
width: 13.w, Expanded(
), child: InkWell(
Expanded( onTap: () {
child: InkWell( click?.call();
onTap: () { SmartDialog.dismiss();
click?.call(); },
SmartDialog.dismiss(); child: RoundButton(
}, text: S.of(context).qudenglu,
child: RoundButton( textColor: Colors.white,
text: S.of(context).qudenglu, padding: EdgeInsets.all(12.w),
textColor: Colors.white, fontSize: 16.sp,
padding: EdgeInsets.all(12.w), backgroup: Color(0xFF32A060),
fontSize: 16.sp, fontWeight: FontWeight.bold,
backgroup: Color(0xFF32A060), radius: 4,
fontWeight: FontWeight.bold, ),
radius: 4,
), ),
flex: 1,
), ),
flex: 1, ],
), ),
], ],
), ),
],
), ),
), ),
), ),
), ),
onWillPop: () async { onWillPop: () async {
return Future.value(false); return Future.value(false);
}); },
);
} }
} }

3
lib/view_widget/selector_store_dialog.dart

@ -151,7 +151,8 @@ class _SelectorStoreWidget extends State<SelectorStoreWidget> {
// } // }
else { else {
String storeId = widget.stores[selectIndex].id ?? ""; 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( Navigator.of(context).pushReplacementNamed(
'/router/store_order', '/router/store_order',
arguments: { arguments: {

3
lib/vip/vip_view/vip_goods_discount.dart

@ -173,7 +173,8 @@ class _VipGoodsDiscount extends State<VipGoodsDiscount> {
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {
// String storeId = widget.vipCardHome.productVips?[position].storeId ?? ""; // 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( // Navigator.of(context).pushReplacementNamed(
// '/router/store_order', // '/router/store_order',
// arguments: { // arguments: {

6
lib/web/web_view/web_content.dart

@ -69,7 +69,8 @@ class _WebContent extends State<WebContent> {
onLinkTap: (url, attributes, element) { onLinkTap: (url, attributes, element) {
if(attributes.containsKey("storeid")){ if(attributes.containsKey("storeid")){
String storeId = attributes["storeid"] ?? ""; String storeId = attributes["storeid"] ?? "";
miniLogin(widget.apiService!, storeId, (token) { String tenant = attributes["tenantcode"] ?? "";
miniLogin(widget.apiService!, tenant, storeId, (token) {
Navigator.of(context).pushReplacementNamed( Navigator.of(context).pushReplacementNamed(
'/router/store_order', '/router/store_order',
arguments: { arguments: {
@ -85,7 +86,8 @@ class _WebContent extends State<WebContent> {
onAnchorTap: (url, attributes, element) { onAnchorTap: (url, attributes, element) {
if(attributes.containsKey("storeid")){ if(attributes.containsKey("storeid")){
String storeId = attributes["storeid"] ?? ""; String storeId = attributes["storeid"] ?? "";
miniLogin(widget.apiService!, storeId, (token) { String tenant = attributes["tenantcode"] ?? "";
miniLogin(widget.apiService!, tenant, storeId, (token) {
Navigator.of(context).pushReplacementNamed( Navigator.of(context).pushReplacementNamed(
'/router/store_order', '/router/store_order',
arguments: { arguments: {

4
pubspec.lock

@ -761,10 +761,10 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: image_pickers name: image_pickers
sha256: "79de5abf134256eb148565d45c4e0bee406399f353b8d56de18b52c4c509faa6" sha256: "43b3098d1d0cee1bbddd919814cee83582d40842f9fc41c1af3c7174dce5a3c9"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.0.4+8" version: "2.0.5+2"
infinite_listview: infinite_listview:
dependency: transitive dependency: transitive
description: description:

2
pubspec.yaml

@ -95,7 +95,7 @@ dependencies:
url_launcher: ^6.3.1 url_launcher: ^6.3.1
#多图, 裁剪 #多图, 裁剪
image_pickers: 2.0.4+8 image_pickers: ^2.0.5+2
scan: ^1.6.0 scan: ^1.6.0
path_provider: ^2.1.4 path_provider: ^2.1.4

Loading…
Cancel
Save