Commit e46230b3 by zhangquan

bug修复

1 parent 497f142c
...@@ -85,3 +85,7 @@ html { ...@@ -85,3 +85,7 @@ html {
vertical-align: middle; vertical-align: middle;
white-space: nowrap; white-space: nowrap;
} }
.message-Z-zinde{
z-index: 5000 !important;
}
...@@ -34,7 +34,7 @@ export default { ...@@ -34,7 +34,7 @@ export default {
}, },
inviteInfo: { inviteInfo: {
type: Object, type: Object,
default: () => { } default: () => {}
} }
// hideStatus: Boolean // hideStatus: Boolean
}, },
...@@ -52,9 +52,10 @@ export default { ...@@ -52,9 +52,10 @@ export default {
SC003: 2, SC003: 2,
SC004: 3 SC004: 3
} }
this.inviteInfo.sceneCodeList && this.inviteInfo.sceneCodeList.forEach(item => { this.inviteInfo.sceneCodeList &&
sceneStr = sceneStr + (sceneStr ? (',' + sceneToNum[item]) : sceneToNum[item]) this.inviteInfo.sceneCodeList.forEach(item => {
}) sceneStr = sceneStr + (sceneStr ? ',' + sceneToNum[item] : sceneToNum[item])
})
let params = { let params = {
merchantId: this.inviteInfo.shopMerchantId, merchantId: this.inviteInfo.shopMerchantId,
staffLabel: sceneStr staffLabel: sceneStr
...@@ -63,13 +64,24 @@ export default { ...@@ -63,13 +64,24 @@ export default {
this.inviteData = res this.inviteData = res
}) })
}, },
handleSaveImg(url, downloadTxt = '海报') { handleSaveImg(imgSrc, fileName = '二维码') {
var alink = document.createElement('a') let image = new Image()
alink.href = url image.src = imgSrc
alink.setAttribute('target', '_blank') // 解决跨域 Canvas 污染问题
alink.download = downloadTxt image.setAttribute('crossOrigin', 'Anonymous') // 支持跨域
alink.click() image.onload = function() {
alink.remove() var canvas = document.createElement('canvas')
canvas.width = image.width
canvas.height = image.height
var context = canvas.getContext('2d')
context.drawImage(image, 0, 0, image.width, image.height)
var url = canvas.toDataURL('image/png') //得到图片的base64编码数据
var a = document.createElement('a') // 生成一个a元素
var event = new MouseEvent('click') // 创建一个单击事件
a.download = fileName || 'photo' // 设置图片名称
a.href = url // 将生成的URL设置为a.href属性
a.dispatchEvent(event) // 触发a的单击事件
}
}, },
handleSaveTxt(txt) { handleSaveTxt(txt) {
this.$message({ this.$message({
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!