未实名拦截

pull/1/head
张萌 3 years ago
parent 2266db00cf
commit 052302c2a6

@ -563,7 +563,7 @@ class _HomePageState extends State<HomePage>
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
if (LoginUtil.isNotLogin) return; if (LoginUtil.isNotLogin) return;
if (ao.title != '全部应用' && !LoginUtil.haveRealName(ao.title)) return; // if (ao.title != '全部应用' && !LoginUtil.haveRealName(ao.title)) return;
if (ao.callback == null) { if (ao.callback == null) {
BotToast.showText( BotToast.showText(
text: '该功能正在准备上线中,敬请期待', align: Alignment(0, 0.5)); text: '该功能正在准备上线中,敬请期待', align: Alignment(0, 0.5));

@ -10,11 +10,8 @@ import 'package:sms_autofill/sms_autofill.dart';
import 'package:velocity_x/src/extensions/string_ext.dart'; import 'package:velocity_x/src/extensions/string_ext.dart';
class InputPayPasswordDialog extends StatefulWidget { class InputPayPasswordDialog extends StatefulWidget {
final int balance;
const InputPayPasswordDialog({ const InputPayPasswordDialog({
Key? key, Key? key,
required this.balance,
}) : super(key: key); }) : super(key: key);
@override @override
@ -58,16 +55,7 @@ class _InputPayPasswordDialogState extends State<InputPayPasswordDialog> {
codeLength: 6, codeLength: 6,
onCodeChanged: (code) async { onCodeChanged: (code) async {
if ((code?.length ?? 0) >= 6) { if ((code?.length ?? 0) >= 6) {
Get.back(); Get.back(result: code!);
var base = await NetUtil()
.post(SAASAPI.balance.buyPointsByBalance, params: {
'balance': widget.balance,
'balancePayPwd': code
});
Get.back();
if (!base.success) {
BotToast.showText(text: base.msg);
}
} }
_currentCode = code; _currentCode = code;
}, },

@ -192,8 +192,15 @@ class _PayWayDialogState extends State<PayWayDialog> {
Get.dialog(SetPayPasswordDialog()); Get.dialog(SetPayPasswordDialog());
} else { } else {
Get.back(); Get.back();
Get.dialog( var psd = await Get.dialog(
InputPayPasswordDialog(balance: widget.amount)); InputPayPasswordDialog());
await NetUtil().post(
SAASAPI.balance.buyPointsByBalance,
params: {
'balance': widget.amount,
'balancePayPwd': psd
},
showMessage: true);
} }
return; return;
} }

@ -138,13 +138,10 @@ class _TabNavigatorState extends State<TabNavigator>
// //
Get.offAll(() => OtherLoginPage()); Get.offAll(() => OtherLoginPage());
} else {} } else {}
if (UserTool.userProvider.userInfoModel?.name == null) {
Get.dialog(CertificationDialog());
} else {
_tabController!.animateTo(2, curve: Curves.easeInOutCubic); _tabController!.animateTo(2, curve: Curves.easeInOutCubic);
_currentIndex = 2; _currentIndex = 2;
setState(() {}); setState(() {});
}
}, },
child: Material( child: Material(
color: Colors.transparent, color: Colors.transparent,

@ -1,3 +1,4 @@
import 'package:aku_new_community/extensions/num_ext.dart';
import 'package:aku_new_community/gen/assets.gen.dart'; import 'package:aku_new_community/gen/assets.gen.dart';
import 'package:aku_new_community/saas_model/task/hall_list_model.dart'; import 'package:aku_new_community/saas_model/task/hall_list_model.dart';
import 'package:aku_new_community/widget/bee_divider.dart'; import 'package:aku_new_community/widget/bee_divider.dart';
@ -98,6 +99,7 @@ class HallCard extends StatelessWidget {
), ),
padding: EdgeInsets.symmetric(horizontal: 24.w, vertical: 24.w), padding: EdgeInsets.symmetric(horizontal: 24.w, vertical: 24.w),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
head, head,
24.w.heightBox, 24.w.heightBox,
@ -164,6 +166,7 @@ class HallCard extends StatelessWidget {
), ),
24.w.heightBox, 24.w.heightBox,
BeeDivider.horizontal(), BeeDivider.horizontal(),
20.hb,
_cardBottom() _cardBottom()
], ],
), ),

