[baozhangchao] пре 3 година
родитељ
комит
38c2e535cc

+ 17
- 0
src/components/Button/index.jsx Прегледај датотеку

@@ -0,0 +1,17 @@
1
+import Taro from '@tarojs/taro';
2
+import { View, SwiperItem, Button } from '@tarojs/components';
3
+import './style.less'
4
+
5
+export default (props) => {
6
+  const { disabled, marginTop, marginButtom, title, onClick, width } = props;
7
+
8
+  return (
9
+    <View slot='button' style={{ margin: `${marginTop || '4'}em 0 ${marginButtom || '2'}em 0` }}>
10
+      <Button onClick={onClick || ''} disabled={disabled || false} style={{ backgroundColor: !disabled ? '#fbd804' : '#858585', width: `${width || ''}vw`, borderRadius: '40px', color: '#000', border: '0px' }} class='weui-btn' type='primary' formType='submit'>{title || '确定'}</Button>
11
+    </View>
12
+  )
13
+}
14
+
15
+
16
+
17
+

+ 0
- 0
src/components/Button/style.less Прегледај датотеку


+ 1
- 1
src/pages/ApplicationList/index.config.js Прегледај датотеку

@@ -1,6 +1,6 @@
1 1
 export default {
2 2
   navigationBarTitleText: '申请列表',
3
-  disableScroll: true,
3
+  disableScroll: false,
4 4
   navigationBarBackgroundColor: "#FBD804",
5 5
   navigationBarTextStyle: "black",
6 6
   backgroundColor: "#FBD804",

+ 2
- 3
src/pages/ApplicationList/index.jsx Прегледај датотеку

@@ -6,7 +6,6 @@ import AppliCard from './components/AppliCard';
6 6
 import './style.less'
7 7
 
8 8
 export default (props) => {
9
-  const id = Taro.getCurrentInstance().router.params.id;
10 9
   const [applionList, setApplionList] = useState([])
11 10
   const [applionLoading, setApplionLoading] = useState(false)
12 11
 
@@ -47,7 +46,7 @@ export default (props) => {
47 46
 
48 47
 
49 48
   return (
50
-    <ScrollView scrollY style={{ height: '100vh' }}>
49
+    <>
51 50
       {
52 51
         applionLoading ? <mp-loading extClass="page-loading-circle" type="circle" show={applionLoading} /> :
53 52
 
@@ -70,6 +69,6 @@ export default (props) => {
70 69
         申请驳回,费用将原路退回支付账户!
71 70
       </View>
72 71
 
73
-    </ScrollView>
72
+    </>
74 73
   )
75 74
 }

+ 1
- 1
src/pages/LicenseInfo/index.config.js Прегледај датотеку

@@ -1,6 +1,6 @@
1 1
 export default {
2 2
   navigationBarTitleText: '证件详情',
3
-  disableScroll: true,
3
+  disableScroll: false,
4 4
   navigationBarBackgroundColor: "#FBD804",
5 5
   navigationBarTextStyle: "black",
6 6
   backgroundColor: "#FBD804",

+ 1
- 1
src/pages/NoticeInfo/index.config.js Прегледај датотеку

@@ -1,6 +1,6 @@
1 1
 export default {
2 2
   navigationBarTitleText: '公告详情',
3
-  disableScroll: true,
3
+  disableScroll: false,
4 4
   navigationBarBackgroundColor: "#FBD804",
5 5
   navigationBarTextStyle: "black",
6 6
   backgroundColor: "#FBD804",

+ 5
- 4
src/pages/NoticeInfo/index.jsx Прегледај датотеку

@@ -1,12 +1,13 @@
1 1
 import { View, RichText, ScrollView } from '@tarojs/components'
2
-import Taro from '@tarojs/taro'
2
+import Taro, { useRouter } from '@tarojs/taro'
3 3
 import { useEffect, useState } from 'react'
4 4
 import { getNoticeInfo } from '../../services/dogAPI'
5 5
 
6 6
 import './style.less'
7 7
 
8 8
 export default (props) => {
9
-  const id = Taro.getCurrentInstance().router.params.id;
9
+  const value = useRouter();
10
+  const { id } = value.params
10 11
   const [content, setContent] = useState()
11 12
   useEffect(() => {
12 13
     if (id) {
@@ -21,13 +22,13 @@ export default (props) => {
21 22
   const htmlSnip = content?.content.replace(/<\/p>/g, '</p><p style="height: 1em">&nbsp;</p>')
22 23
 
23 24
   return (
24
-    <ScrollView scrollY style={{ height: '100vh' }}>
25
+    <>
25 26
       <View className='noticeInfo'>
26 27
         <View className='title'>{content?.title}</View>
27 28
         <View className='date'>{content?.createDate}</View>
28 29
         <RichText nodes={htmlSnip}></RichText>
29 30
       </View>
30
-    </ScrollView>
31
+    </>
31 32
   )
32 33
 }
33 34
 

+ 1
- 1
src/pages/dogCardDetail/index.config.js Прегледај датотеку

@@ -1,6 +1,6 @@
1 1
 export default {
2 2
   navigationBarTitleText: '犬证详情',
3
-  disableScroll: true,
3
+  disableScroll: false,
4 4
   navigationBarBackgroundColor: "#FBD804",
5 5
   navigationBarTextStyle: "black",
6 6
   backgroundColor: "#FBD804",

+ 2
- 2
src/pages/dogCardDetail/index.jsx Прегледај датотеку

@@ -30,7 +30,7 @@ const CardDetailPage = (props) => {
30 30
 
31 31
 
32 32
   return (
33
-    <ScrollView scrollY style={{ height: '100vh' }}>
33
+    <>
34 34
       <View className='dogCardDetail'>
35 35
         <View className='card'>
36 36
           <View className='title'>电&nbsp;&nbsp;&nbsp;子&nbsp;&nbsp;&nbsp;版&nbsp;&nbsp;&nbsp;犬&nbsp;&nbsp;&nbsp;证</View>
@@ -89,7 +89,7 @@ const CardDetailPage = (props) => {
89 89
           </View>
90 90
         </View >
91 91
       </View >
92
-    </ScrollView >
92
+    </>
93 93
   )
94 94
 }
95 95
 

+ 1
- 1
src/pages/dogLicenseList/index.config.js Прегледај датотеку

@@ -1,6 +1,6 @@
1 1
 export default {
2 2
   navigationBarTitleText: '证件列表',
3
-  disableScroll: true,
3
+  disableScroll: false,
4 4
   navigationBarBackgroundColor: "#FBD804",
5 5
   navigationBarTextStyle: "black",
6 6
   backgroundColor: "#FBD804",

+ 2
- 2
src/pages/dogLicenseList/index.jsx Прегледај датотеку

@@ -45,7 +45,7 @@ export default (props) => {
45 45
   }
46 46
 
47 47
   return (
48
-    <ScrollView scrollY style={{ height: '100vh' }}>
48
+    <>
49 49
       {
50 50
         dogCardList.map((item, index) => {
51 51
           return (
@@ -53,7 +53,7 @@ export default (props) => {
53 53
           )
54 54
         })
55 55
       }
56
-    </ScrollView>
56
+    </>
57 57
   )
58 58
 }
59 59
 

+ 1
- 1
src/pages/dogList/index.config.js Прегледај датотеку

@@ -1,6 +1,6 @@
1 1
 export default {
2 2
   navigationBarTitleText: '我的狗狗',
3
-  disableScroll: true,
3
+  disableScroll: false,
4 4
   navigationBarBackgroundColor: "#FBD804",
5 5
   navigationBarTextStyle: "black",
6 6
   backgroundColor: "#FBD804",

+ 5
- 7
src/pages/dogList/index.jsx Прегледај датотеку

@@ -1,7 +1,8 @@
1
-import { View, ScrollView, Image, Button } from '@tarojs/components'
1
+import { View, ScrollView, Image } from '@tarojs/components'
2 2
 import Taro, { useDidShow } from '@tarojs/taro';
3 3
 import ViewIcon from '../../components/ViewIcon';
4 4
 import { useEffect, useState } from 'react';
5
+import Button from '../../components/Button';
5 6
 import './style.less'
6 7
 import { addDogList } from '../../services/dogAPI';
7 8
 import { useModel } from '../../store';
@@ -51,7 +52,7 @@ export default (props) => {
51 52
   }
52 53
 
53 54
   return (
54
-    <ScrollView scrollY style={{ height: '100vh' }}>
55
+    <>
55 56
       {
56 57
         dogs.map((item, index) => {
57 58
           return (
@@ -59,11 +60,8 @@ export default (props) => {
59 60
           )
60 61
         })
61 62
       }
62
-
63
-      <View slot='button' style={{ margin: '4em 0 2em 0' }} onClick={() => goLicenseInfo()}>
64
-        <Button style={{ width: '50vw', backgroundColor: '#fbd804', borderRadius: '40px', color: '#000', border: '0px' }} class='weui-btn' type='primary' loading={false} formType='submit'>+ 添加狗狗</Button>
65
-      </View>
66
-    </ScrollView>
63
+      <Button title='+ 添加狗狗' width='50' onClick={() => goLicenseInfo()} />
64
+    </>
67 65
   )
68 66
 }
69 67
 

+ 1
- 1
src/pages/index/index.config.js Прегледај датотеку

@@ -1,6 +1,6 @@
1 1
 export default {
2 2
   navigationBarTitleText: '码上办证',
3
-  disableScroll: true,
3
+  disableScroll: false,
4 4
   navigationBarBackgroundColor: "#FBD804",
5 5
   navigationBarTextStyle: "black",
6 6
   backgroundColor: "#FBD804",

+ 2
- 5
src/pages/index/index.jsx Прегледај датотеку

@@ -49,10 +49,7 @@ const IndexPage = (props) => {
49 49
   }
50 50
 
51 51
   return (
52
-    <ScrollView scrollY style={{
53
-      height: '100vh'
54
-    }}
55
-    >
52
+    <>
56 53
       <View className='index-page-box'>
57 54
         <View style={{ padding: '16px', boxSizing: 'border-box' }}>
58 55
           <Banner list={bannerList} />
@@ -119,7 +116,7 @@ const IndexPage = (props) => {
119 116
 
120 117
         </View>
121 118
       </View>
122
-    </ScrollView>
119
+    </>
123 120
   )
124 121
 }
125 122
 

+ 1
- 1
src/pages/main/index.config.js Прегледај датотеку

@@ -1,6 +1,6 @@
1 1
 export default {
2 2
   navigationBarTitleText: '个人中心',
3
-  disableScroll: true,
3
+  disableScroll: false,
4 4
   navigationBarBackgroundColor: "#FBD804",
5 5
   navigationBarTextStyle: "black",
6 6
   backgroundColor: "#FBD804",

+ 1
- 1
src/pages/noticeList/index.config.js Прегледај датотеку

@@ -1,6 +1,6 @@
1 1
 export default {
2 2
   navigationBarTitleText: "公告列表",
3
-  disableScroll: true,
3
+  disableScroll: false,
4 4
   navigationBarBackgroundColor: "#FBD804",
5 5
   navigationBarTextStyle: "black",
6 6
   backgroundColor: "#FBD804",

+ 4
- 4
src/pages/noticeList/index.jsx Прегледај датотеку

@@ -9,7 +9,7 @@ export default (props) => {
9 9
     Taro.navigateTo({ url: '/pages/noticeInfo/index' })
10 10
   }
11 11
   return (
12
-    <ScrollView scrollY style={{ height: '100vh' }}>
12
+    <>
13 13
       <View className='noticeList'>
14 14
         <View className='notice-item-row' onClick={onClick}>
15 15
           <Image className='notice' src={noticeIcon} mode='aspectFit' />
@@ -74,7 +74,7 @@ export default (props) => {
74 74
             <View className='notice-item-time'>2022.05.26 16:21</View>
75 75
           </View>
76 76
           <Image className='action' src={more} mode='aspectFit' />
77
-        </View>      
77
+        </View>
78 78
         <View className='notice-item-row' onClick={onClick}>
79 79
           <Image className='notice' src={noticeIcon} mode='aspectFit' />
80 80
           <View className='notice-item-body'>
@@ -90,8 +90,8 @@ export default (props) => {
90 90
             <View className='notice-item-time'>2022.05.26 16:21</View>
91 91
           </View>
92 92
           <Image className='action' src={more} mode='aspectFit' />
93
-        </View>      
93
+        </View>
94 94
       </View>
95
-    </ScrollView>
95
+    </>
96 96
   )
97 97
 }

+ 1
- 1
src/pages/payPage/index.config.js Прегледај датотеку

@@ -1,6 +1,6 @@
1 1
 export default {
2 2
   navigationBarTitleText: '订单确认',
3
-  disableScroll: true,
3
+  disableScroll: false,
4 4
   navigationBarBackgroundColor: "#FBD804",
5 5
   navigationBarTextStyle: "black",
6 6
   backgroundColor: "#FBD804",

+ 8
- 8
src/pages/payPage/index.jsx Прегледај датотеку

@@ -1,11 +1,13 @@
1
-import { ScrollView, View, Button } from '@tarojs/components'
2
-import Taro, { reLaunch } from '@tarojs/taro';
1
+import { ScrollView, View } from '@tarojs/components'
2
+import Taro, { reLaunch, useRouter } from '@tarojs/taro';
3 3
 import { useState, useEffect } from 'react';
4 4
 import { getOrder } from '@/services/dogAPI';
5
+import Button from '../../components/Button';
5 6
 import './style.less'
6 7
 
7 8
 export default (props) => {
8
-  const id = Taro.getCurrentInstance().router.params.id;
9
+  const value = useRouter();
10
+  const { id } = value.params
9 11
   const [orderInfo, setOrderInfo] = useState()
10 12
   const [payLoading, setPayLoading] = useState(false)
11 13
   useEffect(() => {
@@ -53,7 +55,7 @@ export default (props) => {
53 55
   }
54 56
 
55 57
   return (
56
-    <ScrollView scrollY style={{ height: '100vh' }}>
58
+    <>
57 59
       {
58 60
         payLoading ? <mp-loading extClass="page-loading-circle" type="circle" show={payLoading} /> :
59 61
           <>
@@ -75,12 +77,10 @@ export default (props) => {
75 77
                 <View className='payPageBox-payItemBox-leftText'>总金额: <View style={{ color: 'red' }}>{orderInfo?.order?.charges / 100}</View>元</View>
76 78
               </View>
77 79
             </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>
80
+            <Button title='支付' onClick={pay} />
81 81
           </>
82 82
       }
83 83
 
84
-    </ScrollView>
84
+    </>
85 85
   )
86 86
 }

+ 1
- 1
src/pages/setDogInfo/index.config.js Прегледај датотеку

@@ -1,6 +1,6 @@
1 1
 export default {
2 2
   navigationBarTitleText: '狗狗信息',
3
-  disableScroll: true,
3
+  disableScroll: false,
4 4
   navigationBarBackgroundColor: "#FBD804",
5 5
   navigationBarTextStyle: "black",
6 6
   backgroundColor: "#FBD804",

+ 5
- 6
src/pages/setDogInfo/index.jsx Прегледај датотеку

@@ -1,4 +1,4 @@
1
-import { View, Button, Picker, Input, ScrollView } from '@tarojs/components'
1
+import { View, Picker, Input, ScrollView } from '@tarojs/components'
2 2
 import Taro, { useRouter } from '@tarojs/taro';
3 3
 import { useState, useEffect } from 'react';
4 4
 import Form from '@/components/Form';
@@ -6,6 +6,7 @@ import FormItem from '@/components/Form/FormItem'
6 6
 import { addDogInfo, getDogInfo, getDogType, setDogInfo } from '@/services/dogAPI';
7 7
 import { useModel } from '@/store'
8 8
 import { handleFile } from '@/utils/request';
9
+import Button from '../../components/Button';
9 10
 import './style.less'
10 11
 
11 12
 const rules = {
@@ -94,7 +95,7 @@ export default (props) => {
94 95
   }
95 96
 
96 97
   return (
97
-    <ScrollView scrollY style={{ height: '100vh' }}>
98
+    <>
98 99
       <View class='page' >
99 100
         <Form rules={rules} onSubmit={formSubmit}>
100 101
           <FormItem title='狗狗名称' required>
@@ -122,11 +123,9 @@ export default (props) => {
122 123
           <FormItem title='狗狗照片' required>
123 124
             <uploader name='image' value={formData?.image} onFile={handleFile} />
124 125
           </FormItem>
125
-          <View slot='button' style={{ margin: '4em 0 2em 0' }}>
126
-            <Button style={{ backgroundColor: '#fbd804', borderRadius: '40px', color: '#000', border: '0px' }} class='weui-btn' type='primary' loading={false} formType='submit'>确定</Button>
127
-          </View>
126
+          <Button title='添加' />
128 127
         </Form>
129 128
       </View>
130
-    </ScrollView >
129
+    </>
131 130
   )
132 131
 }

+ 1
- 1
src/pages/setDogLicense/index.config.js Прегледај датотеку

@@ -1,6 +1,6 @@
1 1
 export default {
2 2
   navigationBarTitleText: '办证申请',
3
-  disableScroll: true,
3
+  disableScroll: false,
4 4
   navigationBarBackgroundColor: "#FBD804",
5 5
   navigationBarTextStyle: "black",
6 6
   backgroundColor: "#FBD804",

+ 7
- 7
src/pages/setDogLicense/index.jsx Прегледај датотеку

@@ -1,4 +1,4 @@
1
-import { View, Button, Text, RadioGroup, Picker, Image, Input, Radio, Label, ScrollView, Slot } from '@tarojs/components'
1
+import { View, Text, RadioGroup, Picker, Image, Input, Radio, Label, ScrollView, Slot } from '@tarojs/components'
2 2
 import Taro, { useDidShow, useRouter } from '@tarojs/taro';
3 3
 import { useEffect, useState } from 'react';
4 4
 import Form from '@/components/Form';
@@ -7,6 +7,7 @@ import AuthProfile from '@/components/Authorize/AuthProfile';
7 7
 import { addDogList, addlication, getDogInfo } from '@/services/dogAPI';
8 8
 import { handleFile } from '@/utils/request';
9 9
 import { useModel } from '@/store';
10
+import Button from '../../components/Button';
10 11
 
11 12
 import './style.less'
12 13
 import { getCardLicenseInfo } from '../../services/dogAPI';
@@ -14,7 +15,8 @@ import { getCardLicenseInfo } from '../../services/dogAPI';
14 15
 export default (props) => {
15 16
   const { dogs, person } = useModel('userData')
16 17
   const [formData, setFormData] = useState()
17
-  const routerPetId = Taro.getCurrentInstance().router.params.petId;
18
+  const value = useRouter();
19
+  const { petId } = value.params
18 20
 
19 21
   const [dogDate, setDogDate] = useState({ immunizationDate: null, petBirthday: null, petSex: [], petType: [] })
20 22
   const [mainDog, setMainDog] = useState([])
@@ -195,7 +197,7 @@ export default (props) => {
195 197
   }
196 198
 
197 199
   return (
198
-    <ScrollView scrollY style={{ height: '100vh' }} >
200
+    <>
199 201
       <AuthProfile />
200 202
       <View class='page' >
201 203
         <Form onSubmit={formSubmit} rules={rules} >
@@ -294,12 +296,10 @@ export default (props) => {
294 296
 
295 297
             </mp-cells>
296 298
           </mp-form>
297
-          <View slot='button' style={{ margin: '4em 0 2em 0' }}>
298
-            <Button disabled={dogStatus} style={{ backgroundColor: !dogStatus ? '#fbd804' : '#858585', borderRadius: '40px', color: '#000', border: '0px' }} class='weui-btn' type='primary' loading={false} formType='submit'>确定</Button>
299
-          </View>
299
+          <Button disabled={dogStatus} title='确定' />
300 300
         </Form>
301 301
       </View>
302
-    </ScrollView >
302
+    </>
303 303
   )
304 304
 }
305 305
 

+ 1
- 1
src/pages/setUser/index.config.js Прегледај датотеку

@@ -1,6 +1,6 @@
1 1
 export default {
2 2
   navigationBarTitleText: '犬主信息',
3
-  disableScroll: true,
3
+  disableScroll: false,
4 4
   navigationBarBackgroundColor: "#FBD804",
5 5
   navigationBarTextStyle: "black",
6 6
   backgroundColor: "#FBD804",

+ 2
- 2
src/pages/setUser/index.jsx Прегледај датотеку

@@ -60,7 +60,7 @@ export default (props) => {
60 60
   }
61 61
 
62 62
   return (
63
-    <ScrollView scrollY style={{ height: '100vh' }}>
63
+    <>
64 64
       <View class='page' >
65 65
         <Form rules={rules} onSubmit={formSubmit}>
66 66
           <FormItem title='姓名' required>
@@ -83,6 +83,6 @@ export default (props) => {
83 83
           </View>
84 84
         </Form>
85 85
       </View>
86
-    </ScrollView >
86
+    </>
87 87
   )
88 88
 }