吃个甘蔗嚼一年 3 年之前
父節點
當前提交
43bac9e2c7

+ 0
- 39
src/components/CustTabBar/index.jsx 查看文件

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 查看文件

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

+ 18
- 0
src/hotel/pages/landlord/Roomtabbar.js 查看文件

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 查看文件

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

+ 37
- 37
src/pages/details/foodDetails/foodDetails.jsx 查看文件

138
   });
138
   });
139
 
139
 
140
   return (
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
       </view>
144
       </view>
145
       <view
145
       <view
146
         style={{ overflow: "hidden", padding: "0 30rpx", height: '100%', background: "#F8F8F8" }}
146
         style={{ overflow: "hidden", padding: "0 30rpx", height: '100%', background: "#F8F8F8" }}
149
           scrollY
149
           scrollY
150
           style={{ height: '100%' }}
150
           style={{ height: '100%' }}
151
         >
151
         >
152
-          <view className="storeDetails">
152
+          <view className='storeDetails'>
153
             <Swiper
153
             <Swiper
154
-              className="swiper"
154
+              className='swiper'
155
               circular
155
               circular
156
               current={index}
156
               current={index}
157
               onChange={handchange}
157
               onChange={handchange}
158
             >
158
             >
159
               {imglist.map((item) => (
159
               {imglist.map((item) => (
160
                 <SwiperItem>
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
                       <text>
163
                       <text>
164
                         {index + 1}/{imglist.length}
164
                         {index + 1}/{imglist.length}
165
                       </text>
165
                       </text>
168
                 </SwiperItem>
168
                 </SwiperItem>
169
               ))}
169
               ))}
170
             </Swiper>
170
             </Swiper>
171
-            <view className="storeJs">
171
+            <view className='storeJs'>
172
               <view style={{ overflow: "hidden" }}>
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
                   {detail.averagePrice / 100}/人
176
                   {detail.averagePrice / 100}/人
177
-                  <view className="bzRight">
177
+                  <view className='bzRight'>
178
                     <image
178
                     <image
179
                       src={baozan}
179
                       src={baozan}
180
                       style={{
180
                       style={{
188
                   </view>
188
                   </view>
189
                 </view>
189
                 </view>
190
               </view>
190
               </view>
191
-              <view className="appraise">
191
+              <view className='appraise'>
192
                 <Star star={star} />
192
                 <Star star={star} />
193
                 {star}
193
                 {star}
194
                 <view style={{ float: "right", marginTop: "5px" }}>
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
                 </view>
199
                 </view>
200
               </view>
200
               </view>
201
-              <view className="yysj">
202
-                <image src={yysj} className="yysjImg" />
201
+              <view className='yysj'>
202
+                <image src={yysj} className='yysjImg' />
203
                 营业时间:{detail.businessHours}
203
                 营业时间:{detail.businessHours}
204
               </view>
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
                 <view>
207
                 <view>
208
                   {detail.address}
208
                   {detail.address}
209
-                  <image src={zhuandao} className="zhuandao" />
209
+                  <image src={zhuandao} className='zhuandao' />
210
                 </view>
210
                 </view>
211
               </view>
211
               </view>
212
             </view>
212
             </view>
221
                     display: spackage == "" ? "none" : "",
221
                     display: spackage == "" ? "none" : "",
222
                   }}
222
                   }}
223
                 >
223
                 >
224
-                  <view className="title">
224
+                  <view className='title'>
225
                     <image src={titlezs} />
225
                     <image src={titlezs} />
226
                     <text>返现套餐</text>
226
                     <text>返现套餐</text>
227
                   </view>
227
                   </view>
229
                     <Cards key={item.packageId} st={star} item={item} det={detail} />
229
                     <Cards key={item.packageId} st={star} item={item} det={detail} />
230
                   ))}
230
                   ))}
231
                   <view
231
                   <view
232
-                    className="showMore"
232
+                    className='showMore'
233
                     style={{ display: newpgNum == AllpgNum ? "none" : "" }}
233
                     style={{ display: newpgNum == AllpgNum ? "none" : "" }}
234
                     onClick={pgMore}
234
                     onClick={pgMore}
235
                   >
235
                   >
236
                     <view>查看更多</view>
236
                     <view>查看更多</view>
