Browse Source

切换账户

吃个甘蔗嚼一年 3 years ago
parent
commit
7c21dfd537

BIN
src/assets/icons/UserCenter/cutoverUser.png View File


BIN
src/assets/icons/UserCenter/hotelBossOFF.png View File


BIN
src/assets/icons/UserCenter/hotelBossON.png View File


BIN
src/assets/icons/UserCenter/shopBossOFF.png View File


BIN
src/assets/icons/UserCenter/shopBossON.png View File


BIN
src/assets/icons/UserCenter/touristOFF.png View File


BIN
src/assets/icons/UserCenter/touristON.png View File


+ 0
- 3
src/pages/TobeShop/index.jsx View File

@@ -12,9 +12,6 @@ import image from '@/assets/icons/ProCard/8kb.jpg'
12 12
 import food from '@/assets/icons/ProCard/food.png'
13 13
 import ProCard_hot from '@/assets/icons/ProCard/ProCard_hot.png'
14 14
 import { Button, Icon, Text, Textarea } from '@tarojs/components'
15
-
16
-
17
-
18 15
 import './style.less'
19 16
 
20 17
 

+ 6
- 2
src/pages/index/index.config.js View File

@@ -3,7 +3,11 @@ export default {
3 3
   navigationStyle: 'custom',
4 4
   styleIsolation: 'shared',
5 5
   usingComponents: {
6
-    "mp-tabbar": "weui-miniprogram/tabbar/tabbar",    
7
-    "mp-tabs": "../../../components/tabs/index"
6
+    "mp-tabbar": "weui-miniprogram/tabbar/tabbar",
7
+    "mp-tabs": "../../../components/tabs/index",
8
+    "mp-checkbox-group": "weui-miniprogram/checkbox-group/checkbox-group",
9
+    "mp-checkbox": "weui-miniprogram/checkbox/checkbox",
10
+    "mp-cells": "weui-miniprogram/cells/cells",
11
+    "mp-dialog": "weui-miniprogram/dialog/dialog"
8 12
   }
9 13
 }

+ 50
- 4
src/pages/index/tabs/Mine.jsx View File

@@ -1,7 +1,8 @@
1
-import React from 'react'
1
+
2
+import { useState } from 'react'
2 3
 import Taro from '@tarojs/taro'
3 4
 import withLayout from '@/layouts'
4
-
5
+import Popup from '@/components/Popup'
5 6
 import AuthPage from '@/components/AuthPage'
6 7
 import boy from '@/assets/icons/UserCenter/boy.png'
7 8
 import awaitPay from '@/assets/icons/UserCenter/awaitPay.png'
@@ -12,19 +13,38 @@ import HomeLogo from '@/assets/icons/UserCenter/HomeLogo.png'
12 13
 import ContactMe from '@/assets/icons/UserCenter/ContactMe.png'
13 14
 import collect from '@/assets/icons/UserCenter/collect.png'
14 15
 import Rules from '@/assets/icons/UserCenter/Rules.png'
15
-import Userrrrrrr from '@/assets/icons/ProCard/8kb.jpg'
16
+import UserImages from '@/assets/icons/ProCard/8kb.jpg'
17
+import cutoverUser from '@/assets/icons/UserCenter/cutoverUser.png'
18
+import touristON from '@/assets/icons/UserCenter/touristON.png'
19
+import touristOFF from '@/assets/icons/UserCenter/touristOFF.png'
20
+import hotelBossON from '@/assets/icons/UserCenter/hotelBossON.png'
21
+import hotelBossOFF from '@/assets/icons/UserCenter/hotelBossOFF.png'
22
+import shopBossON from '@/assets/icons/UserCenter/shopBossON.png'
23
+import shopBossOFF from '@/assets/icons/UserCenter/shopBossOFF.png'
16 24
 import './MineCss/style.less'
17 25
 
18 26
 
19 27
 
