Browse Source

s ss sdebug

[baozhangchao] 3 years ago
parent
commit
1d3cb64583

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

31
         setImagesList(e.imagesList)
31
         setImagesList(e.imagesList)
32
         setContentList(e.contentList)
32
         setContentList(e.contentList)
33
         setCarsInfo(e)
33
         setCarsInfo(e)
34
-
35
-        console.log('setCarsInfosetCarsInfosetCarsInfo', e);
36
       })
34
       })
37
     }
35
     }
38
 
36
 

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

17
 
17
 
18
   const $instance = Taro.getCurrentInstance()
18
   const $instance = Taro.getCurrentInstance()
19
   const { id, location } = $instance.router.params
19
   const { id, location } = $instance.router.params
20
-  console.log("🚀 ~ file: index.jsx ~ line 20 ~ withLayout ~ $instance.router.params", $instance.router.params)
21
 
20
 
22
 
21
 
23
   const { sserLocation } = useModel('userData')
22
   const { sserLocation } = useModel('userData')
39
         setContentList(e.contentList)
38
         setContentList(e.contentList)
40
         setCarsInfo(e)
39
         setCarsInfo(e)
41
 
40
 
42
-        console.log('e', e);
43
       })
41
       })
44
     }
42
     }
45
 
43
 

+ 1
- 1
src/pages/InformationInfo/index.jsx View File

40
             <View >{newInfo?.title}</View>
40
             <View >{newInfo?.title}</View>
41
             <Image src={decorate} />
41
             <Image src={decorate} />
42
           </View>
42
           </View>
