|
@@ -0,0 +1,133 @@
|
|
|
+<template>
|
|
|
+ <div class="eight">
|
|
|
+ <van-row class="luckDraw">
|
|
|
+ <van-col
|
|
|
+ span="8"
|
|
|
+ v-for="i in 12"
|
|
|
+ :key="i"
|
|
|
+ :class="{ shakeSlow: show[i - 1] }"
|
|
|
+ >
|
|
|
+ <div v-if="show[i - 1]" class="click">点我</div>
|
|
|
+ <van-image
|
|
|
+ :width="img.width"
|
|
|
+ :height="img.height"
|
|
|
+ :class="{ img: true }"
|
|
|
+ fit="contain"
|
|
|
+ src="err"
|
|
|
+ >
|
|
|
+ <template v-slot:loading>
|
|
|
+ <van-loading type="spinner" size="20" />
|
|
|
+ </template>
|
|
|
+ </van-image>
|
|
|
+ </van-col>
|
|
|
+ </van-row>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <script setup>
|
|
|
+ import { reactive, ref } from "vue";
|
|
|
+ // import { onMounted, reactive } from "vue";
|
|
|
+ // import { isIpad, isIpod, isIphone } from "../../utils/isTerminal";
|
|
|
+ /**
|
|
|
+ * window.$originData.orginParames.title 页面标题
|
|
|
+ * window.$originData.orginParames.parameters 固定参数值
|
|
|
+ * window.$originData.urlParames url参数
|
|
|
+ */
|
|
|
+ let w = window.$originData.orginParames.availWidth || 0;
|
|
|
+ const show = ref(Array(12).fill(false));
|
|
|
+
|
|
|
+ setInterval(() => {
|
|
|
+ let index = Math.ceil(Math.random() * 12) - 1;
|
|
|
+ if (index < 0) index = 0;
|
|
|
+ for (let i = 0; i < show.value.length; i++) {
|
|
|
+ show.value[i] = i == index;
|
|
|
+ }
|
|
|
+ }, 5000);
|
|
|
+
|
|
|
+ w = (w / 3) * 0.8;
|
|
|
+ const img = reactive({
|
|
|
+ width: w,
|
|
|
+ height: w,
|
|
|
+ });
|
|
|
+ </script>
|
|
|
+ <style lang="scss" scoped>
|
|
|
+ .eight {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ padding-top: 1rem;
|
|
|
+ background-color: #fff;
|
|
|
+ .luckDraw {
|
|
|
+ $background: #00000040;
|
|
|
+ background-color: #eeeeee80;
|
|
|
+ border-radius: 5px;
|
|
|
+ padding: 0.5em;
|
|
|
+ margin: 0 auto;
|
|
|
+ width: 96%;
|
|
|
+ .img {
|
|
|
+ border-radius: 5px;
|
|
|
+ display: block;
|
|
|
+ margin: auto;
|
|
|
+ border: 3px solid #ffffff;
|
|
|
+ }
|
|
|
+ .click {
|
|
|
+ background-color: $background;
|
|
|
+ position: absolute;
|
|
|
+ border-radius: 3px;
|
|
|
+ text-align: center;
|
|
|
+ padding: 2px 3px;
|
|
|
+ color: #fff;
|
|
|
+ font-size: 14px;
|
|
|
+ right: -0.5em;
|
|
|
+ top: -0.5em;
|
|
|
+ width: 4em;
|
|
|
+ z-index: 10;
|
|
|
+ }
|
|
|
+ .click:before {
|
|
|
+ position: absolute;
|
|
|
+ display: block;
|
|
|
+ content: " ";
|
|
|
+ height: 0px;
|
|
|
+ width: 0px;
|
|
|
+ border: 3px solid $background;
|
|
|
+ border-top-color: rgba($color: #000000, $alpha: 0);
|
|
|
+ border-left-color: rgba($color: #000000, $alpha: 0);
|
|
|
+ bottom: -3px;
|
|
|
+ left: 9px;
|
|
|
+ transform: rotate(45deg);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .shakeSlow {
|
|
|
+ animation: shake-slow 1s ease-in-out;
|
|
|
+ }
|
|
|
+
|
|
|
+ @keyframes shake-slow {
|
|
|
+ 0% {
|
|
|
+ transform: rotate(0) scale(1);
|
|
|
+ }
|
|
|
+ 20% {
|
|
|
+ transform: rotate(2.5deg);
|
|
|
+ }
|
|
|
+ 40% {
|
|
|
+ transform: rotate(-2.5deg);
|
|
|
+ }
|
|
|
+ 60% {
|
|
|
+ transform: rotate(2.5deg) scale(1.1);
|
|
|
+ }
|
|
|
+ 80% {
|
|
|
+ transform: rotate(-2.5deg);
|
|
|
+ }
|
|
|
+ 100% {
|
|
|
+ transform: rotate(0);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ </style>
|
|
|
+ <style lang="scss">
|
|
|
+ .eight {
|
|
|
+ .van-col {
|
|
|
+ padding: 0.2em 0;
|
|
|
+ position: relative;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ </style>
|
|
|
+
|