Socket
Socket
Sign inDemoInstall

bestnihon-react-components

Package Overview
Dependencies
Maintainers
1
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bestnihon-react-components - npm Package Compare versions

Comparing version 2.1.7 to 2.1.8

umd/main.67b6ab3d.css

0

es/AutoScrollTab/AutoScrollTab.js

@@ -0,0 +0,0 @@ var _class, _temp, _initialiseProps;

@@ -0,0 +0,0 @@ var _class, _temp, _initialiseProps;

82

es/ScrollView/ScrollView.js

@@ -8,2 +8,3 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

import React, { Component } from 'react';
import Common from '../utils/Common';
import './ScrollView.css';

@@ -166,3 +167,3 @@ var TOP = 'top';

var itemHeight = parseFloat(window.getComputedStyle(_this.children).height);
_this.wrap.style.height = wrapHeight + 'px';
wrapHeight && (_this.wrap.style.height = wrapHeight + 'px');
_this.setState({

@@ -269,25 +270,18 @@ fillAttr: itemHeight < wrapHeight ? wrapHeight - itemHeight : false

ScrollView.prototype.componentDidMount = function componentDidMount() {
var _this2 = this;
var scrollX = this.state.scrollX;
var _state = this.state,
wrapHeight = _state.wrapHeight,
scrollX = _state.scrollX;
this.setState({
wrapHeight: !scrollX && (wrapHeight ? wrapHeight : parseFloat(window.getComputedStyle(this.wrap.parentNode).height))
}, function () {
if (scrollX) {
_this2.setTarget();
} else {
_this2.wrap.addEventListener('touchstart', _this2.handleTouchStart);
_this2.wrap.addEventListener('touchmove', _this2.handleTouchMove);
_this2.wrap.addEventListener('touchend', _this2.handleTouchEnd);
_this2.fetchData();
_this2.fill(true);
}
});
if (scrollX) {
this.setTarget();
} else {
this.wrap.addEventListener('touchstart', this.handleTouchStart);
this.wrap.addEventListener('touchmove', this.handleTouchMove);
this.wrap.addEventListener('touchend', this.handleTouchEnd);
this.fetchData();
this.fill(true);
}
};
ScrollView.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
var _this3 = this;
var _this2 = this;

@@ -298,17 +292,16 @@ var requestState = nextProps.requestState,

itemKey = nextProps.itemKey;
var _state2 = this.state,
isPullUpStatus = _state2.isPullUpStatus,
isPullDownStatus = _state2.isPullDownStatus,
animateTime = _state2.animateTime;
var _state = this.state,
isPullUpStatus = _state.isPullUpStatus,
isPullDownStatus = _state.isPullDownStatus,
animateTime = _state.animateTime;
console.log('scrollveiw nextProps', nextProps, requestState);
var OO = {
// 上拉加载
pullUp: function pullUp() {
_this3.translate();
_this2.translate();
setTimeout(function () {
_this3.setState({
_this2.setState({
isPullUpStatus: null
}, function () {
_this3.fill();
_this2.fill();
});

@@ -321,8 +314,8 @@ }, animateTime);

// 但当用户停留在 loading 不滚动的时候 就给他来个 动效
_this3.wrap.scrollTop === 0 && _this3.translate();
_this2.wrap.scrollTop === 0 && _this2.translate();
setTimeout(function () {
_this3.setState({
_this2.setState({
isPullDownStatus: null
}, function () {
return _this3.fill();
return _this2.fill();
});

@@ -339,7 +332,7 @@ }, animateTime);

this.state.itemIndex !== itemIndex && this.setState({ itemIndex: itemIndex }, function () {
return _this3.setTarget();
return _this2.setTarget();
});
} else if (itemKey) {
this.state.itemKey !== itemKey && this.setState({ itemKey: itemKey }, function () {
return _this3.setTarget();
return _this2.setTarget();
});

@@ -404,11 +397,10 @@ }

ScrollView.prototype.render = function render() {
var _this4 = this;
var _this3 = this;
var _state3 = this.state,
isPullDownStatus = _state3.isPullDownStatus,
isPullUpStatus = _state3.isPullUpStatus,
fillAttr = _state3.fillAttr,
scrollX = _state3.scrollX,
translate = _state3.translate,
isLoadOver = _state3.isLoadOver;
var _state2 = this.state,
isPullDownStatus = _state2.isPullDownStatus,
isPullUpStatus = _state2.isPullUpStatus,
fillAttr = _state2.fillAttr,
scrollX = _state2.scrollX,
isLoadOver = _state2.isLoadOver;
var _props = this.props,

@@ -432,3 +424,3 @@ style = _props.style,

{ className: 'load-more-root', style: style, ref: function ref(node) {
return _this4.wrap = node;
return _this3.wrap = node;
} },

@@ -438,3 +430,3 @@ React.createElement(

{ className: 'load-more-content', ref: function ref(node) {
return _this4.content = node;
return _this3.content = node;
} },

@@ -444,3 +436,3 @@ !scrollX && isPullDownStatus && !isPullUpStatus && React.createElement(

{ className: 'pull-down-bar', ref: function ref(node) {
node && (_this4.pullDownBarHeight = parseFloat(window.getComputedStyle(node).height));
node && (_this3.pullDownBarHeight = Common.attr(node, 'height'));
} },

@@ -458,3 +450,3 @@ isPullDownStatus === LOADING ? React.createElement(Spinner, null) : React.createElement(

ref: function ref(node) {
return _this4.children = node;
return _this3.children = node;
}

@@ -486,3 +478,3 @@ },

{ className: 'pull-up-bar', ref: function ref(node) {
return node && (_this4.pullUpBarHeight = parseFloat(window.getComputedStyle(node).height));
return node && (_this3.pullUpBarHeight = parseFloat(window.getComputedStyle(node).height));
}

@@ -489,0 +481,0 @@ },

@@ -0,0 +0,0 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

@@ -0,0 +0,0 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

@@ -0,0 +0,0 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -9,2 +9,6 @@ 'use strict';

var _Common = require('../utils/Common');
var _Common2 = _interopRequireDefault(_Common);
require('./ScrollView.css');

@@ -176,3 +180,3 @@

var itemHeight = parseFloat(window.getComputedStyle(_this.children).height);
_this.wrap.style.height = wrapHeight + 'px';
wrapHeight && (_this.wrap.style.height = wrapHeight + 'px');
_this.setState({

@@ -279,25 +283,18 @@ fillAttr: itemHeight < wrapHeight ? wrapHeight - itemHeight : false

ScrollView.prototype.componentDidMount = function componentDidMount() {
var _this2 = this;
var scrollX = this.state.scrollX;
var _state = this.state,
wrapHeight = _state.wrapHeight,
scrollX = _state.scrollX;
this.setState({
wrapHeight: !scrollX && (wrapHeight ? wrapHeight : parseFloat(window.getComputedStyle(this.wrap.parentNode).height))
}, function () {
if (scrollX) {
_this2.setTarget();
} else {
_this2.wrap.addEventListener('touchstart', _this2.handleTouchStart);
_this2.wrap.addEventListener('touchmove', _this2.handleTouchMove);
_this2.wrap.addEventListener('touchend', _this2.handleTouchEnd);
_this2.fetchData();
_this2.fill(true);
}
});
if (scrollX) {
this.setTarget();
} else {
this.wrap.addEventListener('touchstart', this.handleTouchStart);
this.wrap.addEventListener('touchmove', this.handleTouchMove);
this.wrap.addEventListener('touchend', this.handleTouchEnd);
this.fetchData();
this.fill(true);
}
};
ScrollView.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
var _this3 = this;
var _this2 = this;

@@ -308,17 +305,16 @@ var requestState = nextProps.requestState,

itemKey = nextProps.itemKey;
var _state2 = this.state,
isPullUpStatus = _state2.isPullUpStatus,
isPullDownStatus = _state2.isPullDownStatus,
animateTime = _state2.animateTime;
var _state = this.state,
isPullUpStatus = _state.isPullUpStatus,
isPullDownStatus = _state.isPullDownStatus,
animateTime = _state.animateTime;
console.log('scrollveiw nextProps', nextProps, requestState);
var OO = {
// 上拉加载
pullUp: function pullUp() {
_this3.translate();
_this2.translate();
setTimeout(function () {
_this3.setState({
_this2.setState({
isPullUpStatus: null
}, function () {
_this3.fill();
_this2.fill();
});

@@ -331,8 +327,8 @@ }, animateTime);

// 但当用户停留在 loading 不滚动的时候 就给他来个 动效
_this3.wrap.scrollTop === 0 && _this3.translate();
_this2.wrap.scrollTop === 0 && _this2.translate();
setTimeout(function () {
_this3.setState({
_this2.setState({
isPullDownStatus: null
}, function () {
return _this3.fill();
return _this2.fill();
});

@@ -349,7 +345,7 @@ }, animateTime);

this.state.itemIndex !== itemIndex && this.setState({ itemIndex: itemIndex }, function () {
return _this3.setTarget();
return _this2.setTarget();
});
} else if (itemKey) {
this.state.itemKey !== itemKey && this.setState({ itemKey: itemKey }, function () {
return _this3.setTarget();
return _this2.setTarget();
});

@@ -414,11 +410,10 @@ }

ScrollView.prototype.render = function render() {
var _this4 = this;
var _this3 = this;
var _state3 = this.state,
isPullDownStatus = _state3.isPullDownStatus,
isPullUpStatus = _state3.isPullUpStatus,
fillAttr = _state3.fillAttr,
scrollX = _state3.scrollX,
translate = _state3.translate,
isLoadOver = _state3.isLoadOver;
var _state2 = this.state,
isPullDownStatus = _state2.isPullDownStatus,
isPullUpStatus = _state2.isPullUpStatus,
fillAttr = _state2.fillAttr,
scrollX = _state2.scrollX,
isLoadOver = _state2.isLoadOver;
var _props = this.props,

@@ -442,3 +437,3 @@ style = _props.style,

{ className: 'load-more-root', style: style, ref: function ref(node) {
return _this4.wrap = node;
return _this3.wrap = node;
} },

@@ -448,3 +443,3 @@ _react2.default.createElement(

{ className: 'load-more-content', ref: function ref(node) {
return _this4.content = node;
return _this3.content = node;
} },

@@ -454,3 +449,3 @@ !scrollX && isPullDownStatus && !isPullUpStatus && _react2.default.createElement(

{ className: 'pull-down-bar', ref: function ref(node) {
node && (_this4.pullDownBarHeight = parseFloat(window.getComputedStyle(node).height));
node && (_this3.pullDownBarHeight = _Common2.default.attr(node, 'height'));
} },

@@ -468,3 +463,3 @@ isPullDownStatus === LOADING ? _react2.default.createElement(Spinner, null) : _react2.default.createElement(

ref: function ref(node) {
return _this4.children = node;
return _this3.children = node;
}

@@ -496,3 +491,3 @@ },

{ className: 'pull-up-bar', ref: function ref(node) {
return node && (_this4.pullUpBarHeight = parseFloat(window.getComputedStyle(node).height));
return node && (_this3.pullUpBarHeight = parseFloat(window.getComputedStyle(node).height));
}

@@ -499,0 +494,0 @@ },

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ "use strict";

{
"name": "bestnihon-react-components",
"version": "2.1.7",
"version": "2.1.8",
"description": "bestnihon-react-components React component",

@@ -35,4 +35,7 @@ "main": "lib/index.js",

"keywords": [
"react-component","load-more","auto-scroll-tab","tabcontainer"
"react-component",
"load-more",
"auto-scroll-tab",
"tabcontainer"
]
}

@@ -1,16 +0,269 @@

# bestnihon-react-components
# react-Q-element
[![Travis][build-badge]][build]
[![npm package][npm-badge]][npm]
[![Coveralls][coveralls-badge]][coveralls]
## React 私有组件库的搭建 推荐使用 nwb
Describe bestnihon-react-components here.
### [nwb git地址](https://github.com/insin/nwb/blob/master/docs/guides/ReactComponents.md#developing-react-components-and-libraries-with-nwb)
[build-badge]: https://img.shields.io/travis/user/repo/master.png?style=flat-square
[build]: https://travis-ci.org/user/repo
### [npm 地址](https://www.npmjs.com/package/react-q-element)
[npm-badge]: https://img.shields.io/npm/v/npm-package.png?style=flat-square
[npm]: https://www.npmjs.org/package/npm-package
## 使用方法
[coveralls-badge]: https://img.shields.io/coveralls/user/repo/master.png?style=flat-square
[coveralls]: https://coveralls.io/github/user/repo
```jsx
npm i react-q-element || yarn add react-q-element
// 本地安装依赖包后,就可直接在项目中引入
// ex:
import { NavBar, TabContainer, TabContainerItem, LazyLoad, ScrollView} from 'react-q-element'
```
*npm start 运行 demo,同时可在 demo 里面查看示例代码*
### 注意点:
1. 在打包过程中 css 样式文件没有打包的情况下, 请添加 npm run build -- --copy-files
2. 同时,如果你是编写一个组件库而不是单个组件的话, 在 index.js 文件中 export xxx from ‘xxx’ , 可能在某些编辑器里面会有语法报错,直接忽略,打包即可,不要纠结
## 目录结构
```
├── CONTRIBUTING.md
├── README.md // readme
├── demo // demo 存放地址
│   └── src
├── nwb.config.js // nwb 基础配置
├── package.json
├── src
│   ├── LazyLoad // 懒加载
│   ├── NavBar // 导航条
│   ├── ScrollView // 上拉加载,下拉属性, scrollview
│   ├── TabContainer // 左右拖拽,父级
│   ├── TabContainerItem // 左右拖拽,子级
│   ├── index.js // 插件 export 设置
│   └── utils
├── tests
   └── index-test.js
```
## DEMO gif 图展示
![gif点击循环播放](http://os33agcwz.bkt.clouddn.com/new_demo.gif)
## API 详解
### -- AutoScrollTab
点击后自动左 || 居中对齐
点选元素后会给标签添加一个 'active' 类名, 方便样式更改, 也可以写在 onClick 事件中你来定义一些处理事件
### -- LazyLoad
懒加载
效果: 会在 img onload 成功之后 进行一个特效展示, opacity 0 ==>1 的过程
```jsx
<LazyLoad src={图片地址} />
```
### -- NavBar
导航条
*如果需要修改底部 bar 的样式 , 请通过类名进行样式覆盖, 不过我不推荐, 因为我这个蛮好看的*
| 属性 | 类型 | 介绍 |
| --------- | -------- | ------------------------------------------------------------ |
| data | Array | 数组, bar 内容(当传递 children 的时候就无需传 data),**固定格式为 [{ name: '标题1', type: 1 }, { name: '标题2', type: 2 }, { name: '标题3', type: 3 }]** |
| Index | Number | 选择第 ind 个 bar, 默认第一个 bar(0) |
| translate | Object | 当与 TabContainer 组件联动的时候需要接受的 bar 移动距离值, **属性固定{ distance: , transition}** |
| onSel | Function | 回调函数,用户点击第几个 bar, **返回 item,index ; 基本写法: onSel={(item, index) => { console.log(item. Index)}}** |
| isAnimate | Boolean | 是否开启点击移动动画, 默认 false |
```jsx
// navData
const data = [{name: '标题1', type: 1}, {name:'标题2', type: 2}, {name:'标题3', type: 3}]
<NavBar
translate={NavBarTranslate}
onSel={(item, index) => {
console.log('navitem',item, index)
}}
data={data}
index={TabContainerIndex}
/>
// children
<NavBar
translate={NavBarTranslate}
onSel={(item, index) => {
console.log('navitem', index)
}}
index={TabContainerIndex}
>
<span>首页</span>
<span>购物车</span>
<span>我的</span>
</NavBar>
```
### -- ScrollView
上拉加载,下拉刷新,scrollview
| 属性 | 类型 | 介绍 |
| :------------- | :--------------- | ------------------------------------------------------------ |
| isFetch | Boolean | 当页面没有数据的时候,开启 loading 效果,直接触发 topMethod 函数, 默认为 false |
| isLoadOver | Boolean | 请求是否完成,可传字符串 \|\| Boolean, Boolean 为 true 时默认展示字段'全部加载完毕', 传字符串就展示字符串 |
| requestState | Boolean | 请求是否完成,默认 false |
| isPullDown | Boolean | 是否开启下拉刷新, 默认为 false |
| isPullUp | Boolean | 是否开启上拉加载, 默认为 false |
| topDistance | Number | 下拉刷新 触发 阀值, 默认为 50px |
| bottomDistance | Number | 上拉加载 触发 阀值, 默认为 50px |
| topMethod | Function | 下拉刷新执行函数 |
| bottomMethod | Function | 上拉加载执行函数 |
| wrapHeight | Number | **(必传)用户自定义高度, 如果没有则自动获取 scorllview 父级的高度** |
| pullThreshold | Number | 上拉和下拉 最高可拉的阀值, 默认200 |
| scrollX | Boolean | **(必传) 横向滚动布局, 默认 false** |
| scrollY | Boolean | **(必传)纵向滚动布局, 默认 false** |
| upperThreshold | Number | 距离顶部/左边多远时, 触发 onUpper 事件, 默认为 50px |
| lowerThreshold | Number | 距离底部/右边多远时, 触发 onLower 事件, 默认为 50px |
| onUpper | Function | 滚动到顶部/左边, 会触发 onUpper 事件 |
| onLower | Function | 滚动到底部/右边, 会触发 onLower 事件 |
| onScroll | Function | 滚动实时触发,传递实时scroll 的值 |
| itemIndex | Number | 展示第几个内容, 默认第一个,传下标,从0开始 |
| itemKey | String\|\|Number | 展示第几个内容,与 itemIndex 只能存在一个, 需要使用时必须在传递过去的子元素中加入 key 值 |
| animateTime | Number | 设置上拉下拉缓动动画完成时间 |
| limit | Number | 下拉上拉移动速率调整, 公式: 拖动距离 / limit , 提升体验. 基础值为4 |
```jsx
// itemKey 和 itemIndex 使用
<ScrollView
scrollX={true}
itemKey={'test2'}
>
<div style={{width: '375px', height: '100px', backgroundColor:'skyblue'}} key={'test1'}>
测试1
</div>
<div style={{width: '375px', height: '100px', backgroundColor:'green'}} key={'test2'}>
测试2
</div>
<div style={{width: '375px', height: '100px', backgroundColor:'yellow'}}>
测试3
</div>
</ScrollView>
// 上拉加载 下拉刷新使用
<ScrollView
isFetch={true}
scrollY={true}
isPullDown={true}
isPullUp={true}
topMethod={() => {
return new Promise((resolve, reject) => {
setTimeout(() => {
this.setState({
list: list.reverse(),
requestState: true },
() => {
resolve()
})
}, 2000);
})
}}
requestState={requestState}
bottomMethod={() => {
return new Promise((resolve, reject) => {
setTimeout(() => {
this.setState({
list: [...list, '我是节点1', '我是节点2', ...list, '节点3', '节点4'],
requestState: true,
isLoadOver: '全部加载完毕'
}, () => {
resolve()
})
}, 1000);
})
}}
onUpper={() => {
console.warn('到顶了')
}}
onLower={() => {
console.warn('到底了')
}}
onScroll={obj => {
console.warn('无时无刻不在触发', obj)
}}
isLoadOver={isLoadOver}
>
{list.map((item, index) => {
return <div style={{ height: '50px', lineHeight: '50px', backgroundColor: 'red', textAlign: 'center' }} key={'item' + index}>
{item}
</div>
})}
</ScrollView>
```
### -- TabContainer
左右拖拽(**必须与 TabContainerItem 搭配使用**)
| 属性 | 类型 | 介绍 |
| :---------- | -------- | ------------------------------------------------------------ |
| interval | Number | 触发自动滚动下一页阀值, 默认为屏幕的1/5 |
| index | Number | 展示第 index 页, 默认第一页,从0开始 |
| onSel | Function | 回调函数,返回当前页数 |
| onTranslate | Function | 回调函数 配合 Navbar 做 bar 联动, 返回一个对象 {distance:Number,//移动距离transition:Boolean// 是否开启动画效果} |
```jsx
<TabContainer>
<TabContainerItem style={{ fontSize: '20px', backgroundColor: 'red' ,height: '500px'}}>
{arr.map(i => {
return <div key={i}>{i}</div>
})}
</TabContainerItem>
<TabContainerItem style={{ backgroundColor: 'yellow' }}>
{arr.map(i => {
return <div key={i}>{i}</div>
})}
</TabContainerItem>
<TabContainerItem style={{ backgroundColor: 'skyblue' }}>
{arr.map(i => {
return <div key={i}>{i}</div>
})}
</TabContainerItem>
</TabContainer>
```
### -- TabContainerItem
在 style 属性中传下 height 属性, 不传默认全屏高度
**高度必传,但是,当与 ScrollView 连用时,ScrollVIew 高度可不传. 因为 ScrollView 在没有传递 wrapHeight 的时候,自动获取父级的高度**
/*!
* bestnihon-react-components v2.1.7
* bestnihon-react-components v2.1.8
* MIT Licensed

@@ -91,5 +91,35 @@ */

"use strict";
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var Common = function () {
function Common() {
_classCallCheck(this, Common);
}
/**
* 获取 dom 的属性
*
* @static
* @param {*} dom
* @param {*} attr
* @returns 返回 Number
* @memberof Common
*/
Common.attr = function attr(dom, _attr) {
return parseFloat(window.getComputedStyle(dom, null)[_attr]) || dom.getBoundingClientRect()[_attr];
};
return Common;
}();
/* harmony default export */ __webpack_exports__["a"] = (Common);
/***/ }),
/* 2 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__utils_Common__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__utils_Common__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__AutoScrollTab_css__ = __webpack_require__(5);

@@ -274,32 +304,2 @@ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__AutoScrollTab_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2__AutoScrollTab_css__);

/***/ }),
/* 2 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var Common = function () {
function Common() {
_classCallCheck(this, Common);
}
/**
* 获取 dom 的属性
*
* @static
* @param {*} dom
* @param {*} attr
* @returns 返回 Number
* @memberof Common
*/
Common.attr = function attr(dom, _attr) {
return parseFloat(window.getComputedStyle(dom, null)[_attr]) || dom.getBoundingClientRect()[_attr];
};
return Common;
}();
/* harmony default export */ __webpack_exports__["a"] = (Common);
/***/ }),
/* 3 */

@@ -317,3 +317,3 @@ /***/ (function(module, exports, __webpack_require__) {

Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__AutoScrollTab_AutoScrollTab__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__AutoScrollTab_AutoScrollTab__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__NavBar_NavBar__ = __webpack_require__(6);

@@ -329,3 +329,3 @@ /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "NavBar", function() { return __WEBPACK_IMPORTED_MODULE_1__NavBar_NavBar__["a"]; });

/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "LozyLoad", function() { return __WEBPACK_IMPORTED_MODULE_5__LazyLoad_LazyLoad_js__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__AutoScrollTab_AutoScrollTab_js__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__AutoScrollTab_AutoScrollTab_js__ = __webpack_require__(2);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "AutoScrollTab", function() { return __WEBPACK_IMPORTED_MODULE_6__AutoScrollTab_AutoScrollTab_js__["a"]; });

@@ -360,3 +360,3 @@

/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__utils_Common__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__utils_Common__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__NavBar_css__ = __webpack_require__(7);

@@ -856,4 +856,5 @@ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__NavBar_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2__NavBar_css__);

/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__ScrollView_css__ = __webpack_require__(13);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__ScrollView_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__ScrollView_css__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__utils_Common__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ScrollView_css__ = __webpack_require__(13);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ScrollView_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2__ScrollView_css__);
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

@@ -867,2 +868,3 @@

var TOP = 'top';

@@ -1024,3 +1026,3 @@ var BOTTOM = 'bottom';

var itemHeight = parseFloat(window.getComputedStyle(_this.children).height);
_this.wrap.style.height = wrapHeight + 'px';
wrapHeight && (_this.wrap.style.height = wrapHeight + 'px');
_this.setState({

@@ -1127,25 +1129,18 @@ fillAttr: itemHeight < wrapHeight ? wrapHeight - itemHeight : false

ScrollView.prototype.componentDidMount = function componentDidMount() {
var _this2 = this;
var scrollX = this.state.scrollX;
var _state = this.state,
wrapHeight = _state.wrapHeight,
scrollX = _state.scrollX;
this.setState({
wrapHeight: !scrollX && (wrapHeight ? wrapHeight : parseFloat(window.getComputedStyle(this.wrap.parentNode).height))
}, function () {
if (scrollX) {
_this2.setTarget();
} else {
_this2.wrap.addEventListener('touchstart', _this2.handleTouchStart);
_this2.wrap.addEventListener('touchmove', _this2.handleTouchMove);
_this2.wrap.addEventListener('touchend', _this2.handleTouchEnd);
_this2.fetchData();
_this2.fill(true);
}
});
if (scrollX) {
this.setTarget();
} else {
this.wrap.addEventListener('touchstart', this.handleTouchStart);
this.wrap.addEventListener('touchmove', this.handleTouchMove);
this.wrap.addEventListener('touchend', this.handleTouchEnd);
this.fetchData();
this.fill(true);
}
};
ScrollView.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
var _this3 = this;
var _this2 = this;

@@ -1156,17 +1151,16 @@ var requestState = nextProps.requestState,

itemKey = nextProps.itemKey;
var _state2 = this.state,
isPullUpStatus = _state2.isPullUpStatus,
isPullDownStatus = _state2.isPullDownStatus,
animateTime = _state2.animateTime;
var _state = this.state,
isPullUpStatus = _state.isPullUpStatus,
isPullDownStatus = _state.isPullDownStatus,
animateTime = _state.animateTime;
console.log('scrollveiw nextProps', nextProps, requestState);
var OO = {
// 上拉加载
pullUp: function pullUp() {
_this3.translate();
_this2.translate();
setTimeout(function () {
_this3.setState({
_this2.setState({
isPullUpStatus: null
}, function () {
_this3.fill();
_this2.fill();
});

@@ -1179,8 +1173,8 @@ }, animateTime);

// 但当用户停留在 loading 不滚动的时候 就给他来个 动效
_this3.wrap.scrollTop === 0 && _this3.translate();
_this2.wrap.scrollTop === 0 && _this2.translate();
setTimeout(function () {
_this3.setState({
_this2.setState({
isPullDownStatus: null
}, function () {
return _this3.fill();
return _this2.fill();
});

@@ -1197,7 +1191,7 @@ }, animateTime);

this.state.itemIndex !== itemIndex && this.setState({ itemIndex: itemIndex }, function () {
return _this3.setTarget();
return _this2.setTarget();
});
} else if (itemKey) {
this.state.itemKey !== itemKey && this.setState({ itemKey: itemKey }, function () {
return _this3.setTarget();
return _this2.setTarget();
});

@@ -1262,11 +1256,10 @@ }

ScrollView.prototype.render = function render() {
var _this4 = this;
var _this3 = this;
var _state3 = this.state,
isPullDownStatus = _state3.isPullDownStatus,
isPullUpStatus = _state3.isPullUpStatus,
fillAttr = _state3.fillAttr,
scrollX = _state3.scrollX,
translate = _state3.translate,
isLoadOver = _state3.isLoadOver;
var _state2 = this.state,
isPullDownStatus = _state2.isPullDownStatus,
isPullUpStatus = _state2.isPullUpStatus,
fillAttr = _state2.fillAttr,
scrollX = _state2.scrollX,
isLoadOver = _state2.isLoadOver;
var _props = this.props,

@@ -1290,3 +1283,3 @@ style = _props.style,

{ className: 'load-more-root', style: style, ref: function ref(node) {
return _this4.wrap = node;
return _this3.wrap = node;
} },

@@ -1296,3 +1289,3 @@ __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(

{ className: 'load-more-content', ref: function ref(node) {
return _this4.content = node;
return _this3.content = node;
} },

@@ -1302,3 +1295,3 @@ !scrollX && isPullDownStatus && !isPullUpStatus && __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(

{ className: 'pull-down-bar', ref: function ref(node) {
node && (_this4.pullDownBarHeight = parseFloat(window.getComputedStyle(node).height));
node && (_this3.pullDownBarHeight = __WEBPACK_IMPORTED_MODULE_1__utils_Common__["a" /* default */].attr(node, 'height'));
} },

@@ -1316,3 +1309,3 @@ isPullDownStatus === LOADING ? __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Spinner, null) : __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(

ref: function ref(node) {
return _this4.children = node;
return _this3.children = node;
}

@@ -1344,3 +1337,3 @@ },

{ className: 'pull-up-bar', ref: function ref(node) {
return node && (_this4.pullUpBarHeight = parseFloat(window.getComputedStyle(node).height));
return node && (_this3.pullUpBarHeight = parseFloat(window.getComputedStyle(node).height));
}

@@ -1347,0 +1340,0 @@ },

/*!
* bestnihon-react-components v2.1.7
* bestnihon-react-components v2.1.8
* MIT Licensed
*/
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):"object"==typeof exports?exports.Y=e(require("react")):t.Y=e(t.React)}("undefined"!=typeof self?self:this,function(t){return function(t){var e={};function n(o){if(e[o])return e[o].exports;var i=e[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:o})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=3)}([function(e,n){e.exports=t},function(t,e,n){"use strict";var o,i,r=n(0),a=n.n(r),l=n(2),s=n(5);n.n(s);var c="left",u="center",h=(o=function(t){function e(n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var o=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,n));i.call(o);var r=n.left?c:u;return o.interval=n.interval||18,o.state={left:n.left,isScroll:!0,fill:!1,child:null,direction:r},o}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.componentDidMount=function(){var t=this,e=parseFloat(window.getComputedStyle(this.container,null).width),n=e/2;this.setState({rootWidth:e,centre:n,child:this.container.children},function(){return t.checkEl()})},e.prototype.componentWillUnmount=function(){clearInterval(this.timer)},e.prototype.render=function(){var t=this,e=this.state.fill,n=this.props.children;return n=Array.isArray(n)?n:[].concat(n),a.a.createElement("ul",{className:"AutoScrollTab-root",ref:function(e){return t.container=e}},n.map(function(e,n){return a.a.createElement("li",{key:"children"+n,className:"item",onClick:function(){return t.sel(e,n)}},e)}),e&&a.a.createElement("li",{className:"item",style:{width:e+"px"}}))},e}(r.Component),i=function(){var t=this;this.checkEl=function(){for(var e=t.state,n=e.rootWidth,o=e.child,i=0,r=0,a=o.length;r<a;r++)i+=l.a.attr(o[r],"width");if(i>n)return t.fill();t.setState({isScroll:!1})},this.fill=function(){var e=t.state,n=e.rootWidth,o=e.direction,i=e.centre,r=e.child,a=l.a.attr(r[r.length-1],"width"),s=o===u?i-a/2:n-a;t.setState({fill:s})},this.target=function(e){var n=t.state,o=n.direction,i=n.child,r=n.centre,a=i[e],s=a.offsetLeft;return o===u?s+l.a.attr(a,"width")/2>r?s+l.a.attr(a,"width")/2-r:0:s},this.sel=function(e,n){var o=t.target(n);console.log("target==>",o),o>=0&&t.animate(o,t.container)},this.animate=function(e,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"scrollLeft";clearInterval(t.timer),t.timer=setInterval(function(){var i=(e-n[o])/5;i=i>0?Math.ceil(i):Math.floor(i),n[o]+=i,console.log("进行中"),Math.abs(e-n[o])<=Math.abs(i)&&(clearInterval(t.timer),console.log("清除中"),n[o]=e)},t.interval)}},o);e.a=h},function(t,e,n){"use strict";var o=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return t.attr=function(t,e){return parseFloat(window.getComputedStyle(t,null)[e])||t.getBoundingClientRect()[e]},t}();e.a=o},function(t,e,n){t.exports=n(4)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});n(1);var o=n(6);n.d(e,"NavBar",function(){return o.a});var i=n(8);n.d(e,"TabContainer",function(){return i.a});var r=n(10);n.d(e,"TabContainerItem",function(){return r.a});var a=n(12);n.d(e,"ScrollView",function(){return a.a});var l=n(14);n.d(e,"LozyLoad",function(){return l.a});var s=n(1);n.d(e,"AutoScrollTab",function(){return s.a})},function(t,e){},function(t,e,n){"use strict";var o,i,r=n(0),a=n.n(r),l=n(2),s=n(7);n.n(s);var c=(o=function(t){function e(n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var o=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,n));i.call(o);var r=n.data,a=n.children,l=r?r.length:a.length;return o.state={ind:n.index||0,isAnimate:n.isAnimate||!1,onSel:n.onSel,data:n.data,length:l},o}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.componentDidMount=function(){var t=this,e=this.state.length;this.setState({itemWidth:l.a.attr(this.wrap,"width")/e},function(){return t.setBarWidth()})},e.prototype.componentWillReceiveProps=function(t){var e=this,n=t.index,o=t.translate,i=this.state.ind;o&&this.translateBar(o),n>=0&&i!==n&&this.setState({ind:n},function(){return e.setBarWidth()})},e.prototype.render=function(){var t=this,e=this.state,n=e.ind,o=e.data,i=e.itemWidth,r=this.props,l=r.children,s=r.style;return a.a.createElement("div",{style:s,className:"NavBar-root",ref:function(e){return t.wrap=e}},a.a.createElement("div",{className:"container",ref:function(e){return t.container=e}},o?o.map(function(e,o){return a.a.createElement("span",{key:"Nav"+o,style:{width:i+"px"},className:"Nav-item "+(o===n&&"active"),onClick:function(){return t.sel(e,o)}},a.a.createElement("span",null,e.name))}):l.map(function(e,o){return a.a.createElement("span",{key:"Nav"+o,style:{width:i+"px"},className:"Nav-item "+(o===n&&"active"),onClick:function(){return t.sel(e,o)}},e)})),a.a.createElement("div",{className:"Nav-active",style:{width:i+"px",transform:"translatex("+n*i+"px)"},ref:function(e){return t.bar=e}},a.a.createElement("div",{className:"Nav-active-bar",ref:function(e){return t.flag=e}})))},e}(r.Component),i=function(){var t=this;this.translateBar=function(e){var n=t.state.length,o=e.distance,i=e.transition;t.bar.style.transition=i?"all 200ms":"none",t.bar.style.transform="translateX("+-o/n+"px)"},this.sel=function(e,n){var o=t.state,i=o.isAnimate,r=o.onSel;t.bar.style.transition=i?"all 200ms":"none",t.setState({ind:n},function(){r&&r(e,n),t.setBarWidth()})},this.setBarWidth=function(){var e=t.state.ind,n=t.container.children,o=(n[e].children.length>=1?n[e].children[0]:n[e]).getBoundingClientRect().width;t.flag.style.width=o+"px"}},o);e.a=c},function(t,e){},function(t,e,n){"use strict";var o=n(0),i=n.n(o),r=n(9);n.n(r);var a="left",l="right",s="top",c="down",u=function(t){function e(n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var o=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,n));return o.slideStart=function(t){o.startX=t.changedTouches[0].pageX,o.startY=t.changedTouches[0].pageY},o.slideMove=function(t){var e=t.changedTouches[0].pageX,n=t.changedTouches[0].pageY,i=e-o.startX,r=n-o.startY,u=i-o.itemWidth*o.index;if(!o.slideDirection||o.slideDirection===l||o.slideDirection===a)if(Math.abs(i)>Math.abs(r)&&i>0)event.preventDefault(),0!==o.index&&o.translate(u),o.slideDirection=l;else if(Math.abs(i)>Math.abs(r)&&i<0)event.preventDefault(),o.index!==o.props.children.length-1&&o.translate(u),o.slideDirection=a;else if(Math.abs(r)>Math.abs(i)&&r>0){if(o.slideDirection)return;o.slideDirection=c}else if(Math.abs(r)>Math.abs(i)&&r<0){if(o.slideDirection)return;o.slideDirection=s}},o.slideEnd=function(t){o.endX=t.changedTouches[0].pageX,o.isTranslate()},o.translate=function(t,e){var n="\n "+(e?"transition: all 200ms;":"")+"\n transform:translateX("+t+"px)\n ";o.container.style=n;var i=o.props.onTranslate;i&&i({distance:t,transition:e})},o.isTranslate=function(){if(o.slideDirection===l||o.slideDirection===a){var t=o.props.onSel,e=o.endX-o.startX,n={right:function(){0!==o.index&&o.index--},left:function(){o.index!==o.props.children.length-1&&o.index++}};Math.abs(e)>=o.interval&&(n[o.slideDirection](),console.log("上下页切换",o.index),t&&t(o.index)),o.translate(-o.index*o.itemWidth,!0)}o.slideDirection=null},o.itemWidth=window.screen.width,o.interval=n.interval||parseInt(o.itemWidth/5),o.index=n.index||0,o.oldIndex=n.index||0,o}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.componentWillReceiveProps=function(t){var e=t.index,n=this.props.onTranslate;this.index!==e&&(this.index=e,n&&n({distance:-this.index*this.itemWidth}),this.container.style.transition=null,this.container.style.transform="translateX("+-e*this.itemWidth+"px)")},e.prototype.componentDidMount=function(){this.translate(-this.index*this.itemWidth),this.root.addEventListener("touchstart",this.slideStart),this.root.addEventListener("touchmove",this.slideMove),this.root.addEventListener("touchend",this.slideEnd)},e.prototype.componentWillUnmount=function(){this.root.removeEventListener("touchstart",this.slideStart),this.root.removeEventListener("touchmove",this.slideMove),this.root.removeEventListener("touchend",this.slideEnd)},e.prototype.render=function(){var t=this;return i.a.createElement("div",{className:"tab-container-root",ref:function(e){t.root=e}},i.a.createElement("ul",{className:"tab-container",ref:function(e){t.container=e}},this.props.children))},e}(o.Component);e.a=u},function(t,e){},function(t,e,n){"use strict";var o=n(0),i=n.n(o),r=n(11),a=(n.n(r),Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t});var l=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.render=function(){var t=this,e=Object.assign({},this.props),n=e.style;return n?n.height||(n.height=window.screen.height+"px"):n={height:window.screen.height+"px"},i.a.createElement("li",a({className:"TabContainerItem"},e,{ref:function(e){return t.el=e}}),this.props.children)},e}(o.Component);e.a=l},function(t,e){},function(t,e,n){"use strict";var o=n(0),i=n.n(o),r=n(13);n.n(r);var a="top",l="bottom",s="loading",c="touch_top",u="touch_bottom",h=function(t){function e(n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var o=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,n));return o.handleTouchStart=function(t){o.startY=t.touches[0].clientY},o.handleTouchMove=function(t){var e=o.state,n=e.isPullDown,i=e.isPullUp,r=e.topDistance,h=e.bottomDistance,p=e.isPullDownStatus,f=e.isPullUpStatus,d=e.isLoadOver,m=o.wrap.scrollTop,v=t.touches[0].clientY,y=void 0;o.direction=v-o.startY>0?u:c,n&&o.direction===u&&0===m&&p!==s&&!f?(event.preventDefault(),o.pullDownBarStartY=o.pullDownBarStartY?o.pullDownBarStartY:t.touches[0].clientY,y=(v-o.pullDownBarStartY)/o.limit,o.translate(y,!1),o.setState({isPullDownStatus:y>=r?a:l})):i&&!d&&o.direction===c&&m>=o.bottom&&f!==s&&!p&&(event.preventDefault(),o.pullUpBarStartY=o.pullUpBarStartY?o.pullUpBarStartY:t.touches[0].clientY,y=(v-o.pullUpBarStartY)/o.limit,o.translate(y,!1),o.setState({isPullUpStatus:Math.abs(y)>=h?l:a}))},o.handleTouchEnd=function(t){var e=o.state,n=e.isPullDownStatus,i=e.isPullUpStatus,r=e.topMethod,a=e.bottomMethod,l=e.animateTime;o.pullDownBarStartY=null,o.pullUpBarStartY=null;var c={top:function(){o.translate(),setTimeout(function(){o.setState({isPullUpStatus:null})},l)},bottom:function(){o.setState({isPullUpStatus:s},function(){o.translate(-o.pullUpBarHeight),a&&a()})}};n&&n!==s&&{top:function(){o.setState({isPullDownStatus:s},function(){o.translate(o.pullDownBarHeight),r&&r()})},bottom:function(){o.translate(),setTimeout(function(){o.setState({isPullDownStatus:null})},l)}}[n](),i&&c[i]()},o.fetchData=function(){var t=o.state,e=t.isFetch,n=t.topMethod;t.animateTime;e&&o.setState({isPullDownStatus:s,isPullUpStatus:null},function(){o.translate(o.pullDownBarHeight,!0),n&&n()})},o.scroll=function(){var t=o.state,e=t.onLower,n=t.onUpper,i=t.onScroll,r=t.scrollX,a=t.upperThreshold,l=t.lowerThreshold,s=r?"scrollLeft":"scrollTop",c=r?o.children:o.wrap,u=c[s],h=r?parseFloat(window.getComputedStyle(c,null).width):parseFloat(window.getComputedStyle(c,null).height),p=r?c.scrollWidth-h:c.scrollHeight-h;i&&i({scroll:u}),u<=a?n&&n():u>=p-l&&e&&e()},o.fill=function(t){var e=o.state.wrapHeight,n=parseFloat(window.getComputedStyle(o.children).height);o.wrap.style.height=e+"px",o.setState({fillAttr:n<e&&e-n},function(){o.scrollBottom(),t&&o.setTarget()})},o.setTarget=function(){var t=o.state,e=t.itemIndex,n=t.itemKey,i=t.scrollX;if(e&&n){var r=o.children.children,a=void 0;if(e>=0)a=e;else if(n)for(var l=0;l<o.props.children.length;l++)if(n===o.props.children[l].key){a=l;break}var s=i?o.children:o.wrap;a>=0&&(i?s.scrollLeft=r[a].offsetLeft:s.scrollTop=r[a].offsetTop),setTimeout(function(){s.addEventListener("scroll",o.scroll)},0)}},o.translate=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=o.state,i=n.pullThreshold,r=n.animateTime;Math.abs(t)>i||(o.content.style.transition=e?"all "+r+"ms ease":"none",o.content.style.transform="translate3d(0, "+t+"px,0)")},o.scrollBottom=function(){var t=o.state.fillAttr,e=o.children.scrollHeight,n=parseFloat(window.getComputedStyle(o.wrap).height);o.bottom=t?0:e-n},console.log(n),o.limit=n.limit||4,o.state={isFetch:n.isFetch||!1,isLoadOver:n.isLoadOver,requestState:n.requestState,isPullDown:n.isPullDown||!1,isPullUp:n.isPullUp||!1,topDistance:n.topDistance||50,bottomDistance:n.bottomDistance||50,isPullDownStatus:null,isPullUpStatus:null,topMethod:n.topMethod,bottomMethod:n.bottomMethod,wrapHeight:n.wrapHeight,pullThreshold:n.pullThreshold||200,scrollX:n.scrollX||!1,scrollY:n.scrollY||!1,upperThreshold:n.upperThreshold||50,lowerThreshold:n.lowerThreshold||50,onUpper:n.onUpper,onLower:n.onLower,onScroll:n.onScroll,itemIndex:n.itemIndex>=0&&n.itemIndex,itemKey:n.itemKey||!1,animateTime:n.animateTime||300},o}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.componentDidMount=function(){var t=this,e=this.state,n=e.wrapHeight,o=e.scrollX;this.setState({wrapHeight:!o&&(n||parseFloat(window.getComputedStyle(this.wrap.parentNode).height))},function(){o?t.setTarget():(t.wrap.addEventListener("touchstart",t.handleTouchStart),t.wrap.addEventListener("touchmove",t.handleTouchMove),t.wrap.addEventListener("touchend",t.handleTouchEnd),t.fetchData(),t.fill(!0))})},e.prototype.componentWillReceiveProps=function(t){var e=this,n=t.requestState,o=t.isLoadOver,i=t.itemIndex,r=t.itemKey,a=this.state,l=a.isPullUpStatus,s=a.isPullDownStatus,c=a.animateTime;console.log("scrollveiw nextProps",t,n);var u=function(){0===e.wrap.scrollTop&&e.translate(),setTimeout(function(){e.setState({isPullDownStatus:null},function(){return e.fill()})},c)};n&&(l&&function(){e.translate(),setTimeout(function(){e.setState({isPullUpStatus:null},function(){e.fill()})},c)}(),s&&u()),this.setState({isLoadOver:o}),i>=0?this.state.itemIndex!==i&&this.setState({itemIndex:i},function(){return e.setTarget()}):r&&this.state.itemKey!==r&&this.setState({itemKey:r},function(){return e.setTarget()})},e.prototype.componentWillUnmount=function(){this.wrap.removeEventListener("touchstart",this.handleTouchStart),this.wrap.removeEventListener("touchmove",this.handleTouchMove),this.wrap.removeEventListener("touchend",this.handleTouchEnd),(this.state.scrollX?this.children:this.wrap).removeEventListener("scroll",this.scroll),clearInterval(this.timer)},e.prototype.render=function(){var t=this,e=this.state,n=e.isPullDownStatus,o=e.isPullUpStatus,r=e.fillAttr,c=e.scrollX,u=(e.translate,e.isLoadOver),h=this.props,p=h.style,f=h.children;f=Array.isArray(f)?f:[].concat(f);var d=function(){return i.a.createElement("div",{className:"spinner"},i.a.createElement("div",{className:"bounce1"}),i.a.createElement("div",{className:"bounce2"}),i.a.createElement("div",{className:"bounce3"}))};return i.a.createElement("div",{className:"load-more-root",style:p,ref:function(e){return t.wrap=e}},i.a.createElement("div",{className:"load-more-content",ref:function(e){return t.content=e}},!c&&n&&!o&&i.a.createElement("div",{className:"pull-down-bar",ref:function(e){e&&(t.pullDownBarHeight=parseFloat(window.getComputedStyle(e).height))}},n===s?i.a.createElement(d,null):i.a.createElement("span",{className:"is-transition "+(n===a?"is-rotate":"")},"↓")),i.a.createElement("div",{className:"scroll-view-root "+(c?"scroll-view-x":"scroll-view-y")+" ",ref:function(e){return t.children=e}},f.map(function(t,e){return i.a.createElement("div",{key:"children"+e,className:c?"scroll-x-item":"scroll-y-item"},t)})),u&&("string"==typeof u?i.a.createElement("p",{className:"pull-up-tip"},u):i.a.createElement("p",{className:"pull-up-tip"},"加载完毕")),r&&i.a.createElement("div",{style:{height:r+"px"}}),!c&&!u&&o&&!n&&i.a.createElement("div",{className:"pull-up-bar",ref:function(e){return e&&(t.pullUpBarHeight=parseFloat(window.getComputedStyle(e).height))}},o===s?i.a.createElement(d,null):i.a.createElement("span",{className:"is-transition "+(o===l?"is-rotate":"")+" "},"↑"))))},e}(o.Component);e.a=h},function(t,e){},function(t,e,n){"use strict";var o=n(0),i=n.n(o),r=n(15),a=n(16),l=(n.n(a),Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t});var s=function(t){function e(n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var o=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,n));return o.lazyLoad=o.lazyLoad.bind(o,n.src),o.state={isAnimate:!1},o}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.componentDidMount=function(){this.isScroll(),window.addEventListener("scroll",this.lazyLoad),window.addEventListener("resize",this.lazyLoad)},e.prototype.componentWillUnmount=function(){window.removeEventListener("scroll",this.lazyLoad),window.removeEventListener("resize",this.lazyLoad)},e.prototype.isScroll=function(){document.body.clientHeight<=r.a.clientHeight()&&this.lazyLoad()},e.prototype.lazyLoad=function(t){r.a.availHeight()+r.a.scrollTop()>this.img.offsetTop-100&&!this.img.src&&(this.img.src=t)},e.prototype.render=function(){var t=this,e=this.state.isAnimate,n=Object.assign({},this.props);return i.a.createElement("div",{className:e?"LazyLoadImg":"",style:{opacity:e?1:0}},i.a.createElement("img",l({},n,{alt:"",ref:function(e){t.img=e},onLoad:function(){t.setState({isAnimate:!0})}})))},e}(o.Component);e.a=s},function(t,e,n){"use strict";var o=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return t.maxWidth=function(){return Math.min(640,this.clientWidth())},t.documentElement=function(){return document.body.clientWidth+document.body.clientHeight+document.body.scrollWidth+document.body.scrollHeight+document.body.scrollTop>document.documentElement.clientWidth+document.documentElement.clientHeight+document.documentElement.scrollWidth+document.documentElement.scrollHeight+document.documentElement.scrollTop?document.body:document.documentElement},t.rootElement=function(){return document.getElementById("root")},t.availWidth=function(){return window.screen.availWidth},t.availHeight=function(){return window.screen.availHeight},t.scrollHeight=function(){return Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)},t.scrollWidth=function(){return Math.max(document.body.scrollWidth,document.documentElement.scrollWidth)},t.scrollTop=function(){return Math.max(document.body.scrollTop,document.documentElement.scrollTop)},t.scrollToTop=function(){window.scrollTo(0,0)},t.setScrollTop=function(t){document.body.scrollTop=t,document.documentElement.scrollTop=t},t.clientHeight=function(){return Math.max(document.body.clientHeight,document.documentElement.clientHeight)},t.clientWidth=function(){return Math.max(document.body.clientWidth,document.documentElement.clientWidth)},t.resetFontSize=function(){var e=t.maxWidth()/7.5;t.fontSize=e,document.documentElement.style.fontSize=e+"px",document.body.style.maxWidth=t.maxWidth()+"px"},t.setInstance=function(e){t.app=e},t.removeInstance=function(){t.app=void 0},t.alert=function(e,n){t.app.setState({alert:{message:e,onClose:function(){t.app.setState({alert:void 0},function(){n&&n()})}}})},t.confirm=function(e,n,o,i){t.app.setState({confirm:{title:e,message:n,onConfirm:function(){t.app.setState({confirm:void 0},function(){o&&o()})},onCancel:function(){t.app.setState({confirm:void 0},function(){i&&i()})}}})},t.loading=function(e,n){t.app.setState({loading:e},function(){n&&n()})},t.isHorizontal=function(){return t.clientWidth()>t.clientHeight()},t}();e.a=o},function(t,e){}]).default});
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):"object"==typeof exports?exports.Y=e(require("react")):t.Y=e(t.React)}("undefined"!=typeof self?self:this,function(t){return function(t){var e={};function n(o){if(e[o])return e[o].exports;var i=e[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:o})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=3)}([function(e,n){e.exports=t},function(t,e,n){"use strict";var o=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return t.attr=function(t,e){return parseFloat(window.getComputedStyle(t,null)[e])||t.getBoundingClientRect()[e]},t}();e.a=o},function(t,e,n){"use strict";var o,i,r=n(0),a=n.n(r),l=n(1),s=n(5);n.n(s);var c="left",u="center",h=(o=function(t){function e(n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var o=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,n));i.call(o);var r=n.left?c:u;return o.interval=n.interval||18,o.state={left:n.left,isScroll:!0,fill:!1,child:null,direction:r},o}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.componentDidMount=function(){var t=this,e=parseFloat(window.getComputedStyle(this.container,null).width),n=e/2;this.setState({rootWidth:e,centre:n,child:this.container.children},function(){return t.checkEl()})},e.prototype.componentWillUnmount=function(){clearInterval(this.timer)},e.prototype.render=function(){var t=this,e=this.state.fill,n=this.props.children;return n=Array.isArray(n)?n:[].concat(n),a.a.createElement("ul",{className:"AutoScrollTab-root",ref:function(e){return t.container=e}},n.map(function(e,n){return a.a.createElement("li",{key:"children"+n,className:"item",onClick:function(){return t.sel(e,n)}},e)}),e&&a.a.createElement("li",{className:"item",style:{width:e+"px"}}))},e}(r.Component),i=function(){var t=this;this.checkEl=function(){for(var e=t.state,n=e.rootWidth,o=e.child,i=0,r=0,a=o.length;r<a;r++)i+=l.a.attr(o[r],"width");if(i>n)return t.fill();t.setState({isScroll:!1})},this.fill=function(){var e=t.state,n=e.rootWidth,o=e.direction,i=e.centre,r=e.child,a=l.a.attr(r[r.length-1],"width"),s=o===u?i-a/2:n-a;t.setState({fill:s})},this.target=function(e){var n=t.state,o=n.direction,i=n.child,r=n.centre,a=i[e],s=a.offsetLeft;return o===u?s+l.a.attr(a,"width")/2>r?s+l.a.attr(a,"width")/2-r:0:s},this.sel=function(e,n){var o=t.target(n);console.log("target==>",o),o>=0&&t.animate(o,t.container)},this.animate=function(e,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"scrollLeft";clearInterval(t.timer),t.timer=setInterval(function(){var i=(e-n[o])/5;i=i>0?Math.ceil(i):Math.floor(i),n[o]+=i,console.log("进行中"),Math.abs(e-n[o])<=Math.abs(i)&&(clearInterval(t.timer),console.log("清除中"),n[o]=e)},t.interval)}},o);e.a=h},function(t,e,n){t.exports=n(4)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});n(2);var o=n(6);n.d(e,"NavBar",function(){return o.a});var i=n(8);n.d(e,"TabContainer",function(){return i.a});var r=n(10);n.d(e,"TabContainerItem",function(){return r.a});var a=n(12);n.d(e,"ScrollView",function(){return a.a});var l=n(14);n.d(e,"LozyLoad",function(){return l.a});var s=n(2);n.d(e,"AutoScrollTab",function(){return s.a})},function(t,e){},function(t,e,n){"use strict";var o,i,r=n(0),a=n.n(r),l=n(1),s=n(7);n.n(s);var c=(o=function(t){function e(n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var o=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,n));i.call(o);var r=n.data,a=n.children,l=r?r.length:a.length;return o.state={ind:n.index||0,isAnimate:n.isAnimate||!1,onSel:n.onSel,data:n.data,length:l},o}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.componentDidMount=function(){var t=this,e=this.state.length;this.setState({itemWidth:l.a.attr(this.wrap,"width")/e},function(){return t.setBarWidth()})},e.prototype.componentWillReceiveProps=function(t){var e=this,n=t.index,o=t.translate,i=this.state.ind;o&&this.translateBar(o),n>=0&&i!==n&&this.setState({ind:n},function(){return e.setBarWidth()})},e.prototype.render=function(){var t=this,e=this.state,n=e.ind,o=e.data,i=e.itemWidth,r=this.props,l=r.children,s=r.style;return a.a.createElement("div",{style:s,className:"NavBar-root",ref:function(e){return t.wrap=e}},a.a.createElement("div",{className:"container",ref:function(e){return t.container=e}},o?o.map(function(e,o){return a.a.createElement("span",{key:"Nav"+o,style:{width:i+"px"},className:"Nav-item "+(o===n&&"active"),onClick:function(){return t.sel(e,o)}},a.a.createElement("span",null,e.name))}):l.map(function(e,o){return a.a.createElement("span",{key:"Nav"+o,style:{width:i+"px"},className:"Nav-item "+(o===n&&"active"),onClick:function(){return t.sel(e,o)}},e)})),a.a.createElement("div",{className:"Nav-active",style:{width:i+"px",transform:"translatex("+n*i+"px)"},ref:function(e){return t.bar=e}},a.a.createElement("div",{className:"Nav-active-bar",ref:function(e){return t.flag=e}})))},e}(r.Component),i=function(){var t=this;this.translateBar=function(e){var n=t.state.length,o=e.distance,i=e.transition;t.bar.style.transition=i?"all 200ms":"none",t.bar.style.transform="translateX("+-o/n+"px)"},this.sel=function(e,n){var o=t.state,i=o.isAnimate,r=o.onSel;t.bar.style.transition=i?"all 200ms":"none",t.setState({ind:n},function(){r&&r(e,n),t.setBarWidth()})},this.setBarWidth=function(){var e=t.state.ind,n=t.container.children,o=(n[e].children.length>=1?n[e].children[0]:n[e]).getBoundingClientRect().width;t.flag.style.width=o+"px"}},o);e.a=c},function(t,e){},function(t,e,n){"use strict";var o=n(0),i=n.n(o),r=n(9);n.n(r);var a="left",l="right",s="top",c="down",u=function(t){function e(n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var o=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,n));return o.slideStart=function(t){o.startX=t.changedTouches[0].pageX,o.startY=t.changedTouches[0].pageY},o.slideMove=function(t){var e=t.changedTouches[0].pageX,n=t.changedTouches[0].pageY,i=e-o.startX,r=n-o.startY,u=i-o.itemWidth*o.index;if(!o.slideDirection||o.slideDirection===l||o.slideDirection===a)if(Math.abs(i)>Math.abs(r)&&i>0)event.preventDefault(),0!==o.index&&o.translate(u),o.slideDirection=l;else if(Math.abs(i)>Math.abs(r)&&i<0)event.preventDefault(),o.index!==o.props.children.length-1&&o.translate(u),o.slideDirection=a;else if(Math.abs(r)>Math.abs(i)&&r>0){if(o.slideDirection)return;o.slideDirection=c}else if(Math.abs(r)>Math.abs(i)&&r<0){if(o.slideDirection)return;o.slideDirection=s}},o.slideEnd=function(t){o.endX=t.changedTouches[0].pageX,o.isTranslate()},o.translate=function(t,e){var n="\n "+(e?"transition: all 200ms;":"")+"\n transform:translateX("+t+"px)\n ";o.container.style=n;var i=o.props.onTranslate;i&&i({distance:t,transition:e})},o.isTranslate=function(){if(o.slideDirection===l||o.slideDirection===a){var t=o.props.onSel,e=o.endX-o.startX,n={right:function(){0!==o.index&&o.index--},left:function(){o.index!==o.props.children.length-1&&o.index++}};Math.abs(e)>=o.interval&&(n[o.slideDirection](),console.log("上下页切换",o.index),t&&t(o.index)),o.translate(-o.index*o.itemWidth,!0)}o.slideDirection=null},o.itemWidth=window.screen.width,o.interval=n.interval||parseInt(o.itemWidth/5),o.index=n.index||0,o.oldIndex=n.index||0,o}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.componentWillReceiveProps=function(t){var e=t.index,n=this.props.onTranslate;this.index!==e&&(this.index=e,n&&n({distance:-this.index*this.itemWidth}),this.container.style.transition=null,this.container.style.transform="translateX("+-e*this.itemWidth+"px)")},e.prototype.componentDidMount=function(){this.translate(-this.index*this.itemWidth),this.root.addEventListener("touchstart",this.slideStart),this.root.addEventListener("touchmove",this.slideMove),this.root.addEventListener("touchend",this.slideEnd)},e.prototype.componentWillUnmount=function(){this.root.removeEventListener("touchstart",this.slideStart),this.root.removeEventListener("touchmove",this.slideMove),this.root.removeEventListener("touchend",this.slideEnd)},e.prototype.render=function(){var t=this;return i.a.createElement("div",{className:"tab-container-root",ref:function(e){t.root=e}},i.a.createElement("ul",{className:"tab-container",ref:function(e){t.container=e}},this.props.children))},e}(o.Component);e.a=u},function(t,e){},function(t,e,n){"use strict";var o=n(0),i=n.n(o),r=n(11),a=(n.n(r),Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t});var l=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.render=function(){var t=this,e=Object.assign({},this.props),n=e.style;return n?n.height||(n.height=window.screen.height+"px"):n={height:window.screen.height+"px"},i.a.createElement("li",a({className:"TabContainerItem"},e,{ref:function(e){return t.el=e}}),this.props.children)},e}(o.Component);e.a=l},function(t,e){},function(t,e,n){"use strict";var o=n(0),i=n.n(o),r=n(1),a=n(13);n.n(a);var l="top",s="bottom",c="loading",u="touch_top",h="touch_bottom",f=function(t){function e(n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var o=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,n));return o.handleTouchStart=function(t){o.startY=t.touches[0].clientY},o.handleTouchMove=function(t){var e=o.state,n=e.isPullDown,i=e.isPullUp,r=e.topDistance,a=e.bottomDistance,f=e.isPullDownStatus,p=e.isPullUpStatus,d=e.isLoadOver,m=o.wrap.scrollTop,v=t.touches[0].clientY,y=void 0;o.direction=v-o.startY>0?h:u,n&&o.direction===h&&0===m&&f!==c&&!p?(event.preventDefault(),o.pullDownBarStartY=o.pullDownBarStartY?o.pullDownBarStartY:t.touches[0].clientY,y=(v-o.pullDownBarStartY)/o.limit,o.translate(y,!1),o.setState({isPullDownStatus:y>=r?l:s})):i&&!d&&o.direction===u&&m>=o.bottom&&p!==c&&!f&&(event.preventDefault(),o.pullUpBarStartY=o.pullUpBarStartY?o.pullUpBarStartY:t.touches[0].clientY,y=(v-o.pullUpBarStartY)/o.limit,o.translate(y,!1),o.setState({isPullUpStatus:Math.abs(y)>=a?s:l}))},o.handleTouchEnd=function(t){var e=o.state,n=e.isPullDownStatus,i=e.isPullUpStatus,r=e.topMethod,a=e.bottomMethod,l=e.animateTime;o.pullDownBarStartY=null,o.pullUpBarStartY=null;var s={top:function(){o.translate(),setTimeout(function(){o.setState({isPullUpStatus:null})},l)},bottom:function(){o.setState({isPullUpStatus:c},function(){o.translate(-o.pullUpBarHeight),a&&a()})}};n&&n!==c&&{top:function(){o.setState({isPullDownStatus:c},function(){o.translate(o.pullDownBarHeight),r&&r()})},bottom:function(){o.translate(),setTimeout(function(){o.setState({isPullDownStatus:null})},l)}}[n](),i&&s[i]()},o.fetchData=function(){var t=o.state,e=t.isFetch,n=t.topMethod;t.animateTime;e&&o.setState({isPullDownStatus:c,isPullUpStatus:null},function(){o.translate(o.pullDownBarHeight,!0),n&&n()})},o.scroll=function(){var t=o.state,e=t.onLower,n=t.onUpper,i=t.onScroll,r=t.scrollX,a=t.upperThreshold,l=t.lowerThreshold,s=r?"scrollLeft":"scrollTop",c=r?o.children:o.wrap,u=c[s],h=r?parseFloat(window.getComputedStyle(c,null).width):parseFloat(window.getComputedStyle(c,null).height),f=r?c.scrollWidth-h:c.scrollHeight-h;i&&i({scroll:u}),u<=a?n&&n():u>=f-l&&e&&e()},o.fill=function(t){var e=o.state.wrapHeight,n=parseFloat(window.getComputedStyle(o.children).height);e&&(o.wrap.style.height=e+"px"),o.setState({fillAttr:n<e&&e-n},function(){o.scrollBottom(),t&&o.setTarget()})},o.setTarget=function(){var t=o.state,e=t.itemIndex,n=t.itemKey,i=t.scrollX;if(e&&n){var r=o.children.children,a=void 0;if(e>=0)a=e;else if(n)for(var l=0;l<o.props.children.length;l++)if(n===o.props.children[l].key){a=l;break}var s=i?o.children:o.wrap;a>=0&&(i?s.scrollLeft=r[a].offsetLeft:s.scrollTop=r[a].offsetTop),setTimeout(function(){s.addEventListener("scroll",o.scroll)},0)}},o.translate=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=o.state,i=n.pullThreshold,r=n.animateTime;Math.abs(t)>i||(o.content.style.transition=e?"all "+r+"ms ease":"none",o.content.style.transform="translate3d(0, "+t+"px,0)")},o.scrollBottom=function(){var t=o.state.fillAttr,e=o.children.scrollHeight,n=parseFloat(window.getComputedStyle(o.wrap).height);o.bottom=t?0:e-n},console.log(n),o.limit=n.limit||4,o.state={isFetch:n.isFetch||!1,isLoadOver:n.isLoadOver,requestState:n.requestState,isPullDown:n.isPullDown||!1,isPullUp:n.isPullUp||!1,topDistance:n.topDistance||50,bottomDistance:n.bottomDistance||50,isPullDownStatus:null,isPullUpStatus:null,topMethod:n.topMethod,bottomMethod:n.bottomMethod,wrapHeight:n.wrapHeight,pullThreshold:n.pullThreshold||200,scrollX:n.scrollX||!1,scrollY:n.scrollY||!1,upperThreshold:n.upperThreshold||50,lowerThreshold:n.lowerThreshold||50,onUpper:n.onUpper,onLower:n.onLower,onScroll:n.onScroll,itemIndex:n.itemIndex>=0&&n.itemIndex,itemKey:n.itemKey||!1,animateTime:n.animateTime||300},o}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.componentDidMount=function(){this.state.scrollX?this.setTarget():(this.wrap.addEventListener("touchstart",this.handleTouchStart),this.wrap.addEventListener("touchmove",this.handleTouchMove),this.wrap.addEventListener("touchend",this.handleTouchEnd),this.fetchData(),this.fill(!0))},e.prototype.componentWillReceiveProps=function(t){var e=this,n=t.requestState,o=t.isLoadOver,i=t.itemIndex,r=t.itemKey,a=this.state,l=a.isPullUpStatus,s=a.isPullDownStatus,c=a.animateTime,u=function(){0===e.wrap.scrollTop&&e.translate(),setTimeout(function(){e.setState({isPullDownStatus:null},function(){return e.fill()})},c)};n&&(l&&function(){e.translate(),setTimeout(function(){e.setState({isPullUpStatus:null},function(){e.fill()})},c)}(),s&&u()),this.setState({isLoadOver:o}),i>=0?this.state.itemIndex!==i&&this.setState({itemIndex:i},function(){return e.setTarget()}):r&&this.state.itemKey!==r&&this.setState({itemKey:r},function(){return e.setTarget()})},e.prototype.componentWillUnmount=function(){this.wrap.removeEventListener("touchstart",this.handleTouchStart),this.wrap.removeEventListener("touchmove",this.handleTouchMove),this.wrap.removeEventListener("touchend",this.handleTouchEnd),(this.state.scrollX?this.children:this.wrap).removeEventListener("scroll",this.scroll),clearInterval(this.timer)},e.prototype.render=function(){var t=this,e=this.state,n=e.isPullDownStatus,o=e.isPullUpStatus,a=e.fillAttr,u=e.scrollX,h=e.isLoadOver,f=this.props,p=f.style,d=f.children;d=Array.isArray(d)?d:[].concat(d);var m=function(){return i.a.createElement("div",{className:"spinner"},i.a.createElement("div",{className:"bounce1"}),i.a.createElement("div",{className:"bounce2"}),i.a.createElement("div",{className:"bounce3"}))};return i.a.createElement("div",{className:"load-more-root",style:p,ref:function(e){return t.wrap=e}},i.a.createElement("div",{className:"load-more-content",ref:function(e){return t.content=e}},!u&&n&&!o&&i.a.createElement("div",{className:"pull-down-bar",ref:function(e){e&&(t.pullDownBarHeight=r.a.attr(e,"height"))}},n===c?i.a.createElement(m,null):i.a.createElement("span",{className:"is-transition "+(n===l?"is-rotate":"")},"↓")),i.a.createElement("div",{className:"scroll-view-root "+(u?"scroll-view-x":"scroll-view-y")+" ",ref:function(e){return t.children=e}},d.map(function(t,e){return i.a.createElement("div",{key:"children"+e,className:u?"scroll-x-item":"scroll-y-item"},t)})),h&&("string"==typeof h?i.a.createElement("p",{className:"pull-up-tip"},h):i.a.createElement("p",{className:"pull-up-tip"},"加载完毕")),a&&i.a.createElement("div",{style:{height:a+"px"}}),!u&&!h&&o&&!n&&i.a.createElement("div",{className:"pull-up-bar",ref:function(e){return e&&(t.pullUpBarHeight=parseFloat(window.getComputedStyle(e).height))}},o===c?i.a.createElement(m,null):i.a.createElement("span",{className:"is-transition "+(o===s?"is-rotate":"")+" "},"↑"))))},e}(o.Component);e.a=f},function(t,e){},function(t,e,n){"use strict";var o=n(0),i=n.n(o),r=n(15),a=n(16),l=(n.n(a),Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t});var s=function(t){function e(n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var o=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,n));return o.lazyLoad=o.lazyLoad.bind(o,n.src),o.state={isAnimate:!1},o}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.componentDidMount=function(){this.isScroll(),window.addEventListener("scroll",this.lazyLoad),window.addEventListener("resize",this.lazyLoad)},e.prototype.componentWillUnmount=function(){window.removeEventListener("scroll",this.lazyLoad),window.removeEventListener("resize",this.lazyLoad)},e.prototype.isScroll=function(){document.body.clientHeight<=r.a.clientHeight()&&this.lazyLoad()},e.prototype.lazyLoad=function(t){r.a.availHeight()+r.a.scrollTop()>this.img.offsetTop-100&&!this.img.src&&(this.img.src=t)},e.prototype.render=function(){var t=this,e=this.state.isAnimate,n=Object.assign({},this.props);return i.a.createElement("div",{className:e?"LazyLoadImg":"",style:{opacity:e?1:0}},i.a.createElement("img",l({},n,{alt:"",ref:function(e){t.img=e},onLoad:function(){t.setState({isAnimate:!0})}})))},e}(o.Component);e.a=s},function(t,e,n){"use strict";var o=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return t.maxWidth=function(){return Math.min(640,this.clientWidth())},t.documentElement=function(){return document.body.clientWidth+document.body.clientHeight+document.body.scrollWidth+document.body.scrollHeight+document.body.scrollTop>document.documentElement.clientWidth+document.documentElement.clientHeight+document.documentElement.scrollWidth+document.documentElement.scrollHeight+document.documentElement.scrollTop?document.body:document.documentElement},t.rootElement=function(){return document.getElementById("root")},t.availWidth=function(){return window.screen.availWidth},t.availHeight=function(){return window.screen.availHeight},t.scrollHeight=function(){return Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)},t.scrollWidth=function(){return Math.max(document.body.scrollWidth,document.documentElement.scrollWidth)},t.scrollTop=function(){return Math.max(document.body.scrollTop,document.documentElement.scrollTop)},t.scrollToTop=function(){window.scrollTo(0,0)},t.setScrollTop=function(t){document.body.scrollTop=t,document.documentElement.scrollTop=t},t.clientHeight=function(){return Math.max(document.body.clientHeight,document.documentElement.clientHeight)},t.clientWidth=function(){return Math.max(document.body.clientWidth,document.documentElement.clientWidth)},t.resetFontSize=function(){var e=t.maxWidth()/7.5;t.fontSize=e,document.documentElement.style.fontSize=e+"px",document.body.style.maxWidth=t.maxWidth()+"px"},t.setInstance=function(e){t.app=e},t.removeInstance=function(){t.app=void 0},t.alert=function(e,n){t.app.setState({alert:{message:e,onClose:function(){t.app.setState({alert:void 0},function(){n&&n()})}}})},t.confirm=function(e,n,o,i){t.app.setState({confirm:{title:e,message:n,onConfirm:function(){t.app.setState({confirm:void 0},function(){o&&o()})},onCancel:function(){t.app.setState({confirm:void 0},function(){i&&i()})}}})},t.loading=function(e,n){t.app.setState({loading:e},function(){n&&n()})},t.isHorizontal=function(){return t.clientWidth()>t.clientHeight()},t}();e.a=o},function(t,e){}]).default});
//# sourceMappingURL=bestnihon-react-components.min.js.map

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc