|
@@ -11,6 +11,13 @@
|
|
<iframe :src="iframe_url" frameborder="0" sandbox></iframe>
|
|
<iframe :src="iframe_url" frameborder="0" sandbox></iframe>
|
|
</div>
|
|
</div>
|
|
<div class="content" v-else>
|
|
<div class="content" v-else>
|
|
|
|
+ <div class="mask" @click="confirmStatus" v-if="state.showMask">
|
|
|
|
+ <img class="luck" :src=" require('@/assets/svg/icon-post-lock.svg') " />
|
|
|
|
+ <div class="btn">
|
|
|
|
+ <img class="img" v-if="nftAuthINfo && nftAuthINfo.icon" :src=" nftAuthINfo.icon " />
|
|
|
|
+ <div class="font">Available for holders of Ruomeng NFT</div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
<iframe :src="state.iframe_url" v-show="state.status == 'iframe'" ref="dom_iframe" frameborder="0"
|
|
<iframe :src="state.iframe_url" v-show="state.status == 'iframe'" ref="dom_iframe" frameborder="0"
|
|
scrolling="yes" allow="camera *;microphone *"></iframe>
|
|
scrolling="yes" allow="camera *;microphone *"></iframe>
|
|
<!-- sandbox="allow-same-origin allow-scripts allow-popups allow-top-navigation allow-forms allow-modals allow-popups-to-escape-sandbox" -->
|
|
<!-- sandbox="allow-same-origin allow-scripts allow-popups allow-top-navigation allow-forms allow-modals allow-popups-to-escape-sandbox" -->
|
|
@@ -64,9 +71,12 @@
|
|
<script setup>
|
|
<script setup>
|
|
import { getChromeStorage, setChromeStorage, defineProps, sendChromeTabMessage } from "@/uilts/chromeExtension";
|
|
import { getChromeStorage, setChromeStorage, defineProps, sendChromeTabMessage } from "@/uilts/chromeExtension";
|
|
import { getPostDetail } from '@/http/redPacket.js'
|
|
import { getPostDetail } from '@/http/redPacket.js'
|
|
|
|
+import { getPostEditorNftCertInfo } from '@/http/toolBoxApi'
|
|
import { guid, getQueryString } from "@/uilts/help";
|
|
import { guid, getQueryString } from "@/uilts/help";
|
|
import { onMounted, reactive, ref } from "vue";
|
|
import { onMounted, reactive, ref } from "vue";
|
|
|
|
+import { ElMessage } from 'element-plus'
|
|
import { reSetBindTwtterId } from '@/http/help.js'
|
|
import { reSetBindTwtterId } from '@/http/help.js'
|
|
|
|
+import "element-plus/es/components/message/style/css";
|
|
let dom_iframe = ref(null)
|
|
let dom_iframe = ref(null)
|
|
let state = reactive({
|
|
let state = reactive({
|
|
status: '', //
|
|
status: '', //
|
|
@@ -79,10 +89,12 @@ let state = reactive({
|
|
tweetId: '',
|
|
tweetId: '',
|
|
detail: {},
|
|
detail: {},
|
|
handle_type: '',
|
|
handle_type: '',
|
|
|
|
+ showMask: false,
|
|
cover_url: require('@/assets/img/back-loading.png')
|
|
cover_url: require('@/assets/img/back-loading.png')
|
|
})
|
|
})
|
|
|
|
|
|
let dom = {}
|
|
let dom = {}
|
|
|
|
+let nftAuthINfo = ref(null)
|
|
|
|
|
|
let props = defineProps({
|
|
let props = defineProps({
|
|
pre_view: {
|
|
pre_view: {
|
|
@@ -173,12 +185,43 @@ const getDetail = () => {
|
|
state.cover_url = state.detail.viewBgImagePath
|
|
state.cover_url = state.detail.viewBgImagePath
|
|
}
|
|
}
|
|
state.iframe_url = state.detail.convertUrl
|
|
state.iframe_url = state.detail.convertUrl
|
|
|
|
+ // 蒙层
|
|
|
|
+ if (state.detail && state.detail.certNftProjectId) {
|
|
|
|
+ state.showMask = true;
|
|
|
|
+ // 确权
|
|
|
|
+ getNftInfoStatus()
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
state.status = '网页错误'
|
|
state.status = '网页错误'
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+const getNftInfoStatus = () => {
|
|
|
|
+ getPostEditorNftCertInfo({
|
|
|
|
+ params: {
|
|
|
|
+ postId: state.postId,
|
|
|
|
+ }
|
|
|
|
+ }).then(res => {
|
|
|
|
+ let { code, data } = res;
|
|
|
|
+ if ( code === 0 ) {
|
|
|
|
+ nftAuthINfo.value = data;
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+const confirmStatus = () => {
|
|
|
|
+ if (nftAuthINfo.value && nftAuthINfo.value?.certStatus === 1) {
|
|
|
|
+ ElMessage({
|
|
|
|
+ message: `NFT validated!`,
|
|
|
|
+ type: 'success'
|
|
|
|
+ })
|
|
|
|
+ state.showMask = false;
|
|
|
|
+ } else {
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
const clickCancel = () => {
|
|
const clickCancel = () => {
|
|
state.show_alert = false
|
|
state.show_alert = false
|
|
}
|
|
}
|
|
@@ -209,6 +252,8 @@ const handleFull = () => {
|
|
type: '全屏',
|
|
type: '全屏',
|
|
iframe_url: state.iframe_url,
|
|
iframe_url: state.iframe_url,
|
|
tweetId: state.tweetId,
|
|
tweetId: state.tweetId,
|
|
|
|
+ nftAuthINfo: nftAuthINfo.value,
|
|
|
|
+ showMask: state.showMask,
|
|
}
|
|
}
|
|
})
|
|
})
|
|
// 清除当前iframe src
|
|
// 清除当前iframe src
|
|
@@ -264,6 +309,7 @@ const clickFull = () => {
|
|
.alert {
|
|
.alert {
|
|
text-align: center;
|
|
text-align: center;
|
|
position: absolute;
|
|
position: absolute;
|
|
|
|
+ z-index: 3;
|
|
top: 0;
|
|
top: 0;
|
|
left: 0;
|
|
left: 0;
|
|
width: 100%;
|
|
width: 100%;
|
|
@@ -388,6 +434,7 @@ const clickFull = () => {
|
|
}
|
|
}
|
|
|
|
|
|
.content {
|
|
.content {
|
|
|
|
+ position: relative;
|
|
width: 100%;
|
|
width: 100%;
|
|
height: calc(100% - 40px);
|
|
height: calc(100% - 40px);
|
|
background: #686868;
|
|
background: #686868;
|
|
@@ -395,6 +442,48 @@ const clickFull = () => {
|
|
align-items: center;
|
|
align-items: center;
|
|
justify-content: center;
|
|
justify-content: center;
|
|
|
|
|
|
|
|
+ .mask {
|
|
|
|
+ position: absolute;
|
|
|
|
+ z-index: 2;
|
|
|
|
+ display: flex;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ flex-direction: column;
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 100%;
|
|
|
|
+ background-color: rgba($color: #000000, $alpha: .8);
|
|
|
|
+ .luck {
|
|
|
|
+ width: 100px;
|
|
|
|
+ height: 100px;
|
|
|
|
+ }
|
|
|
|
+ .btn {
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ width: 345px;
|
|
|
|
+ height: 70px;
|
|
|
|
+ margin-top: 12px;
|
|
|
|
+ border-radius: 100px;
|
|
|
|
+ background: #1D9BF0;
|
|
|
|
+ .img {
|
|
|
|
+ overflow: hidden;
|
|
|
|
+ width: 35px;
|
|
|
|
+ height: 35px;
|
|
|
|
+ margin-right: 16px;
|
|
|
|
+ border-radius: 4px;
|
|
|
|
+ }
|
|
|
|
+ .font {
|
|
|
|
+ width: 188px;
|
|
|
|
+ color: #fff;
|
|
|
|
+ font-weight: 700;
|
|
|
|
+ font-size: 16px;
|
|
|
|
+ line-height: 19px;
|
|
|
|
+ letter-spacing: 0.3px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
iframe {
|
|
iframe {
|
|
background: #fff;
|
|
background: #fff;
|
|
width: 100%;
|
|
width: 100%;
|