Przeglądaj źródła

Merge branch 'master' of http://git.ycjcjy.com/pet_identity/miniapp

张延森 3 lat temu
rodzic
commit
a3879ad21e

+ 1
- 0
config/prod.js Wyświetl plik

@@ -3,6 +3,7 @@ module.exports = {
3 3
     NODE_ENV: '"production"'
4 4
   },
5 5
   defineConstants: {
6
+    HOST: '"https://pet-certificate-online.njyunzhi.com"',
6 7
   },
7 8
   mini: {},
8 9
   h5: {

+ 8
- 0
src/pages/ApplicationList/components/AppliCard/index.jsx Wyświetl plik

@@ -69,6 +69,10 @@ export default (props) => {
69 69
           <View>审领方式</View>
70 70
           <View>{item.applyMethod == 1 ? '自取' : '邮寄'}</View>
71 71
         </View>
72
+        <View className='ApplicationListBox-CardBox-content'>
73
+          <View>申请类型</View>
74
+          <View>{item.applyType == 'first' ? '办证申请' : item.applyType == 'renewal' ? '证件续期' : item.applyType == 'reissue' ? '证件补办' : '异常'}</View>
75
+        </View>
72 76
         <View className='ApplicationListBox-CardBox-content'>
73 77
           <View>状态</View>
74 78
           <View style={{ color: cardStatus(item)?.styleColor }}>{cardStatus(item)?.title}</View>
@@ -84,6 +88,10 @@ export default (props) => {
84 88
         {
85 89
           cardStatus(item)?.title == '驳回' ?
86 90
             <View>
91
+              <View className='ApplicationListBox-CardBox-content'>
92
+                <View>退款方式</View>
93
+                <View>原路退回支付账户</View>
94
+              </View>
87 95
               <View className='ApplicationListBox-CardBox-refuse'>
88 96
                 <View>驳回原因</View>
89 97
                 <View>{item.rejectReason}</View>

+ 16
- 10
src/pages/ApplicationList/index.jsx Wyświetl plik

@@ -48,26 +48,32 @@ export default (props) => {
48 48
   return (
49 49
     <>
50 50
       {
51
-        applionLoading ? <mp-loading extClass="page-loading-circle" type="circle" show={applionLoading} /> :
51
+        !applionLoading ?
52
+
52 53
 
53
-          <>
54 54
 
55
+          <>
55 56
             {
56
-              applionList.map((item, index) => {
57
-                return (
58
-                  <AppliCard key={index} item={item} onClick={goSetDogLicense} copy={trackingCopy} />
59 57
 
60
-                )
58
+              applionLoading ? <mp-loading extClass="page-loading-circle" type="circle" show={applionLoading} /> :
59
+                applionList.map((item, index) => {
60
+                  return (
61
+                    <AppliCard key={index} item={item} onClick={goSetDogLicense} copy={trackingCopy} />
61 62
 
62
-              })
63
+                  )
64
+
65
+                })
63 66
             }
67
+
64 68
           </>
69
+          :
70
+          <View style={{ textAlign: 'center', margin: '6vw 0 3vw 0', color: '#858585', fontSize: '12px' }}>
71
+            暂无申请信息
72
+          </View>
65 73
       }
66 74
 
67 75
 
68
-      <View style={{ textAlign: 'center', margin: '6vw 0 3vw 0', color: '#858585', fontSize: '12px' }}>
69
-        申请驳回,费用将原路退回支付账户!
70
-      </View>
76
+
71 77
 
72 78
     </>
73 79
   )

+ 3
- 0
src/pages/NoticeInfo/index.jsx Wyświetl plik

@@ -10,6 +10,9 @@ export default (props) => {
10 10
   const { id } = value.params
11 11
   const [content, setContent] = useState()
12 12
   useEffect(() => {
13
+    Taro.showShareMenu({
14
+      withShareTicket: true
15
+    })
13 16
     if (id) {
14 17
       getNoticeInfo(id).then((res) => {
15 18
         setContent(res)

+ 3
- 0
src/pages/index/index.jsx Wyświetl plik

@@ -28,6 +28,9 @@ const IndexPage = (props) => {
28 28
   const [bannerList, setBannerList] = useState([])
29 29
 
30 30
   useEffect(() => {
31
+    Taro.showShareMenu({
32
+      withShareTicket: true
33
+    })
31 34
     getNoticeList({ pageSize: 5 }).then((res) => {
32 35
       setNoticeList(res.records)
33 36
     })

+ 2
- 1
src/pages/setDogInfo/index.jsx Wyświetl plik

@@ -62,7 +62,8 @@ export default (props) => {
62 62
 
63 63
       addDogInfo(value).then((e) => {
64 64
         console.log("🚀 修改前s", dogs)
65
-        setDogs((dogs || [e]))
65
+        // setDogs((dogs || [e]))
66
+        setDogs((dogs || []).concat(e))
66 67
 
67 68
         console.log("🚀 ~ 保存成功数据", value, e)
68 69
 

+ 51
- 24
src/pages/setDogLicense/index.jsx Wyświetl plik

@@ -15,8 +15,8 @@ import { getCardLicenseInfo } from '../../services/dogAPI';
15 15
 export default (props) => {
16 16
   const { dogs, person } = useModel('userData')
17 17
   const [formData, setFormData] = useState()
18
-  const value = useRouter();
19
-  const { petId } = value.params
18
+  const values = useRouter();
19
+  // const { petId } = value.params
20 20
 
21 21
   const [dogDate, setDogDate] = useState({ immunizationDate: null, petBirthday: null, petSex: [], petType: [] })
22 22
   const [mainDog, setMainDog] = useState([])
@@ -67,13 +67,16 @@ export default (props) => {
67 67
   }
68 68
   const getMainDogChange = (value) => {
69 69
     console.log("🚀 ~ file: index.jsx ~ line 34 ~ getMainDogChange ~ value", value)
70
-    const { petId } = value.detail.data
70
+    const valuess = value.detail.data
71
+    const { petId } = valuess
72
+    setRenewalAndReissue({ ...renewalAndReissue, ...valuess })
73
+
71 74
     if (applyType == 'renewal' || applyType == 'reissue') {
72 75
       setDogStatus(false)
73 76
       getDogInfoFunction(petId)
74 77
       getCardLicenseInfo(petId).then((res) => {
75 78
         console.log('狗子证件有效期', res);
76
-        setRenewalAndReissue(res)
79
+        setRenewalAndReissue({ ...renewalAndReissue, ...res })
77 80
       })
78 81
     }
79 82
     if (applyType == 'first') {
@@ -89,10 +92,10 @@ export default (props) => {
89 92
             showCancel: false,
90 93
             success: function (v) {
91 94
               if (v.confirm) {
92
-                console.log('用户点击确定')
93
-                Taro.navigateBack({
94
-                  delta: 1
95
-                })
95
+                // console.log('用户点击确定')
96
+                // Taro.navigateBack({
97
+                //   delta: 1
98
+                // })
96 99
               }
97 100
             }
98 101
           })
@@ -137,7 +140,7 @@ export default (props) => {
137 140
   ]
138 141
 
139 142
   // ...dogDate,
140
-  const formSubmit = value => {
143
+  const formSubmit = (value) => {
141 144
     if (applyType == 'renewal' || applyType == 'reissue') {
142 145
       addlication({ ...value, applyType, petId: formData.petId, originCardNo: renewalAndReissue?.cardNo }).then((res) => {
143 146
         console.log('dogInfo xinwe', res);
@@ -159,25 +162,48 @@ export default (props) => {
159 162
 
160 163
       })
161 164
     } else {
162
-      addlication({ ...value, applyType, petId: formData.petId }).then((res) => {
163
-        console.log('dogInfo xinwe', res);
164
-        Taro.showToast({
165
-          title: '申请成功,等待审核',
166
-          icon: 'none',
167
-          duration: 1000
168
-        })
169
-        if (applyType == 'renewal') {
170
-          Taro.navigateBack({
171
-            delta: 1
165
+      console.log("🚀 ~ file: index.jsx ~ line 166 ~ getCardLicenseInfo ~ renewalAndReissue", renewalAndReissue)
166
+
167
+      getCardLicenseInfo(renewalAndReissue?.petId).then((res) => {
168
+        if (!res) {
169
+          addlication({ ...value, applyType, petId: formData.petId }).then((res) => {
170
+            console.log('dogInfo xinwe', res);
171
+            Taro.showToast({
172
+              title: '申请成功,等待审核',
173
+              icon: 'none',
174
+              duration: 1000
175
+            })
176
+            if (applyType == 'renewal') {
177
+              Taro.navigateBack({
178
+                delta: 1
179
+              })
180
+              return;
181
+            } else {
182
+              Taro.reLaunch({
183
+                url: `/pages/payPage/index?id=${res.applyId}`
184
+              })
185
+            }
186
+
172 187
           })
173
-          return;
174 188
         } else {
175
-          Taro.reLaunch({
176
-            url: `/pages/payPage/index?id=${res.applyId}`
189
+          Taro.showModal({
190
+            title: '提示',
191
+            content: '当前狗狗已有证件,请勿重复申请!',
192
+            showCancel: false,
193
+            success: function (v) {
194
+              if (v.confirm) {
195
+                // console.log('用户点击确定')
196
+                // Taro.navigateBack({
197
+                //   delta: 1
198
+                // })
199
+              }
200
+            }
177 201
           })
178
-        }
179 202
 
203
+
204
+        }
180 205
       })
206
+
181 207
     }
182 208
 
183 209
   }
@@ -296,7 +322,8 @@ export default (props) => {
296 322
 
297 323
             </mp-cells>
298 324
           </mp-form>
299
-          <Button disabled={dogStatus} title='确定' />
325
+          {/* <Button disabled={dogStatus} title='确定' /> */}
326
+          <Button title='确定' />
300 327
         </Form>
301 328
       </View>
302 329
     </>