吃个甘蔗嚼一年 3 anni fa
parent
commit
43bac9e2c7

+ 0
- 39
src/components/CustTabBar/index.jsx Vedi File

@@ -1,39 +0,0 @@
1
-
2
-import React from 'react'
3
-import './style.less'
4
-
5
-export default (props) => {
6
-  const { extClass = '', current, onChange, children } = props
7
-
8
-  const handleTabChange = (e, index) => {
9
-    if (e) {
10
-      e.detail = {
11
-        ...e.detail || {},
12
-        index,
13
-      }
14
-      // Object.assign(e.detail, { index })
15
-    }
16
-
17
-    if (onChange) {
18
-      onChange(e)
19
-    }
20
-  }
21
-
22
-  const className = `weui-tabbar cust-tabbar ${extClass}`
23
-
24
-  return (
25
-    <view className={className}>
26
-      {
27
-        React.Children.toArray(children).map((child, index) => {
28
-          const itemClass = `weui-tabbar__item cust-tabbar-item`
29
-
30
-          return (
31
-            <view className={itemClass} onClick={(e) => handleTabChange(e, index)}>
32
-              {child}
33
-            </view>
34
-          )
35
-        })
36
-      }
37
-    </view>
38
-  )
39
-}

+ 0
- 6
src/components/CustTabBar/style.less Vedi File

@@ -1,6 +0,0 @@
1
-.cust-tabbar {
2
-  &-item {
3
-    font-size: 1em;
4
-    padding: 0;
5
-  }
6
-}

+ 18
- 0
src/hotel/pages/landlord/Roomtabbar.js Vedi File

@@ -0,0 +1,18 @@
1
+
2
+const Roomtabbar = [
3
+
4
+
5
+  {
6
+    text: '房源管理',
7
+    iconPath: require('@/assets/icons/landlord/roomOff.png'),
8
+    selectedIconPath: require('@/assets/icons/landlord/roomON.png'),
9
+  },
10
+  {
11
+    text: '我的收入',
12
+    iconPath: require('@/assets/icons/landlord/money.png'),
13
+    selectedIconPath: require('@/assets/icons/landlord/moneyON.png'),
14
+  },
15
+
16
+]
17
+
18
+export default Roomtabbar

+ 10
- 8
src/hotel/pages/landlord/landlord.jsx Vedi File

@@ -1,17 +1,16 @@
1 1
 import React, { useState, useEffect, useRef } from 'react'
2 2
 import Taro, { useRouter, useShareAppMessage } from '@tarojs/taro'
3
-import TabBar from '@/components/CustTabBar'
4
-import incomeImg from '@/assets/icons/landlord/money.png'
5
-import onincomeImg from '@/assets/icons/landlord/moneyON.png'
6
-import houseImg from '@/assets/icons/landlord/roomOff.png'
7
-import onhouseImg from '@/assets/icons/landlord/roomON.png'
3
+
8 4
 import withLayout from '@/layouts'
5
+
9 6
 import { getHotelManage, getNowHotelManage } from '@/services/landlord'
10 7
 import NoData from '@/components/NoData'
11 8
 import CustomNav from '@/components/CustomNav'
12 9
 import { withSubscribeMessage } from '@/utils/subscribeMessage'
13 10
 import HouseManage from '../../components/HouseManage/houseManage'
14 11
 import Income from '../../components/Income/income'
12
+import tabList from './Roomtabbar'
13
+
15 14
 import './landlord.less'
16 15
 
