吃个甘蔗嚼一年 3 years ago
parent
commit
a86b16d90b
35 changed files with 409 additions and 264 deletions
  1. 1
    1
      config/dev.js
  2. 1
    1
      config/prod.js
  3. 1
    1
      project.config.json
  4. BIN
      src/assets/icons/UserCenter/tips.png
  5. BIN
      src/assets/icons/housemantj/loc-o.png
  6. BIN
      src/assets/icons/housemantj/phone-o.png
  7. 4
    4
      src/components/CouponCard/Cashback/index.jsx
  8. 1
    1
      src/components/CouponCard/Cashback/style.less
  9. 1
    1
      src/components/CouponCard/Media/Header.jsx
  10. 20
    27
      src/components/List/index.jsx
  11. 36
    0
      src/components/MasonryLayout/Column.jsx
  12. 10
    30
      src/components/MasonryLayout/Item.jsx
  13. 48
    0
      src/components/MasonryLayout/Waterfall.jsx
  14. 69
    37
      src/components/MasonryLayout/index.jsx
  15. 15
    4
      src/components/MasonryLayout/style.less
  16. 1
    1
      src/components/MoreGuide/style.less
  17. 5
    8
      src/components/ShopUnused/style.less
  18. 2
    5
      src/components/ShopUsed/style.less
  19. 14
    7
      src/components/Spin/SpinBox.jsx
  20. 8
    14
      src/components/Spin/style.less
  21. 1
    1
      src/hotel/components/HouseManage/houseManage.jsx
  22. 1
    1
      src/hotel/pages/components/Extend/style.less
  23. 3
    7
      src/pages/MineUserAll/RefundMoney/CheckRefund/index.jsx
  24. 4
    1
      src/pages/details/components/Extend/extend.less
  25. 24
    4
      src/pages/details/foodDetails/foodDetails.jsx
  26. 5
    5
      src/pages/details/foodDetails/foodDetails.less
  27. 2
    2
      src/pages/details/mjDetails/sceneryDetails.jsx
  28. 4
    4
      src/pages/details/mjDetails/sceneryDetails.less
  29. 31
    16
      src/pages/index/components/Card/index.jsx
  30. 34
    26
      src/pages/index/components/Card/style.less
  31. 1
    4
      src/pages/index/index.jsx
  32. 8
    11
      src/pages/index/tabs/Guide.jsx
  33. 39
    30
      src/pages/index/tabs/Recommend.jsx
  34. 14
    8
      src/pages/index/tabs/less/Recommend.less
  35. 1
    2
      src/shop/components/ShopKeeper/shopKeeper.jsx

+ 1
- 1
config/dev.js View File

4
   },
4
   },
5
   defineConstants: {
5
   defineConstants: {
6
     // HOST: '"http://192.168.89.147:8080"',
6
     // HOST: '"http://192.168.89.147:8080"',
7
-    HOST: '"https://sgl-v2-test.njyunzhi.com"',
7
+    HOST: '"https://sgl-v2.njyunzhi.com"',
8
   },
8
   },
9
   mini: {},
9
   mini: {},
10
   h5: {}
10
   h5: {}

+ 1
- 1
config/prod.js View File

3
     NODE_ENV: '"production"'
3
     NODE_ENV: '"production"'
4
   },
4
   },
5
   defineConstants: {
5
   defineConstants: {
6
-    HOST: '"https://sgl-v2-test.njyunzhi.com"',
6
+    HOST: '"https://sgl-v2.njyunzhi.com"',
7
   },
7
   },
8
   mini: {},
8
   mini: {},
9
   h5: {
9
   h5: {

+ 1
- 1
project.config.json View File

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

BIN
src/assets/icons/UserCenter/tips.png View File


BIN
src/assets/icons/housemantj/loc-o.png View File


BIN
src/assets/icons/housemantj/phone-o.png View File


+ 4
- 4
src/components/CouponCard/Cashback/index.jsx View File

4
 import './style.less'
4
 import './style.less'
5
 
5
 
6
 export default (props) => {
6
 export default (props) => {
7
-  const { money, prefix = '返', style } = props
7
+  const { money, prefix = '返', style } = props
8
 
8
 
9
-  const yuan = Number(money / 100).toFixed(2)
9
+  const yuan = Number(money / 100).toFixed(0)
10
 
10
 
11
   return (
11
   return (
12
     <View className='cpn_cashback' style={style}>
12
     <View className='cpn_cashback' style={style}>
13
-      <Text>{prefix}</Text>
14
-      <Text>{`${yuan}`}</Text>
13
+      <Text style={{ fontSize: '.6em' }}>{`${prefix}¥`}</Text>
14
+      <Text>{`${yuan}`}</Text>
15
     </View>
15
     </View>
16
   )
16
   )
17
 }
17
 }

+ 1
- 1
src/components/CouponCard/Cashback/style.less View File

4
   background: url('~@/assets/icons/ProCard/ProCard_hot.png') no-repeat;
4
   background: url('~@/assets/icons/ProCard/ProCard_hot.png') no-repeat;
5
   background-size: 100% 100%;
5
   background-size: 100% 100%;
6
   padding: 16px 25px 10px 10px;
6
   padding: 16px 25px 10px 10px;
7
-  font-size: 20px;
7
+  font-size: 44px;
8
   color: #fff;
8
   color: #fff;
9
   line-height: 1em;
9
   line-height: 1em;
10
 }
10
 }

+ 1
- 1
src/components/CouponCard/Media/Header.jsx View File

11
 
11
 
12
   return (
12
   return (
13
     <View className='coupun-media_header'>
13
     <View className='coupun-media_header'>
14
-      {enableCashback && <Cashback money={cashback} style={{ marginTop: '10px' }} />}
14
+      {enableCashback && <Cashback money={cashback} style={{ marginTop: '-10px' }} />}
15
       <View className='coupun-media_thumb'>
15
       <View className='coupun-media_thumb'>
16
         <BadgeTag type={badge} />
16
         <BadgeTag type={badge} />
17
         <Image src={image} />
17
         <Image src={image} />

+ 20
- 27
src/components/List/index.jsx View File

16
     className,
16
     className,
17
     ...leftProps
17
     ...leftProps
18
   } = props
18
   } = props
19
-  const [loading, setLoading] = useState(false)
20
 
19
 
20
+  const [loading, setLoading] = useState(false)
21
   const contextRef = useRef()
21
   const contextRef = useRef()
22
-  const loadingRef = useRef(false)
23
-  const [payload, setPayload] = useState(params)
22
+  const [forceUpdate, setForceUpdate] = useState(0)
24
   const [list, setList] = useState([])
23
   const [list, setList] = useState([])
25
-  const pageRef = useRef({ current: 1, pages: 0 })
26
-  const hasMore = pageRef.current.current < pageRef.current.pages
24
+  const pageRef = useRef({ current: 1 })
25
+  const [hasMore, setHasMore] = useState(false)
27
 
26
 
28
   // 滚动
27
   // 滚动
29
   const handleScrollToLower = (e) => {
28
   const handleScrollToLower = (e) => {
30
-    const loading = loadingRef.current
31
-
32
     if (!loading && hasMore) {
29
     if (!loading && hasMore) {
33
-      setPayload({
34
-        ...payload,
35
-        pageNum: pageRef.current.current + 1
36
-      })
30
+      pageRef.current.current += 1
31
+      setForceUpdate(forceUpdate + 1)
37
     }
32
     }
38
   }
33
   }
39
 
34
 
