[baozhangchao] 3 年之前
父節點
當前提交
2e7d54a83b

+ 3
- 3
src/components/BottomMoadl/index.jsx 查看文件

@@ -3,11 +3,11 @@ import { View, Image } from '@tarojs/components'
3 3
 import WeChatPay from '@/assets/BottomMoadlImags/WeChatPay.png'
4 4
 import Alipay from '@/assets/BottomMoadlImags/Alipay.png'
5 5
 import userRight from '@/assets/mineImgaes/userRight.png'
6
-
6
+import withLayout from '@/layouts'
7 7
 import './style.css'
8 8
 
9 9
 
10
-export default (props) => {
10
+export default withLayout((props) => {
11 11
   const { frameTitle, flag } = props
12 12
 
13 13
   let wrapAnimate = 'wrap wrapAnimate'
@@ -64,4 +64,4 @@ export default (props) => {
64 64
       </view>
65 65
     </view>
66 66
   )
67
-}
67
+})

+ 1
- 0
src/components/ButtontWX/index.jsx 查看文件

@@ -1,5 +1,6 @@
1 1
 
2 2
 import { View, Text, Button } from '@tarojs/components'
3
+import withLayout from '@/layouts'
3 4
 import './style.less'
4 5
 
5 6
 export default (props) => {

+ 3
- 2
src/components/CarsListContent/index.jsx 查看文件

@@ -3,6 +3,7 @@ import { View, Swiper, Image, SwiperItem, Text, Input } from "@tarojs/components
3 3
 import { useEffect, useState, useMemo } from "react"
4 4
 import Taro, { useReachBottom } from "@tarojs/taro"
5 5
 import ButtontWX from '@/components/ButtontWX'
6
+import withLayout from '@/layouts'
6 7
 import addresss from '@/assets/mineImgaes/addresss.png'//地址
7 8
 
8 9
 import { getMachinery, } from "@/services/homes"
@@ -10,7 +11,7 @@ import { getMachinery, } from "@/services/homes"
10 11
 
11 12
 import './style.less'
12 13
 
13
-export default (props) => {
14
+export default withLayout((props) => {
14 15
   const location = Taro.getStorageSync('location')
15 16
   // const { carsList } = props
16 17
 
@@ -74,4 +75,4 @@ export default (props) => {
74 75
 
75 76
     </>
76 77
   )
77
-}
78
+})

+ 11
- 38
src/components/CustomNav/index.jsx 查看文件

@@ -1,15 +1,13 @@
1 1
 
2
-import { useState, useEffect, useMemo } from 'react'
3 2
 import Taro from '@tarojs/taro'
4
-import homeBlack from '@/assets/icons/comm/home.png'
5
-import homeWhite from '@/assets/icons/comm/home_white.png'
3
+import { View } from '@tarojs/components'
6 4
 import gobackBlack from '@/assets/icons/comm/goback.png'
7
-import gobackWhite from '@/assets/icons/comm/goback_white.png'
5
+import { useState, useEffect, useMemo } from 'react'
8 6
 
9 7
 import './style.less'
10 8
 
11 9
 export default (props) => {
12
-  const { bgImg, logo, title = '首页', home, noback } = props
10
+  const { logo, title = '首页', home, noback } = props
13 11
 
14 12
   // 菜单胶囊
15 13
   const menuBound = useMemo(() => Taro.getMenuButtonBoundingClientRect(), [])
@@ -17,9 +15,8 @@ export default (props) => {
17 15
   const navStyle = useMemo(() => {
18 16
     return {
19 17
       height: `${menuBound.bottom + 8}px`,
20
-      backgroundImage: bgImg ? `url(${bgImg})` : 'none',
21 18
     }
22
-  }, [menuBound.bottom, bgImg])
19
+  }, [menuBound.bottom])
23 20
   // 导航栏
24 21
   const navBarStyle = useMemo(() => {
25 22
     return {
@@ -41,20 +38,12 @@ export default (props) => {
41 38
     const screenWidth = menuBound.right + 8;
42 39
     return {
43 40
       width: `${screenWidth - menuBound.width * 2 - 16}px`,
44
-      color: bgImg ? '#fff' : '#333',
45 41
       lineHeight: `${menuBound.height}px`,
46 42
       height: `${menuBound.height}px`,
47 43
       paddingLeft: '8px',
48 44
       paddingRight: '8px',
49 45
     }
50
-  }, [menuBound.width, menuBound.height, menuBound.right, bgImg])
51
-  // logo
52
-  const logoStyle = useMemo(() => {
53
-    return {
54
-      width: `${menuBound.height}px`,
55
-      height: `${menuBound.height}px`,
56
-    }
57
-  }, [menuBound.height])
46
+  }, [menuBound.width, menuBound.height, menuBound.right])
58 47
 
59 48
   const handleAction = () => {
60 49
     if (home || logo) return;
@@ -64,12 +53,6 @@ export default (props) => {
64 53
     }
65 54
   }
66 55
 
67
-  const goHome = () => {
68
-    Taro.reLaunch({
69
-      url: '/pages/index/index'
70
-    })
71
-  }
72
-
73 56
   useEffect(() => {
74 57
     if (title) {
75 58
       Taro.setNavigationBarTitle({ title })
@@ -80,23 +63,13 @@ export default (props) => {
80 63
     <view className='custom-nav' style={navStyle}>
81 64
       <view className='custom-nav-bar' style={navBarStyle}>
82 65
         <view className='custom-nav-bar-action' style={actionStyle}>
83
-          {
84
-            !!logo && <image src={logo} className='custom-nav-bar-logo' mode='aspectFit' style={logoStyle} />
85
-          }
86 66
           {
87 67
             !logo && !home && (
88
-              <view className='custom-nav-bar-action-btns'>
89
-                {
90
-                  !noback && (
91
-                    <view className='custom-nav-bar-action-part' onClick={handleAction}>
92
-                      <image src={bgImg ? gobackWhite : gobackBlack} mode='aspectFit' />
93
-                    </view>
94
-                  )
95
-                }
96
-                <view className='custom-nav-bar-action-part' onClick={goHome}>
97
-                  <image src={bgImg ? homeWhite : homeBlack} mode='aspectFit' />
98
-                </view>
99
-              </view>
68
+              !noback && (
69
+                <View style={{ width: '100%', height: '100%' }} onClick={handleAction}>
70
+                  <image className='goback' src={gobackBlack} />
71
+                </View>
72
+              )
100 73
             )
101 74
           }
102 75
         </view>
@@ -104,4 +77,4 @@ export default (props) => {
104 77
       </view>
105 78
     </view>
106 79
   )
107
-}
80
+}

+ 9
- 27
src/components/CustomNav/style.less 查看文件

@@ -13,39 +13,21 @@
13 13
       flex: none;
14 14
       box-sizing: border-box;
15 15
 
16
-      image {
17
-        display: inline-block;
18
-        border: 0;
16
+      .goback {
17
+        width: 19px;
18
+        height: 35px;
19
+        position: absolute;
20
+        left: 30px;
21
+        top: 14.5px;
19 22
       }
20
-
21
-      &-btns {
22
-        width: 100%;
23
-        height: 100%;
24
-        display: flex;
25
-
26
-        & > view {
27
-          flex: auto;
28
-          width: 50%;
29
-          text-align: center;
30
-
31
-          image {
32
-            width: 100%;
33
-            height: 30px;
34
-          }
35
-        }
36
-      }
37
-    }
38
-
39
-    &-logo {
40
-      display: block !important;
41
-      border-radius: 50%;
42
-      margin: 0 auto;
43 23
     }
44 24
 
45 25
     &-content {
46 26
       flex: none;
47 27
       text-align: center;
48
-      font-size: 32px;
28
+      font-size: 34px;
29
+      font-weight: bold;
30
+      color: #333;
49 31
       cursor: none;
50 32
       pointer-events: none;
51 33
       text-overflow: ellipsis;

+ 22
- 3
src/layouts/index.jsx 查看文件

@@ -1,13 +1,32 @@
1 1
 
2 2
 
3 3
 import useRouter from '@/utils/hooks/useRouter'
4
-import { getPageBy, getIndexPageOf } from '../routes'
4
+import Taro from '@tarojs/taro'
5
+import { useEffect } from 'react'
6
+import { useModel } from '@/store'
5 7
 
6
-export default (Child) => (props) => {
7 8
 
8
-  // const { person } = useModel('person')
9
+export default (Child) => (props) => {
10
+  const { person } = useModel('userData')
9 11
   const router = useRouter()
10 12
 
13
+  const { path } = router
14
+
15
+  useEffect(() => {
16
+    if (!person?.phone) {
17
+      if (path != '/pages/index/index' && path !== '/pages/UserLogin/index') {
18
+        Taro.navigateTo({ url: `/pages/UserLogin/index?id${1}` })
19
+      }
20
+    }
21
+    console.log("🚀 ~ file: index.jsx ~ line 11 ~ person", person, path)
22
+
23
+    // if (path != '/pages/index/index' && !person?.phone) {
24
+    //   Taro.navigateTo({ url: `/pages/userInfo/index?id${1}` })
25
+    // }
26
+  }, [path, person?.phone])
27
+
28
+
29
+
11 30
 
12 31
 
13 32
   return <Child {...props} router={router} />

+ 4
- 2
src/pages/AboutUsPage/index.jsx 查看文件

@@ -1,12 +1,14 @@
1 1
 import { View, Image } from "@tarojs/components"
2 2
 import CustomNav from "@/components/CustomNav"
3 3
 import decorate from "@/assets/icons/comm/decorate.png"
4
+import withLayout from '@/layouts'
5
+
4 6
 
5 7
 import './style.less'
6 8
 
7 9
 
8 10
 
9
-export default (props) => {
11
+export default withLayout((props) => {
10 12
 
11 13
   return (
12 14
     <View className='page-index'>
@@ -46,4 +48,4 @@ export default (props) => {
46 48
       </scroll-view>
47 49
     </View>
48 50
   )
49
-}
51
+})

+ 12
- 9
src/pages/CheckDetails/index.jsx 查看文件

@@ -2,7 +2,7 @@ import { useState, useEffect } from "react"
2 2
 import { Image, View, Text, Swiper, SwiperItem } from "@tarojs/components"
3 3
 import Taro from "@tarojs/taro"
4 4
 import CustomNav from "@/components/CustomNav"
5
-
5
+import withLayout from '@/layouts'
6 6
 import ButtontWX from "@/components/ButtontWX"
7 7
 import decorate from "@/assets/icons/comm/decorate.png"
8 8
 import addresss from '@/assets/mineImgaes/addresss.png'//地址
@@ -14,7 +14,7 @@ import './style.less'
14 14
 
15 15
 
16 16
 
17
-export default (props) => {
17
+export default withLayout((props) => {
18 18
   console.log("🚀 ~ file: index.jsx ~ line 14 ~ props", props)
19 19
 
20 20
   const $instance = Taro.getCurrentInstance()
@@ -26,14 +26,17 @@ export default (props) => {
26 26
 
27 27
 
28 28
   useEffect(() => {
29
+    if (id) {
30
+      getMachineryInfo(id, { location: location, attached: true }).then((e) => {
31
+        setImagesList(e.imagesList)
32
+        setContentList(e.contentList)
33
+        setCarsInfo(e)
34
+
35
+        console.log('e', e);
36
+      })
37
+    }
29 38
 
30
-    getMachineryInfo(id, { location: location, attached: true }).then((e) => {
31
-      setImagesList(e.imagesList)
32
-      setContentList(e.contentList)
33
-      setCarsInfo(e)
34 39
 
35
-      console.log('e', e);
36
-    })
37 40
 
38 41
   }, [$instance.router.params, id, location])
39 42
 
@@ -116,4 +119,4 @@ export default (props) => {
116 119
 
117 120
     </View >
118 121
   )
119
-}
122
+})

+ 2
- 2
src/pages/CheckMap/index.jsx 查看文件

@@ -10,7 +10,7 @@ import { getMachineryInfo } from "@/services/homes"
10 10
 import './style.less'
11 11
 
12 12
 
13
-export default (props) => {
13
+export default withLayout((props) => {
14 14
 
15 15
 
16 16
   const $instance = Taro.getCurrentInstance()
@@ -117,4 +117,4 @@ export default (props) => {
117 117
       </scroll-view>
118 118
     </View>
119 119
   )
120
-}
120
+})

+ 4
- 2
src/pages/FeedbackText/index.jsx 查看文件

@@ -3,13 +3,15 @@ import { Textarea, View } from "@tarojs/components"
3 3
 import CustomNav from "@/components/CustomNav"
4 4
 import ButtontWX from "@/components/ButtontWX"
5 5
 import { feedback } from "@/services/mine"
6
+import withLayout from '@/layouts'
7
+
6 8
 import Taro from "@tarojs/taro"
7 9
 
8 10
 import './style.less'
9 11
 
10 12
 
11 13
 
12
-export default (props) => {
14
+export default withLayout((props) => {
13 15
 
14 16
   const [textAreaValue, setTextAreaValue] = useState('')
15 17
   const [loading, setLoading] = useState(false)
@@ -66,4 +68,4 @@ export default (props) => {
66 68
       </View>
67 69
     </View>
68 70
   )
69
-}
71
+})

+ 3
- 2
src/pages/HelpCenterInfo/index.jsx 查看文件

@@ -1,12 +1,13 @@
1 1
 import { View, Image } from "@tarojs/components"
2 2
 import CustomNav from "@/components/CustomNav"
3 3
 
4
+import withLayout from '@/layouts'
4 5
 
5 6
 import './style.less'
6 7
 
7 8
 
8 9
 
9
-export default (props) => {
10
+export default withLayout((props) => {
10 11
 
11 12
   return (
12 13
     <View className='page-index'>
@@ -53,4 +54,4 @@ export default (props) => {
53 54
       </scroll-view>
54 55
     </View>
55 56
   )
56
-}
57
+})

+ 3
- 2
src/pages/MoreCars/index.jsx 查看文件

@@ -10,13 +10,14 @@ import CustomNav from "@/components/CustomNav"
10 10
 import searchs from '@/assets/homesImgaes/searchs.png'//搜索图片
11 11
 import { getMachineryType } from "@/services/homes"
12 12
 import CarsListContent from "@/components/CarsListContent"
13
+import withLayout from '@/layouts'
13 14
 
14 15
 import './style.less'
15 16
 
16 17
 
17 18
 
18 19
 
19
-export default (props) => {
20
+export default withLayout((props) => {
20 21
   const [activeTab, setActiveTab] = useState(1)
21 22
 
22 23
 
@@ -79,4 +80,4 @@ export default (props) => {
79 80
       </scroll-view>
80 81
     </View>
81 82
   )
82
-}
83
+})

+ 3
- 2
src/pages/MyAddressList/AddressInfos/index.jsx 查看文件

@@ -3,6 +3,7 @@ import Taro from "@tarojs/taro"
3 3
 import CustomNav from "@/components/CustomNav"
4 4
 import ButtontWX from '@/components/ButtontWX'
5 5
 import { addressSave, getAddress, addressDelete, addressUpdate } from "@/services/address"
6
+import withLayout from '@/layouts'
6 7
 
7 8
 import './style.less'
8 9
 import { useEffect } from "react"
@@ -10,7 +11,7 @@ import { useEffect } from "react"
10 11
 
11 12
 
12 13
 
13
-export default (props) => {
14
+export default withLayout((props) => {
14 15
   console.log("🚀 ~ file: index.jsx ~ line 14 ~ props", props)
15 16
 
16 17
   const $instance = Taro.getCurrentInstance()
@@ -87,4 +88,4 @@ export default (props) => {
87 88
       </View>
88 89
     </View>
89 90
   )
90
-}
91
+})

+ 3
- 2
src/pages/MyAddressList/index.jsx 查看文件

@@ -4,6 +4,7 @@ import { useState, useEffect, useMemo } from "react"
4 4
 import CustomNav from "@/components/CustomNav"
5 5
 import edit from "@/assets/icons/comm/edit.png"
6 6
 import userRight from '@/assets/mineImgaes/userRight.png'
7
+import withLayout from '@/layouts'
7 8
 
8 9
 import deletes from "@/assets/icons/comm/deletes.png"
9 10
 import ButtontWX from '@/components/ButtontWX'
@@ -15,7 +16,7 @@ import './style.less'
15 16
 
16 17
 
17 18
 
18
-export default (props) => {
19
+export default withLayout((props) => {
19 20
   const [addresList, setAddresList] = useState([])
20 21
 
21 22
   const addAddress = () => {
@@ -150,6 +151,6 @@ export default (props) => {
150 151
       </scroll-view>
151 152
     </View >
152 153
   )
153
-}
154
+})
154 155
 
155 156
 

+ 3
- 2
src/pages/NewVersionUpdatePage/index.jsx 查看文件

@@ -1,13 +1,14 @@
1 1
 import { View, Image } from "@tarojs/components"
2 2
 import CustomNav from "@/components/CustomNav"
3 3
 import decorate from "@/assets/icons/comm/decorate.png"
4
+import withLayout from '@/layouts'
4 5
 
5 6
 import './style.less'
6 7
 
7 8
 
8 9
 
9 10
 
10
-export default (props) => {
11
+export default withLayout((props) => {
11 12
 
12 13
   return (
13 14
     <View className='page-index'>
@@ -29,4 +30,4 @@ export default (props) => {
29 30
       </scroll-view>
30 31
     </View>
31 32
   )
32
-}
33
+})

+ 4
- 2
src/pages/OrderConfirmation/index.jsx 查看文件

@@ -1,6 +1,8 @@
1 1
 import { View, Text } from "@tarojs/components"
2 2
 import Taro from "@tarojs/taro"
3 3
 import { useState } from "react"
4
+import withLayout from '@/layouts'
5
+
4 6
 import CustomNav from '@/components/CustomNav'
5 7
 import ButtontWX from '@/components/ButtontWX'
6 8
 // import BottomMoadl from '@/components/BottomMoadl/index'
@@ -12,7 +14,7 @@ import ButtontWX from '@/components/ButtontWX'
12 14
 
13 15
 import './style.less'
14 16
 
15
-export default (props) => {
17
+export default withLayout((props) => {
16 18
   //底部弹窗
17 19
   // const [showFrame, setShowFrame] = useState(false)
18 20
   // const setRecommend = () => {
@@ -46,4 +48,4 @@ export default (props) => {
46 48
       </View>
47 49
     </View>
48 50
   )
49
-}
51
+})

+ 3
- 2
src/pages/OrderInfo/index.jsx 查看文件

@@ -4,6 +4,7 @@ import Taro from "@tarojs/taro"
4 4
 import CustomNav from '@/components/CustomNav'
5 5
 import ButtontWX from '@/components/ButtontWX'
6 6
 import formatTimes from "@/utils/codeSegment"
7
+import withLayout from '@/layouts'
7 8
 
8 9
 import { generateOrder, orderDelete, orderInfo } from "@/services/order"
9 10
 // import BottomMoadl from '@/components/BottomMoadl/index'
@@ -15,7 +16,7 @@ import { generateOrder, orderDelete, orderInfo } from "@/services/order"
15 16
 
16 17
 import './style.less'
17 18
 
18
-export default (props) => {
19
+export default withLayout((props) => {
19 20
 
20 21
   const $instance = Taro.getCurrentInstance()
21 22
   const { orderId } = $instance.router.params
@@ -114,4 +115,4 @@ export default (props) => {
114 115
       </View>
115 116
     </View>
116 117
   )
117
-}
118
+})

+ 4
- 3
src/pages/UserLogin/index.jsx 查看文件

@@ -10,11 +10,12 @@ import checkedImg from '@/assets/lolginImages/checkedImg.png'
10 10
 import unselectedImg from '@/assets/lolginImages/unselectedImg.png'
11 11
 import { useModel } from '@/store'
12 12
 
13
+import withLayout from '@/layouts'
13 14
 
14 15
 import './style.less'
15 16
 
16 17
 
17
-export default (props) => {
18
+export default withLayout((props) => {
18 19
 
19 20
   const { person, setUserPhoneInfo } = useModel('userData')
20 21
 
@@ -113,7 +114,7 @@ export default (props) => {
113 114
   return (
114 115
     <View className='page-index'>
115 116
       <View className='index-navbar'>
116
-        <CustomNav title='登陆' />
117
+        <CustomNav title='登陆' home />
117 118
       </View>
118 119
       <View className='loginBackImg-box' >
119 120
         <Image src={require("@/assets/lolginImages/backLogin.png")} />
@@ -149,4 +150,4 @@ export default (props) => {
149 150
 
150 151
     </View>
151 152
   )
152
-}
153
+})

+ 17
- 4
src/pages/index/index.jsx 查看文件

@@ -2,6 +2,8 @@ import React, { useState, useEffect } from 'react'
2 2
 import Taro, { useDidShow } from '@tarojs/taro'
3 3
 import withLayout from '@/layouts'
4 4
 import CustomNav from '@/components/CustomNav'
5
+import { useModel } from '@/store'
6
+
5 7
 import tabList from './tabbar'
6 8
 import Homes from './tabs/Homes'
7 9
 import Orders from './tabs/Orders'
@@ -12,6 +14,8 @@ import './index.less'
12 14
 
13 15
 export default withLayout((props) => {
14 16
   const { router } = props
17
+  const { person } = useModel('userData')
18
+  console.log("🚀 ~ file: index.jsx ~ line 18 ~ withLayout ~ person", person)
15 19
 
16 20
   const { params, path } = router
17 21
   const { tab } = params || {}
@@ -29,12 +33,21 @@ export default withLayout((props) => {
29 33
     if (tab) {
30 34
       setCurrentTab(tab - 0)
31 35
     }
32
-  }, [tab])
36
+  }, [tab,])
33 37
 
34 38
 
35 39
   const handleTabChange = (e) => {
36
-    const { index } = e.detail
37
-    setCurrentTab(index)
40
+    if (!person?.phone) {
41
+      Taro.navigateTo({ url: `/pages/UserLogin/index?id${1}` })
42
+
43
+    } else {
44
+      if (person?.phone) {
45
+        const { index } = e.detail
46
+        setCurrentTab(index)
47
+      }
48
+
49
+    }
50
+
38 51
   }
39 52
 
40 53
 
@@ -42,7 +55,7 @@ export default withLayout((props) => {
42 55
     <view className='page-index'>
43 56
 
44 57
       <view className='index-navbar'>
45
-        <CustomNav title='首页' />
58
+        <CustomNav title='首页' home />
46 59
       </view>
47 60
       <view className='index-container'>
48 61
         {currentTab === 0 && <Homes />}

+ 36
- 36
src/pages/index/tabs/Homes.jsx 查看文件

@@ -7,10 +7,12 @@ import searchs from '@/assets/homesImgaes/searchs.png'//搜索图片
7 7
 import carsListImga from '@/assets/homesImgaes/carsListImga.png'//农机列表图片
8 8
 import CarsListContent from "@/components/CarsListContent"
9 9
 import { getHomeBanner, getMachinery, } from "@/services/homes"
10
+import withLayout from '@/layouts'
11
+
10 12
 import { useModel } from "@/store"
11 13
 import './HomesCss/style.less'
12 14
 
13
-export default (props) => {
15
+export default withLayout((props) => {
14 16
   const location = Taro.getStorageSync('location')
15 17
   const [bannerHome, setBannerHome] = useState([])
16 18
   const [carsList, setCarsList] = useState([])
@@ -47,41 +49,39 @@ export default (props) => {
47 49
 
48 50
   return (
49 51
     <scroll-view className='scrollView' scrollY style='height: 100%;' >
50
-      {
51
-        person?.phone !== '' ? <>
52
-          <View className='heads-top-box'>
53
-            <View className='heads-top-box-left'>
54
-              <Image src={addresss} className='heads-top-box-left-addresssImg' />
55
-              <Text>邓州市</Text>
56
-              <View className='heads-top-box-left-addresssImg-DownIcon' />
57
-            </View>
58
-            <View className='heads-content-searchClass'>
59
-              <Input type='text' className='heads-content-searchClass-searchInput' onBlur={handleSearch} placeholder='搜索关键字查询订单' />
60
-              <Image src={searchs} className='heads-content-searchClass-searchInput-searchImg' />
61
-            </View>
62
-          </View>
63
-          <Swiper
64
-            circular
65
-            autoplay
66
-            className='swiper-box'
67
-          >
68
-            {bannerHome.map((item, inx) => (
69
-              <SwiperItem key={inx}>
70
-                <Image src={item.thumb} mode='widthFix' className='storeImage' />
71
-              </SwiperItem>
72
-            ))}
73
-          </Swiper>
74
-          <View className='content-header-box'>
75
-            <View className='content-header-box-liftCentent'>
76
-              <Image src={carsListImga} />
77
-              <View>农机列表</View>
78
-            </View>
79
-            <View onClick={goToCarsList} className='content-header-box-rightCentent'>更多&gt;&gt;</View>
80
-          </View>
81
-          <CarsListContent carsList={carsList} />
82
-        </> : <View>未登录,请先登陆</View>
83
-      }
52
+
53
+      <View className='heads-top-box'>
54
+        <View className='heads-top-box-left'>
55
+          <Image src={addresss} className='heads-top-box-left-addresssImg' />
56
+          <Text>邓州市</Text>
57
+          <View className='heads-top-box-left-addresssImg-DownIcon' />
58
+        </View>
59
+        <View className='heads-content-searchClass'>
60
+          <Input type='text' className='heads-content-searchClass-searchInput' onBlur={handleSearch} placeholder='搜索关键字查询订单' />
61
+          <Image src={searchs} className='heads-content-searchClass-searchInput-searchImg' />
62
+        </View>
63
+      </View>
64
+      <Swiper
65
+
66
+        mode='scaleToFill'
67
+        className='swiper-box'
68
+      >
69
+        {bannerHome.map((item, inx) => (
70
+          <SwiperItem key={inx}>
71
+            <Image src={item.thumb} mode='widthFix' className='storeImage' />
72
+          </SwiperItem>
73
+        ))}
74
+      </Swiper>
75
+      <View className='content-header-box'>
76
+        <View className='content-header-box-liftCentent'>
77
+          <Image src={carsListImga} />
78
+          <View>农机列表</View>
79
+        </View>
80
+        <View onClick={goToCarsList} className='content-header-box-rightCentent'>更多&gt;&gt;</View>
81
+      </View>
82
+      <CarsListContent carsList={carsList} />
83
+
84 84
 
85 85
     </scroll-view>
86 86
   )
87
-}
87
+})

+ 4
- 3
src/pages/index/tabs/HomesCss/style.less 查看文件

@@ -46,11 +46,12 @@
46 46
 }
47 47
 
48 48
 .swiper-box {
49
-  height: calc(calc(100vw-60px) * 0.62);
49
+  height: calc(calc(100vh - 50vh) * 0.62);
50 50
   text-align: center;
51
-  margin: 30px;
51
+  margin-top: 1em;
52
+
52 53
   .storeImage {
53
-    height: 100%;
54
+    width: 95vw;
54 55
   }
55 56
 }
56 57
 

+ 4
- 3
src/pages/index/tabs/Mine.jsx 查看文件

@@ -11,6 +11,7 @@ import versionUpdate from '@/assets/mineImgaes/versionUpdate.png'//版本更新
11 11
 import userMoren from '@/assets/mineImgaes/userMoren.png'//默认头像
12 12
 import userRight from '@/assets/mineImgaes/userRight.png'
13 13
 import { useModel } from "@/store"
14
+import withLayout from '@/layouts'
14 15
 
15 16
 import { getAddress } from "@/services/address"
16 17
 
@@ -19,7 +20,7 @@ import { getAddress } from "@/services/address"
19 20
 import './MineCss/style.less'
20 21
 
21 22
 
22
-export default (props) => {
23
+export default withLayout((props) => {
23 24
   const { person } = useModel('userData')
24 25
   const [isLoginBox, setIsLoginBox] = useState(false)
25 26
   const [addresInfo, setAddresInfo] = useState('')
@@ -38,7 +39,7 @@ export default (props) => {
38 39
     console.log($instance.router.params, '$instance.router.params路由')
39 40
     if ($instance.router.params.userOk || person.phone) {
40 41
       setIsLoginBox(true)
41
-      return { phone: person.phone, nickName: person.nickName, avatar: person.avatar }
42
+      return { phone: person?.phone, nickName: person?.nickName, avatar: person?.avatar }
42 43
     }
43 44
 
44 45
   }, [$instance.router.params, person])
@@ -160,4 +161,4 @@ export default (props) => {
160 161
       </View>
161 162
     </scroll-view>
162 163
   )
163
-}
164
+})

+ 4
- 3
src/pages/index/tabs/Orders.jsx 查看文件

@@ -8,11 +8,12 @@ import { useEffect, useState } from "react"
8 8
 import { getOrder } from "@/services/order"
9 9
 import formatTimes from "@/utils/codeSegment"
10 10
 import { useModel } from "@/store"
11
+import withLayout from '@/layouts'
11 12
 
12 13
 import './OrdersCss/style.less'
13 14
 
14 15
 
15
-export default (props) => {
16
+export default withLayout((props) => {
16 17
 
17 18
   const [ourderList, setOrderList] = useState([])
18 19
 
@@ -88,7 +89,7 @@ export default (props) => {
88 89
     <scroll-view scrollY style='height: 100%;' >
89 90
 
90 91
       {
91
-        person?.phone !== '' ? <>
92
+        person?.phone ? <>
92 93
           <View className='content-header-box-orders'>
93 94
             <View className='content-header-box-orders-liftCentent'>
94 95
               <Image src={ordersListImga} />
@@ -123,4 +124,4 @@ export default (props) => {
123 124
 
124 125
     </scroll-view>
125 126
   )
126
-}
127
+})

+ 4
- 2
src/pages/userInfo/index.jsx 查看文件

@@ -5,11 +5,13 @@ import { Input, View, Image } from "@tarojs/components"
5 5
 import CustomNav from '@/components/CustomNav'
6 6
 import ButtontWX from '@/components/ButtontWX'
7 7
 import { updateInfo } from "@/services/login"
8
+import withLayout from '@/layouts'
9
+
8 10
 // import banner1 from '@/assets/banner/1.jpg'
9 11
 // import resetImg from '@/assets/user/cancel.png'
10 12
 import './style.less'
11 13
 
12
-export default (props) => {
14
+export default withLayout((props) => {
13 15
 
14 16
   const { person, setPerson } = useModel('userData')
15 17
 
@@ -109,4 +111,4 @@ export default (props) => {
109 111
       </View>
110 112
     </View>
111 113
   )
112
-}
114
+})

+ 1
- 0
src/utils/hooks/useRouter.js 查看文件

@@ -2,6 +2,7 @@ import Taro, { useRouter } from '@tarojs/taro'
2 2
 // import { parseQueryString, random } from '@/utils'
3 3
 // import { useModel } from '@/store'
4 4
 import { useEffect, useRef, useState } from 'react'
5
+import { useModel } from '@/store'
5 6
 
6 7
 export default () => {
7 8
   const router = useRouter()