From 4fa2b93067debbe533469d742b256df95c8d4e47 Mon Sep 17 00:00:00 2001 From: blak-kong <546598185@qq.com> Date: Mon, 15 Jan 2024 14:30:13 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E6=88=91=E7=9A=84=E9=A1=B5?= =?UTF-8?q?=EF=BC=8C=E7=94=A8=E6=88=B7=E4=BF=A1=E6=81=AF=E5=88=B7=E6=96=B0?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/popup/popup-site-swiper.tsx | 3 --- src/pages/index/index.tsx | 2 +- src/pages/user/user.tsx | 18 ++++++++++++++++-- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/components/popup/popup-site-swiper.tsx b/src/components/popup/popup-site-swiper.tsx index b0cdb19..fe63033 100644 --- a/src/components/popup/popup-site-swiper.tsx +++ b/src/components/popup/popup-site-swiper.tsx @@ -194,9 +194,6 @@ export default class PopupSiteSwiper extends Component { style="background-color: transparent;" show={isShow} closeOnClickOverlay={false} - // closeable={true} - // closeIcon="close" - // closeIconPosition="top-right" round overlayStyle="width: 100vw;padding: 0;" onClick={this.onClickStop} diff --git a/src/pages/index/index.tsx b/src/pages/index/index.tsx index c0b4bc2..e0215a8 100644 --- a/src/pages/index/index.tsx +++ b/src/pages/index/index.tsx @@ -115,7 +115,7 @@ class Index extends Component { if (mobile) { this.GetNoReadMessageNum(); // 查询是否有消息 - this.RefreshWxUserInfo(); + // this.RefreshWxUserInfo(); // if (!this.state.isShowIndexFlag) { // // 仅初次进入首页运行 diff --git a/src/pages/user/user.tsx b/src/pages/user/user.tsx index 8f03d85..b26ac7f 100644 --- a/src/pages/user/user.tsx +++ b/src/pages/user/user.tsx @@ -12,6 +12,8 @@ import { connect } from "react-redux"; import { userRefresh } from "../../store/features/userInfo"; /*** redux end ***/ +import { RefreshWxUserInfo } from "../../utils/Interface"; + import "taro-ui/dist/style/components/button.scss"; // 按需引入 import "./user.less"; @@ -46,7 +48,9 @@ class User extends Component { } async onLoad() {} - componentDidMount() {} + componentDidMount() { + this.initData(); + } componentWillUnmount() {} @@ -59,7 +63,17 @@ class User extends Component { componentDidHide() {} - async initData() {} + async initData() { + this.RefreshWxUserInfo(); + } + + // 刷新用户信息 + RefreshWxUserInfo = async () => { + let res = await RefreshWxUserInfo(); + if (res.data.code === 200) { + this.props.userRefresh(res.data.data); + } + }; postSaveMessage = async () => { let { messageInfo } = this.state;