1,新增高级功能根据权限展示不同入口
2,新增添加开门通知保存时弹出需开通Alert框 3,新增增值服务套餐购包链接 4,已开通高级功能布局修改
This commit is contained in:
parent
817b515637
commit
a4a7ee9fa4
BIN
star_lock/images/icon_gift.png
Normal file
BIN
star_lock/images/icon_gift.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.5 KiB |
@ -801,5 +801,7 @@
|
||||
"《隐私政策》": "《Privacy Policy》",
|
||||
"的全部内容。点击“同意”即表示您同意并接受全部条款。若选择不同意,将无法使用我们的产品和服务,并会退出应用。": "The entire content of. By clicking \"Agree\", you agree and accept all terms. If you choose not to agree, you will not be able to use our products and services and will exit the application.",
|
||||
"不同意":"Disagree",
|
||||
"同意":"agree"
|
||||
"同意":"agree",
|
||||
"已开通":"Have opened",
|
||||
"该功能是高级功能,请开通后再使用":"This function is an advanced function. Please enable it before using it"
|
||||
}
|
||||
|
||||
@ -800,5 +800,7 @@
|
||||
"《隐私政策》": "《隐私政策》",
|
||||
"的全部内容。点击“同意”即表示您同意并接受全部条款。若选择不同意,将无法使用我们的产品和服务,并会退出应用。": "的全部内容。点击“同意”即表示您同意并接受全部条款。若选择不同意,将无法使用我们的产品和服务,并会退出应用。",
|
||||
"不同意":"不同意",
|
||||
"同意":"同意"
|
||||
"同意":"同意",
|
||||
"已开通":"已开通",
|
||||
"该功能是高级功能,请开通后再使用":"该功能是高级功能,请开通后再使用"
|
||||
}
|
||||
|
||||
@ -803,6 +803,7 @@
|
||||
"《隐私政策》": "《隐私政策》",
|
||||
"的全部内容。点击“同意”即表示您同意并接受全部条款。若选择不同意,将无法使用我们的产品和服务,并会退出应用。": "的全部内容。点击“同意”即表示您同意并接受全部条款。若选择不同意,将无法使用我们的产品和服务,并会退出应用。",
|
||||
"不同意":"不同意",
|
||||
"同意":"同意"
|
||||
|
||||
"同意":"同意",
|
||||
"已开通":"已开通",
|
||||
"该功能是高级功能,请开通后再使用":"该功能是高级功能,请开通后再使用"
|
||||
}
|
||||
|
||||
@ -52,6 +52,7 @@ import 'package:star_lock/mine/mineSet/transferGateway/selectGetewayList_page.da
|
||||
import 'package:star_lock/mine/mineSet/transferSmartLock/recipientInformation/recipientInformation_page.dart';
|
||||
import 'package:star_lock/mine/mineSet/transferSmartLock/selectBranch/selectBranch_page.dart';
|
||||
import 'package:star_lock/mine/mineSet/transferSmartLock/transferSmartLockList/transferSmartLock_page.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/advancedFeaturesWeb/advancedFeaturesWeb_page.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRecord/value_added_services_record_page.dart';
|
||||
|
||||
import 'common/safetyVerification/safetyVerification_page.dart';
|
||||
@ -209,8 +210,7 @@ abstract class Routers {
|
||||
static const electronicKeyDetailPage = '/ElectronicKeyDetailPage'; // 电子钥匙详情
|
||||
static const electronicKeyDetailChangeDate =
|
||||
'/ElectronicKeyDetailChangeDate'; // 修改有效期
|
||||
static const sendElectronicKeyPage =
|
||||
'/SendElectronicKeyPage'; // 发送电子钥匙
|
||||
static const sendElectronicKeyPage = '/SendElectronicKeyPage'; // 发送电子钥匙
|
||||
static const massSendElectronicKeyManagePage =
|
||||
'/MassSendElectronicKeyManagePage'; // 群发钥匙
|
||||
static const electronicKeyPeriodValidityPage =
|
||||
@ -234,8 +234,7 @@ abstract class Routers {
|
||||
static const authorizedAdminListPage = '/AuthorizedAdminListPage'; // 授权管理员列表
|
||||
static const authorizedAdminDetailPage =
|
||||
'/AuthorizedAdminDetailPage'; // 授权管理员详情
|
||||
static const authorizedAdminPage =
|
||||
'/AuthorizedAdminPage'; // 授权管理员
|
||||
static const authorizedAdminPage = '/AuthorizedAdminPage'; // 授权管理员
|
||||
static const volumeAuthorizationLockManagePage =
|
||||
'/VolumeAuthorizationLockManagePage'; // 批量授权锁
|
||||
static const lockOperatingRecordPage = '/LockOperatingRecordPage'; // 操作记录
|
||||
@ -447,6 +446,7 @@ abstract class Routers {
|
||||
static const accessoriesListPage = '/accessoriesListPage'; //配件列表
|
||||
static const seletKeyCyclicDatePage =
|
||||
'/SeletKeyCyclicDatePage'; // 电子钥匙、授权管理员、卡、指纹、遥控等添加添加循环日期公共界面
|
||||
static const advancedFeaturesWebPage = '/advancedFeaturesWebPage'; // 高级功能
|
||||
}
|
||||
|
||||
abstract class AppRouters {
|
||||
@ -1065,6 +1065,9 @@ abstract class AppRouters {
|
||||
GetPage(
|
||||
name: Routers.addPalmTypeManagePage,
|
||||
page: (() => const AddPalmTypeManagePage())),
|
||||
GetPage(name: Routers.addPalmPage, page: (() => const AddPalmPage()))
|
||||
GetPage(name: Routers.addPalmPage, page: (() => const AddPalmPage())),
|
||||
GetPage(
|
||||
name: Routers.advancedFeaturesWebPage,
|
||||
page: (() => AdvancedFeaturesWebPage()))
|
||||
];
|
||||
}
|
||||
|
||||
@ -1,4 +1,8 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/appRouters.dart';
|
||||
import 'package:star_lock/app_settings/app_colors.dart';
|
||||
import 'package:star_lock/main/lockDetail/messageWarn/addFamily/addFamily_state.dart';
|
||||
import 'package:star_lock/main/lockDetail/messageWarn/msgNotification/openDoorNotify/openDoorNotify_entity.dart';
|
||||
import 'package:star_lock/main/lockDetail/messageWarn/notificationMode/notificationMode_data.dart';
|
||||
@ -141,6 +145,45 @@ class AddFamilyLogic extends BaseGetXController {
|
||||
}
|
||||
}
|
||||
|
||||
//高级功能弹窗
|
||||
void advancedFeatureAlert() {
|
||||
showCupertinoDialog(
|
||||
context: Get.context!,
|
||||
builder: (context) {
|
||||
return CupertinoAlertDialog(
|
||||
title: Container(
|
||||
margin: EdgeInsets.only(bottom: 20.h),
|
||||
child: Image.asset(
|
||||
'images/icon_gift.png',
|
||||
width: 50.w,
|
||||
height: 50.w,
|
||||
),
|
||||
),
|
||||
content: Text('该功能是高级功能,请开通后再使用'.tr),
|
||||
actions: [
|
||||
CupertinoDialogAction(
|
||||
child: Text(
|
||||
'取消'.tr,
|
||||
style: TextStyle(color: AppColors.mainColor),
|
||||
),
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
},
|
||||
),
|
||||
CupertinoDialogAction(
|
||||
child: Text(
|
||||
'去开通'.tr,
|
||||
style: TextStyle(color: AppColors.mainColor),
|
||||
),
|
||||
onPressed: () async {
|
||||
Get.toNamed(Routers.advancedFeaturesWebPage);
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
//根据列表返回值得到邮箱、手机列表
|
||||
Map<String, List<MsgNoticeModeData>> getAccountsMap() {
|
||||
List<MsgNoticeModeData> mailAccounts = [];
|
||||
|
||||
@ -6,6 +6,7 @@ import 'package:star_lock/appRouters.dart';
|
||||
import 'package:star_lock/main/lockDetail/messageWarn/addFamily/addFamily_logic.dart';
|
||||
import 'package:star_lock/tools/commonItem.dart';
|
||||
import 'package:star_lock/tools/showTFView.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
import 'package:star_lock/tools/submitBtn.dart';
|
||||
import 'package:star_lock/translations/trans_lib.dart';
|
||||
|
||||
@ -114,11 +115,16 @@ class _AddFamilyPageState extends State<AddFamilyPage> {
|
||||
? true
|
||||
: logic.checkBtnDisable(),
|
||||
isDelete: state.isDetail.value,
|
||||
onClick: () {
|
||||
if (state.isDetail.value) {
|
||||
logic.deleteLockNoticeSetting();
|
||||
onClick: () async {
|
||||
var isVip = await Storage.getBool(saveIsVip);
|
||||
if (isVip == true) {
|
||||
if (state.isDetail.value) {
|
||||
logic.deleteLockNoticeSetting();
|
||||
} else {
|
||||
logic.addLockNoticeSetting();
|
||||
}
|
||||
} else {
|
||||
logic.addLockNoticeSetting();
|
||||
logic.advancedFeatureAlert();
|
||||
}
|
||||
},
|
||||
)),
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/app_settings/app_settings.dart';
|
||||
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
||||
import 'package:star_lock/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_entity.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
@ -20,7 +18,7 @@ class StarLockMineLogic extends BaseGetXController {
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
state.mineInfoData.value = entity.data!;
|
||||
state.isVip.value = state.mineInfoData.value.isVip! == 0 ? false : true;
|
||||
AppLog.log('isVip: ${state.isVip.value}');
|
||||
Storage.setBool(saveIsVip, state.isVip.value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -34,7 +34,6 @@ class StarLockMinePageState extends State<StarLockMinePage> with BaseWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: const Color(0xFFFFFFFF),
|
||||
// appBar: TitleAppBar(barTitle: "", haveBack:false, backgroundColor: AppColors.mainColor),
|
||||
body: Column(
|
||||
children: [
|
||||
topWidget(),
|
||||
@ -42,7 +41,6 @@ class StarLockMinePageState extends State<StarLockMinePage> with BaseWidget {
|
||||
SizedBox(
|
||||
height: 40.h,
|
||||
),
|
||||
// keyBottomWidget()
|
||||
],
|
||||
),
|
||||
);
|
||||
@ -64,24 +62,18 @@ class StarLockMinePageState extends State<StarLockMinePage> with BaseWidget {
|
||||
),
|
||||
Center(
|
||||
child: Column(
|
||||
// crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 120.h,
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
// Navigator.pushNamed(context, Routers.starLockLoginPage);
|
||||
Get.back();
|
||||
Get.toNamed(Routers.minePersonInfoPage);
|
||||
},
|
||||
child: Obx(() => Container(
|
||||
child: Obx(() => SizedBox(
|
||||
width: 105.w,
|
||||
height: 105.w,
|
||||
// decoration: BoxDecoration(
|
||||
// borderRadius:
|
||||
// BorderRadius.all(Radius.circular(52.5.w)),
|
||||
// ),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(52.5.w),
|
||||
child: CustomNetworkImage(
|
||||
@ -90,12 +82,6 @@ class StarLockMinePageState extends State<StarLockMinePage> with BaseWidget {
|
||||
width: 105.w,
|
||||
height: 105.h),
|
||||
),
|
||||
// state.headUrl().isNotEmpty ?
|
||||
// Image(image: NetworkImage(state.loginData.value.data!.headUrl!)) :
|
||||
// Image.asset(
|
||||
// 'images/mine/icon_mine_main_defaultAvatar.png',
|
||||
// width: 60.w,
|
||||
// height: 60.w)
|
||||
)),
|
||||
),
|
||||
SizedBox(
|
||||
|
||||
@ -37,14 +37,20 @@ class MinePersonInfoLogic extends BaseGetXController {
|
||||
}
|
||||
|
||||
// 上传头像
|
||||
void uploadFile(MinePersonGetUploadFileInfoEntity minePersonGetUploadFileInfoEntity) async {
|
||||
void uploadFile(
|
||||
MinePersonGetUploadFileInfoEntity
|
||||
minePersonGetUploadFileInfoEntity) async {
|
||||
// Map<String, dynamic> user = minePersonGetUploadFileInfoEntity.data!.formData!;
|
||||
var bytes = File(state.image!.path);
|
||||
var enc = await bytes.readAsBytes();
|
||||
// user[minePersonGetUploadFileInfoEntity.data!.fileField!] = enc;
|
||||
|
||||
final form = FormData(minePersonGetUploadFileInfoEntity.data!.formData!);
|
||||
form.files.add(MapEntry(minePersonGetUploadFileInfoEntity.data!.fileField!, MultipartFile(enc, filename: minePersonGetUploadFileInfoEntity.data!.formData!["key"])));
|
||||
form.files.add(MapEntry(
|
||||
minePersonGetUploadFileInfoEntity.data!.fileField!,
|
||||
MultipartFile(enc,
|
||||
filename:
|
||||
minePersonGetUploadFileInfoEntity.data!.formData!["key"])));
|
||||
|
||||
var entity = await ApiRepository.to.uploadFile(
|
||||
url: minePersonGetUploadFileInfoEntity.data!.uploadUrl!, body: form);
|
||||
|
||||
@ -130,8 +130,9 @@ class _MinePersonInfoPageState extends State<MinePersonInfoPage> {
|
||||
}),
|
||||
Obx(() => CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.safetyProblem!.tr,
|
||||
rightTitle:
|
||||
state.mineInfoData.value.haveSafeAnswer == 0 ? "去设置".tr : "",
|
||||
rightTitle: state.mineInfoData.value.haveSafeAnswer == 0
|
||||
? "去设置".tr
|
||||
: "",
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
|
||||
@ -0,0 +1,60 @@
|
||||
class AdvancedFeaturesWebEntity {
|
||||
int? errorCode;
|
||||
String? description;
|
||||
String? errorMsg;
|
||||
Data? data;
|
||||
|
||||
AdvancedFeaturesWebEntity(
|
||||
{this.errorCode, this.description, this.errorMsg, this.data});
|
||||
|
||||
AdvancedFeaturesWebEntity.fromJson(Map<String, dynamic> json) {
|
||||
errorCode = json['errorCode'];
|
||||
description = json['description'];
|
||||
errorMsg = json['errorMsg'];
|
||||
data = json['data'] != null ? Data.fromJson(json['data']) : null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['errorCode'] = errorCode;
|
||||
data['description'] = description;
|
||||
data['errorMsg'] = errorMsg;
|
||||
if (this.data != null) {
|
||||
data['data'] = this.data!.toJson();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Data {
|
||||
String? smsBuyUrl;
|
||||
String? emailBuyUrl;
|
||||
String? vipBuyUrl;
|
||||
String? cloudauthBuyUrl;
|
||||
String? shopList;
|
||||
|
||||
Data(
|
||||
{this.smsBuyUrl,
|
||||
this.emailBuyUrl,
|
||||
this.vipBuyUrl,
|
||||
this.cloudauthBuyUrl,
|
||||
this.shopList});
|
||||
|
||||
Data.fromJson(Map<String, dynamic> json) {
|
||||
smsBuyUrl = json['sms_buy_url'];
|
||||
emailBuyUrl = json['email_buy_url'];
|
||||
vipBuyUrl = json['vip_buy_url'];
|
||||
cloudauthBuyUrl = json['cloudauth_buy_url'];
|
||||
shopList = json['shopList'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['sms_buy_url'] = smsBuyUrl;
|
||||
data['email_buy_url'] = emailBuyUrl;
|
||||
data['vip_buy_url'] = vipBuyUrl;
|
||||
data['cloudauth_buy_url'] = cloudauthBuyUrl;
|
||||
data['shopList'] = shopList;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,122 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:fluwx/fluwx.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/app_settings/app_settings.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/advancedFeaturesWeb/advancedFeaturesWeb_entity.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/advancedFeaturesWeb/advancedFeaturesWeb_state.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import 'package:star_lock/tools/pay/wx_pay_tool.dart';
|
||||
import 'package:star_lock/webview/webview_logic.dart';
|
||||
import 'package:webview_flutter/webview_flutter.dart';
|
||||
|
||||
class AdvancedFeaturesWebLogic extends BaseGetXController {
|
||||
late AdvancedFeaturesWebState state;
|
||||
|
||||
AdvancedFeaturesWebLogic({required bool allowReturn})
|
||||
: state = AdvancedFeaturesWebState(allowReturn: allowReturn);
|
||||
|
||||
//获取商城跳转地址
|
||||
Future<void> getVipBuyURLRequest() async {
|
||||
AdvancedFeaturesWebEntity entity =
|
||||
await ApiRepository.to.getServicePackageBuyUrl();
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
state.vipBuyUrl.value = entity.data!.shopList!;
|
||||
state.mallWebView.setNavigationDelegate(
|
||||
NavigationDelegate(
|
||||
onProgress: (int progress) {
|
||||
// Update loading bar.
|
||||
state.webProgress.value = progress / 100;
|
||||
},
|
||||
onPageStarted: (String url) {
|
||||
state.webProgress.value = 0.0;
|
||||
},
|
||||
onPageFinished: (String url) {
|
||||
state.webProgress.value = 1.0;
|
||||
},
|
||||
onWebResourceError: (WebResourceError error) {},
|
||||
onNavigationRequest: (NavigationRequest request) async {
|
||||
//路由跳转逻辑
|
||||
if (WebViewLogic.judgePaySchemes(request.url)) {
|
||||
await WebViewLogic.runScheme(request.url);
|
||||
return NavigationDecision.prevent;
|
||||
}
|
||||
return NavigationDecision.navigate;
|
||||
},
|
||||
),
|
||||
);
|
||||
state.mallWebView.loadRequest(Uri.parse(state.vipBuyUrl.value));
|
||||
// FlutterBridge.postMessage({action:'',data:'{}',callFun:'回调给js的方法'})
|
||||
state.mallWebView.addJavaScriptChannel(
|
||||
"FlutterBridge",
|
||||
onMessageReceived: (JavaScriptMessage message) async {
|
||||
flutterBridge(message);
|
||||
},
|
||||
);
|
||||
// onMessageReceived
|
||||
}
|
||||
}
|
||||
|
||||
//监听webview的调用
|
||||
Future<void> flutterBridge(JavaScriptMessage message) async {
|
||||
final dynamic obj = jsonDecode(message.message);
|
||||
AppLog.log(obj);
|
||||
if (obj is! Map && obj['action'] is String) {
|
||||
return;
|
||||
}
|
||||
String action = obj['action'];
|
||||
dynamic data = obj['data'];
|
||||
String? callFun = obj['callFun'];
|
||||
switch (action) {
|
||||
case 'WechatPayParams':
|
||||
//微信支付
|
||||
wxPay(data, callFun);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//微信支付
|
||||
Future<void> wxPay(dynamic data, String? callFun) async {
|
||||
WxPayTool.pay(WxPayTool.mapToPayment(data), (response) {
|
||||
if (response is WeChatPaymentResponse) {
|
||||
Map data = {
|
||||
'type': response.type,
|
||||
'extData': response.extData,
|
||||
'errCode': response.errCode,
|
||||
'errStr': response.errStr,
|
||||
};
|
||||
state.mallWebView.runJavaScript(
|
||||
'window.$callFun(`${json.encode(data)}`)',
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//判断webview 是否可以有路由可以回退,无则退出当前页面
|
||||
Future<bool> canGoBack(bool didPop) async {
|
||||
bool canGoBack = await state.mallWebView.canGoBack();
|
||||
if (canGoBack) {
|
||||
await state.mallWebView.goBack();
|
||||
} else {
|
||||
if (state.allowReturn) Get.back();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> onReady() async {
|
||||
super.onReady();
|
||||
}
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
getVipBuyURLRequest();
|
||||
}
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
super.onClose();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,65 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/app_settings/app_colors.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/advancedFeaturesWeb/advancedFeaturesWeb_logic.dart';
|
||||
import 'package:star_lock/tools/titleAppBar.dart';
|
||||
import 'package:webview_flutter/webview_flutter.dart';
|
||||
|
||||
class AdvancedFeaturesWebPage extends StatefulWidget {
|
||||
AdvancedFeaturesWebPage(
|
||||
{Key? key, this.showAppBar = true, this.allowReturn = true})
|
||||
: super(key: key);
|
||||
bool showAppBar;
|
||||
bool allowReturn;
|
||||
|
||||
@override
|
||||
State<AdvancedFeaturesWebPage> createState() =>
|
||||
_AdvancedFeaturesWebPageState();
|
||||
}
|
||||
|
||||
class _AdvancedFeaturesWebPageState extends State<AdvancedFeaturesWebPage> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GetBuilder<AdvancedFeaturesWebLogic>(
|
||||
init: AdvancedFeaturesWebLogic(allowReturn: widget.allowReturn),
|
||||
builder: (AdvancedFeaturesWebLogic logic) {
|
||||
return PopScope(
|
||||
onPopInvoked: logic.canGoBack,
|
||||
canPop: false,
|
||||
child: Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
backgroundColor: const Color(0xFFFFFFFF),
|
||||
appBar: widget.showAppBar
|
||||
? TitleAppBar(
|
||||
barTitle: '高级功能',
|
||||
haveBack: true,
|
||||
backgroundColor: AppColors.mainColor,
|
||||
)
|
||||
: null,
|
||||
body: Obx(() => Column(
|
||||
children: <Widget>[
|
||||
Container(
|
||||
padding: EdgeInsets.only(bottom: 10.w),
|
||||
child: LinearProgressIndicator(
|
||||
value: logic.state.webProgress.value,
|
||||
backgroundColor: Colors.grey,
|
||||
valueColor: AlwaysStoppedAnimation<Color>(
|
||||
AppColors.mainColor),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: WebViewWidget(
|
||||
controller: logic.state.mallWebView),
|
||||
),
|
||||
],
|
||||
))),
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/webview/webview_logic.dart';
|
||||
import 'package:webview_flutter/webview_flutter.dart';
|
||||
|
||||
class AdvancedFeaturesWebState {
|
||||
AdvancedFeaturesWebState({required this.allowReturn});
|
||||
|
||||
var vipBuyUrl = "".obs;
|
||||
var webProgress = 0.0.obs;
|
||||
bool allowReturn;
|
||||
late WebViewController mallWebView = initWebViewController();
|
||||
|
||||
//初始化webView控制器
|
||||
WebViewController initWebViewController() {
|
||||
WebViewController allWebView = WebViewController();
|
||||
allWebView.setJavaScriptMode(JavaScriptMode.unrestricted);
|
||||
allWebView.setBackgroundColor(Colors.white);
|
||||
allWebView.setUserAgent(WebViewLogic.userAgent);
|
||||
return allWebView;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesHighFunction/valueAddedServicesHighFunction_state.dart';
|
||||
|
||||
import '../../../../network/api_repository.dart';
|
||||
import '../../../../tools/baseGetXController.dart';
|
||||
|
||||
class ValueAddedServicesHighFunctionLogic extends BaseGetXController {
|
||||
ValueAddedServicesHighFunctionState state =
|
||||
ValueAddedServicesHighFunctionState();
|
||||
|
||||
//获取增值服务用户余量包
|
||||
Future<void> getServiceUserPackage() async {
|
||||
var entity = await ApiRepository.to.getServiceUserPackage();
|
||||
if (entity.errorCode!.codeIsSuccessful) {}
|
||||
}
|
||||
}
|
||||
@ -1,10 +1,10 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesHighFunction/valueAddedServicesHighFunction_logic.dart';
|
||||
|
||||
import '../../../appRouters.dart';
|
||||
import '../../../app_settings/app_colors.dart';
|
||||
import '../../../tools/submitBtn.dart';
|
||||
import '../../../tools/titleAppBar.dart';
|
||||
import '../../../translations/trans_lib.dart';
|
||||
|
||||
@ -18,6 +18,16 @@ class ValueAddedServicesHighFunctionPage extends StatefulWidget {
|
||||
|
||||
class _ValueAddedServicesHighFunctionPageState
|
||||
extends State<ValueAddedServicesHighFunctionPage> {
|
||||
final logic = Get.put(ValueAddedServicesHighFunctionLogic());
|
||||
final state = Get.find<ValueAddedServicesHighFunctionLogic>().state;
|
||||
|
||||
@override
|
||||
initState() {
|
||||
super.initState();
|
||||
|
||||
logic.getServiceUserPackage();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
@ -69,7 +79,7 @@ class _ValueAddedServicesHighFunctionPageState
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"${TranslationLoader.lanKeys!.currentState!.tr}:${TranslationLoader.lanKeys!.haveNotOpened!.tr}",
|
||||
"已开通".tr,
|
||||
style:
|
||||
TextStyle(fontSize: 24.sp, fontWeight: FontWeight.w600),
|
||||
),
|
||||
|
||||
@ -0,0 +1 @@
|
||||
class ValueAddedServicesHighFunctionState {}
|
||||
@ -0,0 +1,15 @@
|
||||
import 'dart:async';
|
||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesList/valueAddedServicesList_state.dart';
|
||||
|
||||
import '../../../../network/api_repository.dart';
|
||||
import '../../../../tools/baseGetXController.dart';
|
||||
|
||||
class ValueAddedServicesListLogic extends BaseGetXController {
|
||||
ValueAddedServicesListState state = ValueAddedServicesListState();
|
||||
|
||||
//增值服务套餐购包链接
|
||||
Future<void> getServicePackageBuyUrl() async {
|
||||
var entity = await ApiRepository.to.getServicePackageBuyUrl();
|
||||
if (entity.errorCode!.codeIsSuccessful) {}
|
||||
}
|
||||
}
|
||||
@ -2,6 +2,8 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesList/valueAddedServicesList_logic.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
|
||||
import '../../../appRouters.dart';
|
||||
import '../../../app_settings/app_colors.dart';
|
||||
@ -18,6 +20,16 @@ class ValueAddedServicesListPage extends StatefulWidget {
|
||||
|
||||
class _ValueAddedServicesPageListState
|
||||
extends State<ValueAddedServicesListPage> {
|
||||
final logic = Get.put(ValueAddedServicesListLogic());
|
||||
final state = Get.find<ValueAddedServicesListLogic>().state;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
logic.getServicePackageBuyUrl();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
@ -43,14 +55,20 @@ class _ValueAddedServicesPageListState
|
||||
// arguments: 2);
|
||||
// }),
|
||||
_valueAddedServicesItem(
|
||||
Image.asset('images/mine/icon_mine_valueAddedServices_realName.png'),
|
||||
Image.asset(
|
||||
'images/mine/icon_mine_valueAddedServices_realName.png'),
|
||||
TranslationLoader.lanKeys!.realNameAuthentication!.tr, () {
|
||||
Get.toNamed(Routers.valueAddedServicesRealNamePage);
|
||||
}),
|
||||
_valueAddedServicesItem(
|
||||
Image.asset('images/mine/icon_mine_valueAddedServices_vip.png'),
|
||||
TranslationLoader.lanKeys!.advancedFunction!.tr, () {
|
||||
Get.toNamed(Routers.valueAddedServicesHighFunctionPage);
|
||||
TranslationLoader.lanKeys!.advancedFunction!.tr, () async {
|
||||
var isVip = await Storage.getBool(saveIsVip);
|
||||
if (isVip == null || !isVip) {
|
||||
Get.toNamed(Routers.advancedFeaturesWebPage);
|
||||
} else {
|
||||
Get.toNamed(Routers.valueAddedServicesHighFunctionPage);
|
||||
}
|
||||
}),
|
||||
// _valueAddedServicesItem(
|
||||
// Image.asset('images/mine/icon_mine_valueAddedServices_push.png'),
|
||||
@ -67,12 +85,12 @@ class _ValueAddedServicesPageListState
|
||||
Image.asset(
|
||||
'images/mine/icon_mine_valueAddedServices_storage.png'),
|
||||
TranslationLoader.lanKeys!.recordsRetention!.tr, () {
|
||||
EasyLoading.showToast("功能暂未开放",duration: 2000.milliseconds);
|
||||
EasyLoading.showToast("功能暂未开放", duration: 2000.milliseconds);
|
||||
}),
|
||||
_valueAddedServicesItem(
|
||||
Image.asset('images/mine/icon_mine_valueAddedServices_vip.png'),
|
||||
'可视对讲', () {
|
||||
EasyLoading.showToast("功能暂未开放",duration: 2000.milliseconds);
|
||||
EasyLoading.showToast("功能暂未开放", duration: 2000.milliseconds);
|
||||
}),
|
||||
_valueAddedServicesItem(
|
||||
Text(
|
||||
@ -83,7 +101,7 @@ class _ValueAddedServicesPageListState
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
"Amazon Alexa", () {
|
||||
EasyLoading.showToast("功能暂未开放",duration: 2000.milliseconds);
|
||||
EasyLoading.showToast("功能暂未开放", duration: 2000.milliseconds);
|
||||
}),
|
||||
_valueAddedServicesItem(
|
||||
Text(
|
||||
@ -94,7 +112,7 @@ class _ValueAddedServicesPageListState
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
"Google Home", () {
|
||||
EasyLoading.showToast("功能暂未开放",duration: 2000.milliseconds);
|
||||
EasyLoading.showToast("功能暂未开放", duration: 2000.milliseconds);
|
||||
}),
|
||||
],
|
||||
),
|
||||
|
||||
@ -0,0 +1 @@
|
||||
class ValueAddedServicesListState {}
|
||||
@ -220,7 +220,11 @@ abstract class Api {
|
||||
|
||||
final String getBuyRecordListURL = '/v2/service/getBuyRecordList'; //获取购买记录列表
|
||||
|
||||
final String getServicePackageURL = '/v2/service/getPackageUrl'; //增值服务套餐购包链接
|
||||
|
||||
final String getUseRecordListURL = '/v2/service/getUseRecordList'; //获取使用记录列表
|
||||
final String getlockCloudStorageListURL = '/lockCloudStorage/list'; //获取云存列表
|
||||
final String deleteLockCloudStorageURL = '/lockCloudStorage/delete'; //删除云存
|
||||
final String getServiceUserPackageURL =
|
||||
'/v2/service/getUserPackage'; //获取增值服务用户余量包
|
||||
}
|
||||
|
||||
@ -1989,6 +1989,14 @@ class ApiProvider extends BaseProvider {
|
||||
'pageNo': pageNo,
|
||||
'pageSize': pageSize,
|
||||
}));
|
||||
|
||||
// 增值服务套餐购包链接
|
||||
Future<Response> getServicePackageBuyUrl() =>
|
||||
post(getServicePackageURL.toUrl, jsonEncode({}));
|
||||
|
||||
// 获取增值服务用户余量包
|
||||
Future<Response> getServiceUserPackage() =>
|
||||
post(getServiceUserPackageURL.toUrl, jsonEncode({}));
|
||||
}
|
||||
|
||||
extension ExtensionString on String {
|
||||
|
||||
@ -26,6 +26,7 @@ import 'package:star_lock/mine/mineSet/lockUserManage/expireLockList/expireFinge
|
||||
import 'package:star_lock/mine/mineSet/lockUserManage/lockUserManageList/keyListByUserEntity.dart';
|
||||
import 'package:star_lock/mine/mineSet/mineSet/userSettingInfoEntity.dart';
|
||||
import 'package:star_lock/mine/mineSet/mineSet/weChatQRCodeEntity.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/advancedFeaturesWeb/advancedFeaturesWeb_entity.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRealName/face_authentication_entity.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRecord/buy_record_list_entity.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRecord/use_record_list_entity.dart';
|
||||
@ -2015,4 +2016,16 @@ class ApiRepository {
|
||||
final res = await apiProvider.getUseRecordList(type, pageNo, pageSize);
|
||||
return UseRecordListEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
// 增值服务套餐购包链接
|
||||
Future<AdvancedFeaturesWebEntity> getServicePackageBuyUrl() async {
|
||||
final res = await apiProvider.getServicePackageBuyUrl();
|
||||
return AdvancedFeaturesWebEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
// 获取增值服务用户余量包
|
||||
Future<AdvancedFeaturesWebEntity> getServiceUserPackage() async {
|
||||
final res = await apiProvider.getServiceUserPackage();
|
||||
return AdvancedFeaturesWebEntity.fromJson(res.body);
|
||||
}
|
||||
}
|
||||
|
||||
@ -22,6 +22,7 @@ const isAgreeCamera = "isAgreeCamera"; //是否同意获取相机/相册弹窗
|
||||
const isShowUpdateVersion = "isShowUpdateVersion"; //是否更新弹窗
|
||||
const saveLockAlias = "saveLockAlias"; //锁别名
|
||||
const pushDeviceID = 'pushDeviceID'; //推送设备ID
|
||||
const saveIsVip = "saveIsVip"; //是否是VIP
|
||||
|
||||
const saveUserLoginData = "userLoginData";
|
||||
const saveLockMainListData = "lockMainListData";
|
||||
@ -162,7 +163,7 @@ class Storage {
|
||||
static Future<String?> getMobile() async {
|
||||
LoginData? loginData = await getLoginData();
|
||||
String? mobile = loginData!.mobile;
|
||||
return mobile??'';
|
||||
return mobile ?? '';
|
||||
}
|
||||
|
||||
static Future<String?> getEmail() async {
|
||||
@ -205,9 +206,9 @@ class Storage {
|
||||
LockListInfoGroupEntity? lockListInfoGroupEntity;
|
||||
final data = await Storage.getString(saveLockMainListData);
|
||||
if (data != null && data.isNotEmpty) {
|
||||
lockListInfoGroupEntity = LockListInfoGroupEntity.fromJson(jsonDecode(data));
|
||||
lockListInfoGroupEntity =
|
||||
LockListInfoGroupEntity.fromJson(jsonDecode(data));
|
||||
}
|
||||
return lockListInfoGroupEntity;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user