zhaoxiaoqiang1
2026-01-04 f1d30d03186c79ca2cbcfe60d6d2ce7d73fba97b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<template>
  <el-dialog title="请用好酷APP扫描二维码" center :visible.sync="showQrcode" width="400px" :close-on-click-modal='false' @close="closeDialog">
    <div id="qrcode"></div>
  </el-dialog>
</template>
<script>
import {
  qryQRCodeData
} from "@/api/product";
import QRCode from 'qrcodejs2'
import { setStorage, getStorage } from "@/utils/storage";
export default {
  props:['visible'],
  data () {
    return {
      applyInfo:this.$store.state.product.applyInfo,
    }
  },
  computed: {
    showQrcode:{
      get(){
        return this.visible
      },
      set(){}
    }
  },
  created () {
    this.qryQRCode()
  },
  methods: {
    closeDialog(){
      this.$emit('closeQrcode',false)
    },
    qryQRCode(){
      qryQRCodeData({ applySerialno: this.applyInfo.serialNo }).then(res=>{
        if(res.code=='00'){
          let qrcode = new QRCode('qrcode', {
            width: 180,  
            height: 180,
            text: JSON.stringify(res.result.data),
            colorDark : "#000",
            colorLight : "#fff",
          })
        }
      })
    }
  }
}
</script>
<style lang="stylus">
#qrcode
  img 
    margin 0 auto
</style>