update
This commit is contained in:
@@ -1,13 +1,22 @@
|
||||
<script setup>
|
||||
import { Storage, generateQR } from "../libs/utils.js"
|
||||
import ModalTransition from "./ModalTransition.vue"
|
||||
import { ref, watch } from "vue"
|
||||
import { ref, watch, computed } from "vue"
|
||||
import Haibao from "../libs/haibao.js"
|
||||
import ruleBg from "../assets/images/new/rule-share.png"
|
||||
import globalToastEvent, { ToastType } from '../globalToastEvent';
|
||||
import { globalStore } from "../globalstore.js";
|
||||
import share5 from '../assets/images/new/share-bg-5.png';
|
||||
import share4 from '../assets/images/new/share-bg-4.png';
|
||||
import share3 from '../assets/images/new/share-bg-3.png';
|
||||
import share2 from '../assets/images/new/share-bg-2.png';
|
||||
import share1 from '../assets/images/new/share-bg-1.png';
|
||||
import todoListBg from '../assets/images/new/todolist-bg.png';
|
||||
import todoListImg from '../assets/images/new/todolist-img.png';
|
||||
|
||||
const props = defineProps({
|
||||
show: false,
|
||||
isFromTodoList: false
|
||||
})
|
||||
|
||||
watch(() => props.show, async (newVal) => {
|
||||
@@ -18,10 +27,21 @@ watch(() => props.show, async (newVal) => {
|
||||
}, { immediate: true })
|
||||
|
||||
const emit = defineEmits(['close'])
|
||||
const gotoLottery = () => {
|
||||
globalToastEvent.emit(ToastType.SHOW_LOTTERY);
|
||||
|
||||
const gameImgMap = {
|
||||
game1: share1,
|
||||
game2: share2,
|
||||
game3: share3,
|
||||
game4: share4,
|
||||
game5: share5
|
||||
}
|
||||
|
||||
// const haibaoBackgroundImg = computed(() => {
|
||||
// const id = Number(props.gameSlideId) || 1;
|
||||
// const img = gameImgMap[`game${id}`] || game1;
|
||||
// return { backgroundImage: `url(${img})` };
|
||||
// })
|
||||
|
||||
const cancelBtn = () => {
|
||||
emit('close')
|
||||
}
|
||||
@@ -32,8 +52,13 @@ const openHaibao = (e) => {
|
||||
handleHaibao()
|
||||
}
|
||||
|
||||
const haibaoBackgroundImg = ref({});
|
||||
const handleHaibao = async () => {
|
||||
const loading = weui.loading()
|
||||
const loading = weui.loading();
|
||||
|
||||
const img = gameImgMap[globalStore.game_id] || 'share1';
|
||||
haibaoBackgroundImg.value = props.isFromTodoList ? { backgroundImage: `url(${todoListImg})` } : { backgroundImage: `url(${img})` };
|
||||
|
||||
const infos = Storage.get("userinfos")
|
||||
const haibaoCover = new Haibao(1080, 2160);
|
||||
|
||||
@@ -60,15 +85,11 @@ const handleHaibao = async () => {
|
||||
<ModalTransition class="popup" :show="show">
|
||||
<div class="home-wrapper">
|
||||
<div class="fullsection">
|
||||
<div class="haibao">
|
||||
<div class="haibao" :style="haibaoBackgroundImg">
|
||||
<img :src="haibaoUrl" alt="">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="scene-item item-4">
|
||||
<img src="../assets/images/new/choujiang.png" @click="gotoLottery" alt="立即抽奖">
|
||||
</div> -->
|
||||
|
||||
<div class="scene-item item-5">
|
||||
<img src="../assets/images/new/close-btn.png" @click="cancelBtn" alt="关闭">
|
||||
</div>
|
||||
@@ -78,9 +99,11 @@ const handleHaibao = async () => {
|
||||
|
||||
<style scoped>
|
||||
.home-wrapper {
|
||||
background-size: contain;
|
||||
background-position: center;
|
||||
width: 100vw;
|
||||
height: 217vw;
|
||||
background-image: url("../assets/images/new/share-bg.png");
|
||||
background-image: url("../assets/images/new/todolist-bg.png");
|
||||
background-size: cover;
|
||||
background-repeat: no-repeat;
|
||||
display: flex;
|
||||
@@ -166,7 +189,7 @@ const handleHaibao = async () => {
|
||||
width: 40vw;
|
||||
}
|
||||
.item-5 {
|
||||
top: 166vw;
|
||||
top: 170vw;
|
||||
width: 14vw;
|
||||
}
|
||||
.scene-item img {
|
||||
|
||||
Reference in New Issue
Block a user