@ -3,6 +3,8 @@ import 'dart:io';
import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/base/base_style.dart';
import 'package:aku_new_community/constants/saas_api.dart'; import 'package:aku_new_community/constants/saas_api.dart';
import 'package:aku_new_community/gen/assets.gen.dart'; import 'package:aku_new_community/gen/assets.gen.dart';
import 'package:aku_new_community/pages/personal/wallet/input_pay_password_dialog.dart';
import 'package:aku_new_community/pages/personal/wallet/set_pay_password_dialog.dart';
import 'package:aku_new_community/ui/function_and_service/task/task_func.dart'; import 'package:aku_new_community/ui/function_and_service/task/task_func.dart';
import 'package:aku_new_community/ui/function_and_service/task/task_map.dart'; import 'package:aku_new_community/ui/function_and_service/task/task_map.dart';
import 'package:aku_new_community/ui/function_and_service/task/task_remark_page.dart'; import 'package:aku_new_community/ui/function_and_service/task/task_remark_page.dart';
@ -12,6 +14,7 @@ import 'package:aku_new_community/widget/bee_divider.dart';
import 'package:aku_new_community/widget/bee_record_voice_widget.dart'; import 'package:aku_new_community/widget/bee_record_voice_widget.dart';
import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart';
import 'package:aku_new_community/widget/buttons/bee_long_button.dart'; import 'package:aku_new_community/widget/buttons/bee_long_button.dart';
import 'package:aku_new_community/widget/others/user_tool.dart';
import 'package:aku_new_community/widget/picker/bee_date_picker.dart'; import 'package:aku_new_community/widget/picker/bee_date_picker.dart';
import 'package:aku_new_community/widget/picker/bee_pick_image_widget.dart'; import 'package:aku_new_community/widget/picker/bee_pick_image_widget.dart';
import 'package:aku_new_community/widget/picker/bee_picker_box.dart'; import 'package:aku_new_community/widget/picker/bee_picker_box.dart';
@ -118,6 +121,21 @@ class _PublishTaskPageState extends State<PublishTaskPage> {
if (!canTap) { if (!canTap) {
return; return;
} }
var psdCode = '';
if (_rewardType == 1) {
var balance = int.parse(_rewardController.text.trim());
if (balance >
(UserTool.userProvider.userInfoModel!.balance ?? 0)) {
BotToast.showText(text: '余额不足,请前往充值');
} else {
if (!UserTool.userProvider.userInfoModel!.isBalancePayPwd) {
Get.dialog(SetPayPasswordDialog());
} else {
psdCode = await Get.dialog(InputPayPasswordDialog());
}
}
}
var cancel = BotToast.showLoading(); var cancel = BotToast.showLoading();
var _voiceUrl; var _voiceUrl;
if (_voiceUri != null) { if (_voiceUri != null) {
@ -159,7 +177,8 @@ class _PublishTaskPageState extends State<PublishTaskPage> {
voiceUrl: _voiceUrl, voiceUrl: _voiceUrl,
imgUrls: imgs, imgUrls: imgs,
rewardType: _rewardType, rewardType: _rewardType,
reward: _rewardController.text); reward: _rewardController.text,
psd: psdCode);
if (re) { if (re) {
Get.back(); Get.back();
} }

@ -20,6 +20,7 @@ class TaskFunc {
required List<String> imgUrls, required List<String> imgUrls,
required int rewardType, required int rewardType,
required String reward, required String reward,
required String psd,
}) async { }) async {
var base = await NetUtil().post(SAASAPI.task.insert, var base = await NetUtil().post(SAASAPI.task.insert,
params: { params: {
@ -39,6 +40,7 @@ class TaskFunc {
'imgUrls': imgUrls, 'imgUrls': imgUrls,
'rewardType': rewardType, 'rewardType': rewardType,
'reward': reward, 'reward': reward,
'balancePayPwd':psd,
}, },
showMessage: true); showMessage: true);
return base.success; return base.success;

@ -38,7 +38,7 @@ class _AllApplicationPageState extends State<AllApplicationPage> {
? null ? null
: () { : () {
if (LoginUtil.isNotLogin) return; if (LoginUtil.isNotLogin) return;
if (!LoginUtil.haveRealName(object.title)) return; // if (!LoginUtil.haveRealName(object.title)) return;
if (object.callback == null || !online) { if (object.callback == null || !online) {
BotToast.showText( BotToast.showText(
text: '正在准备上线中,敬请期待', align: Alignment(0, 0.5)); text: '正在准备上线中,敬请期待', align: Alignment(0, 0.5));

@ -140,11 +140,7 @@ class _MyFamilyPageState extends State<MyFamilyPage>
child: AddHouseButton( child: AddHouseButton(
text: '添加房屋', text: '添加房屋',
onTap: () async { onTap: () async {
if (UserTool.userProvider.userInfoModel?.name == null) {
await Get.dialog(CertificationDialog());
} else {
Get.to(() => AddHousePage()); Get.to(() => AddHousePage());
}
}), }),
) )
: SizedBox(), : SizedBox(),

@ -76,11 +76,8 @@ class _MyHousePageState extends State<MyHousePage> {
padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 32.w), padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 32.w),
child: AddHouseButton( child: AddHouseButton(
onTap: () async { onTap: () async {
if (UserTool.userProvider.userInfoModel?.name == null) {
await Get.dialog(CertificationDialog());
} else {
Get.to(() => AddHousePage()); Get.to(() => AddHousePage());
}
}, },
text: '添加房屋', text: '添加房屋',
), ),

@ -77,7 +77,7 @@ class _BeeSearchState extends State<BeeSearch> {
return MaterialButton( return MaterialButton(
onPressed: () { onPressed: () {
if (LoginUtil.isNotLogin) return; if (LoginUtil.isNotLogin) return;
if (!LoginUtil.haveRealName(e.title)) return; // if (!LoginUtil.haveRealName(e.title)) return;
if (e.callback == null) { if (e.callback == null) {
BotToast.showText(text: '该功能正在准备上线中,敬请期待', align: Alignment(0, 0.5)); BotToast.showText(text: '该功能正在准备上线中,敬请期待', align: Alignment(0, 0.5));
} else { } else {

@ -30,16 +30,16 @@ class LoginUtil {
/// ///
static bool get isNotLogin => !isLogin; static bool get isNotLogin => !isLogin;
static bool haveRealName(String name) { // static bool haveRealName(String name) {
// if (!name.contains(RegExp('访客邀请|报事报修|建议咨询|生活缴费|物品出门|投诉表扬|我的访客|我的报修|我的缴费'))) // // if (!name.contains(RegExp('访客邀请|报事报修|建议咨询|生活缴费|物品出门|投诉表扬|我的访客|我的报修|我的缴费')))
// return true; // // return true;
final userProvider = Provider.of<UserProvider>(Get.context!, listen: false); // final userProvider = Provider.of<UserProvider>(Get.context!, listen: false);
if (userProvider.userInfoModel!.name == null) { // if (userProvider.userInfoModel!.name == null) {
Get.dialog(CertificationDialog()); // Get.dialog(CertificationDialog());
return false; // return false;
} // }
return true; // return true;
} // }
static bool haveRoom(String name) { static bool haveRoom(String name) {
// if (!name.contains(RegExp('访客邀请|报事报修|建议咨询|生活缴费|物品出门|投诉表扬|我的访客|我的报修|我的缴费'))) // if (!name.contains(RegExp('访客邀请|报事报修|建议咨询|生活缴费|物品出门|投诉表扬|我的访客|我的报修|我的缴费')))

@ -3,10 +3,12 @@ import 'dart:typed_data';
import 'package:aku_new_community/constants/saas_api.dart'; import 'package:aku_new_community/constants/saas_api.dart';
import 'package:aku_new_community/pages/sign/login/other_login_page.dart'; import 'package:aku_new_community/pages/sign/login/other_login_page.dart';
import 'package:aku_new_community/pages/splash/app_verify_dialog.dart';
import 'package:aku_new_community/provider/user_provider.dart'; import 'package:aku_new_community/provider/user_provider.dart';
import 'package:aku_new_community/utils/developer_util.dart'; import 'package:aku_new_community/utils/developer_util.dart';
import 'package:aku_new_community/utils/network/base_list_model.dart'; import 'package:aku_new_community/utils/network/base_list_model.dart';
import 'package:aku_new_community/utils/network/base_model.dart'; import 'package:aku_new_community/utils/network/base_model.dart';
import 'package:aku_new_community/widget/dialog/certification_dialog.dart';
import 'package:bot_toast/bot_toast.dart'; import 'package:bot_toast/bot_toast.dart';
import 'package:common_utils/common_utils.dart'; import 'package:common_utils/common_utils.dart';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
@ -212,9 +214,10 @@ class NetUtil {
userProvider.logout(); userProvider.logout();
// //
Get.offAll(() => OtherLoginPage()); Get.offAll(() => OtherLoginPage());
if (userProvider.isLogin) { }
BotToast.showText(text: model.msg); if (model.code==10100) {
} BotToast.showText(text: '请先实名认证');
Get.dialog(CertificationDialog());
} }
} }
} }

@ -34,7 +34,7 @@ class _ApplicationViewState extends State<ApplicationView> {
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
onPressed: () { onPressed: () {
if (LoginUtil.isNotLogin) return; if (LoginUtil.isNotLogin) return;
if (!LoginUtil.haveRealName(object.title)) return; // if (!LoginUtil.haveRealName(object.title)) return;
if (object.callback == null) { if (object.callback == null) {
BotToast.showText(text: '该功能正在准备上线中,敬请期待', align: Alignment(0, 0.5)); BotToast.showText(text: '该功能正在准备上线中,敬请期待', align: Alignment(0, 0.5));
} else { } else {

@ -16,7 +16,7 @@ buildApk() async {
String date = DateUtil.formatDate(DateTime.now(), format: 'yy_MM_dd_HH_mm'); String date = DateUtil.formatDate(DateTime.now(), format: 'yy_MM_dd_HH_mm');
String version = await getVersion(); String version = await getVersion();
await runAsync('rmdir', arguments: [ Config.apkDir]); await runAsync('rmdir', arguments: ['-f', Config.apkDir]);
await runAsync('mkdir', arguments: [ Config.apkDir]); await runAsync('mkdir', arguments: [ Config.apkDir]);
await runAsync('move', arguments: [ await runAsync('move', arguments: [
Config.buildPath, Config.buildPath,

Loading…
Cancel
Save