|
@@ -1,70 +1,60 @@
|
|
|
<template>
|
|
|
<div class="tab-group-page" ref="pageWrapperDom" @scroll="pageScroll">
|
|
|
<div class="list-wrapper" ref="listWrapperDom">
|
|
|
-
|
|
|
+
|
|
|
<template v-if="listData.length">
|
|
|
- <div class="list-item"
|
|
|
- v-for="(item, index) in listData"
|
|
|
- :key="index"
|
|
|
- @click="clickItem(item, index)">
|
|
|
+ <div class="list-item" v-for="(item, index) in listData" :key="index" @click="clickItem(item, index)">
|
|
|
<div class="left">
|
|
|
<img :src="item.avatarUrl" class="icon-avatar">
|
|
|
</div>
|
|
|
<div class="right">
|
|
|
<div class="top">
|
|
|
<div class="icon-nft-wrapper">
|
|
|
- <el-popover
|
|
|
- :width="340"
|
|
|
- placement="right-start"
|
|
|
- trigger="hover"
|
|
|
- popper-style="background: #FFFFFF;
|
|
|
+ <el-popover :width="340" placement="right-start" trigger="hover" popper-style="background: #FFFFFF;
|
|
|
box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.2);
|
|
|
border-radius: 20px;
|
|
|
padding: 20px;
|
|
|
box-sizing: border-box;
|
|
|
margin-top: -1px">
|
|
|
<template #reference>
|
|
|
- <img v-if="item.nftItem" :src="item.nftItem.imagePath" class="icon-nft" @click.stop="">
|
|
|
+ <img v-if="item.nftItem" :src="item.nftItem.imagePath" class="icon-nft"
|
|
|
+ @click.stop="">
|
|
|
</template>
|
|
|
<template #default>
|
|
|
<div class="preview-nft" v-if="item.nftItem">
|
|
|
<img :src="item.nftItem.imagePath" class="icon-nft-big">
|
|
|
<div class="content">
|
|
|
<div class="nft-name">
|
|
|
- {{item.nftItem.nftItemName}}
|
|
|
+ {{ item.nftItem.nftItemName }}
|
|
|
</div>
|
|
|
<div class="nft-desc">
|
|
|
- <div v-if="item.nftItem.metadata" v-html="item.nftItem.metadata.description"></div>
|
|
|
+ <div v-if="item.nftItem.metadata"
|
|
|
+ v-html="item.nftItem.metadata.description"></div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-popover>
|
|
|
</div>
|
|
|
- <div class="nick-name"
|
|
|
- :style="{
|
|
|
- color: eleThemeStyle.color
|
|
|
- }">
|
|
|
- {{item.nickName}}
|
|
|
+ <div class="nick-name" :style="{
|
|
|
+ color: eleThemeStyle.color
|
|
|
+ }">
|
|
|
+ {{ item.nickName }}
|
|
|
</div>
|
|
|
- <div class="screen-name"
|
|
|
- :style="{
|
|
|
- color: eleThemeStyle.screenName
|
|
|
- }">
|
|
|
- @{{item.screenName}}
|
|
|
+ <div class="screen-name" :style="{
|
|
|
+ color: eleThemeStyle.screenName
|
|
|
+ }">
|
|
|
+ @{{ item.screenName }}
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="post-content"
|
|
|
- :style="{
|
|
|
- color: eleThemeStyle.color
|
|
|
- }"
|
|
|
- v-html="item.textContent"></div>
|
|
|
+ <div class="post-content" :style="{
|
|
|
+ color: eleThemeStyle.color
|
|
|
+ }" v-html="item.textContent"></div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
- <template v-if="loading && !listData.length" >
|
|
|
- <img :src="require('@/assets/svg/icon-tweet-loading.svg')"
|
|
|
- class="icon-loading" >
|
|
|
+ <template v-if="loading && !listData.length">
|
|
|
+ <img :src="require('@/assets/svg/icon-tweet-loading.svg')" class="icon-loading">
|
|
|
</template>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -101,7 +91,7 @@ let listReqParams = {
|
|
|
};
|
|
|
|
|
|
const clickItem = (data, index) => {
|
|
|
- if(data.srcContentId) {
|
|
|
+ if (data.srcContentId) {
|
|
|
let url = `https://twitter.com/${data.screenName}/status/${data.srcContentId}`;
|
|
|
sendMessageToContent({
|
|
|
actionType: 'IFRAME_PAGE_JUMP',
|
|
@@ -114,7 +104,7 @@ const clickItem = (data, index) => {
|
|
|
|
|
|
function onRuntimeMsg() {
|
|
|
chrome.runtime.onMessage.addListener((req, sender, sendResponse) => {
|
|
|
- sendResponse('ok')
|
|
|
+ sendResponse(res.actionType || 'ok')
|
|
|
switch (req.actionType) {
|
|
|
case 'CONTENT_REFRESH_TAB_GROUP_LIST':
|
|
|
listReqParams.params.preTimestamp = ''
|
|
@@ -134,10 +124,10 @@ function onRuntimeMsg() {
|
|
|
}
|
|
|
|
|
|
const nextPage = (params) => {
|
|
|
- let {wrapperHeight, wrapperScrollTop, contentHeight} = params;
|
|
|
+ let { wrapperHeight, wrapperScrollTop, contentHeight } = params;
|
|
|
if (wrapperHeight + wrapperScrollTop >= (contentHeight - 50)) {
|
|
|
console.log('next---');
|
|
|
- if(pageWrapperDom.value && pageWrapperDom.value.style.overflowY != 'auto') {
|
|
|
+ if (pageWrapperDom.value && pageWrapperDom.value.style.overflowY != 'auto') {
|
|
|
pageWrapperDom.value.style.overflowY = 'auto'
|
|
|
}
|
|
|
}
|
|
@@ -153,12 +143,12 @@ const pageScroll = (e) => {
|
|
|
}
|
|
|
|
|
|
const styleHandler = (data) => {
|
|
|
- if(data.top > 53) {
|
|
|
- if(pageWrapperDom.value && pageWrapperDom.value.style.overflowY != 'hidden') {
|
|
|
+ if (data.top > 53) {
|
|
|
+ if (pageWrapperDom.value && pageWrapperDom.value.style.overflowY != 'hidden') {
|
|
|
pageWrapperDom.value.style.overflowY = 'hidden'
|
|
|
}
|
|
|
} else {
|
|
|
- if(pageWrapperDom.value && pageWrapperDom.value.style.overflowY != 'auto') {
|
|
|
+ if (pageWrapperDom.value && pageWrapperDom.value.style.overflowY != 'auto') {
|
|
|
pageWrapperDom.value.style.overflowY = 'auto'
|
|
|
}
|
|
|
innerPageNext(data);
|
|
@@ -175,21 +165,21 @@ const innerPageNext = (data) => {
|
|
|
) {
|
|
|
listReqParams.loadMore = true;
|
|
|
let dataLength = listData.value.length;
|
|
|
- if(dataLength) {
|
|
|
+ if (dataLength) {
|
|
|
listReqParams.params.preTimestamp = listData.value[dataLength - 1]['createTimestamp'];
|
|
|
}
|
|
|
- if(listReqParams.params.preTimestamp) {
|
|
|
+ if (listReqParams.params.preTimestamp) {
|
|
|
getListData();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
const sendMessageToContent = (params) => {
|
|
|
- let {actionType, data} = params || {};
|
|
|
+ let { actionType, data } = params || {};
|
|
|
chrome.tabs.getCurrent((tab) => {
|
|
|
chrome.tabs.sendMessage(tab.id, {
|
|
|
- actionType,
|
|
|
- data,
|
|
|
+ actionType,
|
|
|
+ data,
|
|
|
}, (res) => { console.log(res) });
|
|
|
})
|
|
|
}
|
|
@@ -208,9 +198,9 @@ const getListData = () => {
|
|
|
if (resData.length) {
|
|
|
for (let i = 0; i < resData.length; i++) {
|
|
|
let nftItem = resData[i]["nftItem"];
|
|
|
- if(nftItem) {
|
|
|
+ if (nftItem) {
|
|
|
let matedata = nftItem['metadata'];
|
|
|
- if(matedata) {
|
|
|
+ if (matedata) {
|
|
|
resData[i]["nftItem"]['metadata'] = JSON.parse(matedata);
|
|
|
}
|
|
|
}
|
|
@@ -230,20 +220,20 @@ const getListData = () => {
|
|
|
}
|
|
|
|
|
|
const initData = () => {
|
|
|
- let {windowLocation} = JSON.parse(getQueryString('params'));
|
|
|
- if(windowLocation.pathname) {
|
|
|
- let arr = windowLocation.pathname.split('/');
|
|
|
- if(arr.length >= 2){
|
|
|
+ let { windowLocation } = JSON.parse(getQueryString('params'));
|
|
|
+ if (windowLocation.pathname) {
|
|
|
+ let arr = windowLocation.pathname.split('/');
|
|
|
+ if (arr.length >= 2) {
|
|
|
twitterAccount = arr[1];
|
|
|
- if(twitterAccount) {
|
|
|
+ if (twitterAccount) {
|
|
|
getTwitterNftGroupInfo({
|
|
|
params: {
|
|
|
twitterAccount
|
|
|
}
|
|
|
}).then(res => {
|
|
|
- if(res.code == 0) {
|
|
|
+ if (res.code == 0) {
|
|
|
groupInfo = res.data || {};
|
|
|
- if(!groupInfo.nftGroupId) return;
|
|
|
+ if (!groupInfo.nftGroupId) return;
|
|
|
loading.value = true;
|
|
|
getListData()
|
|
|
}
|
|
@@ -254,14 +244,14 @@ const initData = () => {
|
|
|
}
|
|
|
|
|
|
const setPageThemeStyle = (params) => {
|
|
|
- let {twitterTheme, theme} = params;
|
|
|
+ let { twitterTheme, theme } = params;
|
|
|
|
|
|
- if(twitterTheme == 'light') {
|
|
|
+ if (twitterTheme == 'light') {
|
|
|
eleThemeStyle.color = '#000';
|
|
|
eleThemeStyle.screenName = '#566370';
|
|
|
eleThemeStyle.borderColor = '#F0F3F4';
|
|
|
document.querySelector('body').style.backgroundColor = '#fff'
|
|
|
- } else if (twitterTheme == 'dark'){
|
|
|
+ } else if (twitterTheme == 'dark') {
|
|
|
eleThemeStyle.color = '#fff';
|
|
|
eleThemeStyle.screenName = '#fff';
|
|
|
eleThemeStyle.borderColor = '#000';
|
|
@@ -283,7 +273,9 @@ onMounted(() => {
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|
|
|
-html, body, #app {
|
|
|
+html,
|
|
|
+body,
|
|
|
+#app {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
margin: 0;
|
|
@@ -336,18 +328,21 @@ html, body, #app {
|
|
|
|
|
|
.content {
|
|
|
margin-top: 19px;
|
|
|
+
|
|
|
.nft-name {
|
|
|
margin-bottom: 6px;
|
|
|
font-weight: 500;
|
|
|
font-size: 14px;
|
|
|
color: #000;
|
|
|
}
|
|
|
+
|
|
|
.nft-desc {
|
|
|
font-weight: 400;
|
|
|
font-size: 14px;
|
|
|
color: #787878;
|
|
|
// margin-bottom: 18px;
|
|
|
}
|
|
|
+
|
|
|
.nft-date {
|
|
|
font-weight: 500;
|
|
|
font-size: 12px;
|
|
@@ -363,9 +358,11 @@ html, body, #app {
|
|
|
&::-webkit-scrollbar {
|
|
|
width: 2px;
|
|
|
}
|
|
|
+
|
|
|
&::-webkit-scrollbar-track {
|
|
|
background: rgb(241, 241, 241);
|
|
|
}
|
|
|
+
|
|
|
&::-webkit-scrollbar-thumb {
|
|
|
background: rgb(136, 136, 136);
|
|
|
border-radius: 8px;
|
|
@@ -396,6 +393,7 @@ html, body, #app {
|
|
|
|
|
|
.right {
|
|
|
flex: 1;
|
|
|
+
|
|
|
.top {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
@@ -405,6 +403,7 @@ html, body, #app {
|
|
|
.icon-nft-wrapper {
|
|
|
height: 24px;
|
|
|
margin-right: 8px;
|
|
|
+
|
|
|
.icon-nft {
|
|
|
width: 24px;
|
|
|
height: 24px;
|
|
@@ -413,12 +412,13 @@ html, body, #app {
|
|
|
}
|
|
|
|
|
|
.icon-nft-wrapper:hover {
|
|
|
- .preview-nft {
|
|
|
+ .preview-nft {
|
|
|
// display: block;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- .nick-name, .screen-name {
|
|
|
+ .nick-name,
|
|
|
+ .screen-name {
|
|
|
font-size: 15px;
|
|
|
}
|
|
|
|
|
@@ -448,7 +448,7 @@ html, body, #app {
|
|
|
|
|
|
.icon-loading {
|
|
|
width: 26px;
|
|
|
- height: 26px;
|
|
|
+ height: 26px;
|
|
|
display: block;
|
|
|
margin: 20px auto;
|
|
|
animation: loading infinite 0.8s linear;
|
|
@@ -459,6 +459,7 @@ html, body, #app {
|
|
|
0% {
|
|
|
transform: rotate(0);
|
|
|
}
|
|
|
+
|
|
|
100% {
|
|
|
transform: rotate(360deg);
|
|
|
}
|