魏超 před 5 roky
rodič
revize
d77ab229b6
1 změnil soubory, kde provedl 22 přidání a 0 odebrání
  1. 22
    0
      src/pages/activity/drainage/DrainageList.jsx

+ 22
- 0
src/pages/activity/drainage/DrainageList.jsx Zobrazit soubor

@@ -73,6 +73,23 @@ const header = (props) => {
73 73
     });
74 74
   }
75 75
 
76
+  const newQrcode = row => {
77
+    const x = new XMLHttpRequest();
78
+    const resourceUrl = row.qrCode
79
+    console.log(resourceUrl);
80
+    x.open('GET', resourceUrl, true);
81
+    x.responseType = 'blob';
82
+    x.onload = function (e) {
83
+      const url = window.URL.createObjectURL(x.response)
84
+      const a = document.createElement('a');
85
+      a.href = url;
86
+      a.style.display = 'none'
87
+      a.download = 'H5二维码.png';
88
+      a.click();
89
+    }
90
+    x.send();
91
+  }
92
+
76 93
   const exchangeDrainage = drainage => () => {
77 94
     if(drainage.status === 1){
78 95
       if(drainage.isMiniapp){
@@ -206,6 +223,11 @@ const header = (props) => {
206 223
               数据
207 224
             </span>
208 225
           </AuthButton>
226
+          <AuthButton name="admin.taDrainage.id.delete" noRight={null}>
227
+            <span style={{ right: '20px', bottom: ' 10px', fontSize: ' 0.106rem', color: '#FF7E48', cursor: 'pointer', marginLeft: 20 }} onClick={newQrcode.bind(this, datas)}>
228
+              下载二维码
229
+            </span>
230
+          </AuthButton >
209 231
         </>
210 232
       ),
211 233
     },