<template>
    <div>
        <h3 style="color:#2d8cf0;font-size:18px;margin:14px 0 0 15px">二维码管理</h3>
        <h5 style="margin:24px 0 0 15px;display:inline-block">前台扫描二维码</h5>
        <div class="Qrcode">
            <img :src="url" style="width:100%;height:100%">
        </div>
        <p class="xiazai" @click="downPic">下载</p>
    </div>
</template>
<script>
import {getErcode,downloadErcode} from '../../api/stystem.server.js'
import {
    sapi
} from '../../config'
export default {
    data(){
      return {
          url:'',
          url2:''
      }
    },
    methods:{
    //取到二维码
    getercode(){
       getErcode().then(res=>{
         if(res.data.success==true){
            this.url=res.data.body
        }  
       }) 
    },
    downPic (img) {
     window.location.href=`${sapi}/api/qrCode/downQrCode`
    }

    },
    mounted(){
      this.getercode()
    }
}
</script>
<style>
.Qrcode{
    height: 200px;
    width: 200px;
    border: 1px solid black;
    margin: 20px 0 0 15px
}
.xiazai{
    height: 30px;
    width: 100px;
    background:#2d8cf0;
    color: white;
    line-height: 30px;
    text-align: center;
    border-radius: 5px ;
    position: absolute;
    left: 230px;
    top:270px
}
</style>
