张延森 4 years ago
parent
commit
7b140f8042

+ 0
- 1
package.json View File

41
     "@tarojs/react": "3.0.13",
41
     "@tarojs/react": "3.0.13",
42
     "@tarojs/runtime": "3.0.13",
42
     "@tarojs/runtime": "3.0.13",
43
     "@tarojs/taro": "3.0.13",
43
     "@tarojs/taro": "3.0.13",
44
-    "lodash": "4.17.15",
45
     "lodash.groupby": "^4.6.0",
44
     "lodash.groupby": "^4.6.0",
46
     "miniprogram-recycle-view": "^0.1.5",
45
     "miniprogram-recycle-view": "^0.1.5",
47
     "react": "^16.10.0",
46
     "react": "^16.10.0",

+ 4
- 2
src/compents/Picker/index.jsx View File

7
 
7
 
8
   const handleChange = e => {
8
   const handleChange = e => {
9
     const inx = e.detail.value - 0
9
     const inx = e.detail.value - 0
10
-    console.log('---------->>>>', inx, range)
11
     setPos(inx)
10
     setPos(inx)
12
     if (props.onChange) {
11
     if (props.onChange) {
13
       props.onChange(range[inx])
12
       props.onChange(range[inx])
40
 
39
 
41
   return (
40
   return (
42
     <picker value={pos} range={range} range-key={rangeKey} onChange={handleChange}>
41
     <picker value={pos} range={range} range-key={rangeKey} onChange={handleChange}>
43
-      <view>{label ? `${preTitle} ${label}` : placeholder}</view>
42
+      <view style="display: flex">
43
+        <view style="flex: auto">{label ? `${preTitle} ${label}` : placeholder}</view>
44
+        <view style="flex: none">&gt;</view>
45
+      </view>
44
     </picker>
46
     </picker>
45
   )
47
   )
46
 }
48
 }

+ 6
- 0
src/compents/RecycleList/index.jsx View File

9
   
9
   
10
   const hanldeScrollToLower = e => {
10
   const hanldeScrollToLower = e => {
11
     if ((props.list || []).length >= (props.total - 0)) {
11
     if ((props.list || []).length >= (props.total - 0)) {
12
+      Taro.showToast({
13
+        title: '没有更多数据了~~',
14
+        icon: 'none'
15
+      })
12
       return
16
       return
13
     }
17
     }
14
 
18
 
37
     }
41
     }
38
   }, [props.width, props.height])
42
   }, [props.width, props.height])
39
 
43
 
