|
@@ -0,0 +1,97 @@
|
|
|
+<script setup>
|
|
|
+import {ref} from 'vue'
|
|
|
+const props=defineProps({
|
|
|
+ style:Object,
|
|
|
+ shareData:Object
|
|
|
+})
|
|
|
+
|
|
|
+let show=ref(false)
|
|
|
+let showPoster=ref(false)
|
|
|
+let posterImg=ref('')
|
|
|
+
|
|
|
+const handleCreatePoster=()=>{
|
|
|
+ show.value=true
|
|
|
+ setTimeout(() => {
|
|
|
+ show.value=false
|
|
|
+ posterImg.value='http://hongze.oss-cn-shanghai.aliyuncs.com/static/images/htm2img/e15chyrTqpKDsYPvPRaA77yzIfO6.png'
|
|
|
+ showPoster.value=true
|
|
|
+ }, 1500);
|
|
|
+}
|
|
|
+
|
|
|
+</script>
|
|
|
+
|
|
|
+
|
|
|
+<template>
|
|
|
+ <div class="share-poster-wrap">
|
|
|
+ <img @click="handleCreatePoster" :style="props.style" class="share-icon" src="@/assets/hzyb/share-poster-icon.png"/>
|
|
|
+
|
|
|
+ <view class="poster-mask" v-if="show||showPoster" @click="showPoster=false"></view>
|
|
|
+ <view class="loading-box" v-if="show">
|
|
|
+ <img class="load-img" src="@/assets/hzyb/loading.png"/>
|
|
|
+ <view>海报生成中...</view>
|
|
|
+ </view>
|
|
|
+ <img v-if="showPoster" class="poster-img" :src="posterImg" show-menu-by-longpress />
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.share-poster-wrap{
|
|
|
+ .share-icon{
|
|
|
+ position: fixed;
|
|
|
+ bottom: 100px;
|
|
|
+ right: 34px;
|
|
|
+ z-index: 50;
|
|
|
+ width: 76px;
|
|
|
+ height: 76px;
|
|
|
+ }
|
|
|
+ .poster-mask{
|
|
|
+ position: fixed;
|
|
|
+ left: 0;
|
|
|
+ top: 0;
|
|
|
+ right: 0;
|
|
|
+ bottom: 0;
|
|
|
+ background: rgba(0, 0, 0, 0.4);
|
|
|
+ z-index: 998;
|
|
|
+ }
|
|
|
+ .loading-box{
|
|
|
+ background-color: #fff;
|
|
|
+ position: fixed;
|
|
|
+ left: 50%;
|
|
|
+ top: 50%;
|
|
|
+ z-index: 999;
|
|
|
+ transform: translate(-50%,-50%);
|
|
|
+ width: 417px;
|
|
|
+ height: 261px;
|
|
|
+ text-align: center;
|
|
|
+ padding-top: 80px;
|
|
|
+ font-size: 32px;
|
|
|
+ font-weight: bold;
|
|
|
+ .load-img{
|
|
|
+ display: block;
|
|
|
+ margin-left: auto;
|
|
|
+ margin-right: auto;
|
|
|
+ width: 91px;
|
|
|
+ height: 91px;
|
|
|
+ animation: circle 1s linear infinite;
|
|
|
+ }
|
|
|
+ @keyframes circle {
|
|
|
+ 0%{
|
|
|
+ transform: rotateZ(0);
|
|
|
+ }
|
|
|
+ 100%{
|
|
|
+ transform: rotateZ(360deg);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .poster-img{
|
|
|
+ width: 90vw;
|
|
|
+ display: block;
|
|
|
+ position: fixed;
|
|
|
+ left: 50%;
|
|
|
+ top: 50%;
|
|
|
+ z-index: 999;
|
|
|
+ transform: translate(-50%,-50%);
|
|
|
+ border-radius: 16px;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|