李志伟 3 年 前
コミット
63271c307b

バイナリ
src/assets/user/goto.png ファイルの表示


バイナリ
src/assets/user/right.png ファイルの表示


+ 13
- 0
src/components/MyCell/index.jsx ファイルの表示

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 ファイルの表示

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 ファイルの表示

1
 import Taro from "@tarojs/taro"
1
 import Taro from "@tarojs/taro"
2
 import { View, Text } from '@tarojs/components'
2
 import { View, Text } from '@tarojs/components'
3
+import MyCell from "../MyCell"
3
 import './style.less'
4
 import './style.less'
4
 
5
 
5
 export default (props) => {
6
 export default (props) => {
7
+  const { detail } = props
8
+  const handleDetail = () => {
9
+    Taro.navigateTo({ url: '/pages/orderDetail/index' });
10
+  }
6
   return (
11
   return (
7
     <View className='card'>
12
     <View className='card'>
8
       <View className='jianbian'>
13
       <View className='jianbian'>
9
         <View className='text'>待作业</View>
14
         <View className='text'>待作业</View>
10
       </View>
15
       </View>
11
       <View className='cardHead'>
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
       </View>
19
       </View>
18
       <View className='line' />
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
     </View>
39
     </View>
36
   )
40
   )
37
 }
41
 }

+ 4
- 25
src/components/OrderCard/style.less ファイルの表示

29
     padding: 5px 0 0 38px;
29
     padding: 5px 0 0 38px;
30
     position: relative;
30
     position: relative;
31
     .price{
31
     .price{
32
-      line-height: 36px;
33
       position: absolute;
32
       position: absolute;
34
       right: 40px;
33
       right: 40px;
35
-      top: 22px;
34
+      top: 14px;
36
       font-size: 30px;
35
       font-size: 30px;
37
       font-weight: bold;
36
       font-weight: bold;
38
       color: #FF2525;
37
       color: #FF2525;
40
   }
39
   }
41
   .line{
40
   .line{
42
     width: 100%;
41
     width: 100%;
43
-    border: 1px solid #000;
42
+    border-top: 1px solid #000;
44
     opacity: 0.1;
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
   .footer{
46
   .footer{
67
     width: 100%;
47
     width: 100%;
68
     text-align: center;
48
     text-align: center;
69
-    line-height: 32px;
70
     font-size: 34px;
49
     font-size: 34px;
71
     font-weight: bold;
50
     font-weight: bold;
72
     color: #606060;
51
     color: #606060;
73
-    padding-top: 15px;
52
+    padding-top: 25px;
74
   }
53
   }
75
 }
54
 }

+ 0
- 1
src/pages/index/components/order/style.less ファイルの表示

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

+ 15
- 15
src/pages/moreOrder/index.jsx ファイルの表示

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

+ 7
- 0
src/pages/orderDetail/index.config.js ファイルの表示

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 ファイルの表示

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 ファイルの表示


+ 4
- 0
src/routes.js ファイルの表示

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