[baozhangchao] 3 years ago
parent
commit
2571e88f85
3 changed files with 155 additions and 73 deletions
  1. 3
    1
      config/dev.js
  2. 0
    1
      src/pages/dogCardDetail/index.jsx
  3. 152
    71
      src/pages/setDogLicense/index.jsx

+ 3
- 1
config/dev.js View File

3
     NODE_ENV: '"development"'
3
     NODE_ENV: '"development"'
4
   },
4
   },
5
   defineConstants: {
5
   defineConstants: {
6
-    HOST: '"http://127.0.01:9002"'
6
+    // HOST: '"http://192.168.89.147:9002"'
7
+    HOST: '"https://pet-certificate-online.njyunzhi.com"',
8
+
7
 
9
 
8
   },
10
   },
9
   mini: {},
11
   mini: {},

+ 0
- 1
src/pages/dogCardDetail/index.jsx View File

8
 import NoData from '../../components/NoData';
8
 import NoData from '../../components/NoData';
9
 
9
 
10
 import './style.less'
10
 import './style.less'
11
-
12
 const CardDetailPage = (props) => {
11
 const CardDetailPage = (props) => {
13
   const router = useRouter()
12
   const router = useRouter()
14
   const cardNo = router.params.cardno
13
   const cardNo = router.params.cardno

+ 152
- 71
src/pages/setDogLicense/index.jsx View File

72
     if (applyType == 'renewal' || applyType == 'reissue') {
72
     if (applyType == 'renewal' || applyType == 'reissue') {
73
       getDogInfoFunction(petId)
73
       getDogInfoFunction(petId)
74
       getCardLicenseInfo(petId).then((res) => {
74
       getCardLicenseInfo(petId).then((res) => {
75
+        console.log("🚀 ~ file: index.jsx ~ line 75 ~ getCardLicenseInfo ~ res", res)
76
+        setIsOrgState(res.isOrg)
77
+
78
+        if (res.isOrg) {
79
+          setOrgState([{
80
+            value: false,
81
+            text: '个人',
82
+            checked: false,
83
+          },
84
+          {
85
+            value: true,
86
+            text: '企业',
87
+            checked: true,
88
+
89
+          }])
90
+        } else {
91
+          setOrgState([{
92
+            value: true,
93
+            text: '个人',
94
+            checked: true,
95
+          },
96
+          {
97
+            value: false,
98
+            text: '企业',
99
+            checked: false,
100
+
101
+          }])
102
+        }
103
+
104
+
75
         setRenewalAndReissue({ ...renewalAndReissue, ...res })
105
         setRenewalAndReissue({ ...renewalAndReissue, ...res })
76
       })
106
       })
77
     }
107
     }
134
 
164
 
135
   // ...dogDate,
165
   // ...dogDate,
136
   const formSubmit = (value) => {
166
   const formSubmit = (value) => {
137
-
138
-    if (applyType == 'renewal' || applyType == 'reissue') {
139
-
140
-      getApplicationList({ pageSize: 500 }).then((e) => {
141
-        console.log('e', e);
142
-        const array = e.records
143
-        for (let i = 0; i < array.length; i++) {
144
-          if (array[i].petId == formData.petId) {
145
-            if (array[i].status == 1) {
146
-              console.log('支付过了',);
147
-              Taro.showToast({
148
-                title: '申请成功,等待审核',
149
-                icon: 'none',
150
-                duration: 1000
151
-              })
152
-              setTimeout(() => {
153
-                Taro.navigateBack({
154
-                  delta: 1
167
+    if (applyType == 'reissue') {
168
+      console.log("🚀 ~ file: index.jsx ~ line 201 ~ getApplicationList ~ applyType", applyType, value.applyMethod)
169
+      if (value.applyMethod) {
170
+        getApplicationList({ pageSize: 500 }).then((e) => {
171
+          const array = e.records
172
+          for (let i = 0; i < array.length; i++) {
173
+            if (array[i].petId == formData.petId) {
174
+              if (array[i].status == 1) {
175
+                console.log('支付过了',);
176
+                Taro.showToast({
177
+                  title: '申请成功,等待审核',
178
+                  icon: 'none',
179
+                  duration: 1000
155
                 })
180
                 })
156
-              }, 1000);
181
+                setTimeout(() => {
182
+                  Taro.navigateBack({
183
+                    delta: 1
184
+                  })
185
+                }, 1000);
157
 
186
 
158
-              return;
187
+                return;
188
+              } else {
189
+                console.log('没有支付',);
190
+                other(value);
191
+                return;
192
+              }
159
             } else {
193
             } else {
160
-              console.log('没有支付',);
194
+              console.log('没有这个订单',);
161
               other(value);
195
               other(value);
162
               return;
196
               return;
163
             }
197
             }
164
-          } else {
165
-            console.log('没有这个订单',);
166
-            other(value);
167
-            return;
168
           }
198
           }
169
-        }
170
 
199
 
171
-      })
172
 
200
 
201
+        })
202
+
203
+      } else {
204
+        console.log("🚀 ~ file: index.jsx ~ line 201 ~ getApplicationList ~ applyType", applyType, value.applyMethod)
205
+
206
+        Taro.showToast({
207
+          title: '请选择申领方式',
208
+          icon: 'none',
209
+          duration: 1000
210
+        })
211
+      }
173
     } else {
212
     } else {
213
+      if (applyType == 'renewal' || applyType == 'reissue') {
174
 
214
 
175
-      getApplicationList({ pageSize: 500 }).then((e) => {
176
-        console.log('开始',);
215
+        getApplicationList({ pageSize: 500 }).then((e) => {
216
+          const array = e.records
177
 
217
 
178
-        console.log('e', e);
179
-        const array = e.records
180
-        if (array.length > 0) {
181
           for (let i = 0; i < array.length; i++) {
218
           for (let i = 0; i < array.length; i++) {
182
             if (array[i].petId == formData.petId) {
219
             if (array[i].petId == formData.petId) {
183
               if (array[i].status == 1) {
220
               if (array[i].status == 1) {
192
                     delta: 1
229
                     delta: 1
193
                   })
230
                   })
194
                 }, 1000);
231
                 }, 1000);
232
+
195
                 return;
233
                 return;
196
               } else {
234
               } else {
197
                 console.log('没有支付',);
235
                 console.log('没有支付',);
198
-                goPayPage(value)
199
-
236
+                other(value);
200
                 return;
237
                 return;
201
               }
238
               }
202
             } else {
239
             } else {
203
-              console.log('没有这个订单-----------',);
240
+              console.log('没有这个订单',);
241
+              other(value);
242
+              return;
243
+            }
244
+          }
245
+
246
+
247
+        })
248
+
249
+      } else {
250
+        if (value.applyMethod) {
251
+
252
+          getApplicationList({ pageSize: 500 }).then((e) => {
253
+            console.log('开始',);
254
+            console.log('e', e);
255
+            const array = e.records
256
+            if (array.length > 0) {
257
+              for (let i = 0; i < array.length; i++) {
258
+                if (array[i].petId == formData.petId) {
259
+                  if (array[i].status == 1) {
260
+                    console.log('支付过了',);
261
+                    Taro.showToast({
262
+                      title: '申请成功,等待审核',
263
+                      icon: 'none',
264
+                      duration: 1000
265
+                    })
266
+                    setTimeout(() => {
267
+                      Taro.navigateBack({
268
+                        delta: 1
269
+                      })
270
+                    }, 1000);
271
+                    return;
272
+                  } else {
273
+                    console.log('没有支付',);
274
+                    goPayPage(value)
275
+                    return;
276
+                  }
277
+                } else {
278
+                  console.log('没有这个订单-----------',);
279
+                  goPayPage(value)
280
+
281
+                  return;
282
+                }
283
+
284
+              }
285
+            } else {
204
               goPayPage(value)
286
               goPayPage(value)
205
 
287
 
206
-              return;
207
             }
288
             }
208
 
289
 
209
-          }
290
+
291
+          })
210
         } else {
292
         } else {
211
-          goPayPage(value)
293
+          Taro.showToast({
294
+            title: '请选择申领方式',
295
+            icon: 'none',
296
+            duration: 1000
297
+          })
212
 
298
 
213
         }
299
         }
300
+      }
301
+
214
 