43
-          <View style={{ margin: '25px auto 6em auto', padding: '1px 15px 0px 15px' }}>
43
+          <View style={{ padding: '25px 15px 130px 15px' }}>
44
             {
44
             {
45
               newInfo?.contentList.map((item, index) => {
45
               newInfo?.contentList.map((item, index) => {
46
                 return (
46
                 return (

+ 48
- 24
src/pages/OrderConfirmation/index.jsx View File

5
 import { useModel } from "@/store"
5
 import { useModel } from "@/store"
6
 import addresss from '@/assets/mineImgaes/addresss.png'//地址
6
 import addresss from '@/assets/mineImgaes/addresss.png'//地址
7
 import timeImage from '@/assets/icons/comm/timeImage.png'//日期图片
7
 import timeImage from '@/assets/icons/comm/timeImage.png'//日期图片
8
+import formatTimes from "@/utils/codeSegment"
8
 
9
 
9
 import CustomNav from '@/components/CustomNav'
10
 import CustomNav from '@/components/CustomNav'
10
 import ButtontWX from '@/components/ButtontWX'
11
 import ButtontWX from '@/components/ButtontWX'
44
   }, [userOrderAddress])
45
   }, [userOrderAddress])
45
 
46
 
46
   const formSubmit = (e) => {
47
   const formSubmit = (e) => {
47
-    const { amount, appontmentDate, address } = e?.detail?.value
48
-
49
-    if (amount && appontmentDate && address) {
50
-      generateOrder({
51
-        charges: carsInfo?.price * amount,
52
-        price: carsInfo?.price,
53
-        amount: amount || '',
54
-        machineryId: carsInfo?.machineryId,
55
-        machineryName: carsInfo?.name,
56
-        machineryType: carsInfo?.typeId,
57
-        typeName: carsInfo?.typeName,
58
-        address: address || '',
59
-        orgId: carsInfo?.orgId,
60
-        appointmentDate: `${appontmentDate} 08:00:00` || '',
61
-        // appointmentDate: '2022-03-25 08:00:00',
62
-      }).then((es) => {
48
+    const currentTime = formatTimes(new Date(), 'yyyy-MM-dd')
49
+    const newTime = formatTimes(timeSel, 'yyyy-MM-dd')
50
+
51
+    if (currentTime <= newTime) {
52
+      // const { amount, appontmentDate, address } = e?.detail?.value
53
+      const amount = e?.detail?.value?.amount
54
+      const appontmentDate = e?.detail?.value?.appontmentDate
55
+      const address = e?.detail?.value?.address
56
+
57
+      debugger
58
+
59
+      console.log('formSubmit', e?.detail);
60
+      if (e?.detail?.value?.amount && e?.detail?.value?.appontmentDate && e?.detail?.value?.address) {
61
+        generateOrder({
62
+          charges: carsInfo?.price * amount,
63
+          price: carsInfo?.price,
64
+          amount: amount || '',
65
+          machineryId: carsInfo?.machineryId,
66
+          machineryName: carsInfo?.name,
67
+          machineryType: carsInfo?.typeId,
68
+          typeName: carsInfo?.typeName,
69
+          address: address || '',
70
+          orgId: carsInfo?.orgId,
71
+          appointmentDate: `${appontmentDate} 08:00:00` || '',
72
+          // appointmentDate: '2022-03-25 08:00:00',
73
+        }).then((es) => {
74
+          Taro.showToast({
75
+            title: '农机预约成功',
76
+            icon: 'success',
77
+            duration: 2000
78
+          }).then(() => {
79
+            Taro.redirectTo({ url: `/pages/OrderInfo/index?orderId=${es.orderId}&stateType=待付款` })
80
+          })
81
+        })
82
+      } else {
63
         Taro.showToast({
83
         Taro.showToast({
64
-          title: '农机预约成功',
65
-          icon: 'success',
84
+          title: '请填写完整信息',
85
+          icon: 'error',
66
           duration: 2000
86
           duration: 2000
67
-        }).then(() => {
68
-          Taro.redirectTo({ url: `/pages/OrderInfo/index?orderId=${es.orderId}` })
69
         })
87
         })
70
-      })
88
+      }
89
+
90
+
71
     } else {
91
     } else {
72
       Taro.showToast({
92
       Taro.showToast({
73
-        title: '请填写完整信息',
93
+        title: '日期有误!',
74
         icon: 'error',
94
         icon: 'error',
75
         duration: 2000
95
         duration: 2000
76
       })
96
       })
97
+      return;
77
     }
98
     }
99
+
78
     // Taro.navigateTo({ url: `/pages/OrderInfo/index?goOrder=${id}` })
100
     // Taro.navigateTo({ url: `/pages/OrderInfo/index?goOrder=${id}` })
79
   }
101
   }
80
   useEffect(() => {
102
   useEffect(() => {
87
   }, [id, sserLocation])
109
   }, [id, sserLocation])
88
   const onTimeChange = (e) => {
110
   const onTimeChange = (e) => {
89
     console.log('时间选择器', e);
111
     console.log('时间选择器', e);
112
+    // 获取当前时间 
113
+
90
     setTimeSel(e?.detail?.value)
114
     setTimeSel(e?.detail?.value)
91
 
115
 
92
   }
116
   }
112
         <Form onSubmit={formSubmit} >
136
         <Form onSubmit={formSubmit} >
113
           <View className='example-body-WorkingArea'>
137
           <View className='example-body-WorkingArea'>
114
             <View>作业面积/公顷</View>
138
             <View>作业面积/公顷</View>
115
-            <Input name='amount' type='number' className='aTextareaCentent' placeholder='请输入地址信息' />
139
+            <Input name='amount' type='number' maxlength={6} className='aTextareaCentent' placeholder='请输入地址信息' />
116
           </View>
140
           </View>
117
           <View className='example-body-WorkingTime'>
141
           <View className='example-body-WorkingTime'>
118
             <View>作业时间:</View>
142
             <View>作业时间:</View>
137
             </View>
161
             </View>
138
           </View>
162
           </View>
139
           <View className='BottomtBut-box'>
163
           <View className='BottomtBut-box'>
140
-            <ButtontWX onClick={formSubmit} butText='确定' butWidth={315} butHeight={49} butFontSize={16} butBorderRadius={49} />
164
+            <ButtontWX onClick={formSubmit} formType='submit' butText='确定' butWidth={315} butHeight={49} butFontSize={16} butBorderRadius={49} />
141
             <ButtontWX onClick={cancelPay} styleType butText='取消' butWidth={315} butHeight={49} butFontSize={16} butBorderRadius={49} />
165
             <ButtontWX onClick={cancelPay} styleType butText='取消' butWidth={315} butHeight={49} butFontSize={16} butBorderRadius={49} />
142
           </View>
166
           </View>
143
         </Form>
167
         </Form>

+ 8
- 4
src/pages/Search/index.jsx View File

41
       <View className='index-navbar'>
41
       <View className='index-navbar'>
42
         <CustomNav title='搜索' />
42
         <CustomNav title='搜索' />
43
       </View>
43
       </View>
44
+      <View className='searchClass-jieguoye'>
45
+        <Input type='text' onInput={handlerSearch} placeholder='搜索关键字查询' />
46
+        <Image src={searchs} />
47
+      </View>
44
       <scroll-view scrollY style='height: 100%;' >
48
       <scroll-view scrollY style='height: 100%;' >
45
-        <View className='searchClass-jieguoye'>
46
-          <Input type='text' onInput={handlerSearch} placeholder='搜索关键字查询' />
47
-          <Image src={searchs} />
49
+        <View className='CarsListContent'>
50
+          <CarsListContent carsList={carsList} />
51
+
48
         </View>
52
         </View>
49
-        <CarsListContent carsList={carsList} />
53
+
50
 
54
 
51
 
55
 
52
       </scroll-view>
56
       </scroll-view>

+ 3
- 0
src/pages/Search/style.less View File

22
     top: 19px;
22
     top: 19px;
23
   }
23
   }
24
 }
24
 }
25
+.CarsListContent {
26
+  padding-bottom: 10em;
27
+}

+ 1
- 1
src/pages/index/tabs/Information.jsx View File

35
                 <Image src={item?.thumb} />
35
                 <Image src={item?.thumb} />
36
                 <View className='help-center-cell-bottom' >
36
                 <View className='help-center-cell-bottom' >
37
                   <View className='help-center-cell-bottom-title'  >{item?.title}</View>
37
                   <View className='help-center-cell-bottom-title'  >{item?.title}</View>
38
-                  <View className='help-center-cell-bottom-content' >{formatTimes(item?.createDate, 'yyyy-mm-dd')}</View>
38
+                  <View className='help-center-cell-bottom-content' >{formatTimes(item?.createDate, 'yyyy-MM-dd')}</View>
39
                 </View>
39
                 </View>
40
               </View>
40
               </View>
41
             )
41
             )