20 28
 export default withLayout((props) => {
21 29
   const { router, person } = props
30
+  const [showCutover, setShowCutover] = useState(false)
22 31
 
23 32
   // // 我的行程 
24 33
   // const HomeLogo = () => {
25 34
   //   Taro.navigateTo({ url: '/pages/MineUserAll/Rules/index' })
26 35
   // }
27 36
 
37
+
38
+  const ShowMoldeOn = () => {
39
+    setShowCutover(true)
40
+  }
41
+  const ok = () => {
42
+    setShowCutover(false)
43
+  }
44
+
45
+
46
+
47
+
28 48
   // 待支付
29 49
   const handleTobePaid = () => {
30 50
     Taro.navigateTo({ url: '/pages/MineUserAll/AllOrder/index?tabJump=1' })
@@ -60,17 +80,43 @@ export default withLayout((props) => {
60 80
     Taro.navigateTo({ url: '/pages/MineUserAll/Rules/index' })
61 81
   }
62 82
 
83
+
63 84
   return !person.phone ? <AuthPage /> : (
64 85
     <scroll-view scroll-y style='height: 77vh;' >
65 86
       <view className='User-box'>
87
+        {/* 身份切换 */}
88
+        <Popup show={showCutover} maskClosable={false}>
89
+          <view className='User-box-sths' >
90
+            <view className='User-box-selectUser'>请选择身份:</view>
91
+            <view className='User-box-tourist'>
92
+              <image className='Ubs-tourist-image' src={touristON} />
93
+              <text className='Ubs-tourist-text'>游客</text>
94
+            </view>
95
+            <view className='User-box-hotelBoss'>
96
+              <image className='Ubs-hotelBoss-image' src={hotelBossOFF} />
97
+              <text className='Ubs-hotelBoss-text'>民宿老板</text>
98
+
99
+            </view>
100
+            <view className='User-box-shopBoss'>
101
+              <image className='Ubs-shopBoss-image' src={shopBossOFF} />
102
+              <text className='Ubs-shopBoss-text'>店铺老板</text>
103
+
104
+            </view>
105
+          </view>
106
+
107
+        </Popup>
66 108
         <view className='User-info'>
67 109
           <view className='User-photos-box'>
68
-            <image src={Userrrrrrr} className='User-photos' />
110
+            <image src={UserImages} className='User-photos' />
69 111
           </view>
70 112
           <view className='User-info-all'>
71 113
             <view className='User-name'>福西西<image className='User-sex' src={boy} /></view>
72 114
             <view className='User-phone'>136****9434</view>
73 115
           </view>
116
+          {/* 切换身份 */}
117
+          <view onClick={ShowMoldeOn} className='User-info-cutover'>
118
+            <image className='User-info-cutover-image' src={cutoverUser} />
119
+          </view>
74 120
         </view>
75 121
         {/* 用户信息结束 */}
76 122
         <view className='buy-list-box'>

+ 73
- 0
src/pages/index/tabs/MineCss/style.less View File

@@ -1,5 +1,64 @@
1
+
2
+
1 3
 .User-box {
2 4
   width: 100%;
5
+  .User-box-sths{
6
+    display: flex;
7
+    margin: 40px 0  60px 0;
8
+    justify-content: space-around;
9
+    flex-wrap: wrap;
10
+    .User-box-selectUser{
11
+      width: 100%;
12
+      font-size: 32px;
13
+      font-weight: bold;
14
+      color: #202020;
15
+      line-height: 32px;
16
+      margin: 60px 0 70px  0;
17
+      text-align: left;
18
+    }
19
+    .User-box-tourist{
20
+      display: inline-block;
21
+
22
+       .Ubs-tourist-image{
23
+        width: 86px;
24
+        height: 86px;
25
+  
26
+      }
27
+      .Ubs-tourist-text{
28
+        display: block;
29
+        font-size: 30px;
30
+        font-weight: bold;
31
+        color:#202020;
32
+      }
33
+    }
34
+    .User-box-hotelBoss{
35
+      display: inline-block;
36
+      .Ubs-hotelBoss-image{
37
+        width: 86px;
38
+        height: 86px;
39
+      }
40
+      .Ubs-hotelBoss-text{
41
+        display: block;
42
+        font-size: 30px;
43
+        font-weight: bold;
44
+        color: #999999;
45
+      }
46
+    }
47
+    .User-box-shopBoss{
48
+      .Ubs-shopBoss-image{
49
+        width: 86px;
50
+        height: 86px;
51
+      }
52
+      .Ubs-shopBoss-text{
53
+        display: block;
54
+        font-size: 30px;
55
+        font-weight: bold;
56
+        color: #999999;
57
+      }
58
+    }
59
+
60
+  }
61
+
3 62
   .User-info {
4 63
     width: 90%;
5 64
     align-items: center;
@@ -37,6 +96,20 @@
37 96
         line-height: 48px;
38 97
       }
39 98
     }
99
+    .User-info-cutover{
100
+      width: 62px;
101
+      height: 62px;
102
+      align-items: center;
103
+      display: flex;
104
+      position: relative;
105
+      left: 8em;
106
+      .User-info-cutover-image{
107
+        width: 36px;
108
+        height: 36px;
109
+        margin: 0 auto;
110
+
111
+      }
112
+    }
40 113
   }
41 114
 
42 115
   .buy-list-box {

+ 3
- 3
src/pages/test/index.config.js View File

@@ -1,4 +1,4 @@
1 1
 export default {
2
-    navigationBarTitleText: '测试页',
3
-    navigationStyle: 'custom',
4
-  }
2
+  navigationBarTitleText: '测试页',
3
+  navigationStyle: 'custom',
4
+}