17 16
 export default withLayout((props) => {
@@ -64,7 +63,7 @@ export default withLayout((props) => {
64 63
 
65 64
   return (
66 65
     <view className='page-index'>
67
-      <view className="index-navbar">
66
+      <view className='index-navbar'>
68 67
         <CustomNav title={hotel?.hotelName} logo={hotel?.logo} />
69 68
       </view>
70 69
       <view className='index-container'>
@@ -72,14 +71,17 @@ export default withLayout((props) => {
72 71
         {hotel?.hotelId ? currentTab === 0 && <HouseManage hotel={hotel} ref={houseRef} disabled={!hotel.hotelId} /> : <NoData />}
73 72
       </view>
74 73
       <view className='index-tabbar'>
75
-        <TabBar extClass='custom-tabbar bottomTab' current={currentTab} onChange={handleTabChange}>
74
+        {/* <TabBar extClass='custom-tabbar bottomTab' current={currentTab} onChange={handleTabChange}>
76 75
           <view className={`${currentTab === 0 ? 'houseTab' : ''}`}>
77 76
             <image className='house' src={currentTab === 0 ? onhouseImg : houseImg} /><text>房源管理</text>
78 77
           </view>
79 78
           <view className={`${currentTab === 1 ? 'incomeTab' : ''}`}>
80 79
             <image className='incomes' src={currentTab === 1 ? onincomeImg : incomeImg} /><text>我的收入</text>
81 80
           </view>
82
-        </TabBar>
81
+        </TabBar> */}
82
+      </view>
83
+      <view className='index-tabbar'>
84
+        <mp-tabbar extClass='custom-tabbar' current={currentTab} list={tabList} onChange={handleTabChange}></mp-tabbar>
83 85
       </view>
84 86
     </view>
85 87
 

+ 37
- 37
src/pages/details/foodDetails/foodDetails.jsx Vedi File

@@ -138,9 +138,9 @@ export default withLayout((props) => {
138 138
   });
139 139
 
140 140
   return (
141
-    <view className="page-index">
142
-      <view className="index-navbar">
143
-        <CustomNav title="十公里" />
141
+    <view className='page-index'>
142
+      <view className='index-navbar'>
143
+        <CustomNav title='十公里' />
144 144
       </view>
145 145
       <view
146 146
         style={{ overflow: "hidden", padding: "0 30rpx", height: '100%', background: "#F8F8F8" }}
@@ -149,17 +149,17 @@ export default withLayout((props) => {
149 149
           scrollY
150 150
           style={{ height: '100%' }}
151 151
         >
152
-          <view className="storeDetails">
152
+          <view className='storeDetails'>
153 153
             <Swiper
154
-              className="swiper"
154
+              className='swiper'
155 155
               circular
156 156
               current={index}
157 157
               onChange={handchange}
158 158
             >
159 159
               {imglist.map((item) => (
160 160
                 <SwiperItem>
161
-                  <image src={item.url} mode='aspectFit' className="storeImage">
162
-                    <view className="tpPage">
161
+                  <image src={item.url} mode='aspectFit' className='storeImage'>
162
+                    <view className='tpPage'>
163 163
                       <text>
164 164
                         {index + 1}/{imglist.length}
165 165
                       </text>
@@ -168,13 +168,13 @@ export default withLayout((props) => {
168 168
                 </SwiperItem>
169 169
               ))}
170 170
             </Swiper>
171
-            <view className="storeJs">
171
+            <view className='storeJs'>
172 172
               <view style={{ overflow: "hidden" }}>
173
-                <view className="storeName">{detail.shopName}</view>
174
-                <view className="sprice">
175
-                  <text className="t1">¥</text>
173
+                <view className='storeName'>{detail.shopName}</view>
174
+                <view className='sprice'>
175
+                  <text className='t1'>¥</text>
176 176
                   {detail.averagePrice / 100}/人
177
-                  <view className="bzRight">
177
+                  <view className='bzRight'>
178 178
                     <image
179 179
                       src={baozan}
180 180
                       style={{
@@ -188,25 +188,25 @@ export default withLayout((props) => {
188 188
                   </view>
189 189
                 </view>
190 190
               </view>
191
-              <view className="appraise">
191
+              <view className='appraise'>
192 192
                 <Star star={star} />
193 193
                 {star}
194 194
                 <view style={{ float: "right", marginTop: "5px" }}>
195
-                  <text className="comment">点评:</text>
196
-                  <text className="t1">口味:{detail.sweetScore}</text>
197
-                  <text className="t1">环境:{detail.environmentScore}</text>
198
-                  <text className="t1">服务:{detail.serviceScore}</text>
195
+                  <text className='comment'>点评:</text>
196
+                  <text className='t1'>口味:{detail.sweetScore}</text>
197
+                  <text className='t1'>环境:{detail.environmentScore}</text>
198
+                  <text className='t1'>服务:{detail.serviceScore}</text>
199 199
                 </view>
200 200
               </view>
201
-              <view className="yysj">
202
-                <image src={yysj} className="yysjImg" />
201
+              <view className='yysj'>
202
+                <image src={yysj} className='yysjImg' />
203 203
                 营业时间:{detail.businessHours}
204 204
               </view>
205
-              <view className="dpPosition" onClick={openMap}>
206
-                <image src={dw} className="dwTip" />
205
+              <view className='dpPosition' onClick={openMap}>
206
+                <image src={dw} className='dwTip' />
207 207
                 <view>
208 208
                   {detail.address}
209
-                  <image src={zhuandao} className="zhuandao" />
209
+                  <image src={zhuandao} className='zhuandao' />
210 210
                 </view>
211 211
               </view>
212 212
             </view>
@@ -221,7 +221,7 @@ export default withLayout((props) => {
221 221
                     display: spackage == "" ? "none" : "",
222 222
                   }}
223 223
                 >
224
-                  <view className="title">
224
+                  <view className='title'>
225 225
                     <image src={titlezs} />
226 226
                     <text>返现套餐</text>
227 227
                   </view>
@@ -229,12 +229,12 @@ export default withLayout((props) => {
229 229
                     <Cards key={item.packageId} st={star} item={item} det={detail} />
230 230
                   ))}
231 231
                   <view
232
-                    className="showMore"
232
+                    className='showMore'
233 233
                     style={{ display: newpgNum == AllpgNum ? "none" : "" }}
234 234
                     onClick={pgMore}
235 235
                   >
236 236
                     <view>查看更多</view>
237
-                    <image src={showMore} className="moreTip" />
237
+                    <image src={showMore} className='moreTip' />
238 238
                   </view>
239 239
                 </view>
240 240
                 <view
@@ -244,7 +244,7 @@ export default withLayout((props) => {
244 244
                     display: extend == "" ? "none" : "",
245 245
                   }}
246 246
                 >
247
-                  <view className="title">
247
+                  <view className='title'>
248 248
                     <image src={titlezs} />
249 249
                     <text>本店指南</text>
250 250
                   </view>
@@ -252,16 +252,16 @@ export default withLayout((props) => {
252 252
                     <Extend key={item.extId} item={item} />
253 253
                   ))}
254 254
                   <view
255
-                    className="showMore"
255
+                    className='showMore'
256 256
                     style={{ display: newextNum == AllextNum ? "none" : "" }}
257 257
                     onClick={extendMore}
258 258
                   >
259 259
                     <view>查看更多</view>
260
-                    <image src={showMore} className="moreTip" />
260
+                    <image src={showMore} className='moreTip' />
261 261
                   </view>
262 262
                 </view>
263 263
                 <view
264
-                  className="botton"
264
+                  className='botton'
265 265
                   style={{ display: newextNum == AllextNum ? "" : "none" }}
266 266
                 >
267 267
                   这是我的底线
@@ -270,20 +270,20 @@ export default withLayout((props) => {
270 270
           }
271 271
         </scroll-view>
272 272
       </view>
273
-      <view className="bottomTab">
274
-        <Button openType="share" className="sharebtn">
273
+      <view className='bottomTab'>
274
+        <Button openType='share' className='sharebtn'>
275 275
           分享
276 276
         </Button>
277
-        <view className="tab">
278
-          <image className="share" src={share} />
277
+        <view className='tab'>
278
+          <image className='share' src={share} />
279 279
           分享
280 280
         </view>
281
-        <view className="tab" onClick={toggleLike}>
282
-          <image className="good" style={{ top: '1px' }} src={isLike > 0 ? baozan : weibaozan} />
281
+        <view className='tab' onClick={toggleLike}>
282
+          <image className='good' style={{ top: '1px' }} src={isLike > 0 ? baozan : weibaozan} />
283 283
           {isLike > 0 ? "已爆赞" : "爆赞"}
284 284
         </view>
285
-        <view className="tab" onClick={toggleSave}>
286
-          <image className="collection" src={isSaved > 0 ? ax : good} />
285
+        <view className='tab' onClick={toggleSave}>
286
+          <image className='collection' src={isSaved > 0 ? ax : good} />
287 287
           {isSaved > 0 ? "已收藏" : "加入收藏"}
288 288
         </view>
289 289
       </view>

+ 17
- 0
src/shop/pages/spread/Shoptabbar.js Vedi File

@@ -0,0 +1,17 @@
1
+
2
+const Shoptabbar = [
3
+
4
+  {
5
+    text: '订单收入',
6
+    iconPath: require('@/assets/icons/shopKeeper/orderOFF.png'),
7
+    selectedIconPath: require('@/assets/icons/shopKeeper/orderON.png'),
8
+  },
9
+  {
10
+    text: '推广收入',
11
+    iconPath: require('@/assets/icons/shopKeeper/spreadOFF.png'),
12
+    selectedIconPath: require('@/assets/icons/shopKeeper/spreadON.png'),
13
+  },
14
+
15
+]
16
+
17
+export default Shoptabbar

+ 8
- 14
src/shop/pages/spread/spreadIndex.jsx Vedi File

@@ -3,12 +3,9 @@ import CustomNav from '@/components/CustomNav'
3 3
 import { useRouter } from '@tarojs/taro'
4 4
 import { getShopList, getShopMoney, getAccount, getVerifiedOrder, setGetVerifiedOrder } from '@/services/shopBoss'
5 5
 
6
-import TabBar from '@/components/CustTabBar'
7
-import shopImg from '@/assets/icons/shopKeeper/orderOFF.png'
8
-import onShopImg from '@/assets/icons/shopKeeper/orderON.png'
9
-import spareadImg from '@/assets/icons/shopKeeper/spreadOFF.png'
10
-import onSpareadImg from '@/assets/icons/shopKeeper/spreadON.png'
6
+
11 7
 import withLayout from '@/layouts'
8
+import tabList from './Shoptabbar'
12 9
 import ShopKeeper from '../../components/ShopKeeper/shopKeeper'
13 10
 import Sparead from '../../components/Sparead/spreadMoney'
14 11
 
@@ -43,6 +40,7 @@ export default withLayout((props) => {
43 40
     }
44 41
   }
45 42
   const handelTypeOrder = () => {
43
+
46 44
     setAmountType('order')
47 45
 
48 46
   }
@@ -116,7 +114,7 @@ export default withLayout((props) => {
116 114
 
117 115
   return (
118 116
     <view className='page-index'>
119
-      <view className="index-navbar">
117
+      <view className='index-navbar'>
120 118
         <CustomNav title={shop?.shopName} />
121 119
       </view>
122 120
       <view className='index-container'>
@@ -125,14 +123,10 @@ export default withLayout((props) => {
125 123
         {currentTab === 1 && <Sparead shopList={shopList} shop={shop} verifiedOrder={verifiedOrder} onHotelChange={handleHotelChange} shopMoney={shopMoney} />}
126 124
       </view>
127 125
       <view className='index-tabbar'>
128
-        <TabBar extClass='custom-tabbar bottomTab' current={currentTab} onChange={handleTabChange}>
129
-          <view className={`${currentTab === 0 ? 'orderstab' : ''}`} onClick={() => { handelTypeOrder() }}>
130
-            <image className='incomes' src={currentTab === 0 ? onShopImg : shopImg} /><text>订单收入</text>
131
-          </view>
132
-          <view className={`${currentTab === 1 ? 'spreadtab' : ''}`} onClick={() => { handelType() }} >
133
-            <image className='house' src={currentTab === 1 ? onSpareadImg : spareadImg} /><text>推广收入</text>
134
-          </view>
135
-        </TabBar>
126
+
127
+      </view>
128
+      <view className='index-tabbar'>
129
+        <mp-tabbar extClass='custom-tabbar' current={currentTab} list={tabList} onChange={handleTabChange}></mp-tabbar>
136 130
       </view>
137 131
     </view>
138 132