[baozhangchao] 3 anni fa
parent
commit
05d442d65d

+ 26
- 0
src/app.config.js Vedi File

@@ -11,6 +11,32 @@ export default {
11 11
     navigationBarTitleText: 'WeChat',
12 12
     navigationBarTextStyle: 'black'
13 13
   },
14
+  // tabBar: {
15
+  //   "custom": true,
16
+  //   "color": "#000000",
17
+  //   "selectedColor": "#000000",
18
+  //   "backgroundColor": "#000000",
19
+  //   list: [{
20
+  //     pagePath: "pages/HomePage/index",
21
+  //     text: "首页",
22
+
23
+  //   },
24
+  //   {
25
+  //     pagePath: "pages/OrderPage/index",
26
+  //     text: "订单"
27
+  //   },
28
+  //   {
29
+  //     pagePath: "pages/InformationPage/index",
30
+  //     text: "资讯"
31
+  //   },
32
+  //   {
33
+  //     pagePath: "pages/MinePage/index",
34
+  //     text: "我的"
35
+  //   },
36
+
37
+  //   ]
38
+  // },
39
+
14 40
   permission: {
15 41
     'scope.userLocation': {
16 42
       desc: '您的位置信息将方便您更好的小程序体验'

+ 23
- 16
src/app.less Vedi File

@@ -5,6 +5,7 @@
5 5
   height: 100vh;
6 6
   overflow: hidden;
7 7
   box-sizing: border-box;
8
+  letter-spacing: 2px;
8 9
   // background-color: #f2f2f2;
9 10
 
10 11
   .index-navbar {
@@ -13,6 +14,12 @@
13 14
 
14 15
   .index-tabbar {
15 16
     flex: none;
17
+    display: flex;
18
+    height: 130px;
19
+    text-align: center;
20
+    box-sizing: border-box;
21
+    padding: 14px 0 23px 0;
22
+    box-shadow: 0px -4px 6px 0px rgba(0, 0, 0, 0.08);
16 23
   }
17 24
 
18 25
   .index-container {
@@ -22,23 +29,23 @@
22 29
   }
23 30
 }
24 31
 
25
-.custom-tabbar {
26
-  background: #ffffff;
27
-  box-shadow: 0px -4px 6px 0px rgba(0, 0, 0, 0.08);
28
-  .weui-tabbar__label {
29
-    color: #c0c8d3;
30
-    font-size: 30px;
31
-    font-weight: 800;
32
-  }
32
+// .custom-tabbar {
33
+//   background: #ffffff;
34
+//   box-shadow: 0px -4px 6px 0px rgba(0, 0, 0, 0.08);
35
+//   .weui-tabbar__label {
36
+//     color: #c0c8d3;
37
+//     font-size: 30px;
38
+//     font-weight: 800;
39
+//   }
33 40
 
34
-  .weui-bar__item_on {
35
-    .weui-tabbar__label {
36
-      color: #202020;
37
-      font-size: 30px;
38
-      font-weight: 800;
39
-    }
40
-  }
41
-}
41
+//   .weui-bar__item_on {
42
+//     .weui-tabbar__label {
43
+//       color: #202020;
44
+//       font-size: 30px;
45
+//       font-weight: 800;
46
+//     }
47
+//   }
48
+// }
42 49
 
43 50
 .purebtn {
44 51
   margin: 0;

+ 1
- 1
src/components/ButtontWX/index.jsx Vedi File

@@ -4,7 +4,7 @@ import withLayout from '@/layouts'
4 4
 import './style.less'
5 5
 
6 6
 export default (props) => {
7
-  const { butText, butWidth, butHeight, butFontSize, butBorderRadius, styleType, loading, onClick, formType, disabled, opacity } = props
7
+  const { butText, butWidth, butHeight, butFontSize, butBorderRadius, styleType, loading, onClick = () => { }, formType, disabled, opacity } = props
8 8
   let butStyle = {
9 9
     width: `${butWidth || 100}px`,
10 10
     height: `${butHeight || 40}px`,

+ 54
- 35
src/components/LoginModel/index.jsx Vedi File

@@ -1,5 +1,5 @@
1 1
 
2
-import { useState } from 'react'
2
+import { useEffect, useState } from 'react'
3 3
 import Taro from '@tarojs/taro'
4 4
 import { getUserQcode, setUserPhone } from '@/services/login'
5 5
 
@@ -16,7 +16,7 @@ import './style.less'
16 16
 
17 17
 export default (props) => {
18 18
 
19
-  const { isLoginVisible } = props
19
+  const { isLoginVisible, loginType } = props
20 20
 
21 21
   const { person, setPerson } = useModel('userData')
22 22
 
@@ -30,8 +30,18 @@ export default (props) => {
30 30
 
31 31
   const [checkImage, setCheckImage] = useState(false)
32 32
 
33
-  const [InputPhoneValue, setInputPhoneValue] = useState('')
34
-  const [InputCodeValue, setInputCodeValue] = useState('')
33
+  const [InputPhoneValue, setInputPhoneValue] = useState('18082043755')
34
+  const [InputCodeValue, setInputCodeValue] = useState('375501')
35
+  const [myClosures, setMyClosure] = useState(false)
36
+
37
+  useEffect(() => {
38
+    if (isLoginVisible) {
39
+      setMyClosure(isLoginVisible)
40
+    }
41
+  }, [isLoginVisible])
42
+  const myClosure = () => {
43
+    setMyClosure(false)
44
+  }
35 45
 
36 46
   const onInputPhone = (r) => {
37 47
     setInputPhoneValue(r?.detail?.value)
@@ -102,7 +112,15 @@ export default (props) => {
102 112
         setUserPhone(person.personId, { captcha: InputCodeValue, phone: InputPhoneValue }).then((e) => {
103 113
           console.log('e', e);
104 114
           setPerson({ ...person, phone: InputPhoneValue })
105
-          Taro.reLaunch({ url: '/pages/index/index' });
115
+          // Taro.navigateTo({ url: path });
116
+          if (loginType) {
117
+            Taro.navigateBack({
118
+              delta: 1
119
+            })
120
+          } else {
121
+            myClosure()
122
+
123
+          }
106 124
         })
107 125
         // console.log('person', person);
108 126
       }
@@ -116,44 +134,45 @@ export default (props) => {
116 134
   return (
117 135
     <>
118 136
       {
119
-        isLoginVisible ? <View className='page-index  ' style={{ position: 'absolute', zIndex: '29999' }
120
-        } >
121
-          <View className='index-navbar'>
122
-            <CustomNav title='登陆' home />
123
-          </View>
124
-          <View className='loginBackImg-box' >
125
-            <Image src={require("@/assets/lolginImages/backLogin.png")} />
126
-
127
-            <View className='loginhallo-text'>
128
-              <View>您好!</View>
129
-              <View>欢迎进入农户端小程序!</View>
137
+        isLoginVisible !== myClosures ? myClosures : isLoginVisible ?
138
+          <View className='page-index  ' style={{ position: 'absolute', zIndex: '29999' }
139
+          } >
140
+            <View className='index-navbar'>
141
+              <CustomNav title='登陆' home />
130 142
             </View>
131
-            <View>
132
-              <View className='loginPhone-box' >
133
-                <View className='loginPhone-box-loginPhoneView'>+86</View>
134
-                <Input maxlength={11} placeholder='请输入手机号码' type={Number} value={InputPhoneValue} onInput={onInputPhone} />
143
+            <View className='loginBackImg-box' >
144
+              <Image src={require("@/assets/lolginImages/backLogin.png")} />
135 145
 
136
-                <ButtontWX opacity={countCenter.show_btn ? '0.7' : '11'} disabled={countCenter.show_btn} onClick={getCode} butText={countCenter.code_ts} butWidth={94} butHeight={34} butFontSize={15} butBorderRadius={10} />
146
+              <View className='loginhallo-text'>
147
+                <View>您好!</View>
148
+                <View>欢迎进入农户端小程序!</View>
137 149
               </View>
138
-              <View className='loginPhone-box'>
139
-                <View className='loginPhone-box-loginPhoneView'>
140
-                  <Image style={{ width: '16px', height: '20px', margin: 'auto 2.8vw auto 2.8vw' }} src={require("@/assets/lolginImages/phoneCode.png")} />
150
+              <View>
151
+                <View className='loginPhone-box' >
152
+                  <View className='loginPhone-box-loginPhoneView'>+86</View>
153
+                  <Input maxlength={11} placeholder='请输入手机号码' type={Number} value={InputPhoneValue} onInput={onInputPhone} />
154
+
155
+                  <ButtontWX opacity={countCenter.show_btn ? '0.7' : '11'} disabled={countCenter.show_btn} onClick={getCode} butText={countCenter.code_ts} butWidth={94} butHeight={34} butFontSize={15} butBorderRadius={10} />
156
+                </View>
157
+                <View className='loginPhone-box'>
158
+                  <View className='loginPhone-box-loginPhoneView'>
159
+                    <Image style={{ width: '16px', height: '20px', margin: 'auto 2.8vw auto 2.8vw' }} src={require("@/assets/lolginImages/phoneCode.png")} />
160
+                  </View>
161
+                  <Input maxlength={10} placeholder='请输入验证码' value={InputCodeValue} onInput={onInputCode} />
141 162
                 </View>
142
-                <Input maxlength={10} placeholder='请输入验证码' value={InputCodeValue} onInput={onInputCode} />
143 163
               </View>
144 164
             </View>
145
-          </View>
146
-          <View className='BottomtButrelative'  >
147
-            <ButtontWX onClick={getUserLogin} butText='登陆' butWidth={315} butHeight={49} butFontSize={16} butBorderRadius={49} />
148
-          </View>
149
-          <View className='bottom-agreement'>
150
-            <Image src={!checkImage ? checkedImg : unselectedImg} onClick={() => { setCheckImage(!checkImage) }} />
151
-            <View>
152
-              请认真查看<Text style={{ color: '#CE3800' }}>文本协议/隐私政策</Text>,确认之后选择此项!
165
+            <View className='BottomtButrelative'  >
166
+              <ButtontWX onClick={getUserLogin} butText='登陆' butWidth={315} butHeight={49} butFontSize={16} butBorderRadius={49} />
167
+            </View>
168
+            <View className='bottom-agreement'>
169
+              <Image src={!checkImage ? checkedImg : unselectedImg} onClick={() => { setCheckImage(!checkImage) }} />
170
+              <View>
171
+                请认真查看<Text style={{ color: '#CE3800' }}>文本协议/隐私政策</Text>,确认之后选择此项!
172
+              </View>
153 173
             </View>
154
-          </View>
155 174
 
156
-        </View >
175
+          </View >
157 176
           : <></>
158 177
       }
159 178
     </>

+ 2
- 1
src/layouts/index.jsx Vedi File

@@ -13,6 +13,7 @@ import useLogin from '@/utils/hooks/useLogin'
13 13
 export default (Child) => (props) => {
14 14
   const { person } = useModel('userData')
15 15
   const router = useRouter()
16
+  console.log("🚀 ~ file: index.jsx ~ line 16 ~ router", router)
16 17
 
17 18
 
18 19
   const { loginVisible } = useLogin()
@@ -29,7 +30,7 @@ export default (Child) => (props) => {
29 30
         isLoged && !loginVisible && <Child {...props} router={router} />
30 31
       }
31 32
       {
32
-        isLoged && loginVisible && <LoginModel isLoginVisible={loginVisible} />
33
+        isLoged && loginVisible && <LoginModel isLoginVisible={loginVisible} path={router.path} />
33 34
       }
34 35
     </>
35 36
   )

+ 2
- 1
src/pages/CheckDetails/index.jsx Vedi File

@@ -7,6 +7,7 @@ import ButtontWX from "@/components/ButtontWX"
7 7
 import decorate from "@/assets/icons/comm/decorate.png"
8 8
 import addresss from '@/assets/mineImgaes/addresss.png'//地址
9 9
 import { getMachineryInfo } from "@/services/homes"
10
+import formatPrice from "@/utils/formatPrice"
10 11
 import TextContent from "./TextContent"
11 12
 
12 13
 
@@ -77,7 +78,7 @@ export default withLayout((props) => {
77 78
           <View className='CarsContent-TextBox'>
78 79
             <View className='CheckDetails-bottom-box-flaxBox-liftText'>
79 80
               <View className='CheckDetails-bottom-box-flaxBox-liftText-Titles'>{carsInfo?.name}</View>
80
-              <View className='CheckDetails-bottom-box-flaxBox-liftText-price'>{carsInfo?.price}/<Text>公顷</Text></View>
81
+              <View className='CheckDetails-bottom-box-flaxBox-liftText-price'>{formatPrice(carsInfo.price)}/<Text>公顷</Text></View>
81 82
             </View>
82 83
             <View className='content-header-box-map-Info' onClick={() => goMapInfo('222888')}>
83 84
               <View className='content-header-box-map-Info-liftCentent'>

+ 10
- 0
src/pages/LoginPage/index.config.js Vedi File

@@ -0,0 +1,10 @@
1
+
2
+export default {
3
+  navigationBarTitleText: '登陆',
4
+  navigationStyle: 'custom',
5
+  disableScroll: true,
6
+  usingComponents: {
7
+
8
+  }
9
+
10
+}

+ 27
- 0
src/pages/LoginPage/index.jsx Vedi File

@@ -0,0 +1,27 @@
1
+
2
+import { View } from "@tarojs/components"
3
+import CustomNav from "@/components/CustomNav"
4
+import Taro from "@tarojs/taro"
5
+import { useEffect, useState } from "react"
6
+import LoginModel from "@/components/LoginModel"
7
+
8
+
9
+
10
+export default (props) => {
11
+  const [isShow, setIsShow] = useState(false)
12
+
13
+  const $instance = Taro.getCurrentInstance()
14
+  const { login } = $instance.router.params
15
+
16
+  useEffect(() => {
17
+    setIsShow(true)
18
+  }, [])
19
+
20
+  return (
21
+    <View className='page-index'>
22
+      <View>
23
+        <LoginModel isLoginVisible={isShow} loginType={login} />
24
+      </View>
25
+    </View>
26
+  )
27
+}

+ 3
- 1
src/pages/MyAddressList/AddressInfos/index.jsx Vedi File

@@ -22,6 +22,8 @@ export default withLayout((props) => {
22 22
     const value = e?.detail?.value
23 23
     console.log(value)
24 24
 
25
+
26
+
25 27
     if (addressId) {
26 28
 
27 29
       addressUpdate(addressId, { address: value.address }).then((res) => {
@@ -76,7 +78,7 @@ export default withLayout((props) => {
76 78
             <Textarea name='address' value={address} className='aTextareaCentent' placeholder='请输入地址信息' />
77 79
           </View>
78 80
           <View className='buton-bottom'>
79
-            <ButtontWX onClick={formSubmit} formType='submit' butText='保存' butWidth={315} butHeight={49} butFontSize={16} butBorderRadius={49} />
81
+            <ButtontWX formType='submit' butText='保存' butWidth={315} butHeight={49} butFontSize={16} butBorderRadius={49} />
80 82
           </View>
81 83
         </Form>
82 84
 

+ 2
- 0
src/pages/MyAddressList/index.jsx Vedi File

@@ -20,6 +20,8 @@ export default withLayout((props) => {
20 20
   const [addresList, setAddresList] = useState([])
21 21
   const $instance = Taro.getCurrentInstance()
22 22
   const { type } = $instance.router.params
23
+
24
+
23 25
   console.log("🚀 ~ file: index.jsx ~ line 23 ~ withLayout ~ orderAddress", type)
24 26
 
25 27
 

+ 17
- 11
src/pages/OrderInfo/index.jsx Vedi File

@@ -122,17 +122,24 @@ export default withLayout((props) => {
122 122
 
123 123
 
124 124
   const pay = () => {
125
-    orderPrepay(orderId, {
126
-      payType: 'wx',
127
-
128
-    }).then((e) => {
129
-      console.log('订单返回', e);
130
-      Taro.showLoading({
131
-        title: '支付中',
132
-      })
133
-      requestPayment(e)
125
+    console.log('asd2222222222sad`a',);
134 126
 
127
+    Taro.switchTab({
128
+      url: '/pages/index/index?tab=3'
135 129
     })
130
+    console.log('asdsad`a',);
131
+
132
+    // orderPrepay(orderId, {
133
+    //   payType: 'wx',
134
+
135
+    // }).then((e) => {
136
+    //   console.log('订单返回', e);
137
+    //   Taro.showLoading({
138
+    //     title: '支付中',
139
+    //   })
140
+    //   requestPayment(e)
141
+
142
+    // })
136 143
     //支付逻辑
137 144
   }
138 145
 
@@ -192,7 +199,7 @@ export default withLayout((props) => {
192 199
         <View>作业面积:<Text>{orderInfos?.amount}</Text></View>
193 200
         <View>需求时间:<Text>{formatTimes(orderInfos?.appointmentDate, 'yyyy-MM-dd')}</Text></View>
194 201
         <View>下单时间:<Text>{formatTimes(orderInfos?.createDate, 'yyyy-MM-dd')}</Text></View>
195
-        <View>订单状态:<Text style={{ color: `${stateStyle}` }}  >{stateType}</Text></View>
202
+        <View>订单状态:<Text style={{ color: `${stateStyle}` }}  >{stateType === '已付款' ? '已付款,待调度' : stateType}</Text></View>
196 203
         <View className='View-LiftTextBotton'>
197 204
           <View className='feiyongStyle'>费用:<Text className='feiyongStyle-charges' >{formatPrice(orderInfos?.charges)}</Text></View>
198 205
           <View className='feiyongStyle'>状态:<Text style={{ color: `${stateStyle}` }} className='feiyongStyle-stateStyle' >{orderInfos?.payStatus === 1 ? '已付款' : '待付款'}</Text></View>
@@ -210,7 +217,6 @@ export default withLayout((props) => {
210 217
                       <ButtontWX butText='支付' onClick={pay} butWidth={150} butHeight={39} butFontSize={16} butBorderRadius={49} />
211 218
                     </> : stateType == '已付款' ?
212 219
                       <ButtontWX butText='退单' onClick={orderRefunds} butWidth={323} butHeight={49} butFontSize={16} butBorderRadius={49} />
213
-
214 220
                       // <ButtontWX butText={`${orderInfos?.payStatus == 3 ? '退单申请中' : '退单'}`} disabled={orderInfos?.payStatus == 3 ? true : false} onClick={orderInfos?.payStatus == 3 ? '' : orderRefunds} butWidth={323} butHeight={49} butFontSize={16} butBorderRadius={49} />
215 221
                       : stateType == '待作业' ? <ButtontWX butText={`${orderInfos?.payStatus == 3 ? '退单申请中' : '退单'}`} disabled={orderInfos?.payStatus == 3 ? true : false} onClick={orderInfos?.payStatus == 3 ? '' : orderRefunds} butWidth={323} butHeight={49} butFontSize={16} butBorderRadius={49} />
216 222
 

+ 74
- 8
src/pages/index/index.jsx Vedi File

@@ -4,8 +4,19 @@ import withLayout from '@/layouts'
4 4
 import CustomNav from '@/components/CustomNav'
5 5
 import { useModel } from '@/store'
6 6
 import LoginModel from "@/components/LoginModel"
7
+import { View, Image } from '@tarojs/components'
8
+
9
+//分别是   首页  订单  资讯 我的
10
+import HomesOFFImgaes from '@/assets/tabbar/HomesOFFImgaes.png'
11
+import HomesNOImgaes from '@/assets/tabbar/HomesNOImgaes.png'
12
+import OrdersOFFImgaes from '@/assets/tabbar/OrdersOFFImgaes.png'
13
+import OrdersNOImgaes from '@/assets/tabbar/OrdersNOImgaes.png'
14
+import newsONImages from '@/assets/tabbar/newsONImages.png'
15
+import newsOFFImages from '@/assets/tabbar/newsOFFImages.png'
16
+import MineOFFImgaes from '@/assets/tabbar/MineOFFImgaes.png'
17
+import MineNOImgaes from '@/assets/tabbar/MineNOImgaes.png'
18
+
7 19
 
8
-import tabList from './tabbar'
9 20
 import Homes from './tabs/Homes'
10 21
 import Orders from './tabs/Orders'
11 22
 import Mine from './tabs/Mine'
@@ -20,38 +31,65 @@ export default withLayout((props) => {
20 31
 
21 32
 
22 33
   const { params, path } = router
34
+
35
+
23 36
   const { tab } = params || {}
24 37
 
38
+
39
+  console.log("🚀 ~ file: index.jsx ~ line 24 ~ withLayout ~ tab", tab)
40
+
25 41
   const [currentTab, setCurrentTab] = useState(0)
26 42
 
27 43
   const [isDidShow, setIsDidShow] = useState(0)
28 44
 
45
+
46
+  const [tabsIndex, setTabsIndex] = useState(0)
47
+
48
+
49
+
29 50
   const [isShow, setIsShow] = useState(false)
30 51
 
31 52
 
32 53
   useDidShow(() => {
33 54
     setIsDidShow(isDidShow + 1)
55
+    if (!person?.phone) {
56
+      console.log('还是未登录',);
57
+      setCurrentTab(0)
58
+
59
+
60
+    } else {
61
+      setCurrentTab(tabsIndex)
62
+      // handleTabChange(tabsIndex)
63
+
64
+      console.log('已登陆',);
65
+
66
+    }
34 67
   })
35 68
 
36 69
   useEffect(() => {
37 70
     if (tab) {
38 71
       setCurrentTab(tab - 0)
72
+
73
+
39 74
     }
40 75
     // setIsShow(true)
41 76
   }, [tab,])
42 77
 
43 78
 
44
-  const handleTabChange = (e) => {
79
+  const handleClick = (index) => {
80
+    // Taro.switchTab({
81
+    //   url: '/pages/InformationPage/index'
82
+    // })
83
+
45 84
 
46 85
     if (!person?.phone) {
47
-      // Taro.navigateTo({ url: `/pages/UserLogin/index` })
48
-      setIsShow(true)
86
+      setTabsIndex(index)
87
+      Taro.navigateTo({ url: `/pages/LoginPage/index?login=true` })
88
+      // setIsShow(true)
49 89
     } else {
50
-      const { index } = e.detail
51 90
       setCurrentTab(index)
52 91
 
53 92
     }
54
-
55 93
   }
56 94
 
57 95
 
@@ -61,7 +99,7 @@ export default withLayout((props) => {
61 99
 
62 100
       <view className='index-navbar'>
63 101
 
64
-        <CustomNav title='首页' home />
102
+        <CustomNav title={currentTab === 0 ? '首页' : currentTab === 1 ? '订单' : currentTab === 2 ? '资讯' : '我的'} home />
65 103
       </view>
66 104
       <view className='index-container'>
67 105
         {currentTab === 0 && <Homes />}
@@ -71,7 +109,35 @@ export default withLayout((props) => {
71 109
         {currentTab === 3 && <Mine isDidShow={isDidShow} router={router} />}
72 110
       </view>
73 111
       <view className='index-tabbar'>
74
-        <mp-tabbar extClass='custom-tabbar' current={currentTab} list={tabList} onChange={handleTabChange}></mp-tabbar>
112
+        <View
113
+          className={['tabberItem', currentTab == 0 ? "activeTabber" : '']}
114
+          onClick={() => handleClick(0)}
115
+        >
116
+          <Image className='tabberImg' src={currentTab == 0 ? HomesNOImgaes : HomesOFFImgaes}></Image>
117
+          <View className='text'>首页</View>
118
+        </View>
119
+        <View
120
+          className={['tabberItem', currentTab === 1 ? "activeTabber" : '']}
121
+          onClick={() => handleClick(1)}
122
+        >
123
+          <Image className='tabberImg' src={currentTab == 1 ? OrdersNOImgaes : OrdersOFFImgaes}></Image>
124
+          <View className='text'>订单</View>
125
+        </View>
126
+        <View
127
+          className={['tabberItem', currentTab === 2 ? "activeTabber" : '']}
128
+          onClick={() => handleClick(2)}
129
+        >
130
+          <Image className='tabberImg' src={currentTab == 2 ? newsOFFImages : newsONImages}></Image>
131
+          <View className='text'>资讯</View>
132
+        </View>
133
+        <View
134
+          className={['tabberItem', currentTab === 3 ? "activeTabber" : '']}
135
+          onClick={() => handleClick(3)}
136
+        >
137
+          <Image className='tabberImg' src={currentTab == 3 ? MineNOImgaes : MineOFFImgaes}></Image>
138
+          <View className='text'>我的</View>
139
+        </View>
140
+        {/* <mp-tabbar extClass='custom-tabbar' autoSelect={false} current={currentTab} list={tabList} onChange={handleTabChange}></mp-tabbar> */}
75 141
       </view>
76 142
     </view>
77 143
   )

+ 18
- 0
src/pages/index/index.less Vedi File

@@ -0,0 +1,18 @@
1
+.tabberItem {
2
+  flex: 1;
3
+  font-size: 30px;
4
+  font-weight: bold;
5
+  .tabberImg {
6
+    width: 52px;
7
+    height: 52px;
8
+    display: block;
9
+    margin: auto;
10
+  }
11
+  .text {
12
+    line-height: 29px;
13
+    margin-top: 12px;
14
+  }
15
+}
16
+.activeTabber {
17
+  color: #ff703b;
18
+}

+ 28
- 8
src/pages/index/tabs/Homes.jsx Vedi File

@@ -17,7 +17,10 @@ export default withLayout((props) => {
17 17
   const [bannerHome, setBannerHome] = useState([])
18 18
   const [carsList, setCarsList] = useState([])
19 19
 
20
-  const { person, setPerson } = useModel('userData')
20
+  const [currentPage, setCurrentPage] = useState(1)
21
+
22
+  const [isMore, setIsMore] = useState(false)
23
+
21 24
 
22 25
 
23 26
 
@@ -26,21 +29,32 @@ export default withLayout((props) => {
26 29
       console.log('e', e);
27 30
       setBannerHome(e)
28 31
     })
29
-    getMachinery(sserLocation).then((e) => {
30
-      setCarsList(e.records)
32
+    getMachinery(sserLocation, { pageNum: currentPage, }).then((e) => {
33
+      const records = currentPage === 1 ? e.records || [] : carsList.concat(e.records || [])
34
+      console.log("🚀 ~ file: Orders.jsx ~ line 41 ~ getOrder ~ records", records)
35
+      if (e.records.length == 0 && currentPage != 1) {
36
+        setIsMore(true)
37
+        return
38
+      }
39
+      setCarsList(records)
31 40
     })
32 41
 
33
-  }, [sserLocation])
42
+  }, [currentPage, sserLocation])
43
+
34 44
 
35 45
 
46
+  const handleScrollToLower = () => {
47
+    if (carsList.length < 9) {
48
+      return;
49
+    } else {
50
+      setCurrentPage(currentPage + 1)
36 51
 
52
+    }
53
+  }
37 54
 
38 55
 
39 56
 
40 57
 
41
-  const handleSearch = (e) => {
42
-    console.log(e?.detail?.value)
43
-  }
44 58
 
45 59
   const goSearch = () => {
46 60
     Taro.navigateTo({ url: `/pages/Search/index?location=${sserLocation}` })
@@ -56,7 +70,13 @@ export default withLayout((props) => {
56 70
 
57 71
 
58 72
   return (
59
-    <scroll-view className='scrollView' scrollY style='height: 100%;' >
73
+    <scroll-view
74
+      className='scrollView'
75
+      scrollY
76
+      style='height: 100%;'
77
+      onScrollToLower={isMore ? '' : handleScrollToLower}
78
+
79
+    >
60 80
 
61 81
       <View className='heads-top-box'>
62 82
         <View className='heads-top-box-left'>

+ 3
- 3
src/pages/index/tabs/Orders.jsx Vedi File

@@ -1,8 +1,8 @@
1 1
 
2 2
 import { View, Image, Text } from "@tarojs/components"
3 3
 import Taro, { useDidShow } from '@tarojs/taro'
4
-import withLayout from '@/layouts'
5 4
 import ListPlaceholder from "@/components/ListPlaceholder"
5
+import withLayout from '@/layouts'
6 6
 
7 7
 import ordersListImga from '@/assets/ordersImages/ordersListImga.png'
8 8
 import ordersLeft from '@/assets/ordersImages/ordersLeft.png'//订单装饰
@@ -70,7 +70,7 @@ export default withLayout((props) => {
70 70
         title: '已付款',
71 71
         styleColor: '#FF703B'
72 72
       }
73
-    } else if (item.payStatus == 1 && item.dispatchStatus === 1) {
73
+    } else if (item.payStatus == 1 && item.dispatchStatus === 1 && item.workStatus === 0) {
74 74
       return {
75 75
         title: '待作业',
76 76
         styleColor: '#FF703B'
@@ -86,7 +86,7 @@ export default withLayout((props) => {
86 86
         title: '待评价',
87 87
         styleColor: '#51D4FF'
88 88
       }
89
-    } if (item.workStatus === 3 && item.isEvaluated === 1) {
89
+    } if (item.workStatus === 3 && item.isEvaluated === 1 && item.dispatchStatus == 1) {
90 90
       return {
91 91
         title: '已完成',
92 92
         styleColor: '#FF703B'

+ 26
- 0
src/routes.js Vedi File

@@ -6,6 +6,11 @@ const Pages = [
6 6
     page: 'pages/index/index',
7 7
     isIndex: true,
8 8
   },
9
+  // {
10
+  //   title: '首页1~',
11
+  //   page: 'pages/HomePage/index',
12
+
13
+  // },
9 14
   {
10 15
     title: '搜索页',
11 16
     page: 'pages/Search/index',
@@ -70,6 +75,27 @@ const Pages = [
70 75
     title: '查看地图',
71 76
     page: 'pages/CheckMap/index',
72 77
   },
78
+  // {
79
+  //   title: '订单1~',
80
+  //   page: 'pages/OrderPage/index',
81
+
82
+  // },
83
+  // {
84
+  //   title: '资讯1~',
85
+  //   page: 'pages/InformationPage/index',
86
+  // },
87
+  // {
88
+  //   title: '我的1~',
89
+  //   page: 'pages/MinePage/index',
90
+  // },
91
+
92
+
93
+
94
+  {
95
+    title: '登陆页面~',
96
+    page: 'pages/LoginPage/index',
97
+  },
98
+
73 99
 ];
74 100
 
75 101
 

+ 3
- 1
src/utils/hooks/useLogin.js Vedi File

@@ -6,7 +6,9 @@ import { useModel } from '@/store'
6 6
 import { useMemo, useState, useEffect } from "react";
7 7
 
8 8
 const whiteList = [
9
-  "/pages/index/index"
9
+  "/pages/index/index",
10
+  "/pages/LoginPage/index",
11
+  "/pages/HomePage/index"
10 12
 ]
11 13
 
12 14
 export default () => {

+ 0
- 2
src/utils/hooks/useRouter.js Vedi File

@@ -20,8 +20,6 @@ export default () => {
20 20
       return;
21 21
     }
22 22
 
23
-
24
-
25 23
   }, [scene])
26 24
 
27 25
   return routerRef.current