|
|
@@ -50,6 +50,7 @@ const shareUrl = ref('')
|
|
|
const userInfo = computed(() => {
|
|
|
return userStore.userInfo
|
|
|
})
|
|
|
+const isWechat = navigator.userAgent.indexOf('MicroMessenger') !== -1
|
|
|
|
|
|
const postRef: Ref<HTMLElement | null> = ref(null)
|
|
|
function init() {
|
|
|
@@ -60,19 +61,23 @@ function init() {
|
|
|
'redirect_uri=' + encodeURIComponent('https://chillgpt.raexmeta.com/#/vip?vipPay=true')
|
|
|
)
|
|
|
shareUrl.value = str
|
|
|
- showModal.value = true
|
|
|
-
|
|
|
- setTimeout(() => {
|
|
|
- html2canvas(postRef.value!, {
|
|
|
- useCORS: true,
|
|
|
- allowTaint: true,
|
|
|
- backgroundColor: null,
|
|
|
- scale: 3
|
|
|
- }).then(canvas => {
|
|
|
- console.log(canvas)
|
|
|
- imgUrl.value = canvas.toDataURL('image/png')
|
|
|
- })
|
|
|
- }, 500)
|
|
|
+ if (isWechat) {
|
|
|
+ window.location.href = shareUrl.value
|
|
|
+ } else {
|
|
|
+ showModal.value = true
|
|
|
+
|
|
|
+ setTimeout(() => {
|
|
|
+ html2canvas(postRef.value!, {
|
|
|
+ useCORS: true,
|
|
|
+ allowTaint: true,
|
|
|
+ backgroundColor: null,
|
|
|
+ scale: 3
|
|
|
+ }).then(canvas => {
|
|
|
+ console.log(canvas)
|
|
|
+ imgUrl.value = canvas.toDataURL('image/png')
|
|
|
+ })
|
|
|
+ }, 500)
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
|