|
|
@@ -1,16 +1,19 @@
|
|
|
<template>
|
|
|
<section class="cert-id">
|
|
|
<section class="cert-id-box">
|
|
|
- <h1>{{detail.name}}证书</h1>
|
|
|
- <div class="hr"></div>
|
|
|
- <canvas ref="canvas" width="850" height="520">对不起, 您的浏览器不支持绘图功能, 请更新浏览器.</canvas>
|
|
|
- <img ref="img" class="img" src="~@/assets/img/cert/bg.png" alt="img">
|
|
|
- <img ref="qrImg" class="img" src="/api/cert/certQrCode" alt="qrImg">
|
|
|
- <section style="width: 850px;">
|
|
|
- <a :href="userinfo.seo_uri">开发者个人主页 ></a>
|
|
|
- <br>
|
|
|
- <a :href="`/cert/freelancer?id=${detail.id}`">{{detail.name}}认证标准 ></a>
|
|
|
- </section>
|
|
|
+ <template v-if="detail.name">
|
|
|
+ <h1>{{detail.name}}证书</h1>
|
|
|
+ <div class="hr"></div>
|
|
|
+ <canvas ref="canvas" width="850" height="520">对不起, 您的浏览器不支持绘图功能, 请更新浏览器.</canvas>
|
|
|
+ <img ref="img" class="img" src="~@/assets/img/cert/bg.png" alt="img">
|
|
|
+ <img ref="qrImg" class="img" src="/api/cert/certQrCode" alt="qrImg">
|
|
|
+ <section style="width: 850px;">
|
|
|
+ <a :href="userinfo.seo_uri">开发者个人主页 ></a>
|
|
|
+ <br>
|
|
|
+ <a :href="`/cert/freelancer?id=${detail.id}`">{{detail.name}}认证标准 ></a>
|
|
|
+ </section>
|
|
|
+ </template>
|
|
|
+ <h1 v-else>未查询到证书</h1>
|
|
|
</section>
|
|
|
</section>
|
|
|
</template>
|
|
|
@@ -31,25 +34,27 @@ let canvas = null
|
|
|
export default {
|
|
|
async asyncData(ctx) {
|
|
|
let res = await http.post(`/api/cert/getCertDetail`, { cert_no: ctx.query.no })
|
|
|
+ , detail = {}
|
|
|
+ if(res) {
|
|
|
+ detail = res.data
|
|
|
+ }
|
|
|
return {
|
|
|
- detail: res.data
|
|
|
+ detail
|
|
|
}
|
|
|
},
|
|
|
head() {
|
|
|
return {
|
|
|
title: `${this.detail.name}证书-程序员客栈`,
|
|
|
- meta: [
|
|
|
- // { hid: 'description', name: 'description', content: 'My custom description' }
|
|
|
- ]
|
|
|
}
|
|
|
},
|
|
|
data() {
|
|
|
- return {}
|
|
|
+ return { detail: {} }
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState(['userinfo']),
|
|
|
},
|
|
|
mounted() {
|
|
|
+ if(!this.detail.name) return
|
|
|
this.initCanvas()
|
|
|
this.checkInfoFull()
|
|
|
interval = setInterval(this.checkInfoFull, 500)
|