李志伟 3 years ago
parent
commit
75aedea1d0

+ 9
- 1
src/pages/index/components/User/index.jsx View File

1
+import Taro from "@tarojs/taro"
1
 import { View, Image, ScrollView } from "@tarojs/components"
2
 import { View, Image, ScrollView } from "@tarojs/components"
2
 import userBgi from '@/assets/user/userBgi.png'
3
 import userBgi from '@/assets/user/userBgi.png'
3
 import avatar from '@/assets/user/defaultAvatar.png'
4
 import avatar from '@/assets/user/defaultAvatar.png'
21
   const handleAboutUs = () => { }
22
   const handleAboutUs = () => { }
22
   const handleUpdate = () => { }
23
   const handleUpdate = () => { }
23
   const handleFeedback = () => { }
24
   const handleFeedback = () => { }
24
-  const handleLogin = () => { setIsLogin(true) }
25
+  const handleLogin = () => { 
26
+    Taro.navigateTo({ url: '/pages/login/index' });
27
+    // setIsLogin(true) 
28
+  }
25
   const goMachinery = () => { }
29
   const goMachinery = () => { }
26
   const goWallet = () => { }
30
   const goWallet = () => { }
27
   const goBank = () => { }
31
   const goBank = () => { }
28
   const signOut = () => { setIsLogin(false) }
32
   const signOut = () => { setIsLogin(false) }
29
   return (
33
   return (
30
     <ScrollView scrollY style={{ height: '100%' }}>
34
     <ScrollView scrollY style={{ height: '100%' }}>
35
+      {
36
+        islogin &&
37
+        <View className='personTip'>该账号归张三所属</View>
38
+      }
31
       <View className='userHead'>
39
       <View className='userHead'>
32
         <Image src={userBgi} className='userBgi' />
40
         <Image src={userBgi} className='userBgi' />
33
         <View className='headcontent' onClick={handleLogin}>
41
         <View className='headcontent' onClick={handleLogin}>

+ 13
- 0
src/pages/index/components/User/style.less View File

1
+.personTip{
2
+  font-size: 24px;
3
+  color: #FFFFFF;
4
+  width: 247px;
5
+  height: 54px;
6
+  background: #000000;
7
+  opacity: 0.3;
8
+  position: absolute;
9
+  text-align: center;
10
+  line-height: 54px;
11
+  top: 0;
12
+  right: 0;
13
+}
1
 .userHead{
14
 .userHead{
2
   width: 100%;
15
   width: 100%;
3
   height: 50vw;
16
   height: 50vw;

+ 7
- 0
src/pages/login/index.config.js View File

1
+export default {
2
+  navigationBarTitleText: '登录',
3
+  navigationStyle: 'custom',
4
+  styleIsolation: 'shared',
5
+  enableShareAppMessage: true,
6
+  disableScroll: true,
7
+}

+ 19
- 0
src/pages/login/index.jsx View File

1
+import { View, Image } from "@tarojs/components"
2
+import CustomNav from "@/components/CustomNav"
3
+import bgi from '@/assets/login/loginImg.png'
4
+import './style.less'
5
+
6
+export default (props) => {
7
+  return (
8
+    <View className='page-index'>
9
+      <View className='index-navbar'>
10
+        <CustomNav title='登录' />
11
+      </View>
12
+      <Image src={bgi} className='loginBgi' />
13
+      <View className='index-container loginContent'>
14
+        <View className='title1'>您好!</View>
15
+        <View className='title2'>欢迎进入农机手端小程序!</View>
16
+      </View>
17
+    </View>
18
+  )
19
+}

+ 20
- 0
src/pages/login/style.less View File

1
+.loginBgi{
2
+  width: 100%;
3
+  height: 100%;
4
+  position: absolute;
5
+  top: 0;
6
+}
7
+.loginContent{
8
+  padding: 60px 30px;
9
+  color: #333333;
10
+  font-weight: bold;
11
+  .title1{
12
+    padding: 40px 0;
13
+    font-size: 66px;
14
+    letter-spacing: 10px;
15
+  }
16
+  .title2{
17
+    font-size: 54px;
18
+    letter-spacing: 10px;
19
+  }
20
+}

+ 4
- 0
src/routes.js View File

14
     title: '详情',
14
     title: '详情',
15
     page: 'pages/orderDetail/index',
15
     page: 'pages/orderDetail/index',
16
   },
16
   },
17
+  {
18
+    title: '登录',
19
+    page: 'pages/login/index',
20
+  },
17
   
21
   
18
 ];
22
 ];
19
 
23