logo 预约弹出列表
车辆无绑定弹窗
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
<application
|
||||
android:label="小羚羚"
|
||||
android:name="${applicationName}"
|
||||
android:icon="@mipmap/ic_launcher">
|
||||
android:icon="@mipmap/logo">
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="true"
|
||||
|
||||
BIN
ln_jq_app/android/app/src/main/res/mipmap-xhdpi/logo.png
Normal file
BIN
ln_jq_app/android/app/src/main/res/mipmap-xhdpi/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 74 KiB |
@@ -1,122 +1,122 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-20x20@2x.png",
|
||||
"scale" : "2x"
|
||||
"idiom" : "iphone",
|
||||
"scale" : "2x",
|
||||
"size" : "20x20"
|
||||
},
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-20x20@3x.png",
|
||||
"scale" : "3x"
|
||||
"idiom" : "iphone",
|
||||
"scale" : "3x",
|
||||
"size" : "20x20"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-29x29@1x.png",
|
||||
"scale" : "1x"
|
||||
"idiom" : "iphone",
|
||||
"scale" : "1x",
|
||||
"size" : "29x29"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-29x29@2x.png",
|
||||
"scale" : "2x"
|
||||
"idiom" : "iphone",
|
||||
"scale" : "2x",
|
||||
"size" : "29x29"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-29x29@3x.png",
|
||||
"scale" : "3x"
|
||||
"idiom" : "iphone",
|
||||
"scale" : "3x",
|
||||
"size" : "29x29"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-40x40@2x.png",
|
||||
"scale" : "2x"
|
||||
"idiom" : "iphone",
|
||||
"scale" : "2x",
|
||||
"size" : "40x40"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-40x40@3x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "60x60",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-60x60@2x.png",
|
||||
"scale" : "2x"
|
||||
"scale" : "3x",
|
||||
"size" : "40x40"
|
||||
},
|
||||
{
|
||||
"size" : "60x60",
|
||||
"filename" : "icon 1.png",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-60x60@3x.png",
|
||||
"scale" : "3x"
|
||||
"scale" : "2x",
|
||||
"size" : "60x60"
|
||||
},
|
||||
{
|
||||
"filename" : "icon.png",
|
||||
"idiom" : "iphone",
|
||||
"scale" : "3x",
|
||||
"size" : "60x60"
|
||||
},
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-20x20@1x.png",
|
||||
"scale" : "1x"
|
||||
"idiom" : "ipad",
|
||||
"scale" : "1x",
|
||||
"size" : "20x20"
|
||||
},
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-20x20@2x.png",
|
||||
"scale" : "2x"
|
||||
"idiom" : "ipad",
|
||||
"scale" : "2x",
|
||||
"size" : "20x20"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-29x29@1x.png",
|
||||
"scale" : "1x"
|
||||
"idiom" : "ipad",
|
||||
"scale" : "1x",
|
||||
"size" : "29x29"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-29x29@2x.png",
|
||||
"scale" : "2x"
|
||||
"idiom" : "ipad",
|
||||
"scale" : "2x",
|
||||
"size" : "29x29"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-40x40@1x.png",
|
||||
"scale" : "1x"
|
||||
"idiom" : "ipad",
|
||||
"scale" : "1x",
|
||||
"size" : "40x40"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-40x40@2x.png",
|
||||
"scale" : "2x"
|
||||
"idiom" : "ipad",
|
||||
"scale" : "2x",
|
||||
"size" : "40x40"
|
||||
},
|
||||
{
|
||||
"size" : "76x76",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-76x76@1x.png",
|
||||
"scale" : "1x"
|
||||
"idiom" : "ipad",
|
||||
"scale" : "1x",
|
||||
"size" : "76x76"
|
||||
},
|
||||
{
|
||||
"size" : "76x76",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-76x76@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "83.5x83.5",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-83.5x83.5@2x.png",
|
||||
"scale" : "2x"
|
||||
"scale" : "2x",
|
||||
"size" : "76x76"
|
||||
},
|
||||
{
|
||||
"filename" : "Icon-App-83.5x83.5@2x.png",
|
||||
"idiom" : "ipad",
|
||||
"scale" : "2x",
|
||||
"size" : "83.5x83.5"
|
||||
},
|
||||
{
|
||||
"size" : "1024x1024",
|
||||
"idiom" : "ios-marketing",
|
||||
"filename" : "Icon-App-1024x1024@1x.png",
|
||||
"scale" : "1x"
|
||||
"idiom" : "ios-marketing",
|
||||
"scale" : "1x",
|
||||
"size" : "1024x1024"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 862 B |
Binary file not shown.
|
Before Width: | Height: | Size: 1.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
BIN
ln_jq_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon.png
Normal file
BIN
ln_jq_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
@@ -2,6 +2,7 @@ import 'package:get/get.dart';
|
||||
import 'package:getx_scaffold/getx_scaffold.dart';
|
||||
import 'package:ln_jq_app/common/model/base_model.dart';
|
||||
import 'package:ln_jq_app/common/model/vehicle_info.dart';
|
||||
import 'package:ln_jq_app/pages/qr_code/view.dart';
|
||||
import 'package:ln_jq_app/storage_service.dart';
|
||||
|
||||
import 'certificate_viewer_page.dart';
|
||||
@@ -27,6 +28,33 @@ class CarInfoController extends GetxController with BaseControllerMixin {
|
||||
super.onInit();
|
||||
getUserBindCarInfo();
|
||||
}
|
||||
@override
|
||||
void onReady() {
|
||||
super.onReady();
|
||||
// 如果未绑定车辆,且本次会话尚未提示过,则弹出提示
|
||||
if (!StorageService.to.hasShownBindVehicleDialog) {
|
||||
Future.delayed(const Duration(milliseconds: 500), () {
|
||||
DialogX.to.showConfirmDialog(
|
||||
title: '当前尚未绑定车辆',
|
||||
confirmText: "去绑定",
|
||||
cancelText: "稍后",
|
||||
onConfirm: () {
|
||||
doQrCode();
|
||||
},
|
||||
);
|
||||
// 标记为已显示,本次会话不再提示
|
||||
StorageService.to.markBindVehicleDialogAsShown();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void doQrCode() async {
|
||||
var scanResult = await Get.to(() => const QrCodePage());
|
||||
if (scanResult == true) {
|
||||
getUserBindCarInfo();
|
||||
refreshAppui();
|
||||
}
|
||||
}
|
||||
|
||||
void getUserBindCarInfo() async {
|
||||
if (StorageService.to.hasVehicleInfo) {
|
||||
|
||||
@@ -173,12 +173,7 @@ class CarInfoPage extends GetView<CarInfoController> {
|
||||
isButton
|
||||
? GestureDetector(
|
||||
onTap: () async {
|
||||
//判断是否绑定成功
|
||||
var scanResult = await Get.to(() => const QrCodePage());
|
||||
if (scanResult == true) {
|
||||
controller.getUserBindCarInfo();
|
||||
refreshAppui();
|
||||
}
|
||||
controller.doQrCode();
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsetsGeometry.only(left: 10.w),
|
||||
|
||||
@@ -9,6 +9,7 @@ import 'package:ln_jq_app/common/model/base_model.dart';
|
||||
import 'package:ln_jq_app/common/model/station_model.dart';
|
||||
import 'package:ln_jq_app/common/model/vehicle_info.dart';
|
||||
import 'package:ln_jq_app/pages/b_page/site/controller.dart';
|
||||
import 'package:ln_jq_app/pages/qr_code/view.dart';
|
||||
import 'package:ln_jq_app/storage_service.dart';
|
||||
|
||||
import '../../../common/styles/theme.dart';
|
||||
@@ -353,6 +354,11 @@ class C_ReservationController extends GetxController with BaseControllerMixin {
|
||||
var result = BaseModel.fromJson(responseData.data);
|
||||
if (result.code == 0) {
|
||||
showSuccessToast("预约成功");
|
||||
|
||||
//打开预约列表
|
||||
Future.delayed(const Duration(milliseconds: 800), () {
|
||||
getReservationList();
|
||||
});
|
||||
} else {
|
||||
showErrorToast(result.message);
|
||||
}
|
||||
@@ -606,6 +612,14 @@ class C_ReservationController extends GetxController with BaseControllerMixin {
|
||||
}
|
||||
}
|
||||
|
||||
void doQrCode() async {
|
||||
var scanResult = await Get.to(() => const QrCodePage());
|
||||
if (scanResult == true) {
|
||||
getUserBindCarInfo();
|
||||
refreshAppui();
|
||||
}
|
||||
}
|
||||
|
||||
void getJqinfo() async {
|
||||
try {
|
||||
HttpService.to.setBaseUrl(AppTheme.test_service_url);
|
||||
@@ -707,6 +721,22 @@ class C_ReservationController extends GetxController with BaseControllerMixin {
|
||||
dismissLoading();
|
||||
HttpService.to.setBaseUrl(AppTheme.test_service_url);
|
||||
HttpService.to.dio.options.headers = originalHeaders;
|
||||
|
||||
// 如果未绑定车辆,且本次会话尚未提示过,则弹出提示
|
||||
if (!StorageService.to.hasShownBindVehicleDialog) {
|
||||
Future.delayed(const Duration(milliseconds: 500), () {
|
||||
DialogX.to.showConfirmDialog(
|
||||
title: '当前尚未绑定车辆',
|
||||
confirmText: "去绑定",
|
||||
cancelText: "稍后",
|
||||
onConfirm: () {
|
||||
doQrCode();
|
||||
},
|
||||
);
|
||||
// 标记为已显示,本次会话不再提示
|
||||
StorageService.to.markBindVehicleDialogAsShown();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -201,12 +201,7 @@ class ReservationPage extends GetView<C_ReservationController> {
|
||||
isButton
|
||||
? GestureDetector(
|
||||
onTap: () async {
|
||||
//判断是否绑定成功
|
||||
var scanResult = await Get.to(() => const QrCodePage());
|
||||
if (scanResult == true) {
|
||||
controller.getUserBindCarInfo();
|
||||
refreshAppui();
|
||||
}
|
||||
controller.doQrCode();
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsetsGeometry.only(left: 10.w),
|
||||
|
||||
@@ -20,9 +20,10 @@ class StorageService extends GetxService {
|
||||
static const String _phoneKey = 'user_phone';
|
||||
static const String _idCardKey = 'user_id_card';
|
||||
static const String _vehicleInfoKey = 'vehicle_info';
|
||||
// 加氢站登录凭证的键名
|
||||
static const String _stationAccountKey = 'station_account';
|
||||
static const String _stationPasswordKey = 'station_password';
|
||||
// 新增:用于标记“绑定车辆”弹窗是否已在本会话中显示过
|
||||
static const String _bindDialogShownKey = 'bind_vehicle_dialog_shown';
|
||||
|
||||
|
||||
static StorageService get to => Get.find();
|
||||
@@ -41,10 +42,13 @@ class StorageService extends GetxService {
|
||||
String? get idCard => _box.read<String?>(_idCardKey);
|
||||
bool get hasVehicleInfo => _box.hasData(_vehicleInfoKey);
|
||||
|
||||
// 记住密码:获取加氢站账号和密码
|
||||
String? get stationAccount => _box.read<String?>(_stationAccountKey);
|
||||
String? get stationPassword => _box.read<String?>(_stationPasswordKey);
|
||||
|
||||
// 新增:获取“绑定车辆”弹窗是否已显示的标志
|
||||
bool get hasShownBindVehicleDialog => _box.read<bool>(_bindDialogShownKey) ?? false;
|
||||
|
||||
|
||||
VehicleInfo? get vehicleInfo {
|
||||
final vehicleJson = _box.read<String?>(_vehicleInfoKey);
|
||||
if (vehicleJson != null) {
|
||||
@@ -84,17 +88,21 @@ class StorageService extends GetxService {
|
||||
await _box.write(_vehicleInfoKey, vehicleInfoToJson(data));
|
||||
}
|
||||
|
||||
// 保存加氢站登录凭证
|
||||
Future<void> saveStationCredentials(String account, String password) async {
|
||||
await _box.write(_stationAccountKey, account);
|
||||
await _box.write(_stationPasswordKey, password);
|
||||
}
|
||||
|
||||
// 新增:标记“绑定车辆”弹窗已显示
|
||||
Future<void> markBindVehicleDialogAsShown() async {
|
||||
await _box.write(_bindDialogShownKey, true);
|
||||
}
|
||||
|
||||
|
||||
Future<void> clearVehicleInfo() async {
|
||||
await _box.remove(_vehicleInfoKey);
|
||||
}
|
||||
|
||||
// 清除加氢站登录凭证
|
||||
Future<void> clearStationCredentials() async {
|
||||
await _box.remove(_stationAccountKey);
|
||||
await _box.remove(_stationPasswordKey);
|
||||
@@ -108,6 +116,7 @@ class StorageService extends GetxService {
|
||||
await _box.remove(_phoneKey);
|
||||
await _box.remove(_idCardKey);
|
||||
await clearVehicleInfo();
|
||||
// 注意:登出时我们不清除“记住的密码”,以便下次用户登录时仍然可以回填
|
||||
// 登出时,清除“绑定车辆”弹窗的显示记录,以便下次登录时可以再次弹出
|
||||
await _box.remove(_bindDialogShownKey);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user