|
@@ -1,101 +1,131 @@
|
|
<template>
|
|
<template>
|
|
- <div style="width: 100%; overflow: hidden">
|
|
|
|
- <transition name="fade">
|
|
|
|
- <img
|
|
|
|
- v-if="step === 5"
|
|
|
|
- @click="nextPage"
|
|
|
|
- src="../../../assets/img/next.png"
|
|
|
|
- class="next"
|
|
|
|
- />
|
|
|
|
- </transition>
|
|
|
|
- <div class="sex" :style="'background-image: url(' + bgimg + ')'">
|
|
|
|
- <img
|
|
|
|
- :src="kuangimg"
|
|
|
|
- :style="
|
|
|
|
- step === 2
|
|
|
|
- ? 'opacity: 1'
|
|
|
|
- : step >= 3
|
|
|
|
- ? 'width: 25%;transform: translate(0, 0);opacity: 1; top: 1em; left: 1em'
|
|
|
|
- : 'opacity: 0'
|
|
|
|
- "
|
|
|
|
- class="firstImg"
|
|
|
|
- />
|
|
|
|
- <transition name="fade">
|
|
|
|
- <div
|
|
|
|
- class="sImg img"
|
|
|
|
- v-if="step === 1"
|
|
|
|
- :style="'width:' + width + 'px;'"
|
|
|
|
- >
|
|
|
|
- <template v-for="(item, i) in text.texts" :key="i">
|
|
|
|
- <p
|
|
|
|
- v-text="item"
|
|
|
|
|
|
+ <div>
|
|
|
|
+ <van-swipe
|
|
|
|
+ ref="swipe"
|
|
|
|
+ :touchable="false"
|
|
|
|
+ :show-indicators="false"
|
|
|
|
+ vertical
|
|
|
|
+ indicator-color="white"
|
|
|
|
+ >
|
|
|
|
+ <van-swipe-item>
|
|
|
|
+ <div style="width: 100%; overflow: hidden; position: relative">
|
|
|
|
+ <transition name="fade">
|
|
|
|
+ <img
|
|
|
|
+ v-if="step === 5"
|
|
|
|
+ @click="nextPage"
|
|
|
|
+ src="../../../assets/img/next.png"
|
|
|
|
+ class="next"
|
|
|
|
+ />
|
|
|
|
+ </transition>
|
|
|
|
+ <div class="sex" :style="'background-image: url(' + bgimg + ')'">
|
|
|
|
+ <img
|
|
|
|
+ :src="kuangimg"
|
|
:style="
|
|
:style="
|
|
- stepBody >= i
|
|
|
|
- ? 'opacity: 1;color: ' + text.color
|
|
|
|
- : 'color: ' + text.color
|
|
|
|
|
|
+ step === 2
|
|
|
|
+ ? 'opacity: 1'
|
|
|
|
+ : step >= 3
|
|
|
|
+ ? 'width: 25%;transform: translate(0, 0);opacity: 1; top: 1em; left: 1em'
|
|
|
|
+ : 'opacity: 0'
|
|
"
|
|
"
|
|
- ></p>
|
|
|
|
- <br />
|
|
|
|
- </template>
|
|
|
|
- </div>
|
|
|
|
- </transition>
|
|
|
|
- <transition name="fade">
|
|
|
|
- <div class="body" @click="changeNextStep" v-if="nextStep === 1">
|
|
|
|
- <div class="loading">
|
|
|
|
- <div class="loading1">
|
|
|
|
- <div class="loading2"></div>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- </transition>
|
|
|
|
- <img
|
|
|
|
- :src="text2img"
|
|
|
|
- :style="step >= 4 ? 'opacity: 1' : ''"
|
|
|
|
- class="tImg"
|
|
|
|
- />
|
|
|
|
- <transition name="fade">
|
|
|
|
- <div class="btns" v-if="step === 5">
|
|
|
|
- <div
|
|
|
|
- class="btn"
|
|
|
|
- @click="() => showDown(1)"
|
|
|
|
- style="margin-left: 0"
|
|
|
|
- :stype="'border-color:' + text.color + ';color:' + text.color"
|
|
|
|
- >
|
|
|
|
- 下载壁纸
|
|
|
|
- </div>
|
|
|
|
- <div
|
|
|
|
- class="btn"
|
|
|
|
- @click="() => showDown(2)"
|
|
|
|
- :stype="'border-color:' + text.color + ';color:' + text.color"
|
|
|
|
- >
|
|
|
|
- 生成海报
|
|
|
|
|
|
+ class="firstImg"
|
|
|
|
+ />
|
|
|
|
+ <transition name="fade">
|
|
|
|
+ <div
|
|
|
|
+ class="sImg img"
|
|
|
|
+ v-if="step === 1"
|
|
|
|
+ :style="'width:' + width + 'px;'"
|
|
|
|
+ >
|
|
|
|
+ <template v-for="(item, i) in text.texts" :key="i">
|
|
|
|
+ <p
|
|
|
|
+ v-text="item"
|
|
|
|
+ :style="
|
|
|
|
+ stepBody >= i
|
|
|
|
+ ? 'opacity: 1;color: ' + text.color
|
|
|
|
+ : 'color: ' + text.color
|
|
|
|
+ "
|
|
|
|
+ ></p>
|
|
|
|
+ <br />
|
|
|
|
+ </template>
|
|
|
|
+ </div>
|
|
|
|
+ </transition>
|
|
|
|
+ <transition name="fade">
|
|
|
|
+ <div class="body" @click="changeNextStep" v-if="nextStep === 1">
|
|
|
|
+ <div class="loading">
|
|
|
|
+ <div class="loading1">
|
|
|
|
+ <div class="loading2"></div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </transition>
|
|
|
|
+ <img
|
|
|
|
+ :src="text2img"
|
|
|
|
+ :style="step >= 4 ? 'opacity: 1' : ''"
|
|
|
|
+ class="tImg"
|
|
|
|
+ />
|
|
|
|
+ <transition name="fade">
|
|
|
|
+ <div class="btns" v-if="step === 5">
|
|
|
|
+ <div
|
|
|
|
+ class="btn"
|
|
|
|
+ @click="() => showDown(1)"
|
|
|
|
+ style="margin-left: 0"
|
|
|
|
+ :stype="'border-color:' + text.color + ';color:' + text.color"
|
|
|
|
+ >
|
|
|
|
+ 下载壁纸
|
|
|
|
+ </div>
|
|
|
|
+ <div
|
|
|
|
+ class="btn"
|
|
|
|
+ @click="() => showDown(2)"
|
|
|
|
+ :stype="'border-color:' + text.color + ';color:' + text.color"
|
|
|
|
+ >
|
|
|
|
+ 生成海报
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </transition>
|
|
</div>
|
|
</div>
|
|
|
|
+ <transition name="fade">
|
|
|
|
+ <div class="model" v-if="showImg !== undefined">
|
|
|
|
+ <div class="gs">
|
|
|
|
+ <img :src="bgimg" style="width: 100%; height: 100%" alt="" />
|
|
|
|
+ </div>
|
|
|
|
+ <van-icon
|
|
|
|
+ color="#fff"
|
|
|
|
+ size="26"
|
|
|
|
+ name="close"
|
|
|
|
+ class="close"
|
|
|
|
+ @click="close"
|
|
|
|
+ />
|
|
|
|
+ <div class="modelImg">
|
|
|
|
+ <p>请长按保存图片</p>
|
|
|
|
+ <img :src="showImg" style="width: 100%; height: 100%" />
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </transition>
|
|
</div>
|
|
</div>
|
|
- </transition>
|
|
|
|
- </div>
|
|
|
|
|
|
+ </van-swipe-item>
|
|
|
|
+ <van-swipe-item style="overflow: auto">
|
|
|
|
+ <seven v-if="showSheet" @showVideo="showVideo" />
|
|
|
|
+ </van-swipe-item>
|
|
|
|
+ </van-swipe>
|
|
<transition name="fade">
|
|
<transition name="fade">
|
|
- <div class="model" v-if="showImg !== undefined">
|
|
|
|
- <div class="gs">
|
|
|
|
- <img :src="bgimg" style="width: 100%; height: 100%" alt="" />
|
|
|
|
- </div>
|
|
|
|
|
|
+ <div v-if="showOverlay" class="model">
|
|
<van-icon
|
|
<van-icon
|
|
color="#fff"
|
|
color="#fff"
|
|
size="26"
|
|
size="26"
|
|
name="close"
|
|
name="close"
|
|
class="close"
|
|
class="close"
|
|
- @click="close"
|
|
|
|
|
|
+ @click="closeSeven"
|
|
/>
|
|
/>
|
|
- <div class="modelImg">
|
|
|
|
- <p>请长按保存图片</p>
|
|
|
|
- <img :src="showImg" style="width: 100%; height: 100%" />
|
|
|
|
- </div>
|
|
|
|
|
|
+ <video class="sevenvideo" src=""></video>
|
|
</div>
|
|
</div>
|
|
</transition>
|
|
</transition>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<script setup>
|
|
<script setup>
|
|
-import { ref, reactive, defineEmits } from "vue";
|
|
|
|
|
|
+import { ref, reactive, nextTick } from "vue";
|
|
import data from "../data/data.json";
|
|
import data from "../data/data.json";
|
|
|
|
+
|
|
|
|
+import seven from "./seven.vue";
|
|
|
|
+
|
|
// import { onMounted, reactive } from "vue";
|
|
// import { onMounted, reactive } from "vue";
|
|
// import { isIpad, isIpod, isIphone } from "../../utils/isTerminal";
|
|
// import { isIpad, isIpod, isIphone } from "../../utils/isTerminal";
|
|
/**
|
|
/**
|
|
@@ -103,8 +133,8 @@ import data from "../data/data.json";
|
|
* window.$originData.orginParames.parameters 固定参数值
|
|
* window.$originData.orginParames.parameters 固定参数值
|
|
* window.$originData.urlParames url参数
|
|
* window.$originData.urlParames url参数
|
|
*/
|
|
*/
|
|
-const emits = defineEmits(["changePage"]);
|
|
|
|
const showImg = ref(undefined);
|
|
const showImg = ref(undefined);
|
|
|
|
+const swipe = ref(null);
|
|
let width = window.$originData.orginParames.availWidth * 0.7;
|
|
let width = window.$originData.orginParames.availWidth * 0.7;
|
|
const type = Math.floor(Math.random() * 12 + 1);
|
|
const type = Math.floor(Math.random() * 12 + 1);
|
|
let ori = data[type - 1] || { texts: [] };
|
|
let ori = data[type - 1] || { texts: [] };
|
|
@@ -128,7 +158,7 @@ const url = {
|
|
const bgimg = ref(url.bg);
|
|
const bgimg = ref(url.bg);
|
|
const kuangimg = ref(url.kuang);
|
|
const kuangimg = ref(url.kuang);
|
|
const text2img = ref(url.text2);
|
|
const text2img = ref(url.text2);
|
|
-const step = ref(0);
|
|
|
|
|
|
+const step = ref(4); // 动画步骤
|
|
const stepBody = ref(0);
|
|
const stepBody = ref(0);
|
|
let t = setTimeout(() => {
|
|
let t = setTimeout(() => {
|
|
clearTimeout(t);
|
|
clearTimeout(t);
|
|
@@ -143,10 +173,11 @@ let t = setTimeout(() => {
|
|
}, 2000);
|
|
}, 2000);
|
|
}, 200);
|
|
}, 200);
|
|
|
|
|
|
|
|
+const showSheet = ref(false);
|
|
function nextPage() {
|
|
function nextPage() {
|
|
- console.log(step.value, step.value !== 5)
|
|
|
|
- if (step.value !== 5) return
|
|
|
|
- emits("changePage", "seven");
|
|
|
|
|
|
+ if (step.value !== 5) return;
|
|
|
|
+ showSheet.value = true;
|
|
|
|
+ swipe.value.next();
|
|
}
|
|
}
|
|
|
|
|
|
function changeNextStep() {
|
|
function changeNextStep() {
|
|
@@ -201,11 +232,24 @@ function showDown(type) {
|
|
function close() {
|
|
function close() {
|
|
showImg.value = undefined;
|
|
showImg.value = undefined;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+const showOverlay = ref(false);
|
|
|
|
+function showVideo(url) {
|
|
|
|
+ showOverlay.value = true;
|
|
|
|
+ nextTick(() => {
|
|
|
|
+ let ele = document.querySelector(".sevenvideo");
|
|
|
|
+ ele.src = url;
|
|
|
|
+ ele.play();
|
|
|
|
+ });
|
|
|
|
+}
|
|
|
|
+function closeSeven(){
|
|
|
|
+ showOverlay.value = false;
|
|
|
|
+}
|
|
</script>
|
|
</script>
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
.sex {
|
|
.sex {
|
|
width: 100%;
|
|
width: 100%;
|
|
- height: 100%;
|
|
|
|
|
|
+ height: 100vh;
|
|
background-size: 100% 100%;
|
|
background-size: 100% 100%;
|
|
position: relative;
|
|
position: relative;
|
|
.body {
|
|
.body {
|
|
@@ -290,7 +334,7 @@ function close() {
|
|
top: inherit;
|
|
top: inherit;
|
|
width: 2em;
|
|
width: 2em;
|
|
z-index: 1;
|
|
z-index: 1;
|
|
- position: fixed;
|
|
|
|
|
|
+ position: absolute;
|
|
animation-name: an;
|
|
animation-name: an;
|
|
animation-duration: 1s;
|
|
animation-duration: 1s;
|
|
animation-timing-function: linear;
|
|
animation-timing-function: linear;
|
|
@@ -335,5 +379,12 @@ function close() {
|
|
top: 1em;
|
|
top: 1em;
|
|
right: 1em;
|
|
right: 1em;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ .sevenvideo {
|
|
|
|
+ top: 50%;
|
|
|
|
+ transform: translateY(-50%);
|
|
|
|
+ width: 100%;
|
|
|
|
+ position: absolute;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|