Commit b6da89b8 by hank

图片跨域

parent d252a9eb
......@@ -365,6 +365,8 @@ export default {
ctx.drawImage(img, 0,0,960, 1338)
var img2 = new Image()
img2.src = imgUrl || require('../../static/upload.jpg')
img.setAttribute("crossOrigin",'Anonymous')
img2.setAttribute("crossOrigin",'Anonymous')
img2.onload = function (param) {
ctx.drawImage(img2, 293,640,377, 377)
_this.shareCode = canvas.toDataURL()
......@@ -377,6 +379,20 @@ export default {
share() {
var _this = this
// alert('share')
axios.post('/weixin/getcode', {
scene: _this.$route.query.id,
pages: 'pages/webview/webview'
}).then(res => {
// _this.shareCode = res.data.data.weixinCode
if(res.data.data.weixinCode) {
_this.getCanvasDrawImage(res.data.data.weixinCode)
_this.shareOnoff2 = true
} else {
_this.getCanvasDrawImage()
}
// alert(JSON.stringify(res.data.data))
})
window.wx.miniProgram.getEnv(function (res) {
if (res.miniprogram) {
// todo
......@@ -393,7 +409,7 @@ export default {
_this.shareOnoff2 = true
}
alert(JSON.stringify(res.data.data))
// alert(JSON.stringify(res.data.data))
})
} else {
_this.shareOnoff = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment