Hibok
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
 
 

2207 lignes
75 KiB

  1. import 'dart:convert';
  2. import 'dart:io';
  3. import 'package:chat/home/fans_page.dart';
  4. import 'package:chat/home/goddess_hot.dart';
  5. import 'package:chat/home/my_headview.dart';
  6. import 'package:chat/home/photo_page.dart';
  7. import 'package:chat/home/rich_title.dart';
  8. import 'package:chat/models/ChatMsg.dart';
  9. import 'package:chat/models/money_change.dart';
  10. import 'package:chat/models/ref_name_provider.dart';
  11. import 'package:chat/models/voucher_change.dart';
  12. import 'package:chat/proto/all.pbserver.dart';
  13. import 'package:chat/utils/ChargeMoney.dart';
  14. import 'package:chat/utils/app_navigator.dart';
  15. import 'package:chat/utils/blacklist_mgr.dart';
  16. import 'package:chat/utils/conversation_table.dart';
  17. import 'package:chat/utils/file_cache_mgr.dart';
  18. import 'package:chat/utils/friend_list_mgr.dart';
  19. import 'package:chat/utils/msgHandler.dart';
  20. import 'package:chat/utils/screen.dart';
  21. import 'package:chat/utils/sp_utils.dart';
  22. import 'package:flutter/material.dart';
  23. import 'package:flutter/rendering.dart';
  24. import 'package:chat/data/WebData.dart';
  25. import 'package:chat/data/constants.dart';
  26. import 'package:chat/generated/i18n.dart';
  27. import 'package:chat/home/InformUser.dart';
  28. import 'package:chat/home/MoneyPage.dart';
  29. import 'package:chat/home/Myprogram.dart';
  30. import 'package:chat/home/VideoPage.dart';
  31. import 'package:chat/home/VipPage.dart';
  32. import 'package:chat/models/UserInfo.dart';
  33. import 'package:chat/utils/CustomUI.dart';
  34. import 'package:chat/utils/MessageMgr.dart';
  35. import 'package:chat/utils/TutorialOverlay.dart';
  36. import 'package:cached_network_image/cached_network_image.dart';
  37. import 'package:flutter/services.dart';
  38. import 'package:image_picker/image_picker.dart';
  39. import 'package:multi_image_picker/multi_image_picker.dart';
  40. import 'package:oktoast/oktoast.dart';
  41. import 'package:permission_handler/permission_handler.dart';
  42. import 'package:provider/provider.dart';
  43. import 'package:share/share.dart';
  44. import '../utils/FullWithButton.dart';
  45. import '../home/EditData.dart';
  46. import '../home/SystemEditPage.dart';
  47. import '../data/UserData.dart';
  48. import '../utils/TokenMgr.dart';
  49. import 'package:dio/dio.dart';
  50. import 'package:chat/utils/HttpUtil.dart';
  51. import 'VerificationCenter.dart';
  52. import 'WhiteAndBlackList.dart';
  53. import "package:chat/utils/PicSwiper.dart";
  54. import 'add_friend.dart';
  55. import 'apply_content_view.dart';
  56. import 'daily_bonus_page.dart';
  57. import 'money_picture_view.dart';
  58. import 'dart:math' as math;
  59. var cardWidth;
  60. var greyColor = const Color(0xFFB2B2B2);
  61. const MaxImgSize = 20;
  62. class ProfilePage extends StatefulWidget {
  63. @required
  64. final userId;
  65. final int fromWhere;
  66. final int addMode;
  67. final int applyId; //好友申请id
  68. ProfilePage(
  69. {Key key,
  70. this.userId,
  71. this.fromWhere,
  72. this.addMode = 0,
  73. this.applyId = 0})
  74. : super(key: key);
  75. _ProfilePageState createState() => _ProfilePageState();
  76. }
  77. class _ProfilePageState extends State<ProfilePage>
  78. with TickerProviderStateMixin {
  79. static const Separate_Size = 10.0;
  80. GlobalKey<ScaffoldState> registKey = new GlobalKey();
  81. UserInfo userInfo = new UserInfo();
  82. TextEditingController nickNameController = new TextEditingController();
  83. bool isMyself = false;
  84. List imgList = [];
  85. bool isCanWatch = false;
  86. bool isMan = true;
  87. bool isAttestation = false;
  88. bool isBuyPicture = false;
  89. bool isVip = false;
  90. bool isSvip = false;
  91. bool isApplying = false; //是否申请中
  92. //约会节目
  93. String dateItem = '';
  94. //期待对象
  95. String lovePeople = '';
  96. //约会范围
  97. String dateRange = '';
  98. //生日
  99. String birthday = '';
  100. //身高数据
  101. String heightStr = '';
  102. //体重数据
  103. String weightStr = '';
  104. //个人介绍
  105. String myMsg = '';
  106. Map wealthData = {
  107. 'CoinValue': 0,
  108. 'IsMember': 0,
  109. };
  110. int myselfImg = 0;
  111. String endTime = '';
  112. bool isLoadingFish = false;
  113. String firstDyImg = ''; //第一条动态的图片
  114. int programId = 0; //是否有一条活跃的节目
  115. bool isblack = false;
  116. bool isAuthority = false; //是否有聊天和查看用户资料的权限
  117. bool isShowAll = false;
  118. getUserInfo({mymsg = ''}) async {
  119. if (mymsg != '' && mymsg != null) {
  120. UserData().basicInfo.ownMsg = mymsg;
  121. }
  122. HttpUtil().getUserInfo(
  123. widget.userId,
  124. (data) async {
  125. print('getUserInfo $data');
  126. if (isMyself) {
  127. saveLocalData(data);
  128. }
  129. userInfo = UserInfo.fromJson(data);
  130. initValues();
  131. isLoadingFish = true;
  132. showMyMsgDialog();
  133. if (mounted) {
  134. setState(() {});
  135. }
  136. },
  137. _buildJoinVip,
  138. () {
  139. if (!isMyself) {
  140. Future.delayed(Duration(milliseconds: 500), () {
  141. Navigator.of(context).pop();
  142. });
  143. }
  144. });
  145. getImg();
  146. if (isMyself) {
  147. HttpUtil().getWealth(context, (data) {
  148. wealthData = data;
  149. endTime = data['MemberEnd'];
  150. if (mounted) {
  151. Provider.of<MoneyChangeProvider>(context)
  152. .initMoney(data['CoinValue']);
  153. Provider.of<VoucherChangeProvider>(context)
  154. .initVoucher(data['Voucher']);
  155. }
  156. });
  157. }
  158. }
  159. saveLocalData(data) {
  160. UserData().basicInfo = UserInfo.fromJson(data);
  161. SPUtils.saveString(
  162. Constants.LocalUsrInfo, jsonEncode(UserData().toJson()).toString());
  163. }
  164. initLocalData() async {
  165. if (isMyself && await SPUtils.get(Constants.LocalUsrInfo) != null) {
  166. isLoadingFish = true;
  167. userInfo = UserData().basicInfo;
  168. initValues();
  169. showMyMsgDialog();
  170. }
  171. }
  172. showMyMsgDialog() {
  173. if (!UserData().isFirstTip &&
  174. (UserData().basicInfo.ownMsg == '' ||
  175. UserData().basicInfo.ownMsg == null) &&
  176. UserData().homemainIndex == 4) {
  177. UserData().isFirstTip = true;
  178. CustomUI.buildOneConfirm(
  179. context, I18n.of(context).personal, I18n.of(context).white_now, () {
  180. Navigator.pop(context);
  181. Navigator.of(context).push(
  182. new MaterialPageRoute(
  183. builder: (context) {
  184. return EditPage(
  185. isEditPage: true,
  186. );
  187. },
  188. ),
  189. );
  190. });
  191. }
  192. }
  193. initValues() {
  194. isMan = userInfo.sex == 1;
  195. isAttestation = userInfo.isAttestation == null || userInfo.isAttestation;
  196. isVip = userInfo.isMember > 0;
  197. isSvip = userInfo.isMember == 2;
  198. isCanWatch = userInfo.infoAut == 0 || userInfo.applyStatus == 1;
  199. isApplying = userInfo.applyStatus == 0;
  200. isblack = userInfo.isBlackList;
  201. isBuyPicture =
  202. (isMyself || userInfo.photoAut == 0 || userInfo.payStatus == 1);
  203. dateItem =
  204. userInfo.program == null ? "" : WebData().getProgram(userInfo.program);
  205. lovePeople = userInfo.hopeObject == null
  206. ? ""
  207. : WebData().getLovePeople(userInfo.hopeObject);
  208. dateRange = WebData().getDateRange(userInfo.meetPlace);
  209. birthday = userInfo.birthday == null ? '' : userInfo.birthday;
  210. isAuthority = userInfo.isAuthority ||
  211. (!UserData().isMan() && UserData().basicInfo.isAttestation) ||
  212. userInfo.distince < 200;
  213. myMsg = userInfo.ownMsg;
  214. }
  215. @override
  216. void initState() {
  217. super.initState();
  218. print('ProfilePage initState');
  219. isMyself = widget.userId == UserData().basicInfo.userId;
  220. messageOn();
  221. initLocalData();
  222. getUserInfo();
  223. }
  224. void initMyController() {}
  225. void _buildJoinVip() {
  226. isLoadingFish = true;
  227. CustomUI.buildOneConfirm(
  228. context, I18n.of(context).only_see, I18n.of(context).joinvip, () {
  229. Navigator.of(context).push(
  230. new MaterialPageRoute(
  231. builder: (context) {
  232. return VipPage();
  233. },
  234. ),
  235. );
  236. }, failcallbak: () {
  237. Navigator.of(context).pop();
  238. });
  239. }
  240. msgBuyVip(data) {
  241. HttpUtil().getWealth(context, (data) {
  242. wealthData = data;
  243. endTime = data['MemberEnd'];
  244. if (mounted) {
  245. Provider.of<MoneyChangeProvider>(context).initMoney(data['CoinValue']);
  246. }
  247. });
  248. }
  249. msgRefreshPhoto(data) {
  250. getImg();
  251. }
  252. msgUpdateData(data) {
  253. print('msgUpdateData $data');
  254. getUserInfo(mymsg: data);
  255. }
  256. msgInformSucess(data) {
  257. if (!isMyself)
  258. CustomUI.buildOneConfirm(
  259. context, I18n.of(context).waiting_results, I18n.of(context).ok, () {
  260. Navigator.of(context).pop();
  261. });
  262. }
  263. msgListDelete(data) {
  264. if (userInfo.dynamicNum > 0) {
  265. if (mounted) {
  266. setState(() {
  267. userInfo.dynamicNum--;
  268. });
  269. }
  270. }
  271. }
  272. void messageOn() {
  273. MessageMgr().on('inform_sucess', msgInformSucess);
  274. MessageMgr().on('refresh_money', msgBuyVip);
  275. MessageMgr().on('refresh_photo', msgRefreshPhoto);
  276. MessageMgr().on('update_data', msgUpdateData);
  277. MessageMgr().on('delete_program', msgListDelete);
  278. MessageMgr().on('post_add_friend', msgAddFriend);
  279. MessageMgr().on('refresh_love_list', msgRefreshLoveList);
  280. MessageMgr().on('refresh_fans_num', msgRefreshFansNum);
  281. MessageMgr().on('change_my_headview', msgChangeMyHeadView);
  282. }
  283. void messageOff() {
  284. MessageMgr().off('inform_sucess', msgInformSucess);
  285. MessageMgr().off('refresh_money', msgBuyVip);
  286. MessageMgr().off('refresh_photo', msgRefreshPhoto);
  287. MessageMgr().off('update_data', msgUpdateData);
  288. MessageMgr().off('delete_program', msgListDelete);
  289. MessageMgr().off('post_add_friend', msgAddFriend);
  290. MessageMgr().off('refresh_love_list', msgRefreshLoveList);
  291. MessageMgr().off('refresh_fans_num', msgRefreshFansNum);
  292. MessageMgr().off('change_my_headview', msgChangeMyHeadView);
  293. }
  294. msgChangeMyHeadView(data) {
  295. if (isMyself) {
  296. userInfo.headimgurl = UserData().basicInfo.headimgurl;
  297. setState(() {});
  298. }
  299. }
  300. msgRefreshFansNum(data) {
  301. setState(() {
  302. if (data['UserId'] == userInfo.userId && userInfo.fans < data['nums']) {
  303. userInfo.fans = data['nums'];
  304. }
  305. });
  306. }
  307. msgRefreshLoveList(data) {
  308. setState(() {
  309. if (data['flag'] == 0) {
  310. isMyself ? userInfo.followNum++ : userInfo.fans++;
  311. } else {
  312. isMyself ? userInfo.followNum-- : userInfo.fans--;
  313. }
  314. });
  315. }
  316. msgAddFriend(data) {
  317. setState(() {
  318. userInfo.isAddFriends = 0;
  319. });
  320. }
  321. @override
  322. void dispose() {
  323. messageOff();
  324. registKey = null;
  325. nickNameController.dispose();
  326. super.dispose();
  327. }
  328. void getImg() async {
  329. var data = {
  330. "visitUserId": UserData().basicInfo.userId,
  331. "userId": widget.userId,
  332. };
  333. data['sign'] = TokenMgr().getSign(data);
  334. Response res = await HttpUtil().post('user/personal/album', data: data);
  335. if (res == null) {
  336. return;
  337. }
  338. Map resData = res.data;
  339. if (resData['code'] == 0) {
  340. imgList = resData['data'] == null ? [] : resData['data'];
  341. if (isMyself) {
  342. UserData().picNum = 0;
  343. for (int i = 0; i < imgList.length; i++) {
  344. if (imgList[i]['Status'] == 1) {
  345. UserData().picNum++;
  346. }
  347. if (imgList[i]['Status'] == 0 || imgList[i]['Status'] == 2) {
  348. UserData().haveReview = true;
  349. }
  350. }
  351. }
  352. if (mounted) {
  353. setState(() {});
  354. }
  355. }
  356. }
  357. //上传相册
  358. void _uploadPhoto() async {
  359. int leftLength = MaxImgSize - imgList.length;
  360. if (leftLength <= 0) {
  361. showToast(I18n.of(context)
  362. .max_upload_size
  363. .replaceFirst('/s1', MaxImgSize.toString()));
  364. return;
  365. }
  366. List<Asset> resultList = List<Asset>();
  367. resultList = await MultiImagePicker.pickImages(
  368. maxImages: leftLength > 9 ? 9 : leftLength,
  369. enableCamera: false,
  370. selectedAssets: [],
  371. cupertinoOptions: CupertinoOptions(takePhotoIcon: "chat"),
  372. materialOptions: MaterialOptions(
  373. actionBarColor: "#50A7F9",
  374. actionBarTitle: "Hibok",
  375. allViewTitle: "",
  376. useDetailsView: true,
  377. selectCircleStrokeColor: "#000000",
  378. ),
  379. );
  380. if (resultList != null && resultList.length > 0) {
  381. List<File> fileList = [];
  382. for (var i = 0; i < resultList.length; i++) {
  383. Asset photoEntity = resultList[i];
  384. print('名字:${photoEntity.name}');
  385. ByteData byteData = await photoEntity.getByteData();
  386. File file = await FileCacheMgr().writeFile(
  387. 'temp-photo-${DateTime.now().millisecondsSinceEpoch}.png',
  388. byteData.buffer.asInt8List(0));
  389. fileList.add(file);
  390. }
  391. print('文件列表${fileList.length}');
  392. Map data = {"type": 2, "userId": UserData().basicInfo.userId};
  393. data['sign'] = TokenMgr().getSign(data);
  394. data['sex'] = UserData().basicInfo.sex;
  395. data['isBurn'] = 0;
  396. Response res = await HttpUtil().uploadFiles(
  397. fileList, data, 'upload/post/postfiles', 'image',
  398. isShowLoading: true);
  399. var resData = res.data;
  400. if (resData['code'] == 0) {
  401. if (resData['data']['msg'] != '' && resData['data']['msg'] != null) {
  402. showToast(resData['data']['msg']);
  403. }
  404. if (resData['msg'].split('|').length != fileList.length) {
  405. showToast(I18n.of(context).hava_error_photo);
  406. }
  407. MessageMgr().emit('refresh_photo');
  408. } else {
  409. showToast(resData['msg']);
  410. }
  411. }
  412. }
  413. showHeadView() {
  414. Navigator.of(context).push(
  415. new MaterialPageRoute(
  416. builder: (context) {
  417. return MyHeadViewPage();
  418. },
  419. ),
  420. );
  421. }
  422. Widget _buildSignIn() {
  423. return Container(
  424. margin: EdgeInsets.only(top: Separate_Size, bottom: Separate_Size),
  425. padding: EdgeInsets.symmetric(horizontal: 10),
  426. child: FullWidthButton(
  427. iconCode: 0xe65c,
  428. iconColor: 0xFFAF60F8,
  429. showRightIcon: true,
  430. title: I18n.of(context).sign_in,
  431. showDivider: false,
  432. onPressed: () {
  433. Navigator.of(context).push(MaterialPageRoute(
  434. builder: (context) {
  435. return DailyBonusPage();
  436. },
  437. ));
  438. },
  439. ),
  440. decoration: BoxDecoration(
  441. color: Colors.white,
  442. border: Border(
  443. top: Constants.GreyBorderSide, bottom: Constants.GreyBorderSide)),
  444. );
  445. }
  446. Widget _buildPicture() {
  447. return FullWidthButton(
  448. iconCode: 0xe689,
  449. iconColor: 0xFFE3AA10,
  450. title: (isMyself
  451. ? I18n.of(context).my_album
  452. : (isMan ? I18n.of(context).his_photo : I18n.of(context).her_photo)),
  453. descriptionColor: Constants.BlueTextColor,
  454. showDivider: false,
  455. showRightIcon: true,
  456. onPressed: () {
  457. Navigator.of(context).push(
  458. new MaterialPageRoute(
  459. builder: (context) {
  460. return PhotoPage(
  461. userInfo: userInfo,
  462. );
  463. },
  464. ),
  465. );
  466. },
  467. );
  468. }
  469. Widget _buildHeadView() {
  470. cardWidth = MediaQuery.of(context).size.width;
  471. return Container(
  472. decoration: BoxDecoration(
  473. color: Colors.white,
  474. border: Border(bottom: Constants.GreyBorderSide)),
  475. child: Container(
  476. decoration: BoxDecoration(
  477. color: Colors.white,
  478. ),
  479. width: MediaQuery.of(context).size.width,
  480. padding: EdgeInsets.only(top: 19),
  481. child: Column(
  482. children: <Widget>[
  483. Row(
  484. crossAxisAlignment: CrossAxisAlignment.center,
  485. children: <Widget>[
  486. _buildHeadImg(),
  487. Column(children: <Widget>[
  488. _buildFans(),
  489. _buildButtonList(),
  490. ])
  491. ],
  492. ),
  493. _buildUserChips(),
  494. _buildAttestation(),
  495. _buildMyMsg(),
  496. ],
  497. ),
  498. ),
  499. );
  500. }
  501. Widget _buildMyMsg() {
  502. double width = Screen.width - 80;
  503. var textStyle = TextStyle(fontSize: 12, color: Color(0xFF333333));
  504. // userInfo.ownMsg =
  505. // '哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈';
  506. bool showAllContent = isExpansion(userInfo.ownMsg, width);
  507. return Container(
  508. padding:
  509. EdgeInsets.only(left: 25.5, bottom: isMyself ? 20 : 5, right: 10),
  510. child: userInfo.ownMsg == null || userInfo.ownMsg == ''
  511. ? (isMyself
  512. ? InkWell(
  513. onTap: () {
  514. Navigator.of(context).push(
  515. new MaterialPageRoute(
  516. builder: (context) {
  517. return EditPage(isEditPage: true);
  518. },
  519. ),
  520. );
  521. },
  522. child: Row(children: <Widget>[
  523. Text(I18n.of(context).msg_tips, style: textStyle),
  524. Transform.rotate(
  525. angle: math.pi * 2,
  526. child: Icon(
  527. IconData(0xe68d,
  528. fontFamily: Constants.IconFontFamily),
  529. color: Color(0xFF717171),
  530. size: 16,
  531. ))
  532. ]))
  533. : Container())
  534. : Row(
  535. crossAxisAlignment: CrossAxisAlignment.start,
  536. children: <Widget>[
  537. Container(
  538. width: width,
  539. child: Text(
  540. userInfo.ownMsg,
  541. style: textStyle,
  542. maxLines: isShowAll ? 10 : 1,
  543. overflow: TextOverflow.ellipsis,
  544. )),
  545. SizedBox(width: 4),
  546. showAllContent
  547. ? InkWell(
  548. onTap: () {
  549. setState(() {
  550. isShowAll = !isShowAll;
  551. });
  552. },
  553. child: Transform.rotate(
  554. angle: isShowAll ? math.pi : 0,
  555. child: Icon(
  556. IconData(0xe684,
  557. fontFamily: Constants.IconFontFamily),
  558. color: Color(0xFF717171),
  559. size: 13,
  560. )))
  561. : Container(),
  562. ],
  563. ));
  564. }
  565. bool isExpansion(String text, double width) {
  566. TextPainter _textPainter = TextPainter(
  567. maxLines: 2,
  568. text: TextSpan(
  569. text: text, style: TextStyle(fontSize: 12.0, color: Colors.black)),
  570. textDirection: TextDirection.ltr)
  571. ..layout(maxWidth: width, minWidth: width);
  572. if (_textPainter.didExceedMaxLines) {
  573. //这里判断 文本是否截断
  574. return true;
  575. } else {
  576. return false;
  577. }
  578. }
  579. Widget _buildBorderButton(String str, double width, callback,
  580. {IconData iconCode, int iconColor = 0xFF181818}) {
  581. return InkWell(
  582. onTap: callback,
  583. child: Container(
  584. alignment: Alignment.center,
  585. decoration: BoxDecoration(
  586. border: Border.all(color: Color(0xB5CCCCCC)),
  587. borderRadius: BorderRadius.circular(14)),
  588. height: 28,
  589. width: width,
  590. child: Row(mainAxisAlignment: MainAxisAlignment.center, children: [
  591. iconCode != null
  592. ? Container(
  593. margin: EdgeInsets.only(right: str == null ? 0 : 2),
  594. child: Icon(
  595. iconCode,
  596. size: 16,
  597. color: Color(iconColor),
  598. ))
  599. : Container(),
  600. Text(
  601. str,
  602. style: TextStyle(fontSize: 14),
  603. )
  604. ]),
  605. ));
  606. }
  607. gotoEditPage() {
  608. Navigator.of(context).push(
  609. new MaterialPageRoute(
  610. builder: (context) {
  611. return EditPage(isEditPage: true);
  612. },
  613. ),
  614. );
  615. }
  616. gotoSystemEditPage() {
  617. Navigator.of(context).push(
  618. new MaterialPageRoute(
  619. builder: (context) {
  620. return SystemEditPage();
  621. },
  622. ),
  623. );
  624. }
  625. loveOrCancele() {
  626. if (!userInfo.isLike) {
  627. HttpUtil().setLove(userInfo.userId, () {
  628. MessageMgr()
  629. .emit('refresh_love_list', {'UserId': userInfo.userId, 'flag': 0});
  630. setState(() {
  631. userInfo.isLike = true;
  632. });
  633. });
  634. } else {
  635. HttpUtil().cancleLove(userInfo.userId, () {
  636. MessageMgr()
  637. .emit('refresh_love_list', {'UserId': userInfo.userId, 'flag': 2});
  638. setState(() {
  639. userInfo.isLike = false;
  640. });
  641. });
  642. }
  643. }
  644. Widget _buildButtonList() {
  645. List<Widget> list = [];
  646. if (isMyself) {
  647. list = [
  648. _buildBorderButton(
  649. I18n.of(context).edit_information, 140, gotoEditPage),
  650. SizedBox(width: 12.5),
  651. _buildBorderButton('', 54, gotoSystemEditPage,
  652. iconCode: Icons.settings),
  653. ];
  654. } else if (userInfo.sex == UserData().basicInfo.sex) {
  655. list = [
  656. _buildBorderButton(I18n.of(context).private_chat, 140,
  657. isCanWatch ? buyChatAccount : null,
  658. iconCode: IconData(0xe68c, fontFamily: 'iconfont')),
  659. ];
  660. } else {
  661. list = [
  662. _buildBorderButton(I18n.of(context).like, 140, loveOrCancele,
  663. iconCode: IconData(userInfo.isLike ? 0xe623 : 0xe625,
  664. fontFamily: Constants.IconFontFamily),
  665. iconColor: userInfo.isLike ? 0xFFFF7777 : 0xFF181818),
  666. SizedBox(width: 12.5),
  667. _buildBorderButton('', 53, isCanWatch ? buyChatAccount : null,
  668. iconCode: IconData(0xe68c, fontFamily: 'iconfont')),
  669. ];
  670. }
  671. return Container(
  672. margin: EdgeInsets.only(top: 13, bottom: 10),
  673. child: Row(
  674. children: list,
  675. ));
  676. }
  677. //认证相关
  678. Widget _buildAttestation() {
  679. return Container(
  680. margin: EdgeInsets.only(top: 7, bottom: 7, left: 25.5),
  681. alignment: Alignment.centerLeft,
  682. child: Row(
  683. mainAxisAlignment: MainAxisAlignment.start,
  684. children: <Widget>[
  685. isAttestation
  686. ? Icon(Icons.check_circle_outline,
  687. size: 12, color: Constants.BlueTextColor)
  688. : Padding(
  689. padding: EdgeInsets.only(bottom: 0.5),
  690. child: Icon(IconData(0xe63a, fontFamily: 'iconfont'),
  691. size: 16, color: const Color(0xFFA9A9A9))),
  692. SizedBox(width: 3),
  693. Text(
  694. isAttestation
  695. ? isMyself
  696. ? (isMan
  697. ? (userInfo.isVipAttestation
  698. ? I18n.of(context).by_paying
  699. : I18n.of(context).incode_passed)
  700. : I18n.of(context).certified)
  701. : (isMan
  702. ? (userInfo.isVipAttestation
  703. ? I18n.of(context).pay_join
  704. : I18n.of(context).passed_review)
  705. : I18n.of(context).passed_video)
  706. : isMyself
  707. ? I18n.of(context).not_certified
  708. : (isMan ? '' : I18n.of(context).not_video),
  709. textScaleFactor: 1.0,
  710. style: TextStyle(fontSize: 11, color: Constants.GreyTextColor))
  711. ],
  712. ));
  713. }
  714. Widget _buildFansButton(int nums, String text, callback,
  715. {bool isShowDot = false}) {
  716. return InkWell(
  717. onTap: callback,
  718. child: Container(
  719. width: (Screen.width - 130) / 3,
  720. child: Column(
  721. children: <Widget>[
  722. Stack(
  723. children: <Widget>[
  724. Padding(
  725. padding: EdgeInsets.only(left: 4, right: 4),
  726. child: Text(
  727. nums > 99 ? "99+" : nums.toString(),
  728. style: TextStyle(
  729. fontSize: 15,
  730. color: Constants.BlackTextColor,
  731. fontWeight: FontWeight.bold),
  732. )),
  733. isShowDot
  734. ? Positioned(
  735. top: 2,
  736. right: 0,
  737. child: CircleAvatar(
  738. radius: 2,
  739. backgroundColor: const Color(0xFFE50000),
  740. ),
  741. )
  742. : Container(
  743. width: 0,
  744. )
  745. ],
  746. ),
  747. SizedBox(height: 4),
  748. Text(
  749. text,
  750. style: TextStyle(fontSize: 11, color: greyColor),
  751. ),
  752. ],
  753. )),
  754. );
  755. }
  756. //关注列表
  757. Widget _buildFans() {
  758. return Container(
  759. child: Row(
  760. mainAxisAlignment: MainAxisAlignment.spaceEvenly,
  761. children: <Widget>[
  762. _buildFansButton(
  763. userInfo.fans,
  764. I18n.of(context).fans,
  765. isMyself
  766. ? () {
  767. Navigator.of(context).push(
  768. new MaterialPageRoute(
  769. builder: (context) {
  770. return FansPage();
  771. },
  772. ),
  773. );
  774. }
  775. : null),
  776. _buildFansButton(
  777. userInfo.followNum,
  778. I18n.of(context).attention,
  779. isMyself
  780. ? () {
  781. Navigator.of(context).push(
  782. new MaterialPageRoute(
  783. builder: (context) {
  784. return WhiteAndBlackPage(
  785. isWhite: true,
  786. );
  787. },
  788. ),
  789. );
  790. }
  791. : null),
  792. _buildFansButton(userInfo.dynamicNum, I18n.of(context).dynamics, () {
  793. Navigator.of(context).push(
  794. new MaterialPageRoute(
  795. builder: (context) {
  796. return MyProgramPage(
  797. userId: userInfo.userId,
  798. isMan: isMan,
  799. );
  800. },
  801. ),
  802. );
  803. }, isShowDot: userInfo.dynamicNum > 0),
  804. ],
  805. ));
  806. }
  807. Widget _buildDivder() {
  808. return Container(
  809. color: Color(0xFFE6E6E6),
  810. width: 1.5,
  811. height: 10,
  812. margin: EdgeInsets.only(left: 7.5, right: 7.5));
  813. }
  814. //用户chips
  815. Widget _buildUserChips() {
  816. var age = 0;
  817. if (userInfo.birthday != null) {
  818. age = DateTime.now().year - int.parse(userInfo.birthday.split('-')[0]);
  819. }
  820. var textStyle = TextStyle(fontSize: 12);
  821. return Container(
  822. width: Screen.width,
  823. padding: EdgeInsets.only(left: 25.5),
  824. child: Row(
  825. mainAxisAlignment: MainAxisAlignment.start,
  826. children: <Widget>[
  827. isAttestation && !isMan
  828. ? Container(
  829. height: 13,
  830. padding: EdgeInsets.only(left: 5, right: 5),
  831. alignment: Alignment.center,
  832. decoration: BoxDecoration(
  833. borderRadius: BorderRadius.circular(10),
  834. color: Constants.PurpleBackgroundColor,
  835. ),
  836. child: Text(
  837. 'Real',
  838. textScaleFactor: 1.0,
  839. style: TextStyle(fontSize: 9, color: Colors.white),
  840. ))
  841. : Text(''),
  842. isVip && isMan
  843. ? Container(
  844. child: isSvip ? Constants.svipIcon : Constants.vipIcon)
  845. : Text(''),
  846. (isAttestation && !isMan) || isVip && isMan
  847. ? _buildDivder()
  848. : Container(),
  849. Text(
  850. '${UserData().hasLocationPermission ? WebData().getDateRange(userInfo.meetPlace) : I18n.of(context).unknown}',
  851. style: textStyle,
  852. ),
  853. _buildDivder(),
  854. Text(
  855. '$age ${I18n.of(context).years_old}-${WebData().getConstellation(context, userInfo.constellation)}',
  856. style: textStyle,
  857. ),
  858. _buildDivder(),
  859. Text(
  860. userInfo.occupation == null
  861. ? ''
  862. : WebData().getProffesionName(userInfo.occupation),
  863. style: textStyle,
  864. )
  865. ],
  866. ));
  867. }
  868. //用户头像
  869. Widget _buildHeadImg() {
  870. double width = 85;
  871. return InkWell(
  872. onTap: isMyself
  873. ? showHeadView
  874. : () {
  875. Navigator.of(context).push(
  876. new MaterialPageRoute(
  877. builder: (context) {
  878. return PicSwiper(
  879. id: 0,
  880. pics: [PicSwiperItem(userInfo.headimgurl, id: 0)],
  881. );
  882. },
  883. ),
  884. );
  885. },
  886. child: Container(
  887. margin: EdgeInsets.only(left: 19, right: 0, bottom: 15),
  888. decoration: BoxDecoration(shape: BoxShape.circle, boxShadow: [
  889. BoxShadow(
  890. color: Color(0xFFD9D9D9),
  891. offset: Offset(0, 0.5),
  892. blurRadius: 5,
  893. )
  894. ]),
  895. width: width,
  896. height: width,
  897. child: ClipRRect(
  898. borderRadius: BorderRadius.circular(100),
  899. child: userInfo.headimgurl == null || userInfo.headimgurl == ''
  900. ? Image.asset(Constants.DefaultHeadImgUrl,
  901. height: width, width: width)
  902. : CachedNetworkImage(
  903. imageUrl: userInfo.headimgurl,
  904. placeholder: (context, url) => Image.asset(
  905. Constants.DefaultHeadImgUrl,
  906. height: width,
  907. width: width,
  908. ),
  909. fit: BoxFit.cover,
  910. ),
  911. )),
  912. );
  913. }
  914. Widget _buildMyPicture() {
  915. var pisc = imgList
  916. .map((f) => PicSwiperItem(
  917. f['ImgUrl'],
  918. id: f['Id'],
  919. type: f['Type'],
  920. isWatch: f['IsCheck'] == 1,
  921. userId: userInfo.userId,
  922. isBuy: f['PayStatus'] == 1,
  923. isCheck: f['Status'] == 0,
  924. ))
  925. .toList();
  926. var list = imgList.map((data) {
  927. var width = MediaQuery.of(context).size.width / 4 - 15;
  928. bool isWatch = data['IsCheck'] == 1;
  929. double raduis = 10;
  930. return CustomUI.buildImgCover(data['Id'], pisc, data['ImgUrl'], width,
  931. raduis, isWatch, context, data['Type'],
  932. isMyself: isMyself,
  933. payStatus: data['PayStatus'],
  934. state: isMan ? 1 : data['Status']);
  935. }).toList();
  936. if (!isBuyPicture && list.length > 4) {
  937. list.length = 4;
  938. }
  939. TitleItem title;
  940. if (!isMan) {
  941. title = UserData().isVip
  942. ? TitleItem(
  943. title: I18n.of(context).unlock_user,
  944. name: Provider.of<RefNameProvider>(context)
  945. .getRefName(userInfo.userId, userInfo.nickName),
  946. )
  947. : TitleItem(
  948. title: I18n.of(context).free_unlock,
  949. name: userInfo.price.toString() + I18n.of(context).mask_coin);
  950. } else {
  951. title = TitleItem(
  952. title: I18n.of(context).pay_unlock, name: userInfo.price.toString());
  953. }
  954. //我的相册
  955. return Container(
  956. alignment: Alignment.center,
  957. margin: EdgeInsets.only(top: Separate_Size),
  958. padding: EdgeInsets.symmetric(horizontal: 10),
  959. width: isMyself ? Screen.width : cardWidth,
  960. child: Column(
  961. crossAxisAlignment: CrossAxisAlignment.start,
  962. children: <Widget>[
  963. FullWidthButton(
  964. title: (isMyself
  965. ? I18n.of(context).my_album
  966. : (isMan
  967. ? I18n.of(context).his_photo
  968. : I18n.of(context).her_photo)),
  969. description: isMyself
  970. ? '${I18n.of(context).upload}(${imgList.length}/$MaxImgSize)'
  971. : '',
  972. descriptionColor: Constants.BlueTextColor,
  973. showDivider: true,
  974. showRightIcon: false,
  975. onPressed: isMyself ? _uploadPhoto : () {},
  976. ),
  977. list.length == 0
  978. ? (isMyself
  979. ? InkWell(
  980. onTap: _uploadPhoto,
  981. child: Container(
  982. height: 100,
  983. alignment: Alignment.center,
  984. child: Column(
  985. mainAxisAlignment: MainAxisAlignment.center,
  986. children: <Widget>[
  987. Text(I18n.of(context).first_photo,
  988. textScaleFactor: 1.0),
  989. Text(
  990. isMan
  991. ? I18n.of(context).have_picture
  992. : I18n.of(context).no_photo,
  993. textScaleFactor: 1.0,
  994. style: TextStyle(
  995. fontSize: 12, color: Colors.grey))
  996. ],
  997. )))
  998. : Container(
  999. alignment: Alignment.center,
  1000. height: 120,
  1001. child: Text(
  1002. isMan
  1003. ? I18n.of(context).not_up_man
  1004. : I18n.of(context).not_up_women,
  1005. textScaleFactor: 1.0,
  1006. style: TextStyle(fontSize: 14),
  1007. ),
  1008. ))
  1009. : (isBuyPicture
  1010. ? Container(
  1011. //alignment: Alignment.center,
  1012. child: Wrap(
  1013. crossAxisAlignment: WrapCrossAlignment.start,
  1014. children: list,
  1015. ))
  1016. : Container(
  1017. alignment: Alignment.center,
  1018. child: Stack(
  1019. //alignment: Alignment.center,
  1020. children: <Widget>[
  1021. Wrap(
  1022. crossAxisAlignment: WrapCrossAlignment.start,
  1023. children: list,
  1024. ),
  1025. Opacity(
  1026. opacity: 0.96,
  1027. child: Container(
  1028. decoration: BoxDecoration(color: Colors.white),
  1029. height: 200,
  1030. ),
  1031. ),
  1032. Container(
  1033. height: 200,
  1034. alignment: Alignment.center,
  1035. child: Column(
  1036. mainAxisAlignment: MainAxisAlignment.center,
  1037. children: <Widget>[
  1038. Image.asset(
  1039. 'assets/images/suo.png',
  1040. width: 35,
  1041. color: Colors.grey[700],
  1042. ),
  1043. Container(
  1044. margin: EdgeInsets.only(top: 10),
  1045. alignment: Alignment.center,
  1046. child: Text(
  1047. isMan
  1048. ? I18n.of(context).set_lock
  1049. : I18n.of(context).set_lock2,
  1050. textScaleFactor: 1.0,
  1051. style: TextStyle(
  1052. color: Colors.grey[700],
  1053. fontSize: 15),
  1054. ),
  1055. ),
  1056. Container(
  1057. margin: EdgeInsets.only(top: 8),
  1058. alignment: Alignment.center,
  1059. child: RichText(
  1060. text: TextSpan(
  1061. children: RichTitle.getRichText(title,
  1062. titleStyle: TextStyle(
  1063. color: Colors.grey[700],
  1064. fontSize: 13),
  1065. nameStyle: TextStyle(
  1066. color: Colors.red,
  1067. fontSize: 13))),
  1068. ),
  1069. ),
  1070. InkWell(
  1071. onTap: buyPhoto,
  1072. child: Container(
  1073. margin: EdgeInsets.only(top: 10),
  1074. padding:
  1075. EdgeInsets.only(top: 6, bottom: 6),
  1076. width: 100,
  1077. alignment: Alignment.center,
  1078. decoration: Constants
  1079. .ConfirmBUttonBoxDecoration,
  1080. child: Text(
  1081. I18n.of(context).unlock,
  1082. textScaleFactor: 1.0,
  1083. style: TextStyle(color: Colors.white),
  1084. ),
  1085. )),
  1086. ],
  1087. ))
  1088. ],
  1089. ))),
  1090. !isMan && isMyself
  1091. ? InkWell(
  1092. onTap: () {
  1093. if (!userInfo.isAttestation) {
  1094. _buildNotTrue();
  1095. return;
  1096. }
  1097. if (imgList.length == 0) {
  1098. showToast(I18n.of(context).no_photos);
  1099. return;
  1100. }
  1101. var moneyList = [];
  1102. for (int i = 0; i < imgList.length; i++) {
  1103. if (imgList[i]['Status'] == 1) {
  1104. moneyList.add(imgList[i]);
  1105. }
  1106. }
  1107. Navigator.of(context)
  1108. .push(new MaterialPageRoute(builder: (context) {
  1109. return MoneyPicture(
  1110. imageList: moneyList,
  1111. );
  1112. }));
  1113. },
  1114. child: Container(
  1115. alignment: Alignment.centerRight,
  1116. margin: EdgeInsets.only(top: 10, right: 10, bottom: 10),
  1117. padding: EdgeInsets.only(top: 10),
  1118. child: Text(
  1119. I18n.of(context).set_photo,
  1120. textScaleFactor: 1.0,
  1121. style: TextStyle(color: Colors.red),
  1122. ),
  1123. ))
  1124. : Container(),
  1125. ],
  1126. ),
  1127. decoration: BoxDecoration(
  1128. color: Colors.white,
  1129. border: Border(
  1130. top: Constants.GreyBorderSide, bottom: Constants.GreyBorderSide)),
  1131. );
  1132. }
  1133. void _buildNotTrue() {
  1134. CustomUI.buildOneConfirm(context, I18n.of(context).moneyPageTip,
  1135. I18n.of(context).authenticate_now, () {
  1136. Navigator.pop(context);
  1137. Navigator.of(context).push(
  1138. new MaterialPageRoute(
  1139. builder: (context) {
  1140. return VerificationCenterPage();
  1141. },
  1142. ),
  1143. );
  1144. });
  1145. }
  1146. void _buildConfirmBlack() {
  1147. Navigator.of(context).pop();
  1148. CustomUI.buildOneConfirm(
  1149. context, I18n.of(context).blacklist_choose, I18n.of(context).determine,
  1150. () async {
  1151. Navigator.pop(context);
  1152. HttpUtil().blackUser(userInfo.userId, () {
  1153. isblack = true;
  1154. });
  1155. });
  1156. }
  1157. void _sendMySelfPicture() async {
  1158. if (await CustomUI.showPhotoPermissionSetting(context)) {
  1159. var tempFile = await ImagePicker.pickImage(source: ImageSource.gallery);
  1160. if (tempFile != null) {
  1161. Map data = {"type": 6, "userId": UserData().basicInfo.userId};
  1162. data['sign'] = TokenMgr().getSign(data);
  1163. data['isBurn'] = 1;
  1164. Response res = await HttpUtil().uploadFile(
  1165. tempFile, data, 'upload/file/postflie', 'image',
  1166. isShowLoading: true);
  1167. var resData = res.data;
  1168. if (resData['code'] == 0) {
  1169. showToast(I18n.of(context).successfully_submit);
  1170. myselfImg = resData['data']['photoId'];
  1171. Navigator.of(context).pop();
  1172. _postApply();
  1173. }
  1174. }
  1175. }
  1176. }
  1177. void _postApply() async {
  1178. Map data = {
  1179. "userId": userInfo.userId,
  1180. "imgUrl": myselfImg,
  1181. "applyUserId": UserData().basicInfo.userId
  1182. };
  1183. data['sign'] = TokenMgr().getSign(data);
  1184. Response res = await HttpUtil()
  1185. .post('user/apply/checkcords', data: data, isShowLoading: true);
  1186. Map resData = res.data;
  1187. if (resData['code'] == 0) {
  1188. isApplying = true;
  1189. setState(() {});
  1190. }
  1191. }
  1192. Widget _buildBody() {
  1193. Widget hidden = Container(
  1194. alignment: Alignment.center,
  1195. width: Screen.width,
  1196. height: Screen.height - 372,
  1197. color: Colors.white,
  1198. margin: EdgeInsets.only(top: 10),
  1199. child: Column(
  1200. mainAxisAlignment: MainAxisAlignment.center,
  1201. children: <Widget>[
  1202. Container(
  1203. margin: EdgeInsets.only(bottom: 10),
  1204. child: Image.asset('assets/images/login/lock.png',
  1205. height: 45, width: 45),
  1206. ),
  1207. Text(
  1208. isMan ? I18n.of(context).view_user : I18n.of(context).view_user2,
  1209. textScaleFactor: 1.0,
  1210. textAlign: TextAlign.center,
  1211. style: TextStyle(color: Constants.GreyTextColor, fontSize: 13.5),
  1212. ),
  1213. InkWell(
  1214. onTap: isApplying
  1215. ? null
  1216. : () async {
  1217. CustomUI.buildOneConfirm(
  1218. context,
  1219. I18n.of(context).need_photo,
  1220. I18n.of(context).choose_photo,
  1221. _sendMySelfPicture);
  1222. },
  1223. child: Container(
  1224. margin: EdgeInsets.only(top: 10, left: 100, right: 100),
  1225. padding: EdgeInsets.only(top: 10, bottom: 10),
  1226. alignment: Alignment.center,
  1227. decoration: BoxDecoration(
  1228. color: Constants.ConfrimButtonColor,
  1229. borderRadius: BorderRadius.all(
  1230. Radius.circular(Constants.LittleButtonRadius))),
  1231. child: Text(
  1232. isApplying
  1233. ? I18n.of(context).already_applied
  1234. : I18n.of(context).apply_now,
  1235. textScaleFactor: 1.0,
  1236. style: TextStyle(color: Colors.white),
  1237. ),
  1238. )),
  1239. ],
  1240. ),
  1241. );
  1242. List<Widget> child = [];
  1243. if (isMyself) {
  1244. child.addAll([
  1245. _buildHeadView(),
  1246. _buildSignIn(),
  1247. _buildMoneyBox(),
  1248. ]);
  1249. } else if (isCanWatch) {
  1250. child.addAll([
  1251. _buildHeadView(),
  1252. Container(
  1253. margin: EdgeInsets.only(top: Separate_Size, bottom: Separate_Size),
  1254. padding: EdgeInsets.symmetric(horizontal: 10),
  1255. child: _buildPicture(),
  1256. decoration: BoxDecoration(
  1257. color: Colors.white,
  1258. border: Border(
  1259. top: Constants.GreyBorderSide,
  1260. bottom: Constants.GreyBorderSide)),
  1261. ),
  1262. _buildBasicInfo(),
  1263. _buildBottomTips(),
  1264. ]);
  1265. } else if (userInfo.userId != null) {
  1266. child.addAll([
  1267. _buildHeadView(),
  1268. hidden,
  1269. ]);
  1270. } else {
  1271. child.addAll([
  1272. _buildHeadView(),
  1273. ]);
  1274. }
  1275. return Column(
  1276. children: child,
  1277. );
  1278. }
  1279. _inviteFdBtn() {
  1280. return Container(
  1281. width: Screen.width,
  1282. child: FlatButton(
  1283. child: fixedText(I18n.of(context).add_friends,
  1284. fontSize: 16,
  1285. color: Colors.blueAccent,
  1286. fontWeight: FontWeight.w500),
  1287. onPressed: () async {
  1288. //已经是好友
  1289. if (FriendListMgr().isMyFriend(userInfo.userId)) {
  1290. showToast(I18n.of(context).added);
  1291. return;
  1292. }
  1293. //已申请
  1294. if (userInfo.isAddFriends == 0) {
  1295. showToast(I18n.of(context).add_friends_tips);
  1296. return;
  1297. }
  1298. if (widget.addMode != 3 &&
  1299. UserData().addFdDistanceSwitch > 0 &&
  1300. userInfo.distince > 200) {
  1301. showToast(I18n.of(context).distance_long);
  1302. return;
  1303. }
  1304. Navigator.of(context).push(
  1305. new MaterialPageRoute(
  1306. builder: (context) {
  1307. return AddFriendPage(
  1308. userId: userInfo.userId,
  1309. pageType: SendMessagePageType.AddFriends,
  1310. originalName: I18n.of(context)
  1311. .i_am
  1312. .replaceFirst('/s1', UserData().basicInfo.nickName),
  1313. );
  1314. },
  1315. ),
  1316. );
  1317. }),
  1318. );
  1319. }
  1320. void doFriendApply(state, callback) async {
  1321. Map data = {
  1322. "id": widget.applyId,
  1323. "userId": UserData().basicInfo.userId,
  1324. "status": state,
  1325. };
  1326. data['sign'] = TokenMgr().getSign(data);
  1327. Response res =
  1328. await HttpUtil().post('friendship/handler/apply', data: data);
  1329. if (res == null) {
  1330. return;
  1331. }
  1332. var resData = res.data;
  1333. if (resData['code'] == 0) {
  1334. callback(resData['msg']);
  1335. } else {}
  1336. }
  1337. _dealInvite() {
  1338. return Container(
  1339. width: Screen.width,
  1340. child: Row(
  1341. children: <Widget>[
  1342. Expanded(
  1343. child: InkWell(
  1344. onTap: () {
  1345. doFriendApply(1, (msg) {
  1346. showToast(msg);
  1347. Navigator.of(context).pop();
  1348. var friendModel = FriendModel.fromServerJson({
  1349. 'UserId': userInfo.userId,
  1350. 'ImgUrl': userInfo.headimgurl,
  1351. 'UserName': userInfo.nickName
  1352. });
  1353. FriendListMgr().addFriend(friendModel);
  1354. FriendListMgr().deleteLocalUserId();
  1355. MessageMgr().emit('do_friend_apply',
  1356. {'userId': userInfo.userId, 'state': 1});
  1357. MessageMgr().emit('Add friend');
  1358. //同意好友后发送打招呼
  1359. MsgModel msgModel = MsgHandler.createSendMsg(
  1360. ChatType.TextChatType, I18n.of(context).new_friends_tips,
  1361. friendId: userInfo.userId,
  1362. refMsg: null,
  1363. refShortTxt: null,
  1364. altUsers: null,
  1365. channelType: ChatChannelType.Session);
  1366. int sessionId = UserData().getSessionId(userInfo.userId);
  1367. MsgHandler.updateActiveSesstion(sessionId);
  1368. AppNavigator.pushChatPage(context, userInfo.userId,
  1369. enterType: 3, enterContent: msgModel);
  1370. });
  1371. },
  1372. child: Container(
  1373. color: const Color(0xFF3875E9),
  1374. alignment: Alignment.center,
  1375. child: Text(
  1376. I18n.of(context).agree,
  1377. style: TextStyle(fontSize: 18, color: Colors.white),
  1378. ),
  1379. ),
  1380. )),
  1381. InkWell(
  1382. onTap: () {
  1383. doFriendApply(2, (msg) {
  1384. showToast(msg);
  1385. Navigator.of(context).pop();
  1386. MessageMgr().emit('do_friend_apply',
  1387. {'userId': userInfo.userId, 'state': 2});
  1388. });
  1389. },
  1390. child: Container(
  1391. alignment: Alignment.center,
  1392. color: const Color(0xFFA8D3FF),
  1393. width: Screen.width * 0.33,
  1394. child: Text(
  1395. I18n.of(context).refuse,
  1396. style:
  1397. TextStyle(fontSize: 18, color: const Color(0xFF007EFF)),
  1398. ),
  1399. ))
  1400. ],
  1401. ));
  1402. }
  1403. //自定义item
  1404. Widget _bottomBorderBox(
  1405. String textLeft, String textRight, bool showBorder, callback,
  1406. {showIcon: false}) {
  1407. Widget left = new Container(
  1408. margin: EdgeInsets.only(right: 20),
  1409. width: 90,
  1410. child: new Text(
  1411. textLeft,
  1412. textScaleFactor: 1.0,
  1413. style: TextStyle(fontSize: 14),
  1414. ));
  1415. Widget right = new Expanded(
  1416. child: Text(
  1417. textRight,
  1418. textScaleFactor: 1.0,
  1419. style: TextStyle(fontSize: 13, color: Constants.GreyTextColor),
  1420. ),
  1421. );
  1422. return InkWell(
  1423. highlightColor: Colors.transparent,
  1424. radius: 0.0,
  1425. onTap: callback,
  1426. child: Container(
  1427. decoration: showBorder
  1428. ? BoxDecoration(border: Border(bottom: Constants.GreyBorderSide))
  1429. : null,
  1430. alignment: Alignment.center,
  1431. padding: EdgeInsets.only(
  1432. top: 17,
  1433. bottom: 17,
  1434. ),
  1435. margin: EdgeInsets.only(left: 45, bottom: 0, right: 10),
  1436. child: Row(
  1437. crossAxisAlignment: CrossAxisAlignment.start,
  1438. children: <Widget>[
  1439. left,
  1440. right,
  1441. showIcon
  1442. ? Padding(
  1443. padding: EdgeInsets.only(right: 10),
  1444. child: Icon(
  1445. IconData(0xe63c, fontFamily: 'iconfont'),
  1446. size: 22.0,
  1447. color: Color(AppColors.TabIconNormal),
  1448. ))
  1449. : Container()
  1450. ],
  1451. ),
  1452. ));
  1453. }
  1454. testChatPermission(callback) {
  1455. becomeVip() {
  1456. Navigator.of(context).push(
  1457. new MaterialPageRoute(
  1458. builder: (context) {
  1459. return VipPage();
  1460. },
  1461. ),
  1462. );
  1463. }
  1464. payCallback() {
  1465. if (Provider.of<MoneyChangeProvider>(context).money <
  1466. UserData().accountPrice) {
  1467. Navigator.of(context).pop();
  1468. CustomUI.buildOneConfirm(context, I18n.of(context).balance_insufficien,
  1469. I18n.of(context).recharge, () {
  1470. Navigator.of(context).pop();
  1471. ChargeMoney.showChargeSheet(context, () {
  1472. setState(() {});
  1473. });
  1474. });
  1475. return;
  1476. }
  1477. Navigator.of(context).pop();
  1478. HttpUtil().buyChatAccount(
  1479. UserData().accountPrice, userInfo.userId, context, () {
  1480. setState(() {
  1481. isAuthority = true;
  1482. });
  1483. });
  1484. }
  1485. freeTime() {
  1486. HttpUtil().userFreeTime(context, userInfo.userId, 2, () {
  1487. UserData().basicInfo.usedNum++;
  1488. Navigator.of(context).pop();
  1489. setState(() {
  1490. isAuthority = true;
  1491. });
  1492. });
  1493. }
  1494. //自己是女性,且未认证,提示去认证(好友除外)
  1495. if (!UserData().isMan() &&
  1496. !UserData().basicInfo.isAttestation &&
  1497. !FriendListMgr().isMyFriend(userInfo.userId)) {
  1498. CustomUI.buildNotTrue(context);
  1499. return;
  1500. }
  1501. print('isAuthority $isAuthority');
  1502. var tipStr = '';
  1503. //没有解锁账号,并且对方禁止陌生人聊天
  1504. if (!isAuthority && !userInfo.isCanStrangerNews) {
  1505. tipStr = I18n.of(context).stranger_close;
  1506. } else {
  1507. tipStr = I18n.of(context).unlock_information;
  1508. if (userInfo.sex == 2 && !userInfo.isAttestation) {
  1509. tipStr += '(${I18n.of(context).not_true_woman})';
  1510. }
  1511. }
  1512. if (isAuthority) {
  1513. if (callback != null) callback();
  1514. } else {
  1515. //如果自己是男性,vip提示免费次数,次数用完或者非vip提示购买
  1516. if (UserData().isMan()) {
  1517. if (UserData().isVip) {
  1518. UserData().basicInfo.freeNum < UserData().basicInfo.usedNum
  1519. ? CustomUI.buildOneConfirm(
  1520. context,
  1521. tipStr,
  1522. I18n.of(context)
  1523. .pay_unlock
  1524. .replaceFirst('/s1', UserData().accountPrice.toString()),
  1525. payCallback)
  1526. : CustomUI.buildOneConfirm(
  1527. context,
  1528. tipStr,
  1529. I18n.of(context).unlock_choose,
  1530. freeTime,
  1531. );
  1532. } else {
  1533. CustomUI.buildTowConfirm(
  1534. context,
  1535. tipStr,
  1536. I18n.of(context).become_member,
  1537. becomeVip,
  1538. I18n.of(context)
  1539. .pay_unlock
  1540. .replaceFirst('/s1', UserData().accountPrice.toString()),
  1541. payCallback);
  1542. }
  1543. }
  1544. }
  1545. }
  1546. buyChatAccount() {
  1547. if (widget.fromWhere != null && widget.fromWhere == 0) {
  1548. ///如果是聊天界面跳转过来的,直接返回
  1549. Navigator.of(context).pop();
  1550. } else {
  1551. testChatPermission(() {
  1552. int fdId = userInfo.userId;
  1553. int sessionId = UserData().getSessionId(fdId);
  1554. MsgHandler.updateActiveSesstion(sessionId);
  1555. AppNavigator.pushChatPage(context, fdId);
  1556. });
  1557. }
  1558. }
  1559. clickChatAccout() {
  1560. if (widget.fromWhere != null && widget.fromWhere == 0) {
  1561. ///如果是聊天界面跳转过来的,直接返回
  1562. Navigator.of(context).pop();
  1563. } else {
  1564. testChatPermission(() {});
  1565. }
  1566. }
  1567. buyPhoto() {
  1568. //女性用户付费,男性用户会员的话免费解锁,非会员付费解锁
  1569. becomeVip() {
  1570. Navigator.of(context).push(
  1571. new MaterialPageRoute(
  1572. builder: (context) {
  1573. return VipPage();
  1574. },
  1575. ),
  1576. );
  1577. }
  1578. payCallback() {
  1579. if (Provider.of<MoneyChangeProvider>(context).money < userInfo.price) {
  1580. Navigator.of(context).pop();
  1581. CustomUI.buildOneConfirm(context, I18n.of(context).balance_insufficien,
  1582. I18n.of(context).recharge, () {
  1583. Navigator.of(context).pop();
  1584. ChargeMoney.showChargeSheet(context, () {
  1585. setState(() {});
  1586. });
  1587. });
  1588. return;
  1589. }
  1590. Navigator.of(context).pop();
  1591. HttpUtil().buyPictures(userInfo.price, userInfo.userId, context, () {
  1592. setState(() {
  1593. isBuyPicture = true;
  1594. });
  1595. });
  1596. }
  1597. freeTime() {
  1598. HttpUtil().userFreeTime(context, userInfo.userId, 1, () {
  1599. UserData().basicInfo.usedNum++;
  1600. Navigator.of(context).pop();
  1601. setState(() {
  1602. isBuyPicture = true;
  1603. });
  1604. });
  1605. }
  1606. String title = I18n.of(context).unlock_user.replaceFirst(
  1607. '/s1',
  1608. Provider.of<RefNameProvider>(context)
  1609. .getRefName(userInfo.userId, userInfo.nickName),
  1610. );
  1611. if (!UserData().isMan()) {
  1612. CustomUI.buildOneConfirm(
  1613. context,
  1614. title,
  1615. I18n.of(context)
  1616. .pay_unlock
  1617. .replaceFirst('/s1', userInfo.price.toString()),
  1618. payCallback);
  1619. } else if (UserData().isVip) {
  1620. if (UserData().basicInfo.freeNum < UserData().basicInfo.usedNum) {
  1621. CustomUI.buildOneConfirm(
  1622. context,
  1623. title,
  1624. I18n.of(context)
  1625. .pay_unlock
  1626. .replaceFirst('/s1', userInfo.price.toString()),
  1627. payCallback);
  1628. } else {
  1629. CustomUI.buildOneConfirm(
  1630. context, title, I18n.of(context).unlock_choose, freeTime);
  1631. }
  1632. } else {
  1633. CustomUI.buildTowConfirm(
  1634. context,
  1635. title,
  1636. I18n.of(context).become_member,
  1637. becomeVip,
  1638. I18n.of(context)
  1639. .pay_unlock
  1640. .replaceFirst('/s1', userInfo.price.toString()),
  1641. payCallback);
  1642. }
  1643. }
  1644. Widget _buildBasicInfo() {
  1645. String wechat = '';
  1646. String facebook = '';
  1647. bool isHidden = userInfo.accountStatus == 1;
  1648. //隐藏社交账号
  1649. if (isHidden) {
  1650. wechat = I18n.of(context).ask_me;
  1651. facebook = I18n.of(context).ask_me;
  1652. } else {
  1653. wechat = isAuthority ? userInfo.wechat : I18n.of(context).filled_in;
  1654. facebook = isAuthority ? userInfo.facebook : I18n.of(context).filled_in;
  1655. }
  1656. heightStr = (userInfo.height == 0.0 || userInfo.height == null)
  1657. ? I18n.of(context).not_show
  1658. : '${userInfo.height.toInt()}CM';
  1659. weightStr = (userInfo.weight == 0.0 || userInfo.weight == null)
  1660. ? I18n.of(context).not_show
  1661. : '${userInfo.weight.toInt()}KG';
  1662. List<Widget> basicList = [
  1663. Container(
  1664. padding: EdgeInsets.symmetric(horizontal: 10),
  1665. child: FullWidthButton(
  1666. iconCode: 0xe676,
  1667. iconColor: 0xFF57BBFB,
  1668. title: isMan
  1669. ? I18n.of(context).his_profile
  1670. : I18n.of(context).her_profile,
  1671. showDivider: true,
  1672. showRightIcon: false,
  1673. onPressed: () {})),
  1674. userInfo.height != null && userInfo.height != 0
  1675. ? _bottomBorderBox(I18n.of(context).height, heightStr, true, () {})
  1676. : Container(),
  1677. userInfo.weight != null && userInfo.weight != 0
  1678. ? _bottomBorderBox(I18n.of(context).weight, weightStr, true, () {})
  1679. : Container(),
  1680. _bottomBorderBox(I18n.of(context).Resident_city, dateRange, true, () {}),
  1681. _bottomBorderBox(I18n.of(context).expect_lover, lovePeople, true, () {}),
  1682. (userInfo.wechat != null && userInfo.wechat != '')
  1683. ? _bottomBorderBox(
  1684. I18n.of(context).wechat_number, wechat, true, clickChatAccout,
  1685. showIcon: !isAuthority)
  1686. : Container(),
  1687. (userInfo.facebook != null && userInfo.facebook != '')
  1688. ? _bottomBorderBox(
  1689. I18n.of(context).facebook, facebook, true, clickChatAccout,
  1690. showIcon: !isAuthority)
  1691. : Container(),
  1692. ];
  1693. return Container(
  1694. width: cardWidth,
  1695. margin: EdgeInsets.only(top: Separate_Size),
  1696. decoration: BoxDecoration(
  1697. color: Colors.white,
  1698. border: Border(
  1699. top: Constants.GreyBorderSide,
  1700. bottom: Constants.GreyBorderSide)),
  1701. child: new Column(
  1702. children: basicList,
  1703. ));
  1704. }
  1705. Widget _buildBottomTips() {
  1706. return Container(
  1707. margin: EdgeInsets.only(bottom: 10, left: 10, right: 10, top: 10),
  1708. width: cardWidth,
  1709. alignment: Alignment.center,
  1710. child: Text(I18n.of(context).not_illage,
  1711. textScaleFactor: 1.0,
  1712. textAlign: TextAlign.center,
  1713. style: TextStyle(fontSize: 12, color: Colors.grey)),
  1714. );
  1715. }
  1716. Widget _buildMoneyBox() {
  1717. //认证、钱包、隐私连麦设置
  1718. return Container(
  1719. margin: EdgeInsets.only(top: Separate_Size),
  1720. decoration: BoxDecoration(
  1721. color: Colors.white,
  1722. border: Border(
  1723. top: Constants.GreyBorderSide, bottom: Constants.GreyBorderSide)),
  1724. padding: EdgeInsets.only(top: 4, bottom: 4, left: 10, right: 10),
  1725. child: Column(
  1726. children: <Widget>[
  1727. isMan
  1728. ? Container()
  1729. : FullWidthButton(
  1730. iconCode: 0xe687,
  1731. iconColor: 0xFFFF7752,
  1732. title: I18n.of(context).Goddess_heat,
  1733. showDivider: true,
  1734. showRightIcon: true,
  1735. onPressed: () {
  1736. Navigator.of(context).push(
  1737. new MaterialPageRoute(
  1738. builder: (context) {
  1739. return GoddessHotPage(
  1740. userId: userInfo.userId,
  1741. );
  1742. },
  1743. ),
  1744. );
  1745. },
  1746. ),
  1747. isMan
  1748. ? FullWidthButton(
  1749. iconCode: 0xe68e,
  1750. iconColor: 0xFF3D83E6,
  1751. title: I18n.of(context).member,
  1752. description: UserData().isVip
  1753. ? I18n.of(context)
  1754. .expires
  1755. .replaceFirst('/s1', endTime.split(' ')[0])
  1756. : I18n.of(context).enjoy_privileges,
  1757. showDivider: true,
  1758. onPressed: () {
  1759. Navigator.of(context).push(
  1760. new MaterialPageRoute(
  1761. builder: (context) {
  1762. return VipPage();
  1763. },
  1764. ),
  1765. );
  1766. },
  1767. )
  1768. : FullWidthButton(
  1769. iconCode: 0xe688,
  1770. iconColor: 0xFF3D83E6,
  1771. title: isAttestation
  1772. ? I18n.of(context).certified_video
  1773. : I18n.of(context).authenticate,
  1774. showDivider: true,
  1775. onPressed: () {
  1776. Navigator.of(context).push(
  1777. new MaterialPageRoute(
  1778. builder: (context) {
  1779. return isAttestation
  1780. ? VideoPage(
  1781. userId: userInfo.userId,
  1782. )
  1783. : VerificationCenterPage();
  1784. },
  1785. ),
  1786. );
  1787. },
  1788. ),
  1789. FullWidthButton(
  1790. iconCode: 0xe68a,
  1791. iconColor: 0xFF4CB871,
  1792. title: I18n.of(context).wallet,
  1793. description:
  1794. '${Provider.of<MoneyChangeProvider>(context).money}${I18n.of(context).mask_coin}',
  1795. showDivider: true,
  1796. onPressed: () {
  1797. Navigator.of(context).push(
  1798. new MaterialPageRoute(
  1799. builder: (context) {
  1800. return MoneyPage();
  1801. },
  1802. ),
  1803. );
  1804. },
  1805. ),
  1806. _buildPicture(),
  1807. ],
  1808. ),
  1809. );
  1810. }
  1811. Widget _buildIcon(code, str, isCanHit, callback, {iconSize = 28.0}) {
  1812. var color = isCanHit ? Constants.BlueTextColor : Constants.GreyTextColor;
  1813. return InkWell(
  1814. onTap: isCanHit
  1815. ? callback
  1816. : () {
  1817. showToast(isMan
  1818. ? I18n.of(context).view_user
  1819. : I18n.of(context).view_user2);
  1820. },
  1821. child: Row(
  1822. children: <Widget>[
  1823. Icon(
  1824. IconData(
  1825. code,
  1826. fontFamily: 'iconfont',
  1827. ),
  1828. color: color,
  1829. size: iconSize,
  1830. ),
  1831. Padding(
  1832. child: Text(
  1833. str,
  1834. textScaleFactor: 1.0,
  1835. style: TextStyle(color: color, fontSize: 12),
  1836. ),
  1837. padding: EdgeInsets.only(left: 5))
  1838. ],
  1839. ));
  1840. }
  1841. @override
  1842. Widget build(BuildContext context) {
  1843. Size screenSize = MediaQuery.of(context).size;
  1844. cardWidth = screenSize.width;
  1845. Widget appBar = AppBar(
  1846. leading: isMyself ? Container() : CustomUI.buildCustomLeading(context),
  1847. titleSpacing: isMyself ? -40 : NavigationToolbar.kMiddleSpacing,
  1848. title: isMyself
  1849. ? Text(
  1850. userInfo.nickName,
  1851. //I18n.of(context).me,
  1852. textScaleFactor: 1.0,
  1853. style: Constants.MainTitleStyle,
  1854. )
  1855. : Text(
  1856. WebData().subUserName(Provider.of<RefNameProvider>(context)
  1857. .getRefName(userInfo.userId, userInfo.nickName)),
  1858. textScaleFactor: 1.0,
  1859. style: TextStyle(color: Constants.BlackTextColor)),
  1860. centerTitle: !isMyself,
  1861. elevation: 1,
  1862. actions: <Widget>[
  1863. isMyself
  1864. ? Container(
  1865. padding: EdgeInsets.only(right: 15),
  1866. alignment: Alignment.center,
  1867. child: new InkWell(
  1868. child: CircleAvatar(
  1869. backgroundColor: Constants.GreyBackgroundColor,
  1870. radius: 15.75,
  1871. child: Icon(
  1872. IconData(0xe685, fontFamily: 'iconfont'),
  1873. color: Constants.BlackTextColor,
  1874. size: 20,
  1875. )),
  1876. onTap: () {
  1877. Share.share('https://henho.jphgames.com/');
  1878. },
  1879. ),
  1880. )
  1881. : Container(),
  1882. isMyself
  1883. ? Container()
  1884. : Container(
  1885. alignment: Alignment.center,
  1886. child: new InkWell(
  1887. child: new Padding(
  1888. padding: EdgeInsets.only(
  1889. right: 15, left: 15, top: 10, bottom: 10),
  1890. child: Icon(
  1891. IconData(
  1892. 0xe621,
  1893. fontFamily: 'iconfont',
  1894. ),
  1895. color: Constants.BlackTextColor,
  1896. size: 20,
  1897. ),
  1898. ),
  1899. onTap: () {
  1900. showModalBottomSheet(
  1901. context: registKey.currentContext,
  1902. builder: (BuildContext context) {
  1903. return SafeArea(
  1904. child: Container(
  1905. height: 137,
  1906. child: Column(
  1907. children: <Widget>[
  1908. InkWell(
  1909. onTap: () async {
  1910. Navigator.of(context).pop();
  1911. Navigator.of(context).push(
  1912. new MaterialPageRoute(
  1913. builder: (context) {
  1914. return AddFriendPage(
  1915. userId: userInfo.userId,
  1916. pageType:
  1917. SendMessagePageType.Remark,
  1918. originalName: Provider.of<
  1919. RefNameProvider>(
  1920. context)
  1921. .getRefName(userInfo.userId,
  1922. userInfo.nickName));
  1923. },
  1924. ),
  1925. );
  1926. },
  1927. child: Container(
  1928. alignment: Alignment.center,
  1929. height: 45,
  1930. child: Text(I18n.of(context).Remark,
  1931. textScaleFactor: 1.0,
  1932. style: TextStyle(
  1933. fontSize: 18,
  1934. color: Constants
  1935. .BlackTextColor)))),
  1936. Divider(height: 1),
  1937. InkWell(
  1938. child: Container(
  1939. height: 45,
  1940. alignment: Alignment.center,
  1941. child: Text(
  1942. isblack
  1943. ? I18n.of(context).remove_blacklist
  1944. : I18n.of(context).blacklist,
  1945. textScaleFactor: 1.0,
  1946. style: TextStyle(
  1947. fontSize: 18,
  1948. color: Constants.BlackTextColor),
  1949. ),
  1950. ),
  1951. onTap: isblack
  1952. ? () async {
  1953. HttpUtil().cancleBlackUser(
  1954. userInfo.userId, () {
  1955. Navigator.of(context).pop();
  1956. isblack = false;
  1957. });
  1958. }
  1959. : _buildConfirmBlack,
  1960. ),
  1961. Divider(height: 1),
  1962. InkWell(
  1963. onTap: () async {
  1964. Navigator.of(context).pop();
  1965. Navigator.of(context).push(
  1966. new MaterialPageRoute(
  1967. builder: (context) {
  1968. return InformUserPage(
  1969. isMan: isMan,
  1970. userId: userInfo.userId,
  1971. );
  1972. },
  1973. ),
  1974. );
  1975. },
  1976. child: Container(
  1977. alignment: Alignment.center,
  1978. height: 45,
  1979. child: Text(
  1980. I18n.of(context).anonymous_report,
  1981. textScaleFactor: 1.0,
  1982. style: TextStyle(
  1983. fontSize: 18,
  1984. color: Constants
  1985. .BlackTextColor)))),
  1986. ],
  1987. ),
  1988. ),
  1989. );
  1990. },
  1991. ).then((val) {});
  1992. },
  1993. ),
  1994. ),
  1995. ],
  1996. );
  1997. var bottomWidget = Container(
  1998. height: 55,
  1999. decoration: BoxDecoration(
  2000. border: Border(top: BorderSide(color: Color(0xffeaeaea))),
  2001. color: Constants.LightGreyBackgroundColor,
  2002. ),
  2003. child: Row(
  2004. mainAxisAlignment: MainAxisAlignment.spaceEvenly,
  2005. children: widget.addMode == 1 || widget.addMode == 3
  2006. ? <Widget>[_inviteFdBtn()]
  2007. : (widget.addMode == 2
  2008. ? [_dealInvite()]
  2009. : <Widget>[
  2010. _buildIcon(0xe68b, I18n.of(context).evaluate, true,
  2011. () async {
  2012. Map data = {
  2013. "userid": userInfo.userId,
  2014. 'evaluateuserid': UserData().basicInfo.userId,
  2015. };
  2016. data['sign'] = TokenMgr().getSign(data);
  2017. Response res = await HttpUtil().post('evaluate/user/info',
  2018. data: data, isShowLoading: true);
  2019. Map resData = res.data;
  2020. print(resData);
  2021. if (resData['code'] == 0) {
  2022. Navigator.of(context).push(TutorialOverlay(
  2023. child: ApplyContent(
  2024. userId: userInfo.userId,
  2025. isMan: isMan,
  2026. userInfo: resData['data'])));
  2027. } else {
  2028. showToast(resData['msg']);
  2029. }
  2030. }),
  2031. _buildIcon(
  2032. 0xe62f, I18n.of(context).chat, isCanWatch, onAudio)
  2033. ]),
  2034. ),
  2035. );
  2036. Widget content = Container(
  2037. color: Colors.white,
  2038. child: SafeArea(
  2039. child: Scaffold(
  2040. bottomNavigationBar: !isMyself ? bottomWidget : null,
  2041. appBar: appBar,
  2042. key: registKey,
  2043. body: SafeArea(
  2044. child: Container(
  2045. height: MediaQuery.of(context).size.height,
  2046. width: MediaQuery.of(context).size.width,
  2047. color: AppColors.BackgroundColor,
  2048. child: SingleChildScrollView(
  2049. child: _buildBody(),
  2050. ),
  2051. )))),
  2052. );
  2053. return CustomUI.buildPageLoading(context, content, !isLoadingFish);
  2054. }
  2055. //连麦
  2056. onAudio() async {
  2057. testChatPermission(() async {
  2058. if (userInfo.chatStatus == 0) {
  2059. showToast(I18n.of(context).cantt_voice);
  2060. return;
  2061. }
  2062. if (BlacklistMgr.isBlack(userInfo.userId)) {
  2063. return;
  2064. }
  2065. //对方关闭陌生人消息,则提示
  2066. if (!userInfo.isCanStrangerNews) {
  2067. showToast(I18n.of(context).stranger_close_tips);
  2068. return;
  2069. }
  2070. if (await CustomUI.showPermissionSetting(context,
  2071. PermissionGroup.microphone, I18n.of(context).video_permission)) {
  2072. AppNavigator.pushAudioChatPage(context, userInfo);
  2073. } else {
  2074. showToast(I18n.of(context).need_record);
  2075. }
  2076. });
  2077. }
  2078. }