소스 검색

[edit] resend notice

A\An 2 년 전
부모
커밋
f0c14ce46f

+ 5 - 1
src/entry/content.js

@@ -13,7 +13,8 @@ import {
     initExecuteScript,
     changeQueueNum,
     replyHandle,
-    noticeBindTweet
+    noticeBindTweet,
+    hideNoticeBindTweet
 } from "@/logic/content/twitter.js";
 
 import {
@@ -48,6 +49,9 @@ window.onmessage = (res) => {
             case "IFRAME_RED_PACKET_SHOW_BIND_TWEET_NOTICE":
                 noticeBindTweet(res.data.data || {});
                 break;
+            case "IFRAME_CLOSE_BIND_TWEET":
+                hideNoticeBindTweet();
+                break;
             // case "IFRAME_DO_TASK":
             //     findTweetByIdDoTask(res.data.task_data, res.data.task_type)
             //     break

+ 10 - 0
src/iframe/bind-tweet.js

@@ -0,0 +1,10 @@
+import { createApp } from 'vue'
+import App from '@/view/iframe/bind-tweet/bind-tweet.vue'
+import ElementPlus from 'element-plus'
+import 'element-plus/dist/index.css'
+
+
+const app = createApp(App);
+
+app.use(ElementPlus);
+app.mount('#app');

+ 8 - 1
src/logic/content/twitter.js

@@ -311,13 +311,20 @@ export function noticeBindTweet(params) {
     let iframe = document.createElement('iframe');
     iframe.id = 'de-notice-bind-tweet';
     iframe.src = chrome.runtime.getURL('/iframe/bind-tweet.html') + `?params=${JSON.stringify(params)}`;
-    iframe.style.cssText = `border: medium none; width:400px;min-height:280px;position: fixed; right: 16px; top: 16px;`
+    iframe.style.cssText = `border: medium none; width:400px;min-height:313px;position: fixed; right: 16px; top: 16px;`
     let iframeContent = document.getElementById('de-notice-bind-tweet');
     if(!iframeContent) {
         document.querySelector('body').appendChild(iframe)
     }
 }
 
+export function hideNoticeBindTweet() {
+    let iframeContent = document.getElementById('de-notice-bind-tweet');
+    if(iframeContent) {
+        document.querySelector('body').removeChild(iframeContent)
+    }
+}
+
 /**
  * 点击deNet按钮处理
  * @private

+ 12 - 12
src/view/iframe/bind-tweet/bind-tweet.vue

@@ -1,8 +1,8 @@
 <template>
     <div class="bind-tips-wrapper">
-        <img src="" class="icon-close" @click="close">
+        <img  :src="require('@/assets/svg/icon-close.svg')" class="icon-close" @click="close">
         <div class="top">
-            <img src="" class="icon-give-box">
+            <img :src="require('@/assets/svg/icon-giveaways-notice.svg')" class="icon-give-box">
             <div class="text">
                 oops, you failed to send giveaway
             </div>
@@ -20,6 +20,7 @@ import { onMounted, ref } from "vue";
 import { ElMessage } from 'element-plus'
 import { getChromeStorage } from '@/uilts/chromeExtension.js'
 import { getQueryString } from '@/uilts/help.js'
+import { terminatedLuckdrop } from "@/http/redPacket";
 
 let submitData = ref({});
 
@@ -43,20 +44,14 @@ const seSend = async () => {
 }
 
 const terminate = () => {
+    console.log(' submitData.value ',  submitData.value.taskLuckdropId )
     terminatedLuckdrop({
         params: {
-            luckdropId: submitData.id
+            luckdropId: submitData.value.taskLuckdropId
         }
     }).then(res => {
-        if(res.code == 0) {
-            close();
-        }
+        close();
     });
-    // window.parent.postMessage({ actionType: "IFRAME_RED_PACKET_REPLY_CLICK",  data: {
-    //   postId: state.postId,
-    //   type: params.type,
-    //   taskLuckdropId: state.detail.taskLuckdropId
-    // }}, "*");
 }
 
 /**
@@ -77,7 +72,7 @@ const callEventPageMethod = (actionType, data, callback) => {
 
 onMounted(() => {
     let params = getQueryString('params');
-    submitData.value = params;
+    submitData.value = JSON.parse(params);
 }) 
 
 </script>
@@ -91,6 +86,8 @@ onMounted(() => {
     border-radius: 20px;
     padding: 15px;
     position: relative;
+    box-shadow: 0px 4px 30px 0px #00000033;
+
 
     .icon-close {
         position: absolute;
@@ -98,6 +95,7 @@ onMounted(() => {
         top: 14px;
         width: 24px;
         height: 24px;
+        cursor: pointer;
     }
 
     .top {
@@ -130,6 +128,7 @@ onMounted(() => {
             display: flex;
             align-items: center;
             justify-content: center;
+            cursor: pointer;
         }
         
         .re-send {
@@ -140,6 +139,7 @@ onMounted(() => {
 
         .terminate {
             color: #1D9BF0;
+            border: 1px solid #ECECEC;
         }
     }
 }

+ 2 - 2
src/view/iframe/publish/give-dialog.vue

@@ -1210,14 +1210,14 @@ const formSwitchChange = (val, params, index) => {
 const hideTask = (params, index) => {
     formList[index]['checked'] = false;
     formList[index]['show'] = false;
-    closeDiscordTask(false, {type: 7, index})
+    closeDiscordTask(false, {type: 7}, index)
 }
 
 const clickDropdown = (params, index) => {
     formList[index]['show'] = true;
 }
 
-const closeDiscordTask = (val, params) => {
+const closeDiscordTask = (val, params, index) => {
     if(params.type == 7) {
         if(!val) {
             //错误类型 discord 清空discord错误校验

+ 1 - 1
src/view/iframe/red-packet/red-packet.vue

@@ -928,7 +928,7 @@ function init(initParams) {
           // 显示提示
           window.parent.postMessage({ actionType: "IFRAME_RED_PACKET_SHOW_BIND_TWEET_NOTICE",  data: {
             postId: state.postId,
-            taskLuckdropId: state.detail.taskLuckdropId
+            taskLuckdropId: JSON.parse(res.data.postBizData).taskLuckdropId
           }}, "*");
         }
         reSetBindTwtterId(res.data)