Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swiper组件重构;下拉刷新bug修改;其他组件样式与bug修改 #80

Merged
merged 1 commit into from
Aug 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/taro-components-mpharmony/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"clean": "rimraf dist",
"build": "npm run clean && rollup -c ",
"dev": "npm run clean && rollup -c "
"dev": "npm run clean && rollup -c -w"
},
"keywords": [],
"author": "",
Expand All @@ -31,7 +31,9 @@
"react-grid-layout": "^1.3.4",
"react-resizable": "^3.0.4",
"react-responsive": "^9.0.2",
"react-slick": "^0.29.0",
"react-stonecutter": "^0.3.10",
"slick-carousel": "^1.8.1",
"swiper": "6.8.0",
"tinymce": "6.5.1",
"universal-router": "^9.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ img[src=""] {
overflow: hidden;
position: relative;
font-size: 0;
width: 320px;
height: 240px;
width: 100%;
height: 100%;
}

.taro-img.taro-img__widthfix {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ class PullDownRefresh extends React.Component<IProps, IState> {

get scrollContainer () {
return (
this.contentRef?.parentElement ||
this.contentRef?.closest('.taro_page_stationed') ||
this.containerRef?.parentElement ||
this.containerRef?.closest('.taro_page_stationed') ||
document.querySelector('.taro_page_stationed') ||
document.querySelector('.taro_page') ||
document.querySelector('.taro_router') ||
Expand Down Expand Up @@ -183,6 +183,9 @@ class PullDownRefresh extends React.Component<IProps, IState> {
}

onTouchStart = (_, e: TouchEvent) => {
if (!e || !e.touches) {
return
}
this._ScreenY = this._startScreenY = e.touches[0].screenY
// 一开始 refreshing 为 true 时 this._lastScreenY 有值
this._lastScreenY = this._lastScreenY || 0
Expand Down Expand Up @@ -210,9 +213,11 @@ class PullDownRefresh extends React.Component<IProps, IState> {
}

onTouchMove = (ele: HTMLElement, e: TouchEvent) => {
if (!e || !e.touches) {
return
}
// 使用 pageY 对比有问题
const _screenY = e.touches[0].screenY

// 拖动方向不符合的不处理
if (this._startScreenY > _screenY) {
return
Expand Down Expand Up @@ -328,9 +333,9 @@ class PullDownRefresh extends React.Component<IProps, IState> {
)
}

if (this.scrollContainer) {
return renderRefresh(`${prefixCls}-content ${prefixCls}-down`)
}
// if (this.scrollContainer) {
// return renderRefresh(`${prefixCls}-content ${prefixCls}-down`)
// }
return (
<pull-down-refresh
ref={el => {
Expand Down
Loading