44
+  // console.log('--------list---------->', props.list)
45
+
40
   return (
46
   return (
41
     <recycle-view
47
     <recycle-view
42
       id={id.current}
48
       id={id.current}

+ 0
- 1
src/pages/adminUser/index.jsx View File

10
 import menuicon from '../../assets/menuicon.png'
10
 import menuicon from '../../assets/menuicon.png'
11
 
11
 
12
 import './index.scss'
12
 import './index.scss'
13
-import { xor } from 'lodash';
14
 
13
 
15
 const menuList = [{
14
 const menuList = [{
16
   title: '民宿宿老板账号管理',
15
   title: '民宿宿老板账号管理',

+ 11
- 2
src/pages/house/list/index.jsx View File

3
   useMemo,
3
   useMemo,
4
   useState,
4
   useState,
5
   forwardRef,
5
   forwardRef,
6
-  useImperativeHandle
6
+  useImperativeHandle,
7
+  useCallback
7
 } from "react";
8
 } from "react";
8
 import Taro, { useDidShow } from "@tarojs/taro";
9
 import Taro, { useDidShow } from "@tarojs/taro";
9
 import { useSelector } from 'react-redux'
10
 import { useSelector } from 'react-redux'
11
+// import debounce from 'lodash.debounce'
10
 import "./index.scss";
12
 import "./index.scss";
11
 import { View, Text, Input, Image } from "@tarojs/components";
13
 import { View, Text, Input, Image } from "@tarojs/components";
12
 import ContainerLayout from "../../../compents/container/index";
14
 import ContainerLayout from "../../../compents/container/index";
38
 
40
 
39
   const getHouseList = () => {
41
   const getHouseList = () => {
40
     if (!queryParams.shopId) return
42
     if (!queryParams.shopId) return
43
+    
44
+    // console.log('---------->>>>', queryParams.shopId, queryParams.pageNum)
41
 
45
 
42
     request({
46
     request({
43
       url: "/taHouse",
47
       url: "/taHouse",
45
     }).then(res => {
49
     }).then(res => {
46
       const { records, ...page } = res.data.data;
50
       const { records, ...page } = res.data.data;
47
 
51
 
52
+      // console.log('-----page------>', page)
53
+
48
       if (page.current !== 1) {
54
       if (page.current !== 1) {
55
+        // console.log('-----page---1--->', page.current)
49
         setList(list.concat(records));
56
         setList(list.concat(records));
50
       } else {
57
       } else {
58
+        // console.log('-----page---2--->')
59
+        // setList([]);  // 这句不能删, 部分机型上直接替换 list 不生效
51
         setList(records);
60
         setList(records);
52
       }
61
       }
53
       setTotal(page.total);
62
       setTotal(page.total);
59
       ...queryParams,
68
       ...queryParams,
60
       pageNum: queryParams.pageNum + 1
69
       pageNum: queryParams.pageNum + 1
61
     });
70
     });
62
-  };
71
+  }
63
 
72
 
64
   const onShare = x => {
73
   const onShare = x => {
65
     Taro.navigateTo({ url: `/pages/share/index?houseId=${x.houseId}&&title=${x.title}` });
74
     Taro.navigateTo({ url: `/pages/share/index?houseId=${x.houseId}&&title=${x.title}` });

+ 3
- 3
src/pages/landlord/index.jsx View File

97
         shopList.length > 1 &&
97
         shopList.length > 1 &&
98
         (
98
         (
99
           <mp-cells>
99
           <mp-cells>
100
-            <mp-cell link>
100
+            <mp-cell>
101
               <Picker
101
               <Picker
102
                 value={defaultShop}
102
                 value={defaultShop}
103
                 range={shopList}
103
                 range={shopList}
104
                 rangeKey="text"
104
                 rangeKey="text"
105
                 rangeValue="value"
105
                 rangeValue="value"
106
-                preTitle="当前店铺"
107
-                placeholder="请选择店铺"
106
+                preTitle="当前店铺: "
107
+                placeholder="请选择店铺 ..."
108
                 onChange={handleSelectShop}
108
                 onChange={handleSelectShop}
109
               />
109
               />
110
             </mp-cell>
110
             </mp-cell>

+ 1
- 6
yarn.lock View File

8178
 
8178
 
8179
 lodash.debounce@^4.0.8:
8179
 lodash.debounce@^4.0.8:
8180
   version "4.0.8"
8180
   version "4.0.8"
8181
-  resolved "https://registry.npm.taobao.org/lodash.debounce/download/lodash.debounce-4.0.8.tgz?cache=0&sync_timestamp=1600349120640&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Flodash.debounce%2Fdownload%2Flodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af"
8181
+  resolved "https://registry.npm.taobao.org/lodash.debounce/download/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af"
8182
   integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168=
8182
   integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168=
8183
 
8183
 
8184
 lodash.groupby@^4.6.0:
8184
 lodash.groupby@^4.6.0:
8196
   resolved "https://registry.npm.taobao.org/lodash.toarray/download/lodash.toarray-4.4.0.tgz#24c4bfcd6b2fba38bfd0594db1179d8e9b656561"
8196
   resolved "https://registry.npm.taobao.org/lodash.toarray/download/lodash.toarray-4.4.0.tgz#24c4bfcd6b2fba38bfd0594db1179d8e9b656561"
8197
   integrity sha1-JMS/zWsvuji/0FlNsRedjptlZWE=
8197
   integrity sha1-JMS/zWsvuji/0FlNsRedjptlZWE=
8198
 
8198
 
8199
-lodash@4.17.15:
8200
-  version "4.17.15"
8201
-  resolved "https://registry.npm.taobao.org/lodash/download/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548"
8202
-  integrity sha1-tEf2ZwoEVbv+7dETku/zMOoJdUg=
8203
-
8204
 lodash@4.17.20, "lodash@4.6.1 || ^4.16.1", lodash@^4.0.0, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.3, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.0, lodash@^4.3.0, lodash@~4.17.10:
8199
 lodash@4.17.20, "lodash@4.6.1 || ^4.16.1", lodash@^4.0.0, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.3, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.0, lodash@^4.3.0, lodash@~4.17.10:
8205
   version "4.17.20"
8200
   version "4.17.20"
8206
   resolved "https://registry.npm.taobao.org/lodash/download/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52"
8201
   resolved "https://registry.npm.taobao.org/lodash/download/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52"