Browse Source

二维码管理

qymljy 7 months ago
parent
commit
277d3a8bfa
4 changed files with 63 additions and 15 deletions
  1. 41 9
      public/codeToFile.html
  2. BIN
      public/img/bnBag.png
  3. 22 6
      src/HDrpManagement/codeManage/index.vue
  4. BIN
      src/assets/icons/bnBag.png

+ 41 - 9
public/codeToFile.html

@@ -1,12 +1,44 @@
 <!DOCTYPE html>
 <html lang="en">
-<head>
-    <meta charset="UTF-8">
-    <title>商品资料页</title>
-</head>
-<body>
-    <div style="width:100%;height:50px;margin:auto">
-        <h3 style="font-size: 40px;height:50px;line-height: 50px;vertical-align: auto;text-align: left;margin-left: 20px">产品技术资料</h3>
-    </div>
-</body>
+    <head>
+        <meta charset="UTF-8">
+        <title>商品资料页</title>
+        <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
+    </head>
+    <body>
+        <img src="./img/bnBag.png" width="85%" height="180px" style="margin: 60pt 0 30pt 30pt">
+        <div style="width:100%;height:50px;margin:0 0 20pt 30pt">
+            <div style="font-size: 40pt;height:50px;line-height: 50px;vertical-align: auto;text-align: left;color: #333333;font-weight: bold" >产品技术资料</div>
+        </div>
+        <div></div>
+        <script>
+            window.onload =function(){
+                var loc=location.href;
+                var n1=loc.length;
+                var n2=loc.indexOf('=');
+                var code=loc.slice(n2+1,n1)
+                let that = this
+                console.log(code)
+                let param = {
+                    "id": 2025082515112802,
+                    "content": {
+                        "code": code
+                    },
+                }
+                $.ajax(
+                    {
+                        type:'post',
+                        url:'http://61.164.207.46:8000/codeToFile.htm',
+                        data:param,
+                        dataType:'json',
+                        async:true,
+                        success:function(data){
+                            console.log(data)
+                            alert(data)
+                        }
+                    }
+                )
+            }
+        </script>
+    </body>
 </html>

BIN
public/img/bnBag.png


+ 22 - 6
src/HDrpManagement/codeManage/index.vue

@@ -8,8 +8,10 @@
         idName="plm_technicalinfo_codeids"
         :apiId="{query:2025082513210302,del:2025082513211502}">
       <template v-slot:tbList="scope">
-        <div v-if="scope.data.column.columnname == 'codeImg'" @click="codeClick">
-            <vue-qr  text="http://192.168.3.146:8000/codeToFile.html" :size="36" ></vue-qr>
+        <div v-if="scope.data.column.columnname == 'codeImg'" >
+          <div  @click="codeClick(scope.data.column.data.code)">
+            <vue-qr  :text="url + '?code=' + scope.data.column.data.code" :size="36" @callback="callback"></vue-qr>
+          </div>
         </div>
         <div>
           {{scope.data.column.data[scope.data.column.columnname]}}
@@ -27,7 +29,7 @@
         :visible.sync="dialogVisible"
         width="700px"
     >
-      <vue-qr  text="http://192.168.3.146:8000/codeToFile.html" :size="600" @click="codeClick"></vue-qr>
+      <vue-qr  :text="bigUrl" :size="600" @click="codeClick"  @callback="callback"></vue-qr>
     </el-dialog>
   </div>
 </template>
@@ -42,16 +44,30 @@ export default {
   components:{edit,darwerPanel,btnDelete,vueQr},
   data(){
     return {
-      dialogVisible:false
+      dialogVisible:false,
+      url:'http://61.164.207.46:8000/codeToFile.html',
+      bigUrl:''
     }
   },
   methods:{
     onSuccess(){
       this.$refs.basicLayout.listData()
     },
-    codeClick(){
-      console.log('输出111111111111')
+    async codeClick(code){
+      console.log(code,'code')
       this.dialogVisible = true
+      this.bigUrl = this.url + '?code=' + code
+      // const res = await this.$api.requested({
+      //   "id": 2025082515112802,
+      //   "content": {
+      //     "code": code
+      //   },
+      // })
+      // console.log(res.data)
+      // this.bigUrl = this.url + '?data=' + res.data
+    },
+    callback(){
+      console.log('测试内容1111')
     }
   }
 }

BIN
src/assets/icons/bnBag.png