2023-07-10 17:50:31 +08:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
|
import 'package:get/get.dart';
|
2024-05-30 11:53:25 +08:00
|
|
|
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
2024-03-12 16:35:40 +08:00
|
|
|
import 'package:star_lock/flavors.dart';
|
2024-05-20 17:12:34 +08:00
|
|
|
import 'package:star_lock/mine/mine/starLockMine_state.dart';
|
2024-09-02 18:09:57 +08:00
|
|
|
import 'package:star_lock/tools/wechat/customer_tool.dart';
|
2023-07-10 17:50:31 +08:00
|
|
|
|
2023-08-02 09:22:39 +08:00
|
|
|
import '../../appRouters.dart';
|
|
|
|
|
import '../../app_settings/app_colors.dart';
|
|
|
|
|
import '../../baseWidget.dart';
|
2024-04-09 15:21:10 +08:00
|
|
|
import '../../tools/customNetworkImage.dart';
|
2023-08-02 09:22:39 +08:00
|
|
|
import '../../tools/submitBtn.dart';
|
2024-09-02 18:09:57 +08:00
|
|
|
import '../../tools/wechat/wechatManageTool.dart';
|
2024-11-18 15:29:08 +08:00
|
|
|
import '../../tools/wechat/wx_push_miniProgram/wx_push_miniProgram.dart';
|
2023-08-02 09:22:39 +08:00
|
|
|
import 'starLockMine_logic.dart';
|
2023-07-10 17:50:31 +08:00
|
|
|
|
|
|
|
|
class StarLockMinePage extends StatefulWidget {
|
2023-07-15 15:11:28 +08:00
|
|
|
const StarLockMinePage({Key? key}) : super(key: key);
|
2023-07-10 17:50:31 +08:00
|
|
|
|
|
|
|
|
@override
|
2024-03-07 11:41:06 +08:00
|
|
|
State<StarLockMinePage> createState() => StarLockMinePageState();
|
2023-07-10 17:50:31 +08:00
|
|
|
}
|
|
|
|
|
|
2024-03-07 11:41:06 +08:00
|
|
|
GlobalKey<StarLockMinePageState> starLockMineKey = GlobalKey();
|
2023-07-27 15:26:30 +08:00
|
|
|
|
2024-03-07 11:41:06 +08:00
|
|
|
class StarLockMinePageState extends State<StarLockMinePage> with BaseWidget {
|
2024-05-20 17:12:34 +08:00
|
|
|
final StarLockMineLogic logic = Get.put(StarLockMineLogic());
|
|
|
|
|
final StarLockMineState state = Get.find<StarLockMineLogic>().state;
|
2023-08-02 09:22:39 +08:00
|
|
|
|
2024-04-28 14:12:50 +08:00
|
|
|
@override
|
2024-06-06 17:42:03 +08:00
|
|
|
void initState() {
|
2024-04-28 14:12:50 +08:00
|
|
|
super.initState();
|
|
|
|
|
logic.getUserInfoRequest();
|
|
|
|
|
}
|
|
|
|
|
|
2023-07-10 17:50:31 +08:00
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return Scaffold(
|
|
|
|
|
backgroundColor: const Color(0xFFFFFFFF),
|
|
|
|
|
body: Column(
|
2024-05-20 17:12:34 +08:00
|
|
|
children: <Widget>[
|
2023-07-10 17:50:31 +08:00
|
|
|
topWidget(),
|
2023-07-15 15:11:28 +08:00
|
|
|
bottomListWidget(),
|
2024-03-05 09:29:49 +08:00
|
|
|
SizedBox(
|
2024-12-04 13:55:58 +08:00
|
|
|
height: 80.h,
|
2024-11-18 15:29:08 +08:00
|
|
|
),
|
|
|
|
|
GestureDetector(
|
|
|
|
|
onTap: () {
|
|
|
|
|
WechatManageTool.getAppInfo(() {
|
|
|
|
|
WxPushWeChatMiniProgramTool.pushWeChatMiniProgram(
|
2025-02-07 15:27:06 +08:00
|
|
|
F.wechatAppInfo.wechatAppId, F.wechatAppInfo.universalLink);
|
2024-11-18 15:29:08 +08:00
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: EdgeInsets.only(left: 20.w, right: 20.w),
|
|
|
|
|
child: Image.asset(
|
|
|
|
|
'images/mine/icon_mine_wan_miniprogram.png',
|
|
|
|
|
// width: 400.w,
|
|
|
|
|
// height: 151.h,
|
|
|
|
|
fit: BoxFit.fill,
|
|
|
|
|
),
|
|
|
|
|
),
|
2024-03-05 09:29:49 +08:00
|
|
|
),
|
2023-07-10 17:50:31 +08:00
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2023-07-27 15:26:30 +08:00
|
|
|
Widget topWidget() {
|
2023-07-10 17:50:31 +08:00
|
|
|
return Container(
|
2023-07-27 15:26:30 +08:00
|
|
|
height: 380.h,
|
2023-07-10 17:50:31 +08:00
|
|
|
width: 1.sw,
|
|
|
|
|
color: AppColors.mainColor,
|
|
|
|
|
// color: Colors.red,
|
2023-07-27 15:26:30 +08:00
|
|
|
child: Stack(
|
2024-05-20 17:12:34 +08:00
|
|
|
children: <Widget>[
|
2023-07-27 15:26:30 +08:00
|
|
|
Image.asset(
|
|
|
|
|
'images/mine/icon_mine_topBg.png',
|
|
|
|
|
width: 400.w,
|
|
|
|
|
height: 380.h,
|
|
|
|
|
fit: BoxFit.fill,
|
|
|
|
|
),
|
2024-04-03 16:50:42 +08:00
|
|
|
Center(
|
2024-04-28 14:12:50 +08:00
|
|
|
child: Column(
|
2024-05-20 17:12:34 +08:00
|
|
|
children: <Widget>[
|
2024-04-28 14:12:50 +08:00
|
|
|
SizedBox(
|
|
|
|
|
height: 120.h,
|
|
|
|
|
),
|
|
|
|
|
GestureDetector(
|
|
|
|
|
onTap: () {
|
|
|
|
|
Get.back();
|
|
|
|
|
Get.toNamed(Routers.minePersonInfoPage);
|
|
|
|
|
},
|
2024-04-29 14:59:25 +08:00
|
|
|
child: Obx(() => SizedBox(
|
2024-04-10 13:36:00 +08:00
|
|
|
width: 105.w,
|
|
|
|
|
height: 105.w,
|
|
|
|
|
child: ClipRRect(
|
|
|
|
|
borderRadius: BorderRadius.circular(52.5.w),
|
2024-04-28 14:12:50 +08:00
|
|
|
child: CustomNetworkImage(
|
2024-06-03 13:50:07 +08:00
|
|
|
url: state.userHeadUrl.value,
|
2024-04-30 13:41:34 +08:00
|
|
|
defaultUrl: 'images/controls_user.png',
|
|
|
|
|
width: 105.w,
|
|
|
|
|
height: 105.h,
|
|
|
|
|
),
|
2024-04-10 13:36:00 +08:00
|
|
|
),
|
|
|
|
|
)),
|
2024-04-28 14:12:50 +08:00
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 20.h,
|
|
|
|
|
),
|
2024-04-29 15:36:11 +08:00
|
|
|
Obx(() => GestureDetector(
|
|
|
|
|
onTap: () {
|
2024-05-18 14:54:44 +08:00
|
|
|
if (!state.isVip.value) {
|
2024-05-22 17:49:34 +08:00
|
|
|
// if (CommonDataManage().currentKeyInfo.isLockOwner !=
|
|
|
|
|
// 1) {
|
|
|
|
|
// logic.showToast('请先添加锁');
|
|
|
|
|
// } else {
|
|
|
|
|
Get.toNamed(Routers.advancedFeaturesWebPage,
|
2024-06-03 13:50:07 +08:00
|
|
|
arguments: <String, int>{
|
2024-05-30 11:53:25 +08:00
|
|
|
'webBuyType': XSConstantMacro.webBuyTypeVip,
|
|
|
|
|
});
|
2024-05-22 17:49:34 +08:00
|
|
|
// }
|
2024-04-29 15:36:11 +08:00
|
|
|
} else {
|
|
|
|
|
Get.toNamed(
|
|
|
|
|
Routers.valueAddedServicesHighFunctionPage);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
child: Container(
|
|
|
|
|
color: Colors.transparent,
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
2024-05-20 17:12:34 +08:00
|
|
|
children: <Widget>[
|
2024-04-29 15:36:11 +08:00
|
|
|
Text(
|
|
|
|
|
state.userNickName.value.isNotEmpty
|
|
|
|
|
? state.userNickName.value
|
|
|
|
|
: (state.userMobile.value.isNotEmpty
|
|
|
|
|
? state.userMobile.value
|
|
|
|
|
: state.userEmail.value),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 22.sp,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
)),
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 5.w,
|
|
|
|
|
),
|
2024-05-20 17:12:34 +08:00
|
|
|
if (!state.isVip.value)
|
|
|
|
|
Image.asset(
|
|
|
|
|
'images/mine/icon_mine_noPlus.png',
|
|
|
|
|
width: 20.w,
|
|
|
|
|
height: 20.w,
|
|
|
|
|
)
|
|
|
|
|
else
|
|
|
|
|
Image.asset(
|
|
|
|
|
'images/mine/icon_mine_isPlus.png',
|
|
|
|
|
width: 20.w,
|
|
|
|
|
height: 20.w,
|
|
|
|
|
),
|
2024-04-29 15:36:11 +08:00
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
))
|
2024-04-28 14:12:50 +08:00
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
2023-07-10 17:50:31 +08:00
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2023-07-27 15:26:30 +08:00
|
|
|
Widget bottomListWidget() {
|
2024-12-04 13:55:58 +08:00
|
|
|
return Container(
|
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
|
left: 60.w,
|
|
|
|
|
top: 50.h,
|
|
|
|
|
),
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
2024-11-26 17:46:54 +08:00
|
|
|
mineItem('images/mine/icon_mine_main_addLock.png', '添加设备'.tr, () {
|
2024-01-06 16:26:13 +08:00
|
|
|
Get.back();
|
2024-01-23 17:48:06 +08:00
|
|
|
Get.toNamed(Routers.selectLockTypePage);
|
2023-07-15 15:11:28 +08:00
|
|
|
}),
|
2023-07-27 15:26:30 +08:00
|
|
|
// mineItem('images/mine/icon_mine_main_gateway.png',
|
|
|
|
|
// TranslationLoader.lanKeys!.gateway!.tr, () {
|
|
|
|
|
// Navigator.pushNamed(context, Routers.gatewayListPage);
|
|
|
|
|
// }),
|
2024-11-26 17:46:54 +08:00
|
|
|
mineItem('images/mine/icon_mine_main_message.png', '消息'.tr, () {
|
2024-01-06 16:26:13 +08:00
|
|
|
Get.back();
|
2023-11-18 10:38:13 +08:00
|
|
|
Get.toNamed(Routers.messageListPage);
|
2023-10-17 15:48:32 +08:00
|
|
|
// Toast.show(msg: "功能暂未开放");
|
2023-07-10 17:50:31 +08:00
|
|
|
}),
|
2023-10-13 09:20:28 +08:00
|
|
|
//删除“客服”行
|
|
|
|
|
// mineItem('images/mine/icon_mine_main_supportStaff.png',
|
|
|
|
|
// TranslationLoader.lanKeys!.supportStaff!.tr, () {
|
|
|
|
|
// Navigator.pushNamed(context, Routers.supportStaffPage);
|
|
|
|
|
// }),
|
2024-11-26 17:46:54 +08:00
|
|
|
mineItem('images/mine/icon_mine_main_set.png', '设置'.tr, () {
|
2024-01-06 16:26:13 +08:00
|
|
|
Get.back();
|
2023-11-18 10:38:13 +08:00
|
|
|
Get.toNamed(Routers.mineSetPage);
|
2023-07-10 17:50:31 +08:00
|
|
|
}),
|
2024-03-13 13:49:04 +08:00
|
|
|
//上架审核
|
2024-12-16 16:43:29 +08:00
|
|
|
// if (F.isLite)
|
|
|
|
|
// Container()
|
|
|
|
|
// else
|
|
|
|
|
mineItem('images/mine/icon_mine_main_vip.png', '增值服务'.tr, () {
|
|
|
|
|
Get.back();
|
|
|
|
|
Get.toNamed(Routers.valueAddedServicesPage);
|
|
|
|
|
}),
|
|
|
|
|
// if (F.isLite)
|
|
|
|
|
// Container()
|
|
|
|
|
// else
|
|
|
|
|
mineItem('images/mine/icon_mine_main_shoppingcart.png', '配件商城'.tr,
|
|
|
|
|
() {
|
|
|
|
|
Get.back();
|
|
|
|
|
Get.toNamed(Routers.lockMallPage);
|
|
|
|
|
}),
|
2024-12-04 13:55:58 +08:00
|
|
|
if (F.isSKY && Get.locale!.languageCode == 'zh')
|
|
|
|
|
mineItem('images/mine/icon_mine_main_supportStaff.png', '客服'.tr,
|
2024-11-26 17:46:54 +08:00
|
|
|
() {
|
2024-11-18 15:29:08 +08:00
|
|
|
Get.back();
|
2024-09-02 18:09:57 +08:00
|
|
|
WechatManageTool.getAppInfo(CustomerTool.openCustomerService);
|
2024-11-18 15:29:08 +08:00
|
|
|
}),
|
2024-09-02 18:09:57 +08:00
|
|
|
mineItem('images/mine/icon_mine_main_about.png', '关于'.tr, () {
|
2024-03-05 09:29:49 +08:00
|
|
|
Get.back();
|
|
|
|
|
Get.toNamed(Routers.aboutPage);
|
2023-07-10 17:50:31 +08:00
|
|
|
}),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2024-12-04 13:55:58 +08:00
|
|
|
// Widget keyBottomWidget() {
|
|
|
|
|
// return Column(
|
|
|
|
|
// children: <Widget>[
|
|
|
|
|
// SubmitBtn(
|
|
|
|
|
// btnName: '退出'.tr,
|
|
|
|
|
// borderRadius: 20.w,
|
|
|
|
|
// fontSize: 32.sp,
|
|
|
|
|
// margin: EdgeInsets.only(left: 60.w, right: 60.w),
|
|
|
|
|
// padding: EdgeInsets.only(top: 15.w, bottom: 15.w),
|
|
|
|
|
// onClick: () {}),
|
|
|
|
|
// Container(
|
|
|
|
|
// padding: EdgeInsets.only(right: 30.w),
|
|
|
|
|
// // color: Colors.red,
|
|
|
|
|
// child: Row(
|
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
|
// children: <Widget>[
|
|
|
|
|
// TextButton(
|
|
|
|
|
// child: Text(
|
|
|
|
|
// '删除账号'.tr,
|
|
|
|
|
// style: TextStyle(
|
|
|
|
|
// color: AppColors.mainColor, fontWeight: FontWeight.w500),
|
|
|
|
|
// ),
|
|
|
|
|
// onPressed: () {},
|
|
|
|
|
// ),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// SizedBox(
|
|
|
|
|
// height: 30.h,
|
|
|
|
|
// )
|
|
|
|
|
// ],
|
|
|
|
|
// );
|
|
|
|
|
// }
|
2023-07-15 15:11:28 +08:00
|
|
|
|
2023-07-27 15:26:30 +08:00
|
|
|
Widget mineItem(
|
|
|
|
|
String lockTypeIcon, String lockTypeTitle, Function() action) {
|
2023-07-10 17:50:31 +08:00
|
|
|
return GestureDetector(
|
|
|
|
|
onTap: action,
|
|
|
|
|
child: Row(
|
2024-05-20 17:12:34 +08:00
|
|
|
children: <Widget>[
|
2023-07-10 17:50:31 +08:00
|
|
|
Center(
|
|
|
|
|
child: Container(
|
2023-07-21 19:31:01 +08:00
|
|
|
// height: 80.h,
|
2023-07-27 15:26:30 +08:00
|
|
|
width: 330.w,
|
2023-07-21 19:31:01 +08:00
|
|
|
padding: EdgeInsets.all(20.h),
|
2023-07-10 17:50:31 +08:00
|
|
|
color: Colors.white,
|
|
|
|
|
child: Row(
|
2024-05-20 17:12:34 +08:00
|
|
|
children: <Widget>[
|
2023-07-27 15:26:30 +08:00
|
|
|
Image.asset(
|
|
|
|
|
lockTypeIcon,
|
|
|
|
|
width: 28.w,
|
|
|
|
|
height: 28.w,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(width: 15.w),
|
|
|
|
|
Text(
|
|
|
|
|
lockTypeTitle,
|
|
|
|
|
style: TextStyle(fontSize: 22.sp),
|
|
|
|
|
),
|
2023-07-10 17:50:31 +08:00
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
2023-07-27 15:26:30 +08:00
|
|
|
Container(
|
|
|
|
|
height: 0.5.h,
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
)
|
2023-07-10 17:50:31 +08:00
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|