添加商城示例

This commit is contained in:
葛佳祥 2024-01-17 18:43:34 +08:00
parent 0fba9fcf75
commit 4ca79949ed
10 changed files with 74 additions and 11 deletions

View File

@ -202,6 +202,7 @@
"videoIntercomDoorLock":"Video intercom door lock", "videoIntercomDoorLock":"Video intercom door lock",
"NFCPassiveLock":"NFC Passive Lock", "NFCPassiveLock":"NFC Passive Lock",
"addDevice":"Add device", "addDevice":"Add device",
"shoppingCart":"Lock Mall",
"gateway":"Gateway", "gateway":"Gateway",
"message":"Message", "message":"Message",
"supportStaff":"Support Staff", "supportStaff":"Support Staff",

View File

@ -202,6 +202,7 @@
"videoIntercomDoorLock":"videoIntercomDoorLock", "videoIntercomDoorLock":"videoIntercomDoorLock",
"NFCPassiveLock":"NFCPassiveLock", "NFCPassiveLock":"NFCPassiveLock",
"addDevice":"addDevice", "addDevice":"addDevice",
"shoppingCart":"shoppingCart",
"gateway":"gateway", "gateway":"gateway",
"message":"message", "message":"message",
"supportStaff":"supportStaff", "supportStaff":"supportStaff",

View File

