添加商城示例

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",
"NFCPassiveLock":"NFC Passive Lock",
"addDevice":"Add device",
"shoppingCart":"Lock Mall",
"gateway":"Gateway",
"message":"Message",
"supportStaff":"Support Staff",
@ -473,7 +474,7 @@
"openRight": "Open Right",
"judgmentMethod": "Judgment Method\n",
"judgmentMethodContent": "The man stood outside the house, facing the entrance door. \nIf the hinge or shaft of the door is on the left, the door is left open; \nA door is right-open if its hinge or shaft is on the right. \nIf the setting is wrong, it will not open and close the door properly. \nRecommended to be operated by installation or maintenance personnel.",
"customMode": "Custom mode",
"videoSlot": "Video slot"
}

View File

@ -202,6 +202,7 @@
"videoIntercomDoorLock":"videoIntercomDoorLock",
"NFCPassiveLock":"NFCPassiveLock",
"addDevice":"addDevice",
"shoppingCart":"shoppingCart",
"gateway":"gateway",
"message":"message",
"supportStaff":"supportStaff",
@ -476,4 +477,4 @@
"customMode": "customMode",
"videoSlot": "videoSlot"
}
}

View File

@ -202,6 +202,7 @@
"videoIntercomDoorLock":"可视对讲门锁",
"NFCPassiveLock":"NFC无源锁",
"addDevice":"添加设备",
"shoppingCart":"配件商城",
"gateway":"网关",
"message":"消息",
"supportStaff":"客服",
@ -479,4 +480,4 @@
"customMode": "自定义模式",
"videoSlot": "录像时段"
}
}

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

View File

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

View File

@ -1,16 +1,11 @@
abstract class Api {
// 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 = "https://ge.lock.star-lock.cn:8100"; //
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 registerUrl = '/user/register';

View File

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