1,新增云存部分跳转和接口
This commit is contained in:
parent
92d5a3b473
commit
ac2604a95b
@ -1060,7 +1060,9 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
TranslationLoader.lanKeys!.videoLog!.tr,
|
||||
state.openDoorBtnisUneable.value,
|
||||
state.bottomBtnisEable.value, () {
|
||||
Get.toNamed(Routers.videoLogPage);
|
||||
Get.toNamed(Routers.videoLogPage, arguments: {
|
||||
"lockId": state.keyInfos.value.lockId,
|
||||
});
|
||||
}));
|
||||
}
|
||||
endWiddget.add(
|
||||
|
||||
@ -1,8 +1,17 @@
|
||||
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import 'videoLog_state.dart';
|
||||
|
||||
class VideoLogLogic extends BaseGetXController {
|
||||
VideoLogState state = VideoLogState();
|
||||
|
||||
void getLockCloudStorageList() async {
|
||||
var entity = await ApiRepository.to.getLockCloudStorageList(
|
||||
lockId: state.getLockId.value,
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
state.videoLogList.value = entity.data!.list!;
|
||||
state.videoLogList.refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,4 +1,3 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
@ -20,6 +19,12 @@ class _VideoLogPageState extends State<VideoLogPage> {
|
||||
final logic = Get.put(VideoLogLogic());
|
||||
final state = Get.find<VideoLogLogic>().state;
|
||||
|
||||
@override
|
||||
initState() {
|
||||
super.initState();
|
||||
logic.getLockCloudStorageList();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
@ -33,15 +38,9 @@ class _VideoLogPageState extends State<VideoLogPage> {
|
||||
body: Column(
|
||||
children: [
|
||||
// 云存顶部
|
||||
Visibility(
|
||||
visible: !state.isNavLocal.value,
|
||||
child: vipTip()
|
||||
),
|
||||
Visibility(visible: !state.isNavLocal.value, child: vipTip()),
|
||||
// 本地顶部
|
||||
Visibility(
|
||||
visible: state.isNavLocal.value,
|
||||
child: localTip()
|
||||
),
|
||||
Visibility(visible: state.isNavLocal.value, child: localTip()),
|
||||
// title加编辑按钮
|
||||
editVideoTip(),
|
||||
Visibility(
|
||||
@ -50,39 +49,41 @@ class _VideoLogPageState extends State<VideoLogPage> {
|
||||
child: ListView.builder(
|
||||
itemCount: 5,
|
||||
itemBuilder: (c, index) {
|
||||
return Column(children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(left:20.w, top: 15.w, bottom: 15.w),
|
||||
child: Row(
|
||||
return Column(
|
||||
children: [
|
||||
Text("2023.10.2$index", style: TextStyle(fontSize: 20.sp)),
|
||||
]
|
||||
)),
|
||||
Container(
|
||||
margin: EdgeInsets.only(
|
||||
left: 20.w, top: 15.w, bottom: 15.w),
|
||||
child: Row(children: [
|
||||
Text("2023.10.2$index",
|
||||
style: TextStyle(fontSize: 20.sp)),
|
||||
])),
|
||||
mainListView(index)
|
||||
],);
|
||||
})
|
||||
)
|
||||
),
|
||||
],
|
||||
);
|
||||
}))),
|
||||
// 本地顶部
|
||||
Visibility(
|
||||
visible: state.isNavLocal.value,
|
||||
child: Expanded(
|
||||
child: state.localList.isNotEmpty ? ListView.builder(
|
||||
child: state.localList.isNotEmpty
|
||||
? ListView.builder(
|
||||
itemCount: 5,
|
||||
itemBuilder: (c, index) {
|
||||
return Column(children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(left:20.w, top: 15.w, bottom: 15.w),
|
||||
child: Row(
|
||||
return Column(
|
||||
children: [
|
||||
Text("2023.10.2$index", style: TextStyle(fontSize: 20.sp)),
|
||||
]
|
||||
)),
|
||||
Container(
|
||||
margin: EdgeInsets.only(
|
||||
left: 20.w, top: 15.w, bottom: 15.w),
|
||||
child: Row(children: [
|
||||
Text("2023.10.2$index",
|
||||
style: TextStyle(fontSize: 20.sp)),
|
||||
])),
|
||||
mainListView(index)
|
||||
],);
|
||||
}): NoData()
|
||||
)
|
||||
),
|
||||
],
|
||||
);
|
||||
})
|
||||
: NoData())),
|
||||
],
|
||||
),
|
||||
);
|
||||
@ -103,10 +104,15 @@ class _VideoLogPageState extends State<VideoLogPage> {
|
||||
});
|
||||
},
|
||||
child: Obx(() => Text("云存",
|
||||
style: state.isNavLocal.value == true ?
|
||||
TextStyle(color: Colors.grey, fontSize: 26.sp, fontWeight: FontWeight.w600) :
|
||||
TextStyle(color: Colors.white, fontSize: 28.sp, fontWeight: FontWeight.w600)))
|
||||
),
|
||||
style: state.isNavLocal.value == true
|
||||
? TextStyle(
|
||||
color: Colors.grey,
|
||||
fontSize: 26.sp,
|
||||
fontWeight: FontWeight.w600)
|
||||
: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 28.sp,
|
||||
fontWeight: FontWeight.w600)))),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
@ -114,10 +120,15 @@ class _VideoLogPageState extends State<VideoLogPage> {
|
||||
});
|
||||
},
|
||||
child: Obx(() => Text("本地",
|
||||
style: state.isNavLocal.value == true ?
|
||||
TextStyle(color: Colors.white, fontSize: 28.sp, fontWeight: FontWeight.w600) :
|
||||
TextStyle(color: Colors.grey, fontSize: 26.sp, fontWeight: FontWeight.w600)))
|
||||
),
|
||||
style: state.isNavLocal.value == true
|
||||
? TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 28.sp,
|
||||
fontWeight: FontWeight.w600)
|
||||
: TextStyle(
|
||||
color: Colors.grey,
|
||||
fontSize: 26.sp,
|
||||
fontWeight: FontWeight.w600)))),
|
||||
],
|
||||
),
|
||||
);
|
||||
@ -132,24 +143,29 @@ class _VideoLogPageState extends State<VideoLogPage> {
|
||||
child: Container(
|
||||
height: 150.h,
|
||||
margin: EdgeInsets.all(15.w),
|
||||
padding: EdgeInsets.only(left:20.w, top:20.w, bottom:20.w, right: 10.w),
|
||||
padding:
|
||||
EdgeInsets.only(left: 20.w, top: 20.w, bottom: 20.w, right: 10.w),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFFF6F7F8),
|
||||
borderRadius: BorderRadius.circular(20.h)
|
||||
),
|
||||
borderRadius: BorderRadius.circular(20.h)),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(child: Column(
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text("3天滚动储存", style: TextStyle(fontSize: 24.sp)),
|
||||
SizedBox(height: 10.h),
|
||||
Text("星锁已为本设备免费提供3大滚动视频储存服务", style: TextStyle(fontSize: 22.sp, color: Colors.grey)),
|
||||
Text("星锁已为本设备免费提供3大滚动视频储存服务",
|
||||
style: TextStyle(fontSize: 22.sp, color: Colors.grey)),
|
||||
],
|
||||
)),
|
||||
SizedBox(width: 15.w),
|
||||
Text("去升级", style: TextStyle(fontSize: 22.sp)),
|
||||
Image(width: 40.w, height: 24.w, image: const AssetImage("images/icon_right_black.png"))
|
||||
Image(
|
||||
width: 40.w,
|
||||
height: 24.w,
|
||||
image: const AssetImage("images/icon_right_black.png"))
|
||||
],
|
||||
),
|
||||
),
|
||||
@ -165,25 +181,30 @@ class _VideoLogPageState extends State<VideoLogPage> {
|
||||
child: Container(
|
||||
// height: 130.h,
|
||||
margin: EdgeInsets.all(15.w),
|
||||
padding: EdgeInsets.only(left:20.w, top:30.w, bottom:30.w, right: 10.w),
|
||||
padding:
|
||||
EdgeInsets.only(left: 20.w, top: 30.w, bottom: 30.w, right: 10.w),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFFF6F7F8),
|
||||
borderRadius: BorderRadius.circular(20.h)
|
||||
),
|
||||
borderRadius: BorderRadius.circular(20.h)),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(child: Column(
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
// SizedBox(height: 20.h),
|
||||
Text("下载列表", style: TextStyle(fontSize: 24.sp)),
|
||||
SizedBox(height: 15.h),
|
||||
Text("暂无下载内容", style: TextStyle(fontSize: 22.sp, color: Colors.grey)),
|
||||
Text("暂无下载内容",
|
||||
style: TextStyle(fontSize: 22.sp, color: Colors.grey)),
|
||||
],
|
||||
)),
|
||||
SizedBox(width: 15.w),
|
||||
// Text("去升级", style: TextStyle(fontSize: 24.sp)),
|
||||
Image(width: 40.w, height: 24.w, image: const AssetImage("images/icon_right_black.png"))
|
||||
Image(
|
||||
width: 40.w,
|
||||
height: 24.w,
|
||||
image: const AssetImage("images/icon_right_black.png"))
|
||||
],
|
||||
),
|
||||
),
|
||||
@ -197,12 +218,18 @@ class _VideoLogPageState extends State<VideoLogPage> {
|
||||
child: Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(state.isNavLocal.value == true ? "已下载":"全部视频", style: TextStyle(fontSize: 26.sp, fontWeight: FontWeight.w500)),
|
||||
Text(state.isNavLocal.value == true ? "已下载" : "全部视频",
|
||||
style: TextStyle(fontSize: 26.sp, fontWeight: FontWeight.w500)),
|
||||
Expanded(child: SizedBox(width: 10.w)),
|
||||
IconButton(
|
||||
icon: Image(width: 40.w, height: 40.w, image: const AssetImage("images/main/icon_lockDetail_monitoringEditVoice.png")),
|
||||
icon: Image(
|
||||
width: 40.w,
|
||||
height: 40.w,
|
||||
image: const AssetImage(
|
||||
"images/main/icon_lockDetail_monitoringEditVoice.png")),
|
||||
iconSize: 30,
|
||||
color: Colors.black54, onPressed: () {
|
||||
color: Colors.black54,
|
||||
onPressed: () {
|
||||
Get.toNamed(Routers.editVideoLogPage);
|
||||
},
|
||||
)
|
||||
@ -235,8 +262,7 @@ class _VideoLogPageState extends State<VideoLogPage> {
|
||||
// 横轴间距
|
||||
crossAxisSpacing: 15.w,
|
||||
//子组件宽高长度比例
|
||||
childAspectRatio: itemW/itemH
|
||||
),
|
||||
childAspectRatio: itemW / itemH),
|
||||
itemBuilder: (context, index) {
|
||||
return videoItem(() {
|
||||
Get.toNamed(Routers.videoLogDetailPage);
|
||||
@ -255,7 +281,12 @@ class _VideoLogPageState extends State<VideoLogPage> {
|
||||
children: [
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadius.circular(10.w),
|
||||
child: Image(width: itemW, height: itemW, fit: BoxFit.fill, image: const AssetImage("images/main/icon_lockDetail_monitoringvoiceFrist.png")),
|
||||
child: Image(
|
||||
width: itemW,
|
||||
height: itemW,
|
||||
fit: BoxFit.fill,
|
||||
image: const AssetImage(
|
||||
"images/main/icon_lockDetail_monitoringvoiceFrist.png")),
|
||||
),
|
||||
SizedBox(height: 5.h),
|
||||
Text("2023.10.23 10:00", style: TextStyle(fontSize: 20.sp))
|
||||
@ -264,5 +295,4 @@ class _VideoLogPageState extends State<VideoLogPage> {
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,8 +1,15 @@
|
||||
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class VideoLogState {
|
||||
|
||||
var isNavLocal = false.obs;
|
||||
var localList = [];
|
||||
var getLockId = 0.obs;
|
||||
var videoLogList = [].obs;
|
||||
|
||||
VideoLogState() {
|
||||
Map map = Get.arguments;
|
||||
if (map['lockId'] != null) {
|
||||
getLockId.value = map['lockId'];
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -221,4 +221,5 @@ abstract class Api {
|
||||
final String getBuyRecordListURL = '/v2/service/getBuyRecordList'; //获取购买记录列表
|
||||
|
||||
final String getUseRecordListURL = '/v2/service/getUseRecordList'; //获取使用记录列表
|
||||
final String getlockCloudStorageListURL = '/lockCloudStorage/list'; //获取云存列表
|
||||
}
|
||||
|
||||
@ -1942,6 +1942,10 @@ class ApiProvider extends BaseProvider {
|
||||
jsonEncode(
|
||||
{'lockId': lockId, 'pageNo': pageNo, 'pageSize': pageSize}));
|
||||
|
||||
// 获取云存列表
|
||||
Future<Response> getLockCloudStorageList(int lockId) =>
|
||||
post(getlockCloudStorageListURL.toUrl, jsonEncode({'lockId': lockId}));
|
||||
|
||||
// 设置微信公众号推送
|
||||
Future<Response> setMpWechatPushSwitch(int mpWechatPushSwitch) => post(
|
||||
setWechatPushSwitchURL.toUrl,
|
||||
|
||||
@ -1960,6 +1960,13 @@ class ApiRepository {
|
||||
return CoerceFingerprintListEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
// 获取云存列表
|
||||
Future<CoerceFingerprintListEntity> getLockCloudStorageList(
|
||||
{required int lockId}) async {
|
||||
final res = await apiProvider.getLockCloudStorageList(lockId);
|
||||
return CoerceFingerprintListEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
// 设置微信公众号推送
|
||||
Future<VersionUndateEntity> setMpWechatPushSwitch(
|
||||
{required int mpWechatPushSwitch}) async {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user