[baozhangchao] 3 years ago
parent
commit
56d1f0e541

+ 2
- 1
src/components/ButtontWX/index.jsx View File

3
 import './style.less'
3
 import './style.less'
4
 
4
 
5
 export default (props) => {
5
 export default (props) => {
6
-  const { butText, butWidth, butHeight, butFontSize, butBorderRadius, onClick, formType, disabled } = props
6
+  const { butText, butWidth, butHeight, butFontSize, butBorderRadius, onClick, formType, disabled, opacity } = props
7
   let butStyle = {
7
   let butStyle = {
8
     width: `${butWidth || 100}px`,
8
     width: `${butWidth || 100}px`,
9
     height: `${butHeight || 40}px`,
9
     height: `${butHeight || 40}px`,
10
     borderRadius: `${butBorderRadius || 0}px`,
10
     borderRadius: `${butBorderRadius || 0}px`,
11
     fontSize: `${butFontSize || 20}px`,
11
     fontSize: `${butFontSize || 20}px`,
12
+    opacity: `${opacity || '1'}`
12
 
13
 
13
   }
14
   }
14
   let butStyle2 = {
15
   let butStyle2 = {

+ 10
- 0
src/pages/CheckDetails/index.config.js View File

1
+
2
+export default {
3
+  navigationBarTitleText: '查看详情',
4
+  navigationStyle: 'custom',
5
+  disableScroll: true,
6
+  usingComponents: {
7
+  }
8
+
9
+
10
+}

+ 25
- 0
src/pages/CheckDetails/index.jsx View File

1
+import { useState } from "react"
2
+import { Textarea, View } from "@tarojs/components"
3
+import CustomNav from "@/components/CustomNav"
4
+import ButtontWX from "@/components/ButtontWX"
5
+import './style.less'
6
+
7
+
8
+
9
+export default (props) => {
10
+
11
+  const [textAreaValue, setTextAreaValue] = useState('')
12
+
13
+
14
+
15
+  return (
16
+    <View className='page-index'>
17
+      <View className='index-navbar'>
18
+        <CustomNav title='查看详情' />
19
+      </View>
20
+      <View>
21
+
22
+      </View>
23
+    </View>
24
+  )
25
+}

+ 18
- 0
src/pages/CheckDetails/style.less View File

1
+.components-page {
2
+  &-TextareaCentent {
3
+    width: 85%;
4
+    background: #fefefe;
5
+    border: 2px solid rgba(0, 0, 0, 0.2);
6
+    border-radius: 20px;
7
+    min-height: 25vh;
8
+    margin: 1em auto;
9
+    padding: 10px 37px;
10
+  }
11
+}
12
+
13
+.buton-bottom-Feedback {
14
+  width: 100%;
15
+  margin: 0 auto;
16
+  position: fixed;
17
+  bottom: 6vh;
18
+}

+ 22
- 0
src/pages/CheckMap/index.jsx View File

1
+import { useState } from "react"
2
+import { Textarea, View } from "@tarojs/components"
3
+import CustomNav from "@/components/CustomNav"
4
+import ButtontWX from "@/components/ButtontWX"
5
+import './style.less'
6
+
7
+
8
+
9
+export default (props) => {
10
+
11
+
12
+  return (
13
+    <View className='page-index'>
14
+      <View className='index-navbar'>
15
+        <CustomNav title='查看地图' />
16
+      </View>
17
+      <View>
18
+
19
+      </View>
20
+    </View>
21
+  )
22
+}

+ 18
- 0
src/pages/CheckMap/style.less View File

1
+.components-page {
2
+  &-TextareaCentent {
3
+    width: 85%;
4
+    background: #fefefe;
5
+    border: 2px solid rgba(0, 0, 0, 0.2);
6
+    border-radius: 20px;
7
+    min-height: 25vh;
8
+    margin: 1em auto;
9
+    padding: 10px 37px;
10
+  }
11
+}
12
+
13
+.buton-bottom-Feedback {
14
+  width: 100%;
15
+  margin: 0 auto;
16
+  position: fixed;
17
+  bottom: 6vh;
18
+}

+ 79
- 5
src/pages/MoreCars/index.jsx View File

1
 
1
 
2
 
2
 
3
-import { View, Image, Input, Button } from "@tarojs/components"
3
+import {
4
+  View, Image, Input, Picker,
5
+  Text
6
+} from "@tarojs/components"
7
+
8
+import { useState } from "react"
4
 import CustomNav from "@/components/CustomNav"
9
 import CustomNav from "@/components/CustomNav"
5
 import searchs from '@/assets/homesImgaes/searchs.png'//搜索图片
10
 import searchs from '@/assets/homesImgaes/searchs.png'//搜索图片
6
-
11
+import ButtontWX from '@/components/ButtontWX'
12
+import addresss from '@/assets/mineImgaes/addresss.png'//地址
7
 
13
 
8
 import './style.less'
14
 import './style.less'
9
 
15
 
11
 
17
 
12
 export default (props) => {
18
 export default (props) => {
13
 
19
 
20
+  const carsList = [
21
+    { carsName: '联合收割机', carsUrl: 'http://img3.jc001.cn/img/001/1/1512/15566fd0311736f.jpg', jiage: '300', carsLocation: '3.9' },
22
+    { carsName: '水稻播种机', carsUrl: 'http://img3.jc001.cn/img/001/1/1512/15566fd031719b1.jpg', jiage: '300', carsLocation: '3.9' },
23
+    { carsName: '秸秆统一处理 型号:GB2312', carsUrl: 'http://img3.jc001.cn/img/001/1/1512/15566fd03201503.jpg', jiage: '免费', carsLocation: '3.9' },
24
+    { carsName: '花生稻子小麦收割一体机', carsUrl: 'http://img3.jc001.cn/img/001/1/1512/15566fd0324f649.jpg', jiage: '550', carsLocation: '3.9' },
25
+    { carsName: '拖拉机', carsUrl: 'https://image.cnhnb.com/image/jpg/miniapp/2020/03/26/ef945970d2cc4948b61d45ce57ac1179.jpg', jiage: '180', carsLocation: '3.9' },
26
+    { carsName: '自行车', carsUrl: 'https://image.cnhnb.com/image/jpg/miniapp/2020/03/26/e8745759793d48398f82e6658186686a.jpg', jiage: '20', carsLocation: '3.9' },
27
+  ]
28
+
14
   const handleSearch = (e) => {
29
   const handleSearch = (e) => {
15
     console.log(e.detail.value)
30
     console.log(e.detail.value)
16
   }
31
   }
17
 
32
 
33
+  const [distanceValue, setDistanceValue] = useState('距离')
34
+  const distanceValueState = {
35
+    selector: ['由近到远', '由远到近'],
36
+    selectorChecked: distanceValue,
37
+  }
38
+  const onChangeDistance = e => {
39
+    setDistanceValue(distanceValueState.selector[e.detail.value])
40
+  }
41
+
18
 
42
 
19
 
43
 
44
+  const [selectValueType, setselectValueType] = useState('类型')
45
+  const selectValueTypeState = {
46
+    selector: ['收割机', '水稻机', '清障机', '战斗机', '公鸡'],
47
+    selectorChecked: selectValueType,
48
+  }
49
+
50
+
51
+  const onChangeType = e => {
52
+    setselectValueType(selectValueTypeState.selector[e.detail.value])
53
+  }
54
+
20
 
55
 
21
   return (
56
   return (
22
     <View className='page-index'>
57
     <View className='page-index'>
29
           <Input type='text' className='heads-content-searchClass-abcc-searchInput' onBlur={handleSearch} placeholder='搜索关键字查询订单' />
64
           <Input type='text' className='heads-content-searchClass-abcc-searchInput' onBlur={handleSearch} placeholder='搜索关键字查询订单' />
30
           <Image src={searchs} className='heads-content-searchClass-abcc-searchInput-searchImg' />
65
           <Image src={searchs} className='heads-content-searchClass-abcc-searchInput-searchImg' />
31
         </View>
66
         </View>
32
-
33
-
34
-
67
+        <View className='pick-box'>
68
+
69
+          <Picker className='picker-box' mode='selector' range={distanceValueState.selector} onChange={onChangeDistance}>
70
+            <View className='picker-text'>
71
+              {distanceValueState.selectorChecked}
72
+              <View className='heads-top-box-left-addresssImg-DownIcon-Picker' />
73
+            </View>
74
+          </Picker>
75
+          <Picker className='picker-box' mode='selector' range={selectValueTypeState.selector} onChange={onChangeType}>
76
+            <View className='picker-text'>
77
+              {selectValueTypeState.selectorChecked}
78
+              <View className='heads-top-box-left-addresssImg-DownIcon-Picker' />
79
+            </View>
80
+          </Picker>
81
+        </View>
82
+        {/* 内容区域 */}
83
+
84
+        {
85
+          carsList.map((item, index) => {
86
+            return (
87
+              <View key={index} className='carsListImga-bottom-box-copyStyleless'>
88
+                <Image src={item.carsUrl} />
89
+                <View className='carsListImga-bottom-box-copyStyleless-flaxBox'>
90
+                  <View className='carsListImga-bottom-box-copyStyleless-flaxBox-liftText'>
91
+                    <View className='carsListImga-bottom-box-copyStyleless-flaxBox-liftText-Titles'>{item.carsName}</View>
92
+                    <View className='carsListImga-bottom-box-copyStyleless-flaxBox-liftText-price'>{item.jiage}/<Text>公顷</Text></View>
93
+                  </View>
94
+                  <View className='carsListImga-bottom-box-copyStyleless-flaxBox-rightBut'>
95
+                    <ButtontWX butText='预约' butWidth={80} butHeight={34} butFontSize={19} butBorderRadius={0} />
96
+                  </View>
97
+                </View>
98
+                <View className='content-header-box-map-copyStyleless'>
99
+                  <View className='content-header-box-map-copyStyleless-liftCentent'>
100
+                    <Image src={addresss} />
101
+                    <View>距离当前位置{item.carsLocation}公里</View>
102
+                  </View>
103
+                  <View className='content-header-box-map-copyStyleless-rightCentent'>进入地图&gt;&gt;</View>
104
+                </View>
105
+              </View>
106
+            )
107
+          })
108
+        }
35
       </scroll-view>
109
       </scroll-view>
36
     </View>
110
     </View>
37
   )
111
   )

+ 117
- 2
src/pages/MoreCars/style.less View File

1
 .heads-content-searchClass-abcc {
1
 .heads-content-searchClass-abcc {
2
   display: inline-block;
2
   display: inline-block;
3
   position: relative;
3
   position: relative;
4
-  width: 95%;
4
+  width: 92%;
5
+  margin-top: 30px;
5
   text-align: center;
6
   text-align: center;
6
-  flex: 1;
7
+  left: 4vw;
7
   &-searchInput {
8
   &-searchInput {
8
     background: #f8f8f8;
9
     background: #f8f8f8;
9
     border-radius: 34px;
10
     border-radius: 34px;
21
     top: 19px;
22
     top: 19px;
22
   }
23
   }
23
 }
24
 }
25
+
26
+.pick-box {
27
+  width: 93vw;
28
+  margin: 0 auto;
29
+  text-align: center;
30
+  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
31
+  margin: 29px auto 32px auto;
32
+  padding-bottom: 18px;
33
+
34
+  .picker-box {
35
+    display: inline-block;
36
+    .picker-text {
37
+      line-height: 73px;
38
+      text-align: center;
39
+      border-radius: 42px;
40
+      font-size: 30px;
41
+      font-weight: 700;
42
+      // position: relative;
43
+      top: 34px;
44
+      height: 9.9vw;
45
+      left: 12px;
46
+      padding-right: 40px;
47
+      display: flex;
48
+      align-items: center;
49
+      justify-content: center;
50
+      .picker-text-line {
51
+        color: #808080;
52
+        padding-left: 6px;
53
+        font-weight: 100;
54
+      }
55
+      .heads-top-box-left-addresssImg-DownIcon-Picker {
56
+        border-top: 7px solid #000;
57
+        border-left: 7px solid transparent;
58
+        border-right: 7px solid transparent;
59
+        margin-left: 15px;
60
+      }
61
+    }
62
+  }
63
+}
64
+
65
+.carsListImga-bottom-box-copyStyleless {
66
+  margin: 30px auto 0 auto;
67
+  background: #f2f2f2;
68
+  width: 93vw;
69
+  > Image {
70
+    width: 100%;
71
+    margin: 0 auto;
72
+  }
73
+  &-flaxBox {
74
+    width: 94%;
75
+    display: flex;
76
+    align-items: center;
77
+    margin: 0 auto;
78
+    margin-top: 40px;
79
+    margin-bottom: 38px;
80
+    &-liftText {
81
+      width: 95%;
82
+
83
+      &-Titles {
84
+        width: 95%;
85
+
86
+        text-overflow: ellipsis; //显示...
87
+        white-space: nowrap; //不换行
88
+        overflow: hidden;
89
+        font-size: 36px;
90
+        font-weight: bold;
91
+        color: #222222;
92
+      }
93
+      &-price {
94
+        margin-top: 44px;
95
+        font-size: 44px;
96
+        font-weight: 800;
97
+        color: #666666;
98
+        background: linear-gradient(180deg, #fa7878 0%, #b61515 100%);
99
+        -webkit-background-clip: text;
100
+        -webkit-text-fill-color: transparent;
101
+        > Text {
102
+          font-size: 25px;
103
+        }
104
+      }
105
+    }
106
+    &-rightBut {
107
+      align-items: center;
108
+      margin: 0 auto;
109
+    }
110
+  }
111
+  .content-header-box-map-copyStyleless {
112
+    width: 94%;
113
+    margin: 0 auto;
114
+    display: flex;
115
+    align-items: center;
116
+    justify-content: space-between;
117
+    padding-bottom: 60px;
118
+    &-liftCentent {
119
+      display: flex;
120
+      align-items: center;
121
+      > Image {
122
+        width: 22px;
123
+        height: 27px;
124
+      }
125
+      > View {
126
+        padding-left: 15px;
127
+        font-size: 30px;
128
+        font-weight: 800;
129
+        color: #222222;
130
+      }
131
+    }
132
+    &-rightCentent {
133
+      font-size: 30px;
134
+      font-weight: 500;
135
+      color: #666666;
136
+    }
137
+  }
138
+}

+ 12
- 13
src/pages/UserLogin/index.jsx View File

14
 export default (props) => {
14
 export default (props) => {
15
 
15
 
16
   const [countCenter, setCountCenter] = useState({
16
   const [countCenter, setCountCenter] = useState({
17
-    count: 10,
17
+    count: 60,
18
     toast: false,
18
     toast: false,
19
     show_btn: false,
19
     show_btn: false,
20
     code_ts: '获取验证码'
20
     code_ts: '获取验证码'
29
 
29
 
30
   const getCode = (r) => {
30
   const getCode = (r) => {
31
     if (InputCodeValue === '' || !(/^1[3456789]\d{9}$/.test(InputCodeValue))) {
31
     if (InputCodeValue === '' || !(/^1[3456789]\d{9}$/.test(InputCodeValue))) {
32
-      // 这里验证一下号码格式是否正确,为空或者不正常都提示一下,然后激活提示控件true,其他的框架提示控件同理
33
       console.log('提示')
32
       console.log('提示')
34
       Taro.showToast({
33
       Taro.showToast({
35
         title: '手机号码有误',
34
         title: '手机号码有误',
38
       })
37
       })
39
 
38
 
40
     } else {
39
     } else {
41
-      // 这里写一个定时器就可以去更新灰色按钮的内容而且show_btn是false时会出现灰色按钮,当倒计时结束又变成可以触发的按钮
42
       let count = countCenter.count
40
       let count = countCenter.count
43
       const timer = setInterval(() => {
41
       const timer = setInterval(() => {
44
         setCountCenter({
42
         setCountCenter({
45
           count: (count--),
43
           count: (count--),
46
           show_btn: true,
44
           show_btn: true,
47
           code_ts: count + '秒后重发'
45
           code_ts: count + '秒后重发'
48
-        }, () => {
49
-          if (count == 0) {
50
-            clearInterval(timer)
51
-            setCountCenter({
52
-              show_btn: false,
53
-              count: 60,
54
-              code_ts: '获取验证码'
55
-            })
56
-          }
57
         })
46
         })
47
+        if (count == 0) {
48
+          setCountCenter({
49
+            show_btn: false,
50
+            count: 60,
51
+            code_ts: '获取验证码'
52
+          })
53
+          clearInterval(timer)
54
+
55
+        }
56
+
58
       }, 1000)
57
       }, 1000)
59
     }
58
     }
60
   }
59
   }
89
           <View className='loginPhone-box' >
88
           <View className='loginPhone-box' >
90
             <View className='loginPhone-box-loginPhoneView'>+86</View>
89
             <View className='loginPhone-box-loginPhoneView'>+86</View>
91
             <Input maxlength={11} placeholder='请输入手机号码' type={Number} onInput={InputCode} />
90
             <Input maxlength={11} placeholder='请输入手机号码' type={Number} onInput={InputCode} />
92
-            <ButtontWX disabled={countCenter.show_btn} onClick={getCode} butText={countCenter.code_ts} butWidth={94} butHeight={34} butFontSize={15} butBorderRadius={10} />
91
+            <ButtontWX opacity={countCenter.show_btn ? '0.7' : '11'} disabled={countCenter.show_btn} onClick={getCode} butText={countCenter.code_ts} butWidth={94} butHeight={34} butFontSize={15} butBorderRadius={10} />
93
           </View>
92
           </View>
94
           <View className='loginPhone-box'>
93
           <View className='loginPhone-box'>
95
             <View className='loginPhone-box-loginPhoneView'>
94
             <View className='loginPhone-box-loginPhoneView'>

+ 8
- 0
src/routes.js View File

39
     page: 'pages/MoreCars/index',
39
     page: 'pages/MoreCars/index',
40
   },
40
   },
41
 
41
 
42
+  {
43
+    title: '查看详情',//农机详情
44
+    page: 'pages/CheckDetails/index',
45
+  },
46
+  {
47
+    title: '查看地图',
48
+    page: 'pages/CheckMap/index',
49
+  },
42
 ];
50
 ];
43
 
51
 
44
 
52