Commit e732a20e by tanghuan

手机号脱敏显示

1 parent fc5a9772
...@@ -63,7 +63,7 @@ class AccountPage extends StatelessWidget { ...@@ -63,7 +63,7 @@ class AccountPage extends StatelessWidget {
leading: Icon(Icons.mobile_friendly), leading: Icon(Icons.mobile_friendly),
title: Text('手机号绑定'), title: Text('手机号绑定'),
subtitle: Text( subtitle: Text(
state.phone != '' ? state.phone : '未绑定', state.phone != '' ? '${state.phone.substring(0, 3)}****${state.phone.substring(7, 11)}' : '未绑定',
style: TextStyle( style: TextStyle(
fontSize: 14.0, fontSize: 14.0,
color: Colors.grey, color: Colors.grey,
......
...@@ -27,13 +27,13 @@ class AccountPhonePage extends StatelessWidget { ...@@ -27,13 +27,13 @@ class AccountPhonePage extends StatelessWidget {
color: Colors.white, // 设置返回图标按钮的颜色 color: Colors.white, // 设置返回图标按钮的颜色
), ),
), ),
body: state.phone == '' body: state.phone != ''
? Center( ? Center(
child: Column(children: [ child: Column(children: [
SizedBox(height: 120), SizedBox(height: 120),
Text('已绑定手机号'), Text('已绑定手机号'),
Text( Text(
state.phone, '${state.phone.substring(0, 3)}****${state.phone.substring(7, 11)}',
style: TextStyle( style: TextStyle(
fontSize: 18.0, fontSize: 18.0,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!