Browse Source

s ss sdebug

[baozhangchao] 3 years ago
parent
commit
1d3cb64583

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

@@ -31,8 +31,6 @@ export default withLayout((props) => {
31 31
         setImagesList(e.imagesList)
32 32
         setContentList(e.contentList)
33 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,7 +17,6 @@ export default withLayout((props) => {
17 17
 
18 18
   const $instance = Taro.getCurrentInstance()
19 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 22
   const { sserLocation } = useModel('userData')
@@ -39,7 +38,6 @@ export default withLayout((props) => {
39 38
         setContentList(e.contentList)
40 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,7 +40,7 @@ export default withLayout((props) => {
40 40
             <View >{newInfo?.title}</View>
41 41
             <Image src={decorate} />
42 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 45
               newInfo?.contentList.map((item, index) => {
46 46
                 return (

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

@@ -5,6 +5,7 @@ import withLayout from '@/layouts'
5 5
 import { useModel } from "@/store"
6 6
 import addresss from '@/assets/mineImgaes/addresss.png'//地址
7 7
 import timeImage from '@/assets/icons/comm/timeImage.png'//日期图片
8
+import formatTimes from "@/utils/codeSegment"
8 9
 
9 10
 import CustomNav from '@/components/CustomNav'
10 11
 import ButtontWX from '@/components/ButtontWX'
@@ -44,37 +45,58 @@ export default withLayout((props) => {
44 45
   }, [userOrderAddress])
45 46
 
46 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 83
         Taro.showToast({
64
-          title: '农机预约成功',
65
-          icon: 'success',
84
+          title: '请填写完整信息',
85
+          icon: 'error',
66 86
           duration: 2000
67
-        }).then(() => {
68
-          Taro.redirectTo({ url: `/pages/OrderInfo/index?orderId=${es.orderId}` })
69 87
         })
70
-      })
88
+      }
89
+
90
+
71 91
     } else {
72 92
       Taro.showToast({
73
-        title: '请填写完整信息',
93
+        title: '日期有误!',
74 94
         icon: 'error',
75 95
         duration: 2000
76 96
       })
97
+      return;
77 98
     }
99
+
78 100
     // Taro.navigateTo({ url: `/pages/OrderInfo/index?goOrder=${id}` })
79 101
   }
80 102
   useEffect(() => {
@@ -87,6 +109,8 @@ export default withLayout((props) => {
87 109
   }, [id, sserLocation])
88 110
   const onTimeChange = (e) => {
89 111
     console.log('时间选择器', e);
112
+    // 获取当前时间 
113
+
90 114
     setTimeSel(e?.detail?.value)
91 115
 
92 116
   }
@@ -112,7 +136,7 @@ export default withLayout((props) => {
112 136
         <Form onSubmit={formSubmit} >
113 137
           <View className='example-body-WorkingArea'>
114 138
             <View>作业面积/公顷</View>
115
-            <Input name='amount' type='number' className='aTextareaCentent' placeholder='请输入地址信息' />
139
+            <Input name='amount' type='number' maxlength={6} className='aTextareaCentent' placeholder='请输入地址信息' />
116 140
           </View>
117 141
           <View className='example-body-WorkingTime'>
118 142
             <View>作业时间:</View>
@@ -137,7 +161,7 @@ export default withLayout((props) => {
137 161
             </View>
138 162
           </View>
139 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 165
             <ButtontWX onClick={cancelPay} styleType butText='取消' butWidth={315} butHeight={49} butFontSize={16} butBorderRadius={49} />
142 166
           </View>
143 167
         </Form>

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

@@ -41,12 +41,16 @@ export default withLayout((props) => {
41 41
       <View className='index-navbar'>
42 42
         <CustomNav title='搜索' />
43 43
       </View>
44
+      <View className='searchClass-jieguoye'>
45
+        <Input type='text' onInput={handlerSearch} placeholder='搜索关键字查询' />
46
+        <Image src={searchs} />
47
+      </View>
44 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 52
         </View>
49
-        <CarsListContent carsList={carsList} />
53
+
50 54
 
51 55
 
52 56
       </scroll-view>

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

@@ -22,3 +22,6 @@
22 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,7 +35,7 @@ export default withLayout((props) => {
35 35
                 <Image src={item?.thumb} />
36 36
                 <View className='help-center-cell-bottom' >
37 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 39
                 </View>
40 40
               </View>
41 41
             )