40
-  const fetchList = (params) => {
35
+  const fetchList = () => {
41
     if (!request) return;
36
     if (!request) return;
42
 
37
 
43
     setLoading(true)
38
     setLoading(true)
44
-    loadingRef.current = true
45
-    request(params).then((res) => {
39
+    request({
40
+      ...params,
41
+      pageSize,
42
+      pageNum: pageRef.current.current
43
+    }).then((res) => {
46
       const { records, ...pageInfo } = res || {}
44
       const { records, ...pageInfo } = res || {}
47
       const lst = pageInfo.current === 1 ? records || [] : list.concat(records || [])
45
       const lst = pageInfo.current === 1 ? records || [] : list.concat(records || [])
48
       setList(lst)
46
       setList(lst)
47
+      setHasMore(pageInfo.current < pageInfo.pages)
48
+
49
       if (onDataChange) {
49
       if (onDataChange) {
50
-        onDataChange(lst)
50
+        onDataChange(lst, { paramsChanged: pageInfo.current === 1 })
51
       }
51
       }
52
 
52
 
53
       pageRef.current = pageInfo
53
       pageRef.current = pageInfo
54
-      loadingRef.current = false
55
-
56
       setLoading(false)
54
       setLoading(false)
57
 
55
 
58
     }).catch((err) => {
56
     }).catch((err) => {
59
-      loadingRef.current = false
60
       console.error(err)
57
       console.error(err)
61
       setLoading(false)
58
       setLoading(false)
62
 
59
 
69
   const fetchRef = useRef()
66
   const fetchRef = useRef()
70
   fetchRef.current = fetchList
67
   fetchRef.current = fetchList
71
 
68
 
72
-  // 联动状态, 设置查询参数
73
   useEffect(() => {
69
   useEffect(() => {
74
-    setPayload({
75
-      ...params || {},
76
-      pageNum: 1,
77
-      pageSize,
78
-    })
79
-  }, [pageSize, params])
70
+    pageRef.current.current = 1
71
+    setHasMore(false)
72
+  }, [params])
80
 
73
 
81
   // 请求数据
74
   // 请求数据
82
   useEffect(() => {
75
   useEffect(() => {
83
-    fetchRef.current(payload)
84
-  }, [payload, request])
76
+    fetchRef.current()
77
+  }, [params, forceUpdate])
85
 
78
 
86
   useEffect(() => {
79
   useEffect(() => {
87
     Taro.nextTick(() => {
80
     Taro.nextTick(() => {

+ 36
- 0
src/components/MasonryLayout/Column.jsx View File

1
+import React, { useEffect, useRef } from 'react'
2
+import { View } from '@tarojs/components'
3
+import Item from './Item'
4
+import { classNames } from './utils'
5
+
6
+export default (props) => {
7
+  const { className, list = [], render, onRenderFinish, ...leftProps } = props
8
+
9
+  const heightRef = useRef(0)
10
+
11
+  const handleRenderFinish = (item, index) => (rect) => {
12
+    const { height } = rect;
13
+    item.__height = height
14
+    
15
+    if (index === 0) {
16
+      heightRef.current = height
17
+    } else {
18
+      heightRef.current += height
19
+    }
20
+
21
+    onRenderFinish(heightRef.current)
22
+  }
23
+
24
+  return (
25
+    <View {...leftProps} className={classNames(className, 'masonry-column')}>
26
+      {
27
+        list.map((item, index) => {
28
+
29
+          return (
30
+            <Item key={item.__vid} item={item} render={render} onRenderFinish={handleRenderFinish(item, index)} />
31
+          )
32
+        })
33
+      }
34
+    </View>
35
+  )
36
+}

+ 10
- 30
src/components/MasonryLayout/Item.jsx View File

1
 
1
 
2
-import React, { useMemo, useEffect } from 'react'
2
+import React, { useMemo } from 'react'
3
+import Taro from '@tarojs/taro';
3
 import { View } from '@tarojs/components'
4
 import { View } from '@tarojs/components'
4
-import { classNames, getRect } from './utils';
5
+import { classNames } from './utils';
5
 import './style.less'
6
 import './style.less'
6
 
7
 
7
 export default (props) => {
8
 export default (props) => {
8
-  const { className, item, render, onRenderFinish } = props
9
+  const { className, item, top, render, onRenderFinish } = props
9
 
10
 
11
+  // const uqClass = useMemo(() => `f-${Math.random().toString(36).substring(2)}`, [])
10
   const vid = item.__vid;
12
   const vid = item.__vid;
11
   
13
   
12
-  useEffect(() => {
13
-    const calcHeight = () => {
14
-      getRect(`.${vid}`).then((res) => {
15
-        if (!res) {
16
-          // 找不到 node , 则一直重复查询
17
-          const t = setTimeout(() => {
18
-            clearTimeout(t)
19
-            calcHeight()
20
-          }, 300)
21
-        } else {
22
-          if (Array.isArray(res)) {
23
-            onRenderFinish(res[0])
24
-          } else {
25
-            onRenderFinish(res)
26
-          }
27
-        }
28
-      })
29
-    }
30
-
31
-    calcHeight()
32
-  })
33
-
14
+  const handleCallback = () => {
15
+    Taro.createSelectorQuery().select(`.${vid}`).boundingClientRect(rect => onRenderFinish(rect)).exec()
16
+  }
34
 
17
 
35
   return (
18
   return (
36
-    <View
37
-      key={vid}
38
-      className={classNames(className, 'masonry-item', vid)}
39
-    >
40
-      {render(item)}
19
+    <View className={classNames(className, 'masonry-item', vid)}>
20
+      {render(item, handleCallback)}
41
     </View>
21
     </View>
42
   )
22
   )
43
 }
23
 }

+ 48
- 0
src/components/MasonryLayout/Waterfall.jsx View File

1
+import React, { useEffect, useMemo, useState } from 'react'
2
+import Taro from '@tarojs/taro';
3
+import { View } from '@tarojs/components'
4
+import { classNames, getRect } from './utils';
5
+import './style.less'
6
+
7
+export default (props) => {
8
+  const { className, itemClassName, style, gutter = 0, list, render, ...leftProps } = props
9
+  const uqClass = useMemo(() => `f-${Math.random().toString(36).substring(2)}`, [])
10
+
11
+  const [styles, setStyles] = useState([])
12
+
13
+  const handleImage = index => (e) => {
14
+    const { height } = e
15
+    const span = Math.ceil(height / 10)
16
+
17
+    const itemStyle = { gridRow: `auto/span ${span}` }
18
+    styles[index] = itemStyle
19
+    
20
+    if (styles.filter(Boolean).length === list.length) {    
21
+      setStyles(styles.slice())
22
+    }
23
+  }
24
+
25
+  // useEffect(() => {
26
+  //   const t = setTimeout(() => {
27
+  //     Taro.createSelectorQuery().selectAll(`.${uqClass} .waterfall-item`).boundingClientRect(rects => {
28
+  //       console.log('---------waterfall-item---------->', rects)
29
+  //     }).exec()
30
+  //     clearTimeout(t)
31
+  //   }, 500)
32
+  // }, [list, uqClass])
33
+
34
+  return (
35
+    <View className={classNames(className, 'waterfall-wrapper', uqClass)}>
36
+      {
37
+        list.map((item, index) => {
38
+          const st = styles[index]
39
+          return (
40
+            <View key={index} className={classNames(itemClassName, 'waterfall-item')} style={st}>
41
+              {render(item, handleImage(index))}
42
+            </View>
43
+          )
44
+        })
45
+      }
46
+    </View>
47
+  )
48
+}

+ 69
- 37
src/components/MasonryLayout/index.jsx View File

1
 import React, { useEffect, useMemo, useRef, useState } from 'react';
1
 import React, { useEffect, useMemo, useRef, useState } from 'react';
2
 import Taro from '@tarojs/taro';
2
 import Taro from '@tarojs/taro';
3
 import { View } from '@tarojs/components';
3
 import { View } from '@tarojs/components';
4
-import Item from './Item';
4
+import usePrevious from '@/utils/hooks/usePrevious';
5
+import Column from './Column';
5
 import { useList } from './hooks';
6
 import { useList } from './hooks';
6
 import { classNames, getRect } from './utils';
7
 import { classNames, getRect } from './utils';
7
 
8
 
8
 import './style.less'
9
 import './style.less'
9
 
10
 
11
+/**
12
+ * 核心原理, 左右2栏,一个个放元素,同时记录高度,优先放入低高度区域
13
+ * 元素高度获取,主要是通过图片的 onLoad 来确保加载完成
14
+ * 
15
+ * 复杂度, 多数据公用 list,
16
+ * 需要区分是否更换数据源,是否未更换数据源,只是新增了数据
17
+ */
18
+
10
 export default (props) => {
19
 export default (props) => {
11
-  const { className, itemClassName, style, gutter = 0, list, render, ...leftProps } = props
20
+  const { className, listData, itemKey, render } = props
21
+
22
+  // rfTimes 用来区分是否更换数据源
23
+  const { list, rfTimes: refresh } = listData
24
+
25
+  // 用来绘制页面的数据
26
+  const renderListRef = useRef([])
12
 
27
 
13
-  const splitStyle = { width: `${gutter}rpx` }
28
+  const lastList = usePrevious(list)
29
+  const lastRf = usePrevious(refresh)
14
 
30
 
15
-  const leftBottom = useRef(0)
16
-  const rightBottom = useRef(0)
31
+  // 记录左右2栏的数据及高度
32
+  const leftHeight = useRef(0)
33
+  const rightHeight = useRef(0)
17
   const [leftList, leftRef, setLeftList] = useList()
34
   const [leftList, leftRef, setLeftList] = useList()
18
   const [rightList, rightRef, setRightList] = useList()
35
   const [rightList, rightRef, setRightList] = useList()
19
-  const [cursor, setCursor] = useState(0)
20
 
36
 
21
-  const listRef = useRef([])
22
-  listRef.current = list
23
-
24
-  const handleRenderFinish = (direct) => (rect) => {
25
-    const { bottom } = rect
37
+  // 用来强制更新组件
38
+  const [cursor, setCursor] = useState(-1)
26
 
39
 
40
+  // 每个元素渲染完成, 会拿到当前栏的高度
41
+  const handleRenderFinish = (direct) => (height) => {
27
     if (direct === 'left') {
42
     if (direct === 'left') {
28
-      leftBottom.current = bottom
43
+      leftHeight.current = height
29
     } else {
44
     } else {
30
-      rightBottom.current = bottom
45
+      rightHeight.current = height
31
     }
46
     }
32
 
47
 
48
+    // 触发强制渲染
33
     setCursor(cursor + 1)
49
     setCursor(cursor + 1)
34
   }
50
   }
35
     
51
     
36
   useEffect(() => {
52
   useEffect(() => {
37
-    setCursor(0)
38
-    setLeftList([])
39
-    setRightList([])
40
-    listRef.current = list ? list.slice() : []
53
+    // 新数据源 = 首次进入 或者 切换数据源
54
+    const isNew = (!lastList?.length && list.length) || (lastRf !== refresh)
55
+    
56
+    if (!isNew) {
57
+      // 非新数据源, list 变更那就说明是执行了上拉加载
58
+      const addedList = []
59
+      for (let item of list) {
60
+        const found = lastList.filter(x => x[itemKey] === item[itemKey])[0]
61
+        if (!found) {
62
+          addedList.push(item)
63
+        }
64
+      }
65
+      
66
+      // 于是, 只继续绘制变更的那部分
67
+      renderListRef.current = addedList
68
+      setCursor(-2)
69
+    } else {
70
+      setCursor(0)
71
+      setLeftList([])
72
+      setRightList([])
73
+      renderListRef.current = list ? list.slice() : []
74
+      leftHeight.current = 0
75
+      rightHeight.current = 0
76
+  
77
+      if (renderListRef.current.length) {
78
+        setCursor(0)
79
+      } else {
80
+        setCursor(-1)
81
+      }
82
+    }
41
   }, [list])
83
   }, [list])
42
 
84
 
43
   useEffect(() => {
85
   useEffect(() => {
44
-    const len = !list ? 0 : list.length;
45
-    if (leftRef.current.length + rightRef.current.length >= len) return;
86
+    // 如果当前渲染数据为空
87
+    if (!renderListRef.current.length) return;
46
 
88
 
47
-    const item = listRef.current.shift()
89
+    // 每次把数组最上面的一个拿出来
90
+    const item = renderListRef.current.shift()
48
     item.__vid = `f-${Math.random().toString(36).substring(2)}`
91
     item.__vid = `f-${Math.random().toString(36).substring(2)}`
49
 
92
 
50
-    if (leftBottom.current <= rightBottom.current) {
93
+    // 优先放入低高度的栏里面
94
+    if (leftHeight.current <= rightHeight.current) {
51
       setLeftList([...leftRef.current, item])
95
       setLeftList([...leftRef.current, item])
52
     } else {
96
     } else {
53
       setRightList([...rightRef.current, item])
97
       setRightList([...rightRef.current, item])
54
     }
98
     }
55
-  }, [cursor, list])
99
+  }, [cursor])
56
 
100
 
57
   return (
101
   return (
58
-    <View
59
-      style={style}
60
-      className={classNames(className, 'masonry-layout')}
61
-    >
62
-      <View className='masonry-column'>
63
-        {
64
-          leftList.map(item => <Item key={item.__vid} className={itemClassName} item={item} render={render} onRenderFinish={handleRenderFinish('left')} />)
65
-        }
66
-      </View>
67
-      <View className='masonry-split' style={splitStyle} />
68
-      <View className='masonry-column'>
69
-        {
70
-          rightList.map(item => <Item key={item.__vid} className={itemClassName} item={item} render={render} onRenderFinish={handleRenderFinish('right')} />)
71
-        }
72
-      </View>
102
+    <View className={classNames(className, 'masonry-layout')}>
103
+      <Column list={leftList} render={render} onRenderFinish={handleRenderFinish('left')} />
104
+      <Column list={rightList} render={render} onRenderFinish={handleRenderFinish('right')} />
73
     </View>
105
     </View>
74
   )
106
   )
75
 }
107
 }

+ 15
- 4
src/components/MasonryLayout/style.less View File

6
 
6
 
7
   .masonry-column {
7
   .masonry-column {
8
     flex: 1;
8
     flex: 1;
9
+    overflow: hidden;
10
+    position: relative;
9
   }
11
   }
10
   
12
   
11
-  .masonry-split {
12
-    flex: none;
13
+  .masonry-item {
14
+    width: 100%;
13
   }
15
   }
16
+}
14
 
17
 
15
-  .masonry-item {
18
+
19
+.waterfall-wrapper {
20
+  display: grid;
21
+  grid-template-columns: repeat(auto-fill, minmax(50%, 1fr));
22
+  grid-gap: 0;
23
+  grid-auto-flow: row dense;
24
+  grid-auto-rows: 20px;
25
+
26
+  .waterfall-item {
16
     width: 100%;
27
     width: 100%;
17
-    overflow-x: hidden;
28
+    grid-row: auto/span 10;
18
   }
29
   }
19
 }
30
 }

+ 1
- 1
src/components/MoreGuide/style.less View File

6
     font-size: 28px;
6
     font-size: 28px;
7
     font-weight: 400;
7
     font-weight: 400;
8
     color: #202020;
8
     color: #202020;
9
-    line-height: 54px;
9
+    line-height: 64px;
10
     padding-bottom: 10px;
10
     padding-bottom: 10px;
11
   }
11
   }

+ 5
- 8
src/components/ShopUnused/style.less View File

5
     color: #666666;
5
     color: #666666;
6
     line-height: 44px;
6
     line-height: 44px;
7
     float: left;
7
     float: left;
8
-    margin: 60px 0 32px 0;
8
+    margin: 60px 0 0 0;
9
 
9
 
10
   }
10
   }
11
   .orderTime{    
11
   .orderTime{    
13
     color: #666666;
13
     color: #666666;
14
     line-height: 44px;
14
     line-height: 44px;
15
     float: right;
15
     float: right;
16
-    margin: 60px 0 32px 0;
16
+    margin: 60px 0 0 0;
17
   }
17
   }
18
   .order{
18
   .order{
19
     background: #FFFFFF;
19
     background: #FFFFFF;
25
       height: 194px;
25
       height: 194px;
26
       border-radius: 22px;
26
       border-radius: 22px;
27
       float: left;
27
       float: left;
28
-      margin:0 26px 30px 0;
28
+      margin:0 26px 0 0;
29
     }
29
     }
30
     .orderRight{
30
     .orderRight{
31
       .foodName{
31
       .foodName{
32
         font-size: 24px;
32
         font-size: 24px;
33
         color: #333333;
33
         color: #333333;
34
-        line-height: 40px;
34
+        margin-top: 40px;
35
       }
35
       }
36
       .price{
36
       .price{
37
         font-size: 20px;
37
         font-size: 20px;
38
         font-weight: bold;
38
         font-weight: bold;
39
         color: #202020;
39
         color: #202020;
40
-        line-height: 44px;
41
-        margin: 37px 0 40px 0;
42
-        height: 19px;
40
+        margin: 0 0 10px 0;
43
         .pnum{
41
         .pnum{
44
           color: #333333;
42
           color: #333333;
45
           font-weight: 400;
43
           font-weight: 400;
72
       width: 160px;
70
       width: 160px;
73
     height: 40px;
71
     height: 40px;
74
     background: #1A3B83;
72
     background: #1A3B83;
75
-    /* margin: 0 auto; */
76
     line-height: 40px;
73
     line-height: 40px;
77
     border-radius: 12px;
74
     border-radius: 12px;
78
     font-size: 23px;
75
     font-size: 23px;

+ 2
- 5
src/components/ShopUsed/style.less View File

28
     }
28
     }
29
     .orderRight {
29
     .orderRight {
30
       .foodName {
30
       .foodName {
31
-        height: 63px;
32
         font-size: 24px;
31
         font-size: 24px;
33
         color: #333333;
32
         color: #333333;
34
-        line-height: 40px;
35
       }
33
       }
36
       .price {
34
       .price {
37
         font-size: 20px;
35
         font-size: 20px;
38
         font-weight: bold;
36
         font-weight: bold;
39
         color: #202020;
37
         color: #202020;
40
         line-height: 44px;
38
         line-height: 44px;
41
-        margin: 37px 0 40px 0;
42
         height: 19px;
39
         height: 19px;
43
         .pnum {
40
         .pnum {
44
           color: #333333;
41
           color: #333333;
57
     }
54
     }
58
     .veri_Date {
55
     .veri_Date {
59
       color: red;
56
       color: red;
60
-      height: 5px;
61
       letter-spacing: 1px;
57
       letter-spacing: 1px;
62
       font-size: 30px;
58
       font-size: 30px;
59
+      padding-top: 20px;
63
     }
60
     }
64
     .line {
61
     .line {
65
       width: 100%;
62
       width: 100%;
66
       height: 2px;
63
       height: 2px;
67
       background: #000;
64
       background: #000;
68
       opacity: 0.1;
65
       opacity: 0.1;
69
-      margin-top: 100px;
66
+      margin-top: 30px;
70
     }
67
     }
71
     .phone {
68
     .phone {
72
       font-size: 24px;
69
       font-size: 24px;

+ 14
- 7
src/components/Spin/SpinBox.jsx View File

4
 import Spin from '.'
4
 import Spin from '.'
5
 import './style.less'
5
 import './style.less'
6
 
6
 
7
+const Loading = (props) => {
8
+  const { loading, size = '64rpx', ...leftProps } = props
9
+
10
+  const cls = ['loading-box', loading? 'active' : undefined].filter(Boolean).join(' ')
11
+
12
+  return (
13
+    <View className={cls}>
14
+      <Spin size={size} {...leftProps} />
15
+    </View>
16
+  )
17
+}
18
+
19
+
7
 export default (props) => {
20
 export default (props) => {
8
   const { className, style, loading, size = '64rpx', ...leftProps } = props
21
   const { className, style, loading, size = '64rpx', ...leftProps } = props
9
 
22
 
11
 
24
 
12
   return (
25
   return (
13
     <View className={cls} style={style}>
26
     <View className={cls} style={style}>
14
-      {
15
-        loading && (
16
-          <View className='loading-box'>
17
-            <Spin size={size} {...leftProps} />
18
-          </View>
19
-        )
20
-      }
21
       {props.children}
27
       {props.children}
28
+      <Loading loading={loading} size={size} {...leftProps} />
22
     </View>
29
     </View>
23
   )
30
   )
24
 }
31
 }

+ 8
- 14
src/components/Spin/style.less View File

140
 .loading-wrapper {
140
 .loading-wrapper {
141
   height: 100%;
141
   height: 100%;
142
   position: relative;
142
   position: relative;
143
+  overflow: hidden;
143
 
144
 
144
   .loading-box {
145
   .loading-box {
145
-    // position: absolute;
146
-    // z-index: 10;
147
-    // top: 0;
148
-    // left: 0;
149
-    // width: 100%;
150
-    // height: 100%;
151
-    // min-height: 72px;
152
-    // padding-top: 60%;
153
-    // padding-left: 50%;
154
-    // background: rgba(255, 255, 255, .95);
155
-    // box-sizing: border-box;
156
-
157
     position: absolute;
146
     position: absolute;
158
-    z-index: 10;
147
+    z-index: -10;
159
     top: 0;
148
     top: 0;
160
     left: 0;
149
     left: 0;
161
     width: 100%;
150
     width: 100%;
164
     padding-top: 35%;
153
     padding-top: 35%;
165
     padding-left: 50%;
154
     padding-left: 50%;
166
     background: rgba(255, 255, 255, 0.95);
155
     background: rgba(255, 255, 255, 0.95);
167
-    -webkit-box-sizing: border-box;
168
     box-sizing: border-box;
156
     box-sizing: border-box;
157
+    opacity: 0;
158
+
159
+    &.active {
160
+      opacity: 1;
161
+      z-index: 10;
162
+    }
169
   }
163
   }
170
 }
164
 }

+ 1
- 1
src/hotel/components/HouseManage/houseManage.jsx View File

99
       setShowCard(false)
99
       setShowCard(false)
100
       console.log(`/pages/index/index?tab=1&roomId=${room.roomId}&roomOrderId=${roomOrderId}&fromType=hotel&recommender=${hotel.hotelId}`)
100
       console.log(`/pages/index/index?tab=1&roomId=${room.roomId}&roomOrderId=${roomOrderId}&fromType=hotel&recommender=${hotel.hotelId}`)
101
       return {
101
       return {
102
-        title: room.roomName,
102
+        title: `欢迎来到${room.roomName}`,
103
         path: `/pages/index/index?tab=1&roomId=${room.roomId}&roomOrderId=${roomOrderId}&fromType=hotel&recommender=${hotel.hotelId}`,
103
         path: `/pages/index/index?tab=1&roomId=${room.roomId}&roomOrderId=${roomOrderId}&fromType=hotel&recommender=${hotel.hotelId}`,
104
         imageUrl: shareImage,
104
         imageUrl: shareImage,
105
       }
105
       }

+ 1
- 1
src/hotel/pages/components/Extend/style.less View File

45
   }
45
   }
46
   .storezn{
46
   .storezn{
47
     color: #202020;
47
     color: #202020;
48
-    line-height: 54px;
48
+    line-height: 64px;
49
     margin-bottom: 60px;
49
     margin-bottom: 60px;
50
     text-align: justify;
50
     text-align: justify;
51
   }
51
   }

+ 3
- 7
src/pages/MineUserAll/RefundMoney/CheckRefund/index.jsx View File

122
         <CustomNav title='售后退款' />
122
         <CustomNav title='售后退款' />
123
       </view>
123
       </view>
124
       <View className='index-container'>
124
       <View className='index-container'>
125
-        <View className='box-content'>
126
-          <scroll-view scroll-y style='height: 100%;' >
127
-            <SpinBox loading={loading}>
128
-
125
+        <SpinBox loading={loading} className='box-content'>
126
+          <scroll-view scroll-y style={{ height: '100%' }} >
129
               <view className='Refund-Content-box'>
127
               <view className='Refund-Content-box'>
130
                 <view className='title-image'>
128
                 <view className='title-image'>
131
                   <image
129
                   <image
220
                   提交申请
218
                   提交申请
221
                 </Button>
219
                 </Button>
222
               </view>
220
               </view>
223
-            </SpinBox>
224
-
225
           </scroll-view>
221
           </scroll-view>
226
-        </View>
222
+        </SpinBox>
227
       </View>
223
       </View>
228
 
224
 
229
     </view >
225
     </view >

+ 4
- 1
src/pages/details/components/Extend/extend.less View File

1
 .cardext{
1
 .cardext{
2
+  padding: 0 30px;
3
+  box-sizing: border-box;
4
+
2
   .storezn{
5
   .storezn{
3
     font-size: 28px;    
6
     font-size: 28px;    
4
     color: #202020;
7
     color: #202020;
5
-    line-height: 54px;
8
+    line-height: 64px;
6
     margin-bottom: 40px;
9
     margin-bottom: 40px;
7
     text-align: justify;
10
     text-align: justify;
8
   }
11
   }

+ 24
- 4
src/pages/details/foodDetails/foodDetails.jsx View File

16
 import TabIcon from "@/components/HorTabbar/TabIcon";
16
 import TabIcon from "@/components/HorTabbar/TabIcon";
17
 import ax from "@/assets/icons/housemantj/onlove.png";
17
 import ax from "@/assets/icons/housemantj/onlove.png";
18
 import yysj from "@/assets/icons/housemantj/openTime.png";
18
 import yysj from "@/assets/icons/housemantj/openTime.png";
19
-import dw from "@/assets/icons/housemantj/loc.png";
19
+import dw from "@/assets/icons/housemantj/loc-o.png";
20
+import phoneImg from "@/assets/icons/housemantj/phone-o.png";
20
 import zhuandao from "@/assets/icons/housemantj/backTop.png";
21
 import zhuandao from "@/assets/icons/housemantj/backTop.png";
21
 import titlezs from "@/assets/icons/housemantj/titleTip.png";
22
 import titlezs from "@/assets/icons/housemantj/titleTip.png";
22
 import showMore from "@/assets/icons/housemantj/setMore.png";
23
 import showMore from "@/assets/icons/housemantj/setMore.png";
99
   const log = useRef("");
100
   const log = useRef("");
100
   const lat = useRef("");
101
   const lat = useRef("");
101
 
102
 
103
+
104
+  const handlePhone = () => {
105
+    if (!detail.phone) {
106
+      Taro.showToast({
107
+        title: '暂无商家联系方式',
108
+        icon: 'none',
109
+      })
110
+
111
+      return;
112
+    }
113
+
114
+    Taro.makePhoneCall({
115
+      phoneNumber: detail.phone
116
+    })
117
+  }
118
+
102
   useEffect(() => {
119
   useEffect(() => {
103
     if (id) {
120
     if (id) {
104
       setLoading(true)
121
       setLoading(true)
109
         setimglist(res.imageList || []);
126
         setimglist(res.imageList || []);
110
         setLoading(false)
127
         setLoading(false)
111
       }).catch(() => setLoading(false));
128
       }).catch(() => setLoading(false));
112
-      getShopPackage(id, { pageNum: 9999 }).then((res) => {
129
+      getShopPackage(id, { pageSize: 500 }).then((res) => {
113
         setPackage(res.records || []);
130
         setPackage(res.records || []);
114
         setNewpgNum(res.records.length);
131
         setNewpgNum(res.records.length);
115
         setAllpgNum(res.total);
132
         setAllpgNum(res.total);
116
       });
133
       });
117
-      getExtendContent("shop", id, { pageNum: 999 }).then((res) => {
134
+      getExtendContent("shop", id, { pageSize: 500 }).then((res) => {
118
         setExtend(res.records || []);
135
         setExtend(res.records || []);
119
         setAllextNum(res.total);
136
         setAllextNum(res.total);
120
         setNewextNum(res.records.length);
137
         setNewextNum(res.records.length);
197
               </view>
214
               </view>
198
               <view className='yysj'>
215
               <view className='yysj'>
199
                 <image src={yysj} className='yysjImg' />
216
                 <image src={yysj} className='yysjImg' />
200
-                营业时间:{detail.businessHours}
217
+                <text>营业时间:{detail.businessHours}</text>
218
+                <view style={{ float: 'right', paddingLeft: '30rpx', borderLeft: '1px dotted #999' }} onClick={handlePhone}>
219
+                  <image src={phoneImg} style={{ width: '32rpx', height: '32rpx' }} />
220
+                </view>
201
               </view>
221
               </view>
202
               <view className='dpPosition' onClick={openMap}>
222
               <view className='dpPosition' onClick={openMap}>
203
                 <image src={dw} className='dwTip' />
223
                 <image src={dw} className='dwTip' />

+ 5
- 5
src/pages/details/foodDetails/foodDetails.less View File

79
       margin-top: 40px;
79
       margin-top: 40px;
80
       position: relative;
80
       position: relative;
81
       .dwTip {
81
       .dwTip {
82
-        width: 28px;
83
-        height: 28px;
82
+        width: 48px;
83
+        height: 48px;
84
+        top: -8px;
85
+        left: -16px;
84
         position: absolute;
86
         position: absolute;
85
-        top: 4px;
86
-        left: 0;
87
       }
87
       }
88
       view {
88
       view {
89
         font-size: 24px;
89
         font-size: 24px;
164
 .storezn {
164
 .storezn {
165
   font-size: 28px;
165
   font-size: 28px;
166
   color: #202020;
166
   color: #202020;
167
-  line-height: 54px;
167
+  line-height: 64px;
168
   margin-bottom: 44px;
168
   margin-bottom: 44px;
169
 }
169
 }
170
 .storezn + image {
170
 .storezn + image {

+ 2
- 2
src/pages/details/mjDetails/sceneryDetails.jsx View File

1
 import CustomNav from '@/components/CustomNav'
1
 import CustomNav from '@/components/CustomNav'
2
 import ax from '@/assets/icons/housemantj/onlove.png'
2
 import ax from '@/assets/icons/housemantj/onlove.png'
3
-import dw from '@/assets/icons/housemantj/loc.png'
3
+import dw from '@/assets/icons/housemantj/loc-o.png'
4
 import titlejd from '@/assets/icons/housemantj/goodTourist.png'
4
 import titlejd from '@/assets/icons/housemantj/goodTourist.png'
5
 import titlems from '@/assets/icons/housemantj/goodFood.png'
5
 import titlems from '@/assets/icons/housemantj/goodFood.png'
6
 import showMore from '@/assets/icons/housemantj/setMore.png'
6
 import showMore from '@/assets/icons/housemantj/setMore.png'
79
           setRecommend(res2 || [])
79
           setRecommend(res2 || [])
80
         })
80
         })
81
       })
81
       })
82
-      getExtendContent('tourist', id, { pageNum: 9999 }).then((res) => {
82
+      getExtendContent('tourist', id, { pageSize: 500 }).then((res) => {
83
         setExtend(res.records || [])
83
         setExtend(res.records || [])
84
         setAllextNum(res.total)
84
         setAllextNum(res.total)
85
         setNewextNum(res.records.length)
85
         setNewextNum(res.records.length)

+ 4
- 4
src/pages/details/mjDetails/sceneryDetails.less View File

55
     .dpPosition {
55
     .dpPosition {
56
       position: relative;
56
       position: relative;
57
       .dwTip {
57
       .dwTip {
58
-        width: 28px;
59
-        height: 28px;
58
+        width: 48px;
59
+        height: 48px;
60
+        top: -8px;
61
+        left: -8px;
60
         position: absolute;
62
         position: absolute;
61
-        top: 4px;
62
-        left: 0;
63
       }
63
       }
64
       .distance {
64
       .distance {
65
         padding-left: 38px;
65
         padding-left: 38px;

+ 31
- 16
src/pages/index/components/Card/index.jsx View File

1
 
1
 
2
-import Taro, { useDidShow } from '@tarojs/taro'
2
+import { useMemo } from 'react'
3
+import Taro from '@tarojs/taro'
3
 import useSave from "@/utils/hooks/useSave"
4
 import useSave from "@/utils/hooks/useSave"
4
 import msTip from '@/assets/icons/housemantj/foodtip.png'
5
 import msTip from '@/assets/icons/housemantj/foodtip.png'
5
 import mjTip from '@/assets/icons/housemantj/mjtip.png'
6
 import mjTip from '@/assets/icons/housemantj/mjtip.png'
10
 
11
 
11
 export default (props) => {
12
 export default (props) => {
12
 
13
 
13
-  const { item, style } = props
14
+  const { className, item, style, onImageLoad } = props
15
+  
16
+  const uqClass = useMemo(() => {
17
+    return `f-${Math.random().toString(36).substring(2)}`
18
+  }, [])
19
+
20
+  const cls = useMemo(() => [className, 'contentCard', uqClass].filter(Boolean).join(' '), [className, uqClass])
14
 
21
 
15
   const [isSaved, toggleSave] = useSave(item.isSaved, item.targetType, item.targetId)
22
   const [isSaved, toggleSave] = useSave(item.isSaved, item.targetType, item.targetId)
16
   const Detail = () => {
23
   const Detail = () => {
22
     }
29
     }
23
   }
30
   }
24
 
31
 
25
-
32
+  const handleLoad = () => {
33
+    Taro.createSelectorQuery().select(`.${uqClass}`).boundingClientRect(rect => {
34
+      onImageLoad(rect)
35
+    }).exec()
36
+  }
26
 
37
 
27
   return (
38
   return (
28
-    <view className='contentCard' style={style}>
29
-      <view className='cardTop'>
30
-        <image mode='widthFix' onClick={Detail} src={item.poster} className='cCardimg' />
31
-        <image className='lefttips' src={item.targetType === 'tourist' ? mjTip : msTip} />
32
-        <image onClick={toggleSave} src={isSaved > 0 ? onlove : love} className='loveharde'></image>
33
-      </view>
34
-      <view className='bContent' onClick={Detail}>
35
-        <view className='cCword'>{(item.title).toString().length > 35 ? (item.title).substring(0, 35) + '...' : (item.title)}</view>
36
-        <view className='cCleft'>
37
-          <image src={location} className='cCicon'></image>
38
-          <view className='distance'><text>{(item.distance / 1000).toFixed(2)}</text>公里</view>
39
+    <view className={uqClass} style={{ overflow: 'hidden' }}>
40
+      <view className='contentCard' style={style}>
41
+        <view className='cardTop'>
42
+          <image mode='widthFix' onClick={Detail} src={item.poster} className='cCardimg' onLoad={handleLoad} />
43
+          <image className='lefttips' src={item.targetType === 'tourist' ? mjTip : msTip} />
44
+          <image onClick={toggleSave} src={isSaved > 0 ? onlove : love} className='loveharde'></image>
39
         </view>
45
         </view>
40
-        <view className='cCright'>
41
-          <view className='price'><text className='money'>¥</text><text>{item.averagePrice / 100}</text>/人</view>
46
+        <view className='bContent' onClick={Detail}>
47
+          <view className='cCword'>{(item.title).toString().length > 35 ? (item.title).substring(0, 35) + '...' : (item.title)}</view>
48
+          <view className='cCBottom'>
49
+            <view className='cCleft'>
50
+              <image src={location} className='cCicon'></image>
51
+              <view className='distance'><text>{(item.distance / 1000).toFixed(2)}</text>公里</view>
52
+            </view>
53
+            <view className='cCright'>
54
+              <view className='price'><text className='money'>¥</text><text>{item.averagePrice / 100}</text>/人</view>
55
+            </view>
56
+          </view>
42
         </view>
57
         </view>
43
       </view>
58
       </view>
44
     </view>
59
     </view>

+ 34
- 26
src/pages/index/components/Card/style.less View File

3
   box-shadow: 0px 8px 38px 0px rgba(0, 0, 0, 0.12);
3
   box-shadow: 0px 8px 38px 0px rgba(0, 0, 0, 0.12);
4
   border-radius: 24px;
4
   border-radius: 24px;
5
   overflow: hidden;
5
   overflow: hidden;
6
-  margin-bottom:50px;
6
+  margin-bottom: 30px;
7
   break-inside: avoid;
7
   break-inside: avoid;
8
   position: relative;
8
   position: relative;
9
 
9
 
10
+  width: calc(100% - 30px);
11
+  box-sizing: border-box;
12
+  margin-left: 15px;
13
+
10
   .cardTop{
14
   .cardTop{
11
     border-radius: 24px 24px 0px 0px;
15
     border-radius: 24px 24px 0px 0px;
12
     .cCardimg{
16
     .cCardimg{
36
       color: #404040;
40
       color: #404040;
37
       text-align: justify;
41
       text-align: justify;
38
     }
42
     }
43
+
44
+    .cCBottom {
45
+      display: flex;
39
     
46
     
40
-    .cCleft{
41
-      float: left;
42
-      position: relative;
43
-      padding:40px 0 30px 0;
44
-      .cCicon{
45
-        width: 17px;
46
-        height: 21px;
47
-        position: absolute;
48
-        left: 0;
49
-        top: 48px;
50
-      }
51
-      .distance{
52
-        padding-left: 24px;
53
-        font-size: 24px;
54
-        color: #C0C8D3;
47
+      .cCleft{
48
+        flex: 3;
49
+        position: relative;
50
+        padding:40px 0 30px 0;
51
+        .cCicon{
52
+          width: 17px;
53
+          height: 21px;
54
+          position: absolute;
55
+          left: 0;
56
+          top: 48px;
57
+        }
58
+        .distance{
59
+          padding-left: 24px;
60
+          font-size: 24px;
61
+          color: #C0C8D3;
62
+        }
55
       }
63
       }
56
-    }
57
-    .cCright{
58
-      position: relative;
59
-      float: right;
60
-      padding:40px 0 30px 0;
61
-      .price{          
62
-        font-size: 24px;
63
-        color: #FF3434;
64
-        .money{
65
-          font-size: 20px;
64
+      .cCright{
65
+        flex: 2;
66
+        position: relative;
67
+        padding:40px 0 30px 0;
68
+        .price{          
69
+          font-size: 24px;
70
+          color: #FF3434;
71
+          .money{
72
+            font-size: 20px;
73
+          }
66
         }
74
         }
67
       }
75
       }
68
     }
76
     }

+ 1
- 4
src/pages/index/index.jsx View File

4
 import Taro, { useDidShow } from '@tarojs/taro'
4
 import Taro, { useDidShow } from '@tarojs/taro'
5
 import CustomNav from '@/components/CustomNav'
5
 import CustomNav from '@/components/CustomNav'
6
 import logo from '@/assets/icons/comm/logo_small.png'
6
 import logo from '@/assets/icons/comm/logo_small.png'
7
-import tips from '@/assets/icons/UserCenter/tips.png'
8
 
7
 
9
 import { getHotelDetail } from '@/services/landlord'
8
 import { getHotelDetail } from '@/services/landlord'
10
 import { getTaRoom } from '@/services/taRoom​'
9
 import { getTaRoom } from '@/services/taRoom​'
19
 
18
 
20
 import './index.less'
19
 import './index.less'
21
 
20
 
22
-
21
+const tips = 'https://yz-shigongli.oss-cn-shanghai.aliyuncs.com/images/sgl-v2-tips.png'
23
 
22
 
24
 export default withLayout((props) => {
23
 export default withLayout((props) => {
25
   const { router, person, location } = props
24
   const { router, person, location } = props
42
     roomId = rid
41
     roomId = rid
43
   }
42
   }
44
 
43
 
45
-
46
-
47
   useDidShow(() => {
44
   useDidShow(() => {
48
     setIsDidShow(isDidShow + 1)
45
     setIsDidShow(isDidShow + 1)
49
   })
46
   })

+ 8
- 11
src/pages/index/tabs/Guide.jsx View File

48
     if (roomOrderId) {
48
     if (roomOrderId) {
49
       goToRoomForm(roomOrderId).then((res) => {
49
       goToRoomForm(roomOrderId).then((res) => {
50
         if (res.status !== 1 && res.personNum > 0) {
50
         if (res.status !== 1 && res.personNum > 0) {
51
-          Taro.navigateTo({
51
+          Taro.reLaunch({
52
             url: `/pages/RoomOrder/index?roomOrderId=${roomOrderId}&status=${res.status}&roomId=${roomId}`,
52
             url: `/pages/RoomOrder/index?roomOrderId=${roomOrderId}&status=${res.status}&roomId=${roomId}`,
53
           })
53
           })
54
         }
54
         }
67
 
67
 
68
   const geiZy = () => {
68
   const geiZy = () => {
69
     setLoading(true)
69
     setLoading(true)
70
-    getExtendContent('room', roomId, {
71
-
72
-    }).then((res) => {
70
+    getExtendContent('room', roomId, { pageSize: 500 }).then((res) => {
73
       // setExtend(res.records || [])
71
       // setExtend(res.records || [])
74
       setExtend(res.records)
72
       setExtend(res.records)
75
       setIfroomId('reality')
73
       setIfroomId('reality')
162
   }
160
   }
163
 
161
 
164
   return (
162
   return (
165
-    <scroll-view scrollY style='height:100%;'  >
166
-      <SpinBox loading={loading}>
167
-
163
+    <scroll-view scrollY style={{ height: '100%' }}  >
168
         <view className='Guide-Home-box'>
164
         <view className='Guide-Home-box'>
169
           {
165
           {
170
             ifroomId === 'havenot' && (
166
             ifroomId === 'havenot' && (
177
           {/* 有民宿的情况下 */}
173
           {/* 有民宿的情况下 */}
178
           {
174
           {
179
             ifroomId === 'reality' && (
175
             ifroomId === 'reality' && (
180
-              <view>
176
+              <SpinBox loading={loading}>
181
                 <view className='room-box-info-ROOM'>
177
                 <view className='room-box-info-ROOM'>
182
                   <view className='room-bi-name-ROOM' >
178
                   <view className='room-bi-name-ROOM' >
183
                     <view className='room-bin-title-ROOM'>房屋名称</view>
179
                     <view className='room-bin-title-ROOM'>房屋名称</view>
245
                     <image mode='scaleToFill' className='title-image-cup' src={BlackSpot} />
241
                     <image mode='scaleToFill' className='title-image-cup' src={BlackSpot} />
246
                     <text className='title-title-boss' >更多指引</text>
242
                     <text className='title-title-boss' >更多指引</text>
247
                   </view>
243
                   </view>
248
-                  {(extend || []).map((item, index) => <MoreGuide key={(index)} item={item} />)}
244
+                  <view style={{ padding: '0 30rpx', boxSizing: 'border-box' }}>
245
+                    {(extend || []).map((item, index) => <MoreGuide key={(index)} item={item} />)}
246
+                  </view>
249
                 </view>
247
                 </view>
250
-              </view>
248
+              </SpinBox>
251
             )
249
             )
252
           }
250
           }
253
           <view className='Guide-Content-box'>
251
           <view className='Guide-Content-box'>
261
           </view>
259
           </view>
262
 
260
 
263
         </view>
261
         </view>
264
-      </SpinBox>
265
     </scroll-view>
262
     </scroll-view>
266
   )
263
   )
267
 }
264
 }

+ 39
- 30
src/pages/index/tabs/Recommend.jsx View File

7
 import List from '@/components/List';
7
 import List from '@/components/List';
8
 import NoData from '@/components/NoData'
8
 import NoData from '@/components/NoData'
9
 import MasonryLayout from '@/components/MasonryLayout';
9
 import MasonryLayout from '@/components/MasonryLayout';
10
+import Waterfall from '@/components/MasonryLayout/Waterfall';
10
 import { getIndexType, getResourceList } from '@/services/home'
11
 import { getIndexType, getResourceList } from '@/services/home'
11
 import Card from '../components/Card'
12
 import Card from '../components/Card'
12
 import './less/Recommend.less'
13
 import './less/Recommend.less'
13
 
14
 
15
+const listStyle = { height: 'calc(100% - 145px)' }
14
 
16
 
15
 export default (props) => {
17
 export default (props) => {
16
   const { router, person, location } = props
18
   const { router, person, location } = props
19
   const [typeList, setTypeList] = useState([])
21
   const [typeList, setTypeList] = useState([])
20
   const listRef = useRef()
22
   const listRef = useRef()
21
 
23
 
22
-  const [queryParams, setQueryParams] = useState({ location: location, pageNum: 1, pageSize: 10, typeId: '' })
24
+  const [queryParams, setQueryParams] = useState({ location, pageNum: 1, pageSize: 10, typeId: '' })
25
+  const rfTimes = useRef(0)
23
 
26
 
24
   // 获取资源表信息
27
   // 获取资源表信息
25
-  const [alllist, setAllList] = useState([])
28
+  // const [alllist, setAllList] = useState([])
29
+  const [listData, setListData] = useState({ list: [], rfTimes: 0 })
30
+
26
   //分类标签
31
   //分类标签
27
   const tabs = [{ title: '附近' }].concat(typeList.map(x => ({ ...x, title: x.typeName })))
32
   const tabs = [{ title: '附近' }].concat(typeList.map(x => ({ ...x, title: x.typeName })))
28
   //切换上面的标签
33
   //切换上面的标签
29
   const handleTabChange = (e) => {
34
   const handleTabChange = (e) => {
30
     const { index } = e.detail
35
     const { index } = e.detail
31
     setActiveTab(index)
36
     setActiveTab(index)
32
-    const tab = tabs[index].typeId
37
+    const tab = tabs[index].typeId || ''
38
+
33
     setQueryParams({
39
     setQueryParams({
34
       ...queryParams,
40
       ...queryParams,
35
       typeId: tab
41
       typeId: tab
36
     })
42
     })
37
 
43
 
38
-    if (index == 0) {
39
-      setQueryParams({ location: location, pageNum: 1, pageSize: 10, typeId: '' })
40
-    }
41
     //如果context有的话代表他滚动了   那么切换tab页就置顶
44
     //如果context有的话代表他滚动了   那么切换tab页就置顶
42
     if (listRef.current?.context) {
45
     if (listRef.current?.context) {
43
       listRef.current.context.scrollTo({ top: 0 })
46
       listRef.current.context.scrollTo({ top: 0 })
44
     }
47
     }
45
   }
48
   }
49
+
50
+  const handleDataChange = (value, e) => {
51
+    if (e.paramsChanged) {
52
+      rfTimes.current += 1
53
+    }
54
+
55
+    setListData({ list: value, rfTimes: rfTimes.current })
56
+  }
57
+
46
   useEffect(() => {
58
   useEffect(() => {
47
     //查询分类标签表
59
     //查询分类标签表
48
     getIndexType({ pageSize: 20 }).then((res) => {
60
     getIndexType({ pageSize: 20 }).then((res) => {
50
     })
62
     })
51
   }, [])
63
   }, [])
52
 
64
 
53
-
54
-
55
   const onSearch = () => {
65
   const onSearch = () => {
56
     // 用绝对路径
66
     // 用绝对路径
57
     Taro.navigateTo({ url: '/pages/search/search' });
67
     Taro.navigateTo({ url: '/pages/search/search' });
58
   }
68
   }
59
-  // 联动收藏
60
-  const likeLook = () => {
61
-    getResourceList().then(e => {
62
-      setAllList(e.records)
63
-    })
64
-
65
-  }
66
-
67
-
68
-  useDidShow(() => {
69
-    likeLook()
70
-  })
69
+  // // 联动收藏
70
+  // const likeLook = () => {
71
+  //   getResourceList().then(e => {
72
+  //     setAllList(e.records)
73
+  //   })
71
 
74
 
75
+  // }
72
 
76
 
77
+  // useDidShow(() => {
78
+  //   likeLook()
79
+  // })
73
 
80
 
74
   return (
81
   return (
75
     // <view style={{ height: '100%', overflow: 'hidden',display:'flex',flexDirection:'column' }}>
82
     // <view style={{ height: '100%', overflow: 'hidden',display:'flex',flexDirection:'column' }}>
102
       {/* <View style={{ flex:'auto' }}> */}
109
       {/* <View style={{ flex:'auto' }}> */}
103
         <List
110
         <List
104
           ref={listRef}
111
           ref={listRef}
105
-          style={{ height: 'calc(100% - 145px)' }}
106
-          // style={{ flex: 'auto', height: '100%' }}
112
+          style={listStyle}
107
           request={getResourceList}
113
           request={getResourceList}
108
           params={queryParams}
114
           params={queryParams}
109
-          onDataChange={setAllList}
115
+          onDataChange={handleDataChange}
110
         >
116
         >
111
-          {/* <MasonryLayout
112
-            list={alllist}
113
-            render={item => <Card item={item} />}
114
-          /> */}
115
-
116
-          {
117
+          <view style={{ padding: '30rpx 15rpx' }}>
118
+            <MasonryLayout
119
+              itemKey='resourceNo'
120
+              listData={listData}
121
+              render={(item, callback) => <Card item={item} onImageLoad={callback} />}
122
+            />
123
+          </view>
124
+
125
+          {/* {
117
             alllist.length == 0 ?
126
             alllist.length == 0 ?
118
               <NoData /> :
127
               <NoData /> :
119
               <view className='waterfall'>
128
               <view className='waterfall'>
121
                   alllist.map((item) => <Card key={item.resourceNo} item={item} />)
130
                   alllist.map((item) => <Card key={item.resourceNo} item={item} />)
122
                 }
131
                 }
123
               </view>
132
               </view>
124
-          }
133
+          } */}
125
         </List>
134
         </List>
126
       {/* </View> */}
135
       {/* </View> */}
127
     </view>
136
     </view>

+ 14
- 8
src/pages/index/tabs/less/Recommend.less View File

27
       letter-spacing: 0.2em;
27
       letter-spacing: 0.2em;
28
     }
28
     }
29
 }
29
 }
30
-.waterfall{
31
-  column-count: 2;      //分两列
32
-  column-gap: 30px;    //列间距
33
-  background-color: #F8F8F8;
34
-  padding:30px 30px 0 30px; 
35
-}
30
+// .waterfall{
31
+//   column-count: 2;      //分两列
32
+//   column-gap: 30px;    //列间距
33
+//   background-color: #F8F8F8;
34
+//   padding:30px 30px 0 30px; 
35
+// }
36
 .botton{
36
 .botton{
37
   font-size: 28px;
37
   font-size: 28px;
38
   color: #C0C8D3;
38
   color: #C0C8D3;
70
     }
70
     }
71
   }
71
   }
72
   .tabs-Unselected {
72
   .tabs-Unselected {
73
-    width: 25vw;      
73
+    // width: 25vw;
74
     color: #C0C8D3; 
74
     color: #C0C8D3; 
75
     text-align: center;
75
     text-align: center;
76
     font-size: 28px;
76
     font-size: 28px;
77
     line-height: 91px;
77
     line-height: 91px;
78
+    box-sizing: border-box;
79
+    padding: 0 32px;
80
+    letter-spacing: 2px;
78
   }
81
   }
79
   .tabs-swiper {
82
   .tabs-swiper {
80
     max-height: 0;
83
     max-height: 0;
81
   }
84
   }
82
   .tabs-Selected {
85
   .tabs-Selected {
86
+    box-sizing: border-box;
83
     font-size: 32px;
87
     font-size: 32px;
84
     color: #4C4C4C;
88
     color: #4C4C4C;
85
-    width: 25vw;      
89
+    // width: 25vw;
86
     font-weight: bold;
90
     font-weight: bold;
87
     text-align: center;
91
     text-align: center;
88
     border-bottom: 6px solid #4C4C4C;
92
     border-bottom: 6px solid #4C4C4C;
93
+    padding: 0 32px;
94
+    letter-spacing: 2px;
89
   }
95
   }
90
 }
96
 }

+ 1
- 2
src/shop/components/ShopKeeper/shopKeeper.jsx View File

1
 import { React, useState, useEffect, useMemo, useRef } from 'react'
1
 import { React, useState, useEffect, useMemo, useRef } from 'react'
2
 import Taro, { useRouter } from '@tarojs/taro'
2
 import Taro, { useRouter } from '@tarojs/taro'
3
-import { getShopList, getShopMoney, getAccount, getVerifiedOrder, setGetVerifiedOrder } from '@/services/shopBoss'
4
-
3
+import { getVerifiedOrder } from '@/services/shopBoss'
5
 import Picker from '@/components/Picker'
4
 import Picker from '@/components/Picker'
6
 import ShopUsed from '@/components/ShopUsed' //已核销
5
 import ShopUsed from '@/components/ShopUsed' //已核销
7
 import ShopUnused from '@/components/ShopUnused' //未核销
6
 import ShopUnused from '@/components/ShopUnused' //未核销