302
 
215
 
303
 
216
-      })
217
 
304
 
218
     }
305
     }
219
   }
306
   }
307
 
394
 
308
     })
395
     })
309
   }
396
   }
310
-
311
-  const orgState = [
312
-    {
313
-      value: false,
314
-      text: '个人',
315
-      checked: true,
316
-    },
317
-    {
318
-      value: true,
319
-      text: '企业',
320
-      checked: false,
321
-
322
-    },
323
-
324
-  ]
397
+  const [orgState, setOrgState] = useState([{
398
+    value: false,
399
+    text: '个人',
400
+    checked: false,
401
+  },
402
+  {
403
+    value: true,
404
+    text: '企业',
405
+    checked: false,
406
+
407
+  }])
408
+
409
+  // const orgState = [
410
+  //   {
411
+  //     value: false,
412
+  //     text: '个人',
413
+  //     checked: true,
414
+  //   },
415
+  //   {
416
+  //     value: true,
417
+  //     text: '企业',
418
+  //     checked: false,
419
+  //   },
420
+
421
+  // ]
325
 
422
 
326
 
423
 
327
 
424
 
360
 
457
 
361
   })
458
   })
362
 
459
 
363
-  // let rules = {
364
-  //   petId: [{ required: true, message: '请填写狗狗名称' }],
365
-  //   petSex: [{ type: 'number', required: true, message: '请填写狗狗性别' }],
366
-  //   petBirthday: [{ required: true, message: '请选择狗狗生日' }],
367
-  //   petColor: [{ required: true, message: '请选择狗狗毛色' }],
368
-  //   petType: [{ required: true, message: '请选择犬种类别' }],
369
-  //   img1: [{ required: true, message: '请上传狗狗照片' }],
370
-  //   immunizationDate: [{ required: true, message: '请上输入最近免疫时间' }],
371
-  //   immunizationCode: [{ required: true, message: '请输入免疫证号' }],
372
-  //   immunizationImg: [{ required: true, message: '请上传免疫图片' }],
373
-
374
-  //   address: [{ required: true, message: '请输入详细地址' }],
375
-
376
-  // }
377
-
378
-
379
   return (
460
   return (
380
     <>
461
     <>
381
       <AuthProfile />
462
       <AuthProfile />
458
               {
539
               {
459
                 !isOrgState ? <></> : <>
540
                 !isOrgState ? <></> : <>
460
                   <FormItem title='企业名称' required >
541
                   <FormItem title='企业名称' required >
461
-                    <Input name='orgName' placeholder='请输入企业名称' />
542
+                    <Input name='orgName' placeholder='请输入企业名称' value={renewalAndReissue?.orgName} />
462
                   </FormItem>
543
                   </FormItem>
463
                   <FormItem title='营业执照' >
544
                   <FormItem title='营业执照' >
464
                     <uploader name='orgLicense' onFile={handleFile} />
545
                     <uploader name='orgLicense' onFile={handleFile} />