|
@@ -1,29 +1,50 @@
|
|
|
<template>
|
|
|
<div class="invite-friends">
|
|
|
- <div class="txt">To open the treasure chest you need to share the URL to your friends. Make sure they finish
|
|
|
- the
|
|
|
- tasks.</div>
|
|
|
- <div class="area-url">
|
|
|
- <div class="url">{{ state.detail.inviteUrl }}</div>
|
|
|
- <div class="btn copy-btn" @click="clickCopy" v-click-log="state.log_invite_copy_btn_click"
|
|
|
+ <div class="invite-friends-content">
|
|
|
+ <div class="invite-friends-content-head">
|
|
|
+ <div class="title">Invite Friends to Open the Chest!</div>
|
|
|
+ <div class="info">Invitees need to be new fans of {{followUserStr}} to receive rewards</div>
|
|
|
+ </div>
|
|
|
+ <div class="invite-friends-content-body">
|
|
|
+ <img class="tips" v-if="state.active_share_channel" :src="require('@/assets/svg/icon-channel-tips.svg')" />
|
|
|
+
|
|
|
+ <div class="share-list" :class="{'share-list-active': state.active_share_channel}">
|
|
|
+ <div v-for="(item, index) in state.share_list" :key="index" :data-clipboard-text="item.inviteContent"
|
|
|
+ @click="clickShare(item)" class="share-item">
|
|
|
+ <img :src="item.iconPath" />
|
|
|
+ <div class="name">
|
|
|
+ {{item.name}}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="share-item copy-btn" @click="clickCopy" v-click-log="state.log_invite_copy_btn_click"
|
|
|
:data-clipboard-text="state.detail.inviteCopyUrl">
|
|
|
- Copy
|
|
|
+ <img :src="require('@/assets/svg/icon-copy-url-teasure.svg')" alt="">
|
|
|
+ <div class="name">
|
|
|
+ Copy URL
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="share-list">
|
|
|
- <img :src="item.iconPath" alt="" v-for="item in state.share_list" :data-clipboard-text="item.inviteContent"
|
|
|
- @click="clickShare(item)" class="share-item" />
|
|
|
</div>
|
|
|
- <v-btn :txt="state.open_btn.txt" :font-size="'17px'" class="btn" :icon="false"
|
|
|
+ </div>
|
|
|
+ <v-btn :txt="state.open_btn.txt" :font-size="'17px'" class="btn" :icon="false"
|
|
|
:disabled="state.open_btn.disabled" v-show-log="state.log_invite_btn_show" :loading="state.btn_loading"
|
|
|
v-click-log="state.log_invite_btn_click" @onClick="clickBtn" font-weight="600"></v-btn>
|
|
|
-
|
|
|
+ <div class="mask" v-show="showShareTips">
|
|
|
+ <div class="content">
|
|
|
+ <img class="icon-loading" :src="require('@/assets/svg/icon-tweet-loading.svg')" />
|
|
|
+ <div class="text">
|
|
|
+ Link copied to clipboard
|
|
|
+ <br/>
|
|
|
+ Opening {{selectShareApp.name }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script setup>
|
|
|
import VBtn from '@/view/iframe/treasure-hunt/components/btn.vue'
|
|
|
import { inviteChannel } from '@/http/treasure'
|
|
|
-import { inject, onMounted } from 'vue'
|
|
|
+import { inject, onMounted, ref } from 'vue'
|
|
|
import Report from "@/log-center/log"
|
|
|
import { getFrontConfig } from "@/http/account";
|
|
|
import { faceShareRedirectUrl } from '@/http/configAPI'
|
|
@@ -70,12 +91,28 @@ let facebookAppConfig = {
|
|
|
faceShareRedirectUrl
|
|
|
};
|
|
|
|
|
|
+let selectShareApp = ref({});
|
|
|
+let showShareTips = ref(false);
|
|
|
+let followUserStr = ref('');
|
|
|
+
|
|
|
onMounted(() => {
|
|
|
state.btn_loading = false
|
|
|
setFrontConfig();
|
|
|
- initInviteChannel()
|
|
|
+ initInviteChannel();
|
|
|
+ getFollowUserStr();
|
|
|
})
|
|
|
|
|
|
+const getFollowUserStr = () => {
|
|
|
+ let arr = [];
|
|
|
+ if(state.follows && state.follows.length) {
|
|
|
+ for(let i = 0; i < state.follows.length; i++) {
|
|
|
+ let item = state.follows[i];
|
|
|
+ arr.push('@'+item.name);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ followUserStr.value = arr.join(" or ");
|
|
|
+}
|
|
|
+
|
|
|
chrome.management.onDisabled.addListener(() => {
|
|
|
initInviteChannel()
|
|
|
})
|
|
@@ -131,14 +168,17 @@ async function clickBtn() {
|
|
|
const clickShare = (item) => {
|
|
|
var clipboard = new ClipboardJS('.share-item');
|
|
|
clipboard.on('success', function (e) {
|
|
|
- state.toast.txt = 'Copy Successfully'
|
|
|
- state.toast.has_icon = true
|
|
|
- state.toast.show = true
|
|
|
- setTimeout(() => {
|
|
|
- state.toast.show = false
|
|
|
- }, 2000)
|
|
|
+ // state.toast.txt = 'Copy Successfully'
|
|
|
+ // state.toast.has_icon = true
|
|
|
+ // state.toast.show = true
|
|
|
+ // setTimeout(() => {
|
|
|
+ // state.toast.show = false
|
|
|
+ // }, 2000)
|
|
|
e.clearSelection();
|
|
|
})
|
|
|
+ showShareTips.value = true;
|
|
|
+ selectShareApp.value = item;
|
|
|
+
|
|
|
if (item.name == 'facebook') {
|
|
|
setChromeStorage({
|
|
|
shareFacebookData: JSON.stringify({
|
|
@@ -150,16 +190,23 @@ const clickShare = (item) => {
|
|
|
}
|
|
|
let url = `https://www.facebook.com/dialog/share?app_id=${facebookAppConfig.facebookAppId}&display=popup&href=${item.treasureInviteUrl}&redirect_uri=${facebookAppConfig.faceShareRedirectUrl}?params=${JSON.stringify(cbParams)}`;
|
|
|
|
|
|
- chrome.windows.create({
|
|
|
+ setTimeout(() => {
|
|
|
+ showShareTips.value = false;
|
|
|
+ chrome.windows.create({
|
|
|
width: 800,
|
|
|
- type: 'normal',
|
|
|
- url
|
|
|
- }, function (window) {
|
|
|
- })
|
|
|
+ type: 'normal',
|
|
|
+ url
|
|
|
+ }, function (window) {
|
|
|
+ })
|
|
|
+ }, 1000)
|
|
|
+
|
|
|
} else {
|
|
|
- chrome.tabs.create({
|
|
|
- url: item.redirectPath
|
|
|
- });
|
|
|
+ setTimeout(() => {
|
|
|
+ showShareTips.value = false;
|
|
|
+ chrome.tabs.create({
|
|
|
+ url: item.redirectPath
|
|
|
+ });
|
|
|
+ }, 1000)
|
|
|
}
|
|
|
Report.reportLog({
|
|
|
businessType: Report.businessType.buttonClick,
|
|
@@ -210,80 +257,131 @@ const clickCopy = () => {
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
.invite-friends {
|
|
|
- padding: 18px 16px 25px 16px;
|
|
|
+ padding: 9px 16px 16px 16px;
|
|
|
background: #fff;
|
|
|
+ box-sizing: border-box;
|
|
|
+
|
|
|
+ .invite-friends-content {
|
|
|
+ max-height: 242px;
|
|
|
+ overflow-y: auto;
|
|
|
+ margin-bottom: 10px;
|
|
|
+ padding: 0 6px;
|
|
|
+ box-sizing: border-box;
|
|
|
+
|
|
|
+ .invite-friends-content-head {
|
|
|
+ margin-bottom: 20px;
|
|
|
+ .title {
|
|
|
+ font-weight: 900;
|
|
|
+ font-size: 18px;
|
|
|
+ margin-bottom: 7px;
|
|
|
+ }
|
|
|
+ .info {
|
|
|
+ font-weight: 400;
|
|
|
+ font-size: 12px;
|
|
|
+ color: #7A7A7A;
|
|
|
+ }
|
|
|
|
|
|
- .txt {
|
|
|
- font-style: normal;
|
|
|
- font-weight: 500;
|
|
|
- font-size: 13px;
|
|
|
- line-height: 18px;
|
|
|
- /* or 129% */
|
|
|
- margin-bottom: 18.5px;
|
|
|
-
|
|
|
- letter-spacing: 0.3px;
|
|
|
+ }
|
|
|
|
|
|
- color: #000000;
|
|
|
- }
|
|
|
+ .invite-friends-content-body {
|
|
|
+ position: relative;
|
|
|
|
|
|
- .area-url {
|
|
|
- height: 70px;
|
|
|
- background: rgba(29, 155, 240, 0.01);
|
|
|
- border: 1px solid #1D9BF0;
|
|
|
- border-radius: 5px;
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- padding-left: 15px;
|
|
|
- padding-right: 11px;
|
|
|
- justify-content: space-between;
|
|
|
-
|
|
|
- .url {
|
|
|
- display: -webkit-box;
|
|
|
- -webkit-box-orient: vertical;
|
|
|
- -webkit-line-clamp: 3;
|
|
|
- overflow: hidden;
|
|
|
- width: 194px;
|
|
|
-
|
|
|
- color: #737373;
|
|
|
- font-weight: 400;
|
|
|
- font-size: 13px;
|
|
|
- white-space: normal;
|
|
|
-
|
|
|
- word-wrap: break-word;
|
|
|
-
|
|
|
- word-break: break-all;
|
|
|
+ .tips {
|
|
|
+ position: absolute;
|
|
|
+ top: -42px;
|
|
|
+ left: 0;
|
|
|
+ width: 146px;
|
|
|
}
|
|
|
|
|
|
- .btn {
|
|
|
- user-select: none;
|
|
|
- background: #1D9BF0;
|
|
|
- border-radius: 35px;
|
|
|
- width: 100px;
|
|
|
- text-align: center;
|
|
|
- line-height: 37px;
|
|
|
- height: 37px;
|
|
|
- font-weight: 700;
|
|
|
- font-size: 15px;
|
|
|
- color: #fff;
|
|
|
- cursor: pointer;
|
|
|
+ .share-list-active {
|
|
|
+ background: rgba(29, 155, 240, 0.1);
|
|
|
+ border: 1.5px solid #1D9BF0 !important;
|
|
|
+ border-radius: 10px;
|
|
|
}
|
|
|
- }
|
|
|
+ .share-list {
|
|
|
+ display: flex;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ width: 100%;
|
|
|
+ box-sizing: border-box;
|
|
|
+ border: 1.5px solid #fff;
|
|
|
+
|
|
|
+ .share-item {
|
|
|
+ user-select: none;
|
|
|
+ width: 20%;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ padding: 8px 4px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ border-radius: 12px;
|
|
|
|
|
|
- .share-list {
|
|
|
- margin-top: 20px;
|
|
|
- text-align: center;
|
|
|
- margin-bottom: 14px;
|
|
|
|
|
|
- img {
|
|
|
- user-select: none;
|
|
|
cursor: pointer;
|
|
|
- width: 33px;
|
|
|
- height: 33px;
|
|
|
- margin-right: 14px;
|
|
|
- border-radius: 100px;
|
|
|
+ img {
|
|
|
+ width: 40px;
|
|
|
+ height: 40px;
|
|
|
+ border-radius: 100px;
|
|
|
+ margin-bottom: 8px;
|
|
|
+ }
|
|
|
+ .name {
|
|
|
+ font-weight: 400;
|
|
|
+ font-size: 12px;
|
|
|
+ color: #898989;
|
|
|
+ width: 100%;
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis; //文本溢出显示省略号
|
|
|
+ white-space: nowrap;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .share-item:hover {
|
|
|
+ background: #E3E3E4;
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .mask {
|
|
|
+ position: fixed;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ width: 375px;
|
|
|
+ height: 100%;
|
|
|
+ background: rgba($color: #000000, $alpha: 0.9);
|
|
|
+ z-index: 1000;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+
|
|
|
+ .content {
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+
|
|
|
+ .icon-loading {
|
|
|
+ width: 60px;
|
|
|
+ height: 60px;
|
|
|
+ animation: loading 1.5 1s linear;
|
|
|
+ margin-bottom: 30px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .text {
|
|
|
+ font-weight: 600;
|
|
|
+ font-size: 17px;
|
|
|
+ color: #FFFFFF;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|
|
|
+ @keyframes loading {
|
|
|
+ 0% {
|
|
|
+ transform: rotate(0);
|
|
|
+ }
|
|
|
+
|
|
|
+ 100% {
|
|
|
+ transform: rotate(360deg);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|