李志伟 2 years ago
parent
commit
6a6f1a3b38
2 changed files with 16 additions and 2 deletions
  1. 10
    2
      src/pages/cardList/detail.jsx
  2. 6
    0
      src/services/card.js

+ 10
- 2
src/pages/cardList/detail.jsx View File

1
 import React, { useState, useEffect } from 'react';
1
 import React, { useState, useEffect } from 'react';
2
 import { Card, Form, Button, Image } from 'antd';
2
 import { Card, Form, Button, Image } from 'antd';
3
 import { PageHeaderWrapper } from '@ant-design/pro-layout';
3
 import { PageHeaderWrapper } from '@ant-design/pro-layout';
4
-import { getCardDetail } from '@/services/card'
4
+import { getCardDetail,getCardQRCode } from '@/services/card'
5
 import { history } from 'umi';
5
 import { history } from 'umi';
6
 
6
 
7
 const FormItem = Form.Item;
7
 const FormItem = Form.Item;
13
   const { location } = props;
13
   const { location } = props;
14
   const { id } = location.query;
14
   const { id } = location.query;
15
   const [card, setCard] = useState({});
15
   const [card, setCard] = useState({});
16
-
16
+  const [qrcode,setQrcode]=useState();
17
   useEffect(() => {
17
   useEffect(() => {
18
     getCardDetail(id).then((res) => {
18
     getCardDetail(id).then((res) => {
19
       setCard(res)
19
       setCard(res)
20
+      getCardQRCode(res.cardNo).then((res2)=>{
21
+        setQrcode(res2.qrImage)
22
+      })
20
     }).catch((err) => {
23
     }).catch((err) => {
21
       console.log(err.message)
24
       console.log(err.message)
22
     });
25
     });
65
           <FormItem label="狗证有效期">
68
           <FormItem label="狗证有效期">
66
             {card?.startDate + '~' + card?.expireDate}
69
             {card?.startDate + '~' + card?.expireDate}
67
           </FormItem>
70
           </FormItem>
71
+          <FormItem label="小程序码">
72
+            {
73
+              qrcode&&<Image src={qrcode} width={100} />
74
+            }            
75
+          </FormItem>
68
           <FormItem label=" " colon={false}>
76
           <FormItem label=" " colon={false}>
69
             <Button type="default" onClick={() => goBack()}>
77
             <Button type="default" onClick={() => goBack()}>
70
               返回
78
               返回

+ 6
- 0
src/services/card.js View File

13
  * @returns
13
  * @returns
14
  */
14
  */
15
 export const getCardDetail = (id) => request(`/card/${id}`);
15
 export const getCardDetail = (id) => request(`/card/${id}`);
16
+ /**
17
+ * 查询犬证二维码
18
+ * @param {*} params
19
+ * @returns
20
+ */
21
+  export const getCardQRCode = (id) => request(`/cardNo/${id}`);
16
 
22
 
17
 /**
23
 /**
18
  * 查询制卡列表
24
  * 查询制卡列表