浏览代码

h5下载二维码

魏超 5 年前
父节点
当前提交
d77ab229b6
共有 1 个文件被更改,包括 22 次插入0 次删除
  1. 22
    0
      src/pages/activity/drainage/DrainageList.jsx

+ 22
- 0
src/pages/activity/drainage/DrainageList.jsx 查看文件

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
   const exchangeDrainage = drainage => () => {
93
   const exchangeDrainage = drainage => () => {
77
     if(drainage.status === 1){
94
     if(drainage.status === 1){
78
       if(drainage.isMiniapp){
95
       if(drainage.isMiniapp){
206
               数据
223
               数据
207
             </span>
224
             </span>
208
           </AuthButton>
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
     },