李志伟 3 lat temu
rodzic
commit
90fba8a17c

+ 3
- 25
src/components/Landlord/Income/income.jsx Wyświetl plik

@@ -13,6 +13,7 @@ import hotelBossON from '@/assets/icons/UserCenter/hotelBossON.png'
13 13
 import hotelBossOFF from '@/assets/icons/UserCenter/hotelBossOFF.png'
14 14
 import shopBossON from '@/assets/icons/UserCenter/shopBossON.png'
15 15
 import shopBossOFF from '@/assets/icons/UserCenter/shopBossOFF.png'
16
+import  ToggleRoul  from  '@/components/toggleRoul/ToggleRoul'
16 17
 
17 18
 
18 19
 export default (props) => {
@@ -20,38 +21,15 @@ export default (props) => {
20 21
   const ShowMoldeOn = () => {
21 22
     setShowCutover(true)
22 23
   }
23
-  const ok = () => {
24
+  const onClose = () => {
24 25
     setShowCutover(false)
25 26
   }
26
-  const gotoShop = () => {
27
-    Taro.redirectTo({ url: '/shop/pages/spread/spreadIndex' })
28
-  }
29
-  const gotoPerson = () => {
30
-    Taro.redirectTo({ url: '/pages/index/index' })
31
-  }
32 27
   return (
33 28
     <view>
34 29
       <view>
35 30
         <CustomNav title='十公里' />
36 31
       </view>
37
-      <Popup show={showCutover} maskClosable={false}>
38
-          <view className='User-box-sths' >
39
-            <view className='User-box-selectUser'>请选择身份:</view>
40
-            <view className='User-box-tourist' onClick={gotoPerson}>
41
-              <image className='Ubs-tourist-image' src={touristOFF} />
42
-              <text className='Ubs-tourist-text'>游客</text>
43
-            </view>
44
-            <view className='User-box-hotelBoss' onClick={ok}>
45
-              <image className='Ubs-hotelBoss-image' src={hotelBossON} />
46
-              <text className='Ubs-hotelBoss-text'>民宿老板</text>
47
-
48
-            </view>
49
-            <view className='User-box-shopBoss' onClick={gotoShop}>
50
-              <image className='Ubs-shopBoss-image' src={shopBossOFF} />
51
-              <text className='Ubs-shopBoss-text'>店铺老板</text>
52
-            </view>
53
-          </view>
54
-        </Popup>     
32
+      <ToggleRoul showCutover={showCutover} onClose={onClose} />
55 33
       <view style={{ padding: '30rpx', height: '100%' }}>
56 34
         <scroll-view scroll-y="true" scroll-view='true' bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll" style={{ height: 'calc(100vh - 120px)' }}>
57 35
           <view className='storexx'>

+ 4
- 28
src/components/spreads/ShopKeeper/shopKeeper.jsx Wyświetl plik

@@ -14,6 +14,7 @@ import hotelBossOFF from '@/assets/icons/UserCenter/hotelBossOFF.png'
14 14
 import shopBossON from '@/assets/icons/UserCenter/shopBossON.png'
15 15
 import shopBossOFF from '@/assets/icons/UserCenter/shopBossOFF.png'
16 16
 import './shopKeeper.less'
17
+import  ToggleRoul  from  '@/components/toggleRoul/ToggleRoul'
17 18
 
18 19
 
19 20
 export default (props) => {
@@ -44,41 +45,16 @@ export default (props) => {
44 45
   const ShowMoldeOn = () => {
45 46
     setShowCutover(true)
46 47
   }
47
-  const ok = () => {
48
+  const onClose = () => {
48 49
     setShowCutover(false)
49 50
   }
50
-  const goToHotel = () => {
51
-    Taro.redirectTo({ url: '/hotel/pages/landlord/landlord' })
52
-  }
53
-  const gotoPerson = () => {
54
-    Taro.redirectTo({ url: '/pages/index/index' })
55
-  }
56 51
   return (
57 52
     <view>
58 53
       <view>
59 54
         <CustomNav title='十公里' />
60 55
       </view>
61
-      <Popup show={showCutover} maskClosable={false}>
62
-          <view className='User-box-sths' >
63
-            <view className='User-box-selectUser'>请选择身份:</view>
64
-            <view className='User-box-tourist' onClick={gotoPerson}>
65
-              <image className='Ubs-tourist-image' src={touristOFF} />
66
-              <text className='Ubs-tourist-text'>游客</text>
67
-            </view>
68
-            <view className='User-box-hotelBoss' onClick={goToHotel}>
69
-              <image className='Ubs-hotelBoss-image' src={hotelBossOFF} />
70
-              <text className='Ubs-hotelBoss-text'>民宿老板</text>
71
-
72
-            </view>
73
-            <view className='User-box-shopBoss' onClick={ok}>
74
-              <image className='Ubs-shopBoss-image' src={shopBossON} />
75
-              <text className='Ubs-shopBoss-text'>店铺老板</text>
76
-
77
-            </view>
78
-          </view>
79
-
80
-        </Popup>
81
-        
56
+      <ToggleRoul showCutover={showCutover} onClose={onClose} />
57
+  
82 58
       <view style={{ padding: '30rpx', height: '100%' }}>
83 59
         <scroll-view scroll-y="true" scroll-view='true' bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll" style={{ height: 'calc(100vh - 120px)' }}>
84 60
           <view className='storexx'>

+ 2
- 2
src/layouts/index.jsx Wyświetl plik

@@ -18,12 +18,12 @@ export default (Child) => (props) => {
18 18
     const personRole = person?.personRole;
19 19
     if (!personRole) return;
20 20
 
21
-    const isNormalPerson = personRole === 'person'
21
+    const isNormalPerson = personRole === 'normal'
22 22
 
23 23
     const currentPage = getPageBy(router.path)
24 24
     let indexPage = getIndexPageOf(personRole)
25 25
     if (!isNormalPerson) {
26
-      indexPage = `${personRole}/${indexPage}`
26
+      indexPage = `${personRole}/${indexPage.page}`
27 27
     }
28 28
 
29 29
     const isMatched = isNormalPerson ?

+ 7
- 2
src/pages/index/tabs/Mine.jsx Wyświetl plik

@@ -18,6 +18,8 @@ import cutoverUser from '@/assets/icons/UserCenter/cutoverUser.png'
18 18
 import SwitchSelect from '@/components/SwitchSelect'
19 19
 import { useModel } from '@/store'
20 20
 import './MineCss/style.less'
21
+import  ToggleRoul  from  '@/components/toggleRoul/ToggleRoul'
22
+
21 23
 
22 24
 
23 25
 
@@ -32,7 +34,10 @@ export default (props) => {
32 34
   // console.log("🚀 ~ file: Mine.jsx ~ line 31 ~ hidePhone", hidePhone)
33 35
 
34 36
   const ShowMoldeOn = () => {
35
-    setShowCutover(!showCutover)
37
+    setShowCutover(true)
38
+  }
39
+  const onClose = () => {
40
+    setShowCutover(false)
36 41
   }
37 42
 
38 43
   // 通过getUserProfile获取微信用户信息
@@ -103,7 +108,7 @@ export default (props) => {
103 108
 
104 109
       <view className='User-box'>
105 110
         {/* 身份切换 */}
106
-        <SwitchSelect show={showCutover} maskClosable />
111
+        <ToggleRoul showCutover={showCutover} onClose={onClose} />
107 112
         <view className='User-info'>
108 113
           <view className='User-photos-box'>
109 114
             <image src={person.avatar || { DefaultImage }} className='User-photos' />