张延森 3 年之前
父節點
當前提交
f4956cbd7c
共有 4 個文件被更改,包括 17 次插入19 次删除
  1. 1
    1
      project.config.json
  2. 14
    12
      src/components/List/index.jsx
  3. 1
    0
      src/components/MasonryLayout/style.less
  4. 1
    6
      src/pages/index/tabs/Recommend.jsx

+ 1
- 1
project.config.json 查看文件

@@ -2,7 +2,7 @@
2 2
   "miniprogramRoot": "./dist",
3 3
   "projectname": "miniapp",
4 4
   "description": "十公里",
5
-  "appid": "wx835627a9b9b3932a",
5
+  "appid": "wx06a7372d48d56843",
6 6
   "setting": {
7 7
     "urlCheck": true,
8 8
     "es6": false,

+ 14
- 12
src/components/List/index.jsx 查看文件

@@ -95,23 +95,25 @@ export default React.forwardRef((props, ref) => {
95 95
 
96 96
   return (
97 97
     <ScrollView
98
+      {...leftProps}
98 99
       scrollY
99 100
       enhanced
100 101
       onScrollToLower={handleScrollToLower}
101
-      {...leftProps}
102 102
       className={`${className} ${uqCls} list-view`}
103 103
     >
104
-      {!render
105
-        ? props.children
106
-        : list.map((item, index) => render({ item, index }))
107
-      }
108
-      {!list || !list.length && noData}
109
-
110
-      <Spin3 show={loading} />
111
-
112
-      {list && list.length > 0 && !hasMore &&
113
-        <view className='botton'>这是我的底线</view>
114
-      }
104
+      <view>
105
+        {!render
106
+          ? props.children
107
+          : list.map((item, index) => render({ item, index }))
108
+        }
109
+        {!list || !list.length && noData}
110
+
111
+        <Spin3 show={loading} />
112
+
113
+        {list && list.length > 0 && !hasMore &&
114
+          <view className='botton'>这是我的底线</view>
115
+        }
116
+      </view>
115 117
     </ScrollView>
116 118
   )
117 119
 })

+ 1
- 0
src/components/MasonryLayout/style.less 查看文件

@@ -1,6 +1,7 @@
1 1
 
2 2
 .masonry-layout {
3 3
   box-sizing: border-box;
4
+  position: relative;
4 5
   width: 100%;
5 6
   display: flex;
6 7
 

+ 1
- 6
src/pages/index/tabs/Recommend.jsx 查看文件

@@ -50,12 +50,7 @@ export default (props) => {
50 50
       
51 51
       //如果context有的话代表他滚动了   那么切换tab页就置顶
52 52
       if (listRef.current?.context) {
53
-        Taro.nextTick(() => {
54
-          const t = setTimeout(() => {
55
-            listRef.current.context.scrollTo({ top: 0 })
56
-            clearTimeout(t)
57
-          }, 500)
58
-        })
53
+        listRef.current.context.scrollTo({ top: 0 })
59 54
       }
60 55
     }
61 56