|
@@ -23,7 +23,7 @@
|
|
|
import { onBeforeMount, ref } from 'vue'
|
|
|
import { getTwitterSaleNftProjectInfo } from '@/http/nft'
|
|
|
import { pageUrl } from "@/http/configAPI.js"
|
|
|
-
|
|
|
+import { getChromeStorage } from '@/uilts/chromeExtension.js'
|
|
|
const saleData = ref({});
|
|
|
|
|
|
const getSaleInfo = () => {
|
|
@@ -66,13 +66,24 @@ const share = () => {
|
|
|
}
|
|
|
|
|
|
const buy = () => {
|
|
|
- chrome.tabs.getCurrent((tab) => {
|
|
|
- chrome.tabs.sendMessage(tab.id, {
|
|
|
- actionType: "IFRAME_TWITTER_SHOW_BUY_NFT",
|
|
|
- data: {
|
|
|
- nft_project_Id: saleData.value.nftProjectId
|
|
|
- }
|
|
|
- }, (res) => { });
|
|
|
+ getChromeStorage('userInfo', (_userInfo) => {
|
|
|
+ if (!_userInfo) {
|
|
|
+ chrome.runtime.sendMessage(
|
|
|
+ { actionType: "POPUP_LOGIN", data: "" },
|
|
|
+ (response) => {
|
|
|
+ console.log("res", response);
|
|
|
+ }
|
|
|
+ )
|
|
|
+ } else {
|
|
|
+ chrome.tabs.getCurrent((tab) => {
|
|
|
+ chrome.tabs.sendMessage(tab.id, {
|
|
|
+ actionType: "IFRAME_TWITTER_SHOW_BUY_NFT",
|
|
|
+ data: {
|
|
|
+ nft_project_Id: saleData.value.nftProjectId
|
|
|
+ }
|
|
|
+ }, (res) => { });
|
|
|
+ })
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
|