添加商城示例
This commit is contained in:
parent
0fba9fcf75
commit
4ca79949ed
@ -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",
|
||||||
|
|||||||
@ -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",
|
||||||
|
|||||||
@ -202,6 +202,7 @@
|
|||||||
"videoIntercomDoorLock":"可视对讲门锁",
|
"videoIntercomDoorLock":"可视对讲门锁",
|
||||||
"NFCPassiveLock":"NFC无源锁",
|
"NFCPassiveLock":"NFC无源锁",
|
||||||
"addDevice":"添加设备",
|
"addDevice":"添加设备",
|
||||||
|
"shoppingCart":"配件商城",
|
||||||
"gateway":"网关",
|
"gateway":"网关",
|
||||||
"message":"消息",
|
"message":"消息",
|
||||||
"supportStaff":"客服",
|
"supportStaff":"客服",
|
||||||
|
|||||||
BIN
star_lock/images/mine/icon_mine_main_shoppingcart.png
Normal file
BIN
star_lock/images/mine/icon_mine_main_shoppingcart.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.8 KiB |
@ -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(),
|
||||||
|
|||||||
@ -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,
|
||||||
|
|||||||
50
star_lock/lib/mine/mall/mall_page.dart
Normal file
50
star_lock/lib/mine/mall/mall_page.dart
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -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();
|
||||||
|
|||||||
@ -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';
|
||||||
|
|||||||
@ -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;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user