|
|
|
@ -32,7 +32,7 @@ |
|
|
|
<view class="table"> |
|
|
|
<!-- 全部合规 --> |
|
|
|
<template v-if="detail.level3Num === detail.levelAllNum"> |
|
|
|
<img class="img-succ" style="display: block;" :src="configList.compliance_img" crossorigin=“anonymous /> |
|
|
|
<img ref="succ" class="img-succ" style="display: block;" :src="configList.compliance_img" crossorigin=“anonymous /> |
|
|
|
</template> |
|
|
|
<template v-else> |
|
|
|
<reportTableView :list="tableList"></reportTableView> |
|
|
|
@ -41,23 +41,18 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="flex flex-column contact"> |
|
|
|
<view class="flex flex-column contact" v-if="configList.company_qrcode"> |
|
|
|
<view>扫下方二维码联系我们给你1V1解决方案</view> |
|
|
|
<img class="qr" style="display: block;" :src="configList.company_qrcode" crossorigin=“anonymous /> |
|
|
|
<img ref="qr" class="qr" style="display: block;" :src="configList.company_qrcode" crossorigin=“anonymous /> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view> |
|
|
|
<img class="img" style="display: block;" :src="configList.company_info" crossorigin=“anonymous /> |
|
|
|
<view class="logo"> |
|
|
|
<img class="img" style="display: block;" :src="configList.company_logo" crossorigin=“anonymous /> |
|
|
|
<img v-if="configList.company_info" ref="info" class="img" style="display: block;" :src="configList.company_info" crossorigin=“anonymous /> |
|
|
|
<view class="logo" v-if="configList.company_logo"> |
|
|
|
<img ref="logo" class="img" style="display: block;" :src="configList.company_logo" crossorigin=“anonymous /> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<!-- <view class="bottom" data-html2canvas-ignore="true"> |
|
|
|
<button class="btn" @click="onDownload">长按图片保存到手机</button> |
|
|
|
</view> --> |
|
|
|
|
|
|
|
</view> |
|
|
|
</template> |
|
|
|
@ -75,6 +70,7 @@ |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
batchNo: null, |
|
|
|
detail: null, |
|
|
|
tableList: [], |
|
|
|
canvas: null, |
|
|
|
@ -95,8 +91,22 @@ |
|
|
|
|
|
|
|
const { batchNo, token } = arg |
|
|
|
token && uni.setStorageSync('token', token) |
|
|
|
|
|
|
|
await this.getData(batchNo) |
|
|
|
this.batchNo = batchNo |
|
|
|
}, |
|
|
|
async mounted() { |
|
|
|
console.log('mounted', this.batchNo) |
|
|
|
await this.getData(this.batchNo) |
|
|
|
|
|
|
|
let fetchs = [ |
|
|
|
{ ref: 'qr', url: this.configList.company_qrcode }, |
|
|
|
{ ref: 'info', url: this.configList.company_info }, |
|
|
|
{ ref: 'logo', url: this.configList.company_logo }, |
|
|
|
{ ref: 'succ', url: this.configList.compliance_img }, |
|
|
|
].map(item => { |
|
|
|
return this.preLoadImage(item.ref, item.url) |
|
|
|
}) |
|
|
|
|
|
|
|
await Promise.all(fetchs) |
|
|
|
|
|
|
|
setTimeout(async () => { |
|
|
|
await this.createImage() |
|
|
|
@ -109,7 +119,7 @@ |
|
|
|
showCancel: false, |
|
|
|
confirmText: '知道了' |
|
|
|
}) |
|
|
|
}, 800) |
|
|
|
}, 1000) |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
async getData(batchNo) { |
|
|
|
@ -167,6 +177,28 @@ |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
async preLoadImage(ref, url) { |
|
|
|
return new Promise((resolve) => { |
|
|
|
console.log(ref, url) |
|
|
|
if (!this.$refs[ref] || !url) { |
|
|
|
resolve() |
|
|
|
return |
|
|
|
} |
|
|
|
uni.downloadFile({ |
|
|
|
url, |
|
|
|
success: (res) => { |
|
|
|
if (res.statusCode === 200) { |
|
|
|
console.log('下载成功'); |
|
|
|
this.$refs[ref].src = res.tempFilePath |
|
|
|
resolve() |
|
|
|
} |
|
|
|
}, |
|
|
|
fail: (err) => { |
|
|
|
resolve() |
|
|
|
} |
|
|
|
}); |
|
|
|
}) |
|
|
|
}, |
|
|
|
async createImage() { |
|
|
|
console.log('createImage') |
|
|
|
const node = document.querySelector('.export') |
|
|
|
@ -181,23 +213,6 @@ |
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
onDownload() { |
|
|
|
if (!this.tempFilePath) { |
|
|
|
uni.showToast({ |
|
|
|
title: '图片还未生成完成', |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
// H5环境下提示用户长按保存 |
|
|
|
uni.showModal({ |
|
|
|
title: '保存图片', |
|
|
|
content: '请长按上方图片,选择"保存图片"即可保存到手机', |
|
|
|
showCancel: false, |
|
|
|
confirmText: '知道了' |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
} |
|
|
|
</script> |
|
|
|
|