diff --git a/src/forge/Head/AppPullRefresh.jsx b/src/forge/Head/AppPullRefresh.jsx
new file mode 100644
index 000000000..d609c176e
--- /dev/null
+++ b/src/forge/Head/AppPullRefresh.jsx
@@ -0,0 +1,108 @@
+import React, { Component } from 'react';
+import PropTypes from 'prop-types';
+import { Icon } from 'antd';
+import _ from 'lodash';
+import Nodata from '../Nodata';
+
+
+class PullRefresh extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ }
+ this.pullRef = {};
+ // 节流
+ this.onScrollList = _.throttle(this.handleScroll, 200, {
+ leading: false,
+ trailing: true,
+ });
+ }
+
+ componentDidMount() {
+ let dom = document.querySelector('.pull-refresh-wrap');
+ dom && dom.addEventListener('scroll', this.onScrollList);
+ }
+
+ componentWillUnmount() {
+ let dom = document.querySelector('.pull-refresh-wrap');
+ dom && dom.removeEventListener('scroll', this.onScrollList)
+ }
+
+
+ handleScroll = () => {
+ if (this.props.count < this.props.pageSize) return;
+ if (this.props.type === 1 || this.props.type === 2) return;
+ const wrap = this.pullRef;
+ const currentScroll = wrap.scrollTop + wrap.clientHeight
+
+ // 触底
+ if (currentScroll >= (wrap.scrollHeight - 10)) {
+ this.loadData()
+ }
+ }
+
+
+ handleLoadClick = () => {
+ this.loadData();
+ }
+
+ loadData = () => {
+ this.props.onPullRefresh()
+ }
+
+
+ renderLoading() {
+ switch (this.props.type) {
+ case 0: // 加载更多
+ return
显示更多
+ case 1: // 加载中
+ return (
+
+
+ 加载中...
+
+ )
+ case 2: // 无样式
+ return 没有更多了
+ default:
+ return 没有更多了
+ }
+ }
+
+
+ render() {
+ const { className, count, children } = this.props;
+ return (
+ { this.pullRef = dom }}
+ >
+
+ {children}
+
+ {
+ count < 1 &&
+ }
+
+ {/* 大于分页数据才显示loading */}
+ {/* {this.props.count >= this.props.pageSize ? this.renderLoading() : null} */}
+
+
+
+ )
+ }
+
+}
+
+
+PullRefresh.propTypes = {
+ className: PropTypes.string,
+ children: PropTypes.any,
+ onPullRefresh: PropTypes.func.isRequired,
+ type: PropTypes.oneOf([0, 1, 2]),
+ count: PropTypes.number.isRequired,
+ pageSize: PropTypes.number.isRequired,
+}
+
+
+export default PullRefresh
diff --git a/src/forge/Head/Header.js b/src/forge/Head/Header.js
index 6232439e1..776e9e44f 100644
--- a/src/forge/Head/Header.js
+++ b/src/forge/Head/Header.js
@@ -48,6 +48,7 @@ class NewHeader extends Component {
settings: null,
visiblemyss: false,
openSearch:false,
+ visible:false, //浮动消息框展示控制
}
}
componentDidMount() {
@@ -93,9 +94,6 @@ class NewHeader extends Component {
this.setState({
user: newProps.user
})
- if (newProps.Headertop !== undefined) {
- old_url = newProps.Headertop.old_url
- }
}
educoderlogin = () => {
@@ -277,8 +275,12 @@ class NewHeader extends Component {
)
}
+ handleVisibleChange = visible => {
+ this.setState({ visible });
+ };
+
render() {
- const { match} = this.props;
+ const { match ,hisroty ,showNotification} = this.props;
let current_user = this.props.user;
let {
AccountProfiletype,
@@ -287,6 +289,7 @@ class NewHeader extends Component {
headtypesonClickbool,
headtypess,
settings,
+ visible,
} = this.state;
/*用户名称 用户头像url*/
let activeIndex = false;
@@ -366,6 +369,7 @@ class NewHeader extends Component {
let search_url = settings && settings.common && settings.common.search;
let notice_url = settings && settings.common && settings.common.notice;
+ console.log(current_user);
return (