完成兑奖页面逻辑

This commit is contained in:
Andy Leong
2024-01-17 17:13:45 +08:00
parent 27b1eab2ce
commit 3291088bca
48 changed files with 372 additions and 178 deletions

View File

@@ -18,6 +18,7 @@ const bgPic = computed(() => {
const mbti = ref(userStore.MBTI);
console.log("mbti", mbti.value);
const changBg = (event, number) => {
@@ -27,7 +28,7 @@ const changBg = (event, number) => {
debounceTap(
e,
() => {
console.log("bgId", bgId.value);
// console.log("bgId", bgId.value);
},
0.3
);
@@ -36,15 +37,25 @@ const changBg = (event, number) => {
const createPoster = (event) => {
let e = event.target
debounceTap(e, () => {
let saveImg = posterCreate(
{ width: 750, height: 1450 },
// 海报生成
posterCreate(
{ width: 750, height: 1450 }, //海报尺寸
// 海报素材,按顺序依次渲染
[
new URL(`@/assets/images/result/bg-2.jpg`, import.meta.url).href,
new URL(`@/assets/images/qa/question.png`, import.meta.url).href,
new URL(`@/assets/images/qa/showResult-btn.png`, import.meta.url).href
{
src: new URL(`@/assets/images/result/bg-2.jpg`, import.meta.url).href,
pos: { w: 750, h: 1624, x: 0, y: 0 }
},
{
src: new URL(`@/assets/images/qa/question.png`, import.meta.url).href,
pos: { w: 250, h: 1624, x: 0, y: 0 }
},
{
src: new URL(`@/assets/images/qa/showResult-btn.png`, import.meta.url).href,
pos: { w: 250, h: 124, x: 0, y: 0 }
},
]
)
console.log('saveImg', saveImg);
}, 0.4)
}
</script>
@@ -65,6 +76,7 @@ const createPoster = (event) => {
<div style="width: 500px;height: 700px;">
<img class="pic" src="" alt="" srcset="">
</div>
<img id="poster" alt="" srcset="">
</div>
</div>
</template>