浏览代码

add ApplicationList

[baozhangchao] 3 年前
父节点
当前提交
c5aee2cfdf

+ 2
- 0
src/app.config.js 查看文件

@@ -11,6 +11,8 @@ export default {
11 11
     'pages/dogList/index',
12 12
     'pages/setDogInfo/index',
13 13
     'pages/dogCardDetail/index',
14
+    'pages/payPage/index',
15
+    'pages/ApplicationList/index',
14 16
   ],
15 17
   window: {
16 18
     backgroundTextStyle: 'light',

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

@@ -5,6 +5,7 @@ import './style.less'
5 5
 
6 6
 export default (props) => {
7 7
   const { banner } = props;
8
+  console.log("🚀 ~ file: index.jsx ~ line 8 ~ banner", banner)
8 9
   return (
9 10
     <Swiper
10 11
       className='swiper-container'
@@ -19,7 +20,7 @@ export default (props) => {
19 20
         banner && banner.map((item, index) => (
20 21
           <SwiperItem key={index} className='SwiperItem-img' >
21 22
             <RatioItem ratio='5:3'>
22
-              <Image className='swiper-img' src={item.imgUrl} mode='widthFix'></Image>
23
+              <Image className='swiper-img' src={item.image} mode='widthFix'></Image>
23 24
             </RatioItem>
24 25
           </SwiperItem>
25 26
         ))

+ 11
- 0
src/pages/ApplicationList/index.config.js 查看文件

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

+ 229
- 0
src/pages/ApplicationList/index.jsx 查看文件

@@ -0,0 +1,229 @@
1
+import { ScrollView, View, Image, Button } from '@tarojs/components'
2
+import Taro from '@tarojs/taro';
3
+import { useState } from 'react';
4
+import { useEffect } from 'react';
5
+import { getOrder } from '../../services/dogAPI';
6
+import './style.less'
7
+
8
+export default (props) => {
9
+  const id = Taro.getCurrentInstance().router.params.id;
10
+  const [orderInfo, setOrderInfo] = useState()
11
+
12
+  useEffect(() => {
13
+    if (id) {
14
+      getOrder(id).then((e) => {
15
+        console.log('e', e);
16
+        setOrderInfo(e)
17
+      })
18
+    }
19
+
20
+  }, [id])
21
+
22
+  const goSetDogLicense = () => {
23
+    Taro.navigateTo({
24
+      url: '/pages/setDogLicense/index'
25
+    })
26
+  }
27
+
28
+
29
+  return (
30
+    <ScrollView scrollY style={{ height: '100vh' }}>
31
+      <View className='ApplicationListBox'>
32
+        <View className='ApplicationListBox-CardBox'>
33
+
34
+          <View className='ApplicationListBox-CardBox-headerTop'>
35
+            狗狗姓名
36
+            <View className='ApplicationListBox-CardBox-headerTop-right'>
37
+              <View>我的二狗子</View>
38
+
39
+              <Image src='https://gss0.baidu.com/7Po3dSag_xI4khGko9WTAnF6hhy/zhidao/pic/item/48540923dd54564e953f5e6cbede9c82d1584f08.jpg' />
40
+            </View>
41
+          </View>
42
+          {/* 状态
43
+
44
+待付款 
45
+审核中 > 驳回 点击去修改  /退款
46
+驳回原因
47
+
48
+待发卡
49
+已完成 
50
+
51
+        狗名字
52
+        时间
53
+        方式
54
+        状态
55
+        单号+快递公司
56
+*/}
57
+
58
+          <View className='ApplicationListBox-CardBox-content'>
59
+            <View>申请时间</View>
60
+            <View>2022-05-06 12:36</View>
61
+          </View>
62
+          <View className='ApplicationListBox-CardBox-content'>
63
+            <View>审领方式</View>
64
+            <View>邮寄</View>
65
+          </View>
66
+          <View className='ApplicationListBox-CardBox-content'>
67
+            <View>状态</View>
68
+            <View>已完成</View>
69
+          </View>
70
+          <View className='ApplicationListBox-CardBox-content'>
71
+            <View>邮政快递</View>
72
+            <View>3200222000</View>
73
+          </View>
74
+        </View>
75
+
76
+      </View>
77
+      <View className='ApplicationListBox'>
78
+        <View className='ApplicationListBox-CardBox'>
79
+
80
+          <View className='ApplicationListBox-CardBox-headerTop'>
81
+            狗狗姓名
82
+            <View className='ApplicationListBox-CardBox-headerTop-right'>
83
+              <View>我的二狗子</View>
84
+
85
+              <Image src='https://gss0.baidu.com/7Po3dSag_xI4khGko9WTAnF6hhy/zhidao/pic/item/48540923dd54564e953f5e6cbede9c82d1584f08.jpg' />
86
+            </View>
87
+          </View>
88
+          {/* 状态
89
+
90
+待付款 
91
+审核中 > 驳回 点击去修改  /退款
92
+驳回原因
93
+
94
+待发卡
95
+已完成 
96
+
97
+        狗名字
98
+        时间
99
+        方式
100
+        状态
101
+        单号+快递公司
102
+*/}
103
+
104
+          <View className='ApplicationListBox-CardBox-content'>
105
+            <View>申请时间</View>
106
+            <View>2022-05-06 12:36</View>
107
+          </View>
108
+          <View className='ApplicationListBox-CardBox-content'>
109
+            <View>审领方式</View>
110
+            <View>邮寄</View>
111
+          </View>
112
+          <View className='ApplicationListBox-CardBox-content'>
113
+            <View>状态</View>
114
+            <View>已完成</View>
115
+          </View>
116
+          <View className='ApplicationListBox-CardBox-content'>
117
+            <View>邮政快递</View>
118
+            <View>3200222000</View>
119
+          </View>
120
+        </View>
121
+
122
+      </View>
123
+      <View className='ApplicationListBox'>
124
+        <View className='ApplicationListBox-CardBox'>
125
+
126
+          <View className='ApplicationListBox-CardBox-headerTop'>
127
+            狗狗姓名
128
+            <View className='ApplicationListBox-CardBox-headerTop-right'>
129
+              <View>我的二狗子</View>
130
+
131
+              <Image src='https://gss0.baidu.com/7Po3dSag_xI4khGko9WTAnF6hhy/zhidao/pic/item/48540923dd54564e953f5e6cbede9c82d1584f08.jpg' />
132
+            </View>
133
+          </View>
134
+          {/* 状态
135
+
136
+待付款 
137
+审核中 > 驳回 点击去修改  /退款
138
+驳回原因
139
+
140
+待发卡
141
+已完成 
142
+
143
+        狗名字
144
+        时间
145
+        方式
146
+        状态
147
+        单号+快递公司
148
+*/}
149
+
150
+          <View className='ApplicationListBox-CardBox-content'>
151
+            <View>申请时间</View>
152
+            <View>2022-05-06 12:36</View>
153
+          </View>
154
+          <View className='ApplicationListBox-CardBox-content'>
155
+            <View>审领方式</View>
156
+            <View>邮寄</View>
157
+          </View>
158
+          <View className='ApplicationListBox-CardBox-content'>
159
+            <View>状态</View>
160
+            <View>已完成</View>
161
+          </View>
162
+          <View className='ApplicationListBox-CardBox-content'>
163
+            <View>邮政快递</View>
164
+            <View>3200222000</View>
165
+          </View>
166
+        </View>
167
+
168
+      </View>
169
+      <View className='ApplicationListBox'>
170
+        <View className='ApplicationListBox-CardBox'>
171
+
172
+          <View className='ApplicationListBox-CardBox-headerTop'>
173
+            狗狗姓名
174
+            <View className='ApplicationListBox-CardBox-headerTop-right'>
175
+              <View>我的二狗子</View>
176
+
177
+              <Image src='https://gss0.baidu.com/7Po3dSag_xI4khGko9WTAnF6hhy/zhidao/pic/item/48540923dd54564e953f5e6cbede9c82d1584f08.jpg' />
178
+            </View>
179
+          </View>
180
+          {/* 状态
181
+
182
+待付款 
183
+审核中 > 驳回 点击去修改  /退款
184
+驳回原因
185
+
186
+待发卡
187
+已完成 
188
+
189
+        狗名字
190
+        时间
191
+        方式
192
+        状态
193
+        单号+快递公司
194
+*/}
195
+
196
+          <View className='ApplicationListBox-CardBox-content'>
197
+            <View>申请时间</View>
198
+            <View>2022-05-06 12:36</View>
199
+          </View>
200
+          <View className='ApplicationListBox-CardBox-content'>
201
+            <View>审领方式</View>
202
+            <View>邮寄</View>
203
+          </View>
204
+          <View className='ApplicationListBox-CardBox-content'>
205
+            <View>状态</View>
206
+            <View>已完成</View>
207
+          </View>
208
+          <View className='ApplicationListBox-CardBox-content'>
209
+            <View>邮政快递</View>
210
+            <View>3200222000</View>
211
+          </View>
212
+          <View>
213
+
214
+            <View className='ApplicationListBox-CardBox-refuse'>
215
+              <View>驳回原因</View>
216
+              <View>因地区政策原因,疫苗报告失效,请重新填写申请信息。</View>
217
+            </View>
218
+            <View style={{ margin: '0.5em 0 0.2em 0' }}>
219
+              <Button style={{ width: '135px', height: '35px', fontSize: '14px', backgroundColor: '#fbd804', borderRadius: '40px', color: '#000', border: '0px' }} class='weui-btn' type='primary' loading={false} onClick={goSetDogLicense}>重新填写</Button>
220
+            </View>
221
+          </View>
222
+
223
+        </View>
224
+
225
+      </View>
226
+
227
+    </ScrollView>
228
+  )
229
+}

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

@@ -0,0 +1,72 @@
1
+// #858B9C
2
+.ApplicationListBox {
3
+  background-color: white;
4
+  padding: 30px 30px;
5
+  margin-top: 3vw;
6
+  // font-family: "Trebuchet MS", "Lucida Sans Unicode", "Lucida Grande",
7
+  //   "Lucida Sans", Arial, sans-serif;
8
+
9
+  &-CardBox {
10
+    width: 90%;
11
+    background-color: #f9fafb;
12
+    border-radius: 20px;
13
+
14
+    padding: 20px 20px;
15
+    margin: 0 auto;
16
+    &-headerTop {
17
+      display: flex;
18
+      align-items: center;
19
+      border-bottom: 1px solid rgba(219, 219, 219, 0.603);
20
+      padding-bottom: 30px;
21
+      justify-content: space-between;
22
+      // font-weight: 600;
23
+      font-size: 30px;
24
+
25
+      &-right {
26
+        display: flex;
27
+        flex-flow: row-reverse;
28
+        align-items: center;
29
+        color: #41485d;
30
+        > Image {
31
+          width: 45px;
32
+          height: 45px;
33
+          border-radius: 50%;
34
+          margin: 0 10px;
35
+        }
36
+      }
37
+    }
38
+
39
+    &-content {
40
+      display: flex;
41
+      align-items: center;
42
+      justify-content: space-between;
43
+      margin: 20px auto;
44
+      // font-weight: 600;
45
+      font-size: 30px;
46
+      > View:nth-child(1) {
47
+        color: #858b9c;
48
+      }
49
+      > View:nth-child(2) {
50
+        color: #41485d;
51
+      }
52
+    }
53
+    &-refuse {
54
+      border-top: 1px solid rgba(219, 219, 219, 0.603);
55
+      display: flex;
56
+      font-size: 30px;
57
+      text-align: left;
58
+      margin-top: 30px;
59
+      padding-top: 15px;
60
+
61
+      > View:nth-child(1) {
62
+        width: 180px;
63
+        color: #858b9c;
64
+      }
65
+      > View:nth-child(2) {
66
+        color: #41485d;
67
+        font-size: 27px;
68
+        text-align: right;
69
+      }
70
+    }
71
+  }
72
+}

+ 22
- 14
src/pages/NoticeInfo/index.jsx 查看文件

@@ -1,24 +1,32 @@
1 1
 import { View, RichText, ScrollView } from '@tarojs/components'
2
+import Taro from '@tarojs/taro'
3
+import { useEffect, useState } from 'react'
4
+import { getNoticeInfo } from '../../services/dogAPI'
2 5
 
3 6
 import './style.less'
4 7
 
5 8
 export default (props) => {
9
+  const id = Taro.getCurrentInstance().router.params.id;
10
+  const [content, setContent] = useState()
11
+  useEffect(() => {
12
+    if (id) {
13
+      getNoticeInfo(id).then((res) => {
14
+        setContent(res)
15
+      })
16
+    }
17
+
18
+  }, [id])
19
+
20
+
21
+  const htmlSnip = content?.content.replace(/<\/p>/g, '</p><p style="height: 1em">&nbsp;</p>')
6 22
 
7
-  let htmlSnip=`<p style="text-align: center;"><strong>通知2士大夫敢死队</strong></p>
8
-  <p style="text-indent: 2em;" data-spm-anchor-id="C73544894212.P59511941341.0.i0">在今天举行的上海市新冠肺炎疫情防控新闻发布会上,相关部门介绍,全市高三、高二年级学生从6月6日,初三年级学生从6月13日起返校复学;中小学其他各年级学生继续居家在线学习至学期结束,学校可在学期结束前安排一次学生返校活动。有关部门将按照规范完成校园消杀,确保校园安全干净,为学校配备专门的核酸采样和检测力量,实施校园网格化管理等措施。</p>
9
-  <p style="text-indent: 2em;">上海复工复产加快推动,上海四家整车厂、中国船舶集团旗下的三大船企都实现复工复产。上海还将根据疫情防控形势,在6月推动工业、服务业和外资外贸企业等应复尽复。</p>
10
-  <p style="text-indent: 2em; text-align: right;">2022年5月26日</p>
11
-  <p style="text-indent: 2em; text-align: right;">南京防疫办公室</p>`
12
-  
13
-  htmlSnip = htmlSnip.replace(/<\/p>/g, '</p><p style="height: 1em">&nbsp;</p>')
14
-  
15 23
   return (
16
-    <ScrollView scrollY style={{height:'100vh'}}>
17
-    <View className='noticeInfo'>
18
-      <View className='title'>我是标题</View>
19
-      <View className='date'>2022-6-9 13:33</View>
20
-      <RichText nodes={htmlSnip}></RichText>
21
-    </View>
24
+    <ScrollView scrollY style={{ height: '100vh' }}>
25
+      <View className='noticeInfo'>
26
+        <View className='title'>{content?.title}</View>
27
+        <View className='date'>{content?.createDate}</View>
28
+        <RichText nodes={htmlSnip}></RichText>
29
+      </View>
22 30
     </ScrollView>
23 31
   )
24 32
 }

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

@@ -47,8 +47,8 @@ export default (props) => {
47 47
                 <View className='content'>{applicationInfoDate?.petName}</View>
48 48
               </View>
49 49
               <View className='cell'>
50
-                <View className='lable'>毛色</View>:
51
-                <View className='content'>米白</View>
50
+                <View className='lable'>性别</View>:
51
+                <View className='content'>{applicationInfoDate?.petSex}</View>
52 52
               </View>
53 53
             </View>
54 54
             <View className='cardRight'>

+ 10
- 12
src/pages/index/index.jsx 查看文件

@@ -10,7 +10,7 @@ import withBasic from '@/layouts/withBasic'
10 10
 import MenuItem from './components/MenuItem'
11 11
 
12 12
 import './style.less'
13
-import { getNoticeList } from '../../services/dogAPI'
13
+import { getBanner, getNoticeList } from '../../services/dogAPI'
14 14
 
15 15
 const pt16 = {
16 16
   paddingTop: '16px'
@@ -24,18 +24,18 @@ const IndexPage = (props) => {
24 24
   const { pets, cards } = useModel('userData')
25 25
   const [totalApplyNum, setTotalApplyNum] = useState(0)
26 26
   const [noticeList, setNoticeList] = useState([])
27
-  const banner = [
28
-    { imgUrl: 'https://tse3-mm.cn.bing.net/th/id/OIP-C.yd6uU_V7fqswON8cwWUfewHaE7?w=300&h=200&c=7&r=0&o=5&pid=1.7' },
29
-    { imgUrl: 'https://tse4-mm.cn.bing.net/th/id/OIP-C.A31N2pd7ApUojqrR6x41bwHaFj?pid=ImgDet&rs=1' },
30
-    { imgUrl: 'https://tse1-mm.cn.bing.net/th/id/R-C.413cf61f5c976cdaddafb30e3aeeb547?rik=AJJ41q9z0C1Anw&riu=http%3a%2f%2ffunpicimg.loveinhere.com%2f1008%2f1%2f4770.jpg&ehk=bP4qnBFW9Ha6lXMKKtVhAnkL2hTHv15pjb5oQpAhF6o%3d&risl=&pid=ImgRaw&r=0' },
31
-    { imgUrl: 'https://img.zcool.cn/community/01c62e565d10e76ac7253403cbde61.jpg@1280w_1l_2o_100sh.jpg' }
32
-  ]
33
-  
27
+  const [banner, setBanner] = useState([])
28
+
29
+
34 30
   useEffect(() => {
35 31
     getNoticeList({ pageSize: 5 }).then((res) => {
36 32
       console.log('res', res);
37 33
       setNoticeList(res.records)
38 34
     })
35
+    getBanner().then((e) => {
36
+      setBanner(e)
37
+
38
+    })
39 39
   }, [])
40 40
 
41 41
   const goNoticeList = (e) => {
@@ -43,8 +43,6 @@ const IndexPage = (props) => {
43 43
     Taro.navigateTo({ url: '/pages/noticeList/index' })
44 44
   }
45 45
   const goDetail = (id) => {
46
-    console.log("🚀 ~ file: index.jsx ~ line 52 ~ goNoticeList ~ e", e)
47
-
48 46
     Taro.navigateTo({ url: `/pages/noticeInfo/index?id=${id}` })
49 47
   }
50 48
 
@@ -66,7 +64,7 @@ const IndexPage = (props) => {
66 64
                 subtitle='Registration application'
67 65
                 to='/pages/setDogLicense/index?type=first'
68 66
               >
69
-                <View>您有<Text>{ totalApplyNum }</Text>条办证申请记录</View>
67
+                <View>您有<Text>{totalApplyNum}</Text>条办证申请记录</View>
70 68
               </MenuItem>
71 69
             </View>
72 70
             <View class='weui-flex__item' style={ml16}>
@@ -76,7 +74,7 @@ const IndexPage = (props) => {
76 74
                 icon='certificate'
77 75
                 to='/pages/dogLicenseList/index'
78 76
               >
79
-                <View>您有<Text>{ cards ? cards.length : 0 }</Text>条办证申请记录</View>
77
+                <View>您有<Text>{cards ? cards.length : 0}</Text>条办证申请记录</View>
80 78
               </MenuItem>
81 79
             </View>
82 80
           </View>

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

@@ -24,7 +24,8 @@ export default (props) => {
24 24
   }
25 25
   const goDogApplyList = () => {
26 26
     Taro.navigateTo({
27
-      // url: '/pages/setUser/index'
27
+      url: '/pages/ApplicationList/index'
28
+
28 29
     })
29 30
   }
30 31
   const goSetUser = (personId) => {

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

@@ -3,8 +3,8 @@ import Taro from '@tarojs/taro';
3 3
 import './style.less'
4 4
 
5 5
 export default (props) => {
6
-  const onClick = () => { 
7
-    Taro.navigateTo({url:'/pages/noticeInfo/index'})
6
+  const onClick = () => {
7
+    Taro.navigateTo({ url: '/pages/noticeInfo/index' })
8 8
   }
9 9
   return (
10 10
     <ScrollView scrollY style={{ height: '100vh' }}>

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

@@ -0,0 +1,11 @@
1
+export default {
2
+  navigationBarTitleText: '订单确认',
3
+  disableScroll: true,
4
+  navigationBarBackgroundColor: "#FBD804",
5
+  navigationBarTextStyle: "black",
6
+  backgroundColor: "#FBD804",
7
+  usingComponents: {
8
+
9
+  }
10
+
11
+}

+ 78
- 0
src/pages/payPage/index.jsx 查看文件

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

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

@@ -0,0 +1,40 @@
1
+.payPageBox {
2
+  width: 86%;
3
+  background-color: #fff;
4
+  border-radius: 20px;
5
+  margin: 10vw auto;
6
+  padding-bottom: 50px;
7
+  padding-top: 30px;
8
+  &-payItemBox {
9
+    padding: 8px 30px;
10
+    display: flex;
11
+    align-items: center;
12
+    &-left {
13
+      width: 10px;
14
+      height: 35px;
15
+      background-color: #fbd804;
16
+      margin-right: 20px;
17
+      border-radius: 10px;
18
+    }
19
+    &-content {
20
+      width: 70vw;
21
+      font-size: 28px;
22
+      display: flex;
23
+      color: #858585;
24
+      > View {
25
+        display: flex;
26
+        align-items: center;
27
+      }
28
+    }
29
+    &-leftText {
30
+      display: flex;
31
+      margin-left: 25px;
32
+      font-weight: 400;
33
+
34
+      > View {
35
+        font-weight: 600;
36
+        margin-right: 15px;
37
+      }
38
+    }
39
+  }
40
+}

+ 47
- 45
src/pages/setDogLicense/index.jsx 查看文件

@@ -7,13 +7,14 @@ import { addDogList, addlication, getDogCardList, getDogInfo } from '../../servi
7 7
 import { useModel } from '../../store';
8 8
 
9 9
 import './style.less'
10
+import { uploadFile } from '../../utils/request';
10 11
 
11 12
 export default (props) => {
12 13
   const { dogs, person, setDogs } = useModel('userData')
13 14
   const [formData, setFormData] = useState()
14 15
 
15
-  const [dogDate, setDogDate] = useState({ petBirthday: '请选择生日', petSex: [], petType: [] })
16
-  const [imgUrl, setImgUrl] = useState({ img1: null, immunization: null })
16
+  const [dogDate, setDogDate] = useState({ immunizationDate: '请选择日期', petBirthday: '请选择生日', petSex: [], petType: [] })
17
+  const [imgUrl, setImgUrl] = useState({ img1: null, immunizationImg: null })
17 18
   const [showDialog, setShowDialog] = useState(false)
18 19
   const [mainDog, setMainDog] = useState([])
19 20
   useDidShow(() => {
@@ -39,7 +40,7 @@ export default (props) => {
39 40
       const sex = [{ value: e?.sex, text: e?.sex == 1 ? '雄' : '雌' }];
40 41
       const petType = [{ value: 0, name: e?.petType }];
41 42
 
42
-      setDogDate({ petBirthday: e?.birthday, petSex: sex, petType: petType })
43
+      setDogDate({ ...dogDate, petBirthday: e?.birthday, petSex: sex, petType: petType })
43 44
       setImgUrl({ ...imgUrl, img1: e.image })
44 45
       console.log('test', e);
45 46
 
@@ -59,7 +60,10 @@ export default (props) => {
59 60
         setDogDate({ ...dogDate, petBirthday: value })
60 61
         break;
61 62
       case 'petType':
62
-        setDogDate({ ...dogDate, petType: value })//value 01  text 文字
63
+        setDogDate({ ...dogDate, petType: value })
64
+        break;
65
+      case 'immunizationDate':
66
+        setDogDate({ ...dogDate, immunizationDate: value })
63 67
         break;
64 68
       default:
65 69
         break;
@@ -85,17 +89,6 @@ export default (props) => {
85 89
   }
86 90
 
87 91
   const buttons = [{ text: '确定' }]
88
-  // const dogSex = [
89
-  //   {
90
-  //     value: 1,
91
-  //     text: '雄',
92
-  //   },
93
-  //   {
94
-  //     value: 2,
95
-  //     text: '雌',
96
-  //   },
97
-
98
-  // ]
99 92
 
100 93
   const modeList = [
101 94
     {
@@ -110,7 +103,6 @@ export default (props) => {
110 103
   ]
111 104
 
112 105
   const addImage = (e) => {
113
-    console.log("🚀 ~ file: index.jsx ~ line 94 ~ addImage ~ e", e)
114 106
 
115 107
     if (e == 'img1') {
116 108
       Taro.chooseImage({
@@ -120,7 +112,12 @@ export default (props) => {
120 112
         success: function (res) {
121 113
           // 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片
122 114
           var tempFilePaths = res.tempFilePaths
123
-          setImgUrl({ ...imgUrl, img1: tempFilePaths[0] })
115
+          uploadFile(tempFilePaths[0]).then((res2) => {
116
+            console.log("🚀 ~ file: index.jsx ~ line 61 ~ uploadFile ~ res2", res2)
117
+            setImgUrl({ ...imgUrl, img1: res2 })
118
+
119
+
120
+          })
124 121
         },
125 122
         fail () {
126 123
           Taro.showToast({
@@ -139,7 +136,12 @@ export default (props) => {
139 136
         success: function (res) {
140 137
           // 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片
141 138
           var tempFilePaths = res.tempFilePaths
142
-          setImgUrl({ ...imgUrl, immunization: tempFilePaths[0] })
139
+          uploadFile(tempFilePaths[0]).then((res2) => {
140
+            console.log("🚀 ~ file: index.jsx ~ line 61 ~ uploadFile ~ res2", res2)
141
+            setImgUrl({ ...imgUrl, immunizationImg: res2 })
142
+
143
+
144
+          })
143 145
         },
144 146
         fail () {
145 147
           Taro.showToast({
@@ -151,8 +153,6 @@ export default (props) => {
151 153
       })
152 154
     }
153 155
 
154
-    console.log("🚀 ~ file: index.jsx ~ line 61 ~ addImage ~ tempFilePaths", imgUrl)
155
-
156 156
 
157 157
   }
158 158
   // ...dogDate,
@@ -164,11 +164,9 @@ export default (props) => {
164 164
         icon: 'none',
165 165
         duration: 1000
166 166
       })
167
-      setTimeout(() => {
168
-        Taro.navigateBack({
169
-          delta: 1
170
-        })
171
-      }, 600);
167
+      Taro.navigateTo({
168
+        url: `/pages/payPage/index?id=${res.applyId}`
169
+      })
172 170
     })
173 171
   }
174 172
 
@@ -181,14 +179,20 @@ export default (props) => {
181 179
           请先添加本人信息或狗狗信息
182 180
         </View>
183 181
       </mp-dialog>
182
+      <View className='DogLicenseHeaderBox'>
183
+
184
+      </View>
184 185
       <View class='page' >
185 186
         <Form onSubmit={formSubmit} >
186 187
           <mp-form  >
187
-            <mp-cells title=''>
188
+            <mp-cells >
189
+              <mp-cell title='犬主姓名' extClass=''>
190
+                <View >{person?.nickName}</View>
191
+              </mp-cell>
188 192
               <mp-cell title='狗狗名称' extClass=''>
189 193
                 {/* <Input name='petName' placeholder='请输入狗狗名称' /> */}
190 194
                 <s-picker name='petName' rangeKey='name' rangeValue='value' range={mainDog} value={formData?.name} onChange={getMainDogChange} />
191
-                <View onClick={onDateChange}>asdasdsad</View>
195
+                <View onClick={onDateChange}>log打印</View>
192 196
                 {/* <Picker name='petSex' mode='selector' range={selector} onChange={(e) => { onDateChange('petSex', e.detail.value) }}>
193 197
                   <View className='picker'>
194 198
                     {dogDate.petSex}
@@ -196,22 +200,10 @@ export default (props) => {
196 200
                 </Picker> */}
197 201
               </mp-cell>
198 202
               <mp-cell title='狗狗性别' extClass=''>
199
-                <s-picker name='petSex' rangeKey='text' rangeValue='value' range={dogDate.petSex} value={dogDate?.petSex[0]?.text} />
200
-
201
-                {/* <Picker name='petSex' mode='selector' range={dogSex} onChange={(e) => { onDateChange('petSex', e.detail.value) }}>
202
-                  <View className='picker'>
203
-                    {dogDate.petSex}
204
-                  </View>
205
-                </Picker> */}
203
+                <s-picker name='petSex' rangeKey='text' rangeValue='value' range={dogDate.petSex} value={formData?.sex} />
206 204
               </mp-cell>
207 205
               <mp-cell title='犬种' extClass=''>
208
-                <s-picker name='petType' rangeKey='name' rangeValue='value' range={dogDate.petType} value={dogDate?.petType[0]?.name} />
209
-
210
-                {/* <Picker name='petType' mode='selector' range={dogType} rangeKey='text' onChange={(e) => { onDateChange('petType', e.detail.value) }}>
211
-                  <View className='picker'>
212
-                    {dogDate.petType}
213
-                  </View>
214
-                </Picker> */}
206
+                <s-picker name='petType' rangeKey='name' rangeValue='name' range={dogDate.petType} value={formData?.petType} />
215 207
               </mp-cell>
216 208
               <mp-cell title='生日' extClass=''>
217 209
                 <Picker name='petBirthday' mode='date' onChange={(e) => { onDateChange('petBirthday', e.detail.value) }}>
@@ -234,16 +226,26 @@ export default (props) => {
234 226
                 }
235 227
 
236 228
               </mp-cell>
229
+              <mp-cell title='最近免疫日期' extClass=''>
230
+                <Picker name='immunizationDate' mode='date' onChange={(e) => { onDateChange('immunizationDate', e.detail.value) }}>
231
+                  <View className='picker' style={!formData ? { "color": '#858585' } : {}}>
232
+                    {dogDate.immunizationDate}
233
+                  </View>
234
+                </Picker>
235
+              </mp-cell>
236
+              <mp-cell title='免疫证号' extClass=''>
237
+                <Input name='immunizationCode' placeholder='请输入免疫证号' />
238
+              </mp-cell>
237 239
               <mp-cell title='免疫证明' extClass=''>
238 240
                 {
239
-                  !imgUrl.immunization ?
240
-                    <View className='addImage' onClick={() => addImage('immunization')} >
241
+                  !imgUrl.immunizationImg ?
242
+                    <View className='addImage' onClick={() => addImage('immunizationImg')} >
241 243
                       <Text>+</Text>
242 244
                     </View>
243 245
                     :
244
-                    <Image className='dogImg1' name='immunization' src={imgUrl.immunization} onClick={() => addImage('immunization')} />
246
+                    <Image className='dogImg1' name='immunizationImg' src={imgUrl.immunizationImg} onClick={() => addImage('immunizationImg')} />
245 247
                 }
246
-                {/* <Input name='immunization' placeholder='请输入身份证号' type='idcard' /> */}
248
+                {/* <Input name='immunizationImg' placeholder='请输入身份证号' type='idcard' /> */}
247 249
               </mp-cell>
248 250
               <mp-cell title='详细地址' extClass=''>
249 251
                 <Input name='address' placeholder='请输入详细地址' />

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

@@ -94,7 +94,7 @@ export default (props) => {
94 94
     }}
95 95
     >
96 96
       <View class='page' >
97
-        <Form onSubmit={formSubmit}>
97
+        <Form onSubmit={formSubmit} >
98 98
           <mp-form>
99 99
             <mp-cells title=' '>
100 100
               <mp-cell title='姓名' extClass=''>

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

@@ -114,4 +114,35 @@ export const getDogType = (id, data) => request(`/setting/dog_type`, { data, met
114 114
 * @param {*} data
115 115
 * @returns
116 116
 */
117
-export const getNoticeList = (id, data) => request(`/notice?`, { data, method: 'GET' })
117
+export const getNoticeList = (id, data) => request(`/notice`, { data, method: 'GET' })
118
+
119
+/**
120
+* 消息详情
121
+* @param {*} data
122
+* @returns
123
+*/
124
+export const getNoticeInfo = (id, data) => request(`/notice/${id}`, { data, method: 'GET' })
125
+
126
+
127
+
128
+
129
+
130
+/**
131
+* banner列表
132
+* @param {*} data
133
+* @returns
134
+*/
135
+export const getBanner = (id, data) => request(`/banner`, { data, method: 'GET' })
136
+
137
+
138
+
139
+
140
+/**
141
+* 生成订单
142
+* @param {*} data
143
+* @returns
144
+*/
145
+export const getOrder = (id, data) => request(`/order?applyId=${id}`, { data, method: 'POST' })
146
+
147
+
148
+