|
@@ -333,6 +333,9 @@ getGoodsDetail({goods_id:id.value,rand_num:rand_num.value}).then(res=>{
|
|
isLoading.value=false
|
|
isLoading.value=false
|
|
item.value=res.data
|
|
item.value=res.data
|
|
// item.value.detail=getspan(item.value.detail)
|
|
// item.value.detail=getspan(item.value.detail)
|
|
|
|
+ setTimeout(_=>{
|
|
|
|
+ createCanvas()
|
|
|
|
+ },100)
|
|
})
|
|
})
|
|
// getsimpleimages().then(res=>{
|
|
// getsimpleimages().then(res=>{
|
|
// let arr=res.data
|
|
// let arr=res.data
|
|
@@ -342,6 +345,7 @@ getGoodsDetail({goods_id:id.value,rand_num:rand_num.value}).then(res=>{
|
|
// }
|
|
// }
|
|
// })
|
|
// })
|
|
// })
|
|
// })
|
|
|
|
+
|
|
})
|
|
})
|
|
})
|
|
})
|
|
function getspan(str) {
|
|
function getspan(str) {
|
|
@@ -422,21 +426,23 @@ getGoodsDetail({goods_id:id.value,rand_num:rand_num.value}).then(res=>{
|
|
// url.value = canvas.toDataURL("image/png");
|
|
// url.value = canvas.toDataURL("image/png");
|
|
// show.value = true
|
|
// show.value = true
|
|
// });
|
|
// });
|
|
- var swiper = document.getElementById('copyswiperItem'); // 获取dom元素
|
|
|
|
- var dom = document.getElementById('content1'); // 获取dom元素
|
|
|
|
- var dom1 = document.getElementById('copycontent'); // 获取dom元素
|
|
|
|
- dom1.innerHTML=dom.innerHTML
|
|
|
|
- let res = domTrans(dom1)
|
|
|
|
- // console.log(1223,res)
|
|
|
|
- let html = forFn(res)
|
|
|
|
- dom1.innerHTML=html
|
|
|
|
- html2canvas(swiper,{
|
|
|
|
- allowTaint: true,
|
|
|
|
- useCORS: true
|
|
|
|
- }).then((canvas) => {
|
|
|
|
- url.value = canvas.toDataURL("image/png").replace('image/png', 'image/octet-stream');
|
|
|
|
- show.value=true
|
|
|
|
- });
|
|
|
|
|
|
+ // var swiper = document.getElementById('copyswiperItem'); // 获取dom元素
|
|
|
|
+ // var dom = document.getElementById('content1'); // 获取dom元素
|
|
|
|
+ // var dom1 = document.getElementById('copycontent'); // 获取dom元素
|
|
|
|
+ // dom1.innerHTML=dom.innerHTML
|
|
|
|
+ // let res = domTrans(dom1)
|
|
|
|
+ // // console.log(1223,res)
|
|
|
|
+ // let html = forFn(res)
|
|
|
|
+ // dom1.innerHTML=html
|
|
|
|
+ // html2canvas(swiper,{
|
|
|
|
+ // allowTaint: true,
|
|
|
|
+ // useCORS: true
|
|
|
|
+ // }).then((canvas) => {
|
|
|
|
+ // url.value = canvas.toDataURL("image/png").replace('image/png', 'image/octet-stream');
|
|
|
|
+ // show.value=true
|
|
|
|
+ // });
|
|
|
|
+ url.value=canvasValue.value.toDataURL("image/png").replace('image/png', 'image/octet-stream');
|
|
|
|
+ show.value=true
|
|
}
|
|
}
|
|
let url = ref()
|
|
let url = ref()
|
|
let content = `
|
|
let content = `
|
|
@@ -602,6 +608,23 @@ getGoodsDetail({goods_id:id.value,rand_num:rand_num.value}).then(res=>{
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+ let canvasValue=ref({})
|
|
|
|
+ function createCanvas() {
|
|
|
|
+ var swiper = document.getElementById("copyswiperItem"); // 获取dom元素
|
|
|
|
+ var dom = document.getElementById("content1"); // 获取dom元素
|
|
|
|
+ var dom1 = document.getElementById("copycontent"); // 获取dom元素
|
|
|
|
+ dom1.innerHTML = dom.innerHTML;
|
|
|
|
+ let res = domTrans(dom1);
|
|
|
|
+ let html = forFn(res);
|
|
|
|
+ dom1.innerHTML = html;
|
|
|
|
+ html2canvas(swiper, {
|
|
|
|
+ allowTaint: true,
|
|
|
|
+ useCORS: true,
|
|
|
|
+ }).then((canvas) => {
|
|
|
|
+ canvasValue.value=canvas
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
|