李志伟 3 anos atrás
pai
commit
63271c307b

BIN
src/assets/user/goto.png Ver arquivo


BIN
src/assets/user/right.png Ver arquivo


+ 13
- 0
src/components/MyCell/index.jsx Ver arquivo

@@ -0,0 +1,13 @@
1
+import { View } from "@tarojs/components"
2
+import './style.less'
3
+
4
+export default (props) => {
5
+
6
+  return (
7
+    <View className='Mycell'>
8
+      <View className='cell-header'>{props.header}</View>:
9
+      <View className='cell-body'>{props.children}</View>
10
+      <View className='cell-action'>{props.action}</View>
11
+    </View>
12
+  )
13
+}

+ 24
- 0
src/components/MyCell/style.less Ver arquivo

@@ -0,0 +1,24 @@
1
+
2
+.Mycell {
3
+  display: flex;  
4
+  font-size: 34px;
5
+  font-weight: bold;
6
+  color: #606060;
7
+  padding:18px 0;
8
+
9
+  .cell-header, .cell-action {
10
+    flex: none;
11
+  }
12
+  .cell-header{
13
+    width: 5em;
14
+    display: inline-block;
15
+    text-align: justify;
16
+    text-align-last: justify;
17
+  }
18
+
19
+  .cell-body {
20
+    flex: 1;
21
+    color: #101010;
22
+    line-height: 46px;
23
+  }
24
+}

+ 25
- 21
src/components/OrderCard/index.jsx Ver arquivo

@@ -1,37 +1,41 @@
1 1
 import Taro from "@tarojs/taro"
2 2
 import { View, Text } from '@tarojs/components'
3
+import MyCell from "../MyCell"
3 4
 import './style.less'
4 5
 
5 6
 export default (props) => {
7
+  const { detail } = props
8
+  const handleDetail = () => {
9
+    Taro.navigateTo({ url: '/pages/orderDetail/index' });
10
+  }
6 11
   return (
7 12
     <View className='card'>
8 13
       <View className='jianbian'>
9 14
         <View className='text'>待作业</View>
10 15
       </View>
11 16
       <View className='cardHead'>
12
-        <View className='cell' style={{display:'inline-block'}}>
13
-          <Text className='label'>需求时间</Text>:
14
-          <Text className='data'>2022-06-02</Text>
15
-        </View>
16
-        <Text className='price'><Text style={{fontSize:'44rpx'}}>600</Text>元</Text>
17
+        <MyCell header='需求时间'>2022-06-02</MyCell>
18
+        <Text className='price'><Text style={{ fontSize: '44rpx' }}>600</Text>元</Text>
17 19
       </View>
18 20
       <View className='line' />
19
-      <View className='content'>
20
-        <View className='cell'>
21
-          <Text className='label'>农机名称</Text>:<Text className='data'>收割机001</Text>
22
-        </View>
23
-        <View className='cell'>
24
-          <Text className='label'>下单人</Text>:<Text className='data'>张三</Text>
25
-        </View>
26
-        <View className='cell'>
27
-          <Text className='label'>订单时间</Text>:<Text className='data'>2022-03-08</Text>
28
-        </View>
29
-        <View className='cell'>
30
-          <Text className='label'>作业时间</Text>:<Text className='data'>上午06:00--晚上21:00</Text>
31
-        </View>
32
-      </View>
33
-      <View className='line' />
34
-      <View className='footer'>详情>></View>
21
+      <View>
22
+        <MyCell header='农机名称'>收割机001</MyCell>
23
+        <MyCell header='下单人'>张三</MyCell>
24
+        {
25
+          detail && <MyCell header='手机号'>13613949434</MyCell>
26
+        }
27
+        <MyCell header='订单时间'>2022-03-08</MyCell>
28
+        {
29
+          detail && <MyCell header='服务地址'>河南省南阳市邓州市孟楼镇</MyCell>
30
+        }
31
+        <MyCell header='作业时间'>上午06:00--晚上21:00</MyCell>
32
+      </View> 
33
+      {
34
+        !detail && <View className='line' />
35
+      }
36
+      {
37
+        !detail && <View className='footer' onClick={handleDetail}>详情>></View>
38
+      }
35 39
     </View>
36 40
   )
37 41
 }

+ 4
- 25
src/components/OrderCard/style.less Ver arquivo

@@ -29,10 +29,9 @@
29 29
     padding: 5px 0 0 38px;
30 30
     position: relative;
31 31
     .price{
32
-      line-height: 36px;
33 32
       position: absolute;
34 33
       right: 40px;
35
-      top: 22px;
34
+      top: 14px;
36 35
       font-size: 30px;
37 36
       font-weight: bold;
38 37
       color: #FF2525;
@@ -40,36 +39,16 @@
40 39
   }
41 40
   .line{
42 41
     width: 100%;
43
-    border: 1px solid #000;
42
+    border-top: 1px solid #000;
44 43
     opacity: 0.1;
45
-    margin: 15px 0;
46
-  }
47
-  .content {
48
-    width: 100%;
49
-  }
50
-  .cell{
51
-    line-height: 32px;
52
-    padding: 25px 0;
53
-    font-size: 34px;
54
-    font-weight: bold;
55
-    color: #606060;
56
-    .label{
57
-      width: 24vw;
58
-      display: inline-block;
59
-      text-align: justify;
60
-      text-align-last: justify;
61
-    }
62
-    .data{
63
-      color: #101010;
64
-    }
44
+    margin: 15.5px 0;
65 45
   }
66 46
   .footer{
67 47
     width: 100%;
68 48
     text-align: center;
69
-    line-height: 32px;
70 49
     font-size: 34px;
71 50
     font-weight: bold;
72 51
     color: #606060;
73
-    padding-top: 15px;
52
+    padding-top: 25px;
74 53
   }
75 54
 }

+ 0
- 1
src/pages/index/components/order/style.less Ver arquivo

@@ -50,7 +50,6 @@
50 50
     }
51 51
   }
52 52
   .swiper {
53
-    transition: all 0.3s linear;
54 53
     height: calc( calc(100vw - 60px) * 0.62);
55 54
     text-align: center;
56 55
     margin: 30px;

+ 15
- 15
src/pages/moreOrder/index.jsx Ver arquivo

@@ -1,4 +1,4 @@
1
-import { View, Input, Image,Text,ScrollView } from "@tarojs/components"
1
+import { View, Input, Image, Text, ScrollView } from "@tarojs/components"
2 2
 import CustomNav from "@/components/CustomNav";
3 3
 import searchImg from '@/assets/comm/search.png'
4 4
 import { useState } from "react";
@@ -20,7 +20,7 @@ export default () => {
20 20
   const handleClick = () => {
21 21
     setImageShow(false)
22 22
   }
23
-  const handleChange =(val)=>{
23
+  const handleChange = (val) => {
24 24
     setCurrentTab(val)
25 25
   }
26 26
   return (
@@ -44,8 +44,8 @@ export default () => {
44 44
           <View>
45 45
             <Text className='text'>待付款</Text>
46 46
             {
47
-              currentTab === 0&&<View className='line' />
48
-            }            
47
+              currentTab === 0 && <View className='line' />
48
+            }
49 49
           </View>
50 50
         </View>
51 51
         <View
@@ -55,8 +55,8 @@ export default () => {
55 55
           <View>
56 56
             <Text className='text'>进行中</Text>
57 57
             {
58
-              currentTab === 1&&<View className='line' />
59
-            } 
58
+              currentTab === 1 && <View className='line' />
59
+            }
60 60
           </View>
61 61
         </View>
62 62
         <View
@@ -66,19 +66,19 @@ export default () => {
66 66
           <View>
67 67
             <Text className='text'>已完成</Text>
68 68
             {
69
-              currentTab === 2&&<View className='line' />
70
-            } 
69
+              currentTab === 2 && <View className='line' />
70
+            }
71 71
           </View>
72 72
         </View>
73 73
       </View>
74 74
       <View className='index-container'>
75
-      <ScrollView scrollY style={{height:'100%'}}>
76
-        {currentTab}
77
-      <OrderCard />
78
-      <OrderCard />
79
-      <OrderCard />
80
-      <Footer />
81
-      </ScrollView>
75
+        <ScrollView scrollY style={{ height: '100%' }}>
76
+          {currentTab}
77
+          <OrderCard />
78
+          <OrderCard />
79
+          <OrderCard />
80
+          <Footer />
81
+        </ScrollView>
82 82
         {/* {currentTab === 0 && <View>777</View>}
83 83
         {currentTab === 1 && <View>888</View>}
84 84
         {currentTab === 2 && <View>999</View>} */}

+ 7
- 0
src/pages/orderDetail/index.config.js Ver arquivo

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

+ 16
- 0
src/pages/orderDetail/index.jsx Ver arquivo

@@ -0,0 +1,16 @@
1
+import { View } from "@tarojs/components"
2
+import CustomNav from "@/components/CustomNav"
3
+import OrderCard from "@/components/OrderCard"
4
+
5
+export default () => {
6
+  return (
7
+    <View className='page-index'>
8
+      <View className='index-navbar'>
9
+        <CustomNav title='更多' />
10
+      </View>
11
+      <View className='index-container'>
12
+        <OrderCard detail />
13
+      </View>
14
+    </View>
15
+  )
16
+}

+ 0
- 0
src/pages/orderDetail/style.less Ver arquivo


+ 4
- 0
src/routes.js Ver arquivo

@@ -10,6 +10,10 @@ const mainPages = [
10 10
     title: '更多',
11 11
     page: 'pages/moreOrder/index',
12 12
   },
13
+  {
14
+    title: '详情',
15
+    page: 'pages/orderDetail/index',
16
+  },
13 17
   
14 18
 ];
15 19