From c64cac4e431e358f3766603bb5d63ef40cad7529 Mon Sep 17 00:00:00 2001 From: xufei <727302827@qq.com> Date: Thu, 28 May 2026 14:49:50 +0800 Subject: [PATCH] =?UTF-8?q?2026.5.28=20=E4=B8=AA=E4=BA=BA=E4=BF=A1?= =?UTF-8?q?=E6=81=AFbug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/home/unit/unit_join_detail_page.dart | 3 ++- lib/pages/mine/mine_page.dart | 1 + lib/pages/user/full_userinfo_page.dart | 15 ++++++++++++--- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/lib/pages/home/unit/unit_join_detail_page.dart b/lib/pages/home/unit/unit_join_detail_page.dart index 43af5c1..0576539 100644 --- a/lib/pages/home/unit/unit_join_detail_page.dart +++ b/lib/pages/home/unit/unit_join_detail_page.dart @@ -111,7 +111,7 @@ class _UnitJoinDetailPageState extends State { @override Widget build(BuildContext context) { bool isShow = _isEdit; - if (!_isEdit && FormUtils.hasValue(pd, 'userAvatarUrl')) { + if (!_isEdit) {// && FormUtils.hasValue(pd, 'userAvatarUrl') isShow = true; } return Scaffold( @@ -125,6 +125,7 @@ class _UnitJoinDetailPageState extends State { isShow ? ListView( children: [ RepairedPhotoSection( + key: ValueKey(pd['userAvatarUrl']), title: '照片', inlineSingle: true, isRequired: _isEdit, diff --git a/lib/pages/mine/mine_page.dart b/lib/pages/mine/mine_page.dart index 69348e4..0175d20 100644 --- a/lib/pages/mine/mine_page.dart +++ b/lib/pages/mine/mine_page.dart @@ -3,6 +3,7 @@ import 'dart:convert'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; +import 'package:qhd_prevention/constants/app_enums.dart'; import 'package:qhd_prevention/customWidget/custom_alert_dialog.dart'; import 'package:qhd_prevention/customWidget/custom_button.dart'; import 'package:qhd_prevention/customWidget/toast_util.dart'; diff --git a/lib/pages/user/full_userinfo_page.dart b/lib/pages/user/full_userinfo_page.dart index 83b1614..1bd9d53 100644 --- a/lib/pages/user/full_userinfo_page.dart +++ b/lib/pages/user/full_userinfo_page.dart @@ -96,7 +96,10 @@ class _FullUserinfoPageState extends State { ); if (res['success']) { final data = res['data']; - pd = data; + + setState(() { + pd = data; + }); _genderText = data['sex'] ?? ''; _birthText = data['birthday'] ?? ''; @@ -115,6 +118,9 @@ class _FullUserinfoPageState extends State { } }); if ('${pd['userAvatarUrl']}'.isEmpty) { + // setState(() { + // pd['userAvatarUrl'] = widget.headImage; + // }); await FileApi.getImagePathWithType( eqForeignKey, '', @@ -122,7 +128,9 @@ class _FullUserinfoPageState extends State { ).then((result) { if (result['success']) { List files = result['data'] ?? []; - pd['userAvatarUrl'] = files.map((item) => item['filePath'].toString()).toList().first; + setState(() { + pd['userAvatarUrl'] = files.map((item) => item['filePath'].toString()).toList().first; + }); } }); } @@ -359,7 +367,7 @@ class _FullUserinfoPageState extends State { @override Widget build(BuildContext context) { bool isShow = _isEdit; - if (!_isEdit && FormUtils.hasValue(pd, 'userAvatarUrl')) { + if (!_isEdit ) {//&& FormUtils.hasValue(pd, 'userAvatarUrl') isShow = true; } String token = SessionService.instance.token ?? ''; @@ -406,6 +414,7 @@ class _FullUserinfoPageState extends State { ? ListView( children: [ RepairedPhotoSection( + key: ValueKey(pd['userAvatarUrl']), title: '人脸照片', inlineSingle: true, isRequired: _isEdit,