Browse Source

房东端tab

李志伟 3 years ago
parent
commit
6cb203f6e4

+ 2
- 3
src/app.config.js View File

@@ -7,9 +7,8 @@ export default {
7 7
     'pages/details/foodDetails/foodDetails',
8 8
     'pages/details/mjDetails/sceneryDetails',
9 9
     'pages/login/login',
10
-    'pages/shopKeeper/shopKeeper',
11
-    'pages/spread/spreadMoney',
12
-    'pages/landlord/AllLandlord/AllLandlord',
10
+    'pages/spread/spreadIndex',
11
+    'pages/landlord/landlord',
13 12
     'pages/PayOrder/index',
14 13
     'pages/MineUserAll/ContactMe/index',
15 14
     'pages/MineUserAll/HomeLogo/index',

src/pages/shopKeeper/shopKeeper.jsx → src/components/spreads/ShopKeeper/shopKeeper.jsx View File

@@ -1,18 +1,12 @@
1
-import Taro from '@tarojs/taro'
2 1
 import CustomNav from '@/components/CustomNav'
3 2
 import './shopKeeper.less'
4
-import eyes from '../../assets/icons/shopKeeper/小眼睛.png'
5
-import ceyes from '../../assets/icons/shopKeeper/小眼睛-闭上.png'
6
-import orders from '../../assets/icons/shopKeeper/订单收入按下.png'
7
-import spread from '../../assets/icons/shopKeeper/推广收入.png'
8
-import iconsearch from '../../assets/icons/housemantj/search.png'
9
-import ms from '../../assets/icons/housemantj/ms3.jpg'
3
+import eyes from '@/assets/icons/shopKeeper/小眼睛.png'
4
+import ceyes from '@/assets/icons/shopKeeper/小眼睛-闭上.png'
5
+import iconsearch from '@/assets/icons/housemantj/search.png'
6
+import ms from '@/assets/icons/housemantj/ms3.jpg'
10 7
 
11 8
 
12 9
 export default (props) => {
13
-  const toSpread=()=>{
14
-    Taro.redirectTo({url:'/pages/spread/spreadMoney'})
15
-  }
16 10
   return (
17 11
     <view>
18 12
       <view>
@@ -112,16 +106,7 @@ export default (props) => {
112 106
           </view>
113 107
           <view className='botton'>已经到底了~</view>
114 108
         </scroll-view>        
115
-      </view>
116
-      <view className='bottomTab'>
117
-          <view className='orderstab'>
118
-            <image className='orders' src={orders} /><text>订单收入</text>
119
-          </view>
120
-          <view className='spreadtab' onClick={toSpread}>
121
-            <image className='spread' src={spread} /><text>推广收入</text>
122
-          </view>
123
-        </view>
124
-    
109
+      </view>      
125 110
       </view>
126 111
   )
127 112
 }

src/pages/shopKeeper/shopKeeper.less → src/components/spreads/ShopKeeper/shopKeeper.less View File

@@ -245,32 +245,3 @@
245 245
   padding:40px 0 100px 0;
246 246
 }
247 247
 
248
-.bottomTab{
249
-  width: 100%;
250
-  height: 98px;
251
-  background: #FFFFFF;
252
-  box-shadow: 0px -4px 6px 0px rgba(0, 0, 0, 0.08);
253
-  display: inline-block;
254
-  position: absolute;
255
-  bottom: 0;
256
-  line-height: 98px;
257
-  font-size: 30px;     
258
-  font-weight: bold;
259
-  color: #202020;
260
-  .orderstab{
261
-    display: inline-block;
262
-    margin-left: 17%;
263
-  }
264
-  .spreadtab{
265
-    margin-right:17%;
266
-    float: right;
267
-    color: #666;
268
-  }
269
-  image{
270
-    width: 31px;
271
-    height: 31px;
272
-    position: relative;
273
-    top: 7px;
274
-    margin-right: 12px;
275
-  }
276
-}

src/pages/spread/spreadMoney.jsx → src/components/spreads/Sparead/spreadMoney.jsx View File

@@ -1,16 +1,10 @@
1
-import Taro from '@tarojs/taro'
2 1
 import CustomNav from '@/components/CustomNav'
3 2
 import './spreadMoney.less'
4
-import eyes from '../../assets/icons/shopKeeper/小眼睛.png'
5
-import ceyes from '../../assets/icons/shopKeeper/小眼睛-闭上.png'
6
-import orders from '../../assets/icons/shopKeeper/订单收入.png'
7
-import spread from '../../assets/icons/shopKeeper/推广收入按下.png'
3
+import eyes from '@/assets/icons/shopKeeper/小眼睛.png'
4
+import ceyes from '@/assets/icons/shopKeeper/小眼睛-闭上.png'
8 5
 
9 6
 
10 7
 export default (props) => {
11
-  const toOrders=()=>{
12
-    Taro.redirectTo({url:'/pages/shopKeeper/shopKeeper'})
13
-  }
14 8
   return (
15 9
     <view>
16 10
       <view>
@@ -58,15 +52,7 @@ export default (props) => {
58 52
           <view className='botton'>已经到底了~</view>
59 53
         </scroll-view>        
60 54
       </view>
61
-      <view className='bottomTab'>
62
-          <view className='orderstab' onClick={toOrders}>
63
-            <image className='orders' src={orders} /><text>订单收入</text>
64
-          </view>
65
-          <view className='spreadtab'>
66
-            <image className='spread' src={spread} /><text>推广收入</text>
67
-          </view>
68
-        </view>
69
-    
55
+      
70 56
       </view>
71 57
   )
72 58
 }

src/pages/spread/spreadMoney.less → src/components/spreads/Sparead/spreadMoney.less View File

@@ -115,32 +115,3 @@
115 115
   text-align: center;
116 116
   padding:40px 0 100px 0;
117 117
 }
118
-.bottomTab{
119
-  width: 100%;
120
-  height: 98px;
121
-  background: #FFFFFF;
122
-  box-shadow: 0px -4px 6px 0px rgba(0, 0, 0, 0.08);
123
-  display: inline-block;
124
-  position: absolute;
125
-  bottom: 0;
126
-  line-height: 98px;
127
-  font-size: 30px;     
128
-  font-weight: bold;
129
-  color: #202020;
130
-  .orderstab{
131
-    display: inline-block;
132
-    margin-left: 17%;
133
-    color: #666;
134
-  }
135
-  .spreadtab{
136
-    margin-right:17%;
137
-    float: right;
138
-  }
139
-  image{
140
-    width: 31px;
141
-    height: 31px;
142
-    position: relative;
143
-    top: 7px;
144
-    margin-right: 12px;
145
-  }
146
-}

src/pages/landlord/AllLandlord/AllLandlord.config.js → src/pages/landlord/landlord.config.js View File


src/pages/landlord/AllLandlord/AllLandlord.jsx → src/pages/landlord/landlord.jsx View File

@@ -7,7 +7,7 @@ import incomeImg from '@/assets/icons/landlord/我的收入.png'
7 7
 import onincomeImg from '@/assets/icons/landlord/我的收入按下.png'
8 8
 import houseImg from '@/assets/icons/landlord/房源管理.png'
9 9
 import onhouseImg from '@/assets/icons/landlord/房源管理按下.png'
10
-import './AllLandlord.less'
10
+import './landlord.less'
11 11
 
12 12
 export default (props) => {
13 13
   const { params } = useRouter()

src/pages/landlord/AllLandlord/AllLandlord.less → src/pages/landlord/landlord.less View File


src/pages/shopKeeper/shopKeeper.config.js → src/pages/spread/spreadIndex.config.js View File

@@ -1,4 +1,7 @@
1 1
 export default {
2 2
   navigationBarTitleText: '十公里',
3 3
   navigationStyle: 'custom',
4
+  usingComponents: {
5
+    "mp-tabbar": "weui-miniprogram/tabbar/tabbar"
6
+  }
4 7
 }

+ 49
- 0
src/pages/spread/spreadIndex.jsx View File

@@ -0,0 +1,49 @@
1
+import React, { useState, useEffect } from 'react'
2
+import { useRouter } from '@tarojs/taro'
3
+import ShopKeeper from '@/components/spreads/ShopKeeper/shopKeeper'
4
+import Sparead from '@/components/spreads/Sparead/spreadMoney'
5
+import TabBar from '@/components/CustTabBar'
6
+import shopImg from '@/assets/icons/shopKeeper/订单收入.png'
7
+import onShopImg from '@/assets/icons/shopKeeper/订单收入按下.png'
8
+import spareadImg from '@/assets/icons/shopKeeper/推广收入.png'
9
+import onSpareadImg from '@/assets/icons/shopKeeper/推广收入按下.png'
10
+import './spreadIndex.less'
11
+
12
+export default (props) => {
13
+  const { params } = useRouter()
14
+  const { tab } = params || {}
15
+
16
+  const [currentTab, setCurrentTab] = useState(0)
17
+
18
+  const handleTabChange = (e) => {
19
+    const { index } = e.detail
20
+    setCurrentTab(index)
21
+  }
22
+
23
+  useEffect(() => {
24
+    if (tab) {
25
+      setCurrentTab(tab - 0)
26
+    }
27
+  }, [tab])
28
+
29
+  return (
30
+    <view className='page-index'>
31
+      <view className='index-container'>
32
+        {currentTab === 0 && <ShopKeeper />}
33
+        {currentTab === 1 && <Sparead />}
34
+      </view>
35
+      <view className='index-tabbar'>
36
+        <TabBar extClass='custom-tabbar bottomTab' current={currentTab} onChange={handleTabChange}>
37
+          <view className={`${currentTab === 0 ? 'orderstab' : ''}`}>
38
+            <image className='incomes' src={currentTab === 0 ? onShopImg : shopImg} /><text>订单收入</text>
39
+          </view>
40
+          <view className={`${currentTab === 1 ? 'spreadtab' : ''}`}>
41
+            <image className='house' src={currentTab === 1 ? onSpareadImg : spareadImg} /><text>推广收入</text>
42
+          </view>
43
+        </TabBar>
44
+      </view>
45
+    </view>
46
+
47
+  )
48
+
49
+}

+ 20
- 0
src/pages/spread/spreadIndex.less View File

@@ -0,0 +1,20 @@
1
+.bottomTab{
2
+  height: 98px;
3
+  line-height: 98px;
4
+  font-size: 30px;     
5
+  font-weight: bold;
6
+  color: #202020;
7
+  .orderstab{
8
+    color: #666;
9
+  }
10
+  .spreadtab{
11
+    color: #666;
12
+  }
13
+  image{
14
+    width: 31px;
15
+    height: 31px;
16
+    position: relative;
17
+    top: 7px;
18
+    margin-right: 12px;
19
+  }
20
+}

+ 0
- 4
src/pages/spread/spreadMoney.config.js View File

@@ -1,4 +0,0 @@
1
-export default {
2
-  navigationBarTitleText: '十公里',
3
-  navigationStyle: 'custom',
4
-}