JXDS18FUJT пре 1 година
родитељ
комит
bfcddb5b71
3 измењених фајлова са 47 додато и 0 уклоњено
  1. 4 0
      src/App.tsx
  2. 7 0
      src/views/wxcode/index.less
  3. 36 0
      src/views/wxcode/index.tsx

+ 4 - 0
src/App.tsx

@@ -12,6 +12,7 @@ import { DownloadCaigong1 } from "./views/downloadCaigong1";
 import { DownloadCaigong2 } from "./views/downloadCaigong2";
 import { PdfImages } from './views/pdfImages'
 import { Marked } from './views/marked'
+import { Wxcode } from './views/wxcode'
 export function App() {
 
   return (
@@ -39,6 +40,9 @@ export function App() {
         <Route path="/videoKindList">
           <VideoKindList />
         </Route>
+        <Route path="/wxcode">
+          <Wxcode />
+        </Route>
         <Route path="/marked">
           <Marked />
         </Route>

+ 7 - 0
src/views/wxcode/index.less

@@ -0,0 +1,7 @@
+.Wxcode{
+    .col{
+        padding: 30px;
+        font-size: 30px;
+        
+    }
+}

+ 36 - 0
src/views/wxcode/index.tsx

@@ -0,0 +1,36 @@
+import { Button } from 'react-vant';
+import './index.less'
+import React, { useState } from "react";
+export const Wxcode: React.FC = (props: any) => {
+    const query = new URLSearchParams(window.location.search)
+    const [code] = useState(query.get("code") || "")
+    const [state] = useState(query.get("state") || "")
+    const nkjk1H5 = "https://nbjk1-h5.zzxcx.net/home?code="+code+"&state=LOGIN"
+    const copyText = (text:string)=>{
+      
+        let oInput = document.createElement("input");
+        oInput.value = text;
+        document.body.appendChild(oInput);
+        oInput.select(); // 选择对象;
+        document.execCommand("Copy"); // 执行浏览器复制命令
+        console.log('复制成功')
+        oInput.remove();
+    }
+    return (
+        <div className='Wxcode'>
+            <div className='col'>
+                <div>code:{code}</div>
+                <div style={{
+                    display:'flex',
+                    justifyContent:'space-between'
+                }} className=''>
+                <Button onClick={()=>{copyText(code)}} type='primary'>复制code</Button>
+                <Button onClick={()=>{copyText(nkjk1H5)}} type='primary'>复制测试服地址</Button>
+                </div>
+             
+                <div>state:{state}</div>
+            </div>
+        </div>
+    )
+
+}