@ -202,6 +202,7 @@
"videoIntercomDoorLock":"可视对讲门锁", "videoIntercomDoorLock":"可视对讲门锁",
"NFCPassiveLock":"NFC无源锁", "NFCPassiveLock":"NFC无源锁",
"addDevice":"添加设备", "addDevice":"添加设备",
"shoppingCart":"配件商城",
"gateway":"网关", "gateway":"网关",
"message":"消息", "message":"消息",
"supportStaff":"客服", "supportStaff":"客服",

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@ -144,6 +144,7 @@ import 'mine/gateway/addGateway/seletGatewayTypeNextTip/seletGatewayTypeNextTip_
import 'mine/gateway/gatewayConnectionLock/gatewayConnectionLockList_page.dart'; import 'mine/gateway/gatewayConnectionLock/gatewayConnectionLockList_page.dart';
import 'mine/gateway/gatewayDetail/gatewayDetail_page.dart'; import 'mine/gateway/gatewayDetail/gatewayDetail_page.dart';
import 'mine/gateway/gatewayList/gatewayList_page.dart'; import 'mine/gateway/gatewayList/gatewayList_page.dart';
import 'mine/mall/mall_page.dart';
import 'mine/message/messageList_page.dart'; import 'mine/message/messageList_page.dart';
import 'mine/mine/starLockMine_page.dart'; import 'mine/mine/starLockMine_page.dart';
import 'mine/mineMultiLanguage/mineMultiLanguage_page.dart'; import 'mine/mineMultiLanguage/mineMultiLanguage_page.dart';
@ -183,6 +184,7 @@ abstract class Routers {
static const starLockMain = '/StarLockMain'; // static const starLockMain = '/StarLockMain'; //
static const starLockMinePage = '/StarLockMinePage'; // static const starLockMinePage = '/StarLockMinePage'; //
static const seletLockTypePage = '/SeletLockTypePage'; // static const seletLockTypePage = '/SeletLockTypePage'; //
static const LockMallPage = '/LockMallPage'; //
static const addLockPage = '/AddLockPage'; // static const addLockPage = '/AddLockPage'; //
static const nearbyLockPage = '/NearbyLockPage'; // static const nearbyLockPage = '/NearbyLockPage'; //
static const lockAddressPage = '/LockAddressPage'; // static const lockAddressPage = '/LockAddressPage'; //
@ -436,6 +438,10 @@ abstract class AppRouters {
name: Routers.seletLockTypePage, name: Routers.seletLockTypePage,
page: () => const SeletLockTypePage(), page: () => const SeletLockTypePage(),
), ),
GetPage(
name: Routers.LockMallPage,
page: () => const LockMallPage(),
),
GetPage( GetPage(
name: Routers.addLockPage, name: Routers.addLockPage,
page: () => const AddLockPage(), page: () => const AddLockPage(),

View File

@ -3,7 +3,6 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:star_lock/appRouters.dart'; import 'package:star_lock/appRouters.dart';
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart'; import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
import 'package:star_lock/network/api.dart';
import '../../app_settings/app_colors.dart'; import '../../app_settings/app_colors.dart';
import '../../tools/commonItem.dart'; import '../../tools/commonItem.dart';
@ -68,6 +67,7 @@ class _AbountPageState extends State<AbountPage> {
isHaveLine: false, isHaveLine: false,
isHaveDirection: true, isHaveDirection: true,
action: () { action: () {
print("用户协议${XSConstantMacro.userAgreementURL}");
Navigator.pushNamed(context, Routers.webviewShowPage, Navigator.pushNamed(context, Routers.webviewShowPage,
arguments: { arguments: {
"url": XSConstantMacro.userAgreementURL, "url": XSConstantMacro.userAgreementURL,

View File

@ -0,0 +1,50 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:star_lock/app_settings/app_colors.dart';
import 'package:star_lock/tools/titleAppBar.dart';
import 'package:webview_flutter/webview_flutter.dart';
import '../../translations/trans_lib.dart';
class LockMallPage extends StatefulWidget {
const LockMallPage({Key? key}) : super(key: key);
@override
State<LockMallPage> createState() => _LockMallPageState();
}
class _LockMallPageState extends State<LockMallPage> {
late WebViewController _webViewController;
@override
void initState() {
super.initState();
_webViewController = WebViewController()
..setJavaScriptMode(JavaScriptMode.unrestricted);
}
@override
Widget build(BuildContext context) {
// FIXME
// FIXME url应该使用接口获取 /mall/getUrl POST请求
String url = 'https://ge.mall.star-lock.cn/quick_login?id=4&key=1ffb9d37109b8351ebb04ccfcca02c8e';
_webViewController.loadRequest(Uri.parse(url));
return Scaffold(
resizeToAvoidBottomInset: false,
backgroundColor: const Color(0xFFFFFFFF),
appBar: TitleAppBar(
barTitle: getWebTitle(),
haveBack: true,
backgroundColor: AppColors.mainColor,
),
body: WebViewWidget(controller: _webViewController));
}
String getWebTitle() {
String webTitleStr = TranslationLoader.lanKeys!.shoppingCart!.tr;
_webViewController.getTitle().then((result) {
webTitleStr = result!;
});
return webTitleStr;
}
}

View File

@ -147,6 +147,11 @@ class _StarLockMinePageState extends State<StarLockMinePage> with BaseWidget {
Get.back(); Get.back();
Get.toNamed(Routers.valueAddedServicesPage); Get.toNamed(Routers.valueAddedServicesPage);
}), }),
mineItem('images/mine/icon_mine_main_shoppingcart.png',
TranslationLoader.lanKeys!.shoppingCart!.tr, () {
Get.back();
Get.toNamed(Routers.LockMallPage);
}),
mineItem('images/mine/icon_mine_main_about.png', mineItem('images/mine/icon_mine_main_about.png',
TranslationLoader.lanKeys!.about!.tr, () { TranslationLoader.lanKeys!.about!.tr, () {
Get.back(); Get.back();

View File

@ -1,16 +1,11 @@
abstract class Api { abstract class Api {
// static String baseAddress = "https://pre.lock.star-lock.cn:8093"; // // static String baseAddress = "https://pre.lock.star-lock.cn:8093"; //
static String baseAddress = "http://192.168.56.101:8099"; // // static String baseAddress = "https://dev.lock.star-lock.cn"; //
// static String baseAddress = "http://192.168.1.15:8022"; // // static String baseAddress = "http://192.168.1.15:8022"; //
static String baseAddress = "https://ge.lock.star-lock.cn:8100"; //
final String baseUrl = "$baseAddress/api"; final String baseUrl = "$baseAddress/api";
// final String baseUrl = "http://test.lock.star-lock.cn/api"; //
// final String baseUrl = "https://lock.star-lock.cn/api"; //
// final String baseUrl = "http://wenlin.lock.star-lock.cn/api"; //
// final String baseUrl = "http://192.168.56.101:8099/api"; //
// final String baseUrl = "http://192.168.1.14:8099/api"; //
// //
final String getVerificationCodeUrl = '/user/sendValidationCode'; final String getVerificationCodeUrl = '/user/sendValidationCode';
final String registerUrl = '/user/register'; final String registerUrl = '/user/register';

View File

@ -198,6 +198,7 @@ class LanKeyEntity {
this.videoIntercomDoorLock, this.videoIntercomDoorLock,
this.NFCPassiveLock, this.NFCPassiveLock,
this.addDevice, this.addDevice,
this.shoppingCart,
this.gateway, this.gateway,
this.message, this.message,
this.supportStaff, this.supportStaff,
@ -661,6 +662,7 @@ class LanKeyEntity {
videoIntercomDoorLock = json['videoIntercomDoorLock']; videoIntercomDoorLock = json['videoIntercomDoorLock'];
NFCPassiveLock = json['NFCPassiveLock']; NFCPassiveLock = json['NFCPassiveLock'];
addDevice = json['addDevice']; addDevice = json['addDevice'];
shoppingCart = json['shoppingCart'];
gateway = json['gateway']; gateway = json['gateway'];
message = json['message']; message = json['message'];
supportStaff = json['supportStaff']; supportStaff = json['supportStaff'];
@ -1147,6 +1149,7 @@ class LanKeyEntity {
String? videoIntercomDoorLock; String? videoIntercomDoorLock;
String? NFCPassiveLock; String? NFCPassiveLock;
String? addDevice; String? addDevice;
String? shoppingCart;
String? gateway; String? gateway;
String? message; String? message;
String? supportStaff; String? supportStaff;
@ -1629,6 +1632,7 @@ class LanKeyEntity {
map['videoIntercomDoorLock'] = videoIntercomDoorLock; map['videoIntercomDoorLock'] = videoIntercomDoorLock;
map['NFCPassiveLock'] = NFCPassiveLock; map['NFCPassiveLock'] = NFCPassiveLock;
map['addDevice'] = addDevice; map['addDevice'] = addDevice;
map['shoppingCart'] = shoppingCart;
map['gateway'] = gateway; map['gateway'] = gateway;
map['message'] = message; map['message'] = message;
map['supportStaff'] = supportStaff; map['supportStaff'] = supportStaff;