修复练习不能分享的问题
This commit is contained in:
@@ -13,7 +13,7 @@ import BowPower from "@/components/BowPower.vue";
|
||||
import TestDistance from "@/components/TestDistance.vue";
|
||||
import BubbleTip from "@/components/BubbleTip.vue";
|
||||
import { createPractiseAPI } from "@/apis";
|
||||
import { generateCanvasImage } from "@/util";
|
||||
import { generateCanvasImage, wxShare, debounce } from "@/util";
|
||||
import { MESSAGETYPES } from "@/constants";
|
||||
import useStore from "@/store";
|
||||
import { storeToRefs } from "pinia";
|
||||
@@ -79,23 +79,23 @@ async function onReceiveMessage(messages = []) {
|
||||
arrows: JSON.parse(msg.practice.arrows),
|
||||
lvl: msg.lvl,
|
||||
};
|
||||
generateCanvasImage(
|
||||
"shareCanvas",
|
||||
1,
|
||||
user.value,
|
||||
practiseResult.value
|
||||
);
|
||||
}, 1500);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const onClickShare = debounce(async () => {
|
||||
await generateCanvasImage("shareCanvas", 1, user.value, practiseResult.value);
|
||||
await wxShare("shareCanvas");
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
uni.setKeepScreenOn({
|
||||
keepScreenOn: true,
|
||||
});
|
||||
uni.$on("socket-inbox", onReceiveMessage);
|
||||
uni.$on("share-image", onClickShare);
|
||||
});
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
@@ -103,6 +103,7 @@ onBeforeUnmount(() => {
|
||||
keepScreenOn: false,
|
||||
});
|
||||
uni.$off("socket-inbox", onReceiveMessage);
|
||||
uni.$off("share-image", onClickShare);
|
||||
});
|
||||
|
||||
const nextStep = async () => {
|
||||
|
||||
Reference in New Issue
Block a user