Browse Source

商家端新增切换用户端功能;

用户端切换ui更改;
wr_2023_business
wurong 1 year ago
parent
commit
fb9e4da4c7
  1. BIN
      assets/image/2x/bs_switch.webp
  2. BIN
      assets/image/2x/bs_user_switch_bg.webp
  3. BIN
      assets/image/3x/bs_switch.webp
  4. BIN
      assets/image/3x/bs_user_switch_bg.webp
  5. BIN
      assets/image/bs_switch.webp
  6. BIN
      assets/image/bs_user_switch_bg.webp
  7. 101
      lib/business_system/home/business_home_page.dart
  8. 13
      lib/login/new_login_page.dart
  9. 4
      lib/retrofit/retrofit_api.dart

BIN
assets/image/2x/bs_switch.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 758 B

BIN
assets/image/2x/bs_user_switch_bg.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
assets/image/3x/bs_switch.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
assets/image/3x/bs_user_switch_bg.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
assets/image/bs_switch.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 662 B

BIN
assets/image/bs_user_switch_bg.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

101
lib/business_system/home/business_home_page.dart

@ -531,79 +531,52 @@ class _BusinessHomePage extends State<BusinessHomePage>
context: context, context: context,
builder: (context) { builder: (context) {
return AlertDialog( return AlertDialog(
content: Column( content: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
sharedPreferences.setString('identitySwitch', "2");
Navigator.of(context).pushNamedAndRemoveUntil(
'/router/main_page',
(route) => false,
);
},
child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
GestureDetector( Image.asset(
behavior: HitTestBehavior.opaque, "assets/image/bs_user_switch_bg.webp",
onTap: () { width: 144.h,
sharedPreferences.setString('identitySwitch', "1"); height: 97.h,
Navigator.of(context).pop(); ),
}, Padding(
child: Padding( padding: EdgeInsets.only(top: 10.h, bottom: 10.h),
padding: EdgeInsets.only(top: 10.h, bottom: 10.h), child: Row(
child: Row( mainAxisAlignment: MainAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, children: [
children: [ Image.asset(
Image.asset( "assets/image/bs_switch.webp",
"assets/image/bs_shop_logo.webp", width: 12.h,
width: 28.h, height: 12.h,
height: 28.h, ),
SizedBox(
width: 10.w,
),
Text(
"切换成用户端",
style: TextStyle(
color: Color(0xFF30415B), color: Color(0xFF30415B),
fontSize: 15.sp,
fontWeight: MyFontWeight.bold,
), ),
SizedBox(
width: 10.w,
),
Text(
"商家端",
style: TextStyle(
color: Color(0xFF0D0D0D),
fontSize: 15.sp,
fontWeight: MyFontWeight.bold,
),
),
],
),
),
),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
sharedPreferences.setString('identitySwitch', "2");
Navigator.of(context).pushNamedAndRemoveUntil(
'/router/main_page',
(route) => false,
);
},
child: Padding(
padding: EdgeInsets.only(top: 10.h, bottom: 10.h),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
Icons.person,
size: 28.sp,
color: Color(0xFF30415B),
),
SizedBox(
width: 10.w,
),
Text(
"用户端",
style: TextStyle(
color: Color(0xFF0D0D0D),
fontSize: 15.sp,
fontWeight: MyFontWeight.bold,
),
),
],
), ),
)) ],
),
)
], ],
), ),
); ));
}, },
); );
} }

13
lib/login/new_login_page.dart

@ -271,15 +271,14 @@ class _NewLoginPage extends State<NewLoginPage> {
if (sharedPreferences.containsKey('token') && if (sharedPreferences.containsKey('token') &&
sharedPreferences.getString("token") != null && sharedPreferences.getString("token") != null &&
sharedPreferences.getString("token") != "") { sharedPreferences.getString("token") != "") {
ExamineInstance.instance.isExamine = ExamineInstance.instance.isExamine = sharedPreferences.getString("mobile") == "13800138000";
sharedPreferences.getString("mobile") == "13800138000"; if (sharedPreferences.getString("identitySwitch") != null && sharedPreferences.getString("identitySwitch") != "2" && (sharedPreferences.getString("account")!= "" ||
if (sharedPreferences.getString("identitySwitch") == null || sharedPreferences.getString("identitySwitch") == "2" || (sharedPreferences.getString("account")== "" || sharedPreferences.getString("password")!= "")) {
sharedPreferences.getString("password")== "")) {
Navigator.of(context)
.popAndPushNamed('/router/main_page');
} else {
businessLogin(sharedPreferences.getString("account"), businessLogin(sharedPreferences.getString("account"),
sharedPreferences.getString("password")); sharedPreferences.getString("password"));
} else {
Navigator.of(context)
.popAndPushNamed('/router/main_page');
} }
} else { } else {
apiService = ApiService(Dio(), context: context); apiService = ApiService(Dio(), context: context);

4
lib/retrofit/retrofit_api.dart

@ -68,9 +68,7 @@ part 'retrofit_api.g.dart';
const localBaseUrl = "http://192.168.10.78:8766/app/";/// const localBaseUrl = "http://192.168.10.78:8766/app/";///
// const localBaseUrl = "http://platform.test.api.lotus-wallet.com/app/";/// // const localBaseUrl = "http://platform.test.api.lotus-wallet.com/app/";///
const serviceBaseUrl = "https://pos.platform.lotus-wallet.com/app/"; const serviceBaseUrl = "https://pos.platform.lotus-wallet.com/app/";///线
///线
const ipBaseUrl = "http://whois.pconline.com.cn"; const ipBaseUrl = "http://whois.pconline.com.cn";

Loading…
Cancel
Save