237
-                    <image src={showMore} className="moreTip" />
237
+                    <image src={showMore} className='moreTip' />
238
                   </view>
238
                   </view>
239
                 </view>
239
                 </view>
240
                 <view
240
                 <view
244
                     display: extend == "" ? "none" : "",
244
                     display: extend == "" ? "none" : "",
245
                   }}
245
                   }}
246
                 >
246
                 >
247
-                  <view className="title">
247
+                  <view className='title'>
248
                     <image src={titlezs} />
248
                     <image src={titlezs} />
249
                     <text>本店指南</text>
249
                     <text>本店指南</text>
250
                   </view>
250
                   </view>
252
                     <Extend key={item.extId} item={item} />
252
                     <Extend key={item.extId} item={item} />
253
                   ))}
253
                   ))}
254
                   <view
254
                   <view
255
-                    className="showMore"
255
+                    className='showMore'
256
                     style={{ display: newextNum == AllextNum ? "none" : "" }}
256
                     style={{ display: newextNum == AllextNum ? "none" : "" }}
257
                     onClick={extendMore}
257
                     onClick={extendMore}
258
                   >
258
                   >
259
                     <view>查看更多</view>
259
                     <view>查看更多</view>
260
-                    <image src={showMore} className="moreTip" />
260
+                    <image src={showMore} className='moreTip' />
261
                   </view>
261
                   </view>
262
                 </view>
262
                 </view>
263
                 <view
263
                 <view
264
-                  className="botton"
264
+                  className='botton'
265
                   style={{ display: newextNum == AllextNum ? "" : "none" }}
265
                   style={{ display: newextNum == AllextNum ? "" : "none" }}
266
                 >
266
                 >
267
                   这是我的底线
267
                   这是我的底线
270
           }
270
           }
271
         </scroll-view>
271
         </scroll-view>
272
       </view>
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
         </Button>
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
         </view>
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
           {isLike > 0 ? "已爆赞" : "爆赞"}
283
           {isLike > 0 ? "已爆赞" : "爆赞"}
284
         </view>
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
           {isSaved > 0 ? "已收藏" : "加入收藏"}
287
           {isSaved > 0 ? "已收藏" : "加入收藏"}
288
         </view>
288
         </view>
289
       </view>
289
       </view>

+ 17
- 0
src/shop/pages/spread/Shoptabbar.js 查看文件

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 查看文件

3
 import { useRouter } from '@tarojs/taro'
3
 import { useRouter } from '@tarojs/taro'
4
 import { getShopList, getShopMoney, getAccount, getVerifiedOrder, setGetVerifiedOrder } from '@/services/shopBoss'
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
 import withLayout from '@/layouts'
7
 import withLayout from '@/layouts'
8
+import tabList from './Shoptabbar'
12
 import ShopKeeper from '../../components/ShopKeeper/shopKeeper'
9
 import ShopKeeper from '../../components/ShopKeeper/shopKeeper'
13
 import Sparead from '../../components/Sparead/spreadMoney'
10
 import Sparead from '../../components/Sparead/spreadMoney'
14
 
11
 
43
     }
40
     }
44
   }
41
   }
45
   const handelTypeOrder = () => {
42
   const handelTypeOrder = () => {
43
+
46
     setAmountType('order')
44
     setAmountType('order')
47
 
45
 
48
   }
46
   }
116
 
114
 
117
   return (
115
   return (
118
     <view className='page-index'>
116
     <view className='page-index'>
119
-      <view className="index-navbar">
117
+      <view className='index-navbar'>
120
         <CustomNav title={shop?.shopName} />
118
         <CustomNav title={shop?.shopName} />
121
       </view>
119
       </view>
122
       <view className='index-container'>
120
       <view className='index-container'>
125
         {currentTab === 1 && <Sparead shopList={shopList} shop={shop} verifiedOrder={verifiedOrder} onHotelChange={handleHotelChange} shopMoney={shopMoney} />}
123
         {currentTab === 1 && <Sparead shopList={shopList} shop={shop} verifiedOrder={verifiedOrder} onHotelChange={handleHotelChange} shopMoney={shopMoney} />}
126
       </view>
124
       </view>
127
       <view className='index-tabbar'>
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
       </view>
130
       </view>
137
     </view>
131
     </view>
138
 
132