李志伟 3 anni fa
parent
commit
3fb33c7c14

+ 0
- 20
src/hotel/components/Income/income.jsx Vedi File

@@ -86,26 +86,6 @@ export default (props) => {
86 86
           )}
87 87
         >
88 88
         </List>
89
-        {/*<view className='title' >{accountlog.length==0?'推广收入记录':'暂无推广收入'}</view>
90
-         <List
91
-          style={{ height: '50vh' }}
92
-          request={fetchAPI}
93
-          params={queryParams}
94
-          onDataChange={setAccountlog}
95
-          noData="暂无推广收入"
96
-        >
97
-          <view className='waterfall'>
98
-            {
99
-              accountlog.map((item,index) => <view className='spreadCard' key={index}>
100
-                <view className='card'>
101
-                  <view className='spreadTime'>时&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;间:<text>{formatTime(item.createDate, 'yyyy/MM/dd hh:mm:ss')}</text></view>
102
-                  <view className='spreadMoney'>收入金额:<text>{parseFloat((item.amount / 100).toFixed(2))}</text>元</view>
103
-                  <image className='spreadImg' src={sImg} />
104
-                </view>
105
-              </view>)
106
-            }
107
-          </view>
108
-        </List> */}
109 89
       </view>
110 90
     </view>
111 91
   )

+ 1
- 1
src/pages/index/tabs/Recommend.jsx Vedi File

@@ -36,7 +36,7 @@ export default (props) => {
36 36
     if (index == 0) {
37 37
       setQueryParams({ location: location, pageNum: 1, pageSize: 10, typeId: '' })
38 38
     }
39
-
39
+    //如果context有的话代表他滚动了   那么切换tab页就置顶
40 40
     if (listRef.current?.context) {
41 41
       listRef.current.context.scrollTo({ top: 0 })
42 42
     }

+ 7
- 1
src/pages/searchResult/searchResult.jsx Vedi File

@@ -1,4 +1,4 @@
1
-import { React, useState } from 'react'
1
+import { React, useState,useRef } from 'react'
2 2
 // .就是当前路径
3 3
 import iconsearch from '../../assets/icons/housemantj/search.png'
4 4
 import CustomNav from '@/components/CustomNav'
@@ -33,6 +33,8 @@ export default withLayout((props) => {
33 33
       title: '景点',
34 34
     },
35 35
   ]
36
+  const listRef = useRef()
37
+
36 38
   const handleTabChange = (e) => {
37 39
     const { index } = e.detail
38 40
     setActiveTab(index)
@@ -45,6 +47,10 @@ export default withLayout((props) => {
45 47
     else {
46 48
       setQueryParams({ q: q, targetType: 'tourist', location: location, pageNum: 1, pageSize: 10, typeId: '' })
47 49
     }
50
+    //如果context有的话代表他滚动了   那么切换tab页就置顶
51
+    if (listRef.current?.context) {
52
+      listRef.current.context.scrollTo({ top: 0 })
53
+    }
48 54
   }
49 55
 
50 56
 

+ 6
- 2
src/shop/components/ShopKeeper/shopKeeper.jsx Vedi File

@@ -1,4 +1,4 @@
1
-import { React, useState, useEffect, useMemo } from 'react'
1
+import { React, useState, useEffect, useMemo,useRef } from 'react'
2 2
 import Taro, { useRouter } from '@tarojs/taro'
3 3
 import Picker from '@/components/Picker'
4 4
 import ShopUsed from '@/components/ShopUsed' //已核销
@@ -50,6 +50,7 @@ export default (props) => {
50 50
     onHotelChange(current)
51 51
   }
52 52
 
53
+  const listRef = useRef()
53 54
 
54 55
   const handelSearch = (e) => {
55 56
     const val = e.detail.value
@@ -65,7 +66,10 @@ export default (props) => {
65 66
     const { index } = e.detail
66 67
     setActiveTab(index)
67 68
     setisVerified(index)
68
-
69
+//如果context有的话代表他滚动了   那么切换tab页就置顶
70
+if (listRef.current?.context) {
71
+  listRef.current.context.scrollTo({ top: 0 })
72
+}
69 73
   }
70 74
   const tabs = [
71 75
     {

+ 6
- 1
src/shop/pages/spread/spreadIndex.jsx Vedi File

@@ -1,4 +1,4 @@
1
-import React, { useState, useEffect } from 'react'
1
+import React, { useState, useEffect,useRef } from 'react'
2 2
 import CustomNav from '@/components/CustomNav'
3 3
 import { useRouter } from '@tarojs/taro'
4 4
 import { getShopList, getShopMoney, getAccount, getVerifiedOrder, setGetVerifiedOrder } from '@/services/shopBoss'
@@ -30,10 +30,15 @@ export default withLayout((props) => {
30 30
   const [isVerified, setisVerified] = useState(0)
31 31
   const [shopMoney, setShopMoney] = useState([])
32 32
   const [verifiedOrder, setVerifiedOrder] = useState([])
33
+  const listRef = useRef()
33 34
 
34 35
   const handleTabChange = (e) => {
35 36
     const { index } = e.detail
36 37
     setCurrentTab(index)
38
+    //如果context有的话代表他滚动了   那么切换tab页就置顶
39
+    if (listRef.current?.context) {
40
+      listRef.current.context.scrollTo({ top: 0 })
41
+    }
37 42
   }
38 43
 
39 44
   const handelType = () => {