李志伟 3 年之前
父節點
當前提交
bf9cc1d934

+ 18
- 0
src/components/Jianbian/index.jsx 查看文件

@@ -0,0 +1,18 @@
1
+import { View } from '@tarojs/components'
2
+import './style.less'
3
+
4
+export default (props) => {
5
+  const { status } = props
6
+  return (
7
+    <View className={['jianbian',
8
+      status == 1 ? 'waitClass' :
9
+        status == 2 ? 'workingClass' :
10
+          status == 3 ? 'overClass' : ''
11
+    ]}
12
+    >
13
+      <View className='text'>
14
+        {status == 1 ? '待作业' : status == 2 ? '进行中' : status == 3 ? '已完成' : ''}
15
+      </View>
16
+    </View>
17
+  )
18
+}

+ 29
- 0
src/components/Jianbian/style.less 查看文件

@@ -0,0 +1,29 @@
1
+.jianbian{
2
+  width: 225px;
3
+  height: 217px;
4
+  border-radius: 137px;
5
+  position: absolute;
6
+  left: -134px;
7
+  top: -122px;
8
+  .text{
9
+    transform:rotate(-45deg);
10
+    font-size: 28px;
11
+    font-weight: bold;
12
+    color: #FFFFFF;
13
+    position: relative;
14
+    top: 92px;
15
+    left: 108px;
16
+  }
17
+}
18
+.waitClass{
19
+  background: linear-gradient(-30deg, #FFAB8C, #FF703B);
20
+  border: 1px solid #FFC937;
21
+}
22
+.workingClass{
23
+  background: linear-gradient(-30deg, #00AE39, #A0E067);
24
+  border: 1px solid #06B03B;
25
+}
26
+.overClass{
27
+  background: linear-gradient(-30deg, #8F8F8F, #C0C0C0);
28
+  border: 1px solid #C7C7C7;
29
+}

+ 2
- 3
src/components/MyCard/index.jsx 查看文件

@@ -1,5 +1,6 @@
1 1
 import Taro from "@tarojs/taro"
2 2
 import { View, Text } from '@tarojs/components'
3
+import Jianbian from "@/components/Jianbian"
3 4
 import MyCell from "../MyCell"
4 5
 import MyButton from "../MyButton"
5 6
 import './style.less'
@@ -14,9 +15,7 @@ export default (props) => {
14 15
   }
15 16
   return (
16 17
     <View className='card'>
17
-      <View className='jianbian'>
18
-        <View className='text'>待作业</View>
19
-      </View>
18
+      <Jianbian status='1' />
20 19
       <View className='cardHead'>
21 20
         {
22 21
           job && <MyCell header='需求时间' job action='详情>>' handleAction={handleClick}>2022-06-02</MyCell>

+ 0
- 19
src/components/MyCard/style.less 查看文件

@@ -5,25 +5,6 @@
5 5
   position: relative;
6 6
   overflow: hidden;
7 7
   padding: 40px;
8
-  .jianbian{
9
-    width: 225px;
10
-    height: 217px;
11
-    background: linear-gradient(-30deg, #FFAB8C, #FF703B);
12
-    border-radius: 137px;
13
-    border: 1px solid #FFC937;
14
-    position: absolute;
15
-    left: -134px;
16
-    top: -122px;
17
-    .text{
18
-      transform:rotate(-45deg);
19
-      font-size: 28px;
20
-      font-weight: bold;
21
-      color: #FFFFFF;
22
-      position: relative;
23
-      top: 92px;
24
-      left: 108px;
25
-    }
26
-  }
27 8
   .cardHead{
28 9
     width: 100%;
29 10
     padding: 5px 0 0 38px;

+ 6
- 2
src/pages/index/components/User/index.jsx 查看文件

@@ -17,14 +17,18 @@ import './style.less'
17 17
 
18 18
 export default (props) => {
19 19
   const { isLogin } = props
20
-  const handleAccount = () => { console.log(5555) }
20
+  const handleAccount = () => { 
21
+    
22
+   }
21 23
   const handleAboutUs = () => { }
22 24
   const handleUpdate = () => { }
23 25
   const handleFeedback = () => { }
24 26
   const handleLogin = () => { 
25 27
     Taro.navigateTo({ url: '/pages/login/index' });
26 28
   }
27
-  const goMachinery = () => { }
29
+  const goMachinery = () => {
30
+    Taro.navigateTo({ url: '/pages/machineryList/index' });
31
+   }
28 32
   const goWallet = () => { }
29 33
   const goBank = () => { }
30 34
   const signOut = () => { 

+ 15
- 0
src/pages/machineryList/Card/index.jsx 查看文件

@@ -0,0 +1,15 @@
1
+import { View,Image } from "@tarojs/components"
2
+import Jianbian from "@/components/Jianbian"
3
+import banner1 from '@/assets/banner/2.jpg'
4
+import './style.less'
5
+
6
+export default (props) => {
7
+  const {onClick}=props
8
+  return (
9
+  <View className='machineryCard' onClick={onClick}>
10
+    <Jianbian status='1' />
11
+    <Image src={banner1} mode='aspectFill' />
12
+    <View className='machineryName'>收割机001--S01</View>
13
+  </View>
14
+  )
15
+}

+ 19
- 0
src/pages/machineryList/Card/style.less 查看文件

@@ -0,0 +1,19 @@
1
+.machineryCard{
2
+  height: 594px;
3
+  background: #FFF;
4
+  box-shadow: 0px 0px 44px 0px rgba(0, 0, 0, 0.08);
5
+  border-radius: 40px;
6
+  position: relative;
7
+  overflow: hidden;
8
+  margin: 30px;
9
+  Image{
10
+    height: calc(calc(100vw - 60px) * 0.66);
11
+    width: 100%;
12
+  }
13
+  .machineryName{
14
+    font-size: 36px;
15
+    font-weight: bold;
16
+    color: #222222;
17
+    margin: 39px 0 0 28px;
18
+  }
19
+}

+ 7
- 0
src/pages/machineryList/index.config.js 查看文件

@@ -0,0 +1,7 @@
1
+export default {
2
+  navigationBarTitleText: '农机列表',
3
+  navigationStyle: 'custom',
4
+  styleIsolation: 'shared',
5
+  enableShareAppMessage: true,
6
+  disableScroll: true,
7
+}

+ 24
- 0
src/pages/machineryList/index.jsx 查看文件

@@ -0,0 +1,24 @@
1
+import { View, ScrollView } from "@tarojs/components"
2
+import CustomNav from "@/components/CustomNav"
3
+import MachineryCard from './Card'
4
+import './style.less'
5
+
6
+export default (props) => {
7
+  const goMap=()=>{
8
+    console.log(666)
9
+  }
10
+  return (
11
+    <View className='page-index'>
12
+      <View className='index-navbar'>
13
+        <CustomNav title='农机列表' />
14
+      </View>
15
+      <View className='index-container machineryListContent'>
16
+        <ScrollView scrollY style={{ height: '100%' }}>
17
+          <MachineryCard onClick={()=>goMap()} />
18
+          <MachineryCard />
19
+          <MachineryCard />
20
+        </ScrollView>
21
+      </View>
22
+    </View>
23
+  )
24
+}

+ 3
- 0
src/pages/machineryList/style.less 查看文件

@@ -0,0 +1,3 @@
1
+.machineryListContent{
2
+  padding:13px 0;
3
+}

+ 4
- 0
src/routes.js 查看文件

@@ -18,6 +18,10 @@ const mainPages = [
18 18
     title: '登录',
19 19
     page: 'pages/login/index',
20 20
   },
21
+  {
22
+    title: '农机列表',
23
+    page: 'pages/machineryList/index',
24
+  },
21 25
   
22 26
 ];
23 27