浏览代码

Merge branch 'dev_1.1.7' of https://git.yishihui.com/DeNet/de-net into dev_1.1.7

zhangwei 2 年之前
父节点
当前提交
14a05191d4
共有 3 个文件被更改,包括 27 次插入33 次删除
  1. 8 0
      src/http/toolBoxApi.js
  2. 14 27
      src/view/iframe/tool-box/card.vue
  3. 5 6
      src/view/iframe/tool-box/full.vue

+ 8 - 0
src/http/toolBoxApi.js

@@ -39,3 +39,11 @@ export function getPostEditorNftCertInfo(params) {
         data: params
     })
 }
+
+export function unlockNftCert(params) {
+    return service({
+        url: `/post/editor/unlockNftCert`,
+        method: 'post',
+        data: params
+    })
+}

+ 14 - 27
src/view/iframe/tool-box/card.vue

@@ -74,7 +74,7 @@
 <script setup>
 import { getChromeStorage, setChromeStorage, defineProps, sendChromeTabMessage } from "@/uilts/chromeExtension";
 import { getPostDetail } from '@/http/redPacket.js'
-import { getPostEditorNftCertInfo } from '@/http/toolBoxApi'
+import { getPostEditorNftCertInfo, unlockNftCert } from '@/http/toolBoxApi'
 import { guid, getQueryString } from "@/uilts/help";
 import { onMounted, reactive, ref, onBeforeUnmount } from "vue";
 import { ElMessage } from 'element-plus'
@@ -182,13 +182,6 @@ const getDetail = () => {
     iframe.onerror = () => {
         state.status = '网页错误'
     }
-    // iframe.onload = () => {
-    //     alert(123)
-    //     if (state.status == '加载' || state.status == 'iframe') {
-    //         state.show_btn = true
-    //         state.status = 'iframe'
-    //     }
-    // }
 
     getPostDetail({
         params: {
@@ -221,8 +214,15 @@ const getDetail = () => {
             state.status = 'iframe'
             // 蒙层
             if (state.detail && state.detail.certNftProjectId) {
-                state.showMask = true;
-                // 确权
+                if (state.detail?.certNftUnlockStatus == 0) {
+                    state.showMask = true;
+                    // report
+                    reportFail()
+                } else {
+                    // report
+                    reportSucc()
+                }
+                // 确权信息
                 getChromeStorage('userInfo', (_userInfo) => {
                     if (_userInfo) {
                         getNftInfoStatus()
@@ -254,17 +254,6 @@ const getNftInfoStatus = () => {
         let { code, data } = res;
         if ( code === 0 ) {
             nftAuthINfo.value = data;
-            // checkMask
-            getChromeStorage('post_id_list', (list) => {
-                if (list && list.indexOf(state.postId) !== -1 && nftAuthINfo.value?.certStatus === 1) {
-                    state.showMask = false;
-                    // report
-                    reportSucc()
-                } else {
-                    // report
-                    reportFail()
-                }
-            })
         }
     })
 }
@@ -349,12 +338,10 @@ const succBack = () => {
         type: 'success'
     })
     state.showMask = false;
-    // 记录解锁
-    getChromeStorage('post_id_list', (list) => {
-        let originList = list ? list : [];
-        if (originList.indexOf(state.postId) === -1) {
-            originList.push(state.postId)
-            setChromeStorage({ post_id_list: JSON.stringify(originList) })
+    // 解锁
+    unlockNftCert({
+        params: {
+            postId: state.postId,
         }
     })
 }

+ 5 - 6
src/view/iframe/tool-box/full.vue

@@ -29,7 +29,8 @@
 <script setup>
 import { reactive, ref } from "vue";
 import { ElMessage } from 'element-plus'
-import { getChromeStorage, setChromeStorage, sendChromeTabMessage } from "@/uilts/chromeExtension";
+import { unlockNftCert } from '@/http/toolBoxApi'
+import { getChromeStorage, sendChromeTabMessage } from "@/uilts/chromeExtension";
 import "element-plus/es/components/message/style/css";
 
 let state = reactive({
@@ -157,11 +158,9 @@ const succBack = () => {
     })
     showMask.value = false;
     // 记录解锁
-    getChromeStorage('post_id_list', (list) => {
-        let originList = list ? list : [];
-        if (originList.indexOf(postId.value) === -1) {
-            originList.push(postId.value)
-            setChromeStorage({ post_id_list: JSON.stringify(originList) })
+    unlockNftCert({
+        params: {
+            postId: postId.value,
         }
     })
 }