[baozhangchao] 3 年之前
父節點
當前提交
5abd7c4998

+ 89
- 41
src/pages/ApplicationList/components/AppliCard/index.jsx 查看文件

4
 import './style.less'
4
 import './style.less'
5
 
5
 
6
 export default (props) => {
6
 export default (props) => {
7
-  const { onClick, } = props;
7
+  const { onClick, item, copy } = props;
8
+
9
+  const cardStatus = (ite) => {
10
+    if (item.status === 0) {
11
+      return {
12
+        title: '未付款',
13
+        styleColor: ''
14
+
15
+      }
16
+    } else if (item.status == 1) {
17
+      return {
18
+        title: '审核中',
19
+        styleColor: ''
20
+      }
21
+    } else if (item.status == 2 && item.verifyStatus == 2) {
22
+      return {
23
+        title: '驳回',
24
+        styleColor: 'red'
25
+
26
+      }
27
+
28
+    } else if (item.status == 2 && item.verifyStatus == 1) {
29
+      return {
30
+        title: '待发卡',
31
+        styleColor: ''
32
+
33
+      }
34
+    } else if (item.status == 3) {
35
+      return {
36
+        title: '已完成',
37
+        styleColor: '#04bd02'
38
+
39
+      }
40
+    }
41
+
42
+  }
43
+
44
+  // 状态  如果 status 0 未付款 
45
+  //       如果1审核中   
46
+  //        驳回  status: 2 ||  verifyStatus: 2 驳回
47
+
48
+  //        待发卡  status: 2 ||  verifyStatus: 1 待发卡 
49
+
50
+  //        status 3
8
 
51
 
9
 
52
 
10
   return (
53
   return (
11
     <View className='ApplicationListBox'>
54
     <View className='ApplicationListBox'>
12
       <View className='ApplicationListBox-CardBox'>
55
       <View className='ApplicationListBox-CardBox'>
13
-
14
         <View className='ApplicationListBox-CardBox-headerTop'>
56
         <View className='ApplicationListBox-CardBox-headerTop'>
15
           狗狗姓名
57
           狗狗姓名
16
           <View className='ApplicationListBox-CardBox-headerTop-right'>
58
           <View className='ApplicationListBox-CardBox-headerTop-right'>
17
-            <View>我的二狗子</View>
59
+            <View>{item.petName}</View>
18
 
60
 
19
-            <Image src='https://gss0.baidu.com/7Po3dSag_xI4khGko9WTAnF6hhy/zhidao/pic/item/48540923dd54564e953f5e6cbede9c82d1584f08.jpg' />
61
+            <Image src={item.img1} />
20
           </View>
62
           </View>
21
         </View>
63
         </View>
22
-        {/* 状态
23
-
24
-待付款 
25
-审核中 > 驳回 点击去修改  /退款
26
-驳回原因
27
-
28
-待发卡
29
-已完成 
30
-
31
-        狗名字
32
-        时间
33
-        方式
34
-        状态
35
-        单号+快递公司
36
-*/}
37
-
38
         <View className='ApplicationListBox-CardBox-content'>
64
         <View className='ApplicationListBox-CardBox-content'>
39
           <View>申请时间</View>
65
           <View>申请时间</View>
40
-          <View>2022-05-06 12:36</View>
66
+          <View>{item.createDate}</View>
41
         </View>
67
         </View>
42
         <View className='ApplicationListBox-CardBox-content'>
68
         <View className='ApplicationListBox-CardBox-content'>
43
           <View>审领方式</View>
69
           <View>审领方式</View>
44
-          <View>邮寄</View>
70
+          <View>{item.applyMethod == 1 ? '自取' : '邮寄'}</View>
45
         </View>
71
         </View>
46
         <View className='ApplicationListBox-CardBox-content'>
72
         <View className='ApplicationListBox-CardBox-content'>
47
           <View>状态</View>
73
           <View>状态</View>
48
-          <View>已完成</View>
74
+          <View style={{ color: cardStatus(item)?.styleColor }}>{cardStatus(item)?.title}</View>
49
         </View>
75
         </View>
50
-        <View className='ApplicationListBox-CardBox-content'>
51
-          <View>邮政快递</View>
52
-          <View>3200222000</View>
53
-        </View>
54
-        <View>
76
+        {
77
+          cardStatus(item)?.title == '已完成' ?
78
+            <View className='ApplicationListBox-CardBox-content' onClick={() => { copy(item.trackingNo) }}>
79
+              <View>{item.trackingType}</View>
80
+              <View>{item.trackingNo}</View>
81
+            </View>
82
+            : <></>
83
+        }
84
+        {
85
+          cardStatus(item)?.title == '驳回' ?
86
+            <View>
87
+              <View className='ApplicationListBox-CardBox-refuse'>
88
+                <View>驳回原因</View>
89
+                <View>{item.rejectReason}</View>
90
+              </View>
91
+              <View style={{ margin: '0.5em 0 0.2em 0' }}>
92
+                <Button
93
+                  style={{ width: '135px', height: '35px', fontSize: '14px', backgroundColor: '#fbd804', borderRadius: '40px', color: '#000', border: '0px' }}
94
+                  class='weui-btn' type='primary'
95
+                  loading={false}
96
+                  onClick={() => { onClick(item.petId) }}
97
+                >重新填写</Button>
98
+              </View>
99
+            </View>
100
+            : <></>
101
+        }
55
 
102
 
56
-          <View className='ApplicationListBox-CardBox-refuse'>
57
-            <View>驳回原因</View>
58
-            <View>因地区政策原因,疫苗报告失效,请重新填写申请信息。</View>
59
-          </View>
60
-          <View style={{ margin: '0.5em 0 0.2em 0' }}>
61
-            <Button
62
-              style={{ width: '135px', height: '35px', fontSize: '14px', backgroundColor: '#fbd804', borderRadius: '40px', color: '#000', border: '0px' }}
63
-              class='weui-btn' type='primary'
64
-              loading={false}
65
-              onClick={onClick}
66
-            >重新填写</Button>
67
-          </View>
68
-        </View>
103
+        {
104
+          cardStatus(item)?.title == '未付款' ?
105
+            <View>
106
+              <View style={{ margin: '0.5em 0 0.2em 0' }}>
107
+                <Button
108
+                  style={{ width: '135px', height: '35px', fontSize: '14px', backgroundColor: '#fbd804', borderRadius: '40px', color: '#000', border: '0px' }}
109
+                  class='weui-btn' type='primary'
110
+                  loading={false}
111
+                  onClick={() => { onClick('pay', item.applyId) }}
112
+                >支付</Button>
113
+              </View>
114
+            </View>
115
+            : <></>
116
+        }
69
 
117
 
70
       </View>
118
       </View>
71
 
119
 

+ 2
- 1
src/pages/ApplicationList/index.config.js 查看文件

1
 export default {
1
 export default {
2
-  navigationBarTitleText: '申请状态列表',
2
+  navigationBarTitleText: '申请列表',
3
   disableScroll: true,
3
   disableScroll: true,
4
   navigationBarBackgroundColor: "#FBD804",
4
   navigationBarBackgroundColor: "#FBD804",
5
   navigationBarTextStyle: "black",
5
   navigationBarTextStyle: "black",
6
   backgroundColor: "#FBD804",
6
   backgroundColor: "#FBD804",
7
   usingComponents: {
7
   usingComponents: {
8
+    "mp-loading": "weui-miniprogram/loading/loading"
8
 
9
 
9
   }
10
   }
10
 
11
 

+ 51
- 15
src/pages/ApplicationList/index.jsx 查看文件

1
 import { ScrollView, View, Image, Button } from '@tarojs/components'
1
 import { ScrollView, View, Image, Button } from '@tarojs/components'
2
-import Taro from '@tarojs/taro';
2
+import Taro, { useDidShow } from '@tarojs/taro';
3
 import { useState, useEffect } from 'react';
3
 import { useState, useEffect } from 'react';
4
-import { getOrder } from '../../services/dogAPI';
4
+import { getApplicationList, getOrder } from '../../services/dogAPI';
5
 import AppliCard from './components/AppliCard';
5
 import AppliCard from './components/AppliCard';
6
 import './style.less'
6
 import './style.less'
7
 
7
 
8
 export default (props) => {
8
 export default (props) => {
9
   const id = Taro.getCurrentInstance().router.params.id;
9
   const id = Taro.getCurrentInstance().router.params.id;
10
-  const [orderInfo, setOrderInfo] = useState()
10
+  const [applionList, setApplionList] = useState([])
11
+  const [applionLoading, setApplionLoading] = useState(false)
11
 
12
 
12
-  useEffect(() => {
13
-    if (id) {
14
-      getOrder(id).then((e) => {
15
-        console.log('e', e);
16
-        setOrderInfo(e)
17
-      })
18
-    }
13
+  useDidShow(() => {
14
+    setApplionLoading(true)
19
 
15
 
20
-  }, [id])
16
+    getApplicationList({ pageSize: 500 }).then((e) => {
17
+      console.log('e', e);
18
+      setApplionList(e.records)
19
+      setApplionLoading(false)
21
 
20
 
22
-  const goSetDogLicense = () => {
23
-    Taro.navigateTo({
24
-      url: '/pages/setDogLicense/index'
21
+    })
22
+  }, [])
23
+  const trackingCopy = (value) => {
24
+    Taro.setClipboardData({
25
+      data: value,
26
+      success: e => {
27
+        Taro.showToast({
28
+          title: '快递单号已复制',
29
+          icon: 'success',
30
+          duration: 2000,
31
+        })
32
+      }
25
     })
33
     })
26
   }
34
   }
35
+  const goSetDogLicense = (e, Id) => {
36
+    if (e == 'pay') {
37
+      Taro.navigateTo({
38
+        url: `/pages/payPage/index?id=${Id}`
39
+      })
40
+    } else {
41
+      Taro.navigateTo({
42
+        url: `/pages/setDogLicense/index?type=first&petId=${Id}`
43
+      })
44
+    }
45
+
46
+  }
27
 
47
 
28
 
48
 
29
   return (
49
   return (
30
     <ScrollView scrollY style={{ height: '100vh' }}>
50
     <ScrollView scrollY style={{ height: '100vh' }}>
31
-      <AppliCard onClick={goSetDogLicense} />
51
+      {
52
+        applionLoading ? <mp-loading extClass="page-loading-circle" type="circle" show={applionLoading} /> :
53
+
54
+          <>
55
+
56
+            {
57
+              applionList.map((item, index) => {
58
+                return (
59
+                  <AppliCard key={index} item={item} onClick={goSetDogLicense} copy={trackingCopy} />
60
+
61
+                )
62
+
63
+              })
64
+            }
65
+          </>
66
+      }
67
+
32
 
68
 
33
       <View style={{ textAlign: 'center', margin: '6vw 0 3vw 0', color: '#858585', fontSize: '12px' }}>
69
       <View style={{ textAlign: 'center', margin: '6vw 0 3vw 0', color: '#858585', fontSize: '12px' }}>
34
         申请驳回,费用将原路退回支付账户!
70
         申请驳回,费用将原路退回支付账户!

+ 6
- 0
src/pages/ApplicationList/style.less 查看文件

1
+.page-loading-circle {
2
+  .weui-loading {
3
+    width: 96rpx;
4
+    height: 96rpx;
5
+  }
6
+}

+ 5
- 6
src/pages/dogCardDetail/index.jsx 查看文件

2
 import Taro from '@tarojs/taro';
2
 import Taro from '@tarojs/taro';
3
 import { useEffect, useState } from 'react';
3
 import { useEffect, useState } from 'react';
4
 import RatioItem from '@/components/RatioItem';
4
 import RatioItem from '@/components/RatioItem';
5
-import { getApplicationInfo } from '../../services/dogAPI';
5
+import { getDogCardInfo } from '../../services/dogAPI';
6
 
6
 
7
 import './style.less'
7
 import './style.less'
8
 
8
 
9
 export default (props) => {
9
 export default (props) => {
10
-  const status = 2;
11
   const petId = Taro.getCurrentInstance().router.params.id
10
   const petId = Taro.getCurrentInstance().router.params.id
12
   const [applicationInfoDate, setApplicationInfoDate] = useState()
11
   const [applicationInfoDate, setApplicationInfoDate] = useState()
13
   useEffect(() => {
12
   useEffect(() => {
14
     if (petId) {
13
     if (petId) {
15
-      getApplicationInfo(petId).then((e) => {
14
+      getDogCardInfo(petId).then((e) => {
16
         setApplicationInfoDate(e)
15
         setApplicationInfoDate(e)
17
 
16
 
18
       })
17
       })
48
               </View>
47
               </View>
49
               <View className='cell'>
48
               <View className='cell'>
50
                 <View className='lable'>性别</View>:
49
                 <View className='lable'>性别</View>:
51
-                <View className='content'>{applicationInfoDate?.petSex}</View>
50
+                <View className='content'>{applicationInfoDate?.petSex == 1 ? '雄' : '雌'}</View>
52
               </View>
51
               </View>
53
             </View>
52
             </View>
54
             <View className='cardRight'>
53
             <View className='cardRight'>
55
               <RatioItem ratio='109:151'>
54
               <RatioItem ratio='109:151'>
56
                 <Image
55
                 <Image
57
                   style={{ width: '100%' }}
56
                   style={{ width: '100%' }}
58
-                  mode='center'
57
+                  mode='widthFix'
59
                   src={applicationInfoDate?.petImg1}
58
                   src={applicationInfoDate?.petImg1}
60
                 ></Image>
59
                 ></Image>
61
               </RatioItem>
60
               </RatioItem>
63
           </View >
62
           </View >
64
           <View className='cell' style={{ marginTop: '0' }}>
63
           <View className='cell' style={{ marginTop: '0' }}>
65
             <View className='lable'>状态</View>:
64
             <View className='lable'>状态</View>:
66
-            <View className={['state', 'color' + status]}>{applicationInfoDate?.status == 1 ? '正常' : applicationInfoDate?.status == 2 ? '挂失' : '过期'}</View>
65
+            <View className={['state', 'color' + applicationInfoDate?.status]}>{applicationInfoDate?.status == 1 ? '正常' : applicationInfoDate?.status == 2 ? '挂失' : '过期'}</View>
67
             {/* 挂失 续期 */}
66
             {/* 挂失 续期 */}
68
           </View>
67
           </View>
69
           <View className='cell'>
68
           <View className='cell'>

+ 2
- 1
src/pages/dogLicenseList/index.jsx 查看文件

25
   }
25
   }
26
 
26
 
27
   const widgetView = (value) => {
27
   const widgetView = (value) => {
28
+    console.log("🚀 ~ file: index.jsx ~ line 28 ~ widgetView ~ value", value)
28
     return (
29
     return (
29
-      <View className='user-box-DogListCard' onClick={() => { goLicenseInfo(value.petId) }}>
30
+      <View className='user-box-DogListCard' onClick={() => { goLicenseInfo(value.cardId) }}>
30
         <View className='user-box-DogListCard-DogImage'>
31
         <View className='user-box-DogListCard-DogImage'>
31
           {/* <ViewIcon icon='morentouxiang' size={50} color='#FBD804' /> */}
32
           {/* <ViewIcon icon='morentouxiang' size={50} color='#FBD804' /> */}
32
           <Image src={value.petImg1} />
33
           <Image src={value.petImg1} />

+ 2
- 1
src/pages/index/index.jsx 查看文件

4
 import Banner from '@/components/Banner'
4
 import Banner from '@/components/Banner'
5
 import Notice from '@/components/Notice'
5
 import Notice from '@/components/Notice'
6
 import PageLoading from '@/components/PageLoading'
6
 import PageLoading from '@/components/PageLoading'
7
+import withBasic from '@/layouts/withBasic'
8
+
7
 import { useModel } from '@/store'
9
 import { useModel } from '@/store'
8
 import { getApplicationList, getBannerList } from '@/services/dogAPI'
10
 import { getApplicationList, getBannerList } from '@/services/dogAPI'
9
-import withBasic from '@/layouts/withBasic'
10
 import MenuItem from './components/MenuItem'
11
 import MenuItem from './components/MenuItem'
11
 
12
 
12
 import './style.less'
13
 import './style.less'

+ 1
- 0
src/pages/payPage/index.config.js 查看文件

5
   navigationBarTextStyle: "black",
5
   navigationBarTextStyle: "black",
6
   backgroundColor: "#FBD804",
6
   backgroundColor: "#FBD804",
7
   usingComponents: {
7
   usingComponents: {
8
+    "mp-loading": "weui-miniprogram/loading/loading"
8
 
9
 
9
   }
10
   }
10
 
11
 

+ 38
- 27
src/pages/payPage/index.jsx 查看文件

1
 import { ScrollView, View, Button } from '@tarojs/components'
1
 import { ScrollView, View, Button } from '@tarojs/components'
2
-import Taro from '@tarojs/taro';
2
+import Taro, { reLaunch } from '@tarojs/taro';
3
 import { useState, useEffect } from 'react';
3
 import { useState, useEffect } from 'react';
4
 import { getOrder } from '@/services/dogAPI';
4
 import { getOrder } from '@/services/dogAPI';
5
 import './style.less'
5
 import './style.less'
7
 export default (props) => {
7
 export default (props) => {
8
   const id = Taro.getCurrentInstance().router.params.id;
8
   const id = Taro.getCurrentInstance().router.params.id;
9
   const [orderInfo, setOrderInfo] = useState()
9
   const [orderInfo, setOrderInfo] = useState()
10
-
10
+  const [payLoading, setPayLoading] = useState(false)
11
   useEffect(() => {
11
   useEffect(() => {
12
     if (id) {
12
     if (id) {
13
+      setPayLoading(true)
13
       getOrder(id).then((e) => {
14
       getOrder(id).then((e) => {
14
         console.log('e', e);
15
         console.log('e', e);
15
         setOrderInfo(e)
16
         setOrderInfo(e)
17
+        setPayLoading(false)
18
+
16
       })
19
       })
17
     }
20
     }
18
 
21
 
20
 
23
 
21
   const pay = (params) => {
24
   const pay = (params) => {
22
     Taro.hideLoading()
25
     Taro.hideLoading()
23
-    console.log("🚀 ~ file: index.jsx ~ line 92 ~ requestPayment ~ params", params)
24
     Taro.requestPayment({
26
     Taro.requestPayment({
25
-      // ...params,
26
-      // package: params.packageValue,
27
+      ...orderInfo.prepay,
28
+      package: orderInfo.prepay.packageValue,
27
       success: () => {
29
       success: () => {
28
         Taro.showToast({
30
         Taro.showToast({
29
           title: "支付成功",
31
           title: "支付成功",
30
           icon: "success",
32
           icon: "success",
31
           duration: 1000,
33
           duration: 1000,
32
         }).then(() => {
34
         }).then(() => {
35
+          console.log('支付成功',);
33
           setTimeout(() => {
36
           setTimeout(() => {
34
             Taro.reLaunch({
37
             Taro.reLaunch({
35
-              // url: `/pages/index/index?tab=2`
38
+              url: '/pages/ApplicationList/index'
36
             })
39
             })
37
           }, 400)
40
           }, 400)
38
         })
41
         })
43
           icon: "none",
46
           icon: "none",
44
           duration: 2000,
47
           duration: 2000,
45
         });
48
         });
46
-        Taro.reLaunch({
47
-          // url: `/pages/MineUserAll/AllOrder/index?tabJump=1`
48
-        })
49
+        console.log('支付失败', e);
50
+
49
       },
51
       },
50
     })
52
     })
51
   }
53
   }
52
 
54
 
53
   return (
55
   return (
54
     <ScrollView scrollY style={{ height: '100vh' }}>
56
     <ScrollView scrollY style={{ height: '100vh' }}>
55
-      <View className='payPageBox'>
56
-        <View className='payPageBox-payItemBox'>
57
-          <View className='payPageBox-payItemBox-left'></View>
58
-          <View className='payPageBox-payItemBox-content'>订单号: <View>32121321321</View></View>
59
-        </View>
60
-        <View className='payPageBox-payItemBox'>
61
-          <View className='payPageBox-payItemBox-leftText'>工本费: <View>20</View>元</View>
62
-        </View>
63
-        <View className='payPageBox-payItemBox'>
64
-          <View className='payPageBox-payItemBox-leftText'>快递费: <View>3221321</View>元</View>
65
-        </View>
66
-        <View className='payPageBox-payItemBox'>
67
-          <View className='payPageBox-payItemBox-leftText'>总金额: <View style={{ color: 'red' }}>20</View>元</View>
68
-        </View>
69
-      </View>
70
-      <View slot='button' style={{ margin: '4em 0 2em 0' }}>
71
-        <Button style={{ backgroundColor: '#fbd804', borderRadius: '40px', color: '#000', border: '0px' }} class='weui-btn' type='primary' loading={false} onClick={pay}>支付</Button>
72
-      </View>
57
+      {
58
+        payLoading ? <mp-loading extClass="page-loading-circle" type="circle" show={payLoading} /> :
59
+          <>
60
+            <View className='payPageBox'>
61
+              <View className='payPageBox-payItemBox'>
62
+                <View className='payPageBox-payItemBox-left'></View>
63
+                <View className='payPageBox-payItemBox-content'>订单号: <View>{orderInfo?.order?.orderNo}</View></View>
64
+              </View>
65
+              <View className='payPageBox-payItemBox'>
66
+                <View className='payPageBox-payItemBox-leftText'>下单时间: <View>{orderInfo?.order?.createDate}</View></View>
67
+              </View>
68
+              <View className='payPageBox-payItemBox'>
69
+                <View className='payPageBox-payItemBox-leftText'>工本费: <View>{orderInfo?.order?.productionCost / 100}</View>元</View>
70
+              </View>
71
+              <View className='payPageBox-payItemBox'>
72
+                <View className='payPageBox-payItemBox-leftText'>快递费: <View>{orderInfo?.order?.expressFee / 100}</View>元</View>
73
+              </View>
74
+              <View className='payPageBox-payItemBox'>
75
+                <View className='payPageBox-payItemBox-leftText'>总金额: <View style={{ color: 'red' }}>{orderInfo?.order?.charges / 100}</View>元</View>
76
+              </View>
77
+            </View>
78
+            <View slot='button' style={{ margin: '4em 0 2em 0' }}>
79
+              <Button style={{ backgroundColor: '#fbd804', borderRadius: '40px', color: '#000', border: '0px' }} class='weui-btn' type='primary' loading={false} onClick={pay}>支付</Button>
80
+            </View>
81
+          </>
82
+      }
83
+
73
     </ScrollView>
84
     </ScrollView>
74
   )
85
   )
75
 }
86
 }

+ 7
- 0
src/pages/payPage/style.less 查看文件

1
+.page-loading-circle {
2
+  .weui-loading {
3
+    width: 96rpx;
4
+    height: 96rpx;
5
+  }
6
+}
7
+
1
 .payPageBox {
8
 .payPageBox {
2
   width: 86%;
9
   width: 86%;
3
   background-color: #fff;
10
   background-color: #fff;

+ 82
- 32
src/pages/setDogLicense/index.jsx 查看文件

14
 export default (props) => {
14
 export default (props) => {
15
   const { dogs, person } = useModel('userData')
15
   const { dogs, person } = useModel('userData')
16
   const [formData, setFormData] = useState()
16
   const [formData, setFormData] = useState()
17
+  const routerPetId = Taro.getCurrentInstance().router.params.petId;
17
 
18
 
18
   const [dogDate, setDogDate] = useState({ immunizationDate: null, petBirthday: null, petSex: [], petType: [] })
19
   const [dogDate, setDogDate] = useState({ immunizationDate: null, petBirthday: null, petSex: [], petType: [] })
19
   const [mainDog, setMainDog] = useState([])
20
   const [mainDog, setMainDog] = useState([])
49
     })
50
     })
50
   }, [])
51
   }, [])
51
 
52
 
53
+
52
   const getDogInfoFunction = (petId) => {
54
   const getDogInfoFunction = (petId) => {
53
 
55
 
54
     getDogInfo(petId).then((e) => {
56
     getDogInfo(petId).then((e) => {
56
       const sex = [{ value: e?.sex, text: e?.sex == 1 ? '雄' : '雌' }];
58
       const sex = [{ value: e?.sex, text: e?.sex == 1 ? '雄' : '雌' }];
57
       const petType = [{ value: 0, name: e?.petType }];
59
       const petType = [{ value: 0, name: e?.petType }];
58
 
60
 
59
-      setDogDate({ ...dogDate, petBirthday: e?.birthday, petSex: sex, petType: petType })
61
+      setDogDate({ ...dogDate, petBirthday: e?.birthday, petSex: sex, petType: petType, })
60
       console.log('test', e);
62
       console.log('test', e);
61
 
63
 
62
     })
64
     })
64
   const getMainDogChange = (value) => {
66
   const getMainDogChange = (value) => {
65
     console.log("🚀 ~ file: index.jsx ~ line 34 ~ getMainDogChange ~ value", value)
67
     console.log("🚀 ~ file: index.jsx ~ line 34 ~ getMainDogChange ~ value", value)
66
     const { petId } = value.detail.data
68
     const { petId } = value.detail.data
67
-    if (applyType == 'renewal' || (applyType == 'reissue')) {
69
+    if (applyType == 'renewal' || applyType == 'reissue') {
68
       setDogStatus(false)
70
       setDogStatus(false)
69
       getDogInfoFunction(petId)
71
       getDogInfoFunction(petId)
70
       getCardLicenseInfo(petId).then((res) => {
72
       getCardLicenseInfo(petId).then((res) => {
71
         console.log('狗子证件有效期', res);
73
         console.log('狗子证件有效期', res);
74
+        setRenewalAndReissue(res)
72
       })
75
       })
73
     }
76
     }
74
     if (applyType == 'first') {
77
     if (applyType == 'first') {
78
           getDogInfoFunction(petId)
81
           getDogInfoFunction(petId)
79
         } else {
82
         } else {
80
           setDogStatus(true)
83
           setDogStatus(true)
81
-          Taro.showToast({
82
-            title: '当前狗狗已有证件!',
83
-            icon: 'error',
84
-            duration: 2000,
84
+          Taro.showModal({
85
+            title: '提示',
86
+            content: '当前狗狗已有证件,请勿重复申请!',
87
+            showCancel: false,
88
+            success: function (v) {
89
+              if (v.confirm) {
90
+                console.log('用户点击确定')
91
+                Taro.navigateBack({
92
+                  delta: 1
93
+                })
94
+              }
95
+            }
85
           })
96
           })
86
 
97
 
98
+
87
         }
99
         }
88
       })
100
       })
89
     }
101
     }
114
   const modeList = [
126
   const modeList = [
115
     {
127
     {
116
       value: 1,
128
       value: 1,
117
-      text: '邮寄',
129
+      text: '自取',
118
     },
130
     },
119
     {
131
     {
120
       value: 2,
132
       value: 2,
121
-      text: '自取',
133
+      text: '邮寄',
122
     },
134
     },
123
   ]
135
   ]
124
 
136
 
125
   // ...dogDate,
137
   // ...dogDate,
126
   const formSubmit = value => {
138
   const formSubmit = value => {
127
-    addlication({ ...value, applyType }).then((res) => {
128
-      console.log('dogInfo xinwe', res);
129
-      Taro.showToast({
130
-        title: '申请成功,等待审核',
131
-        icon: 'none',
132
-        duration: 1000
133
-      })
134
-      if (applyType == 'renewal') {
135
-        Taro.navigateBack({
136
-          delta: 1
139
+    if (applyType == 'renewal' || applyType == 'reissue') {
140
+      addlication({ ...value, applyType, petId: formData.petId, originCardNo: renewalAndReissue?.cardNo }).then((res) => {
141
+        console.log('dogInfo xinwe', res);
142
+        Taro.showToast({
143
+          title: '申请成功,等待审核',
144
+          icon: 'none',
145
+          duration: 1000
137
         })
146
         })
138
-        return;
139
-      } else {
140
-        Taro.reLaunch({
141
-          url: `/pages/payPage/index?id=${res.applyId}`
147
+        if (applyType == 'renewal') {
148
+          Taro.navigateBack({
149
+            delta: 1
150
+          })
151
+          return;
152
+        } else {
153
+          Taro.reLaunch({
154
+            url: `/pages/payPage/index?id=${res.applyId}`
155
+          })
156
+        }
157
+
158
+      })
159
+    } else {
160
+      addlication({ ...value, applyType, petId: formData.petId }).then((res) => {
161
+        console.log('dogInfo xinwe', res);
162
+        Taro.showToast({
163
+          title: '申请成功,等待审核',
164
+          icon: 'none',
165
+          duration: 1000
142
         })
166
         })
143
-      }
167
+        if (applyType == 'renewal') {
168
+          Taro.navigateBack({
169
+            delta: 1
170
+          })
171
+          return;
172
+        } else {
173
+          Taro.reLaunch({
174
+            url: `/pages/payPage/index?id=${res.applyId}`
175
+          })
176
+        }
177
+
178
+      })
179
+    }
144
 
180
 
145
-    })
146
   }
181
   }
147
 
182
 
148
   const rules = {
183
   const rules = {
151
     petBirthday: [{ required: true, message: '请选择狗狗生日' }],
186
     petBirthday: [{ required: true, message: '请选择狗狗生日' }],
152
     petColor: [{ required: true, message: '请选择狗狗毛色' }],
187
     petColor: [{ required: true, message: '请选择狗狗毛色' }],
153
     petType: [{ required: true, message: '请选择犬种类别' }],
188
     petType: [{ required: true, message: '请选择犬种类别' }],
154
-    dogImg1: [{ required: true, message: '请上传狗狗照片' }],
189
+    img1: [{ required: true, message: '请上传狗狗照片' }],
155
     immunizationDate: [{ required: true, message: '请上输入最近免疫时间' }],
190
     immunizationDate: [{ required: true, message: '请上输入最近免疫时间' }],
156
     immunizationCode: [{ required: true, message: '请输入免疫证号' }],
191
     immunizationCode: [{ required: true, message: '请输入免疫证号' }],
157
     immunizationImg: [{ required: true, message: '请上传免疫图片' }],
192
     immunizationImg: [{ required: true, message: '请上传免疫图片' }],
169
               <FormItem title='犬主姓名' required>
204
               <FormItem title='犬主姓名' required>
170
                 <View >{person?.nickName}</View>
205
                 <View >{person?.nickName}</View>
171
               </FormItem>
206
               </FormItem>
172
-              <FormItem title='证件号' required>
173
-                <View >{person?.nickName}</View>
174
-              </FormItem>
175
-              <FormItem title='有效期' required>
176
-                <View >{person?.nickName}</View>
177
-              </FormItem>
207
+              {
208
+                applyType == 'first' ? <></>
209
+                  :
210
+                  <>
211
+                    <FormItem title='证件号' required>
212
+                      <View >{renewalAndReissue?.cardNo}</View>
213
+                    </FormItem>
214
+                    <FormItem title='有效期' required>
215
+                      {
216
+                        formData?.sex ?
217
+                          <View >
218
+
219
+                            {renewalAndReissue?.startDate}~{renewalAndReissue?.expireDate}</View>
220
+                          :
221
+                          <View></View>
222
+                      }
223
+
224
+                    </FormItem>
225
+                  </>
226
+              }
227
+
178
               <FormItem title='狗狗名称' required>
228
               <FormItem title='狗狗名称' required>
179
                 <s-picker name='petName' rangeKey='name' rangeValue='value' range={mainDog} value={formData?.name} onChange={getMainDogChange} />
229
                 <s-picker name='petName' rangeKey='name' rangeValue='value' range={mainDog} value={formData?.name} onChange={getMainDogChange} />
180
               </FormItem>
230
               </FormItem>
201
                 <Input name='petColor' placeholder='请输入毛色' value={formData?.color} />
251
                 <Input name='petColor' placeholder='请输入毛色' value={formData?.color} />
202
               </FormItem>
252
               </FormItem>
203
               <FormItem title='狗狗照片' required>
253
               <FormItem title='狗狗照片' required>
204
-                <uploader name='dogImg1' onFile={handleFile} value={formData?.image} />
254
+                <uploader name='img1' onFile={handleFile} value={formData?.image} />
205
               </FormItem>
255
               </FormItem>
206
               <FormItem title='最近免疫日期' required>
256
               <FormItem title='最近免疫日期' required>
207
                 <Picker name='immunizationDate' mode='date' onChange={(e) => { onDateChange('immunizationDate', e.detail.value) }}>
257
                 <Picker name='immunizationDate' mode='date' onChange={(e) => { onDateChange('immunizationDate', e.detail.value) }}>

+ 0
- 1
src/services/dogAPI.js 查看文件

108
 
108
 
109
 
109
 
110
 
110
 
111
-
112
 /**
111
 /**
113
 * 消息列表
112
 * 消息列表
114
 * @param {*} data
113
 * @param {*} data